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

1 line
628 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

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

(self.webpackChunk=self.webpackChunk||[]).push([[3317],{32464:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof=__webpack_require__(31468).default;(function(){if("function"!=typeof window.GGBApplet){var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var e={},t="5.0",n={},i=null,r=!1,o=!1,a=null,l=!1,s=null,c=null,u=0;u<arguments.length;u++){var h=arguments[u];if(null!==h)switch(_typeof(h)){case"number":t=h.toFixed(1);break;case"string":h.match(new RegExp("^[0-9]\\.[0-9]+$"))?t=h:a=h;break;case"object":void 0!==h.is3D?i=h:n=h;break;case"boolean":r=h,o=!0}}null===i&&(i={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},void 0===n.material_id||o||(r=!0)),null!==a&&void 0===n.id&&(n.id=a);var d="",p=!1,f=null,m=null,v=null,g=!1,y=null,b=null,x=null;void 0!==n.height&&(n.height=Math.round(n.height)),void 0!==n.width&&(n.width=Math.round(n.width));var w=function(e){return parseFloat(e)>4?parseFloat(e):5};function C(){try{return window.self!==window.top}catch(e){return!0}}function k(){return(!n.hasOwnProperty("screenshotGenerator")||!n.screenshotGenerator)&&Math.max(screen.width,screen.height)<800}e.setHTML5Codebase=function(e,t){c=e,R(e,t)},e.setJavaCodebase=e.setJavaCodebaseVersion=e.isCompiledInstalled=e.setPreCompiledScriptPath=e.setPreCompiledResourcePath=function(){},e.setHTML5CodebaseVersion=function(e,t){var n=parseFloat(e);NaN!==n&&n<5?console.log("The GeoGebra HTML5 codebase version "+n+" is deprecated. Using version latest instead."):(s=e,O(e,t))},e.getHTML5CodebaseVersion=function(){return m},e.getParameters=function(){return n},e.setFontsCSSURL=function(e){x=e},e.setGiacJSURL=function(e){},e.setJNLPFile=function(e){e},e.setJNLPBaseDir=function(e){},e.inject=function(){function t(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var i,r="auto",o=n.id,a=!1,s=0;s<arguments.length;s++){var c=arguments[s];"string"==typeof c?(c=c.toLowerCase()).match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?r=c:o=arguments[s]:"boolean"==typeof c?a=c:c instanceof HTMLElement&&(i=c)}function u(){if(l){r=_(r);var s=i||document.getElementById(o);if(s)if(e.removeExistingApplet(s,!1),void 0===n.width&&s.clientWidth&&(n.width=s.clientWidth),void 0===n.height&&s.clientHeight&&(n.height=s.clientHeight),n.width&&n.height||"html5"!==r||(delete n.width,delete n.height),f=r,"screenshot"===r)A(s,n);else{var c=!1;n.hasOwnProperty("playButton")&&n.playButton||n.hasOwnProperty("clickToLoad")&&n.clickToLoad?c=!0:n.hasOwnProperty("playButtonAutoDecide")&&n.playButtonAutoDecide&&(c=(!C()||t())&&k()),c?(f="screenshot",P(s,n,a,r)):L(s,n,a)}else console.log("possibly bug on ajax loading? ")}else setTimeout(u,200)}u()},e.getViews=function(){return i},e.isJavaInstalled=function(){return!1};var S=function(t){var r=function(){n.onError&&n.onError(),j("Error: Fetching material (id "+n.material_id+") failed.",n)},o=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",a="/materials/"+n.material_id+"?scope=basic";M("https://"+o+"/api/proxy.php?path="+encodeURIComponent(a),(function(o){var a=JSON.parse(o),l=a.elements?a.elements.filter((function(e){return"G"==e.type||"E"==e.type}))[0]:a;if(l&&l.url){n.fileName=l.url,E(l.settings||{}),i.is3D=!0;var s="https://www.geogebra.org/images/";e.setPreviewImage(y||l.previewUrl,s+"GeoGebra_loading.png",s+"applet_play.png"),t()}else r()}),r)};function E(e){["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach((function(t){e[t]=!!e[t]})),["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"].forEach((function(t){void 0===n[t]&&void 0!==e[t]&&(n[t]=e[t])})),void 0===n.showToolBarHelp&&(n.showToolBarHelp=n.showToolBar)}function M(e,t,n){var i=new XMLHttpRequest;i.open("GET",e),i.onload=function(){t(i.responseText)},i.onerror=n,i.send()}e.isHTML5Installed=function(){return!0},e.getLoadedAppletType=function(){return f},e.setPreviewImage=function(e,t,n){y=e,b=t,n},e.removeExistingApplet=function(e,t){var i;"string"==typeof e&&(e=document.getElementById(e)),f=null;var r=null;for(i=0;i<e.childNodes.length;i++){var o=e.childNodes[i],a=o.className;"applet_screenshot"===a?t?(o.style.display="block",f="screenshot"):o.style.display="none":"applet_scaler prerender"!==a&&(e.removeChild(o),r=a&&-1!=a.indexOf("appletParameters")?o.id:null,i--)}var l=void 0!==n.id?n.id:r,s=window[l];s&&"function"==typeof s.getBase64&&(s.remove(),window[l]=null)},e.refreshHitPoints=function(){if(w(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var t=e.getAppletObject();return!(!t||"function"!=typeof t.recalculateEnvironments)&&(t.recalculateEnvironments(),!0)},e.startAnimation=function(){var t=e.getAppletObject();return!(!t||"function"!=typeof t.startAnimation)&&(t.startAnimation(),!0)},e.stopAnimation=function(){var t=e.getAppletObject();return!(!t||"function"!=typeof t.stopAnimation)&&(t.stopAnimation(),!0)},e.getAppletObject=function(){var e=void 0!==n.id?n.id:"ggbApplet";return window[e]},e.resize=function(){};var T=function(e){return e&&"false"!==e},L=function(t,n,i){w(m)<=4.2&&(i=!0);var r=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==m||ggbHTML5LoadedCodebaseIsWebSimple&&!g)&&(r=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var o=document.createElement("div");o.classList.add("appletParameters","notranslate");var a=n.width,l=n.height;if(n.disableAutoScale=void 0===n.disableAutoScale?GGBAppletUtils.isFlexibleWorksheetEditor():n.disableAutoScale,void 0!==n.width)if(w(m)<=4.4)T(n.showToolBar)&&(n.height-=7),T(n.showAlgebraInput)&&(n.height-=37),n.width<605&&T(n.showToolBar)&&(n.width=605,a=605);else{var u=100;(T(n.showToolBar)||T(n.showMenuBar))&&(n.hasOwnProperty("customToolBar")&&(n.customToolbar=n.customToolBar),u=T(n.showMenuBar)?245:155),a<u&&(n.width=u,a=u)}for(var h in o.style.border="none",o.style.display="inline-block",n)n.hasOwnProperty(h)&&"appletOnLoad"!==h&&o.setAttribute("data-param-"+h,n[h]);x&&o.setAttribute("data-param-fontscssurl",x),e.resize=function(){GGBAppletUtils.responsiveResize(t,n)},window.addEventListener("resize",(function(t){e.resize()}));var p="function"==typeof n.appletOnLoad?n.appletOnLoad:function(){};if(i||void 0===n.width){var f=document.createElement("div");f.className="applet_scaler",f.style.position="relative",f.style.display="block",f.appendChild(o),t.appendChild(f),n.appletOnLoad=function(t){e.resize(),p(t)}}else{n.hasOwnProperty("showSplash")||o.setAttribute("data-param-showSplash","false");var y=t.querySelector(".applet_scaler.prerender"),b=null!==y;if(b)C=y.querySelector(".ggb_preview");else{var C=B(a,l,n.borderColor,!1);(y=document.createElement("div")).className="applet_scaler",y.style.position="relative",y.style.display="block",y.style.width=a+"px",y.style.height=l+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(y,"66%"),w(m)>=5?(n.appletOnLoad=function(e){var n=t.querySelector(".ggb_preview");n&&n.parentNode.removeChild(n),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(y),window.GGBT_wsf_view&&$(window).trigger("resize"),p(e)},b||y.appendChild(C)):o.appendChild(C),y.appendChild(o),b||t.appendChild(y),setTimeout((function(){e.resize()}),1)}function k(e,t){t&&"function"==typeof t.appletOnLoad&&"function"==typeof renderGGBElement?renderGGBElement(e,t.appletOnLoad):renderGGBElement(e),j("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",t)}function S(e,t){"undefined"==typeof renderGGBElement?(null===html5AppletsToProcess&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:e,params:t}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,null!==html5AppletsToProcess&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach((function(e){k(e.article,e.params)})),html5AppletsToProcess=null)},w(m)<5&&(e.className+=" geogebraweb")):k(e,t)}if(r){scriptLoadStarted=!0;for(var E=0;E<o.childNodes.length;E++){"TABLE"===o.childNodes[E].tagName&&(o.removeChild(o.childNodes[E]),E--)}if(null!==ggbHTML5LoadedScript){var M=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');null!=M&&M.parentNode.removeChild(M)}var L=document.createElement("script"),A=function(){S(o,n)};L.src=d+v,ggbHTML5LoadedCodebaseIsWebSimple=g,ggbHTML5LoadedCodebaseVersion=m,ggbHTML5LoadedScript=L.src,j("GeoGebra HTML5 codebase loaded: '"+d+"'.",n),c||s&&"5.0"!=s?d.requirejs?__webpack_require__.e(5803).then(function(){var e=[__webpack_require__(55803)];A.apply(null,e)}.bind(this)).catch(__webpack_require__.oe):(L.onload=A,t.appendChild(L)):(g?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),A())}else S(o,n);n.height=l,n.width=a},A=function(t,n,i){var r=B(n.width,n.height,n.borderColor,i),o=document.createElement("div");o.style.position="relative",o.style.display="block",o.style.width=n.width+"px",o.style.height=n.height+"px",o.className="applet_screenshot applet_scaler"+(i?" applet_screenshot_play":""),o.appendChild(r);var a=GGBAppletUtils.getScale(n,t,i);i?(t.appendChild(N()),window.GGBT_wsf_view||(t.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(o,"66%"),t.appendChild(o),1===a||isNaN(a)||(GGBAppletUtils.scaleElement(o,a),o.style.width=n.width+"px",o.style.height=n.height+"px",o.parentNode.style.width=n.width*a+"px",o.parentNode.style.height=n.height*a+"px"),e.resize=function(){D(t,r,o,i)},window.addEventListener("resize",(function(t){e.resize()})),e.resize()};function D(e,t,i,r){if(e.contains(t)){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if("fullscreencontent"!==e.id)return;window.GGBT_wsf_view.setCloseBtnPosition(e)}var o=GGBAppletUtils.getScale(n,e,r);null!==i.parentNode&&(isNaN(o)||1===o?(GGBAppletUtils.scaleElement(i,1),i.parentNode.style.width=n.width+"px",i.parentNode.style.height=n.height+"px"):(GGBAppletUtils.scaleElement(i,o),i.parentNode.style.width=n.width*o+"px",i.parentNode.style.height=n.height*o+"px")),"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(e),"object"===_typeof(window.GGBT_ws_header_footer)&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}e.onExitFullscreen=function(e,t){t.appendChild(e)};var P=function(e,t,n,i){A(e,t,!0);for(var r=function(){var n=[];for(a=0;a<e.childNodes.length;a++)n.push(e.childNodes[a]);if(window.GGBT_wsf_view){var r=window.GGBT_wsf_view.renderFullScreen(e,t.id),o=document.getElementById("fullscreencontainer"),l=jQuery(e).find(".fullscreencontent");l.length>0?(r.remove(),l.attr("id","fullscreencontent").show(),jQuery(o).append(l),window.dispatchEvent(new Event("resize"))):L(r,t,!1),window.GGBT_wsf_view.launchFullScreen(o)}else f=i,L(e,t,!1);if(!window.GGBT_wsf_view)for(a=0;a<n.length;a++)e.removeChild(n[a])},o=e.getElementsByClassName("ggb_preview_play"),a=0;a<o.length;a++)o[a].addEventListener("click",r,!1),o[a].addEventListener("ontouchstart",r,!1);"function"==typeof window.ggbAppletPlayerOnload&&window.ggbAppletPlayerOnload(e),k()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},N=function(){var e=document.createElement("div");if(e.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var t='.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");}',n=document.createElement("style");n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(n)}return e},B=function(e,t,n,i){var r=document.createElement("div");r.className="ggb_preview",r.style.position="absolute",r.style.zIndex="90",r.style.width=e-2+"px",r.style.height=t-2+"px",r.style.top="0px",r.style.left="0px",r.style.overflow="hidden",r.style.backgroundColor="white";var o="lightgrey";void 0!==n&&(o="none"===n?"transparent":n),r.style.border="1px solid "+o;var a,l,s,c=document.createElement("img");if((c.style.position="relative",c.style.zIndex="1000",c.style.top="-1px",c.style.left="-1px",null!==y&&c.setAttribute("src",y),c.style.opacity=.7,null!==b)&&!i){(a=document.createElement("img")).style.position="absolute",a.style.zIndex="1001",a.style.opacity=1,c.style.opacity=.3,(l=360)>e/4*3&&(l=e/4*3),s=l/5.8,a.setAttribute("src",b),a.setAttribute("width",l),a.setAttribute("height",s);var u=(e-l)/2,h=(t-s)/2;a.style.left=u+"px",a.style.top=h+"px",r.appendChild(a)}return r.appendChild(c),r},_=function(e){return"html5"===(e=e.toLowerCase())||"screenshot"===e?e:"html5"},I=["web","webSimple","web3d","tablet","tablet3d","phone"],O=function(e,t){if(m=e,t)R(m,!0);else{var o,a,l=!r;if(l){var s=w(m);!isNaN(s)&&s<4.4&&(l=!1)}o="http"===window.location.protocol.substr(0,4)?window.location.protocol:"http:";var c=m.indexOf("//");for(var u in a=c>0?m:0===c?o+m:"https://www.geogebra.org/apps/5.2.814.0/",I)if(m.slice(-1*I[u].length)===I[u]||m.slice(-1*(I[u].length+1))===I[u]+"/")return void R(a,!1);GGBAppletUtils.isFlexibleWorksheetEditor()||!l||i.is3D||i.AV||i.SV||i.CV||i.EV2||i.CP||i.PC||i.DA||i.FI||i.PV||T(n.showToolBar)||T(n.showMenuBar)||T(n.showAlgebraInput)||T(n.enableRightClick)||n.appName&&"classic"!=n.appName?a+="web3d/":a+="webSimple/",R(a,!1)}},R=function(e,t){if(e.requirejs)d=e;else{"/"!==e.slice(-1)&&(e+="/"),d=e,null===t&&(t=-1===e.indexOf("http")),p=t,v="web.nocache.js",g=!1;var n=d.split("/");n.length>1&&(t||"webSimple"!==n[n.length-2]?I.indexOf(n[n.length-2])>=0&&(v=n[n.length-2]+".nocache.js"):(v="webSimple.nocache.js",g=!0)),n=e.split("/"),"test"===(m=n[n.length-3]).substr(0,4)?m=m.substr(4,1)+"."+m.substr(5,1):"war"!==m.substr(0,3)&&"beta"!==m.substr(0,4)||(m="5.0");var i=parseFloat(m);NaN!==i&&i<5&&e.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+i+" is deprecated. Using version latest instead."),O("5.0",t))}},j=function(e,t){window.console&&window.console.log&&(!t||void 0===t.showLogging||t.showLogging&&"false"!==t.showLogging)&&console.log(e)};function F(){var e=t;null!==s?e=s:parseFloat(e)<5&&(e="5.0"),O(e,!1),null!==c&&R(c,p),l=!0}return void 0!==n.material_id?S(F):F(),e},GGBAppletUtils=function(){"use strict";function e(){return void 0!==window.GGBT_wsf_edit}function t(e,t){1!=t?(e.style.transformOrigin="0% 0% 0px",e.style.webkitTransformOrigin="0% 0% 0px",e.style.transform="scale("+t+","+t+")",e.style.webkitTransform="scale("+t+","+t+")",e.style.maxWidth="initial",null!==e.querySelector(".ggb_preview")&&(e.querySelector(".ggb_preview").style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[0]&&(e.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[1]&&(e.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(e.style.transform="none",e.style.webkitTransform="none")}function n(e,t,n,i,r){if(e.isScreenshoGenerator)return 1;var o,a=void 0!==i&&i,l=null!=e.noScaleMargin&&e.noScaleMargin,s=(o=e.autoHeight)&&"false"!==o,c=function(e,t,n,i,r,o){var a=null;if(null!=o&&""!=o)for(var l=e.parentNode;null!=l;){if((" "+l.className+" ").indexOf(" "+o+" ")>-1){a=l;break}l=l.parentNode}var s=0,c=0,u=0,h=0,d=0,p=0,f=0;if(a)s=a.offsetWidth,c=Math.max(i?a.offsetWidth:0,a.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(s=Math.min(window.innerWidth,document.documentElement.clientWidth),c=Math.min(window.innerHeight,document.documentElement.clientHeight),u=s):(s=window.innerWidth,c=window.innerHeight,u=window.innerWidth),e){var m=e.getBoundingClientRect();m.left>0&&m.left<=s&&(void 0===r||!r)&&("rtl"===document.dir?(d=s-m.width-m.left,p=u<=480?10:30):(p=m.left,d=u<=480?10:30),h=p+d)}e&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(e.getBoundingClientRect(),"closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(h=40,f=0):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(h=0,f=40))}return e&&((void 0===n||!n)&&t>0&&t+h<s?s=t:s-=h,"object"!==_typeof(window.GGBT_wsf_view)||!window.GGBT_wsf_view.isFullscreen()||void 0!==n&&n||(c-=f)),{width:s,height:c}}(t,e.width,n,s,a&&window.GGBT_wsf_view||l,r),u=parseInt(c.width),h=e.width,d=e.height;if(void 0===h){var p=t.querySelector(".appletParameters");p&&(h=p.offsetWidth,d=p.offsetHeight)}var f=u/h,m=a?1:c.height/d;return void 0===n||n||(f=Math.min(1,f),m=Math.min(1,m)),Math.min(f,m)}function i(e,t,i){var r,o=1,a=!1;return e.hasOwnProperty("allowUpscale")&&(a=e.allowUpscale),e.hasOwnProperty("scale")&&(o=parseFloat(e.scale),(isNaN(o)||null===o||0===o)&&(o=1),o>1&&(a=!0)),t&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(a=!0),e.hasOwnProperty("disableAutoScale")&&e.disableAutoScale?o:(r=n(e,t,a,i,e.scaleContainerClass),!a||e.hasOwnProperty("scale")&&1!==o?Math.min(o,r):r)}function r(e){var t=Math.min(window.innerWidth,document.documentElement.clientWidth),n=Math.min(window.innerHeight,document.documentElement.clientHeight),i=e.getBoundingClientRect(),r=(t-i.width)/2,o=(n-i.height)/2;o<0&&(o=0),e.style.position="relative","closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(e.style.left=r<40?"40px":r+"px",e.style.top=o+"px"):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(e.style.top=o<40?"40px":o+"px",e.style.left=r+"px")}return{responsiveResize:function(n,o){var a=n.querySelector(".appletParameters");if(a){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if(o.id!==a.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(n)}if(a.parentElement&&/fullscreen/.test(a.parentElement.className))return;var l=i(o,n);e()&&a.setAttribute("data-param-scale",l);for(var s=null,c=0;c<n.childNodes.length;c++)if(void 0!==n.childNodes[c].className&&n.childNodes[c].className.match(/^applet_scaler/)){s=n.childNodes[c];break}if(null!==s&&null!==s.querySelector(".noscale"))return;var u=void 0!==o.id?o.id:"ggbApplet",h=window[u];null!=h&&h.recalculateEnvironments||null===s||s.className.match(/fullscreen/)||(s.parentNode.style.transform="",isNaN(l)||1===l?(t(s,1),s.parentNode.style.width=o.width+"px",s.parentNode.style.height=o.height+"px"):(s.parentNode.style.width=o.width*l+"px",s.parentNode.style.height=o.height*l+"px",t(s,l))),"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&r(n),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(a).parents(".content-added-content"))}},isFlexibleWorksheetEditor:e,positionCenter:r,getScale:i,scaleElement:t}}();__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return GGBApplet}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(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 e=n.location.search;return-1!=e.indexOf(J)||-1!=e.indexOf(K)}function q(e,t){}q(H,I),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||{},t;function u(){return v(),t}function v(){if(!t){var e=o.createElement(Q);if(e.id=L,e.style.cssText=R+S,e.tabIndex=-1,o.body.appendChild(e),t=e.contentWindow.document,-1==navigator.userAgent.indexOf(T)){t.open();var n=document.compatMode==U?V:W;t.write(n+X),t.close()}}}function w(e){q(cb,eb),function(e){function t(){return _typeof(o.readyState)==Y?_typeof(o.body)!=Y&&null!=o.body:/loaded|complete/.test(o.readyState)}var n=t();if(n)e();else{o.addEventListener&&o.addEventListener(Z,r,!1);var i=setInterval((function(){r()}),$)}function r(){if(!n){if(!t())return;n=!0,e(),o.removeEventListener&&o.removeEventListener(Z,r,!1),i&&clearInterval(i)}}}((function(){var t,n,i,r;t=e,n=u(),i=n.body,(r=n.createElement(_)).language=ab,r.crossOrigin=W,r.src=t,webModule.__errFn&&(r.onerror=function(){webModule.__errFn(L,new Error(bb+t))}),i.appendChild(r),q(cb,db)}))}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(e){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(e){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(e){var t=c[e];return null==t?null:t},r=d,webModule.__errFn=e}function B(){function e(e){var t=e.lastIndexOf(rb);-1==t&&(t=e.length);var n=e.indexOf(sb);-1==n&&(n=e.length);var i=e.lastIndexOf(tb,Math.min(n,t));return i>=O?e.substring(O,i+P):W}var t,n=null!=(t=__gwt_getMetaProperty(wb))?t:W;return n==W&&(n=function(){for(var t=o.getElementsByTagName(_),n=O;n<t.length;++n)if(-1!=t[n].src.indexOf(xb))return e(t[n].src);return W}()),n==W&&(n=function(){var e=o.getElementsByTagName(yb);return e.length>O?e[e.length-P].href:W}()),n==W&&function(){var e=o.location;return e.href==e.protocol+zb+e.host+e.pathname+e.search+e.hash}()&&(n=e(o.location.href)),n=function(t){if(t.match(/^\w+:\/\//));else{var n=o.createElement(ub);n.src=t+vb,t=e(n.src)}return t}(n),n}function C(e){return e.match(/^\//)||e.match(/^[a-zA-Z]+:\/\//)?e:webModule.__moduleBase+e}function D(){var e,t=O,i=[],o=[];function a(e){var t=o[e](),n=i[e];if(t in n)return t;var a=[];for(var l in n)a[n[l]]=l;throw r&&r(e,a,t),null}if(__gwt_isKnownPropertyValue=function(e,t){return t in i[e]},webModule.__getPropMap=function(){var e={};for(var t in i)i.hasOwnProperty(t)&&(e[t]=a(t));return e},webModule.__computePropValue=a,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);try{var l=(e=Cb).indexOf(Db);-1!=l&&(t=parseInt(e.substring(l+P),$),e=e.substring(O,l))}catch(e){}return webModule.__softPermutationId=t,C(e+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}s[L]={moduleName:L},webModule.__moduleStartupDone=function(e){var t=s[L].bindings;s[L].bindings=function(){for(var n=t?t():{},i=e[webModule.__softPermutationId],r=O;r<i.length;r++){var o=i[r];n[o[O]]=o[P]}return n}},webModule.__startLoadingFragment=function(e){return C(e)},webModule.__installRunAsyncCode=function(e){var t=u(),n=t.body,i=t.createElement(_);i.language=ab,i.text=e,n.appendChild(i),n.removeChild(i)},A(),webModule.__moduleBase="/react/build/js/mathematicalGraphics/"+name+"/",s[L].moduleBase=webModule.__moduleBase;var G=D();return F(),w(G),!0}return webModule},"function"!=typeof window.web3d&&(window.web3d=GGBAppletUtils.makeModule("web3d","A18F540516513B1292CA7CEF2F6AFC7E")),"function"!=typeof window.webSimple&&(window.webSimple=GGBAppletUtils.makeModule("webSimple","96B09BF1B436BF53F0DF54116700F16A")),window.GGBApplet=GGBApplet}else console.warn("deployggb.js was loaded twice")})()},78988:function(e,t,n){"use strict";function i(e){var t=!0;if(e.length>0){for(var n=0;n<e.length;n++)if(0==e[n].compile_success||!e[n].compile_success){t=!1;break}}else t=!1;return t}function r(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=[],i=0;i<e.length;i++){var r=e[i],o=t?"".concat(t,"/").concat(r.name):"".concat(r.name);n.push({title:r.name,type:r.type,isLeaf:"tree"!==r.type,key:o})}return n}function o(e,t,n){for(var i=0;i<e.length;i++){var r=e[i];if(r.key===t){r.children=n;break}r.children&&o(r.children,t,n)}return e}function a(e,t,n){var i;return function(){var r=this,o=arguments,a=function(){i=null,n||e.apply(r,o)},l=n&&!i;clearTimeout(i),i=setTimeout(a,t),l&&e.apply(r,o)}}n.d(t,{Ax:function(){return o},Ds:function(){return a},KI:function(){return l},SI:function(){return r},f1:function(){return i}});var l=n(91689).Z.API_SERVER},11933:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var i=n(7557),r=n.n(i),o=n(41498),a=n.n(o),l=n(79800),s=n.n(l),c=n(59301),u="imageDimensions___a7crR",h="img___Kroat",d="fullWidth___c492T",p=n(92310),f=n.n(p),m=n(29787),v=n(2859),g=n(94171),y=n(83287),b=n(37712),x=function(e){var t=e.data,n=e.className,i=e.fullWidth,o=e.style,l=void 0===o?{}:o,p=e.onClose,x=e.onOk,w=e.showFullTools,C=e.noAssociationId,k=(0,c.useRef)(null),S=(0,c.useRef)(null),E=(0,c.useRef)(null),M=(0,c.useRef)(null),T=(0,c.useState)(!1),L=s()(T,2),A=L[0],D=L[1],P=(0,c.useState)("正在加载中"),N=s()(P,2),B=N[0],_=N[1];(0,c.useEffect)((function(){return E.current||(E.current=document.createElement("style"),document.head.appendChild(E.current)),null!=t&&t.visible?(document.body.setAttribute("data-custom","y-hidden"),E.current.innerHTML=" html { overflow-y: hidden; }",null!=t&&t.src&&I()):(document.body.removeAttribute("data-custom"),E.current&&(document.head.removeChild(E.current),E.current=null)),function(){document.body.removeAttribute("data-custom"),E.current&&(document.head.removeChild(E.current),E.current=null)}}),[null==t?void 0:t.visible]);var I=function(){var e=a()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return D(!0),_("正在加载中"),e.next=4,(0,y.ZJ)(null==t?void 0:t.src);case 4:n=e.sent,k.current.src="",k.current.src=n,k.current.onload=function(){R()},D(!1),_("");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),O=function(){var e=a()(r()().mark((function e(n){var i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return D(!0),_("正在保存中"),e.next=4,(0,g.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:t.title,file:n.dataUrl}});case 4:if(null==(i=e.sent)||!i.id||C){e.next=12;break}return e.next=8,(0,g.ZP)("/api/attachments/".concat(t.id,"/add_subitem.json"),{method:"post",body:{subitem_id:null==i?void 0:i.id,settings:JSON.stringify(n.state)}});case 8:0===e.sent.status&&x(),e.next=13;break;case 12:null!=i&&i.id&&x(i);case 13:D(!1),_("");case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),R=function(){S.current=new v.hP(k.current),S.current.targetRoot=M.current,S.current.addEventListener("render",O),S.current.addEventListener("beforeclose",p),w&&(S.current.availableMarkerTypes=S.current.ALL_MARKER_TYPES,S.current.uiStyleSettings.redoButtonVisible=!0,S.current.uiStyleSettings.notesButtonVisible=!0,S.current.uiStyleSettings.zoomButtonVisible=!0,S.current.uiStyleSettings.zoomOutButtonVisible=!0,S.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=S.current.uiStyleSettings,S.current.show(),null!=t&&t.snapshotData&&S.current.restoreState(t.snapshotData),setTimeout((function(){var e;window.scrollTo(0,0),(e=document.querySelector('a[href="https://markerjs.com/"]'))&&e.parentNode&&(e.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"选择"},{name:'[data-action="delete"]',title:"删除元素"},{name:'[data-action="undo"]',title:"撤销"},{name:'[data-type-name="FrameMarker"]',title:"矩形"},{name:'[data-type-name="FreehandMarker"]',title:"画线"},{name:'[data-type-name="ArrowMarker"]',title:"箭头"},{name:'[data-type-name="TextMarker"]',title:"文本"},{name:'[data-type-name="EllipseMarker"]',title:"椭圆"},{name:'[data-type-name="HighlightMarker"]',title:"方块"},{name:'[data-type-name="CalloutMarker"]',title:"注释"},{name:'[data-action="render"]',title:"保存"},{name:'[data-action="close"]',title:"退出"}].forEach((function(e){var t=document.querySelector(e.name);t&&t.setAttribute("title",e.title)}))}),300)};return(0,b.jsx)(c.Fragment,{children:(null==t?void 0:t.visible)&&(0,b.jsx)(m.Z,{spinning:A,tip:B,style:{position:"absolute",width:"100vw"},children:(0,b.jsx)("div",{ref:M,className:f()(u,n,i?d:""),style:l,children:(0,b.jsx)("img",{className:h,ref:k})})})})}},55893:function(e,t,n){"use strict";var i=n(59301),r=n(77019),o=n(5269),a=n(20554),l=n(99571),s=n(74889),c=n(21697),u=(n(48136),n(37712)),h=(0,i.forwardRef)((function(e,t){var n=e.callback,h=e.showSaveButton,d=e.value,p=void 0===d?"":d,f=(0,i.useRef)(),m=function(e){f.current.setValue(f.current.getValue()+" "+e.value+" ")},v=[{key:"1",label:"快捷模板",children:(0,u.jsx)(r.Z,{className:c.Z.lists,gutter:[10,10],children:[{name:"分数得分",value:"\\frac{x}{y}",children:[{name:"分数 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:"导数 Derivative",data:[{value:"\\dot{a} "},{value:"\\ddot{a}"},{value:"{f}^{\\prime}"},{value:"{f}^{\\prime\\prime}"},{value:"{f}^{(n)}"}]},{name:"模算术 Modular arithmetic",data:[{value:"a \\bmod b"},{value:"a \\equiv b \\pmod{m} "},{value:"\\gcd(m, n) "},{value:"\\operatorname{lcm}(m, n) "}]}]},{name:"根式角标",value:"\\sqrt{x}",children:[{name:"根式 Radicals",data:[{value:"\\sqrt{x}"},{value:"\\sqrt[y]{x}"}]},{name:"上下标 Sub&Super",data:[{value:"x^{a}"},{value:"x_{a}"},{value:"x_{a}^{b} "},{value:"_{a}^{b} x"},{value:"x_{a}^{b} "}]},{name:"重音符及其他 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:"极限对数",value:"\\lim_{x \\to 0}",children:[{name:"极限 Limits",data:[{value:"\\lim a"},{value:"\\lim_{x \\to 0}"},{value:"\\lim_{x \\to \\infty}"},{value:"\\max_b{a}"},{value:"\\min_a{b}"}]},{name:"对数指数 Logarithms and exponentials",data:[{value:"\\log_{a}{b}"},{value:"\\lg_{a}{b}"},{value:"\\ln_{a}{b}"},{value:"\\exp a"}]},{name:"界限 Bounds",data:[{value:"\\min x"},{value:"\\sup t"},{value:"\\inf s"},{value:"\\lim u"},{value:"\\limsup w"},{value:"\\dim p"},{value:"\\ker\\phi "}]}]},{name:"三角函数",value:"\\sin a",children:[{name:"三角函数 Trigonometric functions",data:[{value:"\\sin a"},{value:"\\cos a"},{value:"\\tan a"},{value:"\\cot a "},{value:"\\sec a "},{value:"\\csc a "}]},{name:"反三角函数 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:"双曲函数 Hyperblic functions",data:[{value:"\\sinh a"},{value:"\\cosh a"},{value:"\\tanh a"},{value:"\\coth a"},{value:"\\operatorname{sech} a"},{value:"\\operatorname{csch} a"}]},{name:"反双曲函数 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:"积分运算",value:"\\int_{a}^{b}",children:[{name:"积分 Integral",data:[{value:"\\int"},{value:"\\int_{a}^{b}"},{value:"\\int\\limits_{a}^{b}"}]},{name:"双重积分 Double integral",data:[{value:"\\iint"},{value:"\\iint_{a}^{b} "},{value:"\\iint\\limits_{a}^{b} "}]},{name:"三重积分 Triple integral",data:[{value:"\\iiint"},{value:"\\iiint_{a}^{b}"},{value:"\\iiint\\limits_{a}^{b} "}]},{name:"曲线积分 Closed line or path integral",data:[{value:"\\oint"},{value:"\\oint_{a}^{b} "}]}]},{name:"大型运算",value:"\\sum_{a}^{b}",children:[{name:"求和 Summation",data:[{value:"\\sum"},{value:"\\sum_{a}^{b}"},{value:"{\\textstyle \\sum_{a}^{b}} "}]},{name:"乘积余积 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:"并集交集 Union and intersection",data:[{value:"\\bigcup"},{value:"\\bigcup_{a}^{b}"},{value:"{\\textstyle \\bigcup_{a}^{b}}"},{value:"\\bigcap"},{value:"\\bigcap_{a}^{b}"}]},{name:"析取合取 Disjunction and conjunction",data:[{value:"\\bigvee"},{value:"\\bigvee_{a}^{b}"},{value:"\\bigwedge"},{value:"\\bigwedge_{a}^{b}"}]}]},{name:"括号取整",value:"\\left [ \\left ( \\right ) \\right ] ",children:[{name:"括号 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 "}]}]}].map((function(e,t){return(0,u.jsxs)(o.Z,{flex:"110px",className:c.Z.item,children:[(0,u.jsxs)("div",{children:[(0,u.jsx)(s.Z,{value:"$$".concat(e.value,"$$")}),e.name]}),(0,u.jsx)("div",{className:c.Z.children,children:e.children.map((function(e,t){return(0,u.jsxs)("div",{children:[(0,u.jsx)("h1",{children:e.name}),(0,u.jsx)(r.Z,{gutter:[10,10],children:e.data.map((function(e,t){return(0,u.jsx)(o.Z,{onClick:function(){return m(e)},className:c.Z.diamond,children:(0,u.jsx)(s.Z,{value:"`$$"+e.value+"$$`"})},t)}))})]},t)}))})]})}))})},{key:"2",label:"公式模板",children:(0,u.jsx)(r.Z,{className:c.Z.lists,gutter:[10,10],children:[{name:"代数",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\n x=a + r\\text{cos}\\theta \\ \r\n y=b + r\\text{sin}\\theta \r\n\\end{matrix}\\right. "},{value:"\\begin{array}{l} \r\n \\text{对于方程形如:}x^{3}-1=0 \\ \r\n \\text{设}\\text{:}\\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r\n x_{1}=1,x_{2}= \\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r\n x_{3}= \\omega ^{2}=\\frac{-1-\\sqrt{3}i}{2} \r\n\\end{array} "},{value:"\\begin{array}{l} \r\n a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r\n \\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r\n \\left\\{\\begin{matrix} \r\n \\Delta \\gt 0\\text{方程有两个不相等的实根} \\ \r\n \\Delta = 0\\text{方程有两个相等的实根} \\ \r\n \\Delta \\lt 0\\text{方程无实根} \r\n\\end{matrix}\\right. \r\n\\end{array} "},{value:"\\begin{array}{l} \r\n a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r\n \\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r\n \\mathop{{x}}\\nolimits_{{1,2}}=\\frac{{-b \\pm \r\n \\sqrt{{\\mathop{{b}}\\nolimits^{{2}}-4ac}}}}{{2a}} \\ \r\n \\mathop{{x}}\\nolimits_{{1}}+\\mathop{{x}}\\nolimits_{{2}}=-\\frac{{b}}{{a}} \\ \r\n \\mathop{{x}}\\nolimits_{{1}}\\mathop{{x}}\\nolimits_{{2}}=\\frac{{c}}{{a}} \r\n\\end{array} "}]}]},{name:"几何",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\n a \\perp \\alpha \\ \r\n b \\perp \\alpha \r\n\\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\n \\Rightarrow a \\perp \\beta "},{value:"\\left.\\begin{matrix} \r\n a \\subset \\beta ,b \\subset \\beta ,a \\cap b=P \\ \r\n a \\parallel \\partial ,b \\parallel \\partial \r\n\\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\n m \\subset \\alpha ,n \\subset \\alpha ,m \\cap n=P \\ \r\n a \\perp m,a \\perp n \r\n\\end{matrix}\\right\\}\\Rightarrow a \\perp \\alpha "},{value:"\\begin{array}{c} \r\n \\text{直角三角形中,直角边长a,b,斜边边长c} \\ \r\n a^{2}+b^{2}=c^{2} \r\n\\end{array}"}]}]},{name:"不等式",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\n a \\gt b,c \\gt 0 \\Rightarrow ac \\gt bc \\ \r\n a \\gt b,c \\lt 0 \\Rightarrow ac \\lt bc \r\n\\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\n a \\gt b \\gt 0,n \\in N^{\\ast},n \\gt 1 \\ \r\n \\Rightarrow a^{n}\\gt b^{n}, \\sqrt[n]{a}\\gt \\sqrt[n]{b} \r\n\\end{array}"},{value:"\\left( \\sum_{k=1}^n a_k b_k \\right)^{\\!\\!2}\\leq \r\n\\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) "},{value:"\\begin{array}{c} \r\n a,b \\in R^{+} \\ \r\n \\Rightarrow \\frac{a+b}{{2}}\\ge \\sqrt{ab} \\ \r\n \\left( \\text{当且仅当}a=b\\text{时取“}=\\text{”号}\\right) \r\n\\end{array}"},{value:"\\begin{array}{c} \r\n a,b \\in R \\ \r\n \\Rightarrow a^{2}+b^{2}\\gt 2ab \\ \r\n \\left( \\text{当且仅当}a=b\\text{时取“}=\\text{”号}\\right) \r\n\\end{array}"},{value:"\\begin{array}{c} \r\n 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\n\\end{array}"}]}]},{name:"积分",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:"三角",value:"e^{i \\theta}",children:[{name:"求和 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:"统计",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\n \\text{若}P \\left( AB \\right) =P \\left( A \\right) P \\left( B \\right) \\\\ \r\n \\text{则}P \\left( A \\left| B\\right. \\right) =P \\left({B}\\right) \r\n\\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\n P \\left( \\emptyset \\right) =0 \\\\ \r\n P \\left( S \\right) =1 \r\n\\end{array}"},{value:"\\begin{array}{c} \r\n \\forall A \\in S \\\\ \r\n P \\left( A \\right) \\ge 0 \r\n\\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\n S= \\binom{N}{n},A_{k}=\\binom{M}{k}\\cdot \\binom{N-M}{n-k} \\\\ \r\n P\\left ( A_{k}\\right ) = \\frac{\\binom{M}{k}\\cdot \\binom{N-M}{n-k}}{\\binom{N}{n}} \r\n\\end{array}"},{value:"\\begin{array}{c} \r\n P_{n}=n! \\\\ \r\n A_{n}^{k}=\\frac{n!}{\\left( n-k \\left) !\\right. \\right.} \r\n\\end{array}"}]}]}].map((function(e,t){return(0,u.jsxs)(o.Z,{flex:"110px",className:c.Z.item,children:[(0,u.jsxs)("div",{children:[(0,u.jsx)(s.Z,{value:"`$$"+e.value+"$$`"}),e.name]}),(0,u.jsx)("div",{className:c.Z.children,children:e.children.map((function(e,t){return(0,u.jsxs)("div",{children:[e.name&&(0,u.jsx)("h1",{children:e.name}),(0,u.jsx)(r.Z,{gutter:[10,10],children:e.data.map((function(e,t){return(0,u.jsx)(o.Z,{onClick:function(){return m(e)},className:c.Z.diamond,children:(0,u.jsx)(s.Z,{value:"`$$"+e.value+"$$`"})},t)}))})]},t)}))})]})}))})}],g=function(){var e=document.createElement("div");e.innerHTML=f.current.getValue();var t=e.innerText;return n&&n(t),t};return(0,i.useImperativeHandle)(t,(function(){return{getData:g}})),(0,u.jsxs)("div",{className:c.Z.mathWrap,children:[(0,u.jsx)(a.Z,{defaultActiveKey:"1",items:v}),(0,u.jsx)("math-field",{locale:"zh_cn",className:c.Z.mathField,placeholder:"请打开键盘,输入公式",ref:f,style:{width:800,marginTop:30,fontSize:18},children:p||""}),h&&(0,u.jsx)("div",{className:c.Z.button,children:(0,u.jsx)(l.ZP,{size:"large",onClick:g,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})}));t.Z=h},13767:function(e,t,n){"use strict";var i=n(82242),r=n.n(i),o=(n(59301),n(93314)),a=n(99571),l=n(37712);t.Z=function(e){var t=e.img,n=e.buttonProps,i=void 0===n?{}:n,s=e.styles,c=void 0===s?{}:s,u=e.customText,h=e.ButtonText,d=e.ButtonClick,p=e.Buttonclass,f=e.ButtonTwo,m=e.imgStyles,v=e.loading,g=void 0!==v&&v,y=e.className,b=void 0===y?"":y;return(0,l.jsxs)("section",{className:"tc animated fadeIn ".concat(b),style:r()({color:"#999",margin:"100px auto",visibility:g?"hidden":"visible"},c),children:[(0,l.jsx)("img",{src:t||o,style:r()(r()({},m),{},{pointerEvents:"none",userSelect:"none"})}),(0,l.jsx)("p",{className:"mt20 font14",children:u||"暂时还没有相关数据哦!"}),h&&(0,l.jsx)(a.ZP,r()(r()({className:p,onClick:d},i),{},{children:h})),f&&f]})}},32831:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var i=n(82242),r=n.n(i),o=n(7557),a=n.n(o),l=n(41498),s=n.n(l),c=n(79800),u=n.n(c),h=n(59301),d={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},p=n(99571),f=n(70557),m=n(92068),v=n(25399),g=n(83287),y=n(94280),b=n(13767),x=n(91689),w=n(8814),C=n(37712),k=function(e){var t,n,i,o,l,c,k=e.editOffice,S=void 0===k?"view":k,E=e.data,M=e.issaver,T=e.onSaver,L=(e.theme,e.type),A=e.filename,D=e.monacoEditor,P=e.className,N=e.style,B=e.close,_=e.onClose,I=e.hasMask,O=e.disabledDownload,R=e.onImgDimensions,j=e.showNodata,F=e.recordInfo,Z=(0,h.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),z=u()(Z,2),H=(z[0],z[1],(0,h.useState)("")),W=u()(H,2),G=(W[0],W[1]),V=(0,h.useState)(),U=u()(V,2),q=U[0],K=U[1],Y="build"===window.ENV?"/react/build":"",X=location.host.startsWith("localhost")?x.Z.PROXY_SERVER:x.Z.API_SERVER,J=(0,h.useRef)();null!==(t=E)&&void 0!==t&&t.startsWith("/api")&&"txt"!==L&&(E=x.Z.API_SERVER+E);function Q(e){return $.apply(this,arguments)}function $(){return($=s()(a()().mark((function e(t){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"pdfdata"===t.data.type&&(T(t.data.data),window.removeEventListener("message",Q,!1)),console.log("mess---:",t.data);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}A&&D&&(D.filename=A),(0,h.useEffect)((function(){var e,t=null===(e=document.cookie)||void 0===e||null===(e=e.replace(/\s/g,""))||void 0===e?void 0:e.split(";");null==t||t.map((function(e){var t=e.split("=");"_educoder_session"===t[0]&&G(t[1])}))}),[]),(0,h.useEffect)((function(){var e;"office"===L&&(E.indexOf("bigfilescdn.")>-1||E.indexOf("bigfiles1")>-1?K({url:E,fileType:(e=E,e.substring(e.lastIndexOf("/")+1).split(".").pop()),model:E.indexOf("model=edit")?"edit":"view"}):ee())}),[L,E]);var ee=function(){var e=s()(a()().mark((function e(){var t,n,i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("data:",E),t=E,E.startsWith("http")||(t=location.origin+t),n=new URL(t).pathname.split("/").pop(),e.next=6,(0,y.gJ)({attachment_id:n});case 6:(i=e.sent).url=X+i.url,K(i);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),te=function(){E.startsWith("http")||E.startsWith("blob:")?ne():(0,g.Sv)(A||"educoder",E,A)},ne=function(){F&&(0,w.fc)({id:null==F?void 0:F.id,watch_type:1,course_id:null==F?void 0:F.course_id}),(0,g.Nd)(A||"educoder",decodeURIComponent(E))};return(0,C.jsxs)("div",{style:r()({},N||{}),className:"".concat(I&&d.bgBlack," ").concat(L?d.wrp:"hide"),children:[B&&(0,C.jsxs)("div",{className:d.close,ref:J,children:[!!R&&(0,C.jsx)(v.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return J.current},children:(0,C.jsx)("span",{onClick:function(){_(),R()},children:(0,C.jsx)("i",{className:"icon-yulanpizhu"})})}),!O&&(0,C.jsx)(v.Z,{title:"点击下载此文件",getPopupContainer:function(){return J.current},children:(0,C.jsx)("span",{onClick:ne,children:(0,C.jsx)("i",{className:"icon-quxiaozhiding"})})}),M&&(0,C.jsx)(v.Z,{title:"保存pdf并退出",getPopupContainer:function(){return J.current},children:(0,C.jsx)("span",{className:"",onClick:function(){var e=document.getElementById("pdfiframe");window.addEventListener("message",Q,!1),setTimeout((function(){e.contentWindow.postMessage("getData","*")}),300)},children:(0,C.jsx)("i",{className:"icon-baocun"})})}),(0,C.jsx)(v.Z,{title:"关闭",getPopupContainer:function(){return J.current},children:(0,C.jsx)("span",{className:"",onClick:function(){_()},children:(0,C.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,C.jsx)("div",{className:"".concat(d[P]," ").concat(P," ").concat(d.monaco," ").concat("txt"===L?"show":"hide"),children:"txt"===L&&(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(m.ZP,r()({},D))})}),"audio"===L&&(0,C.jsx)("audio",{src:"".concat((null===(n=E)||void 0===n?void 0:n.indexOf("http://"))>-1||(null===(i=E)||void 0===i?void 0:i.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(E),autoPlay:!0}),"video"===L&&(0,C.jsx)(C.Fragment,{children:(null===(o=E)||void 0===o?void 0:o.indexOf("http"))>-1?(0,C.jsx)("video",{controls:!0,src:"".concat(E),autoPlay:!0}):(0,C.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(E),autoPlay:!0})}),"office"===L&&q&&(0,C.jsx)("iframe",{src:"".concat(Y,"/office.html?key=").concat(q.key,"&url=").concat(btoa(q.url),"&callbackUrl=").concat(X+(q.callbackUrl||""),"&fileType=").concat(q.fileType,"&title=").concat(q.title||"","&model=").concat(S,"&officeServer=").concat(x.Z.ONLYOFFICE,"&disabledDownload=").concat(!!O)}),"html"===L&&(0,C.jsx)("iframe",{src:E+"&disposition=inline"}),"pdf"===L&&(0,C.jsx)("iframe",{id:"pdfiframe",src:"".concat(Y,"/js/pdfview/index.html?filename=").concat(A||"educoder.pdf","&url=").concat(encodeURIComponent(E),"&disabledDownload=").concat(!!O,"&model=").concat(S)}),"image"===L&&(0,C.jsx)("img",{src:"".concat((null===(l=E)||void 0===l?void 0:l.indexOf("http://"))>-1||(null===(c=E)||void 0===c?void 0:c.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(E)}),("other"===L||"download"===L)&&(0,C.jsx)(C.Fragment,{children:j?(0,C.jsx)(b.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,C.jsx)(p.ZP,{icon:(0,C.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:te,disabled:O,children:"下载"})}):(0,C.jsxs)(p.ZP,{type:"primary",size:"middle",onClick:te,disabled:O,children:[(0,C.jsx)(f.Z,{}),"点击下载"]})}),"flowChart"===L&&(0,C.jsx)("div",{className:"embed",children:(0,C.jsx)("iframe",{src:"/drawio/src/main/webapp/viewer.html?id=".concat(E||"","&gapi=0&od=0&db=0&gh=0&gl=0"),width:"100%",height:"100%",frameBorder:"0"})})]})}},74889:function(e,t,n){"use strict";n.d(t,{z:function(){return L},Z:function(){return A}});var i=n(82242),r=n.n(i),o=n(37205),a=n.n(o),l=n(91232),s=n.n(l),c=n(79800),u=n.n(c),h=n(59301),d=(n(88831),n(75359)),p=(n(64018),n(44523)),f=n(91689),m=n(83287),v=n(15342),g=n(77736),y=n(99571),b=n(1012),x=n(32831),w=n(37712),C=function(e){var t=e.html,n=(0,h.useRef)(null),i=(0,h.useRef)(null);return(0,h.useEffect)((function(){var e=n.current.attachShadow({mode:"open"});i.current=document.createElement("div"),i.current.className="markdown-body",i.current.innerHTML=t,e.appendChild(i.current);var r=document.createElement("style");return r.textContent='.markdown-body p {\n margin: 0 0 16px 0 !important;\n line-height: 28px;\n white-space: pre-wrap;\n }\n\n ol,\n ul,\n li {\n list-style-type: none\n }\n\n ol,\n ul,\n dl {\n margin-bottom: 0px;\n }\n\n .markdown-body {\n -ms-text-size-adjust: 100%;\n -webkit-text-size-adjust: 100%;\n color: #333;\n overflow: hidden;\n font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif;\n word-break: break-word;\n font-size: 16px;\n line-height: 1.6;\n white-space: normal;\n word-wrap: break-word;\n position: relative;\n }\n\n .markdown-body ul>li {\n list-style-type: disc;\n }\n\n .markdown-body ol>li {\n list-style-type: decimal;\n }\n\n .markdown-body a {\n background: transparent;\n }\n\n .markdown-body a:active,\n .markdown-body a:hover {\n outline: 0;\n }\n\n .markdown-body strong {\n font-weight: bold;\n }\n\n .markdown-body h1 {\n font-size: 2em;\n margin: 0.67em 0;\n }\n\n .markdown-body img {\n border: 0;\n }\n\n .markdown-body hr {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n height: 0;\n }\n\n .markdown-body pre {\n overflow: auto;\n }\n\n .markdown-body code,\n .markdown-body kbd,\n .markdown-body pre {\n font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;\n font-size: 1em;\n }\n\n .markdown-body input {\n color: inherit;\n font: inherit;\n margin: 0;\n }\n\n .markdown-body html input[disabled] {\n cursor: default;\n }\n\n .markdown-body input {\n line-height: normal;\n }\n\n .markdown-body input[type="checkbox"] {\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n padding: 0;\n }\n\n .markdown-body table {\n border-collapse: collapse;\n border-spacing: 0;\n }\n\n .markdown-body td,\n .markdown-body th {\n padding: 0;\n }\n\n .markdown-body * {\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n .markdown-body input {\n font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";\n }\n\n .markdown-body a {\n color: #4183c4;\n text-decoration: none;\n }\n\n .markdown-body a:hover,\n .markdown-body a:active {\n text-decoration: underline;\n }\n\n .markdown-body hr {\n height: 0;\n margin: 15px 0;\n overflow: hidden;\n background: transparent;\n border: 0;\n border-bottom: 1px solid #ddd;\n }\n\n .markdown-body hr:before {\n display: table;\n content: "";\n }\n\n .markdown-body hr:after {\n display: table;\n clear: both;\n content: "";\n }\n\n .markdown-body h1,\n .markdown-body h2,\n .markdown-body h3,\n .markdown-body h4,\n .markdown-body h5,\n .markdown-body h6 {\n margin-top: 15px;\n margin-bottom: 15px;\n line-height: 1.1;\n }\n\n .markdown-body h1 {\n font-size: 30px;\n }\n\n .markdown-body h2 {\n font-size: 21px;\n }\n\n .markdown-body h3 {\n font-size: 16px;\n }\n\n .markdown-body h4 {\n font-size: 14px;\n }\n\n .markdown-body h5 {\n font-size: 12px;\n }\n\n .markdown-body h6 {\n font-size: 11px;\n }\n\n .markdown-body blockquote {\n margin: 0;\n }\n\n .markdown-body ul,\n .markdown-body ol {\n padding: 0;\n margin-top: 0;\n margin-bottom: 0;\n }\n\n ul.linenums,\n ol.linenums {\n padding: 16px 0 0 56px !important;\n }\n\n .markdown-body ul,\n .markdown-body ol {\n padding-left: 2em;\n }\n\n\n .markdown-body ol ol,\n .markdown-body ul ol {\n list-style-type: lower-roman;\n }\n\n .markdown-body ul ul ol,\n .markdown-body ul ol ol,\n .markdown-body ol ul ol,\n .markdown-body ol ol ol {\n list-style-type: lower-alpha;\n }\n\n .markdown-body dd {\n margin-left: 0;\n }\n\n .markdown-body code {\n font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;\n font-size: 12px;\n }\n\n .markdown-body pre {\n margin-top: 0;\n margin-bottom: 0;\n font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;\n }\n\n .markdown-body .octicon {\n font: normal normal 16px octicons-anchor;\n line-height: 1;\n display: inline-block;\n text-decoration: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n\n .markdown-body .octicon-link:before {\n content: \'\f05c\';\n }\n\n .markdown-body>*:first-child {\n margin-top: 0 !important;\n }\n\n .markdown-body>*:last-child {\n margin-bottom: 0 !important;\n }\n\n .markdown-body .anchor {\n position: absolute;\n top: 0;\n left: 0;\n display: block;\n padding-right: 6px;\n padding-left: 30px;\n margin-left: -30px;\n }\n\n .markdown-body .anchor:focus {\n outline: none;\n }\n\n .markdown-body h1,\n .markdown-body h2,\n .markdown-body h3,\n .markdown-body h4,\n .markdown-body h5,\n .markdown-body h6 {\n position: relative;\n margin-top: 1em;\n margin-bottom: 16px;\n font-weight: bold;\n line-height: 1.4;\n }\n\n .markdown-body h1 .octicon-link,\n .markdown-body h2 .octicon-link,\n .markdown-body h3 .octicon-link,\n .markdown-body h4 .octicon-link,\n .markdown-body h5 .octicon-link,\n .markdown-body h6 .octicon-link {\n display: none;\n color: #000;\n vertical-align: middle;\n }\n\n .markdown-body h1:hover .anchor,\n .markdown-body h2:hover .anchor,\n .markdown-body h3:hover .anchor,\n .markdown-body h4:hover .anchor,\n .markdown-body h5:hover .anchor,\n .markdown-body h6:hover .anchor {\n padding-left: 8px;\n margin-left: -30px;\n text-decoration: none;\n }\n\n .markdown-body h1:hover .anchor .octicon-link,\n .markdown-body h2:hover .anchor .octicon-link,\n .markdown-body h3:hover .anchor .octicon-link,\n .markdown-body h4:hover .anchor .octicon-link,\n .markdown-body h5:hover .anchor .octicon-link,\n .markdown-body h6:hover .anchor .octicon-link {\n display: inline-block;\n }\n\n .markdown-body h1 {\n padding-bottom: 0.3em;\n font-size: 2.25em;\n line-height: 1.2;\n border-bottom: 1px solid #eee;\n }\n\n .markdown-body h1 .anchor {\n line-height: 1;\n }\n\n .markdown-body h2 {\n padding-bottom: 0.3em;\n font-size: 1.75em;\n line-height: 1.225;\n border-bottom: 1px solid #eee;\n }\n\n .markdown-body h2 .anchor {\n line-height: 1;\n }\n\n .markdown-body h3 {\n font-size: 1.5em;\n line-height: 1.43;\n }\n\n .markdown-body h3 .anchor {\n line-height: 1.2;\n }\n\n .markdown-body h4 {\n font-size: 1.25em;\n }\n\n .markdown-body h4 .anchor {\n line-height: 1.2;\n }\n\n .markdown-body h5 {\n font-size: 1em;\n }\n\n .markdown-body h5 .anchor {\n line-height: 1.1;\n }\n\n .markdown-body h6 {\n font-size: 1em;\n color: #777;\n }\n\n .markdown-body h6 .anchor {\n line-height: 1.1;\n }\n\n .markdown-body p,\n .markdown-body blockquote,\n .markdown-body ul,\n .markdown-body ol,\n .markdown-body dl,\n .markdown-body table,\n .markdown-body pre {\n margin-top: 0;\n margin-bottom: 16px;\n }\n\n .markdown-body ul ul,\n .markdown-body ul ol,\n .markdown-body ol ol,\n .markdown-body ol ul {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n .markdown-body li>p {\n margin-top: 16px;\n }\n\n .markdown-body dl {\n padding: 0;\n }\n\n .markdown-body dl dt {\n padding: 0;\n margin-top: 16px;\n font-size: 1em;\n font-style: italic;\n font-weight: bold;\n }\n\n .markdown-body dl dd {\n padding: 0 16px;\n margin-bottom: 16px;\n }\n\n .markdown-body blockquote {\n padding: 0 15px;\n color: #777;\n border-left: 4px solid #ddd;\n }\n\n .markdown-body blockquote> :first-child {\n margin-top: 0;\n }\n\n .markdown-body blockquote> :last-child {\n margin-bottom: 0;\n }\n\n .markdown-body table {\n display: block;\n width: 100%;\n overflow: auto;\n word-break: normal;\n word-break: keep-all;\n }\n\n .markdown-body table th {\n font-weight: bold;\n text-align: revert;\n }\n\n .markdown-body table th,\n .markdown-body table td {\n padding: 6px 13px;\n border: 1px solid #ddd;\n }\n\n .markdown-body table tr {\n background-color: #fff;\n border-top: 1px solid #ccc;\n }\n\n .markdown-body table tr:nth-child(2n) {\n background-color: #f8f8f8;\n }\n\n .markdown-body img {\n max-width: 100%;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n .markdown-body code {\n padding: 0;\n padding-top: 0.2em;\n padding-bottom: 0.2em;\n margin: 0;\n font-size: 85%;\n background-color: rgba(0, 0, 0, 0.04);\n border-radius: 3px;\n }\n\n .markdown-body code:has(.katex) {\n background-color: transparent;\n }\n\n .markdown-body code:before,\n .markdown-body code:after {\n letter-spacing: -0.2em;\n content: "\\00a0";\n }\n\n .markdown-body pre>code {\n padding: 0;\n margin: 0;\n font-size: 100%;\n word-break: normal;\n white-space: pre;\n background: transparent;\n border: 0;\n }\n\n .markdown-body .highlight {\n margin-bottom: 16px;\n }\n\n .markdown-body .highlight pre,\n .markdown-body pre {\n padding: 16px;\n overflow: auto;\n font-size: 85%;\n line-height: 1.45;\n background-color: #f7f7f7;\n border-radius: 3px;\n }\n\n .markdown-body .highlight pre {\n margin-bottom: 0;\n word-break: normal;\n }\n\n .markdown-body pre {\n word-wrap: normal;\n }\n\n .markdown-body pre code {\n display: inline;\n max-width: initial;\n padding: 0;\n margin: 0;\n overflow: initial;\n line-height: inherit;\n word-wrap: normal;\n background-color: transparent;\n border: 0;\n }\n\n .markdown-body pre code:before,\n .markdown-body pre code:after {\n content: normal;\n }\n\n .markdown-body kbd {\n display: inline-block;\n padding: 3px 5px;\n font-size: 11px;\n line-height: 10px;\n color: #555;\n vertical-align: middle;\n background-color: #fcfcfc;\n border: solid 1px #ccc;\n border-bottom-color: #bbb;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 #bbb;\n }\n\n .markdown-body .pl-c {\n color: #969896;\n }\n\n .markdown-body .pl-c1,\n .markdown-body .pl-mdh,\n .markdown-body .pl-mm,\n .markdown-body .pl-mp,\n .markdown-body .pl-mr,\n .markdown-body .pl-s1 .pl-v,\n .markdown-body .pl-s3,\n .markdown-body .pl-sc,\n .markdown-body .pl-sv {\n color: #0086b3;\n }\n\n .markdown-body .pl-e,\n .markdown-body .pl-en {\n color: #795da3;\n }\n\n .markdown-body .pl-s1 .pl-s2,\n .markdown-body .pl-smi,\n .markdown-body .pl-smp,\n .markdown-body .pl-stj,\n .markdown-body .pl-vo,\n .markdown-body .pl-vpf {\n color: #333;\n }\n\n .markdown-body .pl-ent {\n color: #63a35c;\n }\n\n .markdown-body .pl-k,\n .markdown-body .pl-s,\n .markdown-body .pl-st {\n color: #a71d5d;\n }\n\n .markdown-body .pl-pds,\n .markdown-body .pl-s1,\n .markdown-body .pl-s1 .pl-pse .pl-s2,\n .markdown-body .pl-sr,\n .markdown-body .pl-sr .pl-cce,\n .markdown-body .pl-sr .pl-sra,\n .markdown-body .pl-sr .pl-sre,\n .markdown-body .pl-src {\n color: #df5000;\n }\n\n .markdown-body .pl-mo,\n .markdown-body .pl-v {\n color: #1d3e81;\n }\n\n .markdown-body .pl-id {\n color: #b52a1d;\n }\n\n .markdown-body .pl-ii {\n background-color: #b52a1d;\n color: #f8f8f8;\n }\n\n .markdown-body .pl-sr .pl-cce {\n color: #63a35c;\n font-weight: bold;\n }\n\n .markdown-body .pl-ml {\n color: #693a17;\n }\n\n .markdown-body .pl-mh,\n .markdown-body .pl-mh .pl-en,\n .markdown-body .pl-ms {\n color: #1d3e81;\n font-weight: bold;\n }\n\n .markdown-body .pl-mq {\n color: #008080;\n }\n\n .markdown-body .pl-mi {\n color: #333;\n font-style: italic;\n }\n\n .markdown-body .pl-mb {\n color: #333;\n font-weight: bold;\n }\n\n .markdown-body .pl-md,\n .markdown-body .pl-mdhf {\n background-color: #ffecec;\n color: #bd2c00;\n }\n\n .markdown-body .pl-mdht,\n .markdown-body .pl-mi1 {\n background-color: #eaffea;\n color: #55a532;\n }\n\n .markdown-body .pl-mdr {\n color: #795da3;\n font-weight: bold;\n }\n\n .markdown-body kbd {\n display: inline-block;\n padding: 3px 5px;\n font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;\n line-height: 10px;\n color: #555;\n vertical-align: middle;\n background-color: #fcfcfc;\n border: solid 1px #ccc;\n border-bottom-color: #bbb;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 #bbb;\n }\n\n .markdown-body .task-list-item {\n list-style-type: none;\n }\n\n .markdown-body .task-list-item+.task-list-item {\n margin-top: 3px;\n }\n\n .markdown-body .task-list-item input {\n float: left;\n margin: 0.3em 0 0.25em -1.6em;\n vertical-align: middle;\n }\n\n .markdown-body :checked+.radio-label {\n z-index: 1;\n position: relative;\n border-color: #4183c4;\n }\n\n\n /*! Pretty printing styles. Used with prettify.js. */\n /* SPAN elements with the classes below are added by prettyprint. */\n .pln {\n color: #000\n }\n\n /* plain text */\n\n @media screen {\n .str {\n color: #080\n }\n\n /* string content */\n .kwd {\n color: #008\n }\n\n /* a keyword */\n .com {\n color: #800\n }\n\n /* a comment */\n .typ {\n color: #606\n }\n\n /* a type name */\n .lit {\n color: #066\n }\n\n /* a literal value */\n /* punctuation, lisp open bracket, lisp close bracket */\n .pun,\n .opn,\n .clo {\n color: #660\n }\n\n .tag {\n color: #008\n }\n\n /* a markup tag name */\n .atn {\n color: #606\n }\n\n /* a markup attribute name */\n .atv {\n color: #080\n }\n\n /* a markup attribute value */\n .dec,\n .var {\n color: #606\n }\n\n /* a declaration; a variable name */\n .fun {\n color: red\n }\n\n /* a function name */\n }\n\n /* Use higher contrast and text-weight for printable form. */\n @media print,\n projection {\n .str {\n color: #060\n }\n\n .kwd {\n color: #006;\n font-weight: bold\n }\n\n .com {\n color: #600;\n font-style: italic\n }\n\n .typ {\n color: #404;\n font-weight: bold\n }\n\n .lit {\n color: #044\n }\n\n .pun,\n .opn,\n .clo {\n color: #440\n }\n\n .tag {\n color: #006;\n font-weight: bold\n }\n\n .atn {\n color: #404\n }\n\n .atv {\n color: #060\n }\n }\n\n /* Put a border around prettyprinted code snippets. */\n pre.prettyprint {\n padding: 2px;\n /* border: 1px solid #888 */\n }\n\n /* Specify class=linenums on a pre to get line numbering */\n ol.linenums {\n margin-top: 0;\n margin-bottom: 0\n }\n\n /* IE indents via margin-left */\n li.L0,\n li.L1,\n li.L2,\n li.L3,\n li.L5,\n li.L6,\n li.L7,\n li.L8 {\n list-style-type: none\n }\n\n /* Alternate shading for lines */\n li.L1,\n li.L3,\n li.L5,\n li.L7,\n li.L9 {\n background: #eee\n }\n\n .markdown-body p,\n .markdown-body blockquote,\n .markdown-body ul,\n .markdown-body ol,\n .markdown-body dl,\n .markdown-body table,\n .markdown-body pre {\n margin-top: 0;\n margin-bottom: 16px;\n }',e.appendChild(r),function(){e.innerHTML=""}}),[]),(0,h.useEffect)((function(){i.current&&(i.current.innerHTML=t)}),[t]),(0,w.jsx)("div",{ref:n})};var k="mdBody___raKXb",S="button___Ch5Pc",E="previewFlowChart___vY1dq",M="@▁@",T=/<pre[^>]*>/g;var L=function(e,t){e=e||"";var n=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return t?e.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(n,(function(e,t,n,i,r,o,a){var l=t||i||o,s=n||r||a||"?";return f.Z.API_SERVER+"/api/attachments/"+l+s+"&t="+(0,m.Jn)(l,Date.now())+(e.indexOf(")")>-1?")":"&")})).replaceAll('src="(','src="').replaceAll("src='(",'src="'):e=e.replace(/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,(function(e,t,n,i,r,o,a){var l=t||i||o,s=n||r||a||"?";return f.Z.API_SERVER+"/attachments/download/"+l+s+"&t="+(0,m.Jn)(l,Date.now())+(e.indexOf(")")>-1?")":"&")})).replace(n,(function(e,t,n,i,r,o,a){var l=t||i||o,s=n||r||a||"?";return f.Z.API_SERVER+"/api/attachments/"+l+s+"&t="+(0,m.Jn)(l,Date.now())+(e.indexOf(")")>-1?")":"&")})).replace(/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,(function(e,t,n,i,r){var o=t||i,a=n||r||"";return'"'+f.Z.API_SERVER+"/api/attachments/"+o+a+o+a+"&t="+(0,m.Jn)(o,Date.now())})).replace(/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,(function(e,t,n,i,r){var o=t||i,a=n||r||"";return"("+f.Z.API_SERVER+"/files/uploads/"+o+a+o+a+"&t="+(0,m.Jn)(o,Date.now())})).replaceAll('src="(','src="').replaceAll("src='(",'src="').replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,"\n")},A=function(e){var t=e.value,n=void 0===t?"":t,i=e.edit,o=void 0!==i&&i,l=e.className,c=e.showTextOnly,m=e.showLines,L=e.style,A=void 0===L?{}:L,D=e.stylesPrev,P=void 0===D?{}:D,N=e.highlightKeywords,B=e.showProgramFill,_=(e.isProgramFill,e.disabledFill),I=void 0!==_&&_,O=e.programFillValue,R=e.openEditor,j=void 0===R?function(){}:R,F=e.onFillChange,Z=void 0===F?function(e){}:F,z=e.onFillBlur,H=void 0===z?function(){}:z,W=e.onFillFocus,G=void 0===W?function(){}:W,V=function(e){var t=new RegExp("\\b(".concat(["onabort","onanimationend","onanimationiteration","onanimationstart","onauxclick","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncopy","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitionend","onvolumechange","onwaiting","onwheel"].join("|"),")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s>]*)"),"gi");return e.replace(t,"").trim()}(String(n||"")),U=(0,h.useRef)(),q=(0,h.useRef)(),K=(0,h.useState)(""),Y=u()(K,2),X=Y[0],J=Y[1],Q=(0,h.useState)("office"),$=u()(Q,2),ee=$[0],te=$[1],ne=(0,h.useState)([]),ie=u()(ne,2),re=ie[0],oe=ie[1],ae=(0,h.useRef)("a"+(0,b.Z)()),le={},se=function(e){return/<style[\s\S]*?>/i.test(e||"")};var ce=function(e){return!c&&se(V)?e:e.replace(/<style.*?>([\s\S]+?)<\/style>/gim,(function(e,t){var n=t.replace(/(\n|\r)/g,"").split("}"),i=[];return n.map((function(e){""!=e&&i.push(".".concat(ae.current," ").concat(e))})),"<style>".concat(i.join("}"),"</style>")}))},ue=(0,h.useMemo)((function(){try{V=V.replace(/\(\/attachments\/download\//g,"("+f.Z.API_SERVER+"/attachments/download/").replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,"("+f.Z.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+f.Z.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+f.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,"\n"),U.current.style.display="none"}catch(e){}if(B){var e=-1;return V=V.replaceAll("<","&lt;").replaceAll(">","&gt;").replace(/(@▁▁@|@▁@)/g,(function(t,n,i){var r;return function(e,t,n){var i=document.createElement(e===M?"input":"textarea");i.style.width="100%",i.style.height=e===M?"40px":"151px",i.rows=5,i.spellcheck=!1,i.name="edu-program-fill",i.placeholder="请输入",i.dataset.id=t;var r=Object.keys(le).length;return le[r]=i,'<span class="edu-program-fill-wrap '.concat(e===M?"":"show",'" style="width:').concat(e===M?"600px":"100%",'" title=').concat(n||"","><span>").concat(i.outerHTML,'<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>')}(t,++e,null==O||null===(r=O[e])||void 0===r?void 0:r.value.replaceAll("<","&lt;").replaceAll(">","&gt;"))})),'<pre style="background:#fff;padding:4px">'.concat(ce(V||""),"</pre>")}var t=ce(V);t=(0,d.ZP)(t);var n=(0,d.ez)();V.match(/\[TOC\]/)&&(t=t.replace("<p>[TOC]</p>",(0,d.Qv)()),(0,d.Iy)()),t=t.replace(/(__special_katext_id_\d+__)/g,(function(e,t){var i=n[t],r=i.type,o=i.expression;return(0,v.renderToString)(function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}(o)||"",{displayMode:"block"===r,throwOnError:!1,output:"html"})})),t=t.replace(/▁/g,"▁▁▁▁▁"),(0,d.AL)();var i=document.createElement("div");return i.innerHTML=t,c?i.innerText:N?(fe(i,N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),i.innerHTML):(setTimeout((function(){return ge()}),500),i.innerHTML)}),[V,N]);(0,h.useEffect)((function(){me.current&&me.current.querySelectorAll(["input","textarea"]).forEach((function(e){e.oninput=he,e.onblur=de,e.onfocus=pe}))}),[re]),(0,h.useEffect)((function(){if(null!=O&&O.length)try{var e,t=me.current.querySelectorAll(".edu-program-fill-score"),n=me.current.querySelectorAll('[name="edu-program-fill"]'),i=s()(n.entries());try{for(i.s();!(e=i.n()).done;){var r,o,a,l=u()(e.value,2),c=l[0],h=l[1];h.value=(null==O||null===(r=O[c])||void 0===r?void 0:r.value)||"","warning"===(null==O||null===(o=O[c])||void 0===o?void 0:o.type)?h.className="program-fill-warning":"success"===(null==O||null===(a=O[c])||void 0===a?void 0:a.type)?h.className="program-fill-success":h.className=""}}catch(e){i.e(e)}finally{i.f()}var d,p=s()(t.entries());try{for(p.s();!(d=p.n()).done;){var f,m,v=u()(d.value,2),g=v[0];v[1].innerHTML=null!=O&&null!==(f=O[g])&&void 0!==f&&f.score?"".concat(null==O||null===(m=O[g])||void 0===m?void 0:m.score,"分"):""}}catch(e){p.e(e)}finally{p.f()}oe(O)}catch(e){console.log(e,"error")}}),[O]);var he=function(e){re[e.target.dataset.id]=re[e.target.dataset.id]||{},re[e.target.dataset.id].value=e.target.value,oe(a()(re)),Z(re,e.target.dataset.id)},de=function(e){re[e.target.dataset.id]=re[e.target.dataset.id]||{},re[e.target.dataset.id].value=e.target.value,oe(a()(re)),H(re,e.target.dataset.id)},pe=function(e){re[e.target.dataset.id]=re[e.target.dataset.id]||{},re[e.target.dataset.id].value=e.target.value,oe(a()(re)),G(re,e.target.dataset.id)};function fe(e,t){return e.childNodes.forEach((function(e){if(e.childNodes.length>0)fe(e,t);else if("IMG"!==e.nodeName)if(e.innerHTML){var n;e.innerHTML=null===(n=e.innerHTML)||void 0===n?void 0:n.replace(new RegExp(t,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>')}else{var i=document.createElement("span");i.innerHTML=e.textContent.replace(new RegExp(t,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),e.replaceWith(i)}}))}var me=(0,h.useRef)();function ve(e){var t=e.target;if("A"===t.tagName.toUpperCase()){var n=t.getAttribute("href");if(n.indexOf("office")>-1)e.preventDefault(),J(n),te("office");else if(n.indexOf("application/pdf")>-1)e.preventDefault(),J(n),te("pdf");else if(n.indexOf("text/html")>-1)e.preventDefault(),J(n),te("html");else if(n.startsWith("#")){e.preventDefault();var i=document.getElementById(n.replace("#",""));i&&i.scrollIntoView(!0)}}}d.jb.WebkitLineClamp=m,m&&(A=r()(r()({},A),d.jb));var ge=function(){var e,t=null===(e=me.current)||void 0===e?void 0:e.querySelectorAll("video");null==t||t.forEach((function(e){if(e.oncontextmenu=function(){return!1},e.src.indexOf(".m3u8")>-1)if(e.canPlayType("application/vnd.apple.mpegurl"));else if(p.ZP.isSupported()){var t=new p.ZP;t.loadSource(e.src),t.attachMedia(e)}}))};(0,h.useEffect)((function(){if(me.current&&ue&&ue.match(T)&&window.PR.prettyPrint(),me.current)return me.current.addEventListener("click",ve),function(){var e;null===(e=me.current)||void 0===e||e.removeEventListener("click",ve),(0,d.AL)(),(0,d.Iy)()}}),[ue,me.current,ve]);return(0,h.useEffect)((function(){var e,t=function(e){e.preventDefault(),e.clipboardData.setData("text",window.getSelection().toString())};return null===(e=me.current)||void 0===e||e.addEventListener("copy",t),function(){var e;null===(e=me.current)||void 0===e||e.removeEventListener("copy",t)}}),[me.current]),(0,w.jsxs)("div",{style:{position:"relative"},onMouseLeave:function(){U.current.style.display="none"},children:[c&&(0,w.jsx)("div",{ref:me,className:"".concat(k," "),children:ue}),!c&&!se(ue)&&(0,w.jsx)("div",{ref:me,style:r()({},A),onMouseOver:function(e){"IMG"===e.target.nodeName&&e.target.className.indexOf("draw-flowchart")>-1?(U.current.style.zIndex=1,U.current.style.display="flex",U.current.style.width=e.target.clientWidth+"px",U.current.style.height=e.target.clientHeight+"px",U.current.style.top=e.target.offsetTop+"px",U.current.style.left=e.target.offsetLeft+"px",e.target.id&&(q.current=e.target.id)):U.current.style.display="none"},className:"".concat(l||""," ").concat(I?"disabled-fill":""," markdown-body ").concat(k," ").concat(ae.current),dangerouslySetInnerHTML:{__html:ue}}),!c&&se(ue)&&(0,w.jsx)(C,{html:ue}),(0,w.jsx)("div",{ref:U,className:"".concat(S," ").concat(o?"":E),children:(0,w.jsx)(g.Z,{children:(0,w.jsx)(y.ZP,{onClick:function(){o?j(q.current):(J(q.current),te("flowChart"))},children:o?"编辑":"预览"})})}),(0,w.jsx)(x.Z,{close:!0,data:X,type:null!=X&&X.length?ee:"",style:r()({},P),onClose:function(){return J("")}})]})}},17124:function(e,t,n){"use strict";n.d(t,{h:function(){return g}});var i=n(82242),r=n.n(i),o=n(79800),a=n.n(o),l=n(59301),s=n(82326),c=n(28284),u=n(99571),h=n(89780),d=n.n(h),p=(n(66543),n(59598),n(37712)),f=s.default.Option,m={labelCol:{span:4},wrapperCol:{span:20}},v={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"]};function g(e){var t=e.value,n=e.onChange,i=e.mode,o=e.options,s=void 0===o?{}:o,c=(0,l.useRef)(),u=(0,l.useState)(),h=a()(u,2),f=h[0],m=h[1];return(0,l.useEffect)((function(){if(f){var e=function(e){var t=e.getValue();n&&n(t)};return f.on("change",e),function(){f.off("change",e)}}}),[f,n]),(0,l.useEffect)((function(){f&&f.setOption("mode",i)}),[f,i]),(0,l.useEffect)((function(){f&&(t===f.getValue()&&""!==t||setTimeout((function(){f.setValue(t||"")}),300))}),[f,t]),(0,l.useEffect)((function(){if(c.current&&!f){var e=d().fromTextArea(c.current,r()({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},s));m(e)}}),[c.current,f]),(0,p.jsx)("div",{className:"my-codemirror-container",children:(0,p.jsx)("textarea",{ref:c})})}t.Z=function(e){var t=e.callback,n=e.onCancel,i=(0,l.useState)("python"),o=a()(i,2),h=o[0],d=o[1];return(0,p.jsxs)(c.Z,r()(r()({},m),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)},style:{width:500},children:[(0,p.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,p.jsx)(s.default,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){d(v[e][1])},children:Object.keys(v).map((function(e){return(0,p.jsx)(f,{value:e,children:v[e][0]},e)}))})}),(0,p.jsx)(c.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,p.jsx)(g,{mode:h})}),(0,p.jsxs)("div",{className:"flex-container flex-end",children:[(0,p.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,p.jsx)(u.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))}},58358:function(e,t,n){"use strict";n.d(t,{Z:function(){return de}});var i=n(91232),r=n.n(i),o=n(79800),a=n.n(o),l=n(85573),s=n.n(l),c=n(59301),u=n(53260),h=n(89780),d=n.n(h),p=n(76374),f=(n(66543),n(6313),n(25717),n(99498),n(25419),n(67549),n(74889)),m=n(37712),v=function(e){var t=e.value,n=void 0===t?"":t,i=(e.className,e.showTextOnly,e.showLines,e.style,(0,c.useMemo)((function(){return""}),[n]));return(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:i}})})},g=n(82242),y=n.n(g),b=[{title:"粗体",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"斜体",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"md-iconfont icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"链接",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"行内公式",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"数学公式",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"多行公式",icon:"md-iconfont icon-formula",actionName:"latex"},"|",{title:"添加图片",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"插入画图",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"插入流程图",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"表格",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"换行",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"清空",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function x(e){var t=e.onActionCallback,n=e.title,i=e.icon,r=e.actionName,o=e.className,a=void 0===o?"":o,l=e.children;return(0,m.jsxs)("a",{title:n,className:a,onClick:function(){t(r)},children:[(0,m.jsx)("i",{className:"".concat(i)}),l]})}var w=function(e){var t=e.watch,n=e.showNullButton,i=e.showNullProgramButton,r=e.onActionCallback,o=e.fullScreen,a=e.insertTemp,l=e.hidetoolBar,s=e.extraUse,c=[].concat(b,[{title:"".concat(t?"关闭实时预览":"开启实时预览"),icon:"".concat(t?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"),actionName:"trigger-watch"}]);return(0,m.jsxs)("ul",{className:"markdown-toolbar-container",children:[!l&&c.map((function(e,t){return(0,m.jsx)("li",{children:e.actionName?(0,m.jsx)(x,y()(y()({},e),{},{onActionCallback:r})):(0,m.jsx)("span",{className:"v-line"})},t)})),n?(0,m.jsx)("li",{children:(0,m.jsx)(x,{icon:"iconfont icon-tianjia5 insert-blank",className:"btn-null ml5",title:"增加填空",actionName:"add-null-ch",onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"点击新增填空项"})})}):null,i?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("li",{children:(0,m.jsx)(x,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-signal",onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"添加单行填空项"})})}),(0,m.jsx)("li",{children:(0,m.jsx)(x,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"增加填空",actionName:"add-multiple",onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"添加多行填空项"})})})]}):null,a&&(0,m.jsx)("li",{children:(0,m.jsx)(x,{icon:"md-iconfont icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(a),onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),s&&(0,m.jsx)("li",{children:s}),(0,m.jsx)("li",{className:"btn-full-screen",children:(0,m.jsx)(x,{icon:"".concat(o?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"),title:o?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:r})})]})},C=n(82255),k=n(28284),S=n(37568),E=n(99571),M={labelCol:{span:4},wrapperCol:{span:20}},T=function(e){var t=e.callback,n=e.onCancel;return(0,m.jsxs)(k.Z,y()(y()({},M),{},{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){t(e)},style:{width:500},children:[(0,m.jsx)(k.Z.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}],children:(0,m.jsx)(S.Z,{})}),(0,m.jsx)(k.Z.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}],children:(0,m.jsx)(S.Z,{})}),(0,m.jsxs)("div",{className:"flex-container flex-end",children:[(0,m.jsx)(E.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(E.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))},L=n(17124),A=n(13889),D=n(62957),P=n(77019),N=n(11933),B=function(e){var t=e.callback,n=e.onCancel,i=document.createElement("canvas"),r=i.getContext("2d");i.width=1e3,i.height=800,r.fillStyle="#ffffff",r.fillRect(0,0,i.width,i.height);var o=i.toDataURL("image/png");return(0,m.jsx)(D.Z,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1,children:(0,m.jsx)(P.Z,{style:{height:"100vh"},children:(0,m.jsx)(N.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:o,visible:!0,title:String(Date.now())},onOk:function(e){t({src:e.url})},onClose:n})})})},_=n(30641),I=n(5269),O=n(6767),R="drawerWrap___MfDw8",j=(0,c.forwardRef)((function(e,t){e.onCancel;var n=e.editImgId,i=e.callback,r=((0,c.useRef)(),(0,c.useRef)()),o=((0,c.useRef)(),(0,c.useRef)(!1),(0,c.useRef)(!1));console.log("ref:",t);var l=(0,c.useState)(0),s=a()(l,2),u=s[0],h=s[1],d=(0,c.useState)("100vh"),p=a()(d,2),f=p[0],v=p[1];return(0,c.useEffect)((function(){h(1)}),[]),(0,c.useImperativeHandle)(t,(function(){return{setHeight:v}})),(0,m.jsx)("div",{ref:o,className:"body-overflow-initial",children:(0,m.jsx)(_.Z,{width:"100vw",height:f,footer:null,closable:!0,placement:"bottom",open:!!u,destroyOnClose:!0,maskClosable:!1,mask:!1,rootClassName:"zIndex-9999 ".concat(R),onClose:function(){window.saveDrawData((function(e){i({src:"/api/attachments/".concat(e),id:e})}))},title:(0,m.jsxs)(P.Z,{align:"middle",children:[(0,m.jsx)(I.Z,{flex:1,children:"插入流程图"}),(0,m.jsx)(I.Z,{onClick:function(){v("60px"===f?"100vh":"60px")},children:(0,m.jsx)("span",{className:"current c-blue",style:{fontWeight:400},children:"展开/收起"})}),(0,m.jsx)(I.Z,{onClick:function(){window.saveDrawData((function(e){null!==e?(O.ZP.success({content:"保存成功",key:"saveFlowChart",style:{zIndex:999999999}}),i({src:"/api/attachments/".concat(e),id:e,disabledClose:!0})):O.ZP.warning({content:"内容为空,请先绘制流程图",key:"saveFlowChart"})}))},children:(0,m.jsx)(E.ZP,{type:"primary",className:"ml20",children:"保存"})})]}),children:(0,m.jsx)("iframe",{src:"/drawio/src/main/webapp/?id=".concat(n||"","&gapi=0&od=0&db=0&gh=0&gl=0&local=0"),width:"100%",height:"100%",frameBorder:"0",ref:r})})})})),F=n(91689),Z=n(47889),z=n(71051),H=Z.ZP.Group,W={margin:"0 8px"},G=function(e){var t=e.callback,n=e.onCancel;return(0,m.jsxs)(k.Z,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){t(e)},children:[(0,m.jsxs)("div",{className:"flex-container",style:{alignItems:"baseline"},children:[(0,m.jsx)("span",{style:W,children:"单元格数:"}),(0,m.jsx)("span",{style:W,children:"行数"}),(0,m.jsx)(k.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,m.jsx)(z.Z,{})}),(0,m.jsx)("span",{style:W,children:"列数"}),(0,m.jsx)(k.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,m.jsx)(z.Z,{})})]}),(0,m.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,m.jsx)("span",{style:W,children:"对齐方式:"}),(0,m.jsx)(k.Z.Item,{name:"align",children:(0,m.jsxs)(H,{children:[(0,m.jsx)(Z.ZP,{value:"default",children:(0,m.jsx)("i",{className:"fa fa-align-justify"})}),(0,m.jsx)(Z.ZP,{value:"left",children:(0,m.jsx)("i",{className:"fa fa-align-left"})}),(0,m.jsx)(Z.ZP,{value:"center",children:(0,m.jsx)("i",{className:"fa fa-align-center"})}),(0,m.jsx)(Z.ZP,{value:"right",children:(0,m.jsx)("i",{className:"fa fa-align-right"})})]})})]}),(0,m.jsxs)("div",{className:"flex-container flex-end",children:[(0,m.jsx)(E.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(E.ZP,{type:"ghost",onClick:n,children:"取消"})]})]})},V=n(71411),U=n(32464),q=n.n(U),K=(0,c.forwardRef)((function(e,t){var n=e.use3d,i=e.width,r=e.height,o=e.callback,l=(e.showSaveButton,(0,c.useRef)()),s=(0,c.useRef)(),u=(0,c.useState)(!1),h=a()(u,2),d=h[0],p=h[1],f=(0,c.useRef)({id:l,appName:"graphing",width:i||1e3,height:r||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,c.useEffect)((function(){s.current=new(q())(f.current,!0),window.onload=function(){s.current.inject("applet_container")}}),[]);var v=function(){var e=window.ggbApplet.getPNGBase64(1,!0,72);return o&&o(e),e};return(0,c.useEffect)((function(){f.current.appName=d?"3D":"graphing",s.current.inject("applet_container")}),[d]),(0,c.useEffect)((function(){p(n)}),[n]),(0,c.useImperativeHandle)(t,(function(){return{getImgData:v}})),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:l}),(0,m.jsxs)(P.Z,{align:"middle",children:[(0,m.jsx)(I.Z,{flex:1,children:(0,m.jsx)(V.Z,{size:"default",checkedChildren:"关闭3D图像",unCheckedChildren:"开启3D图像",checked:d,onChange:function(e){return p(e)}})}),(0,m.jsx)(I.Z,{children:(0,m.jsx)(E.ZP,{size:"large",onClick:v,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})]})})),Y=n(55893),X="link",J="upload-image",Q="add-flowchart",$="draw-image",ee="code-block",te="add-table",ne="------------",ie={default:ne,left:":".concat(ne),center:":".concat(ne,":"),right:"".concat(ne,":")},re=n(22336),oe=n(83287);var ae="@▁▁@",le=["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 se(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var ce=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",ue=s()(s()({},ce+"-B","bold"),ce+"-I","italic"),he=s()(s()(s()(s()(s()(s()(s()(s()({},X,"添加链接"),ee,"添加代码块"),J,"添加图片"),$,"添加画图"),Q,"插入流程图"),te,"添加表格"),"maths-latex","数学图像"),"inline-latex","LATEX公式"),de=function(e){var t=e.defaultValue,n=void 0===t?"":t,i=e.onChange,o=e.width,l=void 0===o?"100%":o,h=e.height,g=void 0===h?400:h,y=e.miniToolbar,b=void 0!==y&&y,x=e.isFocus,k=void 0!==x&&x,S=e.watch,E=e.insertTemp,M=e.mode,P=void 0===M?"markdown":M,N=e.id,_=void 0===N?"markdown-editor-id":N,I=e.showResizeBar,R=void 0!==I&&I,Z=e.noStorage,z=void 0!==Z&&Z,H=e.showNullButton,W=void 0!==H&&H,V=e.showNullProgramButton,U=void 0!==V&&V,q=e.hidetoolBar,ne=void 0!==q&&q,ce=e.fullScreen,de=void 0!==ce&&ce,pe=e.onBlur,fe=e.onCMBeforeChange,me=e.onFullScreen,ve=e.className,ge=void 0===ve?"":ve,ye=e.disablePaste,be=void 0!==ye&&ye,xe=e.disabled,we=void 0!==xe&&xe,Ce=e.disabledFill,ke=void 0!==Ce&&Ce,Se=e.placeholder,Ee=void 0===Se?"":Se,Me=e.values,Te=void 0===Me?"":Me,Le=e.extraUse,Ae=e.onAddBlank,De=(0,c.useState)(null),Pe=a()(De,2),Ne=Pe[0],Be=Pe[1],_e=(0,c.useState)(n),Ie=a()(_e,2),Oe=Ie[0],Re=Ie[1],je=(0,c.useState)(S),Fe=a()(je,2),Ze=Fe[0],ze=Fe[1],He=(0,c.useState)(de),We=a()(He,2),Ge=We[0],Ve=We[1],Ue=(0,c.useState)(""),qe=a()(Ue,2),Ke=qe[0],Ye=qe[1],Xe=(0,c.useState)(0),Je=a()(Xe,2),Qe=Je[0],$e=Je[1],et=(0,c.useState)(g),tt=a()(et,2),nt=tt[0],it=tt[1],rt=(0,c.useState)(!1),ot=a()(rt,2),at=(ot[0],ot[1]),lt=(0,c.useState)(0),st=a()(lt,2),ct=st[0],ut=st[1],ht=(0,c.useState)(0),dt=a()(ht,2),pt=dt[0],ft=dt[1],mt=(0,c.useRef)(),vt=(0,c.useRef)(),gt=(0,c.useRef)(),yt=(0,c.useRef)(),bt=(0,c.useRef)(),xt=(0,c.useRef)(),wt=(0,u.useDispatch)();(0,c.useEffect)((function(){var e=window.scrollY||window.pageYOffset;Re(Te),null==Ne||Ne.setValue(Te),window.scrollTo(0,e)}),[Te]),(0,c.useEffect)((function(){null==me||me(Ge)}),[Ge]),(0,c.useEffect)((function(){if(mt.current){var e=function(e,n){if(!be){var i=n.clipboardData;if(i){var r=i.types.toString(),o=i.items;if("Files"===r||i.types.indexOf("Files")>-1){if(n.preventDefault(),"stex"==P)return;try{var a,l=o[1];"file"===(null===(a=o[0])||void 0===a?void 0:a.kind)&&(l=o[0]);var s=l.getAsFile(),c=s.name.split(".").pop();(0,A.I)(s,(function(e){var n,i,r;e.id?(null==s||null===(n=s.type)||void 0===n?void 0:n.indexOf("image"))>-1?t.replaceSelection('<img width="100%" src="/api/attachments/'.concat(e.id,"?type=").concat(e.content_type,')" alt="','" />')):(null==s||null===(i=s.type)||void 0===i?void 0:i.indexOf("video"))>-1?t.replaceSelection('<video width="100%" controls src="/api/attachments/'.concat(e.id,'"></video>')):(null==s||null===(r=s.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?t.replaceSelection('<a href="/api/attachments/'.concat(e.id,"?type=").concat(s.type,'&disposition=inline" target="_blank">').concat(s.name,"</a>")):le.includes(c)?t.replaceSelection('<a href="/api/attachments/'.concat(e.id,'?type=office&disposition=inline" target="_blank">').concat(s.name,"</a>")):t.replaceSelection("[".concat(s.name,"](/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))}catch(n){O.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}n.preventDefault()},t=d().fromTextArea(mt.current,{mode:P,lineNumbers:!b,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});return t.on("keyup",(function(e,n){8===n.keyCode&&(""==e.getValue()?t.setOption("placeholder",Ee):t.setOption("placeholder",null))})),t.on("keydown",(function(e,t){if(8===t.keyCode){var n=function(e,t){var n=e.getDoc(),i=n.getCursor(),r=n.getLine(i.line),o=r.charAt(i.ch-1),a=r.lastIndexOf("@▁@",i.ch),l=r.lastIndexOf("@▁▁@",i.ch),s=a>l?a:l,c=a>l?3:4;if(-1===ae.indexOf(o))return null;if(console.log("change1:",t,e,r,i,s,a,l,o),s>=0&&i.ch-s<5){var u=s+c;return n.replaceRange("",{line:i.line,ch:s},{line:i.line,ch:u}),{line:i.line,ch:u}}return null}(e);n&&t.preventDefault()}})),k&&t.focus(),t.on("paste",e),we&&t.on("beforeChange",(function(e,t){"paste"!==t.origin&&"+input"!==t.origin||t.cancel()})),Be(t),function(){t.off("paste",e)}}}),[]);var Ct=(0,c.useCallback)((function(){vt.current}),[nt,vt,Ge]);(0,c.useEffect)((function(){if(Ne){var e=function(){var e=new p.Z((function(e){var t,n=r()(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(Ct(),Ne.setSize("100%","100%"),Ne.refresh())}}catch(e){n.e(e)}finally{n.f()}}));return e.observe(mt.current.parentElement),e}();return function(){var t,n;null!==(t=mt.current)&&void 0!==t&&t.parentElement&&e.unobserve(null===(n=mt.current)||void 0===n?void 0:n.parentElement)}}}),[Ne,Ct]),(0,c.useEffect)((function(){if(Ne){for(var e=[],t=function(){var t=a()(i[n],2),r=t[0],o=t[1],l=s()({},r,(function(){kt(o)}));e.push(l),Ne.addKeyMap(l)},n=0,i=Object.entries(ue);n<i.length;n++)t();return function(){for(var t=0,n=e;t<n.length;t++){var i=n[t];Ne.removeKeyMap(i)}}}}),[Ne]),(0,c.useEffect)((function(){de!==Ge&&Ve(de)}),[de]),(0,re.Z)((function(){if(!z&&Qe>0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(_);e>=Qe+1e4&&(!t||t!==Oe)&&(window.sessionStorage.setItem(_,Oe),at(!0))}}),1e4),(0,c.useEffect)((function(){ze(S)}),[Ne,S]),(0,c.useEffect)((function(){Ne&&k&&Ne.focus()}),[Ne,k]),(0,c.useEffect)((function(){if(Ze&&Ne){var e=function(e){var t=e.target;if(yt.current){var n=t.scrollTop/t.scrollHeight;yt.current.scrollTop=yt.current.scrollHeight*n}},t=Ne.getScrollerElement();return t.addEventListener("scroll",e),function(){t.removeEventListener("scroll",e)}}}),[Ne,Ze]),(0,c.useEffect)((function(){if(Ne&&fe){var e=function(e,t){fe(e,t)};return Ne.on("beforeChange",e),function(){Ne.off("beforeChange",e)}}}),[Ne,fe]),(0,c.useEffect)((function(){if(Ne&&pe){var e=function(){pe(Ne.getValue())};return Ne.on("blur",e),function(){Ne.off("blur",e)}}}),[Ne,pe]),(0,c.useEffect)((function(){if(Ne){var e=function(e,t){var n=e.getValue();Re(n),$e((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),i&&(U?i(n,Lt(n)):i(n))};return Ne.on("change",e),function(){Ne.off("change",e)}}}),[Ne,i]),(0,c.useEffect)((function(){if(Ne)if(null==n)Ne.setValue(""),Re("");else{var e=window.scrollY||window.pageYOffset;n!==Ne.getValue()&&(Ne.setValue(n),Re(n),Ne.setCursor(we?1:Ne.lineCount(),0),window.scrollTo(0,e))}}),[Ne,n]);var kt=(0,c.useCallback)((function(e){var t=Ne.getCursor(),n=Ne.getSelection(),i=n.split("\n");switch(e){case"bold":return Ne.replaceSelection("**"+n+"**"),""===n&&Ne.setCursor(t.line,t.ch+2),Ne.focus();case"italic":return Ne.replaceSelection("*"+n+"*"),""===n&&Ne.setCursor(t.line,t.ch+1),Ne.focus();case"code":return Ne.replaceSelection("`"+n+"`"),""===n&&Ne.setCursor(t.line,t.ch+1),Ne.focus();case"inline-latex":if((0,oe.Ye)(wt))return;return Ye("inline-latex"),Ne.focus();case"latex":return Ne.replaceSelection("```latex\n"+n+"\n```"),Ne.setCursor(t.line+1,n.length+1),Ne.focus();case"line-break":return Ne.replaceSelection("<br/>\n"),Ne.focus();case"list-ul":return""===n?Ne.replaceSelection("- "+n):Ne.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),Ne.focus();case"list-ol":return""===n?Ne.replaceSelection("1. "+n):Ne.replaceSelection(i.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),Ne.focus();case"add-null-ch":return void(null==Ae||Ae());case"add-signal":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection("@▁@"),Ne.focus();case"add-multiple":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection(ae),Ne.focus();case"inster-template-1":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection("\n**模板标题**\n模板正文内容可输入文本内容和粘贴图片等操作"),Ne.focus();case"eraser":return Ne.setValue(""),Ne.focus();case"trigger-watch":return ze(!Ze),Ne.focus();case"trigger-full-screen":return Ve(!Ge),Ne.focus();case X:return void Ye(X);case ee:return void Ye(ee);case J:return void Ye(J);case $:return void Ye($);case"maths-latex":if((0,oe.Ye)(wt))return;return void Ye("maths-latex");case Q:return bt.current="",sessionStorage.removeItem("file_id"),void Ye(Q);case te:return void Ye(te);default:throw new Error}}),[Ne,Ze,Ge]),St=(0,c.useCallback)((function(e,t){var n,i,r,o,a;null!=e&&e.disabledClose||Ye("");var l=e||{},s=l.src,c=l.alt,u=l.id;switch(Ke){case X:var h=e.title,d=e.link;return Ne.replaceSelection("[".concat(h,"](").concat(d,")")),Ne.focus();case ee:var p=e.language,f=e.content;return Ne.replaceSelection(["```"+p,f,"```"].join("\n")),Ne.focus();case"maths-latex":for(var m=atob(e),v=new Uint8Array(m.length),g=0;g<m.length;g++)v[g]=m.charCodeAt(g);var y=new Blob([v],{type:"image/png"});(0,A.I)(y,(function(e){e.id?Ne.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}));break;case"inline-latex":if((0,oe.Ye)(wt))return;Ne.replaceSelection("`$$"+e+"$$`");break;case"add-flowchart":if(!u)return;-1===Ne.getValue().indexOf(s)?Ne.replaceSelection('<center><img id="'.concat(u,'" width="80%" src="').concat(s,'" class="draw-flowchart" alt="').concat(c||"",'" /></center>')):document.getElementById(u).src=F.Z.API_SERVER+s+"?t="+Date.now();break;case J:case $:var b=t,x=null==b||null===(n=b.name)||void 0===n||null===(n=n.split("."))||void 0===n||null===(i=n.pop)||void 0===i?void 0:i.call(n);return(null==b||null===(r=b.type)||void 0===r?void 0:r.indexOf("image"))>-1||null==b||!b.type?null!=b&&b.align||null!=b&&b.width?Ne.replaceSelection('<p style="text-align:'.concat(b.align||"initial",'"><img width="').concat(b.width?b.width+"%":"initial",'" src="').concat(s,'" alt="').concat(c||"",'" /></p>')):Ne.replaceSelection('<img width="100%" src="'.concat(s,'" alt="').concat(c||"",'" />')):(null==b||null===(o=b.type)||void 0===o?void 0:o.indexOf("video"))>-1?Ne.replaceSelection('<video width="100%" controls src="'.concat(s,'"></video>')):(null==b||null===(a=b.type)||void 0===a?void 0:a.indexOf("pdf"))>-1?Ne.replaceSelection('<a href="'.concat(s,"?type=").concat(b.type,'&disposition=inline" target="_blank">').concat(b.name,"</a>")):le.includes(x)?Ne.replaceSelection('<a href="'.concat(s,'?type=office&disposition=inline" target="_blank">').concat(b.name,"</a>")):Ne.replaceSelection("[".concat(b.name,"](").concat(s,")")),Ne.focus();case te:for(var w=e.row,C=e.col,k=e.align,S="\n",E=0;E<w;E++){for(var M=[],T=[],L=0;L<C;L++)1===E&&T.push(ie[k]),M.push(" ");1===E&&(S+="| ".concat(T.join(" | ")," |\n")),S+="| ".concat(M.join(1===C?"":" | ")," |\n")}return Ne.replaceSelection(S+"\n"),Ne.focus();default:throw new Error}}),[Ne,Ke]),Et=(0,c.useMemo)((function(){switch(Ke){case X:return(0,m.jsx)(T,{callback:St,onCancel:Mt});case ee:return(0,m.jsx)(L.Z,{callback:St,onCancel:Mt});case J:return(0,m.jsx)(A.Z,{callback:St,onCancel:Mt});case Q:return(0,m.jsx)(j,{editImgId:bt.current,callback:St,onCancel:Mt});case te:return(0,m.jsx)(G,{callback:St,onCancel:Mt});case"maths-latex":return(0,m.jsx)(K,{showSaveButton:!0,callback:St});case"inline-latex":return(0,m.jsx)(Y.Z,{showSaveButton:!0,callback:St});default:return null}}),[Ke]);function Mt(){Ye("")}(0,c.useEffect)((function(){if(gt.current){var e=function(e){r=!0,o=e.pageY},t=function(){r=!1},n=function(e){if(r){var t=e.pageY-o;t<0&&(t=0),t>300&&(t=300),it(g+t+"px")}},i=gt.current,r=!1,o=0;return i.addEventListener("mousedown",e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",t),function(){i.removeEventListener("mousedown",e),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",t)}}}),[Ne,gt]),(0,c.useEffect)((function(){it(g)}),[g]);var Tt={width:se(l),height:se(nt)},Lt=((0,c.useMemo)((function(){if(Qe){var e=new Date(Qe),t=e.getHours(),n=e.getMinutes(),i=e.getSeconds();return n=n<10?"0"+n:n,i=i<10?"0"+i:i,"".concat(t=t<10?"0"+t:t,":").concat(n,":").concat(i)}return 0}),[Qe]),function(e){var t=[];if(U){e=e.replace(/(@▁▁@|@▁@)/g,(function(e,n,i){t.push({multiLine:!("@▁@"===e)})}))}return t});(0,c.useEffect)((function(){he[Ke]&&Ke!==$&&Ke!==Q&&setTimeout((function(){var e=document.getElementsByClassName("markdown-popup-form")[0],t=window.innerWidth/2-e.offsetWidth/2,n=window.innerHeight/2-e.offsetHeight/2;ut(t),ft(n)}),0)}),[Ke]);var At=function(e,t,n,i){var r=document.body.clientHeight,o=document.body.clientWidth;return!(e<20&&n>e||e>o-20&&n<e||t<20&&i>t||t>r-20&&i<t)||(document.body.onmousemove=null,document.body.onmouseup=null,!1)};return(0,m.jsxs)(c.Fragment,{children:[(0,m.jsx)("div",{className:"markdown-editor-wrapper",ref:vt,children:(0,m.jsxs)("div",{className:"markdown-editor-container ".concat(ge," ").concat(Ze?"on-preview":""," ").concat(b?"mini":""," ").concat(Ge?"full-screen":""),style:Tt,children:[(0,m.jsx)(w,{insertTemp:E,watch:Ze,fullScreen:Ge,showNullButton:W,showNullProgramButton:U,onActionCallback:kt,hidetoolBar:ne,extraUse:Le}),(0,m.jsxs)("div",{className:"markdown-editor-body",children:[(0,m.jsx)("div",{className:"codemirror-container",children:(0,m.jsx)("textarea",{ref:mt,placeholder:Ee})}),Ze?(0,m.jsxs)("div",{ref:yt,className:"preview-container",children:["stex"===P&&(0,m.jsx)(v,{value:Oe}),"stex"!==P&&(0,m.jsx)(f.Z,{edit:!0,disabledFill:ke,showProgramFill:U,value:Oe,openEditor:function(e){var t;bt.current=e,null===(t=xt.current)||void 0===t||t.setHeight("100vh"),setTimeout((function(){Ye("add-flowchart")}),150)}})]}):null]})]})}),R?(0,m.jsx)("a",{ref:gt,className:"editor-resize"}):null,Ke===$&&(0,m.jsx)(B,{callback:St,onCancel:Mt}),Ke===Q&&(0,m.jsx)(j,{ref:xt,editImgId:bt.current,callback:St,onCancel:Mt}),(0,m.jsx)(C.Z,{children:he[Ke]&&Ke!==$&&Ke!==Q?(0,m.jsx)(D.Z,{maskClosable:!1,centered:!0,style:{position:"absolute",left:ct,top:pt},title:(0,m.jsx)("div",{style:{cursor:"move"},onMouseDown:function(e){e.preventDefault();var t=e.clientX-ct,n=e.clientY-pt;document.body.onmousemove=function(e){var i=e.clientX-t,r=e.clientY-n,o=document.getElementsByClassName("markdown-popup-form")[0],a=window.innerWidth-o.offsetWidth,l=window.innerHeight-o.offsetHeight;i=Math.max(0,Math.min(i,a)),r=Math.max(0,Math.min(r,l)),At(e.clientX,e.clientY,t,n)&&(ut(i),ft(r))},document.body.onmouseup=function(){document.body.onmousemove=null}},children:he[Ke]}),open:!0,onCancel:Mt,footer:null,destroyOnClose:!0,width:Ke===Q?"1200px":null,height:Ke===Q?"80vh":null,className:"markdown-popup-form",children:Et}):null})]})}},13889:function(e,t,n){"use strict";n.d(t,{Z:function(){return x},I:function(){return C}});var i=n(82242),r=n.n(i),o=n(79800),a=n.n(o),l=n(28284),s=n(6767),c=n(37568),u=n(77736),h=n(71051),d=n(47889),p=n(99571),f=n(78988),m=n(59301),v=n(37712),g=l.Z.useForm,y={width:280,marginRight:10},b={labelCol:{span:5},wrapperCol:{span:19}},x=function(e){var t=e.callback,n=e.onCancel,i=g(),o=a()(i,1)[0],f=(0,m.useRef)();function x(e,t){-1!==e.status?o.setFieldsValue({src:"/api/attachments/".concat(e.id),type:t.type}):s.ZP.error(e.message)}return(0,v.jsxs)(l.Z,r()(r()({form:o},b),{},{className:"upload-image-panel",onFinish:function(e){f.current.width=o.getFieldValue("width"),f.current.align=o.getFieldValue("align"),t(e,f.current)},style:{width:470,overflow:"hidden"},children:[(0,v.jsx)(l.Z.Item,{label:"图片地址",required:!0,children:(0,v.jsxs)("div",{className:"flex-container",children:[(0,v.jsx)(l.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,v.jsx)(c.Z,{style:y})}),(0,v.jsx)(w,{onFileChange:function(e){var t=e.target.files[0];f.current=t,C(t,x)}})]})}),(0,v.jsx)(l.Z.Item,{label:"图片描述",name:"alt",children:(0,v.jsx)(c.Z,{style:{width:264}})}),(0,v.jsx)(l.Z.Item,{label:"图片宽度",name:"width",children:(0,v.jsxs)(u.Z,{children:[(0,v.jsx)(l.Z.Item,{name:"width",style:{margin:0},children:(0,v.jsx)(h.Z,{style:{width:264}})}),(0,v.jsx)("span",{className:"ml8",children:"%"})]})}),(0,v.jsx)(l.Z.Item,{label:"对齐方式",name:"align",children:(0,v.jsx)(d.ZP.Group,{name:"align",defaultValue:1,options:[{value:"left",label:"左对齐"},{value:"center",label:"居中对齐"},{value:"right",label:"右对齐"}]})}),(0,v.jsx)("aside",{children:(0,v.jsxs)(l.Z.Item,{style:{textAlign:"right",position:"relative",right:-98},children:[(0,v.jsx)(p.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,v.jsx)(p.ZP,{type:"default",onClick:n,children:"取消"})]})})]}))};function w(e){var t=e.onFileChange;return(0,v.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,v.jsx)("input",{type:"file",onChange:t})]})}function C(e,t){if(!e)throw new String("没有文件");var n=new FormData;n.append("editormd-image-file",e),n.append("file_param_name","editormd-image-file"),n.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(n){t(JSON.parse(n.target.responseText),e)}),!1),i.addEventListener("error",(function(e){console.error(e)}),!1),i.open("POST","".concat(f.KI,"/api/attachments.json")),i.send(n)}},82255:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var i=n(82100),r=n.n(i),o=n(29186),a=n.n(o),l=n(80619),s=n.n(l),c=n(47074),u=n.n(c),h=n(59301),d=n(4676),p=function(e){s()(n,e);var t=u()(n);function n(e){var i;r()(this,n),i=t.call(this,e);var o=window.document;return i.node=o.createElement("div"),o.body.appendChild(i.node),i}return a()(n,[{key:"render",value:function(){var e=this.props.children;return(0,d.createPortal)(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),n}(h.Component)},92068:function(e,t,n){"use strict";n.d(t,{SV:function(){return J},ZP:function(){return X}});var i=n(82242),r=n.n(i),o=n(37205),a=n.n(o),l=n(91232),s=n.n(l),c=n(79800),u=n.n(c),h=n(39647),d=n.n(h),p=n(7557),f=n.n(p),m=n(41498),v=n.n(m),g=n(59301),y=n(76374),b=["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"],x={quickKey:[{label:"main",content:["public static void main(String[] args) {","\t$0","}"].join("\n")},{label:"System.out.println",content:["System.out.println($0)"].join("\n")},{label:"System.out.print",content:["System.out.print($0)"].join("\n")}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},w={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {","\t$0","} else {","\t","}"].join("\n")},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {","\t$0","}"].join("\n")},{label:"if",content:["if () {","\t$0","}"].join("\n")},{label:"for",content:["for(int j=0 ; j<10; j++){","\t$0","}"].join("\n")},{label:"trycatch",content:["try{","\t$0","}catch(ExceptionName e){","}"].join("\n")},{label:"using namespace std;",content:["using namespace std;"].join("\n")},{label:"include <iostream>",content:["#include <iostream>"].join("\n")},{label:"include <vector>",content:["#include <vector>"].join("\n")},{label:"include <cstdio>",content:["#include <cstdio>"].join("\n")},{label:"include <cstring>",content:["#include <cstring>"].join("\n")},{label:"include <sstream>",content:["#include <sstream>"].join("\n")},{label:"include <fstream>",content:["#include <fstream>"].join("\n")},{label:"include <map>",content:["#include <map>"].join("\n")},{label:"include <string>",content:["#include <string>"].join("\n")},{label:"include <cmath>",content:["#include <cmath>"].join("\n")}]},C={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join("\n")}]},k={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join("\n")}]},S=n(53184),E=n.n(S),M={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},T=function(e,t,n,i){e.languages.registerCompletionItemProvider(t,{provideCompletionItems:function(t,r){var o=t.getWordUntilPosition(r),l={startLineNumber:r.lineNumber,endLineNumber:r.lineNumber,startColumn:o.startColumn,endColumn:o.endColumn},s=t.getLineContent(r.lineNumber).substring(o.startColumn-2,o.endColumn),c=function(e,t,n,i){var r=t.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column});return Array.from(new Set(r.match(/\b\w{2,}\b/g)||[])).map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Text,insertText:t,range:i}}))}(e,t,r,l);return{suggestions:[].concat(a()(c),a()(n.map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Keyword,documentation:t,insertText:t,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:l}}))),a()(i.map((function(t){return{label:t.label,kind:e.languages.CompletionItemKind.Snippet,documentation:t.content,insertText:s.startsWith("#")?t.content.replace(/#/,""):t.content,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:l}}))))}}})},L=n(82100),A=n.n(L),D=n(29186),P=n.n(D),N=n(85573),B=n.n(N),_=function(){function e(t,n,i){var r=this;A()(this,e),this.placeholder=t,this.editor=n,this.monaco=i,n.onDidChangeModelContent((function(){return r.onDidChangeModelContent()})),this.onDidChangeModelContent()}return P()(e,[{key:"onDidChangeModelContent",value:function(){""===this.editor.getValue()?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}},{key:"getId",value:function(){return e.ID}},{key:"getDomNode",value:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}},{key:"getPosition",value:function(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}},{key:"dispose",value:function(){this.editor.removeContentWidget(this)}}]),e}();B()(_,"ID","editor.widget.placeholderHint");var I=_,O=n(96236),R=n(6767),j=n(25399),F=n(89392),Z=n(70717),z=n(56102),H=n(37712),W=["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"];function G(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}function V(){}var U={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale",solidity:"sol"};function q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e;if(Array.isArray(e)){for(var n=0;n<e.length;n++){var i=U[e[n]];if(i)return i}return t[0]}return U[t]||t}var K=null,Y=function(){var e=v()(f()().mark((function e(){return f()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,navigator.clipboard.writeText(" ");case 3:console.log("内容已自动复制到剪贴板:"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("自动复制失败:",e.t0);case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),X=function(e){var t=e.width,i=void 0===t?"100%":t,o=e.height,l=void 0===o?"100%":o,c=e.value,h=e.language,p=void 0===h?"javascript":h,m=e.style,S=void 0===m?{}:m,L=e.options,A=void 0===L?{}:L,D=e.overrideServices,P=void 0===D?{}:D,N=e.theme,B=void 0===N?"vs-dark":N,_=e.onEditBlur,U=e.isCopy,X=void 0!==U&&U,J=e.onSave,Q=e.autoHeight,$=void 0!==Q&&Q,ee=e.forbidCopy,te=void 0!==ee&&ee,ne=e.onChange,ie=void 0===ne?V:ne,re=e.editorDidMount,oe=void 0===re?V:re,ae=e.onFocus,le=void 0===ae?V:ae,se=e.onBreakPoint,ce=void 0===se?V:se,ue=e.breakPointValue,he=void 0===ue?[]:ue,de=e.filename,pe=void 0===de?"educoder.txt":de,fe=e.errorLine,me=e.errorContent,ve=void 0===me?"":me,ge=e.highlightLine,ye=e.openBreakPoint,be=void 0!==ye&&ye,xe=e.placeholder,we=void 0===xe?"":xe,Ce=e.showMiniMap,ke=void 0===Ce||Ce,Se=(d()(e,W),(0,g.useRef)()),Ee=(0,g.useRef)({}),Me=(0,g.useRef)(),Te=(0,g.useRef)(),Le=(0,g.useRef)([]),Ae=(0,g.useRef)(!1),De=(0,g.useRef)(),Pe=(0,g.useRef)(),Ne=(0,g.useRef)(!1),Be=(0,g.useState)(!1),_e=u()(Be,2),Ie=_e[0],Oe=_e[1];(0,g.useEffect)((function(){var e=Z.Z.subscribe("formatDocument",(function(e){var t,n=Ee.current.instance;null==n||null===(t=n.getAction)||void 0===t||t.call(n,"editor.action.formatDocument").run()}));return window.updateMonacoValue=function(e){ie(e)},e}),[]),(0,g.useEffect)((function(){var e,t=Ee.current.instance;(Te.current&&clearTimeout(Te.current),Te.current=setTimeout((function(){!function(){var e=Ee.current.instance;if(null!=c&&e&&Ie){var t=e.getModel();t&&c!==t.getValue()&&(!0,t.setValue(c),e.layout(),!1)}}()}),500),c&&null!=c&&c.length)&&(null==t||null===(e=t.updateOptions)||void 0===e||e.call(t,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(c.split(/\r\n|\r|\n/g).length))+3,5)}))}),[c,Ie,Ee.current]),(0,g.useEffect)((function(){if(fe&&Ee.current&&Ee.current.instance){var e=Ee.current.instance;e.changeViewZones((function(e){var t=document.createElement("div");t.style.padding="10px 20px",t.style.width="calc(100% - 20px)",t.className="my-error-line-wrp",t.innerHTML=ve,e.addZone({afterLineNumber:fe||11,heightInLines:3,domNode:t})}));var t={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};e.addOverlayWidget(t),e.revealPositionInCenter({lineNumber:20,column:1})}}),[fe,Ee.current,Ie]);var Re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!e||""===e.trim())return!0;for(var n=Ee.current.instance.getModel(),i=n.getLineTokens(t),r=!1,o=0;o<2;o++)1===i.getStandardTokenType(o)&&(r=!0);return r};function je(e){(window.navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)&&83==e.keyCode&&(e.preventDefault(),J())}(0,g.useEffect)((function(){var e,t=null===(e=Ee.current)||void 0===e?void 0:e.instance;if(t&&Ie&&te){var n=t.onDidBlurEditorWidget((function(){Ne.current=!1})),i=t.onDidFocusEditorText((function(){Ne.current=!0}));return function(){n.dispose(),i.dispose()}}}),[Ee.current,Ie,te]),(0,g.useEffect)((function(){var e;if(null!==(e=Ee.current)&&void 0!==e&&e.instance&&Ie&&be){var t=Ee.current.instance,n=t.getModel();if(!n)return;!function(){var e,i=[],r=[],o=n.getAllDecorations(),a=s()(o);try{for(a.s();!(e=a.n()).done;){var l,c=e.value;if("highlighted-line"===c.options.className)i.push(null==c||null===(l=c.range)||void 0===l?void 0:l.startLineNumber),r.push(null==c?void 0:c.id)}}catch(e){a.e(e)}finally{a.f()}if(ge!==i[0]){n.deltaDecorations(r,[]);var u=n.getLineCount();ge&&ge<=u&&(t.deltaDecorations([],[{range:new K.Range(ge,1,ge,n.getLineMaxColumn(ge)),options:{isWholeLine:!0,className:"highlighted-line"}}]),t.revealLineInCenter(ge))}}();var i=function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=[],r=[],o=n.getAllDecorations(),a=s()(o);try{for(a.s();!(e=a.n()).done;){var l,c=e.value;if("breakpoints-select"===c.options.linesDecorationsClassName)i.push(null==c||null===(l=c.range)||void 0===l?void 0:l.startLineNumber),r.push(null==c?void 0:c.id)}}catch(e){a.e(e)}finally{a.f()}if(t)return{lines:i,ids:r};ce(i)},r=function(){var e=v()(f()().mark((function e(t){var r;return f()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={range:new K.Range(t,1,t,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}},e.next=3,n.deltaDecorations([],[r]);case 3:i();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),o=function(){var e=v()(f()().mark((function e(r){var o,a,l,c,u;return f()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=t.getLineDecorations(r),l=s()(a);try{for(l.s();!(c=l.n()).done;)"breakpoints-select"===(u=c.value).options.linesDecorationsClassName&&o.push(u.id)}catch(e){l.e(e)}finally{l.f()}return e.next=6,n.deltaDecorations(o,[]);case 6:i();case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),a=function(e){var n,i=t.getLineDecorations(e),r=s()(i);try{for(r.s();!(n=r.n()).done;){if("breakpoints-select"===n.value.options.linesDecorationsClassName)return!0}}catch(e){r.e(e)}finally{r.f()}return!1};if(!(0,F.isEqual)(he,i(!0).lines)){n.deltaDecorations(i(!0).ids,[]);var l=he.map((function(e){return{range:new K.Range(e,1,e,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}}));n.deltaDecorations([],l)}var c=t.onDidChangeModelContent((function(e){var l=t.getPosition();if(l){var s=l.lineNumber;clearTimeout(Pe.current),Pe.current=setTimeout((function(){Re(n.getLineContent(s),s)?o(s):a(s)?(o(s),r(s)):i()}),100)}})),u=t.onMouseDown((function(e){var t;if(e.target.detail&&null!==(t=e.target)&&void 0!==t&&null!==(t=t.element)&&void 0!==t&&null!==(t=t.className)&&void 0!==t&&t.includes("line-numbers")){var i=e.target.position.lineNumber;if(Re(n.getLineContent(i),i))return;a(i)?o(i):r(i)}})),h=function(){Le.current=t.deltaDecorations(Le.current,[])},d=t.onMouseMove((function(e){var i;if(h(),e.target.detail&&null!==(i=e.target)&&void 0!==i&&null!==(i=i.element)&&void 0!==i&&null!==(i=i.className)&&void 0!==i&&i.includes("line-numbers")){var r=e.target.position.lineNumber;if(Re(n.getLineContent(r),r))return;!function(e){var n={range:new K.Range(e,1,e,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Le.current=t.deltaDecorations(Le.current,[n])}(r)}})),p=t.onMouseLeave((function(){h()}));return function(){c.dispose(),u.dispose(),d.dispose(),p.dispose()}}}),[Ee.current,Ie,he,ge,be,p]),(0,g.useEffect)((function(){var e;null!==(e=Ee.current)&&void 0!==e&&e.instance&&be&&Ee.current.instance.setPosition({lineNumber:0,column:0})}),[ge]);var Fe=function(){if($&&Ee.current.instance){var e=Ee.current.instance.getContentHeight();Ke(e<l?l:e)}else Ke(l)};var Ze=function(e){if(Ne.current){var t=e.keyCode,n=e.ctrlKey,i=e.metaKey,r=e.target;return"paste"!==e.type&&(67!==t&&86!==t||!i&&!n)||"TEXTAREA"!==r.nodeName||(R.ZP.warning({content:decodeURIComponent("该任务关卡设置了禁止复制粘贴,请手动输入代码。"),key:"monaco-editor-tip"}),e.preventDefault()),!1}};function ze(e,t){var n,i,r=window.URL||window.webkitURL||window,o=new Blob([t]),a=document.createElementNS("http://www.w3.org/1999/xhtml","a");a.href=r.createObjectURL(o),a.download=e,n=a,(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}(0,g.useEffect)((function(){Fe()}),[Fe]),(0,g.useEffect)((function(){Se.current&&!Ie&&Promise.all([n.e(8909),n.e(5028)]).then(n.bind(n,71448)).then((function(e){try{K=e,Ee.current.instance=K.editor.create(Se.current,{value:c,language:q(p),theme:B,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:ke||!1}},P);var t=Ee.current.instance,n=O.BH._menuItems,i=a()(n).find((function(e){return"EditorContext"==e[0]._debugName}))[1];if(oe(t,K),setTimeout((function(){Fe(),Ee.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ze(pe||"educoder.txt",t.getValue())}})}),500),Ee.current.subscription=t.onDidChangeModelContent((function(e){Ae.current?clearTimeout(De.current):(Fe(),ie(t.getValue(),e)),De.current=setTimeout((function(){Ae.current=!1}),500)})),window.Monaco||function(e){M.languages.forEach((function(t){e.languages.registerDocumentFormattingEditProvider(t,{provideDocumentFormattingEdits:function(e){return v()(f()().mark((function t(){var n;return f()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=E()(e.getValue(),{indent_size:2,indent_char:" ",max_preserve_newlines:2,preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:0,indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),t.abrupt("return",[{range:e.getFullModelRange(),text:n}]);case 2:case"end":return t.stop()}}),t)})))()}})})),T(e,"java",x.keywords,x.quickKey),T(e,"cpp",w.keywords,w.quickKey),T(e,"c",b,[]),T(e,"python",C.keywords,C.quickKey),T(e,"scala",k.keywords,k.quickKey)}(K,q(p)),te&&(!function(e,t){var n=e._first;do{var i;t.includes(null===(i=n.element)||void 0===i||null===(i=i.command)||void 0===i?void 0:i.id)&&e._remove(n)}while(n=n.next)}(i,["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"]),Se.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Ze),window.removeEventListener("paste",Ze),window.addEventListener("keydown",Ze),window.addEventListener("paste",Ze)),window.Monaco=K,_&&t.onDidBlurEditorWidget((function(){_(t.getValue())})),le&&t.onDidFocusEditorText((function(){te&&Y(),le(t.getValue())})),te){Y();try{t.onDidPaste((function(e){var n=t.getSelection(),i=Ee.current.pastePos||{};new K.Range(i.startLineNumber||n.endLineNumber,i.startColumn||n.endColumn,i.endLineNumber||n.endLineNumber,i.endColumn||n.endColumn);t.executeEdits("",[{range:e.range,text:""}])}))}catch(e){}}var r=function(){var e;return Se.current&&(e=new y.Z((function(e){var t,n=s()(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&Ee.current.instance.layout()}}catch(e){n.e(e)}finally{n.f()}}))).observe(Se.current),e}();return we&&"string"==typeof we&&new I(we,t,K),Oe(!0),function(){var e=Ee.current.instance;e.dispose();var t=e.getModel();t&&t.dispose(),Ee.current.subscription&&Ee.current.subscription.dispose(),r.unobserve(Se.current)}}catch(e){}}))}),[]),(0,g.useEffect)((function(){if(Ee.current.instance&&Ie)return document.addEventListener("keydown",je,!1),function(){document.removeEventListener("keydown",je)}}),[J,Ie]),(0,g.useEffect)((function(){var e=Ee.current.instance;if(e&&Ie){var t=q(p);K.editor.setModelLanguage(e.getModel(),t)}}),[p,Ie]),(0,g.useEffect)((function(){Ee.current.instance&&Ie&&K.editor.setTheme(B)}),[B,Ie]),(0,g.useEffect)((function(){var e=Ee.current.instance;Me.current=A,e&&Ie&&(e.updateOptions(r()({},A)),setTimeout((function(){e.getModel().updateOptions(r()({},A))}),200))}),[JSON.stringify(A),Ie]),(0,g.useEffect)((function(){var e=Ee.current.instance;e&&Ie&&e.layout()}),[i,l,Ie]);var He=(0,g.useState)(G(i)),We=u()(He,2),Ge=We[0],Ve=(We[1],(0,g.useState)(G(l))),Ue=u()(Ve,2),qe=Ue[0],Ke=Ue[1],Ye=r()(r()({},S),{},{width:Ge,height:qe,position:"relative"});return(0,H.jsx)("div",{className:"my-monaco-editor",ref:Se,style:Ye,children:X&&(0,H.jsx)(z.CopyToClipboard,{text:c,onCopy:function(){return R.ZP.success("复制成功")},children:(0,H.jsx)(j.Z,{title:"复制代码",children:(0,H.jsxs)("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"},children:[(0,H.jsx)("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," 复制代码"]})})})})};function J(e){var t=e.width,i=void 0===t?"100%":t,o=e.height,a=void 0===o?"100%":o,l=e.original,c=e.modified,h=e.language,d=e.options,p=void 0===d?{}:d,f=(0,g.useRef)(),m=(0,g.useState)(null),v=u()(m,2),b=v[0],x=v[1];(0,g.useEffect)((function(){return f.current&&Promise.all([n.e(8909),n.e(9404)]).then(n.bind(n,2550)).then((function(e){var t=(K=e).editor.createDiffEditor(f.current,r()(r()({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},p),{},{wordWrap:!0}));x(t);var n=function(e){var t;return f.current&&(t=new y.Z((function(t){var n,i=s()(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;(r.target.offsetHeight>0||r.target.offsetWidth>0)&&e.layout()}}catch(e){i.e(e)}finally{i.f()}}))).observe(f.current),t}(t);return function(){t.dispose();var e=t.getModel();e&&e.dispose(),n.unobserve(f.current)}})),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}}),[]),(0,g.useEffect)((function(){b&&b.setModel({original:K.editor.createModel(l,h),modified:K.editor.createModel(c,h)})}),[l,c,h,b]);var w={width:G(i),height:G(a)};return(0,H.jsx)("div",{className:"my-diff-editor",ref:f,style:w})}},22336:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var i=n(59301);function r(e,t){var n=(0,i.useRef)();(0,i.useEffect)((function(){n.current=e})),(0,i.useEffect)((function(){if(null!==t){var e=setInterval((function(){n.current()}),t);return function(){return clearInterval(e)}}}),[t])}},82158:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return N}});var i=n(7557),r=n.n(i),o=n(82242),a=n.n(o),l=n(41498),s=n.n(l),c=n(79800),u=n.n(c),h=n(39647),d=n.n(h),p=n(59301),f=n(58358),m=n(53260),v=n(93041),g=n(24404),y=n(28284),b=n(6767),x=n(91882),w=n(77019),C=n(5269),k=n(82326),S=n(37568),E=n(37285),M=n(17149),T=n(99571),L=n(57725),A={flex_box_center:"flex_box_center___JefHi",flex_space_between:"flex_space_between___N1h0l",flex_box_vertical_center:"flex_box_vertical_center___Mtb4t",flex_box_center_end:"flex_box_center_end___F6G6K",flex_box_column:"flex_box_column___JldFX",bg:"bg___Hgook",title:"title____XaYs",titleLeft:"titleLeft___xe0PB",titleRight:"titleRight___wML5g",btns:"btns___l22_n"},D=n(37712),P=["graduation","globalSetting","loading","user","dispatch"],N=(v.Z.SubMenu,g.Z.Content,g.Z.Sider,(0,m.connect)((function(e){var t=e.graduation,n=e.loading,i=e.user;return{graduation:t,globalSetting:e.globalSetting,user:i,loading:n.effects}}))((function(e){var t,n,i,o,l,c,h,v=e.graduation,g=(e.globalSetting,e.loading,e.user),N=e.dispatch,B=(d()(e,P),(0,m.useParams)()),_=((0,m.useLocation)(),g.userInfo),I=y.Z.useForm(),O=u()(I,1)[0],R=v.addTopicData,j=function(){var e=s()(r()().mark((function e(){var t,n,i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=O.getFieldsValue(),(n=a()({},t)).city&&(n.province=n.city[0],n.city=n.city[1]),e.next=5,N({type:"graduation/addTopic",payload:{coursesId:B.coursesId,attachment_ids:[],graduation_topic:n}});case 5:(i=e.sent).status?b.ZP.error(i.message):m.history.push("/classrooms/".concat(B.coursesId,"/graduation_topics/").concat(B.categoryId));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,p.useEffect)((function(){N({type:"graduation/addTopicDefaultData",payload:a()({},B)})}),[B.coursesId]),(0,D.jsxs)("section",{className:"edu-container",children:[(0,D.jsxs)("section",{className:"animated fadeIn",children:[(0,D.jsx)("aside",{className:"mt10",children:_&&(0,D.jsxs)(x.Z,{separator:">",children:[(0,D.jsx)(x.Z.Item,{children:(0,D.jsx)(m.Link,{to:"".concat(_.first_category_url),children:null==_||null===(t=_.course)||void 0===t?void 0:t.course_name})}),(0,D.jsx)(x.Z.Item,{children:(0,D.jsx)(m.Link,{to:"/classrooms/".concat(B.coursesId,"/graduation_topics/").concat(B.categoryId),children:"毕设选题"})}),(0,D.jsx)(x.Z.Item,{children:"新建"})]})}),(0,D.jsx)("aside",{className:[A.title,"mt20"].join(" "),children:(0,D.jsxs)(w.Z,{style:{width:"100%"},children:[(0,D.jsx)(C.Z,{flex:"1",children:(0,D.jsx)("strong",{className:"font20 ml5",children:"新建毕设选题"})}),(0,D.jsx)(C.Z,{children:(0,D.jsx)(m.Link,{className:"font16 c-light-black",to:"/classrooms/".concat(B.coursesId,"/exercise"),children:"返回"})})]})})]}),(0,D.jsx)("section",{className:[A.bg,"pt30","pl30","pr30","pb30","mt20"].join(" "),children:(0,D.jsxs)(y.Z,{layout:"vertical",form:O,scrollToFirstError:!0,onFinish:function(){var e=s()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:j();case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),children:[(0,D.jsx)(y.Z.Item,{name:"tea_id",label:"指导老师:",rules:[{required:!0,message:"请选择指导老师"}],children:(0,D.jsx)(k.default,{size:"middle",placeholder:"请选择指导老师",style:{width:200},children:null===(n=R.teacher_list)||void 0===n?void 0:n.map((function(e,t){return(0,D.jsx)(k.default.Option,{value:e.id,children:e.name},t)}))})}),(0,D.jsx)(y.Z.Item,{name:"name",label:"选题名称:",rules:[{required:!0,message:"请填写试卷标题"}],children:(0,D.jsx)(S.Z,{maxLength:60,size:"middle",placeholder:"试卷标题最大限制60个字符"})}),(0,D.jsx)(E.Z,{}),(0,D.jsx)(y.Z.Item,{label:"选题简介",name:"description",rules:[{required:!0,message:"请输入内容"}],children:(0,D.jsx)(f.Z,{watch:!0,placeholder:"请简要说明选题内容最大限制5000个字符"})}),(0,D.jsxs)(w.Z,{gutter:[20,0],children:[(0,D.jsx)(C.Z,{flex:"1",children:(0,D.jsx)(y.Z.Item,{name:"topic_type",children:(0,D.jsx)(k.default,{size:"middle",placeholder:"请选择选题类型",children:null===(i=R.topic_type)||void 0===i?void 0:i.map((function(e,t){return(0,D.jsx)(k.default.Option,{value:e.id,children:e.name},t)}))})})}),(0,D.jsx)(C.Z,{flex:"1",children:(0,D.jsx)(y.Z.Item,{name:"topic_source",children:(0,D.jsx)(k.default,{size:"middle",placeholder:"请选择选题来源",children:null===(o=R.topic_source)||void 0===o?void 0:o.map((function(e,t){return(0,D.jsx)(k.default.Option,{value:e.id,children:e.name},t)}))})})}),(0,D.jsx)(C.Z,{flex:"1",children:(0,D.jsx)(y.Z.Item,{name:"topic_property_first",children:(0,D.jsx)(k.default,{size:"middle",placeholder:"请选择选题性质1",children:null===(l=R.topic_property_first)||void 0===l?void 0:l.map((function(e,t){return(0,D.jsx)(k.default.Option,{value:e.id,children:e.name},t)}))})})}),(0,D.jsx)(C.Z,{flex:"1",children:(0,D.jsx)(y.Z.Item,{name:"topic_property_second",children:(0,D.jsx)(k.default,{size:"middle",placeholder:"请选择选题性质2",children:null===(c=R.topic_property_second)||void 0===c?void 0:c.map((function(e,t){return(0,D.jsx)(k.default.Option,{value:e.id,children:e.name},t)}))})})}),(0,D.jsx)(C.Z,{flex:"150px"})]}),(0,D.jsx)(E.Z,{}),(0,D.jsx)(y.Z.Item,{name:"source_unit",label:"选题来源单位:",children:(0,D.jsx)(S.Z,{width:"200",size:"middle",style:{width:200},placeholder:"请填写来源单位"})}),(0,D.jsx)(y.Z.Item,{name:"topic_repeat",label:"选题重复情况:",children:(0,D.jsx)(k.default,{size:"middle",placeholder:"请选择重复情况",style:{width:200},children:null===(h=R.topic_repeat)||void 0===h?void 0:h.map((function(e,t){return(0,D.jsx)(k.default.Option,{value:e.id,children:e.name},t)}))})}),(0,D.jsx)(y.Z.Item,{name:"city",label:"调研或实习地点:",children:(0,D.jsx)(M.Z,{size:"middle",style:{width:200},options:L.P,placeholder:"请选择所在地"})})]})}),(0,D.jsxs)("aside",{className:A.btns,children:[(0,D.jsx)(T.ZP,{type:"primary",onClick:function(){O.submit()},children:"保存"}),(0,D.jsx)(m.Link,{to:"/classrooms/".concat(B.coursesId,"/graduation_topics/").concat(B.categoryId),children:"取消"})]})]})})))},57725:function(e,t,n){"use strict";n.d(t,{P:function(){return i}});var i=[{value:"北京",label:"北京",children:[{value:"东城",label:"东城"},{value:"西城",label:"西城"},{value:"朝阳",label:"朝阳"},{value:"丰台",label:"丰台"},{value:"石景山",label:"石景山"},{value:"海淀",label:"海淀"},{value:"门头沟",label:"门头沟"},{value:"房山",label:"房山"},{value:"通州",label:"通州"},{value:"顺义",label:"顺义"},{value:"昌平",label:"昌平"},{value:"大兴",label:"大兴"},{value:"平谷",label:"平谷"},{value:"怀柔",label:"怀柔"},{value:"密云",label:"密云"},{value:"延庆",label:"延庆"}]},{value:"上海",label:"上海",children:[{value:"崇明",label:"崇明"},{value:"黄浦",label:"黄浦"},{value:"卢湾",label:"卢湾"},{value:"徐汇",label:"徐汇"},{value:"长宁",label:"长宁"},{value:"静安",label:"静安"},{value:"普陀",label:"普陀"},{value:"闸北",label:"闸北"},{value:"虹口",label:"虹口"},{value:"杨浦",label:"杨浦"},{value:"闵行",label:"闵行"},{value:"宝山",label:"宝山"},{value:"嘉定",label:"嘉定"},{value:"浦东",label:"浦东"},{value:"金山",label:"金山"},{value:"松江",label:"松江"},{value:"青浦",label:"青浦"},{value:"南汇",label:"南汇"},{value:"奉贤",label:"奉贤"}]},{value:"广东",label:"广东",children:[{value:"广州",label:"广州"},{value:"深圳",label:"深圳"},{value:"珠海",label:"珠海"},{value:"东莞",label:"东莞"},{value:"中山",label:"中山"},{value:"佛山",label:"佛山"},{value:"惠州",label:"惠州"},{value:"河源",label:"河源"},{value:"潮州",label:"潮州"},{value:"江门",label:"江门"},{value:"揭阳",label:"揭阳"},{value:"茂名",label:"茂名"},{value:"梅州",label:"梅州"},{value:"清远",label:"清远"},{value:"汕头",label:"汕头"},{value:"汕尾",label:"汕尾"},{value:"韶关",label:"韶关"},{value:"顺德",label:"顺德"},{value:"阳江",label:"阳江"},{value:"云浮",label:"云浮"},{value:"湛江",label:"湛江"},{value:"肇庆",label:"肇庆"}]},{value:"江苏",label:"江苏",children:[{value:"南京",label:"南京"},{value:"常熟",label:"常熟"},{value:"常州",label:"常州"},{value:"海门",label:"海门"},{value:"淮安",label:"淮安"},{value:"江都",label:"江都"},{value:"江阴",label:"江阴"},{value:"昆山",label:"昆山"},{value:"连云港",label:"连云港"},{value:"南通",label:"南通"},{value:"启东",label:"启东"},{value:"沭阳",label:"沭阳"},{value:"宿迁",label:"宿迁"},{value:"苏州",label:"苏州"},{value:"太仓",label:"太仓"},{value:"泰州",label:"泰州"},{value:"同里",label:"同里"},{value:"无锡",label:"无锡"},{value:"徐州",label:"徐州"},{value:"盐城",label:"盐城"},{value:"扬州",label:"扬州"},{value:"宜兴",label:"宜兴"},{value:"仪征",label:"仪征"},{value:"张家港",label:"张家港"},{value:"镇江",label:"镇江"}]},{value:"重庆",label:"重庆",children:[{value:"万州",label:"万州"},{value:"涪陵",label:"涪陵"},{value:"渝中",label:"渝中"},{value:"大渡口",label:"大渡口"},{value:"江北",label:"江北"},{value:"沙坪坝",label:"沙坪坝"},{value:"九龙坡",label:"九龙坡"},{value:"南岸",label:"南岸"},{value:"北碚",label:"北碚"},{value:"万盛",label:"万盛"},{value:"双挢",label:"双挢"},{value:"渝北",label:"渝北"},{value:"巴南",label:"巴南"},{value:"黔江",label:"黔江"},{value:"长寿",label:"长寿"},{value:"綦江",label:"綦江"},{value:"潼南",label:"潼南"},{value:"铜梁",label:"铜梁"},{value:"大足",label:"大足"},{value:"荣昌",label:"荣昌"},{value:"壁山",label:"壁山"},{value:"梁平",label:"梁平"},{value:"城口",label:"城口"},{value:"丰都",label:"丰都"},{value:"垫江",label:"垫江"},{value:"武隆",label:"武隆"},{value:"忠县",label:"忠县"},{value:"开县",label:"开县"},{value:"云阳",label:"云阳"},{value:"奉节",label:"奉节"},{value:"巫山",label:"巫山"},{value:"巫溪",label:"巫溪"},{value:"石柱",label:"石柱"},{value:"秀山",label:"秀山"},{value:"酉阳",label:"酉阳"},{value:"彭水",label:"彭水"},{value:"江津",label:"江津"},{value:"合川",label:"合川"},{value:"永川",label:"永川"},{value:"南川",label:"南川"}]},{value:"安徽",label:"安徽",children:[{value:"合肥",label:"合肥"},{value:"安庆",label:"安庆"},{value:"蚌埠",label:"蚌埠"},{value:"亳州",label:"亳州"},{value:"巢湖",label:"巢湖"},{value:"滁州",label:"滁州"},{value:"阜阳",label:"阜阳"},{value:"贵池",label:"贵池"},{value:"淮北",label:"淮北"},{value:"淮化",label:"淮化"},{value:"淮南",label:"淮南"},{value:"黄山",label:"黄山"},{value:"九华山",label:"九华山"},{value:"六安",label:"六安"},{value:"马鞍山",label:"马鞍山"},{value:"宿州",label:"宿州"},{value:"铜陵",label:"铜陵"},{value:"屯溪",label:"屯溪"},{value:"芜湖",label:"芜湖"},{value:"宣城",label:"宣城"}]},{value:"福建",label:"福建",children:[{value:"福州",label:"福州"},{value:"厦门",label:"厦门"},{value:"泉州",label:"泉州"},{value:"漳州",label:"漳州"},{value:"龙岩",label:"龙岩"},{value:"南平",label:"南平"},{value:"宁德",label:"宁德"},{value:"莆田",label:"莆田"},{value:"三明",label:"三明"}]},{value:"甘肃",label:"甘肃",children:[{value:"兰州",label:"兰州"},{value:"嘉峪关",label:"嘉峪关"},{value:"白银",label:"白银"},{value:"定西",label:"定西"},{value:"敦煌",label:"敦煌"},{value:"甘南",label:"甘南"},{value:"金昌",label:"金昌"},{value:"酒泉",label:"酒泉"},{value:"临夏",label:"临夏"},{value:"平凉",label:"平凉"},{value:"天水",label:"天水"},{value:"陇南",label:"陇南"},{value:"武威",label:"武威"},{value:"西峰",label:"西峰"},{value:"张掖",label:"张掖"}]},{value:"广西",label:"广西",children:[{value:"南宁",label:"南宁"},{value:"来宾",label:"来宾"},{value:"百色",label:"百色"},{value:"北海",label:"北海"},{value:"桂林",label:"桂林"},{value:"防城港",label:"防城港"},{value:"贵港",label:"贵港"},{value:"河池",label:"河池"},{value:"贺州",label:"贺州"},{value:"柳州",label:"柳州"},{value:"钦州",label:"钦州"},{value:"梧州",label:"梧州"},{value:"玉林",label:"玉林"}]},{value:"贵州",label:"贵州",children:[{value:"贵阳",label:"贵阳"},{value:"安顺",label:"安顺"},{value:"毕节",label:"毕节"},{value:"都匀",label:"都匀"},{value:"凯里",label:"凯里"},{value:"六盘水",label:"六盘水"},{value:"铜仁",label:"铜仁"},{value:"兴义",label:"兴义"},{value:"玉屏",label:"玉屏"},{value:"遵义",label:"遵义"}]},{value:"海南",label:"海南",children:[{value:"海口",label:"海口"},{value:"儋县",label:"儋县"},{value:"陵水",label:"陵水"},{value:"琼海",label:"琼海"},{value:"三亚",label:"三亚"},{value:"通什",label:"通什"},{value:"万宁",label:"万宁"}]},{value:"河北",label:"河北",children:[{value:"石家庄",label:"石家庄"},{value:"保定",label:"保定"},{value:"北戴河",label:"北戴河"},{value:"沧州",label:"沧州"},{value:"承德",label:"承德"},{value:"丰润",label:"丰润"},{value:"邯郸",label:"邯郸"},{value:"衡水",label:"衡水"},{value:"廊坊",label:"廊坊"},{value:"南戴河",label:"南戴河"},{value:"秦皇岛",label:"秦皇岛"},{value:"唐山",label:"唐山"},{value:"新城",label:"新城"},{value:"邢台",label:"邢台"},{value:"张家口",label:"张家口"}]},{value:"黑龙江",label:"黑龙江",children:[{value:"哈尔滨",label:"哈尔滨"},{value:"北安",label:"北安"},{value:"大庆",label:"大庆"},{value:"大兴安岭",label:"大兴安岭"},{value:"鹤岗",label:"鹤岗"},{value:"黑河",label:"黑河"},{value:"佳木斯",label:"佳木斯"},{value:"鸡西",label:"鸡西"},{value:"牡丹江",label:"牡丹江"},{value:"齐齐哈尔",label:"齐齐哈尔"},{value:"七台河",label:"七台河"},{value:"双鸭山",label:"双鸭山"},{value:"绥化",label:"绥化"},{value:"伊春",label:"伊春"}]},{value:"河南",label:"河南",children:[{value:"郑州",label:"郑州"},{value:"安阳",label:"安阳"},{value:"鹤壁",label:"鹤壁"},{value:"潢川",label:"潢川"},{value:"焦作",label:"焦作"},{value:"济源",label:"济源"},{value:"开封",label:"开封"},{value:"漯河",label:"漯河"},{value:"洛阳",label:"洛阳"},{value:"南阳",label:"南阳"},{value:"平顶山",label:"平顶山"},{value:"濮阳",label:"濮阳"},{value:"三门峡",label:"三门峡"},{value:"商丘",label:"商丘"},{value:"新乡",label:"新乡"},{value:"信阳",label:"信阳"},{value:"许昌",label:"许昌"},{value:"周口",label:"周口"},{value:"驻马店",label:"驻马店"}]},{value:"香港",label:"香港",children:[{value:"香港",label:"香港"},{value:"九龙",label:"九龙"},{value:"新界",label:"新界"}]},{value:"湖北",label:"湖北",children:[{value:"武汉",label:"武汉"},{value:"天门",label:"天门"},{value:"恩施",label:"恩施"},{value:"鄂州",label:"鄂州"},{value:"黄冈",label:"黄冈"},{value:"黄石",label:"黄石"},{value:"荆门",label:"荆门"},{value:"荆州",label:"荆州"},{value:"潜江",label:"潜江"},{value:"十堰",label:"十堰"},{value:"随州",label:"随州"},{value:"武穴",label:"武穴"},{value:"仙桃",label:"仙桃"},{value:"咸宁",label:"咸宁"},{value:"襄阳",label:"襄阳"},{value:"襄樊",label:"襄樊"},{value:"孝感",label:"孝感"},{value:"宜昌",label:"宜昌"}]},{value:"湖南",label:"湖南",children:[{value:"长沙",label:"长沙"},{value:"常德",label:"常德"},{value:"郴州",label:"郴州"},{value:"衡阳",label:"衡阳"},{value:"怀化",label:"怀化"},{value:"吉首",label:"吉首"},{value:"娄底",label:"娄底"},{value:"邵阳",label:"邵阳"},{value:"湘潭",label:"湘潭"},{value:"益阳",label:"益阳"},{value:"岳阳",label:"岳阳"},{value:"永州",label:"永州"},{value:"张家界",label:"张家界"},{value:"株洲",label:"株洲"}]},{value:"江西",label:"江西",children:[{value:"南昌",label:"南昌"},{value:"抚州",label:"抚州"},{value:"赣州",label:"赣州"},{value:"吉安",label:"吉安"},{value:"景德镇",label:"景德镇"},{value:"井冈山",label:"井冈山"},{value:"九江",label:"九江"},{value:"庐山",label:"庐山"},{value:"萍乡",label:"萍乡"},{value:"上饶",label:"上饶"},{value:"新余",label:"新余"},{value:"宜春",label:"宜春"},{value:"鹰潭",label:"鹰潭"}]},{value:"吉林",label:"吉林",children:[{value:"长春",label:"长春"},{value:"吉林",label:"吉林"},{value:"白城",label:"白城"},{value:"白山",label:"白山"},{value:"珲春",label:"珲春"},{value:"辽源",label:"辽源"},{value:"梅河",label:"梅河"},{value:"四平",label:"四平"},{value:"松原",label:"松原"},{value:"通化",label:"通化"},{value:"延吉",label:"延吉"}]},{value:"辽宁",label:"辽宁",children:[{value:"沈阳",label:"沈阳"},{value:"鞍山",label:"鞍山"},{value:"本溪",label:"本溪"},{value:"朝阳",label:"朝阳"},{value:"大连",label:"大连"},{value:"丹东",label:"丹东"},{value:"抚顺",label:"抚顺"},{value:"阜新",label:"阜新"},{value:"葫芦岛",label:"葫芦岛"},{value:"锦州",label:"锦州"},{value:"辽阳",label:"辽阳"},{value:"盘锦",label:"盘锦"},{value:"铁岭",label:"铁岭"},{value:"营口",label:"营口"}]},{value:"澳门",label:"澳门",children:[{value:"澳门",label:"澳门"}]},{value:"内蒙古",label:"内蒙古",children:[{value:"呼和浩特",label:"呼和浩特"},{value:"阿拉善盟",label:"阿拉善盟"},{value:"包头",label:"包头"},{value:"赤峰",label:"赤峰"},{value:"东胜",label:"东胜"},{value:"海拉尔",label:"海拉尔"},{value:"集宁",label:"集宁"},{value:"临河",label:"临河"},{value:"通辽",label:"通辽"},{value:"乌海",label:"乌海"},{value:"乌兰浩特",label:"乌兰浩特"},{value:"锡林浩特",label:"锡林浩特"}]},{value:"宁夏",label:"宁夏",children:[{value:"银川",label:"银川"},{value:"固源",label:"固源"},{value:"石嘴山",label:"石嘴山"},{value:"吴忠",label:"吴忠"}]},{value:"青海",label:"青海",children:[{value:"西宁",label:"西宁"},{value:"德令哈",label:"德令哈"},{value:"格尔木",label:"格尔木"},{value:"共和",label:"共和"},{value:"海东",label:"海东"},{value:"海晏",label:"海晏"},{value:"玛沁",label:"玛沁"},{value:"同仁",label:"同仁"},{value:"玉树",label:"玉树"}]},{value:"山东",label:"山东",children:[{value:"济南",label:"济南"},{value:"滨州",label:"滨州"},{value:"兖州",label:"兖州"},{value:"德州",label:"德州"},{value:"东营",label:"东营"},{value:"菏泽",label:"菏泽"},{value:"济宁",label:"济宁"},{value:"莱芜",label:"莱芜"},{value:"聊城",label:"聊城"},{value:"临沂",label:"临沂"},{value:"蓬莱",label:"蓬莱"},{value:"青岛",label:"青岛"},{value:"曲阜",label:"曲阜"},{value:"日照",label:"日照"},{value:"泰安",label:"泰安"},{value:"潍坊",label:"潍坊"},{value:"威海",label:"威海"},{value:"烟台",label:"烟台"},{value:"枣庄",label:"枣庄"},{value:"淄博",label:"淄博"}]},{value:"山西",label:"山西",children:[{value:"太原",label:"太原"},{value:"吕梁",label:"吕梁"},{value:"长治",label:"长治"},{value:"大同",label:"大同"},{value:"候马",label:"候马"},{value:"晋城",label:"晋城"},{value:"离石",label:"离石"},{value:"临汾",label:"临汾"},{value:"宁武",label:"宁武"},{value:"朔州",label:"朔州"},{value:"忻州",label:"忻州"},{value:"阳泉",label:"阳泉"},{value:"榆次",label:"榆次"},{value:"晋中",label:"晋中"},{value:"运城",label:"运城"}]},{value:"陕西",label:"陕西",children:[{value:"西安",label:"西安"},{value:"安康",label:"安康"},{value:"宝鸡",label:"宝鸡"},{value:"汉中",label:"汉中"},{value:"渭南",label:"渭南"},{value:"商州",label:"商州"},{value:"绥德",label:"绥德"},{value:"铜川",label:"铜川"},{value:"咸阳",label:"咸阳"},{value:"延安",label:"延安"},{value:"榆林",label:"榆林"}]},{value:"四川",label:"四川",children:[{value:"成都",label:"成都"},{value:"巴中",label:"巴中"},{value:"达川",label:"达川"},{value:"德阳",label:"德阳"},{value:"都江堰",label:"都江堰"},{value:"峨眉山",label:"峨眉山"},{value:"涪陵",label:"涪陵"},{value:"广安",label:"广安"},{value:"广元",label:"广元"},{value:"九寨沟",label:"九寨沟"},{value:"康定",label:"康定"},{value:"乐山",label:"乐山"},{value:"泸州",label:"泸州"},{value:"马尔康",label:"马尔康"},{value:"绵阳",label:"绵阳"},{value:"眉山",label:"眉山"},{value:"南充",label:"南充"},{value:"内江",label:"内江"},{value:"攀枝花",label:"攀枝花"},{value:"遂宁",label:"遂宁"},{value:"汶川",label:"汶川"},{value:"西昌",label:"西昌"},{value:"雅安",label:"雅安"},{value:"宜宾",label:"宜宾"},{value:"自贡",label:"自贡"},{value:"资阳",label:"资阳"}]},{value:"台湾",label:"台湾",children:[{value:"台北",label:"台北"},{value:"基隆",label:"基隆"},{value:"台南",label:"台南"},{value:"台中",label:"台中"},{value:"高雄",label:"高雄"},{value:"屏东",label:"屏东"},{value:"南投",label:"南投"},{value:"云林",label:"云林"},{value:"新竹",label:"新竹"},{value:"彰化",label:"彰化"},{value:"苗栗",label:"苗栗"},{value:"嘉义",label:"嘉义"},{value:"桃园",label:"桃园"},{value:"宜兰",label:"宜兰"},{value:"台东",label:"台东"},{value:"金门",label:"金门"},{value:"马祖",label:"马祖"},{value:"澎湖",label:"澎湖"}]},{value:"天津",label:"天津",children:[{value:"天津",label:"天津"},{value:"和平",label:"和平"},{value:"东丽",label:"东丽"},{value:"河东",label:"河东"},{value:"西青",label:"西青"},{value:"河西",label:"河西"},{value:"津南",label:"津南"},{value:"南开",label:"南开"},{value:"北辰",label:"北辰"},{value:"河北",label:"河北"},{value:"武清",label:"武清"},{value:"红挢",label:"红挢"},{value:"塘沽",label:"塘沽"},{value:"汉沽",label:"汉沽"},{value:"大港",label:"大港"},{value:"宁河",label:"宁河"},{value:"静海",label:"静海"},{value:"宝坻",label:"宝坻"},{value:"蓟县",label:"蓟县"}]},{value:"新疆",label:"新疆",children:[{value:"乌鲁木齐",label:"乌鲁木齐"},{value:"阿克苏",label:"阿克苏"},{value:"阿勒泰",label:"阿勒泰"},{value:"阿图什",label:"阿图什"},{value:"博乐",label:"博乐"},{value:"昌吉",label:"昌吉"},{value:"东山",label:"东山"},{value:"哈密",label:"哈密"},{value:"和田",label:"和田"},{value:"喀什",label:"喀什"},{value:"克拉玛依",label:"克拉玛依"},{value:"库车",label:"库车"},{value:"库尔勒",label:"库尔勒"},{value:"奎屯",label:"奎屯"},{value:"石河子",label:"石河子"},{value:"塔城",label:"塔城"},{value:"吐鲁番",label:"吐鲁番"},{value:"伊宁",label:"伊宁"}]},{value:"西藏",label:"西藏",children:[{value:"拉萨",label:"拉萨"},{value:"阿里",label:"阿里"},{value:"昌都",label:"昌都"},{value:"林芝",label:"林芝"},{value:"那曲",label:"那曲"},{value:"日喀则",label:"日喀则"},{value:"山南",label:"山南"}]},{value:"云南",label:"云南",children:[{value:"昆明",label:"昆明"},{value:"大理",label:"大理"},{value:"保山",label:"保山"},{value:"楚雄",label:"楚雄"},{value:"大理",label:"大理"},{value:"东川",label:"东川"},{value:"个旧",label:"个旧"},{value:"景洪",label:"景洪"},{value:"开远",label:"开远"},{value:"临沧",label:"临沧"},{value:"丽江",label:"丽江"},{value:"六库",label:"六库"},{value:"潞西",label:"潞西"},{value:"曲靖",label:"曲靖"},{value:"思茅",label:"思茅"},{value:"文山",label:"文山"},{value:"西双版纳",label:"西双版纳"},{value:"玉溪",label:"玉溪"},{value:"中甸",label:"中甸"},{value:"昭通",label:"昭通"}]},{value:"浙江",label:"浙江",children:[{value:"杭州",label:"杭州"},{value:"温州",label:"温州"},{value:"安吉",label:"安吉"},{value:"慈溪",label:"慈溪"},{value:"定海",label:"定海"},{value:"奉化",label:"奉化"},{value:"海盐",label:"海盐"},{value:"黄岩",label:"黄岩"},{value:"湖州",label:"湖州"},{value:"嘉兴",label:"嘉兴"},{value:"金华",label:"金华"},{value:"临安",label:"临安"},{value:"临海",label:"临海"},{value:"丽水",label:"丽水"},{value:"宁波",label:"宁波"},{value:"瓯海",label:"瓯海"},{value:"平湖",label:"平湖"},{value:"千岛湖",label:"千岛湖"},{value:"衢州",label:"衢州"},{value:"江山",label:"江山"},{value:"瑞安",label:"瑞安"},{value:"绍兴",label:"绍兴"},{value:"嵊州",label:"嵊州"},{value:"台州",label:"台州"},{value:"温岭",label:"温岭"},{value:"余姚",label:"余姚"},{value:"舟山",label:"舟山"}]},{value:"海外",label:"海外",children:[{value:"美国",label:"美国"},{value:"日本",label:"日本"},{value:"英国",label:"英国"},{value:"法国",label:"法国"},{value:"德国",label:"德国"},{value:"其他",label:"其他"}]}]},75359:function(e,t,n){"use strict";n.d(t,{AL:function(){return k},Iy:function(){return p},Qv:function(){return v},ez:function(){return C},jb:function(){return f}});var i=n(79800),r=n.n(i),o=n(32834),a=n.n(o),l=n(11690),s=1;var c=[],u=["<ul>"],h=new(a().Renderer),d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function p(){c.length=0,u=["<ul>"]}var f={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(e,t,n,i){if(t>=e.length||e[t].level<=n)return t;var r=e[t];i.push("<li><a href='#"+s+r.anchor+"'>"+r.text+"</a>");var o=[];return t=m(e,++t,r.level,o),o.length>0&&(i.push("<ul>"),o.forEach((function(e){i.push(e)})),i.push("</ul>")),i.push("</li>"),t=m(e,t,n,i)}function v(){return m(c,0,0,u),u.push("</ul>"),u.join("")}var g={heading:function(e){var t=d.exec(e);if(s+=1,t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},fences:function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],i=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var i=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:r()(t,1)[0].length>=i.length?e.slice(i.length):e})).join("\n")}(n,t[3]||""),o=t[2]?t[2].trim():t[2];if(["latex","katex","math"].indexOf(o)>=0){var a=x(),l=i;i=a,w[a]={type:"block",expression:l}}return{type:"code",raw:n,lang:o,text:i}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,x=function(){return"__special_katext_id_".concat(b++,"__")},w={};function C(){return w}function k(){b=0,w={}}function S(e){return e=e.replace(y,(function(e,t){var n=x();return w[n]={type:"inline",expression:t},n}))}var E=h.listitem;h.listitem=function(e){return E(S(e))};var M=h.paragraph;h.paragraph=function(e){return M(S(e))};var T=h.tablecell;h.tablecell=function(e,t){return T(S(e),t)},h.code=function(e,t,n){var i=(t||"").match(/\S*/)[0];return i?["latex","katex","math"].indexOf(i)>=0?"<p class='editormd-tex'>".concat(e,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(t,'">').concat(n?e:(0,l.escape)(e,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(n?e:(0,l.escape)(e,!0))+"</code></pre>"},h.heading=function(e,t,n){var i=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return c.push({anchor:i,level:t,text:e}),"<h"+t+' id="'+s+i+'">'+e+"</h"+t+">"},a().setOptions({silent:!0,gfm:!0,pedantic:!1}),a().use({tokenizer:g,renderer:h}),t.ZP=a()},66543:function(){},59598:function(){},21697:function(e,t){"use strict";t.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},99498:function(e,t,n){!function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=e.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var i=e.getOption("placeholder");"string"==typeof i&&(i=document.createTextNode(i)),n.appendChild(i),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function i(e){setTimeout((function(){var i=!1,r=e.getInputField();"TEXTAREA"==r.nodeName?i=!r.value:1==e.lineCount()&&(i=!/[^\u200b]/.test(r.querySelector(".CodeMirror-line").textContent)),i?n(e):t(e)}),20)}function r(e){a(e)&&n(e)}function o(e){var i=e.getWrapperElement(),r=a(e);i.className=i.className.replace(" CodeMirror-empty","")+(r?" CodeMirror-empty":""),r?n(e):t(e)}function a(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",(function(n,a,l){var s=l&&l!=e.Init;if(a&&!s)n.on("blur",r),n.on("change",o),n.on("swapDoc",o),e.on(n.getInputField(),"compositionupdate",n.state.placeholderCompose=function(){i(n)}),o(n);else if(!a&&s){n.off("blur",r),n.off("change",o),n.off("swapDoc",o),e.off(n.getInputField(),"compositionupdate",n.state.placeholderCompose),t(n);var c=n.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}a&&!n.hasFocus()&&r(n)}))}(n(89780))},25717:function(e,t,n){!function(e){var t={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=e.Pos;function i(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,a){a&&a!=e.Init&&(t.removeKeyMap(r),t.state.closeBrackets=null),n&&(o(i(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(r))}));var r={Backspace:s,Enter:c};function o(e){for(var t=0;t<e.length;t++){var n=e.charAt(t),i="'"+n+"'";r[i]||(r[i]=a(n))}}function a(e){return function(t){return h(t,e)}}function l(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function s(t){var r=l(t);if(!r||t.getOption("disableInput"))return e.Pass;for(var o=i(r,"pairs"),a=t.listSelections(),s=0;s<a.length;s++){if(!a[s].empty())return e.Pass;var c=d(t,a[s].head);if(!c||o.indexOf(c)%2!=0)return e.Pass}for(s=a.length-1;s>=0;s--){var u=a[s].head;t.replaceRange("",n(u.line,u.ch-1),n(u.line,u.ch+1),"+delete")}}function c(t){var n=l(t),r=n&&i(n,"explode");if(!r||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),a=0;a<o.length;a++){if(!o[a].empty())return e.Pass;var s=d(t,o[a].head);if(!s||r.indexOf(s)%2!=0)return e.Pass}t.operation((function(){var e=t.lineSeparator()||"\n";t.replaceSelection(e+e,null),t.execCommand("goCharLeft"),o=t.listSelections();for(var n=0;n<o.length;n++){var i=o[n].head.line;t.indentLine(i,null,!0),t.indentLine(i+1,null,!0)}}))}function u(t){var i=e.cmpPos(t.anchor,t.head)>0;return{anchor:new n(t.anchor.line,t.anchor.ch+(i?-1:1)),head:new n(t.head.line,t.head.ch+(i?1:-1))}}function h(t,r){var o=l(t);if(!o||t.getOption("disableInput"))return e.Pass;var a=i(o,"pairs"),s=a.indexOf(r);if(-1==s)return e.Pass;for(var c,h=i(o,"closeBefore"),d=i(o,"triples"),f=a.charAt(s+1)==r,m=t.listSelections(),v=s%2==0,g=0;g<m.length;g++){var y,b=m[g],x=b.head,w=t.getRange(x,n(x.line,x.ch+1));if(v&&!b.empty())y="surround";else if(!f&&v||w!=r)if(f&&x.ch>1&&d.indexOf(r)>=0&&t.getRange(n(x.line,x.ch-2),x)==r+r){if(x.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(x.line,x.ch-2))))return e.Pass;y="addFour"}else if(f){var C=0==x.ch?" ":t.getRange(n(x.line,x.ch-1),x);if(e.isWordChar(w)||C==r||e.isWordChar(C))return e.Pass;y="both"}else{if(!v||!(0===w.length||/\s/.test(w)||h.indexOf(w)>-1))return e.Pass;y="both"}else y=f&&p(t,x)?"both":d.indexOf(r)>=0&&t.getRange(x,n(x.line,x.ch+3))==r+r+r?"skipThree":"skip";if(c){if(c!=y)return e.Pass}else c=y}var k=s%2?a.charAt(s-1):r,S=s%2?r:a.charAt(s+1);t.operation((function(){if("skip"==c)t.execCommand("goCharRight");else if("skipThree"==c)for(var e=0;e<3;e++)t.execCommand("goCharRight");else if("surround"==c){var n=t.getSelections();for(e=0;e<n.length;e++)n[e]=k+n[e]+S;for(t.replaceSelections(n,"around"),n=t.listSelections().slice(),e=0;e<n.length;e++)n[e]=u(n[e]);t.setSelections(n)}else"both"==c?(t.replaceSelection(k+S,null),t.triggerElectric(k+S),t.execCommand("goCharLeft")):"addFour"==c&&(t.replaceSelection(k+k+k+k,"before"),t.execCommand("goCharRight"))}))}function d(e,t){var i=e.getRange(n(t.line,t.ch-1),n(t.line,t.ch+1));return 2==i.length?i:null}function p(e,t){var i=e.getTokenAt(n(t.line,t.ch+1));return/\bstring/.test(i.type)&&i.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}o(t.pairs+"`")}(n(89780))},6313:function(e,t,n){!function(e){e.defineOption("autoCloseTags",!1,(function(t,n,r){if(r!=e.Init&&r&&t.removeKeyMap("autoCloseTags"),n){var a={name:"autoCloseTags"};"object"==typeof n&&!1===n.whenClosing||(a["'/'"]=function(e){return o(e)}),"object"==typeof n&&!1===n.whenOpening||(a["'>'"]=function(e){return i(e)}),t.addKeyMap(a)}}));var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=["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 i(i){if(i.getOption("disableInput"))return e.Pass;for(var r=i.listSelections(),o=[],s=i.getOption("autoCloseTags"),c=0;c<r.length;c++){if(!r[c].empty())return e.Pass;var u=r[c].head,h=i.getTokenAt(u),d=e.innerMode(i.getMode(),h.state),p=d.state,f=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(p),m=f&&f.name;if(!m)return e.Pass;var v="html"==d.mode.configuration,g="object"==typeof s&&s.dontCloseTags||v&&t,y="object"==typeof s&&s.indentTags||v&&n;h.end>u.ch&&(m=m.slice(0,m.length-h.end+u.ch));var b=m.toLowerCase();if(!m||"string"==h.type&&(h.end!=u.ch||!/[\"\']/.test(h.string.charAt(h.string.length-1))||1==h.string.length)||"tag"==h.type&&f.close||h.string.indexOf("/")==u.ch-h.start-1||g&&a(g,b)>-1||l(i,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(p)||[],m,u,!0))return e.Pass;var x="object"==typeof s&&s.emptyTags;if(x&&a(x,m)>-1)o[c]={text:"/>",newPos:e.Pos(u.line,u.ch+2)};else{var w=y&&a(y,b)>-1;o[c]={indent:w,text:">"+(w?"\n\n":"")+"</"+m+">",newPos:w?e.Pos(u.line+1,0):e.Pos(u.line,u.ch+1)}}}var C="object"==typeof s&&s.dontIndentOnAutoClose;for(c=r.length-1;c>=0;c--){var k=o[c];i.replaceRange(k.text,r[c].head,r[c].anchor,"+insert");var S=i.listSelections().slice(0);S[c]={head:k.newPos,anchor:k.newPos},i.setSelections(S),!C&&k.indent&&(i.indentLine(k.newPos.line,null,!0),i.indentLine(k.newPos.line+1,null,!0))}}function r(t,n){for(var i=t.listSelections(),r=[],o=n?"/":"</",a=t.getOption("autoCloseTags"),s="object"==typeof a&&a.dontIndentOnSlash,c=0;c<i.length;c++){if(!i[c].empty())return e.Pass;var u=i[c].head,h=t.getTokenAt(u),d=e.innerMode(t.getMode(),h.state),p=d.state;if(n&&("string"==h.type||"<"!=h.string.charAt(0)||h.start!=u.ch-1))return e.Pass;var f,m="xml"!=d.mode.name&&"htmlmixed"==t.getMode().name;if(m&&"javascript"==d.mode.name)f=o+"script";else if(m&&"css"==d.mode.name)f=o+"style";else{var v=d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(p);if(!v||v.length&&l(t,v,v[v.length-1],u))return e.Pass;f=o+v[v.length-1]}">"!=t.getLine(u.line).charAt(h.end)&&(f+=">"),r[c]=f}if(t.replaceSelections(r),i=t.listSelections(),!s)for(c=0;c<i.length;c++)(c==i.length-1||i[c].head.line<i[c+1].head.line)&&t.indentLine(i[c].head.line)}function o(t){return t.getOption("disableInput")?e.Pass:r(t,!0)}function a(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;n<i;++n)if(e[n]==t)return n;return-1}function l(t,n,i,r,o){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,r.line+500),l=e.scanForClosingTag(t,r,null,a);if(!l||l.tag!=i)return!1;for(var s=o?1:0,c=n.length-1;c>=0&&n[c]==i;c--)++s;for(r=l.to,c=1;c<s;c++){var u=e.scanForClosingTag(t,r,null,a);if(!u||u.tag!=i)return!1;r=u.to}return!0}e.commands.closeTag=function(e){return r(e)}}(n(89780),n(32855))},32855:function(e,t,n){!function(e){"use strict";var t=e.Pos;function n(e,t){return e.line-t.line||e.ch-t.ch}var i="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",r=new RegExp("<(/?)(["+i+"]["+i+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function o(e,t,n,i){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=i?Math.max(i.from,e.firstLine()):e.firstLine(),this.max=i?Math.min(i.to-1,e.lastLine()):e.lastLine()}function a(e,n){var i=e.cm.getTokenTypeAt(t(e.line,n));return i&&/\btag\b/.test(i)}function l(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function s(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function c(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(l(e))continue;return}if(a(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t+1}}function u(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(s(e))continue;return}if(a(e,t+1)){r.lastIndex=t,e.ch=t;var n=r.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function h(e){for(;;){r.lastIndex=e.ch;var t=r.exec(e.text);if(!t){if(l(e))continue;return}if(a(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function d(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(s(e))continue;return}if(a(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t}}function p(e,n){for(var i=[];;){var r,o=h(e),a=e.line,l=e.ch-(o?o[0].length:0);if(!o||!(r=c(e)))return;if("selfClose"!=r)if(o[1]){for(var s=i.length-1;s>=0;--s)if(i[s]==o[2]){i.length=s;break}if(s<0&&(!n||n==o[2]))return{tag:o[2],from:t(a,l),to:t(e.line,e.ch)}}else i.push(o[2])}}function f(e,n){for(var i=[];;){var r=d(e);if(!r)return;if("selfClose"!=r){var o=e.line,a=e.ch,l=u(e);if(!l)return;if(l[1])i.push(l[2]);else{for(var s=i.length-1;s>=0;--s)if(i[s]==l[2]){i.length=s;break}if(s<0&&(!n||n==l[2]))return{tag:l[2],from:t(e.line,e.ch),to:t(o,a)}}}else u(e)}}e.registerHelper("fold","xml",(function(e,i){for(var r=new o(e,i.line,0);;){var a=h(r);if(!a||r.line!=i.line)return;var l=c(r);if(!l)return;if(!a[1]&&"selfClose"!=l){var s=t(r.line,r.ch),u=p(r,a[2]);return u&&n(u.from,s)>0?{from:s,to:u.from}:null}}})),e.findMatchingTag=function(e,i,r){var a=new o(e,i.line,i.ch,r);if(-1!=a.text.indexOf(">")||-1!=a.text.indexOf("<")){var l=c(a),s=l&&t(a.line,a.ch),h=l&&u(a);if(l&&h&&!(n(a,i)>0)){var d={from:t(a.line,a.ch),to:s,tag:h[2]};return"selfClose"==l?{open:d,close:null,at:"open"}:h[1]?{open:f(a,h[2]),close:d,at:"close"}:{open:d,close:p(a=new o(e,s.line,s.ch,r),h[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,n,i){for(var r=new o(e,t.line,t.ch,n);;){var a=f(r,i);if(!a)break;var l=p(new o(e,t.line,t.ch,n),a.tag);if(l)return{open:a,close:l}}},e.scanForClosingTag=function(e,t,n,i){return p(new o(e,t.line,t.ch,i?{from:0,to:i}:null),n)}}(n(89780))},89780:function(e){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),i=/MSIE \d/.test(e),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=i||r||o,l=a&&(i?document.documentMode||6:+(o||r)[1]),s=!o&&/WebKit\//.test(e),c=s&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),h=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),f=/PhantomJS/.test(e),m=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),v=/Android/.test(e),g=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),w=h&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(h=!1,s=!0);var C=y&&(c||h&&(null==w||w<12.11)),k=n||a&&l>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var E,M=function(e,t){var n=e.className,i=S(t).exec(n);if(i){var r=n.slice(i.index+i[0].length);e.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function L(e,t){return T(e).appendChild(t)}function A(e,t,n,i){var r=document.createElement(e);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof t)r.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)r.appendChild(t[o]);return r}function D(e,t,n,i){var r=A(e,t,n,i);return r.setAttribute("role","presentation"),r}function P(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function N(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function B(e,t){var n=e.className;S(t).test(n)||(e.className+=(n?" ":"")+t)}function _(e,t){for(var n=e.split(" "),i=0;i<n.length;i++)n[i]&&!S(n[i]).test(t)&&(t+=" "+n[i]);return t}E=document.createRange?function(e,t,n,i){var r=document.createRange();return r.setEnd(i||e,n),r.setStart(e,t),r}:function(e,t,n){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(e){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i};var I=function(e){e.select()};function O(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function R(e,t,n){for(var i in t||(t={}),e)!e.hasOwnProperty(i)||!1===n&&t.hasOwnProperty(i)||(t[i]=e[i]);return t}function j(e,t,n,i,r){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=i||0,a=r||0;;){var l=e.indexOf("\t",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}}m?I=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(I=function(e){try{e.select()}catch(e){}});var F=function(){this.id=null,this.f=null,this.time=0,this.handler=O(this.onTimeout,this)};function Z(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}F.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},F.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var z=50,H={toString:function(){return"CodeMirror.Pass"}},W={scroll:!1},G={origin:"*mouse"},V={origin:"+move"};function U(e,t,n){for(var i=0,r=0;;){var o=e.indexOf("\t",i);-1==o&&(o=e.length);var a=o-i;if(o==e.length||r+a>=t)return i+Math.min(a,t-r);if(r+=o-i,i=o+1,(r+=n-r%n)>=t)return i}}var q=[""];function K(e){for(;q.length<=e;)q.push(Y(q)+" ");return q[e]}function Y(e){return e[e.length-1]}function X(e,t){for(var n=[],i=0;i<e.length;i++)n[i]=t(e[i],i);return n}function J(e,t,n){for(var i=0,r=n(t);i<e.length&&n(e[i])<=r;)i++;e.splice(i,0,t)}function Q(){}function $(e,t){var n;return Object.create?n=Object.create(e):(Q.prototype=e,n=new Q),t&&R(t,n),n}var ee=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function te(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function ne(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function ie(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\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 oe(e){return e.charCodeAt(0)>=768&&re.test(e)}function ae(e,t,n){for(;(n<0?t>0:t<e.length)&&oe(e.charAt(t));)t+=n;return t}function le(e,t,n){for(var i=t>n?-1:1;;){if(t==n)return t;var r=(t+n)/2,o=i<0?Math.ceil(r):Math.floor(r);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+i}}function se(e,t,n,i){if(!e)return i(t,n,"ltr",0);for(var r=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(i(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),r=!0)}r||i(t,n,"ltr")}var ce=null;function ue(e,t,n){var i;ce=null;for(var r=0;r<e.length;++r){var o=e[r];if(o.from<t&&o.to>t)return r;o.to==t&&(o.from!=o.to&&"before"==n?i=r:ce=r),o.from==t&&(o.from!=o.to&&"before"!=n?i=r:ce=r)}return null!=i?i:ce}var he=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;function s(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var c="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!i.test(e))return!1;for(var u=e.length,h=[],d=0;d<u;++d)h.push(n(e.charCodeAt(d)));for(var p=0,f=c;p<u;++p){var m=h[p];"m"==m?h[p]=f:f=m}for(var v=0,g=c;v<u;++v){var y=h[v];"1"==y&&"r"==g?h[v]="n":o.test(y)&&(g=y,"r"==y&&(h[v]="R"))}for(var b=1,x=h[0];b<u-1;++b){var w=h[b];"+"==w&&"1"==x&&"1"==h[b+1]?h[b]="1":","!=w||x!=h[b+1]||"1"!=x&&"n"!=x||(h[b]=x),x=w}for(var C=0;C<u;++C){var k=h[C];if(","==k)h[C]="N";else if("%"==k){var S=void 0;for(S=C+1;S<u&&"%"==h[S];++S);for(var E=C&&"!"==h[C-1]||S<u&&"1"==h[S]?"1":"N",M=C;M<S;++M)h[M]=E;C=S-1}}for(var T=0,L=c;T<u;++T){var A=h[T];"L"==L&&"1"==A?h[T]="L":o.test(A)&&(L=A)}for(var D=0;D<u;++D)if(r.test(h[D])){var P=void 0;for(P=D+1;P<u&&r.test(h[P]);++P);for(var N="L"==(D?h[D-1]:c),B=N==("L"==(P<u?h[P]:c))?N?"L":"R":c,_=D;_<P;++_)h[_]=B;D=P-1}for(var I,O=[],R=0;R<u;)if(a.test(h[R])){var j=R;for(++R;R<u&&a.test(h[R]);++R);O.push(new s(0,j,R))}else{var F=R,Z=O.length,z="rtl"==t?1:0;for(++R;R<u&&"L"!=h[R];++R);for(var H=F;H<R;)if(l.test(h[H])){F<H&&(O.splice(Z,0,new s(1,F,H)),Z+=z);var W=H;for(++H;H<R&&l.test(h[H]);++H);O.splice(Z,0,new s(2,W,H)),Z+=z,F=H}else++H;F<R&&O.splice(Z,0,new s(1,F,R))}return"ltr"==t&&(1==O[0].level&&(I=e.match(/^\s+/))&&(O[0].from=I[0].length,O.unshift(new s(0,0,I[0].length))),1==Y(O).level&&(I=e.match(/\s+$/))&&(Y(O).to-=I[0].length,O.push(new s(0,u-I[0].length,u)))),"rtl"==t?O.reverse():O}}();function de(e,t){var n=e.order;return null==n&&(n=e.order=he(e.text,t)),n}var pe=[],fe=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||pe).concat(n)}};function me(e,t){return e._handlers&&e._handlers[t]||pe}function ve(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var i=e._handlers,r=i&&i[t];if(r){var o=Z(r,n);o>-1&&(i[t]=r.slice(0,o).concat(r.slice(o+1)))}}}function ge(e,t){var n=me(e,t);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r<n.length;++r)n[r].apply(null,i)}function ye(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ge(e,n||t.type,e,t),Se(t)||t.codemirrorIgnore}function be(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)-1==Z(n,t[i])&&n.push(t[i])}function xe(e,t){return me(e,t).length>0}function we(e){e.prototype.on=function(e,t){fe(this,e,t)},e.prototype.off=function(e,t){ve(this,e,t)}}function Ce(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ke(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Se(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ee(e){Ce(e),ke(e)}function Me(e){return e.target||e.srcElement}function Te(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Le,Ae,De=function(){if(a&&l<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function Pe(e){if(null==Le){var t=A("span","");L(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Le=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&l<8))}var n=Le?A("span",""):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ne(e){if(null!=Ae)return Ae;var t=L(e,document.createTextNode("AخA")),n=E(t,0,1).getBoundingClientRect(),i=E(t,1,2).getBoundingClientRect();return T(e),!(!n||n.left==n.right)&&(Ae=i.right-n.right<3)}var Be,_e=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],i=e.length;t<=i;){var r=e.indexOf("\n",t);-1==r&&(r=e.length);var o=e.slice(t,"\r"==e.charAt(r-1)?r-1:r),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=r+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Ie=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Oe="oncopy"in(Be=A("div"))||(Be.setAttribute("oncopy","return;"),"function"==typeof Be.oncopy),Re=null;function je(e){if(null!=Re)return Re;var t=L(e,A("span","x")),n=t.getBoundingClientRect(),i=E(t,0,1).getBoundingClientRect();return Re=Math.abs(n.left-i.left)>1}var Fe={},Ze={};function ze(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Fe[e]=t}function He(e,t){Ze[e]=t}function We(e){if("string"==typeof e&&Ze.hasOwnProperty(e))e=Ze[e];else if(e&&"string"==typeof e.name&&Ze.hasOwnProperty(e.name)){var t=Ze[e.name];"string"==typeof t&&(t={name:t}),(e=$(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return We("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return We("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ge(e,t){t=We(t);var n=Fe[t.name];if(!n)return Ge(e,"text/plain");var i=n(e,t);if(Ve.hasOwnProperty(t.name)){var r=Ve[t.name];for(var o in r)r.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=r[o])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)i[a]=t.modeProps[a];return i}var Ve={};function Ue(e,t){R(t,Ve.hasOwnProperty(e)?Ve[e]:Ve[e]={})}function qe(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var i in t){var r=t[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function Ke(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ye(e,t,n){return!e.startState||e.startState(t,n)}var Xe=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Je(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(t<o){n=r;break}t-=o}return n.lines[t]}function Qe(e,t,n){var i=[],r=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;r==n.line&&(o=o.slice(0,n.ch)),r==t.line&&(o=o.slice(t.ch)),i.push(o),++r})),i}function $e(e,t,n){var i=[];return e.iter(t,n,(function(e){i.push(e.text)})),i}function et(e,t){var n=t-e.height;if(n)for(var i=e;i;i=i.parent)i.height+=n}function tt(e){if(null==e.parent)return null;for(var t=e.parent,n=Z(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var r=0;i.children[r]!=t;++r)n+=i.children[r].chunkSize();return n+t.first}function nt(e,t){var n=e.first;e:do{for(var i=0;i<e.children.length;++i){var r=e.children[i],o=r.height;if(t<o){e=r;continue e}t-=o,n+=r.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a].height;if(t<l)break;t-=l}return n+a}function it(e,t){return t>=e.first&&t<e.first+e.size}function rt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ot(e,t,n){if(void 0===n&&(n=null),!(this instanceof ot))return new ot(e,t,n);this.line=e,this.ch=t,this.sticky=n}function at(e,t){return e.line-t.line||e.ch-t.ch}function lt(e,t){return e.sticky==t.sticky&&0==at(e,t)}function st(e){return ot(e.line,e.ch)}function ct(e,t){return at(e,t)<0?t:e}function ut(e,t){return at(e,t)<0?e:t}function ht(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function dt(e,t){if(t.line<e.first)return ot(e.first,0);var n=e.first+e.size-1;return t.line>n?ot(n,Je(e,n).text.length):pt(t,Je(e,t.line).text.length)}function pt(e,t){var n=e.ch;return null==n||n>t?ot(e.line,t):n<0?ot(e.line,0):e}function ft(e,t){for(var n=[],i=0;i<t.length;i++)n[i]=dt(e,t[i]);return n}Xe.prototype.eol=function(){return this.pos>=this.string.length},Xe.prototype.sol=function(){return this.pos==this.lineStart},Xe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Xe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Xe.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Xe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Xe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Xe.prototype.skipToEnd=function(){this.pos=this.string.length},Xe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Xe.prototype.backUp=function(e){this.pos-=e},Xe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=j(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.indentation=function(){return j(this.string,null,this.tabSize)-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.match=function(e,t,n){if("string"!=typeof e){var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}var r=function(e){return n?e.toLowerCase():e};if(r(this.string.substr(this.pos,e.length))==r(e))return!1!==t&&(this.pos+=e.length),!0},Xe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Xe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Xe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Xe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var mt=function(e,t){this.state=e,this.lookAhead=t},vt=function(e,t,n,i){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function gt(e,t,n,i){var r=[e.state.modeGen],o={};Mt(e,t.text,e.doc.mode,n,(function(e,t){return r.push(e,t)}),o,i);for(var a=n.state,l=function(i){n.baseTokens=r;var l=e.state.overlays[i],s=1,c=0;n.state=!0,Mt(e,t.text,l.mode,n,(function(e,t){for(var n=s;c<e;){var i=r[s];i>e&&r.splice(s,1,e,r[s+1],i),s+=2,c=Math.min(e,i)}if(t)if(l.opaque)r.splice(n,s-n,e,"overlay "+t),s=n+2;else for(;n<s;n+=2){var o=r[n+1];r[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:r,classes:o.bgClass||o.textClass?o:null}}function yt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=bt(e,tt(t)),r=t.text.length>e.options.maxHighlightLength&&qe(e.doc.mode,i.state),o=gt(e,t,i);r&&(i.state=r),t.stateAfter=i.save(!r),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function bt(e,t,n){var i=e.doc,r=e.display;if(!i.mode.startState)return new vt(i,!0,t);var o=Tt(e,t,n),a=o>i.first&&Je(i,o-1).stateAfter,l=a?vt.fromSaved(i,a,o):new vt(i,Ye(i.mode),o);return i.iter(o,t,(function(n){xt(e,n.text,l);var i=l.line;n.stateAfter=i==t-1||i%5==0||i>=r.viewFrom&&i<r.viewTo?l.save():null,l.nextLine()})),n&&(i.modeFrontier=l.line),l}function xt(e,t,n,i){var r=e.doc.mode,o=new Xe(t,e.options.tabSize,n);for(o.start=o.pos=i||0,""==t&&wt(r,n.state);!o.eol();)Ct(r,o,n.state),o.start=o.pos}function wt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ke(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Ct(e,t,n,i){for(var r=0;r<10;r++){i&&(i[0]=Ke(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}vt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},vt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},vt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},vt.fromSaved=function(e,t,n){return t instanceof mt?new vt(e,qe(e.mode,t.state),n,t.lookAhead):new vt(e,qe(e.mode,t),n)},vt.prototype.save=function(e){var t=!1!==e?qe(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new mt(t,this.maxLookAhead):t};var kt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function St(e,t,n,i){var r,o,a=e.doc,l=a.mode,s=Je(a,(t=dt(a,t)).line),c=bt(e,t.line,n),u=new Xe(s.text,e.options.tabSize,c);for(i&&(o=[]);(i||u.pos<t.ch)&&!u.eol();)u.start=u.pos,r=Ct(l,u,c.state),i&&o.push(new kt(u,r,qe(a.mode,c.state)));return i?o:new kt(u,r,c.state)}function Et(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var i=n[1]?"bgClass":"textClass";null==t[i]?t[i]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+n[2])}return e}function Mt(e,t,n,i,r,o,a){var l=n.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,h=new Xe(t,e.options.tabSize,i),d=e.options.addModeClass&&[null];for(""==t&&Et(wt(n,i.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(l=!1,a&&xt(e,t,i,h.pos),h.pos=t.length,s=null):s=Et(Ct(n,h,i.state,d),o),d){var p=d[0].name;p&&(s="m-"+(s?p+" "+s:p))}if(!l||u!=s){for(;c<h.start;)r(c=Math.min(h.start,c+5e3),u);u=s}h.start=h.pos}for(;c<h.pos;){var f=Math.min(h.pos,c+5e3);r(f,u),c=f}}function Tt(e,t,n){for(var i,r,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=Je(o,l-1),c=s.stateAfter;if(c&&(!n||l+(c instanceof mt?c.lookAhead:0)<=o.modeFrontier))return l;var u=j(s.text,null,e.options.tabSize);(null==r||i>u)&&(r=l-1,i=u)}return r}function Lt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,i=t-1;i>n;i--){var r=Je(e,i).stateAfter;if(r&&(!(r instanceof mt)||i+r.lookAhead<t)){n=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var At=!1,Dt=!1;function Pt(){At=!0}function Nt(){Dt=!0}function Bt(e,t,n){this.marker=e,this.from=t,this.to=n}function _t(e,t){if(e)for(var n=0;n<e.length;++n){var i=e[n];if(i.marker==t)return i}}function It(e,t){for(var n,i=0;i<e.length;++i)e[i]!=t&&(n||(n=[])).push(e[i]);return n}function Ot(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Rt(e,t,n){var i;if(e)for(var r=0;r<e.length;++r){var o=e[r],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(i||(i=[])).push(new Bt(a,o.from,l?null:o.to))}}return i}function jt(e,t,n){var i;if(e)for(var r=0;r<e.length;++r){var o=e[r],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(i||(i=[])).push(new Bt(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return i}function Ft(e,t){if(t.full)return null;var n=it(e,t.from.line)&&Je(e,t.from.line).markedSpans,i=it(e,t.to.line)&&Je(e,t.to.line).markedSpans;if(!n&&!i)return null;var r=t.from.ch,o=t.to.ch,a=0==at(t.from,t.to),l=Rt(n,r,a),s=jt(i,o,a),c=1==t.text.length,u=Y(t.text).length+(c?r:0);if(l)for(var h=0;h<l.length;++h){var d=l[h];if(null==d.to){var p=_t(s,d.marker);p?c&&(d.to=null==p.to?null:p.to+u):d.to=r}}if(s)for(var f=0;f<s.length;++f){var m=s[f];null!=m.to&&(m.to+=u),null==m.from?_t(l,m.marker)||(m.from=u,c&&(l||(l=[])).push(m)):(m.from+=u,c&&(l||(l=[])).push(m))}l&&(l=Zt(l)),s&&s!=l&&(s=Zt(s));var v=[l];if(!c){var g,y=t.text.length-2;if(y>0&&l)for(var b=0;b<l.length;++b)null==l[b].to&&(g||(g=[])).push(new Bt(l[b].marker,null,null));for(var x=0;x<y;++x)v.push(g);v.push(s)}return v}function Zt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function zt(e,t,n){var i=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||i&&-1!=Z(i,n)||(i||(i=[])).push(n)}})),!i)return null;for(var r=[{from:t,to:n}],o=0;o<i.length;++o)for(var a=i[o],l=a.find(0),s=0;s<r.length;++s){var c=r[s];if(!(at(c.to,l.from)<0||at(c.from,l.to)>0)){var u=[s,1],h=at(c.from,l.from),d=at(c.to,l.to);(h<0||!a.inclusiveLeft&&!h)&&u.push({from:c.from,to:l.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:l.to,to:c.to}),r.splice.apply(r,u),s+=u.length-3}}return r}function Ht(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Wt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Gt(e){return e.inclusiveLeft?-1:0}function Vt(e){return e.inclusiveRight?1:0}function Ut(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var i=e.find(),r=t.find(),o=at(i.from,r.from)||Gt(e)-Gt(t);if(o)return-o;var a=at(i.to,r.to)||Vt(e)-Vt(t);return a||t.id-e.id}function qt(e,t){var n,i=Dt&&e.markedSpans;if(i)for(var r=void 0,o=0;o<i.length;++o)(r=i[o]).marker.collapsed&&null==(t?r.from:r.to)&&(!n||Ut(n,r.marker)<0)&&(n=r.marker);return n}function Kt(e){return qt(e,!0)}function Yt(e){return qt(e,!1)}function Xt(e,t){var n,i=Dt&&e.markedSpans;if(i)for(var r=0;r<i.length;++r){var o=i[r];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||Ut(n,o.marker)<0)&&(n=o.marker)}return n}function Jt(e,t,n,i,r){var o=Je(e,t),a=Dt&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=at(c.from,n)||Gt(s.marker)-Gt(r),h=at(c.to,i)||Vt(s.marker)-Vt(r);if(!(u>=0&&h<=0||u<=0&&h>=0)&&(u<=0&&(s.marker.inclusiveRight&&r.inclusiveLeft?at(c.to,n)>=0:at(c.to,n)>0)||u>=0&&(s.marker.inclusiveRight&&r.inclusiveLeft?at(c.from,i)<=0:at(c.from,i)<0)))return!0}}}function Qt(e){for(var t;t=Kt(e);)e=t.find(-1,!0).line;return e}function $t(e){for(var t;t=Yt(e);)e=t.find(1,!0).line;return e}function en(e){for(var t,n;t=Yt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function tn(e,t){var n=Je(e,t),i=Qt(n);return n==i?t:tt(i)}function nn(e,t){if(t>e.lastLine())return t;var n,i=Je(e,t);if(!rn(e,i))return t;for(;n=Yt(i);)i=n.find(1,!0).line;return tt(i)+1}function rn(e,t){var n=Dt&&t.markedSpans;if(n)for(var i=void 0,r=0;r<n.length;++r)if((i=n[r]).marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&on(e,t,i))return!0}}function on(e,t,n){if(null==n.to){var i=n.marker.find(1,!0);return on(e,i.line,_t(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var r=void 0,o=0;o<t.markedSpans.length;++o)if((r=t.markedSpans[o]).marker.collapsed&&!r.marker.widgetNode&&r.from==n.to&&(null==r.to||r.to!=n.from)&&(r.marker.inclusiveLeft||n.marker.inclusiveRight)&&on(e,t,r))return!0}function an(e){for(var t=0,n=(e=Qt(e)).parent,i=0;i<n.lines.length;++i){var r=n.lines[i];if(r==e)break;t+=r.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==n)break;t+=l.height}return t}function ln(e){if(0==e.height)return 0;for(var t,n=e.text.length,i=e;t=Kt(i);){var r=t.find(0,!0);i=r.from.line,n+=r.from.ch-r.to.ch}for(i=e;t=Yt(i);){var o=t.find(0,!0);n-=i.text.length-o.from.ch,n+=(i=o.to.line).text.length-o.to.ch}return n}function sn(e){var t=e.display,n=e.doc;t.maxLine=Je(n,n.first),t.maxLineLength=ln(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=ln(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var cn=function(e,t,n){this.text=e,Wt(this,t),this.height=n?n(this):1};function un(e,t,n,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ht(e),Wt(e,n);var r=i?i(e):1;r!=e.height&&et(e,r)}function hn(e){e.parent=null,Ht(e)}cn.prototype.lineNo=function(){return tt(this)},we(cn);var dn={},pn={};function fn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?pn:dn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function mn(e,t){var n=D("span",null,null,s?"padding-right: .1px":null),i={pre:D("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var o=r?t.rest[r-1]:t.line,a=void 0;i.pos=0,i.addToken=gn,Ne(e.display.measure)&&(a=de(o,e.doc.direction))&&(i.addToken=bn(i.addToken,a)),i.map=[],wn(o,i,yt(e,o,t!=e.display.externalMeasured&&tt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=_(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=_(o.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Pe(e.display.measure))),0==r?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var l=i.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return ge(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=_(i.pre.className,i.textClass||"")),i}function vn(e){var t=A("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function gn(e,t,n,i,r,o,s){if(t){var c,u=e.splitSpaces?yn(t,e.trailingSpace):t,h=e.cm.state.specialChars,d=!1;if(h.test(t)){c=document.createDocumentFragment();for(var p=0;;){h.lastIndex=p;var f=h.exec(t),m=f?f.index-p:t.length-p;if(m){var v=document.createTextNode(u.slice(p,p+m));a&&l<9?c.appendChild(A("span",[v])):c.appendChild(v),e.map.push(e.pos,e.pos+m,v),e.col+=m,e.pos+=m}if(!f)break;p+=m+1;var g=void 0;if("\t"==f[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(g=c.appendChild(A("span",K(b),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=b}else"\r"==f[0]||"\n"==f[0]?((g=c.appendChild(A("span","\r"==f[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",f[0]),e.col+=1):((g=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),a&&l<9?c.appendChild(A("span",[g])):c.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&l<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||i||r||d||o||s){var x=n||"";i&&(x+=i),r&&(x+=r);var w=A("span",[c],x,o);if(s)for(var C in s)s.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&w.setAttribute(C,s[C]);return e.content.appendChild(w)}e.content.appendChild(c)}}function yn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,i="",r=0;r<e.length;r++){var o=e.charAt(r);" "!=o||!n||r!=e.length-1&&32!=e.charCodeAt(r+1)||(o=" "),i+=o,n=" "==o}return i}function bn(e,t){return function(n,i,r,o,a,l,s){r=r?r+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+i.length;;){for(var h=void 0,d=0;d<t.length&&!((h=t[d]).to>c&&h.from<=c);d++);if(h.to>=u)return e(n,i,r,o,a,l,s);e(n,i.slice(0,h.to-c),r,o,null,l,s),o=null,i=i.slice(h.to-c),c=h.to}}}function xn(e,t,n,i){var r=!i&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!i&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function wn(e,t,n){var i=e.markedSpans,r=e.text,o=0;if(i)for(var a,l,s,c,u,h,d,p=r.length,f=0,m=1,v="",g=0;;){if(g==f){s=c=u=l="",d=null,h=null,g=1/0;for(var y=[],b=void 0,x=0;x<i.length;++x){var w=i[x],C=w.marker;if("bookmark"==C.type&&w.from==f&&C.widgetNode)y.push(C);else if(w.from<=f&&(null==w.to||w.to>f||C.collapsed&&w.to==f&&w.from==f)){if(null!=w.to&&w.to!=f&&g>w.to&&(g=w.to,c=""),C.className&&(s+=" "+C.className),C.css&&(l=(l?l+";":"")+C.css),C.startStyle&&w.from==f&&(u+=" "+C.startStyle),C.endStyle&&w.to==g&&(b||(b=[])).push(C.endStyle,w.to),C.title&&((d||(d={})).title=C.title),C.attributes)for(var k in C.attributes)(d||(d={}))[k]=C.attributes[k];C.collapsed&&(!h||Ut(h.marker,C)<0)&&(h=w)}else w.from>f&&g>w.from&&(g=w.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==g&&(c+=" "+b[S]);if(!h||h.from==f)for(var E=0;E<y.length;++E)xn(t,0,y[E]);if(h&&(h.from||0)==f){if(xn(t,(null==h.to?p+1:h.to)-f,h.marker,null==h.from),null==h.to)return;h.to==f&&(h=!1)}}if(f>=p)break;for(var M=Math.min(p,g);;){if(v){var T=f+v.length;if(!h){var L=T>M?v.slice(0,M-f):v;t.addToken(t,L,a?a+s:s,u,f+L.length==g?c:"",l,d)}if(T>=M){v=v.slice(M-f),f=M;break}f=T,u=""}v=r.slice(o,o=n[m++]),a=fn(n[m++],t.cm.options)}}else for(var A=1;A<n.length;A+=2)t.addToken(t,r.slice(o,o=n[A]),fn(n[A+1],t.cm.options))}function Cn(e,t,n){this.line=t,this.rest=en(t),this.size=this.rest?tt(Y(this.rest))-n+1:1,this.node=this.text=null,this.hidden=rn(e,t)}function kn(e,t,n){for(var i,r=[],o=t;o<n;o=i){var a=new Cn(e.doc,Je(e.doc,o),o);i=o+a.size,r.push(a)}return r}var Sn=null;function En(e){Sn?Sn.ops.push(e):e.ownsGroup=Sn={ops:[e],delayedCallbacks:[]}}function Mn(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var i=0;i<e.ops.length;i++){var r=e.ops[i];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(n<t.length)}function Tn(e,t){var n=e.ownsGroup;if(n)try{Mn(n)}finally{Sn=null,t(n)}}var Ln=null;function An(e,t){var n=me(e,t);if(n.length){var i,r=Array.prototype.slice.call(arguments,2);Sn?i=Sn.delayedCallbacks:Ln?i=Ln:(i=Ln=[],setTimeout(Dn,0));for(var o=function(e){i.push((function(){return n[e].apply(null,r)}))},a=0;a<n.length;++a)o(a)}}function Dn(){var e=Ln;Ln=null;for(var t=0;t<e.length;++t)e[t]()}function Pn(e,t,n,i){for(var r=0;r<t.changes.length;r++){var o=t.changes[r];"text"==o?In(e,t):"gutter"==o?Rn(e,t,n,i):"class"==o?On(e,t):"widget"==o&&jn(e,t,i)}t.changes=null}function Nn(e){return e.node==e.text&&(e.node=A("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&l<8&&(e.node.style.zIndex=2)),e.node}function Bn(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var i=Nn(t);t.background=i.insertBefore(A("div",null,n),i.firstChild),e.display.input.setUneditable(t.background)}}function _n(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):mn(e,t)}function In(e,t){var n=t.text.className,i=_n(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,On(e,t)):n&&(t.text.className=n)}function On(e,t){Bn(e,t),t.line.wrapClass?Nn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Rn(e,t,n,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var r=Nn(t);t.gutterBackground=A("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),r.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=Nn(t),l=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(A("div",rt(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var c=e.display.gutterSpecs[s].className,u=o.hasOwnProperty(c)&&o[c];u&&l.appendChild(A("div",[u],"CodeMirror-gutter-elt","left: "+i.gutterLeft[c]+"px; width: "+i.gutterWidth[c]+"px"))}}}function jn(e,t,n){t.alignable&&(t.alignable=null);for(var i=S("CodeMirror-linewidget"),r=t.node.firstChild,o=void 0;r;r=o)o=r.nextSibling,i.test(r.className)&&t.node.removeChild(r);Zn(e,t,n)}function Fn(e,t,n,i){var r=_n(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),On(e,t),Rn(e,t,n,i),Zn(e,t,i),t.node}function Zn(e,t,n){if(zn(e,t.line,t,n,!0),t.rest)for(var i=0;i<t.rest.length;i++)zn(e,t.rest[i],t,n,!1)}function zn(e,t,n,i,r){if(t.widgets)for(var o=Nn(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=A("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Hn(s,c,n,i),e.display.input.setUneditable(c),r&&s.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),An(s,"redraw")}}function Hn(e,t,n,i){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var r=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(r-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function Wn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!P(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),L(t.display.measure,A("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Gn(e,t){for(var n=Me(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Vn(e){return e.lineSpace.offsetTop}function Un(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=L(e.measure,A("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(i.left)||isNaN(i.right)||(e.cachedPaddingH=i),i}function Kn(e){return z-e.display.nativeBarWidth}function Yn(e){return e.display.scroller.clientWidth-Kn(e)-e.display.barWidth}function Xn(e){return e.display.scroller.clientHeight-Kn(e)-e.display.barHeight}function Jn(e,t,n){var i=e.options.lineWrapping,r=i&&Yn(e);if(!t.measure.heights||i&&t.measure.width!=r){var o=t.measure.heights=[];if(i){t.measure.width=r;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Qn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var r=0;r<e.rest.length;r++)if(tt(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function $n(e,t){var n=tt(t=Qt(t)),i=e.display.externalMeasured=new Cn(e.doc,t,n);i.lineN=n;var r=i.built=mn(e,i);return i.text=r.pre,L(e.display.lineMeasure,r.pre),i}function ei(e,t,n,i){return ii(e,ni(e,t),n,i)}function ti(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Oi(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function ni(e,t){var n=tt(t),i=ti(e,n);i&&!i.text?i=null:i&&i.changes&&(Pn(e,i,n,Pi(e)),e.curOp.forceUpdate=!0),i||(i=$n(e,t));var r=Qn(i,t,n);return{line:t,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function ii(e,t,n,i,r){t.before&&(n=-1);var o,a=n+(i||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Jn(e,t.view,t.rect),t.hasHeights=!0),(o=si(e,t,n,i)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:r?o.rtop:o.top,bottom:r?o.rbottom:o.bottom}}var ri,oi={left:0,right:0,top:0,bottom:0};function ai(e,t,n){for(var i,r,o,a,l,s,c=0;c<e.length;c+=3)if(l=e[c],s=e[c+1],t<l?(r=0,o=1,a="left"):t<s?o=1+(r=t-l):(c==e.length-3||t==s&&e[c+3]>t)&&(r=(o=s-l)-1,t>=s&&(a="right")),null!=r){if(i=e[c+2],l==s&&n==(i.insertLeft?"left":"right")&&(a=n),"left"==n&&0==r)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)i=e[2+(c-=3)],a="left";if("right"==n&&r==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)i=e[(c+=3)+2],a="right";break}return{node:i,start:r,end:o,collapse:a,coverStart:l,coverEnd:s}}function li(e,t){var n=oi;if("left"==t)for(var i=0;i<e.length&&(n=e[i]).left==n.right;i++);else for(var r=e.length-1;r>=0&&(n=e[r]).left==n.right;r--);return n}function si(e,t,n,i){var r,o=ai(t.map,n,i),s=o.node,c=o.start,u=o.end,h=o.collapse;if(3==s.nodeType){for(var d=0;d<4;d++){for(;c&&oe(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u<o.coverEnd&&oe(t.line.text.charAt(o.coverStart+u));)++u;if((r=a&&l<9&&0==c&&u==o.coverEnd-o.coverStart?s.parentNode.getBoundingClientRect():li(E(s,c,u).getClientRects(),i)).left||r.right||0==c)break;u=c,c-=1,h="right"}a&&l<11&&(r=ci(e.display.measure,r))}else{var p;c>0&&(h=i="right"),r=e.options.lineWrapping&&(p=s.getClientRects()).length>1?p["right"==i?p.length-1:0]:s.getBoundingClientRect()}if(a&&l<9&&!c&&(!r||!r.left&&!r.right)){var f=s.parentNode.getClientRects()[0];r=f?{left:f.left,right:f.left+Di(e.display),top:f.top,bottom:f.bottom}:oi}for(var m=r.top-t.rect.top,v=r.bottom-t.rect.top,g=(m+v)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(g<y[b]);b++);var x=b?y[b-1]:0,w=y[b],C={left:("right"==h?r.right:r.left)-t.rect.left,right:("left"==h?r.left:r.right)-t.rect.left,top:x,bottom:w};return r.left||r.right||(C.bogus=!0),e.options.singleCursorHeightPerLine||(C.rtop=m,C.rbottom=v),C}function ci(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!je(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*i,bottom:t.bottom*i}}function ui(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function hi(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ui(e.display.view[t])}function di(e){hi(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function pi(){return u&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function fi(){return u&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function mi(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Wn(e.widgets[n]));return t}function vi(e,t,n,i,r){if(!r){var o=mi(t);n.top+=o,n.bottom+=o}if("line"==i)return n;i||(i="local");var a=an(t);if("local"==i?a+=Vn(e.display):a-=e.display.viewOffset,"page"==i||"window"==i){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==i?0:fi());var s=l.left+("window"==i?0:pi());n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function gi(e,t,n){if("div"==n)return t;var i=t.left,r=t.top;if("page"==n)i-=pi(),r-=fi();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();i+=o.left,r+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:i-a.left,top:r-a.top}}function yi(e,t,n,i,r){return i||(i=Je(e.doc,t.line)),vi(e,i,ei(e,i,t.ch,r),n)}function bi(e,t,n,i,r,o){function a(t,a){var l=ii(e,r,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,vi(e,i,l,n)}i=i||Je(e.doc,t.line),r||(r=ni(e,i));var l=de(i,e.doc.direction),s=t.ch,c=t.sticky;if(s>=i.text.length?(s=i.text.length,c="before"):s<=0&&(s=0,c="after"),!l)return a("before"==c?s-1:s,"before"==c);function u(e,t,n){return a(n?e-1:e,1==l[t].level!=n)}var h=ue(l,s,c),d=ce,p=u(s,h,"before"==c);return null!=d&&(p.other=u(s,d,"before"!=c)),p}function xi(e,t){var n=0;t=dt(e.doc,t),e.options.lineWrapping||(n=Di(e.display)*t.ch);var i=Je(e.doc,t.line),r=an(i)+Vn(e.display);return{left:n,right:n,top:r,bottom:r+i.height}}function wi(e,t,n,i,r){var o=ot(e,t,n);return o.xRel=r,i&&(o.outside=i),o}function Ci(e,t,n){var i=e.doc;if((n+=e.display.viewOffset)<0)return wi(i.first,0,null,-1,-1);var r=nt(i,n),o=i.first+i.size-1;if(r>o)return wi(i.first+i.size-1,Je(i,o).text.length,null,1,1);t<0&&(t=0);for(var a=Je(i,r);;){var l=Mi(e,a,r,t,n),s=Xt(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var c=s.find(1);if(c.line==r)return c;a=Je(i,r=c.line)}}function ki(e,t,n,i){i-=mi(t);var r=t.text.length,o=le((function(t){return ii(e,n,t-1).bottom<=i}),r,0);return{begin:o,end:r=le((function(t){return ii(e,n,t).top>i}),o,r)}}function Si(e,t,n,i){return n||(n=ni(e,t)),ki(e,t,n,vi(e,t,ii(e,n,i),"line").top)}function Ei(e,t,n,i){return!(e.bottom<=n)&&(e.top>n||(i?e.left:e.right)>t)}function Mi(e,t,n,i,r){r-=an(t);var o=ni(e,t),a=mi(t),l=0,s=t.text.length,c=!0,u=de(t,e.doc.direction);if(u){var h=(e.options.lineWrapping?Li:Ti)(e,t,n,o,u,i,r);l=(c=1!=h.level)?h.from:h.to-1,s=c?h.to:h.from-1}var d,p,f=null,m=null,v=le((function(t){var n=ii(e,o,t);return n.top+=a,n.bottom+=a,!!Ei(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(f=t,m=n),!0)}),l,s),g=!1;if(m){var y=i-m.left<m.right-i,b=y==c;v=f+(b?0:1),p=b?"after":"before",d=y?m.left:m.right}else{c||v!=s&&v!=l||v++,p=0==v?"after":v==t.text.length?"before":ii(e,o,v-(c?1:0)).bottom+a<=r==c?"after":"before";var x=bi(e,ot(n,v,p),"line",t,o);d=x.left,g=r<x.top?-1:r>=x.bottom?1:0}return wi(n,v=ae(t.text,v,1),p,g,i-d)}function Ti(e,t,n,i,r,o,a){var l=le((function(l){var s=r[l],c=1!=s.level;return Ei(bi(e,ot(n,c?s.to:s.from,c?"before":"after"),"line",t,i),o,a,!0)}),0,r.length-1),s=r[l];if(l>0){var c=1!=s.level,u=bi(e,ot(n,c?s.from:s.to,c?"after":"before"),"line",t,i);Ei(u,o,a,!0)&&u.top>a&&(s=r[l-1])}return s}function Li(e,t,n,i,r,o,a){var l=ki(e,t,i,a),s=l.begin,c=l.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,h=null,d=0;d<r.length;d++){var p=r[d];if(!(p.from>=c||p.to<=s)){var f=ii(e,i,1!=p.level?Math.min(c,p.to)-1:Math.max(s,p.from)).right,m=f<o?o-f+1e9:f-o;(!u||h>m)&&(u=p,h=m)}}return u||(u=r[r.length-1]),u.from<s&&(u={from:s,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function Ai(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ri){ri=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ri.appendChild(document.createTextNode("x")),ri.appendChild(A("br"));ri.appendChild(document.createTextNode("x"))}L(e.measure,ri);var n=ri.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function Di(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),n=A("pre",[t],"CodeMirror-line-like");L(e.measure,n);var i=t.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function Pi(e){for(var t=e.display,n={},i={},r=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className;n[l]=o.offsetLeft+o.clientLeft+r,i[l]=o.clientWidth}return{fixedPos:Ni(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function Ni(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Bi(e){var t=Ai(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/Di(e.display)-3);return function(r){if(rn(e.doc,r))return 0;var o=0;if(r.widgets)for(var a=0;a<r.widgets.length;a++)r.widgets[a].height&&(o+=r.widgets[a].height);return n?o+(Math.ceil(r.text.length/i)||1)*t:o+t}}function _i(e){var t=e.doc,n=Bi(e);t.iter((function(e){var t=n(e);t!=e.height&&et(e,t)}))}function Ii(e,t,n,i){var r=e.display;if(!n&&"true"==Me(t).getAttribute("cm-not-content"))return null;var o,a,l=r.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(e){return null}var s,c=Ci(e,o,a);if(i&&c.xRel>0&&(s=Je(e.doc,c.line).text).length==c.ch){var u=j(s,s.length,e.options.tabSize)-s.length;c=ot(c.line,Math.max(0,Math.round((o-qn(e.display).left)/Di(e.display))-u))}return c}function Oi(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,i=0;i<n.length;i++)if((t-=n[i].size)<0)return i}function Ri(e,t,n,i){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),i||(i=0);var r=e.display;if(i&&n<r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)Dt&&tn(e.doc,t)<r.viewTo&&Fi(e);else if(n<=r.viewFrom)Dt&&nn(e.doc,n+i)>r.viewFrom?Fi(e):(r.viewFrom+=i,r.viewTo+=i);else if(t<=r.viewFrom&&n>=r.viewTo)Fi(e);else if(t<=r.viewFrom){var o=Zi(e,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):Fi(e)}else if(n>=r.viewTo){var a=Zi(e,t,t,-1);a?(r.view=r.view.slice(0,a.index),r.viewTo=a.lineN):Fi(e)}else{var l=Zi(e,t,t,-1),s=Zi(e,n,n+i,1);l&&s?(r.view=r.view.slice(0,l.index).concat(kn(e,l.lineN,s.lineN)).concat(r.view.slice(s.index)),r.viewTo+=i):Fi(e)}var c=r.externalMeasured;c&&(n<c.lineN?c.lineN+=i:t<c.lineN+c.size&&(r.externalMeasured=null))}function ji(e,t,n){e.curOp.viewChanged=!0;var i=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(i.externalMeasured=null),!(t<i.viewFrom||t>=i.viewTo)){var o=i.view[Oi(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==Z(a,n)&&a.push(n)}}}function Fi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Zi(e,t,n,i){var r,o=Oi(e,t),a=e.display.view;if(!Dt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(i>0){if(o==a.length-1)return null;r=l+a[o].size-t,o++}else r=l-t;t+=r,n+=r}for(;tn(e.doc,n)!=n;){if(o==(i<0?0:a.length-1))return null;n+=i*a[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function zi(e,t,n){var i=e.display;0==i.view.length||t>=i.viewTo||n<=i.viewFrom?(i.view=kn(e,t,n),i.viewFrom=t):(i.viewFrom>t?i.view=kn(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(Oi(e,t))),i.viewFrom=t,i.viewTo<n?i.view=i.view.concat(kn(e,i.viewTo,n)):i.viewTo>n&&(i.view=i.view.slice(0,Oi(e,n)))),i.viewTo=n}function Hi(e){for(var t=e.display.view,n=0,i=0;i<t.length;i++){var r=t[i];r.hidden||r.node&&!r.changes||++n}return n}function Wi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Gi(e,t){void 0===t&&(t=!0);for(var n=e.doc,i={},r=i.cursors=document.createDocumentFragment(),o=i.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var l=n.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&Vi(e,l.head,r),s||qi(e,l,o)}}return i}function Vi(e,t,n){var i=bi(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=n.appendChild(A("div"," ","CodeMirror-cursor"));if(r.style.left=i.left+"px",r.style.top=i.top+"px",r.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var o=n.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=i.other.left+"px",o.style.top=i.other.top+"px",o.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Ui(e,t){return e.top-t.top||e.left-t.left}function qi(e,t,n){var i=e.display,r=e.doc,o=document.createDocumentFragment(),a=qn(e.display),l=a.left,s=Math.max(i.sizerWidth,Yn(e)-i.sizer.offsetLeft)-a.right,c="ltr"==r.direction;function u(e,t,n,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?s-e:n)+"px;\n height: "+(i-t)+"px"))}function h(t,n,i){var o,a,h=Je(r,t),d=h.text.length;function p(n,i){return yi(e,ot(t,n),"div",h,i)}function f(t,n,i){var r=Si(e,h,null,t),o="ltr"==n==("after"==i)?"left":"right";return p("after"==i?r.begin:r.end-(/\s/.test(h.text.charAt(r.end-1))?2:1),o)[o]}var m=de(h,r.direction);return se(m,n||0,null==i?d:i,(function(e,t,r,h){var v="ltr"==r,g=p(e,v?"left":"right"),y=p(t-1,v?"right":"left"),b=null==n&&0==e,x=null==i&&t==d,w=0==h,C=!m||h==m.length-1;if(y.top-g.top<=3){var k=(c?x:b)&&C,S=(c?b:x)&&w?l:(v?g:y).left,E=k?s:(v?y:g).right;u(S,g.top,E-S,g.bottom)}else{var M,T,L,A;v?(M=c&&b&&w?l:g.left,T=c?s:f(e,r,"before"),L=c?l:f(t,r,"after"),A=c&&x&&C?s:y.right):(M=c?f(e,r,"before"):l,T=!c&&b&&w?s:g.right,L=!c&&x&&C?l:y.left,A=c?f(t,r,"after"):s),u(M,g.top,T-M,g.bottom),g.bottom<y.top&&u(l,g.bottom,null,y.top),u(L,y.top,A-L,y.bottom)}(!o||Ui(g,o)<0)&&(o=g),Ui(y,o)<0&&(o=y),(!a||Ui(g,a)<0)&&(a=g),Ui(y,a)<0&&(a=y)})),{start:o,end:a}}var d=t.from(),p=t.to();if(d.line==p.line)h(d.line,d.ch,p.ch);else{var f=Je(r,d.line),m=Je(r,p.line),v=Qt(f)==Qt(m),g=h(d.line,d.ch,v?f.text.length+1:null).end,y=h(p.line,v?0:null,p.ch).start;v&&(g.top<y.top-2?(u(g.right,g.top,null,g.bottom),u(l,y.top,y.left,y.bottom)):u(g.right,g.top,y.left-g.right,g.bottom)),g.bottom<y.top&&u(l,g.bottom,null,y.top)}n.appendChild(o)}function Ki(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||Qi(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Yi(e){e.state.focused||(e.display.input.focus(),Ji(e))}function Xi(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Qi(e))}),100)}function Ji(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ge(e,"focus",e,t),e.state.focused=!0,B(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Ki(e))}function Qi(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ge(e,"blur",e,t),e.state.focused=!1,M(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function $i(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var r=t.view[i],o=e.options.lineWrapping,s=void 0,c=0;if(!r.hidden){if(a&&l<8){var u=r.node.offsetTop+r.node.offsetHeight;s=u-n,n=u}else{var h=r.node.getBoundingClientRect();s=h.bottom-h.top,!o&&r.text.firstChild&&(c=r.text.firstChild.getBoundingClientRect().right-h.left-1)}var d=r.line.height-s;if((d>.005||d<-.005)&&(et(r.line,s),er(r.line),r.rest))for(var p=0;p<r.rest.length;p++)er(r.rest[p]);if(c>e.display.sizerWidth){var f=Math.ceil(c/Di(e.display));f>e.display.maxLineLength&&(e.display.maxLineLength=f,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}}function er(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],i=n.node.parentNode;i&&(n.height=i.offsetHeight)}}function tr(e,t,n){var i=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;i=Math.floor(i-Vn(e));var r=n&&null!=n.bottom?n.bottom:i+e.wrapper.clientHeight,o=nt(t,i),a=nt(t,r);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<o?(o=l,a=nt(t,an(Je(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=nt(t,an(Je(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function nr(e,t){if(!ye(e,"scrollCursorIntoView")){var n=e.display,i=n.sizer.getBoundingClientRect(),r=null;if(t.top+i.top<0?r=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!f){var o=A("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Vn(e.display))+"px;\n height: "+(t.bottom-t.top+Kn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(r),e.display.lineSpace.removeChild(o)}}}function ir(e,t,n,i){var r;null==i&&(i=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?ot(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ot(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,l=bi(e,t),s=n&&n!=t?bi(e,n):l,c=or(e,r={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-i,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+i}),u=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=c.scrollTop&&(dr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(fr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(a=!0)),!a)break}return r}function rr(e,t){var n=or(e,t);null!=n.scrollTop&&dr(e,n.scrollTop),null!=n.scrollLeft&&fr(e,n.scrollLeft)}function or(e,t){var n=e.display,i=Ai(e.display);t.top<0&&(t.top=0);var r=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Xn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Un(n),s=t.top<i,c=t.bottom>l-i;if(t.top<r)a.scrollTop=s?0:t.top;else if(t.bottom>r+o){var u=Math.min(t.top,(c?l:t.bottom)-o);u!=r&&(a.scrollTop=u)}var h=e.options.fixedGutter?0:n.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-h,p=Yn(e)-n.gutters.offsetWidth,f=t.right-t.left>p;return f&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left+h-(f?0:10)):t.right>p+d-3&&(a.scrollLeft=t.right+(f?0:10)-p),a}function ar(e,t){null!=t&&(ur(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function lr(e){ur(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function sr(e,t,n){null==t&&null==n||ur(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function cr(e,t){ur(e),e.curOp.scrollToPos=t}function ur(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,hr(e,xi(e,t.from),xi(e,t.to),t.margin))}function hr(e,t,n,i){var r=or(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-i,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+i});sr(e,r.scrollLeft,r.scrollTop)}function dr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Wr(e,{top:t}),pr(e,t,!0),n&&Wr(e),Ir(e,100))}function pr(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function fr(e,t,n,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i||(e.doc.scrollLeft=t,qr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function mr(e){var t=e.display,n=t.gutters.offsetWidth,i=Math.round(e.doc.height+Un(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+Kn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var vr=function(e,t,n){this.cm=n;var i=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,e(i),e(r),fe(i,"scroll",(function(){i.clientHeight&&t(i.scrollTop,"vertical")})),fe(r,"scroll",(function(){r.clientWidth&&t(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};vr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var r=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:t?i:0}},vr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},vr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},vr.prototype.zeroWidthHack=function(){var e=y&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new F,this.disableVert=new F},vr.prototype.enableZeroWidthBar=function(e,t,n){function i(){var r=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,i)}e.style.pointerEvents="auto",t.set(1e3,i)},vr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var gr=function(){};function yr(e,t){t||(t=mr(e));var n=e.display.barWidth,i=e.display.barHeight;br(e,t);for(var r=0;r<4&&n!=e.display.barWidth||i!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&$i(e),br(e,mr(e)),n=e.display.barWidth,i=e.display.barHeight}function br(e,t){var n=e.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}gr.prototype.update=function(){return{bottom:0,right:0}},gr.prototype.setScrollLeft=function(){},gr.prototype.setScrollTop=function(){},gr.prototype.clear=function(){};var xr={native:vr,null:gr};function wr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&M(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new xr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?fr(e,t):dr(e,t)}),e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var Cr=0;function kr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.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:++Cr},En(e.curOp)}function Sr(e){var t=e.curOp;t&&Tn(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;Er(e)}))}function Er(e){for(var t=e.ops,n=0;n<t.length;n++)Mr(t[n]);for(var i=0;i<t.length;i++)Tr(t[i]);for(var r=0;r<t.length;r++)Lr(t[r]);for(var o=0;o<t.length;o++)Ar(t[o]);for(var a=0;a<t.length;a++)Dr(t[a])}function Mr(e){var t=e.cm,n=t.display;jr(t),e.updateMaxLine&&sn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Rr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Tr(e){e.updatedDisplay=e.mustUpdate&&zr(e.cm,e.update)}function Lr(e){var t=e.cm,n=t.display;e.updatedDisplay&&$i(t),e.barMeasure=mr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ei(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Kn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Yn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Ar(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&fr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==N();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&yr(t,e.barMeasure),e.updatedDisplay&&Ur(t,e.barMeasure),e.selectionChanged&&Ki(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Yi(e.cm)}function Dr(e){var t=e.cm,n=t.display,i=t.doc;e.updatedDisplay&&Hr(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&pr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&fr(t,e.scrollLeft,!0,!0),e.scrollToPos&&nr(t,ir(t,dt(i,e.scrollToPos.from),dt(i,e.scrollToPos.to),e.scrollToPos.margin));var r=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(r)for(var a=0;a<r.length;++a)r[a].lines.length||ge(r[a],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&ge(o[l],"unhide");n.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ge(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Pr(e,t){if(e.curOp)return t();kr(e);try{return t()}finally{Sr(e)}}function Nr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);kr(e);try{return t.apply(e,arguments)}finally{Sr(e)}}}function Br(e){return function(){if(this.curOp)return e.apply(this,arguments);kr(this);try{return e.apply(this,arguments)}finally{Sr(this)}}}function _r(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);kr(t);try{return e.apply(this,arguments)}finally{Sr(t)}}}function Ir(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,O(Or,e))}function Or(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,i=bt(e,t.highlightFrontier),r=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(i.line>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength?qe(t.mode,i.state):null,s=gt(e,o,i,!0);l&&(i.state=l),o.styles=s.styles;var c=o.styleClasses,u=s.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var h=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!h&&d<a.length;++d)h=a[d]!=o.styles[d];h&&r.push(i.line),o.stateAfter=i.save(),i.nextLine()}else o.text.length<=e.options.maxHighlightLength&&xt(e,o.text,i),o.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>n)return Ir(e,e.options.workDelay),!0})),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),r.length&&Pr(e,(function(){for(var t=0;t<r.length;t++)ji(e,r[t],"text")}))}}var Rr=function(e,t,n){var i=e.display;this.viewport=t,this.visible=tr(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Yn(e),this.force=n,this.dims=Pi(e),this.events=[]};function jr(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Kn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Kn(e)+"px",t.scrollbarsClipped=!0)}function Fr(e){if(e.hasFocus())return null;var t=N();if(!t||!P(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&P(e.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}function Zr(e){if(e&&e.activeElt&&e.activeElt!=N()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&P(document.body,e.anchorNode)&&P(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function zr(e,t){var n=e.display,i=e.doc;if(t.editorIsHidden)return Fi(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Hi(e))return!1;Kr(e)&&(Fi(e),t.dims=Pi(e));var r=i.first+i.size,o=Math.max(t.visible.from-e.options.viewportMargin,i.first),a=Math.min(r,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(i.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(r,n.viewTo)),Dt&&(o=tn(e.doc,o),a=nn(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;zi(e,o,a),n.viewOffset=an(Je(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=Hi(e);if(!l&&0==s&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Fr(e);return s>4&&(n.lineDiv.style.display="none"),Gr(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Zr(c),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Ir(e,400)),n.updateLineNumbers=null,!0}function Hr(e,t){for(var n=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=Yn(e))i&&(t.visible=tr(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Un(e.display)-Xn(e),n.top)}),t.visible=tr(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!zr(e,t))break;$i(e);var r=mr(e);Wi(e),yr(e,r),Ur(e,r),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Wr(e,t){var n=new Rr(e,t);if(zr(e,n)){$i(e),Hr(e,n);var i=mr(e);Wi(e),yr(e,i),Ur(e,i),n.finish()}}function Gr(e,t,n){var i=e.display,r=e.options.lineNumbers,o=i.lineDiv,a=o.firstChild;function l(t){var n=t.nextSibling;return s&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=i.view,u=i.viewFrom,h=0;h<c.length;h++){var d=c[h];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;a!=d.node;)a=l(a);var p=r&&null!=t&&t<=u&&d.lineNumber;d.changes&&(Z(d.changes,"gutter")>-1&&(p=!1),Pn(e,d,u,n)),p&&(T(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(rt(e.options,u)))),a=d.node.nextSibling}else{var f=Fn(e,d,u,n);o.insertBefore(f,a)}u+=d.size}for(;a;)a=l(a)}function Vr(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ur(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Kn(e)+"px"}function qr(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=Ni(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,o=i+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=i+r+"px")}}function Kr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=rt(e.options,t.first+t.size-1),i=e.display;if(n.length!=i.lineNumChars){var r=i.measure.appendChild(A("div",[A("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=r.firstChild.offsetWidth,a=r.offsetWidth-o;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-a)+1,i.lineNumWidth=i.lineNumInnerWidth+a,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Vr(e.display),!0}return!1}function Yr(e,t){for(var n=[],i=!1,r=0;r<e.length;r++){var o=e[r],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;i=!0}n.push({className:o,style:a})}return t&&!i&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Xr(e){var t=e.gutters,n=e.gutterSpecs;T(t),e.lineGutter=null;for(var i=0;i<n.length;++i){var r=n[i],o=r.className,a=r.style,l=t.appendChild(A("div",null,"CodeMirror-gutter "+o));a&&(l.style.cssText=a),"CodeMirror-linenumbers"==o&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Vr(e)}function Jr(e){Xr(e.display),Ri(e),qr(e)}function Qr(e,t,i,r){var o=this;this.input=i,o.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=D("div",null,"CodeMirror-code"),o.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=A("div",null,"CodeMirror-cursors"),o.measure=A("div",null,"CodeMirror-measure"),o.lineMeasure=A("div",null,"CodeMirror-measure"),o.lineSpace=D("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=D("div",[o.lineSpace],"CodeMirror-lines");o.mover=A("div",[c],null,"position: relative"),o.sizer=A("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=A("div",null,null,"position: absolute; height: "+z+"px; width: 1px;"),o.gutters=A("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=A("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=A("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),a&&l<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),s||n&&g||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=Yr(r.gutters,r.lineNumbers),Xr(o),i.init(o)}Rr.prototype.signal=function(e,t){xe(e,t)&&this.events.push(arguments)},Rr.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ge.apply(null,this.events[e])};var $r=0,eo=null;function to(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function no(e){var t=to(e);return t.x*=eo,t.y*=eo,t}function io(e,t){var i=to(t),r=i.x,o=i.y,a=e.display,l=a.scroller,c=l.scrollWidth>l.clientWidth,u=l.scrollHeight>l.clientHeight;if(r&&c||o&&u){if(o&&y&&s)e:for(var d=t.target,p=a.view;d!=l;d=d.parentNode)for(var f=0;f<p.length;f++)if(p[f].node==d){e.display.currentWheelTarget=d;break e}if(r&&!n&&!h&&null!=eo)return o&&u&&dr(e,Math.max(0,l.scrollTop+o*eo)),fr(e,Math.max(0,l.scrollLeft+r*eo)),(!o||o&&u)&&Ce(t),void(a.wheelStartX=null);if(o&&null!=eo){var m=o*eo,v=e.doc.scrollTop,g=v+a.wrapper.clientHeight;m<0?v=Math.max(0,v+m-50):g=Math.min(e.doc.height,g+m+50),Wr(e,{top:v,bottom:g})}$r<20&&(null==a.wheelStartX?(a.wheelStartX=l.scrollLeft,a.wheelStartY=l.scrollTop,a.wheelDX=r,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var e=l.scrollLeft-a.wheelStartX,t=l.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(eo=(eo*$r+n)/($r+1),++$r)}}),200)):(a.wheelDX+=r,a.wheelDY+=o))}}a?eo=-.53:n?eo=15:u?eo=-.7:d&&(eo=-1/3);var ro=function(e,t){this.ranges=e,this.primIndex=t};ro.prototype.primary=function(){return this.ranges[this.primIndex]},ro.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],i=e.ranges[t];if(!lt(n.anchor,i.anchor)||!lt(n.head,i.head))return!1}return!0},ro.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new oo(st(this.ranges[t].anchor),st(this.ranges[t].head));return new ro(e,this.primIndex)},ro.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ro.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=this.ranges[n];if(at(t,i.from())>=0&&at(e,i.to())<=0)return n}return-1};var oo=function(e,t){this.anchor=e,this.head=t};function ao(e,t,n){var i=e&&e.options.selectionsMayTouch,r=t[n];t.sort((function(e,t){return at(e.from(),t.from())})),n=Z(t,r);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=at(l.to(),a.from());if(i&&!a.empty()?s>0:s>=0){var c=ut(l.from(),a.from()),u=ct(l.to(),a.to()),h=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new oo(h?u:c,h?c:u))}}return new ro(t,n)}function lo(e,t){return new ro([new oo(e,t||e)],0)}function so(e){return e.text?ot(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function co(e,t){if(at(e,t.from)<0)return e;if(at(e,t.to)<=0)return so(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=so(t).ch-t.to.ch),ot(n,i)}function uo(e,t){for(var n=[],i=0;i<e.sel.ranges.length;i++){var r=e.sel.ranges[i];n.push(new oo(co(r.anchor,t),co(r.head,t)))}return ao(e.cm,n,e.sel.primIndex)}function ho(e,t,n){return e.line==t.line?ot(n.line,e.ch-t.ch+n.ch):ot(n.line+(e.line-t.line),e.ch)}function po(e,t,n){for(var i=[],r=ot(e.first,0),o=r,a=0;a<t.length;a++){var l=t[a],s=ho(l.from,r,o),c=ho(so(l),r,o);if(r=l.to,o=c,"around"==n){var u=e.sel.ranges[a],h=at(u.head,u.anchor)<0;i[a]=new oo(h?c:s,h?s:c)}else i[a]=new oo(s,s)}return new ro(i,e.sel.primIndex)}function fo(e){e.doc.mode=Ge(e.options,e.doc.modeOption),mo(e)}function mo(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Ir(e,100),e.state.modeGen++,e.curOp&&Ri(e)}function vo(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Y(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function go(e,t,n,i){function r(e){return n?n[e]:null}function o(e,n,r){un(e,n,r,i),An(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new cn(c[o],r(o),i));return n}var l=t.from,s=t.to,c=t.text,u=Je(e,l.line),h=Je(e,s.line),d=Y(c),p=r(c.length-1),f=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(vo(e,t)){var m=a(0,c.length-1);o(h,h.text,p),f&&e.remove(l.line,f),m.length&&e.insert(l.line,m)}else if(u==h)if(1==c.length)o(u,u.text.slice(0,l.ch)+d+u.text.slice(s.ch),p);else{var v=a(1,c.length-1);v.push(new cn(d+u.text.slice(s.ch),p,i)),o(u,u.text.slice(0,l.ch)+c[0],r(0)),e.insert(l.line+1,v)}else if(1==c.length)o(u,u.text.slice(0,l.ch)+c[0]+h.text.slice(s.ch),r(0)),e.remove(l.line+1,f);else{o(u,u.text.slice(0,l.ch)+c[0],r(0)),o(h,d+h.text.slice(s.ch),p);var g=a(1,c.length-1);f>1&&e.remove(l.line+1,f-1),e.insert(l.line+1,g)}An(e,"change",e,t)}function yo(e,t,n){function i(e,r,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var l=e.linked[a];if(l.doc!=r){var s=o&&l.sharedHist;n&&!s||(t(l.doc,s),i(l.doc,e,s))}}}i(e,null,!0)}function bo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,_i(e),fo(e),xo(e),e.options.lineWrapping||sn(e),e.options.mode=t.modeOption,Ri(e)}function xo(e){("rtl"==e.doc.direction?B:M)(e.display.lineDiv,"CodeMirror-rtl")}function wo(e){Pr(e,(function(){xo(e),Ri(e)}))}function Co(e){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=e||1}function ko(e,t){var n={from:st(t.from),to:so(t),text:Qe(e,t.from,t.to)};return Do(e,n,t.from.line,t.to.line+1),yo(e,(function(e){return Do(e,n,t.from.line,t.to.line+1)}),!0),n}function So(e){for(;e.length&&Y(e).ranges;)e.pop()}function Eo(e,t){return t?(So(e.done),Y(e.done)):e.done.length&&!Y(e.done).ranges?Y(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}function Mo(e,t,n,i){var r=e.history;r.undone.length=0;var o,a,l=+new Date;if((r.lastOp==i||r.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&r.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=Eo(r,r.lastOp==i)))a=Y(o.changes),0==at(t.from,t.to)&&0==at(t.from,a.to)?a.to=so(t):o.changes.push(ko(e,t));else{var s=Y(r.done);for(s&&s.ranges||Ao(e.sel,r.done),o={changes:[ko(e,t)],generation:r.generation},r.done.push(o);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=l,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=t.origin,a||ge(e,"historyAdded")}function To(e,t,n,i){var r=t.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Lo(e,t,n,i){var r=e.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||To(e,o,Y(r.done),t))?r.done[r.done.length-1]=t:Ao(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&!1!==i.clearRedo&&So(r.undone)}function Ao(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Do(e,t,n,i){var r=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),(function(n){n.markedSpans&&((r||(r=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Po(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function No(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var i=[],r=0;r<t.text.length;++r)i.push(Po(n[r]));return i}function Bo(e,t){var n=No(e,t),i=Ft(e,t);if(!n)return i;if(!i)return n;for(var r=0;r<n.length;++r){var o=n[r],a=i[r];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(n[r]=a)}return n}function _o(e,t,n){for(var i=[],r=0;r<e.length;++r){var o=e[r];if(o.ranges)i.push(n?ro.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];i.push({changes:l});for(var s=0;s<a.length;++s){var c=a[s],u=void 0;if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var h in c)(u=h.match(/^spans_(\d+)$/))&&Z(t,Number(u[1]))>-1&&(Y(l)[h]=c[h],delete c[h])}}}return i}function Io(e,t,n,i){if(i){var r=e.anchor;if(n){var o=at(t,r)<0;o!=at(n,r)<0?(r=t,t=n):o!=at(t,n)<0&&(t=n)}return new oo(r,t)}return new oo(n||t,t)}function Oo(e,t,n,i,r){null==r&&(r=e.cm&&(e.cm.display.shift||e.extend)),Ho(e,new ro([Io(e.sel.primary(),t,n,r)],0),i)}function Ro(e,t,n){for(var i=[],r=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)i[o]=Io(e.sel.ranges[o],t[o],null,r);Ho(e,ao(e.cm,i,e.sel.primIndex),n)}function jo(e,t,n,i){var r=e.sel.ranges.slice(0);r[t]=n,Ho(e,ao(e.cm,r,e.sel.primIndex),i)}function Fo(e,t,n,i){Ho(e,lo(t,n),i)}function Zo(e,t,n){var i={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new oo(dt(e,t[n].anchor),dt(e,t[n].head))},origin:n&&n.origin};return ge(e,"beforeSelectionChange",e,i),e.cm&&ge(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?ao(e.cm,i.ranges,i.ranges.length-1):t}function zo(e,t,n){var i=e.history.done,r=Y(i);r&&r.ranges?(i[i.length-1]=t,Wo(e,t,n)):Ho(e,t,n)}function Ho(e,t,n){Wo(e,t,n),Lo(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Wo(e,t,n){(xe(e,"beforeSelectionChange")||e.cm&&xe(e.cm,"beforeSelectionChange"))&&(t=Zo(e,t,n));var i=n&&n.bias||(at(t.primary().head,e.sel.primary().head)<0?-1:1);Go(e,Uo(e,t,i,!0)),n&&!1===n.scroll||!e.cm||lr(e.cm)}function Go(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,be(e.cm)),An(e,"cursorActivity",e))}function Vo(e){Go(e,Uo(e,e.sel,null,!1))}function Uo(e,t,n,i){for(var r,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=Ko(e,a.anchor,l&&l.anchor,n,i),c=Ko(e,a.head,l&&l.head,n,i);(r||s!=a.anchor||c!=a.head)&&(r||(r=t.ranges.slice(0,o)),r[o]=new oo(s,c))}return r?ao(e.cm,r,t.primIndex):t}function qo(e,t,n,i,r){var o=Je(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,c="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,u="selectRight"in s?!s.selectRight:s.inclusiveRight;if((null==l.from||(c?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(u?l.to>=t.ch:l.to>t.ch))){if(r&&(ge(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(n){var h=s.find(i<0?1:-1),d=void 0;if((i<0?u:c)&&(h=Yo(e,h,-i,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(d=at(h,n))&&(i<0?d<0:d>0))return qo(e,h,t,i,r)}var p=s.find(i<0?-1:1);return(i<0?c:u)&&(p=Yo(e,p,i,p.line==t.line?o:null)),p?qo(e,p,t,i,r):null}}return t}function Ko(e,t,n,i,r){var o=i||1,a=qo(e,t,n,o,r)||!r&&qo(e,t,n,o,!0)||qo(e,t,n,-o,r)||!r&&qo(e,t,n,-o,!0);return a||(e.cantEdit=!0,ot(e.first,0))}function Yo(e,t,n,i){return n<0&&0==t.ch?t.line>e.first?dt(e,ot(t.line-1)):null:n>0&&t.ch==(i||Je(e,t.line)).text.length?t.line<e.first+e.size-1?ot(t.line+1,0):null:new ot(t.line,t.ch+n)}function Xo(e){e.setSelection(ot(e.firstLine(),0),ot(e.lastLine()),W)}function Jo(e,t,n){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return n&&(i.update=function(t,n,r,o){t&&(i.from=dt(e,t)),n&&(i.to=dt(e,n)),r&&(i.text=r),void 0!==o&&(i.origin=o)}),ge(e,"beforeChange",e,i),e.cm&&ge(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function Qo(e,t,n){if(e.cm){if(!e.cm.curOp)return Nr(e.cm,Qo)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(xe(e,"beforeChange")||e.cm&&xe(e.cm,"beforeChange"))||(t=Jo(e,t,!0))){var i=At&&!n&&zt(e,t.from,t.to);if(i)for(var r=i.length-1;r>=0;--r)$o(e,{from:i[r].from,to:i[r].to,text:r?[""]:t.text,origin:t.origin});else $o(e,t)}}function $o(e,t){if(1!=t.text.length||""!=t.text[0]||0!=at(t.from,t.to)){var n=uo(e,t);Mo(e,t,n,e.cm?e.cm.curOp.id:NaN),na(e,t,n,Ft(e,t));var i=[];yo(e,(function(e,n){n||-1!=Z(i,e.history)||(la(e.history,t),i.push(e.history)),na(e,t,null,Ft(e,t))}))}}function ea(e,t,n){var i=e.cm&&e.cm.state.suppressEdits;if(!i||n){for(var r,o=e.history,a=e.sel,l="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,c=0;c<l.length&&(r=l[c],n?!r.ranges||r.equals(e.sel):r.ranges);c++);if(c!=l.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(r=l.pop()).ranges){if(i)return void l.push(r);break}if(Ao(r,s),n&&!r.equals(e.sel))return void Ho(e,r,{clearRedo:!1});a=r}var u=[];Ao(a,s),s.push({changes:u,generation:o.generation}),o.generation=r.generation||++o.maxGeneration;for(var h=xe(e,"beforeChange")||e.cm&&xe(e.cm,"beforeChange"),d=function(n){var i=r.changes[n];if(i.origin=t,h&&!Jo(e,i,!1))return l.length=0,{};u.push(ko(e,i));var o=n?uo(e,i):Y(l);na(e,i,o,Bo(e,i)),!n&&e.cm&&e.cm.scrollIntoView({from:i.from,to:so(i)});var a=[];yo(e,(function(e,t){t||-1!=Z(a,e.history)||(la(e.history,i),a.push(e.history)),na(e,i,null,Bo(e,i))}))},p=r.changes.length-1;p>=0;--p){var f=d(p);if(f)return f.v}}}}function ta(e,t){if(0!=t&&(e.first+=t,e.sel=new ro(X(e.sel.ranges,(function(e){return new oo(ot(e.anchor.line+t,e.anchor.ch),ot(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Ri(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;i<n.viewTo;i++)ji(e.cm,i,"gutter")}}function na(e,t,n,i){if(e.cm&&!e.cm.curOp)return Nr(e.cm,na)(e,t,n,i);if(t.to.line<e.first)ta(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var r=t.text.length-1-(e.first-t.from.line);ta(e,r),t={from:ot(e.first,0),to:ot(t.to.line+r,t.to.ch),text:[Y(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ot(o,Je(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Qe(e,t.from,t.to),n||(n=uo(e,t)),e.cm?ia(e.cm,t,i):go(e,t,i),Wo(e,n,W),e.cantEdit&&Ko(e,ot(e.firstLine(),0))&&(e.cantEdit=!1)}}function ia(e,t,n){var i=e.doc,r=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=tt(Qt(Je(i,o.line))),i.iter(s,a.line+1,(function(e){if(e==r.maxLine)return l=!0,!0}))),i.sel.contains(t.from,t.to)>-1&&be(e),go(i,t,n,Bi(e)),e.options.lineWrapping||(i.iter(s,o.line+t.text.length,(function(e){var t=ln(e);t>r.maxLineLength&&(r.maxLine=e,r.maxLineLength=t,r.maxLineChanged=!0,l=!1)})),l&&(e.curOp.updateMaxLine=!0)),Lt(i,o.line),Ir(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?Ri(e):o.line!=a.line||1!=t.text.length||vo(e.doc,t)?Ri(e,o.line,a.line+1,c):ji(e,o.line,"text");var u=xe(e,"changes"),h=xe(e,"change");if(h||u){var d={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};h&&An(e,"change",e,d),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}function ra(e,t,n,i,r){var o;i||(i=n),at(i,n)<0&&(n=(o=[i,n])[0],i=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Qo(e,{from:n,to:i,text:t,origin:r})}function oa(e,t,n,i){n<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function aa(e,t,n,i){for(var r=0;r<e.length;++r){var o=e[r],a=!0;if(o.ranges){o.copied||((o=e[r]=o.deepCopy()).copied=!0);for(var l=0;l<o.ranges.length;l++)oa(o.ranges[l].anchor,t,n,i),oa(o.ranges[l].head,t,n,i)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(n<c.from.line)c.from=ot(c.from.line+i,c.from.ch),c.to=ot(c.to.line+i,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,r+1),r=0)}}}function la(e,t){var n=t.from.line,i=t.to.line,r=t.text.length-(i-n)-1;aa(e.done,n,i,r),aa(e.undone,n,i,r)}function sa(e,t,n,i){var r=t,o=t;return"number"==typeof t?o=Je(e,ht(e,t)):r=tt(t),null==r?null:(i(o,r)&&e.cm&&ji(e.cm,r,n),o)}function ca(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function ua(e){this.children=e;for(var t=0,n=0,i=0;i<e.length;++i){var r=e[i];t+=r.chunkSize(),n+=r.height,r.parent=this}this.size=t,this.height=n,this.parent=null}oo.prototype.from=function(){return ut(this.anchor,this.head)},oo.prototype.to=function(){return ct(this.anchor,this.head)},oo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ca.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,i=e+t;n<i;++n){var r=this.lines[n];this.height-=r.height,hn(r),An(r,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,n){for(var i=e+t;e<i;++e)if(n(this.lines[e]))return!0}},ua.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var i=this.children[n],r=i.chunkSize();if(e<r){var o=Math.min(t,r-e),a=i.height;if(i.removeInner(e,o),this.height-=a-i.height,r==o&&(this.children.splice(n--,1),i.parent=null),0==(t-=o))break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ca))){var l=[];this.collapse(l),this.children=[new ca(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var i=0;i<this.children.length;++i){var r=this.children[i],o=r.chunkSize();if(e<=o){if(r.insertInner(e,t,n),r.lines&&r.lines.length>50){for(var a=r.lines.length%25+25,l=a;l<r.lines.length;){var s=new ca(r.lines.slice(l,l+=25));r.height-=s.height,this.children.splice(++i,0,s),s.parent=this}r.lines=r.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new ua(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=Z(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var i=new ua(e.children);i.parent=e,e.children=[i,t],e=i}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var i=0;i<this.children.length;++i){var r=this.children[i],o=r.chunkSize();if(e<o){var a=Math.min(t,o-e);if(r.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var ha=function(e,t,n){if(n)for(var i in n)n.hasOwnProperty(i)&&(this[i]=n[i]);this.doc=e,this.node=t};function da(e,t,n){an(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ar(e,n)}function pa(e,t,n,i){var r=new ha(e,n,i),o=e.cm;return o&&r.noHScroll&&(o.display.alignWidgets=!0),sa(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==r.insertAt?n.push(r):n.splice(Math.min(n.length-1,Math.max(0,r.insertAt)),0,r),r.line=t,o&&!rn(e,t)){var i=an(t)<e.scrollTop;et(t,t.height+Wn(r)),i&&ar(o,r.height),o.curOp.forceUpdate=!0}return!0})),o&&An(o,"lineWidgetAdded",o,r,"number"==typeof t?t:tt(t)),r}ha.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,i=tt(n);if(null!=i&&t){for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(n.widgets=null);var o=Wn(this);et(n,Math.max(0,n.height-o)),e&&(Pr(e,(function(){da(e,n,-o),ji(e,i,"widget")})),An(e,"lineWidgetCleared",e,this,i))}},ha.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,i=this.line;this.height=null;var r=Wn(this)-t;r&&(rn(this.doc,i)||et(i,i.height+r),n&&Pr(n,(function(){n.curOp.forceUpdate=!0,da(n,i,r),An(n,"lineWidgetChanged",n,e,tt(i))})))},we(ha);var fa=0,ma=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++fa};function va(e,t,n,i,r){if(i&&i.shared)return ya(e,t,n,i,r);if(e.cm&&!e.cm.curOp)return Nr(e.cm,va)(e,t,n,i,r);var o=new ma(e,r),a=at(t,n);if(i&&R(i,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=D("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Jt(e,t.line,t,n,o)||t.line!=n.line&&Jt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Nt()}o.addToHistory&&Mo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l,s=t.line,c=e.cm;if(e.iter(s,n.line+1,(function(e){c&&o.collapsed&&!c.options.lineWrapping&&Qt(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&et(e,0),Ot(e,new Bt(o,s==t.line?t.ch:null,s==n.line?n.ch:null)),++s})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){rn(e,t)&&et(t,0)})),o.clearOnEnter&&fe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Pt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++fa,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)Ri(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)ji(c,u,"text");o.atomic&&Vo(c.doc),An(c,"markerAdded",c,o)}return o}ma.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&kr(e),xe(this,"clear")){var n=this.find();n&&An(this,"clear",n.from,n.to)}for(var i=null,r=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=_t(a.markedSpans,this);e&&!this.collapsed?ji(e,tt(a),"text"):e&&(null!=l.to&&(r=tt(a)),null!=l.from&&(i=tt(a))),a.markedSpans=It(a.markedSpans,l),null==l.from&&this.collapsed&&!rn(this.doc,a)&&e&&et(a,Ai(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var c=Qt(this.lines[s]),u=ln(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=i&&e&&this.collapsed&&Ri(e,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Vo(e.doc)),e&&An(e,"markerCleared",e,this,i,r),t&&Sr(e),this.parent&&this.parent.clear()}},ma.prototype.find=function(e,t){var n,i;null==e&&"bookmark"==this.type&&(e=1);for(var r=0;r<this.lines.length;++r){var o=this.lines[r],a=_t(o.markedSpans,this);if(null!=a.from&&(n=ot(t?o:tt(o),a.from),-1==e))return n;if(null!=a.to&&(i=ot(t?o:tt(o),a.to),1==e))return i}return n&&{from:n,to:i}},ma.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,i=this.doc.cm;t&&i&&Pr(i,(function(){var r=t.line,o=tt(t.line),a=ti(i,o);if(a&&(ui(a),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!rn(n.doc,r)&&null!=n.height){var l=n.height;n.height=null;var s=Wn(n)-l;s&&et(r,r.height+s)}An(i,"markerChanged",i,e)}))},ma.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=Z(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ma.prototype.detachLine=function(e){if(this.lines.splice(Z(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},we(ma);var ga=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function ya(e,t,n,i,r){(i=R(i)).shared=!1;var o=[va(e,t,n,i,r)],a=o[0],l=i.widgetNode;return yo(e,(function(e){l&&(i.widgetNode=l.cloneNode(!0)),o.push(va(e,dt(e,t),dt(e,n),i,r));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=Y(o)})),new ga(o,a)}function ba(e){return e.findMarks(ot(e.first,0),e.clipPos(ot(e.lastLine())),(function(e){return e.parent}))}function xa(e,t){for(var n=0;n<t.length;n++){var i=t[n],r=i.find(),o=e.clipPos(r.from),a=e.clipPos(r.to);if(at(o,a)){var l=va(e,o,a,i.primary,i.primary.type);i.markers.push(l),l.parent=i}}}function wa(e){for(var t=function(t){var n=e[t],i=[n.primary.doc];yo(n.primary.doc,(function(e){return i.push(e)}));for(var r=0;r<n.markers.length;r++){var o=n.markers[r];-1==Z(i,o.doc)&&(o.parent=null,n.markers.splice(r--,1))}},n=0;n<e.length;n++)t(n)}ga.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();An(this,"clear")}},ga.prototype.find=function(e,t){return this.primary.find(e,t)},we(ga);var Ca=0,ka=function(e,t,n,i,r){if(!(this instanceof ka))return new ka(e,t,n,i,r);null==n&&(n=0),ua.call(this,[new ca([new cn("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=ot(n,0);this.sel=lo(o),this.history=new Co(null),this.id=++Ca,this.modeOption=t,this.lineSep=i,this.direction="rtl"==r?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),go(this,{from:o,to:o,text:e}),Ho(this,lo(o),W)};ka.prototype=$(ua.prototype,{constructor:ka,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,i=0;i<t.length;++i)n+=t[i].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=$e(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:_r((function(e){var t=ot(this.first,0),n=this.first+this.size-1;Qo(this,{from:t,to:ot(n,Je(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&sr(this.cm,0,0),Ho(this,lo(t),W)})),replaceRange:function(e,t,n,i){ra(this,e,t=dt(this,t),n=n?dt(this,n):t,i)},getRange:function(e,t,n){var i=Qe(this,dt(this,e),dt(this,t));return!1===n?i:i.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(it(this,e))return Je(this,e)},getLineNumber:function(e){return tt(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Je(this,e)),Qt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return dt(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:_r((function(e,t,n){Fo(this,dt(this,"number"==typeof e?ot(e,t||0):e),null,n)})),setSelection:_r((function(e,t,n){Fo(this,dt(this,e),dt(this,t||e),n)})),extendSelection:_r((function(e,t,n){Oo(this,dt(this,e),t&&dt(this,t),n)})),extendSelections:_r((function(e,t){Ro(this,ft(this,e),t)})),extendSelectionsBy:_r((function(e,t){Ro(this,ft(this,X(this.sel.ranges,e)),t)})),setSelections:_r((function(e,t,n){if(e.length){for(var i=[],r=0;r<e.length;r++)i[r]=new oo(dt(this,e[r].anchor),dt(this,e[r].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Ho(this,ao(this.cm,i,t),n)}})),addSelection:_r((function(e,t,n){var i=this.sel.ranges.slice(0);i.push(new oo(dt(this,e),dt(this,t||e))),Ho(this,ao(this.cm,i,i.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,i=0;i<n.length;i++){var r=Qe(this,n[i].from(),n[i].to());t=t?t.concat(r):r}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,i=0;i<n.length;i++){var r=Qe(this,n[i].from(),n[i].to());!1!==e&&(r=r.join(e||this.lineSeparator())),t[i]=r}return t},replaceSelection:function(e,t,n){for(var i=[],r=0;r<this.sel.ranges.length;r++)i[r]=e;this.replaceSelections(i,t,n||"+input")},replaceSelections:_r((function(e,t,n){for(var i=[],r=this.sel,o=0;o<r.ranges.length;o++){var a=r.ranges[o];i[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var l=t&&"end"!=t&&po(this,i,t),s=i.length-1;s>=0;s--)Qo(this,i[s]);l?zo(this,l):this.cm&&lr(this.cm)})),undo:_r((function(){ea(this,"undo")})),redo:_r((function(){ea(this,"redo")})),undoSelection:_r((function(){ea(this,"undo",!0)})),redoSelection:_r((function(){ea(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Co(this.history.maxGeneration),yo(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:_o(this.history.done),undone:_o(this.history.undone)}},setHistory:function(e){var t=this.history=new Co(this.history.maxGeneration);t.done=_o(e.done.slice(0),null,!0),t.undone=_o(e.undone.slice(0),null,!0)},setGutterMarker:_r((function(e,t,n){return sa(this,e,"gutter",(function(e){var i=e.gutterMarkers||(e.gutterMarkers={});return i[t]=n,!n&&ie(i)&&(e.gutterMarkers=null),!0}))})),clearGutter:_r((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&sa(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,ie(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!it(this,e))return null;if(t=e,!(e=Je(this,e)))return null}else if(null==(t=tt(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:_r((function(e,t,n){return sa(this,e,"gutter"==t?"gutter":"class",(function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[i]){if(S(n).test(e[i]))return!1;e[i]+=" "+n}else e[i]=n;return!0}))})),removeLineClass:_r((function(e,t,n){return sa(this,e,"gutter"==t?"gutter":"class",(function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",r=e[i];if(!r)return!1;if(null==n)e[i]=null;else{var o=r.match(S(n));if(!o)return!1;var a=o.index+o[0].length;e[i]=r.slice(0,o.index)+(o.index&&a!=r.length?" ":"")+r.slice(a)||null}return!0}))})),addLineWidget:_r((function(e,t,n){return pa(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return va(this,dt(this,e),dt(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return va(this,e=dt(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Je(this,(e=dt(this,e)).line).markedSpans;if(n)for(var i=0;i<n.length;++i){var r=n[i];(null==r.from||r.from<=e.ch)&&(null==r.to||r.to>=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,n){e=dt(this,e),t=dt(this,t);var i=[],r=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&r==e.line&&e.ch>=s.to||null==s.from&&r!=e.line||null!=s.from&&r==t.line&&s.from>=t.ch||n&&!n(s.marker)||i.push(s.marker.parent||s.marker)}++r})),i},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var i=0;i<n.length;++i)null!=n[i].from&&e.push(n[i].marker)})),e},posFromIndex:function(e){var t,n=this.first,i=this.lineSeparator().length;return this.iter((function(r){var o=r.text.length+i;if(o>e)return t=e,!0;e-=o,++n})),dt(this,ot(n,t))},indexFromPos:function(e){var t=(e=dt(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new ka($e(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var i=new ka($e(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],xa(i,ba(this)),i},unlinkDoc:function(e){if(e instanceof Rl&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),wa(ba(this));break}if(e.history==this.history){var n=[e.id];yo(e,(function(e){return n.push(e.id)}),!0),e.history=new Co(null),e.history.done=_o(this.history.done,n),e.history.undone=_o(this.history.undone,n)}},iterLinkedDocs:function(e){yo(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):_e(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:_r((function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&wo(this.cm))}))}),ka.prototype.eachLine=ka.prototype.iter;var Sa=0;function Ea(e){var t=this;if(La(t),!ye(t,e)&&!Gn(t.display,e)){Ce(e),a&&(Sa=+new Date);var n=Ii(t,e,!0),i=e.dataTransfer.files;if(n&&!t.isReadOnly())if(i&&i.length&&window.FileReader&&window.File)for(var r=i.length,o=Array(r),l=0,s=function(){++l==r&&Nr(t,(function(){var e={from:n=dt(t.doc,n),to:n,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};Qo(t.doc,e),zo(t.doc,lo(dt(t.doc,n),dt(t.doc,so(e))))}))()},c=function(e,n){if(t.options.allowDropFileTypes&&-1==Z(t.options.allowDropFileTypes,e.type))s();else{var i=new FileReader;i.onerror=function(){return s()},i.onload=function(){var e=i.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[n]=e),s()},i.readAsText(e)}},u=0;u<i.length;u++)c(i[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var h=e.dataTransfer.getData("Text");if(h){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),Wo(t.doc,lo(n,n)),d)for(var p=0;p<d.length;++p)ra(t.doc,"",d[p].anchor,d[p].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Ma(e,t){if(a&&(!e.state.draggingText||+new Date-Sa<100))Ee(t);else if(!ye(e,t)&&!Gn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=A("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}function Ta(e,t){var n=Ii(e,t);if(n){var i=document.createDocumentFragment();Vi(e,n,i),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),L(e.display.dragCursor,i)}}function La(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Aa(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],i=0;i<t.length;i++){var r=t[i].CodeMirror;r&&n.push(r)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Da=!1;function Pa(){Da||(Na(),Da=!0)}function Na(){var e;fe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Aa(Ba)}),100))})),fe(window,"blur",(function(){return Aa(Qi)}))}function Ba(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var _a={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"},Ia=0;Ia<10;Ia++)_a[Ia+48]=_a[Ia+96]=String(Ia);for(var Oa=65;Oa<=90;Oa++)_a[Oa]=String.fromCharCode(Oa);for(var Ra=1;Ra<=12;Ra++)_a[Ra+111]=_a[Ra+63235]="F"+Ra;var ja={};function Fa(e){var t,n,i,r,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))r=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);i=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),r&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Za(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==i){delete e[n];continue}for(var r=X(n.split(" "),Fa),o=0;o<r.length;o++){var a=void 0,l=void 0;o==r.length-1?(l=r.join(" "),a=i):(l=r.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[n]}for(var c in t)e[c]=t[c];return e}function za(e,t,n,i){var r=(t=Va(t)).call?t.call(e,i):t[e];if(!1===r)return"nothing";if("..."===r)return"multi";if(null!=r&&n(r))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return za(e,t.fallthrough,n,i);for(var o=0;o<t.fallthrough.length;o++){var a=za(e,t.fallthrough[o],n,i);if(a)return a}}}function Ha(e){var t="string"==typeof e?e:_a[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Wa(e,t,n){var i=e;return t.altKey&&"Alt"!=i&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=i&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&"Mod"!=i&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=i&&(e="Shift-"+e),e}function Ga(e,t){if(h&&34==e.keyCode&&e.char)return!1;var n=_a[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Wa(n,e,t))}function Va(e){return"string"==typeof e?ja[e]:e}function Ua(e,t){for(var n=e.doc.sel.ranges,i=[],r=0;r<n.length;r++){for(var o=t(n[r]);i.length&&at(o.from,Y(i).to)<=0;){var a=i.pop();if(at(a.from,o.from)<0){o.from=a.from;break}}i.push(o)}Pr(e,(function(){for(var t=i.length-1;t>=0;t--)ra(e.doc,"",i[t].from,i[t].to,"+delete");lr(e)}))}function qa(e,t,n){var i=ae(e.text,t+n,n);return i<0||i>e.text.length?null:i}function Ka(e,t,n){var i=qa(e,t.ch,n);return null==i?null:new ot(t.line,i,n<0?"after":"before")}function Ya(e,t,n,i,r){if(e){"rtl"==t.doc.direction&&(r=-r);var o=de(n,t.doc.direction);if(o){var a,l=r<0?Y(o):o[0],s=r<0==(1==l.level)?"after":"before";if(l.level>0||"rtl"==t.doc.direction){var c=ni(t,n);a=r<0?n.text.length-1:0;var u=ii(t,c,a).top;a=le((function(e){return ii(t,c,e).top==u}),r<0==(1==l.level)?l.from:l.to-1,a),"before"==s&&(a=qa(n,a,1))}else a=r<0?l.to:l.from;return new ot(i,a,s)}}return new ot(i,r<0?n.text.length:0,r<0?"before":"after")}function Xa(e,t,n,i){var r=de(t,e.doc.direction);if(!r)return Ka(t,n,i);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ue(r,n.ch,n.sticky),a=r[o];if("ltr"==e.doc.direction&&a.level%2==0&&(i>0?a.to>n.ch:a.from<n.ch))return Ka(t,n,i);var l,s=function(e,n){return qa(t,e instanceof ot?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(l=l||ni(e,t),Si(e,t,l,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?s(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var h=1==a.level==i<0,d=s(n,h?1:-1);if(null!=d&&(h?d<=a.to&&d<=u.end:d>=a.from&&d>=u.begin)){var p=h?"before":"after";return new ot(n.line,d,p)}}var f=function(e,t,i){for(var o=function(e,t){return t?new ot(n.line,s(e,1),"before"):new ot(n.line,e,"after")};e>=0&&e<r.length;e+=t){var a=r[e],l=t>0==(1!=a.level),c=l?i.begin:s(i.end,-1);if(a.from<=c&&c<a.to)return o(c,l);if(c=l?a.from:s(a.to,-1),i.begin<=c&&c<i.end)return o(c,l)}},m=f(o+i,i,u);if(m)return m;var v=i>0?u.end:s(u.begin,-1);return null==v||i>0&&v==t.text.length||!(m=f(i>0?0:r.length-1,i,c(v)))?null:m}ja.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"},ja.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"},ja.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"},ja.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"]},ja.default=y?ja.macDefault:ja.pcDefault;var Ja={selectAll:Xo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),W)},killLine:function(e){return Ua(e,(function(t){if(t.empty()){var n=Je(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:ot(t.head.line+1,0)}:{from:t.head,to:ot(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Ua(e,(function(t){return{from:ot(t.from().line,0),to:dt(e.doc,ot(t.to().line+1,0))}}))},delLineLeft:function(e){return Ua(e,(function(e){return{from:ot(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Ua(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Ua(e,(function(t){var n=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:i}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ot(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ot(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return Qa(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return el(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return $a(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),V)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),V)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:n},"div");return i.ch<e.getLine(i.line).search(/\S/)?el(e,t.head):i}),V)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),i=e.options.tabSize,r=0;r<n.length;r++){var o=n[r].from(),a=j(e.getLine(o.line),o.ch,i);t.push(K(i-a%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Pr(e,(function(){for(var t=e.listSelections(),n=[],i=0;i<t.length;i++)if(t[i].empty()){var r=t[i].head,o=Je(e.doc,r.line).text;if(o)if(r.ch==o.length&&(r=new ot(r.line,r.ch-1)),r.ch>0)r=new ot(r.line,r.ch+1),e.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),ot(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var a=Je(e.doc,r.line-1).text;a&&(r=new ot(r.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),ot(r.line-1,a.length-1),r,"+transpose"))}n.push(new oo(r,r))}e.setSelections(n)}))},newlineAndIndent:function(e){return Pr(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);lr(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Qa(e,t){var n=Je(e.doc,t),i=Qt(n);return i!=n&&(t=tt(i)),Ya(!0,e,i,t,1)}function $a(e,t){var n=Je(e.doc,t),i=$t(n);return i!=n&&(t=tt(i)),Ya(!0,e,n,t,-1)}function el(e,t){var n=Qa(e,t.line),i=Je(e.doc,n.line),r=de(i,e.doc.direction);if(!r||0==r[0].level){var o=Math.max(n.ch,i.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return ot(n.line,a?0:o,n.sticky)}return n}function tl(e,t,n){if("string"==typeof t&&!(t=Ja[t]))return!1;e.display.input.ensurePolled();var i=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),r=t(e)!=H}finally{e.display.shift=i,e.state.suppressEdits=!1}return r}function nl(e,t,n){for(var i=0;i<e.state.keyMaps.length;i++){var r=za(t,e.state.keyMaps[i],n,e);if(r)return r}return e.options.extraKeys&&za(t,e.options.extraKeys,n,e)||za(t,e.options.keyMap,n,e)}var il=new F;function rl(e,t,n,i){var r=e.state.keySeq;if(r){if(Ha(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:il.set(50,(function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())})),ol(e,r+" "+t,n,i))return!0}return ol(e,t,n,i)}function ol(e,t,n,i){var r=nl(e,t,i);return"multi"==r&&(e.state.keySeq=t),"handled"==r&&An(e,"keyHandled",e,t,n),"handled"!=r&&"multi"!=r||(Ce(n),Ki(e)),!!r}function al(e,t){var n=Ga(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?rl(e,"Shift-"+n,t,(function(t){return tl(e,t,!0)}))||rl(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return tl(e,t)})):rl(e,n,t,(function(t){return tl(e,t)})))}function ll(e,t,n){return rl(e,"'"+n+"'",t,(function(t){return tl(e,t,!0)}))}var sl=null;function cl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=N(),ye(t,e)))){a&&l<11&&27==e.keyCode&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=16==i||e.shiftKey;var r=al(t,e);h&&(sl=r?i:null,r||88!=i||Oe||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!y&&!r&&46==i&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=i||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||ul(t)}}function ul(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(M(t,"CodeMirror-crosshair"),ve(document,"keyup",n),ve(document,"mouseover",n))}B(t,"CodeMirror-crosshair"),fe(document,"keyup",n),fe(document,"mouseover",n)}function hl(e){16==e.keyCode&&(this.doc.sel.shift=!1),ye(this,e)}function dl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||Gn(t.display,e)||ye(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,i=e.charCode;if(h&&n==sl)return sl=null,void Ce(e);if(!h||e.which&&!(e.which<10)||!al(t,e)){var r=String.fromCharCode(null==i?n:i);"\b"!=r&&(ll(t,e,r)||t.display.input.onKeyPress(e))}}}var pl,fl,ml=400,vl=function(e,t,n){this.time=e,this.pos=t,this.button=n};function gl(e,t){var n=+new Date;return fl&&fl.compare(n,e,t)?(pl=fl=null,"triple"):pl&&pl.compare(n,e,t)?(fl=new vl(n,e,t),pl=null,"double"):(pl=new vl(n,e,t),fl=null,"single")}function yl(e){var t=this,n=t.display;if(!(ye(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,Gn(n,e))s||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!Tl(t,e)){var i=Ii(t,e),r=Te(e),o=i?gl(i,r):"single";window.focus(),1==r&&t.state.selectingText&&t.state.selectingText(e),i&&bl(t,r,i,o,e)||(1==r?i?wl(t,i,o,e):Me(e)==n.scroller&&Ce(e):2==r?(i&&Oo(t.doc,i),setTimeout((function(){return n.input.focus()}),20)):3==r&&(k?t.display.input.onContextMenu(e):Xi(t)))}}function bl(e,t,n,i,r){var o="Click";return"double"==i?o="Double"+o:"triple"==i&&(o="Triple"+o),rl(e,Wa(o=(1==t?"Left":2==t?"Middle":"Right")+o,r),r,(function(t){if("string"==typeof t&&(t=Ja[t]),!t)return!1;var i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i=t(e,n)!=H}finally{e.state.suppressEdits=!1}return i}))}function xl(e,t,n){var i=e.getOption("configureMouse"),r=i?i(e,t,n):{};if(null==r.unit){var o=b?n.shiftKey&&n.metaKey:n.altKey;r.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==r.extend||e.doc.extend)&&(r.extend=e.doc.extend||n.shiftKey),null==r.addNew&&(r.addNew=y?n.metaKey:n.ctrlKey),null==r.moveOnDrag&&(r.moveOnDrag=!(y?n.altKey:n.ctrlKey)),r}function wl(e,t,n,i){a?setTimeout(O(Yi,e),0):e.curOp.focus=N();var r,o=xl(e,n,i),l=e.doc.sel;e.options.dragDrop&&De&&!e.isReadOnly()&&"single"==n&&(r=l.contains(t))>-1&&(at((r=l.ranges[r]).from(),t)<0||t.xRel>0)&&(at(r.to(),t)>0||t.xRel<0)?Cl(e,i,t,o):Sl(e,i,t,o)}function Cl(e,t,n,i){var r=e.display,o=!1,c=Nr(e,(function(t){s&&(r.scroller.draggable=!1),e.state.draggingText=!1,ve(r.wrapper.ownerDocument,"mouseup",c),ve(r.wrapper.ownerDocument,"mousemove",u),ve(r.scroller,"dragstart",h),ve(r.scroller,"drop",c),o||(Ce(t),i.addNew||Oo(e.doc,n,null,null,i.extend),s&&!d||a&&9==l?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},h=function(){return o=!0};s&&(r.scroller.draggable=!0),e.state.draggingText=c,c.copy=!i.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),fe(r.wrapper.ownerDocument,"mouseup",c),fe(r.wrapper.ownerDocument,"mousemove",u),fe(r.scroller,"dragstart",h),fe(r.scroller,"drop",c),Xi(e),setTimeout((function(){return r.input.focus()}),20)}function kl(e,t,n){if("char"==n)return new oo(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new oo(ot(t.line,0),dt(e.doc,ot(t.line+1,0)));var i=n(e,t);return new oo(i.from,i.to)}function Sl(e,t,n,i){var r=e.display,o=e.doc;Ce(t);var a,l,s=o.sel,c=s.ranges;if(i.addNew&&!i.extend?(l=o.sel.contains(n),a=l>-1?c[l]:new oo(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),"rectangle"==i.unit)i.addNew||(a=new oo(n,n)),n=Ii(e,t,!0,!0),l=-1;else{var u=kl(e,n,i.unit);a=i.extend?Io(a,u.anchor,u.head,i.extend):u}i.addNew?-1==l?(l=c.length,Ho(o,ao(e,c.concat([a]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==i.unit&&!i.extend?(Ho(o,ao(e,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):jo(o,l,a,G):(l=0,Ho(o,new ro([a],0),G),s=o.sel);var h=n;function d(t){if(0!=at(h,t))if(h=t,"rectangle"==i.unit){for(var r=[],c=e.options.tabSize,u=j(Je(o,n.line).text,n.ch,c),d=j(Je(o,t.line).text,t.ch,c),p=Math.min(u,d),f=Math.max(u,d),m=Math.min(n.line,t.line),v=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=v;m++){var g=Je(o,m).text,y=U(g,p,c);p==f?r.push(new oo(ot(m,y),ot(m,y))):g.length>y&&r.push(new oo(ot(m,y),ot(m,U(g,f,c))))}r.length||r.push(new oo(n,n)),Ho(o,ao(e,s.ranges.slice(0,l).concat(r),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=a,w=kl(e,t,i.unit),C=x.anchor;at(w.anchor,C)>0?(b=w.head,C=ut(x.from(),w.anchor)):(b=w.anchor,C=ct(x.to(),w.head));var k=s.ranges.slice(0);k[l]=El(e,new oo(dt(o,C),b)),Ho(o,ao(e,k,l),G)}}var p=r.wrapper.getBoundingClientRect(),f=0;function m(t){var n=++f,a=Ii(e,t,!0,"rectangle"==i.unit);if(a)if(0!=at(a,h)){e.curOp.focus=N(),d(a);var l=tr(r,o);(a.line>=l.to||a.line<l.from)&&setTimeout(Nr(e,(function(){f==n&&m(t)})),150)}else{var s=t.clientY<p.top?-20:t.clientY>p.bottom?20:0;s&&setTimeout(Nr(e,(function(){f==n&&(r.scroller.scrollTop+=s,m(t))})),50)}}function v(t){e.state.selectingText=!1,f=1/0,t&&(Ce(t),r.input.focus()),ve(r.wrapper.ownerDocument,"mousemove",g),ve(r.wrapper.ownerDocument,"mouseup",y),o.history.lastSelOrigin=null}var g=Nr(e,(function(e){0!==e.buttons&&Te(e)?m(e):v(e)})),y=Nr(e,v);e.state.selectingText=y,fe(r.wrapper.ownerDocument,"mousemove",g),fe(r.wrapper.ownerDocument,"mouseup",y)}function El(e,t){var n=t.anchor,i=t.head,r=Je(e.doc,n.line);if(0==at(n,i)&&n.sticky==i.sticky)return t;var o=de(r);if(!o)return t;var a=ue(o,n.ch,n.sticky),l=o[a];if(l.from!=n.ch&&l.to!=n.ch)return t;var s,c=a+(l.from==n.ch==(1!=l.level)?0:1);if(0==c||c==o.length)return t;if(i.line!=n.line)s=(i.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=ue(o,i.ch,i.sticky),h=u-a||(i.ch-n.ch)*(1==l.level?-1:1);s=u==c-1||u==c?h<0:h>0}var d=o[c+(s?-1:0)],p=s==(1==d.level),f=p?d.from:d.to,m=p?"after":"before";return n.ch==f&&n.sticky==m?t:new oo(new ot(n.line,f,m),i)}function Ml(e,t,n,i){var r,o;if(t.touches)r=t.touches[0].clientX,o=t.touches[0].clientY;else try{r=t.clientX,o=t.clientY}catch(e){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&Ce(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!xe(e,n))return Se(t);o-=l.top-a.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=r)return ge(e,n,e,nt(e.doc,o),e.display.gutterSpecs[s].className,t),Se(t)}}function Tl(e,t){return Ml(e,t,"gutterClick",!0)}function Ll(e,t){Gn(e.display,t)||Al(e,t)||ye(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function Al(e,t){return!!xe(e,"gutterContextMenu")&&Ml(e,t,"gutterContextMenu",!1)}function Dl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),di(e)}vl.prototype.compare=function(e,t,n){return this.time+ml>e&&0==at(t,this.pos)&&n==this.button};var Pl={toString:function(){return"CodeMirror.Init"}},Nl={},Bl={};function _l(e){var t=e.optionHandlers;function n(n,i,r,o){e.defaults[n]=i,r&&(t[n]=o?function(e,t,n){n!=Pl&&r(e,t,n)}:r)}e.defineOption=n,e.Init=Pl,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,fo(e)}),!0),n("indentUnit",2,fo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){mo(e),di(e),Ri(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],i=e.doc.first;e.doc.iter((function(e){for(var r=0;;){var o=e.text.indexOf(t,r);if(-1==o)break;r=o+t.length,n.push(ot(i,o))}i++}));for(var r=n.length-1;r>=0;r--)ra(e.doc,t,n[r],ot(n[r].line,n[r].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Pl&&e.refresh()})),n("specialCharPlaceholder",vn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",g?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Dl(e),Jr(e)}),!0),n("keyMap","default",(function(e,t,n){var i=Va(t),r=n!=Pl&&Va(n);r&&r.detach&&r.detach(e,i),i.attach&&i.attach(e,r||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ol,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Yr(t,e.options.lineNumbers),Jr(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Ni(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return yr(e)}),!0),n("scrollbarStyle","native",(function(e){wr(e),yr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Yr(e.options.gutters,t),Jr(e)}),!0),n("firstLineNumber",1,Jr,!0),n("lineNumberFormatter",(function(e){return e}),Jr,!0),n("showCursorWhenSelecting",!1,Wi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Qi(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Il),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Wi,!0),n("singleCursorHeightPerLine",!0,Wi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,mo,!0),n("addModeClass",!1,mo,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,mo,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Il(e,t,n){if(!t!=!(n&&n!=Pl)){var i=e.display.dragFunctions,r=t?fe:ve;r(e.display.scroller,"dragstart",i.start),r(e.display.scroller,"dragenter",i.enter),r(e.display.scroller,"dragover",i.over),r(e.display.scroller,"dragleave",i.leave),r(e.display.scroller,"drop",i.drop)}}function Ol(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(M(e.display.wrapper,"CodeMirror-wrap"),sn(e)),_i(e),Ri(e),di(e),setTimeout((function(){return yr(e)}),100)}function Rl(e,t){var n=this;if(!(this instanceof Rl))return new Rl(e,t);this.options=t=t?R(t):{},R(Nl,t,!1);var i=t.value;"string"==typeof i?i=new ka(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var r=new Rl.inputStyles[t.inputStyle](this),o=this.display=new Qr(e,i,r,t);for(var c in o.wrapper.CodeMirror=this,Dl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),wr(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 F,keySeq:null,specialChars:null},t.autofocus&&!g&&o.input.focus(),a&&l<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),jl(this),Pa(),kr(this),this.curOp.forceUpdate=!0,bo(this,i),t.autofocus&&!g||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Ji(n)}),20):Qi(this),Bl)Bl.hasOwnProperty(c)&&Bl[c](this,t[c],Pl);Kr(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Fl.length;++u)Fl[u](this);Sr(this),s&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function jl(e){var t=e.display;fe(t.scroller,"mousedown",Nr(e,yl)),fe(t.scroller,"dblclick",a&&l<11?Nr(e,(function(t){if(!ye(e,t)){var n=Ii(e,t);if(n&&!Tl(e,t)&&!Gn(e.display,t)){Ce(t);var i=e.findWordAt(n);Oo(e.doc,i.anchor,i.head)}}})):function(t){return ye(e,t)||Ce(t)}),fe(t.scroller,"contextmenu",(function(t){return Ll(e,t)})),fe(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||Ll(e,n)}));var n,i={end:0};function r(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(i=t.activeTouch).end=+new Date)}function o(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function s(e,t){if(null==t.left)return!0;var n=t.left-e.left,i=t.top-e.top;return n*n+i*i>400}fe(t.scroller,"touchstart",(function(r){if(!ye(e,r)&&!o(r)&&!Tl(e,r)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-i.end<=300?i:null},1==r.touches.length&&(t.activeTouch.left=r.touches[0].pageX,t.activeTouch.top=r.touches[0].pageY)}})),fe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),fe(t.scroller,"touchend",(function(n){var i=t.activeTouch;if(i&&!Gn(t,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!i.prev||s(i,i.prev)?new oo(a,a):!i.prev.prev||s(i,i.prev.prev)?e.findWordAt(a):new oo(ot(a.line,0),dt(e.doc,ot(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),Ce(n)}r()})),fe(t.scroller,"touchcancel",r),fe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(dr(e,t.scroller.scrollTop),fr(e,t.scroller.scrollLeft,!0),ge(e,"scroll",e))})),fe(t.scroller,"mousewheel",(function(t){return io(e,t)})),fe(t.scroller,"DOMMouseScroll",(function(t){return io(e,t)})),fe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ye(e,t)||Ee(t)},over:function(t){ye(e,t)||(Ta(e,t),Ee(t))},start:function(t){return Ma(e,t)},drop:Nr(e,Ea),leave:function(t){ye(e,t)||La(e)}};var c=t.input.getField();fe(c,"keyup",(function(t){return hl.call(e,t)})),fe(c,"keydown",Nr(e,cl)),fe(c,"keypress",Nr(e,dl)),fe(c,"focus",(function(t){return Ji(e,t)})),fe(c,"blur",(function(t){return Qi(e,t)}))}Rl.defaults=Nl,Rl.optionHandlers=Bl;var Fl=[];function Zl(e,t,n,i){var r,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?r=bt(e,t).state:n="prev");var a=e.options.tabSize,l=Je(o,t),s=j(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,u=l.text.match(/^\s*/)[0];if(i||/\S/.test(l.text)){if("smart"==n&&((c=o.mode.indent(r,l.text.slice(u.length),l.text))==H||c>150)){if(!i)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?j(Je(o,t-1).text,null,a):0:"add"==n?c=s+e.options.indentUnit:"subtract"==n?c=s-e.options.indentUnit:"number"==typeof n&&(c=s+n),c=Math.max(0,c);var h="",d=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)d+=a,h+="\t";if(d<c&&(h+=K(c-d)),h!=u)return ra(o,h,ot(t,0),ot(t,u.length),"+input"),l.stateAfter=null,!0;for(var f=0;f<o.sel.ranges.length;f++){var m=o.sel.ranges[f];if(m.head.line==t&&m.head.ch<u.length){var v=ot(t,u.length);jo(o,f,new oo(v,v));break}}}Rl.defineInitHook=function(e){return Fl.push(e)};var zl=null;function Hl(e){zl=e}function Wl(e,t,n,i,r){var o=e.doc;e.display.shift=!1,i||(i=o.sel);var a=+new Date-200,l="paste"==r||e.state.pasteIncoming>a,s=_e(t),c=null;if(l&&i.ranges.length>1)if(zl&&zl.text.join("\n")==t){if(i.ranges.length%zl.text.length==0){c=[];for(var u=0;u<zl.text.length;u++)c.push(o.splitLines(zl.text[u]))}}else s.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(c=X(s,(function(e){return[e]})));for(var h=e.curOp.updateInput,d=i.ranges.length-1;d>=0;d--){var p=i.ranges[d],f=p.from(),m=p.to();p.empty()&&(n&&n>0?f=ot(f.line,f.ch-n):e.state.overwrite&&!l?m=ot(m.line,Math.min(Je(o,m.line).text.length,m.ch+Y(s).length)):l&&zl&&zl.lineWise&&zl.text.join("\n")==s.join("\n")&&(f=m=ot(f.line,0)));var v={from:f,to:m,text:c?c[d%c.length]:s,origin:r||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};Qo(e.doc,v),An(e,"inputRead",e,v)}t&&!l&&Vl(e,t),lr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Gl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Pr(t,(function(){return Wl(t,n,0,null,"paste")})),!0}function Vl(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=e.getModeAt(r.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Zl(e,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Je(e.doc,r.head.line).text.slice(0,r.head.ch))&&(a=Zl(e,r.head.line,"smart"));a&&An(e,"electricInput",e,r.head.line)}}}function Ul(e){for(var t=[],n=[],i=0;i<e.doc.sel.ranges.length;i++){var r=e.doc.sel.ranges[i].head.line,o={anchor:ot(r,0),head:ot(r+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function ql(e,t,n,i){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function Kl(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return s?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),ql(e),t}function Yl(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var i=this.options,r=i[e];i[e]==n&&"mode"!=e||(i[e]=n,t.hasOwnProperty(e)&&Nr(this,t[e])(this,n,r),ge(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Va(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Br((function(t,n){var i=t.token?t:e.getMode(this.options,t);if(i.startState)throw new Error("Overlays may not be stateful.");J(this.state.overlays,{mode:i,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,Ri(this)})),removeOverlay:Br((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var i=t[n].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return t.splice(n,1),this.state.modeGen++,void Ri(this)}})),indentLine:Br((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),it(this.doc,e)&&Zl(this,e,t,n)})),indentSelection:Br((function(e){for(var t=this.doc.sel.ranges,n=-1,i=0;i<t.length;i++){var r=t[i];if(r.empty())r.head.line>n&&(Zl(this,r.head.line,e,!0),n=r.head.line,i==this.doc.sel.primIndex&&lr(this));else{var o=r.from(),a=r.to(),l=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var s=l;s<n;++s)Zl(this,s,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[i].from().ch>0&&jo(this.doc,i,new oo(o,c[i].to()),W)}}})),getTokenAt:function(e,t){return St(this,e,t)},getLineTokens:function(e,t){return St(this,ot(e),t,!0)},getTokenTypeAt:function(e){e=dt(this.doc,e);var t,n=yt(this,Je(this.doc,e.line)),i=0,r=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=i+r>>1;if((a?n[2*a-1]:0)>=o)r=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}i=a+1}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var i=[];if(!n.hasOwnProperty(t))return i;var r=n[t],o=this.getModeAt(e);if("string"==typeof o[t])r[o[t]]&&i.push(r[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var l=r[o[t][a]];l&&i.push(l)}else o.helperType&&r[o.helperType]?i.push(r[o.helperType]):r[o.name]&&i.push(r[o.name]);for(var s=0;s<r._global.length;s++){var c=r._global[s];c.pred(o,this)&&-1==Z(i,c.val)&&i.push(c.val)}return i},getStateAfter:function(e,t){var n=this.doc;return bt(this,(e=ht(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return bi(this,null==e?n.head:"object"==typeof e?dt(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return yi(this,dt(this.doc,e),t||"page")},coordsChar:function(e,t){return Ci(this,(e=gi(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=gi(this,{top:e,left:0},t||"page").top,nt(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var i,r=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,r=!0),i=Je(this.doc,e)}else i=e;return vi(this,i,{top:0,left:0},t||"page",n||r).top+(r?this.doc.height-an(i):0)},defaultTextHeight:function(){return Ai(this.display)},defaultCharWidth:function(){return Di(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,i,r){var o=this.display,a=(e=bi(this,dt(this.doc,e))).bottom,l=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==i)a=e.top;else if("above"==i||"near"==i){var s=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==i||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(a=e.bottom),l+t.offsetWidth>c&&(l=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==r?(l=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==r?l=0:"middle"==r&&(l=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),n&&rr(this,{left:l,top:a,right:l+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Br(cl),triggerOnKeyPress:Br(dl),triggerOnKeyUp:hl,triggerOnMouseDown:Br(yl),execCommand:function(e){if(Ja.hasOwnProperty(e))return Ja[e].call(null,this)},triggerElectric:Br((function(e){Vl(this,e)})),findPosH:function(e,t,n,i){var r=1;t<0&&(r=-1,t=-t);for(var o=dt(this.doc,e),a=0;a<t&&!(o=Xl(this.doc,o,r,n,i)).hitSide;++a);return o},moveH:Br((function(e,t){var n=this;this.extendSelectionsBy((function(i){return n.display.shift||n.doc.extend||i.empty()?Xl(n.doc,i.head,e,t,n.options.rtlMoveVisually):e<0?i.from():i.to()}),V)})),deleteH:Br((function(e,t){var n=this.doc.sel,i=this.doc;n.somethingSelected()?i.replaceSelection("",null,"+delete"):Ua(this,(function(n){var r=Xl(i,n.head,e,t,!1);return e<0?{from:r,to:n.head}:{from:n.head,to:r}}))})),findPosV:function(e,t,n,i){var r=1,o=i;t<0&&(r=-1,t=-t);for(var a=dt(this.doc,e),l=0;l<t;++l){var s=bi(this,a,"div");if(null==o?o=s.left:s.left=o,(a=Jl(this,s,r,n)).hitSide)break}return a},moveV:Br((function(e,t){var n=this,i=this.doc,r=[],o=!this.display.shift&&!i.extend&&i.sel.somethingSelected();if(i.extendSelectionsBy((function(a){if(o)return e<0?a.from():a.to();var l=bi(n,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),r.push(l.left);var s=Jl(n,l,e,t);return"page"==t&&a==i.sel.primary()&&ar(n,yi(n,s,"div").top-l.top),s}),V),r.length)for(var a=0;a<i.sel.ranges.length;a++)i.sel.ranges[a].goalColumn=r[a]})),findWordAt:function(e){var t=Je(this.doc,e.line).text,n=e.ch,i=e.ch;if(t){var r=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=t.length||!n?++i:--n;for(var o=t.charAt(n),a=ne(o,r)?function(e){return ne(e,r)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ne(e)};n>0&&a(t.charAt(n-1));)--n;for(;i<t.length&&a(t.charAt(i));)++i}return new oo(ot(e.line,n),ot(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):M(this.display.cursorDiv,"CodeMirror-overwrite"),ge(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Br((function(e,t){sr(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Kn(this)-this.display.barHeight,width:e.scrollWidth-Kn(this)-this.display.barWidth,clientHeight:Xn(this),clientWidth:Yn(this)}},scrollIntoView:Br((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ot(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?cr(this,e):hr(this,e.from,e.to,e.margin)})),setSize:Br((function(e,t){var n=this,i=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=i(e)),null!=t&&(this.display.wrapper.style.height=i(t)),this.options.lineWrapping&&hi(this);var r=this.display.viewFrom;this.doc.iter(r,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){ji(n,r,"widget");break}++r})),this.curOp.forceUpdate=!0,ge(this,"refresh",this)})),operation:function(e){return Pr(this,e)},startOperation:function(){return kr(this)},endOperation:function(){return Sr(this)},refresh:Br((function(){var e=this.display.cachedTextHeight;Ri(this),this.curOp.forceUpdate=!0,di(this),sr(this,this.doc.scrollLeft,this.doc.scrollTop),Vr(this.display),(null==e||Math.abs(e-Ai(this.display))>.5||this.options.lineWrapping)&&_i(this),ge(this,"refresh",this)})),swapDoc:Br((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),bo(this,e),di(this),this.display.input.reset(),sr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,An(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},we(e),e.registerHelper=function(t,i,r){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][i]=r},e.registerGlobalHelper=function(t,i,r,o){e.registerHelper(t,i,o),n[t]._global.push({pred:r,val:o})}}function Xl(e,t,n,i,r){var o=t,a=n,l=Je(e,t.line),s=r&&"rtl"==e.direction?-n:n;function c(){var n=t.line+s;return!(n<e.first||n>=e.first+e.size)&&(t=new ot(n,t.ch,t.sticky),l=Je(e,n))}function u(o){var a;if("codepoint"==i){var u=l.text.charCodeAt(t.ch+(i>0?0:-1));a=isNaN(u)?null:new ot(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(u>=55296&&u<56320?2:1))),-n)}else a=r?Xa(e.cm,l,t,n):Ka(l,t,n);if(null==a){if(o||!c())return!1;t=Ya(r,e.cm,l,t.line,s)}else t=a;return!0}if("char"==i||"codepoint"==i)u();else if("column"==i)u(!0);else if("word"==i||"group"==i)for(var h=null,d="group"==i,p=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(n<0)||u(!f);f=!1){var m=l.text.charAt(t.ch)||"\n",v=ne(m,p)?"w":d&&"\n"==m?"n":!d||/\s/.test(m)?null:"p";if(!d||f||v||(v="s"),h&&h!=v){n<0&&(n=1,u(),t.sticky="after");break}if(v&&(h=v),n>0&&!u(!f))break}var g=Ko(e,t,o,a,!0);return lt(o,g)&&(g.hitSide=!0),g}function Jl(e,t,n,i){var r,o,a=e.doc,l=t.left;if("page"==i){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(s-.5*Ai(e.display),3);r=(n>0?t.bottom:t.top)+n*c}else"line"==i&&(r=n>0?t.bottom+3:t.top-3);for(;(o=Ci(e,l,r)).outside;){if(n<0?r<=0:r>=a.height){o.hitSide=!0;break}r+=5*n}return o}var Ql=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new F,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function $l(e,t){var n=ti(e,t.line);if(!n||n.hidden)return null;var i=Je(e.doc,t.line),r=Qn(n,i,t.line),o=de(i,e.doc.direction),a="left";o&&(a=ue(o,t.ch)%2?"right":"left");var l=ai(r.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function es(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ts(e,t){return t&&(e.bad=!0),e}function ns(e,t,n,i,r){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function c(e){return function(t){return t.id==e}}function u(){a&&(o+=l,s&&(o+=l),a=s=!1)}function h(e){e&&(u(),o+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void h(n);var o,p=t.getAttribute("cm-marker");if(p){var f=e.findMarks(ot(i,0),ot(r+1,0),c(+p));return void(f.length&&(o=f[0].find(0))&&h(Qe(e.doc,o.from,o.to).join(l)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&u();for(var v=0;v<t.childNodes.length;v++)d(t.childNodes[v]);/^(pre|p)$/i.test(t.nodeName)&&(s=!0),m&&(a=!0)}else 3==t.nodeType&&h(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;d(t),t!=n;)t=t.nextSibling,s=!1;return o}function is(e,t,n){var i;if(t==e.display.lineDiv){if(!(i=e.display.lineDiv.childNodes[n]))return ts(e.clipPos(ot(e.display.viewTo-1)),!0);t=null,n=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var r=0;r<e.display.view.length;r++){var o=e.display.view[r];if(o.node==i)return rs(o,t,n)}}function rs(e,t,n){var i=e.text.firstChild,r=!1;if(!t||!P(i,t))return ts(ot(tt(e.line),0),!0);if(t==i&&(r=!0,t=i.childNodes[n],n=0,!t)){var o=e.rest?Y(e.rest):e.line;return ts(ot(tt(o),o.text.length),r)}var a=3==t.nodeType?t:null,l=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));l.parentNode!=i;)l=l.parentNode;var s=e.measure,c=s.maps;function u(t,n,i){for(var r=-1;r<(c?c.length:0);r++)for(var o=r<0?s.map:c[r],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==n){var u=tt(r<0?e.line:e.rest[r]),h=o[a]+i;return(i<0||l!=t)&&(h=o[a+(i?1:0)]),ot(u,h)}}}var h=u(a,l,n);if(h)return ts(h,r);for(var d=l.nextSibling,p=a?a.nodeValue.length-n:0;d;d=d.nextSibling){if(h=u(d,d.firstChild,0))return ts(ot(h.line,h.ch-p),r);p+=d.textContent.length}for(var f=l.previousSibling,m=n;f;f=f.previousSibling){if(h=u(f,f.firstChild,-1))return ts(ot(h.line,h.ch+m),r);m+=f.textContent.length}}Ql.prototype.init=function(e){var t=this,n=this,i=n.cm,r=n.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(o(e)&&!ye(i,e)){if(i.somethingSelected())Hl({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Ul(i);Hl({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation((function(){i.setSelections(t.ranges,0,W),i.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=zl.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var l=Kl(),s=l.firstChild;i.display.lineSpace.insertBefore(l,i.display.lineSpace.firstChild),s.value=zl.text.join("\n");var c=document.activeElement;I(s),setTimeout((function(){i.display.lineSpace.removeChild(l),c.focus(),c==r&&n.showPrimarySelection()}),50)}}ql(r,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize),fe(r,"paste",(function(e){!o(e)||ye(i,e)||Gl(e,i)||l<=11&&setTimeout(Nr(i,(function(){return t.updateFromDOM()})),20)})),fe(r,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),fe(r,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),fe(r,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),fe(r,"touchstart",(function(){return n.forceCompositionEnd()})),fe(r,"input",(function(){t.composing||t.readFromDOMSoon()})),fe(r,"copy",a),fe(r,"cut",a)},Ql.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ql.prototype.prepareSelection=function(){var e=Gi(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ql.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ql.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ql.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),o=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=is(t,e.anchorNode,e.anchorOffset),l=is(t,e.focusNode,e.focusOffset);if(!a||a.bad||!l||l.bad||0!=at(ut(a,l),r)||0!=at(ct(a,l),o)){var s=t.display.view,c=r.line>=t.display.viewFrom&&$l(t,r)||{node:s[0].measure.map[2],offset:0},u=o.line<t.display.viewTo&&$l(t,o);if(!u){var h=s[s.length-1].measure,d=h.maps?h.maps[h.maps.length-1]:h.map;u={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(c&&u){var p,f=e.rangeCount&&e.getRangeAt(0);try{p=E(c.node,c.offset,u.offset,u.node)}catch(e){}p&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),p.collapsed||(e.removeAllRanges(),e.addRange(p))):(e.removeAllRanges(),e.addRange(p)),f&&null==e.anchorNode?e.addRange(f):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Ql.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Ql.prototype.showMultipleSelections=function(e){L(this.cm.display.cursorDiv,e.cursors),L(this.cm.display.selectionDiv,e.selection)},Ql.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ql.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return P(this.div,t)},Ql.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ql.prototype.blur=function(){this.div.blur()},Ql.prototype.getField=function(){return this.div},Ql.prototype.supportsTouch=function(){return!0},Ql.prototype.receivedFocus=function(){var e=this;function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.selectionInEditor()?this.pollSelection():Pr(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,t)},Ql.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ql.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(v&&u&&this.cm.display.gutterSpecs.length&&es(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=is(t,e.anchorNode,e.anchorOffset),i=is(t,e.focusNode,e.focusOffset);n&&i&&Pr(t,(function(){Ho(t.doc,lo(n,i),W),(n.bad||i.bad)&&(t.curOp.selectionChanged=!0)}))}}},Ql.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,i=this.cm,r=i.display,o=i.doc.sel.primary(),a=o.from(),l=o.to();if(0==a.ch&&a.line>i.firstLine()&&(a=ot(a.line-1,Je(i.doc,a.line-1).length)),l.ch==Je(i.doc,l.line).text.length&&l.line<i.lastLine()&&(l=ot(l.line+1,0)),a.line<r.viewFrom||l.line>r.viewTo-1)return!1;a.line==r.viewFrom||0==(e=Oi(i,a.line))?(t=tt(r.view[0].line),n=r.view[0].node):(t=tt(r.view[e].line),n=r.view[e-1].node.nextSibling);var s,c,u=Oi(i,l.line);if(u==r.view.length-1?(s=r.viewTo-1,c=r.lineDiv.lastChild):(s=tt(r.view[u+1].line)-1,c=r.view[u+1].node.previousSibling),!n)return!1;for(var h=i.doc.splitLines(ns(i,n,c,t,s)),d=Qe(i.doc,ot(t,0),ot(s,Je(i.doc,s).text.length));h.length>1&&d.length>1;)if(Y(h)==Y(d))h.pop(),d.pop(),s--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),t++}for(var p=0,f=0,m=h[0],v=d[0],g=Math.min(m.length,v.length);p<g&&m.charCodeAt(p)==v.charCodeAt(p);)++p;for(var y=Y(h),b=Y(d),x=Math.min(y.length-(1==h.length?p:0),b.length-(1==d.length?p:0));f<x&&y.charCodeAt(y.length-f-1)==b.charCodeAt(b.length-f-1);)++f;if(1==h.length&&1==d.length&&t==a.line)for(;p&&p>a.ch&&y.charCodeAt(y.length-f-1)==b.charCodeAt(b.length-f-1);)p--,f++;h[h.length-1]=y.slice(0,y.length-f).replace(/^\u200b+/,""),h[0]=h[0].slice(p).replace(/\u200b+$/,"");var w=ot(t,p),C=ot(s,d.length?Y(d).length-f:0);return h.length>1||h[0]||at(w,C)?(ra(i.doc,h,w,C,"+input"),!0):void 0},Ql.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ql.prototype.reset=function(){this.forceCompositionEnd()},Ql.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ql.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Ql.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Pr(this.cm,(function(){return Ri(e.cm)}))},Ql.prototype.setUneditable=function(e){e.contentEditable="false"},Ql.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Nr(this.cm,Wl)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ql.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ql.prototype.onContextMenu=function(){},Ql.prototype.resetPosition=function(){},Ql.prototype.needsContentAttribute=!0;var os=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new F,this.hasSelection=!1,this.composing=null};function as(e,t){if((t=t?R(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=N();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function i(){e.value=l.getValue()}var r;if(e.form&&(fe(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var o=e.form;r=o.submit;try{var a=o.submit=function(){i(),o.submit=r,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=i,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,i(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(ve(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=r))}},e.style.display="none";var l=Rl((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return l}function ls(e){e.off=ve,e.on=fe,e.wheelEventPixels=no,e.Doc=ka,e.splitLines=_e,e.countColumn=j,e.findColumn=U,e.isWordChar=te,e.Pass=H,e.signal=ge,e.Line=cn,e.changeEnd=so,e.scrollbarModel=xr,e.Pos=ot,e.cmpPos=at,e.modes=Fe,e.mimeModes=Ze,e.resolveMode=We,e.getMode=Ge,e.modeExtensions=Ve,e.extendMode=Ue,e.copyState=qe,e.startState=Ye,e.innerMode=Ke,e.commands=Ja,e.keyMap=ja,e.keyName=Ga,e.isModifierKey=Ha,e.lookupKey=za,e.normalizeKeyMap=Za,e.StringStream=Xe,e.SharedTextMarker=ga,e.TextMarker=ma,e.LineWidget=ha,e.e_preventDefault=Ce,e.e_stopPropagation=ke,e.e_stop=Ee,e.addClass=B,e.contains=P,e.rmClass=M,e.keyNames=_a}os.prototype.init=function(e){var t=this,n=this,i=this.cm;this.createField(e);var r=this.textarea;function o(e){if(!ye(i,e)){if(i.somethingSelected())Hl({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Ul(i);Hl({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,W):(n.prevInput="",r.value=t.text.join("\n"),I(r))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(r.style.width="0px"),fe(r,"input",(function(){a&&l>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),fe(r,"paste",(function(e){ye(i,e)||Gl(e,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),fe(r,"cut",o),fe(r,"copy",o),fe(e.scroller,"paste",(function(t){if(!Gn(e,t)&&!ye(i,t)){if(!r.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,r.dispatchEvent(o)}})),fe(e.lineSpace,"selectstart",(function(t){Gn(e,t)||Ce(t)})),fe(r,"compositionstart",(function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}})),fe(r,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},os.prototype.createField=function(e){this.wrapper=Kl(),this.textarea=this.wrapper.firstChild},os.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},os.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,i=Gi(e);if(e.options.moveInputWithCursor){var r=bi(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+a.top-o.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+a.left-o.left))}return i},os.prototype.showSelection=function(e){var t=this.cm.display;L(t.cursorDiv,e.cursors),L(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},os.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&I(this.textarea),a&&l>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&l>=9&&(this.hasSelection=null))}},os.prototype.getField=function(){return this.textarea},os.prototype.supportsTouch=function(){return!1},os.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!g||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},os.prototype.blur=function(){this.textarea.blur()},os.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},os.prototype.receivedFocus=function(){this.slowPoll()},os.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},os.prototype.fastPoll=function(){var e=!1,t=this;function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,t.polling.set(20,n)},os.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ie(n)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=n.value;if(r==i&&!t.somethingSelected())return!1;if(a&&l>=9&&this.hasSelection===r||y&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var s=0,c=Math.min(i.length,r.length);s<c&&i.charCodeAt(s)==r.charCodeAt(s);)++s;return Pr(t,(function(){Wl(t,r.slice(s),i.length-s,null,e.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},os.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},os.prototype.onKeyPress=function(){a&&l>=9&&(this.hasSelection=null),this.fastPoll()},os.prototype.onContextMenu=function(e){var t=this,n=t.cm,i=n.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Ii(n,e),c=i.scroller.scrollTop;if(o&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Nr(n,Ho)(n.doc,lo(o),W);var u,d=r.style.cssText,p=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",s&&(u=window.scrollY),i.input.focus(),s&&window.scrollTo(null,u),i.input.reset(),n.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=g,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),a&&l>=9&&v(),k){Ee(e);var m=function(){ve(window,"mouseup",m),setTimeout(g,20)};fe(window,"mouseup",m)}else setTimeout(g,50)}function v(){if(null!=r.selectionStart){var e=n.somethingSelected(),o=""+(e?r.value:"");r.value="⇚",r.value=o,t.prevInput=e?"":"",r.selectionStart=1,r.selectionEnd=o.length,i.selForContextMenu=n.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,r.style.cssText=d,a&&l<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=c),null!=r.selectionStart)){(!a||a&&l<9)&&v();var e=0,o=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&""==t.prevInput?Nr(n,Xo)(n):e++<10?i.detectingSelectAll=setTimeout(o,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(o,200)}}},os.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},os.prototype.setUneditable=function(){},os.prototype.needsContentAttribute=!1,_l(Rl),Yl(Rl);var ss="iter insert remove copy getEditor constructor".split(" ");for(var cs in ka.prototype)ka.prototype.hasOwnProperty(cs)&&Z(ss,cs)<0&&(Rl.prototype[cs]=function(e){return function(){return e.apply(this.doc,arguments)}}(ka.prototype[cs]));return we(ka),Rl.inputStyles={textarea:os,contenteditable:Ql},Rl.defineMode=function(e){Rl.defaults.mode||"null"==e||(Rl.defaults.mode=e),ze.apply(this,arguments)},Rl.defineMIME=He,Rl.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Rl.defineMIME("text/plain","null"),Rl.defineExtension=function(e,t){Rl.prototype[e]=t},Rl.defineDocExtension=function(e,t){ka.prototype[e]=t},Rl.fromTextArea=as,ls(Rl),Rl.version="5.58.2",Rl}()},25419:function(e,t,n){!function(e){"use strict";e.defineMode("markdown",(function(t,n){var i=e.getMode(t,"text/html"),r="null"==i.name;function o(n){if(e.findModeByName){var i=e.findModeByName(n);i&&(n=i.mime||i.mimes[0])}var r=e.getMode(t,n);return"null"==r.name?null:r}void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.emoji&&(n.emoji=!1),void 0===n.fencedCodeBlockHighlighting&&(n.fencedCodeBlockHighlighting=!0),void 0===n.fencedCodeBlockDefaultMode&&(n.fencedCodeBlockDefaultMode="text/plain"),void 0===n.xml&&(n.xml=!0),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var a={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 l in a)a.hasOwnProperty(l)&&n.tokenTypeOverrides[l]&&(a[l]=n.tokenTypeOverrides[l]);var s=/^([*\-_])(?:\s*\1){2,}\s*$/,c=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,u=/^\[(x| )\](?=\s)/i,h=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ {0,3}(?:\={1,}|-{2,})\s*$/,p=/^[^#!\[\]*_\\<>` "'(~:]+/,f=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,m=/^\s*\[[^\]]+?\]:.*$/,v=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,g=" ";function y(e,t,n){return t.f=t.inline=n,n(e,t)}function b(e,t,n){return t.f=t.block=n,n(e,t)}function x(e){return!e||!/\S/.test(e.string)}function w(t){if(t.linkTitle=!1,t.linkHref=!1,t.linkText=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==k){var n=r;if(!n){var o=e.innerMode(i,t.htmlState);n="xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText}n&&(t.f=T,t.block=C,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function C(t,i){var r=t.column()===i.indentation,l=x(i.prevLine.stream),p=i.indentedCode,v=i.prevLine.hr,g=!1!==i.list,b=(i.listStack[i.listStack.length-1]||0)+3;i.indentedCode=!1;var w=i.indentation;if(null===i.indentationDiff&&(i.indentationDiff=i.indentation,g)){for(i.list=null;w<i.listStack[i.listStack.length-1];)i.listStack.pop(),i.listStack.length?i.indentation=i.listStack[i.listStack.length-1]:i.list=!1;!1!==i.list&&(i.indentationDiff=w-i.listStack[i.listStack.length-1])}var C=!(l||v||i.prevLine.header||g&&p||i.prevLine.fencedCodeEnd),k=(!1===i.list||v||l)&&i.indentation<=b&&t.match(s),M=null;if(i.indentationDiff>=4&&(p||i.prevLine.fencedCodeEnd||i.prevLine.header||l))return t.skipToEnd(),i.indentedCode=!0,a.code;if(t.eatSpace())return null;if(r&&i.indentation<=b&&(M=t.match(h))&&M[1].length<=6)return i.quote=0,i.header=M[1].length,i.thisLine.header=!0,n.highlightFormatting&&(i.formatting="header"),i.f=i.inline,E(i);if(i.indentation<=b&&t.eat(">"))return i.quote=r?1:i.quote+1,n.highlightFormatting&&(i.formatting="quote"),t.eatSpace(),E(i);if(!k&&!i.setext&&r&&i.indentation<=b&&(M=t.match(c))){var T=M[1]?"ol":"ul";return i.indentation=w+t.current().length,i.list=!0,i.quote=0,i.listStack.push(i.indentation),i.em=!1,i.strong=!1,i.code=!1,i.strikethrough=!1,n.taskLists&&t.match(u,!1)&&(i.taskList=!0),i.f=i.inline,n.highlightFormatting&&(i.formatting=["list","list-"+T]),E(i)}return r&&i.indentation<=b&&(M=t.match(f,!0))?(i.quote=0,i.fencedEndRE=new RegExp(M[1]+"+ *$"),i.localMode=n.fencedCodeBlockHighlighting&&o(M[2]||n.fencedCodeBlockDefaultMode),i.localMode&&(i.localState=e.startState(i.localMode)),i.f=i.block=S,n.highlightFormatting&&(i.formatting="code-block"),i.code=-1,E(i)):i.setext||!(C&&g||i.quote||!1!==i.list||i.code||k||m.test(t.string))&&(M=t.lookAhead(1))&&(M=M.match(d))?(i.setext?(i.header=i.setext,i.setext=0,t.skipToEnd(),n.highlightFormatting&&(i.formatting="header")):(i.header="="==M[0].charAt(0)?1:2,i.setext=i.header),i.thisLine.header=!0,i.f=i.inline,E(i)):k?(t.skipToEnd(),i.hr=!0,i.thisLine.hr=!0,a.hr):"["===t.peek()?y(t,i,N):y(t,i,i.inline)}function k(t,n){var o=i.token(t,n.htmlState);if(!r){var a=e.innerMode(i,n.htmlState);("xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)&&(n.f=T,n.block=C,n.htmlState=null)}return o}function S(e,t){var i,r=t.listStack[t.listStack.length-1]||0,o=t.indentation<r,l=r+3;return t.fencedEndRE&&t.indentation<=l&&(o||e.match(t.fencedEndRE))?(n.highlightFormatting&&(t.formatting="code-block"),o||(i=E(t)),t.localMode=t.localState=null,t.block=C,t.f=T,t.fencedEndRE=null,t.code=0,t.thisLine.fencedCodeEnd=!0,o?b(e,t,t.block):i):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),a.code)}function E(e){var t=[];if(e.formatting){t.push(a.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var i=0;i<e.formatting.length;i++)t.push(a.formatting+"-"+e.formatting[i]),"header"===e.formatting[i]&&t.push(a.formatting+"-"+e.formatting[i]+"-"+e.header),"quote"===e.formatting[i]&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(a.formatting+"-"+e.formatting[i]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(a.linkHref,"url"):(e.strong&&t.push(a.strong),e.em&&t.push(a.em),e.strikethrough&&t.push(a.strikethrough),e.emoji&&t.push(a.emoji),e.linkText&&t.push(a.linkText),e.code&&t.push(a.code),e.image&&t.push(a.image),e.imageAltText&&t.push(a.imageAltText,"link"),e.imageMarker&&t.push(a.imageMarker)),e.header&&t.push(a.header,a.header+"-"+e.header),e.quote&&(t.push(a.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(a.quote+"-"+e.quote):t.push(a.quote+"-"+n.maxBlockquoteDepth)),!1!==e.list){var r=(e.listStack.length-1)%3;r?1===r?t.push(a.list2):t.push(a.list3):t.push(a.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function M(e,t){if(e.match(p,!0))return E(t)}function T(t,r){var o=r.text(t,r);if(void 0!==o)return o;if(r.list)return r.list=null,E(r);if(r.taskList)return" "===t.match(u,!0)[1]?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,E(r);if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),E(r);var l=t.next();if(r.linkTitle){r.linkTitle=!1;var s=l;"("===l&&(s=")");var c="^\\s*(?:[^"+(s=(s+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+s;if(t.match(new RegExp(c),!0))return a.linkHref}if("`"===l){var h=r.formatting;n.highlightFormatting&&(r.formatting="code"),t.eatWhile("`");var d=t.current().length;if(0!=r.code||r.quote&&1!=d){if(d==r.code){var p=E(r);return r.code=0,p}return r.formatting=h,E(r)}return r.code=d,E(r)}if(r.code)return E(r);if("\\"===l&&(t.next(),n.highlightFormatting)){var f=E(r),m=a.formatting+"-escape";return f?f+" "+m:m}if("!"===l&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return r.imageMarker=!0,r.image=!0,n.highlightFormatting&&(r.formatting="image"),E(r);if("["===l&&r.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return r.imageMarker=!1,r.imageAltText=!0,n.highlightFormatting&&(r.formatting="image"),E(r);if("]"===l&&r.imageAltText){n.highlightFormatting&&(r.formatting="image");var f=E(r);return r.imageAltText=!1,r.image=!1,r.inline=r.f=A,f}if("["===l&&!r.image)return r.linkText&&t.match(/^.*?\]/)||(r.linkText=!0,n.highlightFormatting&&(r.formatting="link")),E(r);if("]"===l&&r.linkText){n.highlightFormatting&&(r.formatting="link");var f=E(r);return r.linkText=!1,r.inline=r.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?A:T,f}if("<"===l&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=L,n.highlightFormatting&&(r.formatting="link"),(f=E(r))?f+=" ":f="",f+a.linkInline;if("<"===l&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=L,n.highlightFormatting&&(r.formatting="link"),(f=E(r))?f+=" ":f="",f+a.linkEmail;if(n.xml&&"<"===l&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var g=t.string.indexOf(">",t.pos);if(-1!=g){var y=t.string.substring(t.start,g);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(y)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(i),b(t,r,k)}if(n.xml&&"<"===l&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";if("*"===l||"_"===l){for(var x=1,w=1==t.pos?" ":t.string.charAt(t.pos-2);x<3&&t.eat(l);)x++;var C=t.peek()||" ",S=!/\s/.test(C)&&(!v.test(C)||/\s/.test(w)||v.test(w)),M=!/\s/.test(w)&&(!v.test(w)||/\s/.test(C)||v.test(C)),D=null,P=null;if(x%2&&(r.em||!S||"*"!==l&&M&&!v.test(w)?r.em!=l||!M||"*"!==l&&S&&!v.test(C)||(D=!1):D=!0),x>1&&(r.strong||!S||"*"!==l&&M&&!v.test(w)?r.strong!=l||!M||"*"!==l&&S&&!v.test(C)||(P=!1):P=!0),null!=P||null!=D)return n.highlightFormatting&&(r.formatting=null==D?"strong":null==P?"em":"strong em"),!0===D&&(r.em=l),!0===P&&(r.strong=l),p=E(r),!1===D&&(r.em=!1),!1===P&&(r.strong=!1),p}else if(" "===l&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return E(r);t.backUp(1)}if(n.strikethrough)if("~"===l&&t.eatWhile(l)){if(r.strikethrough)return n.highlightFormatting&&(r.formatting="strikethrough"),p=E(r),r.strikethrough=!1,p;if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),E(r)}else if(" "===l&&t.match(/^~~/,!0)){if(" "===t.peek())return E(r);t.backUp(2)}if(n.emoji&&":"===l&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){r.emoji=!0,n.highlightFormatting&&(r.formatting="emoji");var N=E(r);return r.emoji=!1,N}return" "===l&&(t.match(/^ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),E(r)}function L(e,t){if(">"===e.next()){t.f=t.inline=T,n.highlightFormatting&&(t.formatting="link");var i=E(t);return i?i+=" ":i="",i+a.linkInline}return e.match(/^[^>]+/,!0),a.linkInline}function A(e,t){if(e.eatSpace())return null;var i=e.next();return"("===i||"["===i?(t.f=t.inline=P("("===i?")":"]"),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,E(t)):"error"}var D={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function P(e){return function(t,i){if(t.next()===e){i.f=i.inline=T,n.highlightFormatting&&(i.formatting="link-string");var r=E(i);return i.linkHref=!1,r}return t.match(D[e]),i.linkHref=!0,E(i)}}function N(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=B,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,E(t)):y(e,t,T)}function B(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=_,n.highlightFormatting&&(t.formatting="link");var i=E(t);return t.linkText=!1,i}return e.match(/^([^\]\\]|\\.)+/,!0),a.linkText}function _(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=T,a.linkHref+" url")}var I={startState:function(){return{f:C,prevLine:{stream:null},thisLine:{stream:null},block:C,htmlState:null,indentation:0,inline:T,text:M,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(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(i,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return w(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=k)){var n=e.match(/^\s*/,!0)[0].replace(/\t/g,g).length;if(t.indentation=n,t.indentationDiff=null,n>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==k?{state:e.htmlState,mode:i}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:I}},indent:function(t,n,r){return t.block==k&&i.indent?i.indent(t.htmlState,n,r):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},blankLine:w,getType:E,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return I}),"xml"),e.defineMIME("text/markdown","markdown"),e.defineMIME("text/x-markdown","markdown")}(n(89780),n(15525),n(98101))},98101:function(e,t,n){!function(e){"use strict";e.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 t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.mime==t)return i;if(i.mimes)for(var r=0;r<i.mimes.length;r++)if(i.mimes[r]==t)return i}return/\+xml$/.test(t)?e.findModeByMIME("application/xml"):/\+json$/.test(t)?e.findModeByMIME("application/json"):void 0},e.findModeByExtension=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.ext)for(var r=0;r<i.ext.length;r++)if(i.ext[r]==t)return i}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.file&&i.file.test(t))return i}var r=t.lastIndexOf("."),o=r>-1&&t.substring(r+1,t.length);if(o)return e.findModeByExtension(o)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.name.toLowerCase()==t)return i;if(i.alias)for(var r=0;r<i.alias.length;r++)if(i.alias[r].toLowerCase()==t)return i}}}(n(89780))},67549:function(e,t,n){!function(e){"use strict";e.defineMode("stex",(function(e,t){function n(e,t){e.cmdState.push(t)}function i(e){return e.cmdState.length>0?e.cmdState[e.cmdState.length-1]:null}function r(e){var t=e.cmdState.pop();t&&t.closeBracket()}function o(e){for(var t=e.cmdState,n=t.length-1;n>=0;n--){var i=t[n];if("DEFAULT"!=i.name)return i}return{styleIdentifier:function(){return null}}}function a(e,t,n){return function(){this.name=e,this.bracketNo=0,this.style=t,this.styles=n,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var l={};function s(e,t){e.f=t}function c(e,t){var r;if(e.match(/^\\[a-zA-Z@]+/)){var a=e.current().slice(1);return n(t,r=new(r=l.hasOwnProperty(a)?l[a]:l.DEFAULT)),s(t,h),r.style}if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/\\]/))return"tag";if(e.match("\\["))return s(t,(function(e,t){return u(e,t,"\\]")})),"keyword";if(e.match("\\("))return s(t,(function(e,t){return u(e,t,"\\)")})),"keyword";if(e.match("$$"))return s(t,(function(e,t){return u(e,t,"$$")})),"keyword";if(e.match("$"))return s(t,(function(e,t){return u(e,t,"$")})),"keyword";var c=e.next();return"%"==c?(e.skipToEnd(),"comment"):"}"==c||"]"==c?(r=i(t))?(r.closeBracket(c),s(t,h),"bracket"):"error":"{"==c||"["==c?(n(t,r=new(r=l.DEFAULT)),"bracket"):/\d/.test(c)?(e.eatWhile(/[\w.%]/),"atom"):(e.eatWhile(/[\w\-_]/),"begin"==(r=o(t)).name&&(r.argument=e.current()),r.styleIdentifier())}function u(e,t,n){if(e.eatSpace())return null;if(n&&e.match(n))return s(t,c),"keyword";if(e.match(/^\\[a-zA-Z@]+/))return"tag";if(e.match(/^[a-zA-Z]+/))return"variable-2";if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/]/))return"tag";if(e.match(/^[\^_&]/))return"tag";if(e.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(e.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=e.next();return"{"==i||"}"==i||"["==i||"]"==i||"("==i||")"==i?"bracket":"%"==i?(e.skipToEnd(),"comment"):"error"}function h(e,t){var n=e.peek();return"{"==n||"["==n?(i(t).openBracket(n),e.eat(n),s(t,c),"bracket"):/[ \t\r]/.test(n)?(e.eat(n),null):(s(t,c),r(t),c(e,t))}return l.importmodule=a("importmodule","tag",["string","builtin"]),l.documentclass=a("documentclass","tag",["","atom"]),l.usepackage=a("usepackage","tag",["atom"]),l.begin=a("begin","tag",["atom"]),l.end=a("end","tag",["atom"]),l.label=a("label","tag",["atom"]),l.ref=a("ref","tag",["atom"]),l.eqref=a("eqref","tag",["atom"]),l.cite=a("cite","tag",["atom"]),l.bibitem=a("bibitem","tag",["atom"]),l.Bibitem=a("Bibitem","tag",["atom"]),l.RBibitem=a("RBibitem","tag",["atom"]),l.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:t.inMathMode?function(e,t){return u(e,t)}:c}},copyState:function(e){return{cmdState:e.cmdState.slice(),f:e.f}},token:function(e,t){return t.f(e,t)},blankLine:function(e){e.f=c,e.cmdState.length=0},lineComment:"%"}})),e.defineMIME("text/x-stex","stex"),e.defineMIME("text/x-latex","stex")}(n(89780))},15525:function(e,t,n){!function(e){"use strict";var t={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},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(i,r){var o,a,l=i.indentUnit,s={},c=r.htmlMode?t:n;for(var u in c)s[u]=c[u];for(var u in r)s[u]=r[u];function h(e,t){function n(n){return t.tokenize=n,n(e,t)}var i=e.next();return"<"==i?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(f("atom","]]>")):null:e.match("--")?n(f("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(m(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=f("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=d,"tag bracket"):"&"==i?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function d(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=h,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){t.tokenize=h,t.state=b,t.tagName=t.tagStart=null;var i=t.tokenize(e,t);return i?i+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=p(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=d;break}return"string"};return t.isInAttribute=!0,t}function f(e,t){return function(n,i){for(;!n.eol();){if(n.match(t)){i.tokenize=h;break}n.next()}return e}}function m(e){return function(t,n){for(var i;null!=(i=t.next());){if("<"==i)return n.tokenize=m(e+1),n.tokenize(t,n);if(">"==i){if(1==e){n.tokenize=h;break}return n.tokenize=m(e-1),n.tokenize(t,n)}}return"meta"}}function v(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(s.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function g(e){e.context&&(e.context=e.context.prev)}function y(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!s.contextGrabbers.hasOwnProperty(n)||!s.contextGrabbers[n].hasOwnProperty(t))return;g(e)}}function b(e,t,n){return"openTag"==e?(n.tagStart=t.column(),x):"closeTag"==e?w:b}function x(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",S):s.allowMissingTagName&&"endTag"==e?(a="tag bracket",S(e,t,n)):(a="error",x)}function w(e,t,n){if("word"==e){var i=t.current();return n.context&&n.context.tagName!=i&&s.implicitlyClosed.hasOwnProperty(n.context.tagName)&&g(n),n.context&&n.context.tagName==i||!1===s.matchClosing?(a="tag",C):(a="tag error",k)}return s.allowMissingTagName&&"endTag"==e?(a="tag bracket",C(e,t,n)):(a="error",k)}function C(e,t,n){return"endTag"!=e?(a="error",C):(g(n),b)}function k(e,t,n){return a="error",C(e,t,n)}function S(e,t,n){if("word"==e)return a="attribute",E;if("endTag"==e||"selfcloseTag"==e){var i=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||s.autoSelfClosers.hasOwnProperty(i)?y(n,i):(y(n,i),n.context=new v(n,i,r==n.indented)),b}return a="error",S}function E(e,t,n){return"equals"==e?M:(s.allowMissing||(a="error"),S(e,t,n))}function M(e,t,n){return"string"==e?T:"word"==e&&s.allowUnquoted?(a="string",S):(a="error",S(e,t,n))}function T(e,t,n){return"string"==e?T:S(e,t,n)}return h.isInText=!0,{startState:function(e){var t={tokenize:h,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(t,n,i){var r=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+l;if(r&&r.noIndent)return e.Pass;if(t.tokenize!=d&&t.tokenize!=h)return i?i.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==s.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+l*(s.multilineTagIndentFactor||1);if(s.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var o=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(o&&o[1])for(;r;){if(r.tagName==o[2]){r=r.prev;break}if(!s.implicitlyClosed.hasOwnProperty(r.tagName))break;r=r.prev}else if(o)for(;r;){var a=s.contextGrabbers[r.tagName];if(!a||!a.hasOwnProperty(o[2]))break;r=r.prev}for(;r&&r.prev&&!r.startOfLine;)r=r.prev;return r?r.indent+l:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:s.htmlMode?"html":"xml",helperType:s.htmlMode?"html":"xml",skipAttribute:function(e){e.state==M&&(e.state=S)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)n.tagName&&t.push(n.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(89780))},2859:function(e,t,n){"use strict";n.d(t,{hP:function(){return Q}});var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function r(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function o(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((i=i.apply(e,t||[])).next())}))}function a(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}function l(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,l=o.length;a<l;a++,r++)i[r]=o[a];return i}var s=function(){function e(){}return e.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},e.setAttributes=function(e,t){for(var n=0,i=t;n<i.length;n++){var r=i[n],o=r[0],a=r[1];e.setAttribute(o,a)}},e.createRect=function(t,n,i){var r=document.createElementNS("http://www.w3.org/2000/svg","rect");return r.setAttribute("width",t.toString()),r.setAttribute("height",n.toString()),i&&e.setAttributes(r,i),r},e.createLine=function(t,n,i,r,o){var a=document.createElementNS("http://www.w3.org/2000/svg","line");return a.setAttribute("x1",t.toString()),a.setAttribute("y1",n.toString()),a.setAttribute("x2",i.toString()),a.setAttribute("y2",r.toString()),o&&e.setAttributes(a,o),a},e.createPolygon=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg","polygon");return i.setAttribute("points",t),n&&e.setAttributes(i,n),i},e.createCircle=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg","circle");return i.setAttribute("cx",(t/2).toString()),i.setAttribute("cy",(t/2).toString()),i.setAttribute("r",t.toString()),n&&e.setAttributes(i,n),i},e.createEllipse=function(t,n,i){var r=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return r.setAttribute("cx",(t/2).toString()),r.setAttribute("cy",(n/2).toString()),r.setAttribute("rx",(t/2).toString()),r.setAttribute("ry",(n/2).toString()),i&&e.setAttributes(r,i),r},e.createGroup=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","g");return t&&e.setAttributes(n,t),n},e.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},e.createMarker=function(t,n,i,r,o,a,l){var s=document.createElementNS("http://www.w3.org/2000/svg","marker");return e.setAttributes(s,[["id",t],["orient",n],["markerWidth",i.toString()],["markerHeight",r.toString()],["refX",o.toString()],["refY",a.toString()]]),s.appendChild(l),s},e.createText=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","text");return n.setAttribute("x","0"),n.setAttribute("y","0"),t&&e.setAttributes(n,t),n},e.createTSpan=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg","tspan");return i.textContent=t,n&&e.setAttributes(i,n),i},e.createImage=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","image");return t&&e.setAttributes(n,t),n},e.createPoint=function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return n.x=e,n.y=t,n},e.createPath=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",t),n&&e.setAttributes(i,n),i},e}(),c=function(){function e(){}return e.addKey=function(t){e.key=t},Object.defineProperty(e,"isLicensed",{get:function(){return!!e.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(e.key)},enumerable:!1,configurable:!0}),e}(),u=function(){function e(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return e.prototype.rasterize=function(e,t,n){var i=this;return new Promise((function(r){var o=void 0!==n?n:document.createElement("canvas");null===e&&(i.markersOnly=!0,i.naturalSize=!1);var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("width",t.width.baseVal.valueAsString),a.setAttribute("height",t.height.baseVal.valueAsString),a.setAttribute("viewBox","0 0 "+t.viewBox.baseVal.width.toString()+" "+t.viewBox.baseVal.height.toString()),a.innerHTML=t.innerHTML,!0===i.naturalSize?(a.width.baseVal.value=e.naturalWidth,a.height.baseVal.value=e.naturalHeight):void 0!==i.width&&void 0!==i.height&&(a.width.baseVal.value=i.width,a.height.baseVal.value=i.height),o.width=a.width.baseVal.value,o.height=a.height.baseVal.value;var l=a.outerHTML,s=o.getContext("2d");!0!==i.markersOnly&&s.drawImage(e,0,0,o.width,o.height);var c=window.URL,u=new Image(o.width,o.height);u.setAttribute("crossOrigin","anonymous");var h=new Blob([l],{type:"image/svg+xml"}),d=c.createObjectURL(h);u.onload=function(){s.drawImage(u,0,0),c.revokeObjectURL(d);var e=o.toDataURL(i.imageType,i.imageQuality);r(e)},u.src=d}))},e}(),h=function(){},d=function(){function e(e){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+e+"_"}return Object.defineProperty(e.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(e.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(e.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),e.prototype.addClass=function(e){return void 0===this.styleSheet&&this.addStyleSheet(),e.name=""+this.classNamePrefix+e.localName,this.classes.push(e),this.styleSheet.sheet.insertRule("."+e.name+" {"+e.style+"}",this.styleSheet.sheet.cssRules.length),e},e.prototype.addRule=function(e){void 0===this.styleSheet&&this.addStyleSheet(),this.rules.push(e),this.styleSheet.sheet.insertRule(e.selector+" {"+e.style+"}",this.styleSheet.sheet.cssRules.length)},e.prototype.addStyleSheet=function(){var e;this.styleSheet=document.createElement("style"),(null!==(e=this.styleSheetRoot)&&void 0!==e?e:document.head).appendChild(this.styleSheet),this.addRule(new p("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new p("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames","\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n ")),this.addRule(new p("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames","\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n ")),this.addClass(new f("fade_in","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_in_animation_frames;\n ")),this.addClass(new f("fade_out","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_out_animation_frames;\n "))},e.prototype.removeStyleSheet=function(){var e;this.styleSheet&&((null!==(e=this.styleSheetRoot)&&void 0!==e?e:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},e}(),p=function(e,t){this.selector=e,this.style=t},f=function(e,t){this.localName=e,this.style=t},m=function(){function e(e,t,n,i,r){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=e,this.displayMode=t,this.markerItems=n,this.uiStyleSettings=i,this.styles=r,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return e.prototype.show=function(e){var t=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=e,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var n=document.createElement("div");n.className=this.toolbarBlockStyleClass.name,n.style.whiteSpace="nowrap",this.uiContainer.appendChild(n),this.addActionButton(n,'<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(n,'<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(n,'<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(n,'<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(n,'<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(n,'<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(n,'<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(n,'<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(e){var n=document.createElement("div");n.className=""+t.toolbarButtonStyleClass.name,n.setAttribute("data-type-name",e.typeName),n.innerHTML=e.icon,n.addEventListener("click",(function(){t.markerToolbarButtonClicked(n,e)})),t.buttons.push(n),t.markerButtons.push(n)})),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 i=document.createElement("div");i.className=this.toolbarBlockStyleClass.name,i.style.whiteSpace="nowrap",i.style.display=!1!==this.uiStyleSettings.resultButtonBlockVisible?"":"none",this.uiContainer.appendChild(i),this.addActionButton(i,'<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(i,'<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()},e.prototype.addButtonClickListener=function(e){this.buttonClickListeners.push(e)},e.prototype.removeButtonClickListener=function(e){this.buttonClickListeners.indexOf(e)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(e),1)},e.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},e.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var e=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var t=0;t<this.markerButtons.length;t++)t<e||t===e&&this.markerButtons.length-1===e?this.markerButtonBlock.appendChild(this.markerButtons[t]):(t===e&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[t]))}},e.prototype.overflowButtonClicked=function(){"none"!==this.markerButtonOverflowBlock.style.display?(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")},e.prototype.resetButtonStyles=function(){var e=this;this.buttons.forEach((function(t){t.className=t.className.replace(e.uiStyleSettings.toolbarButtonStyleColorsClassName?e.uiStyleSettings.toolbarButtonStyleColorsClassName:e.toolbarButtonStyleColorsClass.name,"").trim(),t.className=t.className.replace(e.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?e.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:e.toolbarActiveButtonStyleColorsClass.name,"").trim(),t.className+=" "+(e.uiStyleSettings.toolbarButtonStyleColorsClassName?e.uiStyleSettings.toolbarButtonStyleColorsClassName:e.toolbarButtonStyleColorsClass.name)}))},e.prototype.addActionButton=function(e,t,n){var i=this,r=document.createElement("div");switch(r.className=""+this.toolbarButtonStyleClass.name,r.innerHTML=t,r.setAttribute("data-action",n),r.addEventListener("click",(function(){i.actionToolbarButtonClicked(r,n)})),n){case"select":case"undo":case"redo":r.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":r.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"render":r.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":r.style.fill=this.uiStyleSettings.closeButtonColor}e.appendChild(r),this.buttons.push(r)},e.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new f("toolbar","\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: row;\n justify-content: space-between; \n height: "+this.uiStyleSettings.toolbarHeight+"px;\n box-sizing: content-box;\n "+("inline"===this.displayMode?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n "+("inline"===this.displayMode?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n overflow: hidden;\n ")),this.toolbarStyleColorsClass=this.styles.addClass(new f("toolbar_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n box-shadow: 0px 3px rgba(33, 33, 33, 0.1);\n ")),this.toolbarBlockStyleClass=this.styles.addClass(new f("toolbar-block","\n display: inline-block;\n box-sizing: content-box;\n ")),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new f("toolbar-overflow-block","\n position: absolute;\n top: "+this.uiStyleSettings.toolbarHeight+"px;\n max-width: "+2*this.uiStyleSettings.toolbarHeight+"px;\n z-index: 10;\n box-sizing: content-box;\n ")),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new f("toolbar-overflow-block_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n "));var e=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new f("toolbar_button","\n display: inline-block;\n width: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n height: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n padding: "+e+"px;\n box-sizing: content-box;\n ")),this.toolbarButtonStyleColorsClass=this.styles.addClass(new f("toolbar_button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbar_active_button","\n fill: "+this.uiStyleSettings.toolbarColor+";\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new p("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n ")),this.styles.addRule(new p("."+this.toolbarButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n "))},e.prototype.markerToolbarButtonClicked=function(e,t){this.setActiveButton(e),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(e){return e("marker",t)})),this.markerButtonOverflowBlock.style.display="none"},e.prototype.actionToolbarButtonClicked=function(e,t){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(e){return e("action",t)})),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},e.prototype.setActiveButton=function(e){this.resetButtonStyles(),e.className=e.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),e.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},e.prototype.setActiveMarkerButton=function(e){var t=this.markerButtons.find((function(t){return t.getAttribute("data-type-name")===e}));t&&this.setActiveButton(t)},e.prototype.setCurrentMarker=function(e){var t=this;this.currentMarker=e,this.buttons.filter((function(e){return/delete|notes/.test(e.getAttribute("data-action"))})).forEach((function(e){void 0===t.currentMarker?(e.style.fillOpacity="0.4",e.style.pointerEvents="none"):(e.style.fillOpacity="1",e.style.pointerEvents="all")}))},e}(),v=function(){function e(e,t,n,i){this.panels=[],this.panelButtons=[],this.markerjsContainer=e,this.displayMode=t,this.uiStyleSettings=n,this.styles=i,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return e.prototype.addStyles=function(){var e;this.toolboxStyleClass=this.styles.addClass(new f("toolbox","\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n font-family: sans-serif;\n "+("popup"===this.displayMode?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+"\n box-sizing: content-box;\n "+("popup"===this.displayMode?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+"\n "+("inline"===this.displayMode?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n "+("inline"===this.displayMode?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n overflow: hidden;\n ")),this.toolboxStyleColorsClass=this.styles.addClass(new f("toolbox_colors","\n color: "+this.uiStyleSettings.toolboxColor+";\n "));var t=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new f("toolbox-button-row","\n display: flex;\n cursor: default;\n box-sizing: content-box;\n ")),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new f("toolbox-button-row_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n ")),this.toolboxPanelRowStyleClass=this.styles.addClass(new f("toolbox-panel-row","\n display: flex;\n "+("inline"===this.displayMode?"position: absolute;":"")+"\n "+("inline"===this.displayMode?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+"\n cursor: default;\n height: "+1.5*this.uiStyleSettings.toolbarHeight+"px;\n "+("inline"===this.displayMode?"width: 100%;":"")+"\n box-sizing: content-box;\n ")),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new f("toolbox-panel-row_colors","\n background-color: "+(null!==(e=this.uiStyleSettings.toolboxBackgroundColor)&&void 0!==e?e:this.uiStyleSettings.toolbarBackgroundHoverColor)+";\n ")),this.toolboxButtonStyleClass=this.styles.addClass(new f("toolbox_button","\n display: inline-block;\n width: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n height: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n padding: "+t+"px;\n box-sizing: content-box;\n ")),this.toolboxButtonStyleColorsClass=this.styles.addClass(new f("toolbox-button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbox-active-button_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+";\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.styles.addRule(new p("."+this.toolboxButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new p("."+this.toolboxButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n "))},e.prototype.show=function(e){var t;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=e,this.uiContainer.className=this.toolboxStyleClass.name+" "+(null!==(t=this.uiStyleSettings.toolboxStyleColorsClassName)&&void 0!==t?t:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},e.prototype.setPanelButtons=function(e){var t,n,i=this;this.panels=e,void 0!==this.uiContainer&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+(null!==(t=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)&&void 0!==t?t:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+(null!==(n=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)&&void 0!==n?n:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach((function(e){var t;e.uiStyleSettings=i.uiStyleSettings;var n=document.createElement("div");n.className=i.toolboxButtonStyleClass.name+" "+(null!==(t=i.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==t?t:i.toolboxButtonStyleColorsClass.name),n.innerHTML=e.icon,n.title=e.title,n.addEventListener("click",(function(){i.panelButtonClick(e)})),i.panelButtons.push(n),i.buttonRow.appendChild(n)})),"inline"===this.displayMode?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},e.prototype.panelButtonClick=function(e){var t=this,n=-1;if(e!==this.activePanel){n=this.panels.indexOf(e),this.panelRow.innerHTML="";var i=e.getUi();i.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(i),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=e}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout((function(){"inline"===t.displayMode?t.panelRow.style.display="none":t.panelRow.style.visibility="hidden"}),200);this.panelButtons.forEach((function(e,i){var r,o;e.className=t.toolboxButtonStyleClass.name+" "+(i===n?""+(null!==(r=t.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)&&void 0!==r?r:t.toolboxActiveButtonStyleColorsClass.name):""+(null!==(o=t.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==o?o:t.toolboxButtonStyleColorsClass.name))}))},e}(),g=function(e,t){this.title=e,this.icon=t},y=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'<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 o.colors=[],o.addTransparent=!1,o.colorBoxes=[],o.colors=n,o.currentColor=i,o.setCurrentColor=o.setCurrentColor.bind(o),o.getColorBox=o.getColorBox.bind(o),o}return r(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.overflow="hidden",t.style.whiteSpace="nowrap",this.colors.forEach((function(n){var i=e.getColorBox(n);t.appendChild(i),e.colorBoxes.push(i)})),t},t.prototype.getColorBox=function(e){var t=this,n=this.uiStyleSettings.toolbarHeight/4,i=this.uiStyleSettings.toolbarHeight-n,r=document.createElement("div");r.style.display="inline-block",r.style.boxSizing="content-box",r.style.width=i-2+"px",r.style.height=i-2+"px",r.style.padding="1px",r.style.marginRight="2px",r.style.marginBottom="2px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.borderRadius=(i+2)/2+"px",r.style.borderColor=e===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){t.setCurrentColor(e,r)}));var o=document.createElement("div");return o.style.display="inline-block",o.style.width=i-2+"px",o.style.height=i-2+"px",o.style.backgroundColor=e,o.style.borderRadius=i/2+"px","transparent"===e&&(o.style.fill=this.uiStyleSettings.toolboxAccentColor,o.innerHTML='<svg viewBox="0 0 24 24">\n <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" />\n </svg>'),r.appendChild(o),r},t.prototype.setCurrentColor=function(e,t){var n=this;this.currentColor=e,this.colorBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onColorChanged&&this.onColorChanged(e)},t}(g),b=function(){function e(e,t,n){this._state="new",this._isSelected=!1,this._container=e,this._overlayContainer=t,this.globalSettings=n,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(e.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!1},Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),e.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},e.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},e.prototype.pointerDown=function(e,t){},e.prototype.dblClick=function(e,t){},e.prototype.manipulate=function(e){},e.prototype.pointerUp=function(e){this.stateChanged()},e.prototype.dispose=function(){},e.prototype.addMarkerVisualToContainer=function(e){this.container.childNodes.length>0?this.container.insertBefore(e,this.container.childNodes[0]):this.container.appendChild(e)},e.prototype.getState=function(){return{typeName:e.typeName,state:this.state,notes:this.notes}},e.prototype.restoreState=function(e){this._state=e.state,this.notes=e.notes},e.prototype.scale=function(e,t){},e.prototype.colorChanged=function(e){this.onColorChanged&&this.onColorChanged(e),this.stateChanged()},e.prototype.fillColorChanged=function(e){this.onFillColorChanged&&this.onFillColorChanged(e),this.stateChanged()},e.prototype.stateChanged=function(){if(this.onStateChanged&&"creating"!==this.state&&"new"!==this.state){var e=this.getState();void 0!==this.manipulationStartState&&(this.manipulationStartState.state="select"),e.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(e)&&this.onStateChanged(this)}},e.typeName="MarkerBase",e}(),x=function(){function e(){this.findGripByVisual=this.findGripByVisual.bind(this)}return e.prototype.findGripByVisual=function(e){return this.topLeft.ownsTarget(e)?this.topLeft:this.topCenter.ownsTarget(e)?this.topCenter:this.topRight.ownsTarget(e)?this.topRight:this.centerLeft.ownsTarget(e)?this.centerLeft:this.centerRight.ownsTarget(e)?this.centerRight:this.bottomLeft.ownsTarget(e)?this.bottomLeft:this.bottomCenter.ownsTarget(e)?this.bottomCenter:this.bottomRight.ownsTarget(e)?this.bottomRight:void 0},e}(),w=function(){function e(){this.GRIP_SIZE=10,this.visual=s.createGroup(),this.visual.appendChild(s.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(s.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return e.prototype.ownsTarget=function(e){return e===this.visual||e===this.visual.childNodes[0]||e===this.visual.childNodes[1]},e}(),C=function(){function e(){}return e.toITransformMatrix=function(e){return{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}},e.toSVGMatrix=function(e,t){return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e},e}(),k=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.left=0,r.top=0,r.width=0,r.height=0,r.defaultSize={x:50,y:20},r.offsetX=0,r.offsetY=0,r.rotationAngle=0,r.CB_DISTANCE=10,r._suppressMarkerCreateEvent=!1,r.container.transform.baseVal.appendItem(s.createTransform()),r.setupControlBox(),r}return r(t,e),Object.defineProperty(t.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visual",{get:function(){return this._visual},set:function(e){this._visual=e;var t=s.createTransform();this._visual.transform.baseVal.appendItem(t)},enumerable:!1,configurable:!0}),t.prototype.ownsTarget=function(t){return!!e.prototype.ownsTarget.call(this,t)||!!(void 0!==this.controlGrips.findGripByVisual(t)||void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(t))},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.left=t.x,this.top=t.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var i=this.unrotatePoint(t);if(this.manipulationStartX=i.x,this.manipulationStartY=i.y,this.offsetX=i.x-this.left,this.offsetY=i.y-this.top,"new"!==this.state)if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(n),void 0!==this.activeGrip)this._state="resize";else if(void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(n)){this.activeGrip=this.rotatorGrip;var r=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=r.x-this.width/2,this.top=r.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var o=this.container.transform.baseVal.getItem(0);o.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(o,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},t.prototype.pointerUp=function(t){var n=this.state;e.prototype.pointerUp.call(this,t),"creating"===this.state&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(t),this._state="select","creating"===n&&this.onMarkerCreated&&!1===this._suppressMarkerCreateEvent&&this.onMarkerCreated(this)},t.prototype.moveVisual=function(e){this.visual.style.transform="translate("+e.x+"px, "+e.y+"px)"},t.prototype.manipulate=function(e){var t=this.unrotatePoint(e);"creating"===this.state?this.resize(e):"move"===this.state?(this.left=this.manipulationStartLeft+(t.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(t.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):"resize"===this.state?this.resize(t):"rotate"===this.state&&this.rotate(e)},t.prototype.resize=function(e){var t=this.manipulationStartLeft,n=this.manipulationStartWidth,i=this.manipulationStartTop,r=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:t=this.manipulationStartLeft+e.x-this.manipulationStartX,n=this.manipulationStartWidth+this.manipulationStartLeft-t;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:n=this.manipulationStartWidth+e.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:i=this.manipulationStartTop+e.y-this.manipulationStartY,r=this.manipulationStartHeight+this.manipulationStartTop-i;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:r=this.manipulationStartHeight+e.y-this.manipulationStartY}n>=0?(this.left=t,this.width=n):(this.left=t+n,this.width=-n),r>=0?(this.top=i,this.height=r):(this.top=i+r,this.height=-r),this.setSize()},t.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},t.prototype.rotate=function(e){if(Math.abs(e.x-this.centerX)>.1){var t=Math.sign(e.x-this.centerX);this.rotationAngle=180*Math.atan((e.y-this.centerY)/(e.x-this.centerX))/Math.PI+90*t,this.applyRotation()}},t.prototype.applyRotation=function(){var e=this.container.transform.baseVal.getItem(0);e.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(e,0)},t.prototype.rotatePoint=function(e){if(0===this.rotationAngle)return e;var t=this.container.getCTM(),n=s.createPoint(e.x,e.y);return{x:(n=n.matrixTransform(t)).x,y:n.y}},t.prototype.unrotatePoint=function(e){if(0===this.rotationAngle)return e;var t=this.container.getCTM();t=t.inverse();var n=s.createPoint(e.x,e.y);return{x:(n=n.matrixTransform(t)).x,y:n.y}},t.prototype.select=function(){e.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},t.prototype.deselect=function(){e.prototype.deselect.call(this),this.controlBox.style.display="none"},t.prototype.setupControlBox=function(){this.controlBox=s.createGroup();var e=s.createTransform();e.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(e),this.container.appendChild(this.controlBox),this.controlRect=s.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),!0!==this.globalSettings.disableRotation&&(this.rotatorGripLine=s.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 x,this.addControlGrips(),this.controlBox.style.display="none"},t.prototype.adjustControlBox=function(){var e=this.controlBox.transform.baseVal.getItem(0);e.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(e,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),void 0!==this.rotatorGripLine&&(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()},t.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(),!0!==this.globalSettings.disableRotation&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},t.prototype.createGrip=function(){var e=new w;return e.visual.transform.baseVal.appendItem(s.createTransform()),this.controlBox.appendChild(e.visual),e},t.prototype.positionGrips=function(){var e=this.controlGrips.topLeft.GRIP_SIZE,t=-e/2,n=t,i=(this.width+this.CB_DISTANCE)/2-e/2,r=(this.height+this.CB_DISTANCE)/2-e/2,o=this.height+this.CB_DISTANCE-e/2,a=this.width+this.CB_DISTANCE-e/2;this.positionGrip(this.controlGrips.topLeft.visual,t,n),this.positionGrip(this.controlGrips.topCenter.visual,i,n),this.positionGrip(this.controlGrips.topRight.visual,a,n),this.positionGrip(this.controlGrips.centerLeft.visual,t,r),this.positionGrip(this.controlGrips.centerRight.visual,a,r),this.positionGrip(this.controlGrips.bottomLeft.visual,t,o),this.positionGrip(this.controlGrips.bottomCenter.visual,i,o),this.positionGrip(this.controlGrips.bottomRight.visual,a,o),void 0!==this.rotatorGrip&&this.positionGrip(this.rotatorGrip.visual,i,n-3*this.CB_DISTANCE)},t.prototype.positionGrip=function(e,t,n){var i=e.transform.baseVal.getItem(0);i.setTranslate(t,n),e.transform.baseVal.replaceItem(i,0)},t.prototype.hideControlBox=function(){this.controlBox.style.display="none"},t.prototype.showControlBox=function(){this.controlBox.style.display=""},t.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:C.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:C.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.left=n.left,this.top=n.top,this.width=n.width,this.height=n.height,this.rotationAngle=n.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(C.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,n.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(C.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,n.containerTransformMatrix))},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n);var i=this.rotatePoint({x:this.left,y:this.top}),r=this.unrotatePoint({x:i.x*t,y:i.y*n});this.left=r.x,this.top=r.y,this.width=this.width*t,this.height=this.height*n,this.adjustControlBox()},t}(b),S=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.fillColor="transparent",r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.opacity=1,r.setStrokeColor=r.setStrokeColor.bind(r),r.setFillColor=r.setFillColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.createVisual=r.createVisual.bind(r),r}return r(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual)},t.prototype.createVisual=function(){this.visual=s.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.setSize()},t.prototype.setSize=function(){e.prototype.setSize.call(this),s.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},t.prototype.pointerUp=function(t){e.prototype.pointerUp.call(this,t),this.setSize()},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.visual&&s.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(e),this.stateChanged()},t.prototype.setFillColor=function(e){this.fillColor=e,this.visual&&s.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.visual&&s.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.visual&&s.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},t.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){var n=t;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.opacity=n.opacity,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setSize()},t.title="Rectangle marker",t}(k),E=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return o.widths=[],o.widthBoxes=[],o.widths=n,o.currentWidth=i,o.setCurrentWidth=o.setCurrentWidth.bind(o),o}return r(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2",this.widths.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.flexGrow="2",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.borderColor=n===e.currentWidth?e.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){e.setCurrentWidth(n,i)})),t.appendChild(i);var r=document.createElement("div");r.innerText=n.toString(),r.style.marginRight="5px",i.appendChild(r);var o=document.createElement("div");o.style.minHeight="20px",o.style.flexGrow="2",o.style.display="flex",o.style.alignItems="center";var a=document.createElement("hr");a.style.minWidth="20px",a.style.border="0px",a.style.borderTop=n+"px solid "+e.uiStyleSettings.toolboxColor,a.style.flexGrow="2",o.appendChild(a),i.appendChild(o),e.widthBoxes.push(i)})),t},t.prototype.setCurrentWidth=function(e,t){var n=this;this.currentWidth=e,this.widthBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},t}(g),M=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'<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 o.styles=[],o.styleBoxes=[],o.styles=n,o.currentStyle=i,o.setCurrentStyle=o.setCurrentStyle.bind(o),o}return r(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2",this.styles.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.overflow="hidden",i.style.maxWidth=100/e.styles.length-5+"%",i.style.borderColor=n===e.currentStyle?e.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){e.setCurrentStyle(n,i)})),t.appendChild(i);var r=document.createElement("div");r.style.minHeight="20px",r.style.flexGrow="2",r.style.overflow="hidden";var o='<svg width="100" height="20">\n <line x1="0" y1="10" x2="100" y2="10" stroke="'+e.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(""!==n?'stroke-dasharray="'+n+'"':"")+" />\n </svg>";r.innerHTML=o,i.appendChild(r),e.styleBoxes.push(i)})),t},t.prototype.setCurrentStyle=function(e,t){var n=this;this.currentStyle=e,this.styleBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},t}(g),T=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new y("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new M("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return r(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="FrameMarker",t.title="Frame marker",t.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',t}(S),L=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"},A=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.x1=0,r.y1=0,r.x2=0,r.y2=0,r.defaultLength=50,r.manipulationStartX=0,r.manipulationStartY=0,r.manipulationStartX1=0,r.manipulationStartY1=0,r.manipulationStartX2=0,r.manipulationStartY2=0,r.setupControlBox(),r}return r(t,e),t.prototype.ownsTarget=function(t){return!!e.prototype.ownsTarget.call(this,t)||!(!this.grip1.ownsTarget(t)&&!this.grip2.ownsTarget(t))},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),this.manipulationStartX=t.x,this.manipulationStartY=t.y,"new"===this.state&&(this.x1=t.x,this.y1=t.y,this.x2=t.x,this.y2=t.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,"new"!==this.state&&(this.select(),this.grip1.ownsTarget(n)?this.activeGrip=this.grip1:this.grip2.ownsTarget(n)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},t.prototype.pointerUp=function(t){var n=this.state;e.prototype.pointerUp.call(this,t),"creating"===this.state&&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(t),this._state="select","creating"===n&&this.onMarkerCreated&&this.onMarkerCreated(this)},t.prototype.adjustVisual=function(){},t.prototype.manipulate=function(e){"creating"===this.state?this.resize(e):"move"===this.state?(this.x1=this.manipulationStartX1+e.x-this.manipulationStartX,this.y1=this.manipulationStartY1+e.y-this.manipulationStartY,this.x2=this.manipulationStartX2+e.x-this.manipulationStartX,this.y2=this.manipulationStartY2+e.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):"resize"===this.state&&this.resize(e)},t.prototype.resize=function(e){switch(this.activeGrip){case this.grip1:this.x1=e.x,this.y1=e.y;break;case this.grip2:case void 0:this.x2=e.x,this.y2=e.y}this.adjustVisual(),this.adjustControlBox()},t.prototype.select=function(){e.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},t.prototype.deselect=function(){e.prototype.deselect.call(this),this.controlBox.style.display="none"},t.prototype.setupControlBox=function(){this.controlBox=s.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},t.prototype.adjustControlBox=function(){this.positionGrips()},t.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},t.prototype.createGrip=function(){var e=new w;return e.visual.transform.baseVal.appendItem(s.createTransform()),this.controlBox.appendChild(e.visual),e},t.prototype.positionGrips=function(){var e=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-e/2,this.y1-e/2),this.positionGrip(this.grip2.visual,this.x2-e/2,this.y2-e/2)},t.prototype.positionGrip=function(e,t,n){var i=e.transform.baseVal.getItem(0);i.setTranslate(t,n),e.transform.baseVal.replaceItem(i,0)},t.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.x1=n.x1,this.y1=n.y1,this.x2=n.x2,this.y2=n.y2},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.x1=this.x1*t,this.y1=this.y1*n,this.x2=this.x2*t,this.y2=this.y2*n,this.adjustVisual(),this.adjustControlBox()},t}(b),D=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.setStrokeColor=r.setStrokeColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new y("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new M("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return r(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.selectorLine&&t!==this.visibleLine)},t.prototype.createVisual=function(){this.visual=s.createGroup(),this.selectorLine=s.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=s.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.createVisual(),this.adjustVisual(),this._state="creating")},t.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()),s.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),s.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),s.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.adjustVisual(),this.colorChanged(e)},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.adjustVisual()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.adjustVisual(),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.createVisual(),this.adjustVisual()},t.typeName="LineMarker",t.title="Line marker",t.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',t}(A),P=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'<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 o.fonts=[],o.fontBoxes=[],o.fonts=n,o.currentFont=i,o.setCurrentFont=o.setCurrentFont.bind(o),o}return r(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.overflow="hidden",t.style.flexGrow="2",this.fonts.forEach((function(n){var i=document.createElement("div");i.style.display="inline-block",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.overflow="hidden",i.style.maxWidth=100/e.fonts.length-5+"%",i.style.borderColor=n===e.currentFont?e.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){e.setCurrentFont(n,i)})),t.appendChild(i);var r=document.createElement("div");r.style.display="flex",r.style.minHeight="20px",r.style.flexGrow="2",r.style.fontFamily=n,r.style.overflow="hidden";var o=document.createElement("div");o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.innerHTML="The quick brown fox jumps over the lazy dog",r.appendChild(o),i.appendChild(r),e.fontBoxes.push(i)})),t},t.prototype.setCurrentFont=function(e,t){var n=this;this.currentFont=e,this.fontBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onFontChanged&&this.onFontChanged(this.currentFont)},t}(g),N=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.color="transparent",r.padding=5,r.DEFAULT_TEXT="请输入文本",r.text=r.DEFAULT_TEXT,r.isMoved=!1,r.color=i.defaultColor,r.fontFamily=i.defaultFontFamily,r.defaultSize={x:100,y:30},r.setColor=r.setColor.bind(r),r.setFont=r.setFont.bind(r),r.renderText=r.renderText.bind(r),r.sizeText=r.sizeText.bind(r),r.textEditDivClicked=r.textEditDivClicked.bind(r),r.showTextEditor=r.showTextEditor.bind(r),r.setSize=r.setSize.bind(r),r.positionTextEditor=r.positionTextEditor.bind(r),r.colorPanel=new y("Color",i.defaultColorSet,i.defaultColor),r.colorPanel.onColorChanged=r.setColor,r.fontFamilyPanel=new P("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r}return r(t,e),t.prototype.ownsTarget=function(t){if(e.prototype.ownsTarget.call(this,t)||t===this.visual||t===this.textElement||t===this.bgRectangle)return!0;var n=!1;return this.textElement.childNodes.forEach((function(e){e===t&&(n=!0)})),n},t.prototype.createVisual=function(){this.visual=s.createGroup(),this.bgRectangle=s.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=s.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(s.createTransform()),this.textElement.transform.baseVal.appendItem(s.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),this.isMoved=!1,this.pointerDownPoint=t,this.pointerDownTimestamp=Date.now(),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.renderText=function(){var e=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(t){e.textElement.appendChild(s.createTSpan(""===t.trim()?" ":t.trim(),[["x","0"],["dy","1.2em"]]))})),setTimeout(this.sizeText,10)}},t.prototype.getTextScale=function(){var e=this.textElement.getBBox(),t=1;if(e.width>0&&e.height>0){var n=(1*this.width-this.width*this.padding*2/100)/e.width,i=(1*this.height-this.height*this.padding*2/100)/e.height;t=Math.min(n,i)}return t},t.prototype.getTextPosition=function(e){var t=this.textElement.getBBox(),n=0,i=0;return t.width>0&&t.height>0&&(n=(this.width-t.width*e)/2,i=this.height/2-t.height*e/2),{x:n,y:i}},t.prototype.sizeText=function(){var e=this.textElement.getBBox(),t=this.getTextScale(),n=this.getTextPosition(t);n.y-=e.y*t,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+n.x+"px, "+n.y+"px) scale("+t+", "+t+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(n.x,n.y),this.textElement.transform.baseVal.getItem(1).setScale(t,t))},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t),void 0!==this.pointerDownPoint&&(this.isMoved=Math.abs(t.x-this.pointerDownPoint.x)>5||Math.abs(t.y-this.pointerDownPoint.y)>5)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.isMoved=!0,this.setSize(),this.sizeText()},t.prototype.setSize=function(){e.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(s.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),s.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},t.prototype.pointerUp=function(t){var n=this.state;"creating"===n&&(this._suppressMarkerCreateEvent=!0),e.prototype.pointerUp.call(this,t),this.setSize(),("creating"===n||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},t.prototype.showTextEditor=function(){var e=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(e){e.stopPropagation()})),this.textEditor.addEventListener("input",(function(){for(var t=Number.parseFloat(e.textEditor.style.fontSize);e.textEditor.clientWidth>=Number.parseInt(e.textEditor.style.maxWidth)&&t>.9;)t-=.1,e.textEditor.style.fontSize=Math.max(t,.9)+"em"})),this.textEditor.addEventListener("keyup",(function(e){e.cancelBubble=!0})),this.textEditor.addEventListener("paste",(function(e){if(e.clipboardData){var t=e.clipboardData.getData("text"),n=window.getSelection();if(!n.rangeCount)return!1;n.deleteFromDocument(),n.getRangeAt(0).insertNode(document.createTextNode(t)),e.preventDefault()}})),this.textEditDiv.addEventListener("pointerup",(function(){e.textEditDivClicked(e.textEditor.innerText)})),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},t.prototype.positionTextEditor=function(){if("edit"===this.state)if(void 0===this.textEditor)this.showTextEditor();else{this.textElement.style.display="";var e=this.getTextScale(),t=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),n=this.textElement.getBBox(),i={x:n.width*e,y:n.height*e};t.x-=i.x/2,t.y-=i.y/2,this.textEditor.style.top=t.y+"px",this.textEditor.style.left=t.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-t.x+"px",this.textEditor.style.fontSize=Math.max(16*e,12)+"px",this.textElement.style.display="none"}},t.prototype.textEditDivClicked=function(e){this.text=e.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},t.prototype.select=function(){e.prototype.select.call(this),"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText)},t.prototype.deselect=function(){"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText),e.prototype.deselect.call(this)},t.prototype.dblClick=function(t,n){e.prototype.dblClick.call(this,t,n),this.showTextEditor()},t.prototype.setColor=function(e){this.textElement&&s.setAttributes(this.textElement,[["fill",e]]),this.color=e,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(e)},t.prototype.setFont=function(e){this.textElement&&s.setAttributes(this.textElement,[["font-family",e]]),this.fontFamily=e,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},t.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},t.prototype.showVisual=function(){"edit"===this.state&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){var n=t;this.color=n.color,this.fontFamily=n.fontFamily,this.padding=n.padding,this.text=n.text,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setSize(),this.sizeText(),this.positionTextEditor()},t.typeName="TextMarker",t.title="Text marker",t.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>',t}(k),B=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.color="transparent",r.lineWidth=3,r.drawing=!1,r.pixelRatio=1,r.color=i.defaultColor,r.lineWidth=i.defaultStrokeWidth,r.pixelRatio=i.freehandPixelRatio,r.setColor=r.setColor.bind(r),r.addCanvas=r.addCanvas.bind(r),r.finishCreation=r.finishCreation.bind(r),r.setLineWidth=r.setLineWidth.bind(r),r.colorPanel=new y("Color",i.defaultColorSet,i.defaultColor),r.colorPanel.onColorChanged=r.setColor,r.lineWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.lineWidthPanel.onWidthChanged=r.setLineWidth,r}return r(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.drawingImage)},t.prototype.createVisual=function(){this.visual=s.createGroup(),this.drawingImage=s.createImage(),this.visual.appendChild(this.drawingImage);var e=s.createTransform();this.visual.transform.baseVal.appendItem(e),this.addMarkerVisualToContainer(this.visual)},t.prototype.pointerDown=function(t,n){"new"===this.state&&(this.addCanvas(),this.createVisual(),this._state="creating"),"creating"===this.state?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(t.x,t.y),this.drawing=!0):e.prototype.pointerDown.call(this,t,n)},t.prototype.manipulate=function(t){"creating"===this.state?this.drawing&&(this.canvasContext.lineTo(t.x,t.y),this.canvasContext.stroke()):e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),s.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),s.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},t.prototype.pointerUp=function(t){"creating"===this._state?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):e.prototype.pointerUp.call(this,t)},t.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)},t.prototype.select=function(){"creating"===this.state&&this.finishCreation(),e.prototype.select.call(this)},t.prototype.deselect=function(){"creating"===this.state&&this.finishCreation(),e.prototype.deselect.call(this)},t.prototype.finishCreation=function(){for(var e=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),t=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],n=t[0],i=t[1],r=t[2],o=t[3],a=!1,l=0;l<this.canvasElement.height;l++)for(var s=0;s<this.canvasElement.width;s++)e.data[l*this.canvasElement.width*4+4*s+3]>0&&(a=!0,l<i&&(i=l),s<n&&(n=s),l>o&&(o=l),s>r&&(r=s));if(a){this.left=n/this.pixelRatio,this.top=i/this.pixelRatio,this.width=(r-n)/this.pixelRatio,this.height=(o-i)/this.pixelRatio;var c=document.createElement("canvas");c.width=r-n,c.height=o-i,c.getContext("2d").putImageData(this.canvasContext.getImageData(n,i,r-n,o-i),0,0),this.drawingImgUrl=c.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},t.prototype.setDrawingImage=function(){s.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),s.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},t.prototype.setColor=function(e){this.color=e,this.colorChanged(e)},t.prototype.setLineWidth=function(e){this.lineWidth=e},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return"new"===this.state||"creating"===this.state?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({drawingImgUrl:this.drawingImgUrl},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){this.createVisual(),e.prototype.restoreState.call(this,t),this.drawingImgUrl=t.drawingImgUrl,this.setDrawingImage()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setDrawingImage()},t.typeName="FreehandMarker",t.title="Freehand marker",t.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>',t}(k),_=function(e){function t(t,n,i){var r=e.call(this,t,i||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return r.typeBoxes=[],r.currentType=n,r.setCurrentType=r.setCurrentType.bind(r),r}return r(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2";for(var n=function(n){var r="both";switch(n){case 0:r="both";break;case 1:r="start";break;case 2:r="end";break;case 3:r="none"}var o=document.createElement("div");if(o.style.display="flex",o.style.flexGrow="2",o.style.alignItems="center",o.style.justifyContent="space-between",o.style.padding="5px",o.style.borderWidth="2px",o.style.borderStyle="solid",o.style.borderColor=r===i.currentType?i.uiStyleSettings.toolboxAccentColor:"transparent",o.addEventListener("click",(function(){e.setCurrentType(r,o)})),t.appendChild(o),"both"===r||"start"===r){var a=document.createElement("div");a.style.display="flex",a.style.alignItems="center",a.style.minHeight="20px",a.innerHTML='<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">\n <polygon points="0,5 10,0 10,10" fill="'+(void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxColor:"#eeeeee")+'" />\n </svg>',a.style.marginLeft="5px",o.appendChild(a)}var l=document.createElement("div");l.style.display="flex",l.style.alignItems="center",l.style.minHeight="20px",l.style.flexGrow="2";var s=document.createElement("hr");if(s.style.minWidth="20px",s.style.border="0px",s.style.borderTop="3px solid "+(void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxColor:"#eeeeee"),s.style.flexGrow="2",l.appendChild(s),o.appendChild(l),"both"===r||"end"===r){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.minHeight="20px",c.innerHTML='<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">\n <polygon points="0,0 10,5 0,10" fill="'+(void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxColor:"#eeeeee")+'" />\n </svg>',c.style.marginRight="5px",o.appendChild(c)}i.typeBoxes.push(o)},i=this,r=0;r<4;r++)n(r);return t},t.prototype.setCurrentType=function(e,t){var n=this;this.currentType=e,this.typeBoxes.forEach((function(e){e.style.borderColor=e===t?void 0!==n.uiStyleSettings?n.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"})),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},t}(g),I=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.arrowType="end",r.arrowBaseHeight=10,r.arrowBaseWidth=10,r.getArrowPoints=r.getArrowPoints.bind(r),r.setArrowType=r.setArrowType.bind(r),r.arrowTypePanel=new _("Arrow type","end"),r.arrowTypePanel.onArrowTypeChanged=r.setArrowType,r}return r(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.arrow1&&t!==this.arrow2)},t.prototype.getArrowPoints=function(e,t){var n=this.arrowBaseWidth+2*this.strokeWidth,i=this.arrowBaseHeight+2*this.strokeWidth;return e-n/2+","+(t+i/2)+" "+e+","+(t-i/2)+" "+(e+n/2)+","+(t+i/2)},t.prototype.createTips=function(){this.arrow1=s.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(s.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=s.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(s.createTransform()),this.visual.appendChild(this.arrow2)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"creating"===this.state&&this.createTips()},t.prototype.adjustVisual=function(){if(e.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2){this.arrow1.style.display="both"===this.arrowType||"start"===this.arrowType?"":"none",this.arrow2.style.display="both"===this.arrowType||"end"===this.arrowType?"":"none",s.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),s.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var t=0;Math.abs(this.x1-this.x2)>.1&&(t=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var n=this.arrow1.transform.baseVal.getItem(0);n.setRotate(t,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(n,0);var i=this.arrow2.transform.baseVal.getItem(0);i.setRotate(t+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(i,0)}},t.prototype.setArrowType=function(e){this.arrowType=e,this.adjustVisual(),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({arrowType:this.arrowType},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.arrowType=n.arrowType,this.createTips(),this.adjustVisual()},t.typeName="ArrowMarker",t.title="Arrow marker",t.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',t}(D),O=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.fillColor=i.defaultFillColor,r.strokeWidth=0,r.fillPanel=new y("Color",i.defaultColorSet,i.defaultFillColor),r.fillPanel.onColorChanged=r.setFillColor,r}return r(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="CoverMarker",t.title="Cover marker",t.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',t}(S),R=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'<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 o.opacities=[],o.opacityBoxes=[],o.opacities=n,o.currentOpacity=i,o.setCurrentOpacity=o.setCurrentOpacity.bind(o),o}return r(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2",t.style.justifyContent="space-between",this.opacities.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.borderColor=n===e.currentOpacity?e.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){e.setCurrentOpacity(n,i)})),t.appendChild(i);var r=document.createElement("div");r.innerText=100*n+"%",i.appendChild(r),e.opacityBoxes.push(i)})),t},t.prototype.setCurrentOpacity=function(e,t){var n=this;this.currentOpacity=e,this.opacityBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},t}(g),j=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.setOpacity=r.setOpacity.bind(r),r.fillColor=i.defaultHighlightColor,r.strokeWidth=0,r.opacity=i.defaultHighlightOpacity,r.fillPanel=new y("Color",i.defaultColorSet,r.fillColor),r.fillPanel.onColorChanged=r.setFillColor,r.opacityPanel=new R("Opacity",i.defaultOpacitySteps,r.opacity),r.opacityPanel.onOpacityChanged=r.setOpacity,r}return r(t,e),t.prototype.setOpacity=function(e){this.opacity=e,this.visual&&s.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="HighlightMarker",t.title="Highlight marker",t.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>',t}(O),F='<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>',Z='<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>',z=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.bgColor="transparent",r.tipPosition={x:0,y:0},r.tipBase1Position={x:0,y:0},r.tipBase2Position={x:0,y:0},r.tipMoving=!1,r.color=i.defaultStrokeColor,r.bgColor=i.defaultFillColor,r.fontFamily=i.defaultFontFamily,r.defaultSize={x:100,y:30},r.setBgColor=r.setBgColor.bind(r),r.getTipPoints=r.getTipPoints.bind(r),r.positionTip=r.positionTip.bind(r),r.setTipPoints=r.setTipPoints.bind(r),r.colorPanel=new y("Text color",i.defaultColorSet,r.color,F),r.colorPanel.onColorChanged=r.setColor,r.bgColorPanel=new y("Fill color",i.defaultColorSet,r.bgColor,Z),r.bgColorPanel.onColorChanged=r.setBgColor,r.fontFamilyPanel=new P("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r.tipGrip=new w,r.tipGrip.visual.transform.baseVal.appendItem(s.createTransform()),r.controlBox.appendChild(r.tipGrip.visual),r}return r(t,e),t.prototype.ownsTarget=function(t){return e.prototype.ownsTarget.call(this,t)||this.tipGrip.ownsTarget(t)||this.tip===t},t.prototype.createTip=function(){s.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=s.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},t.prototype.pointerDown=function(t,n){"new"===this.state&&e.prototype.pointerDown.call(this,t,n),"creating"===this.state?this.createTip():this.tipGrip.ownsTarget(n)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):e.prototype.pointerDown.call(this,t,n)},t.prototype.pointerUp=function(t){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,e.prototype.pointerUp.call(this,t);else{var n="creating"===this.state;e.prototype.pointerUp.call(this,t),this.setTipPoints(n),this.positionTip()}},t.prototype.manipulate=function(t){if(this.tipMoving){var n=this.unrotatePoint(t);this.tipPosition={x:n.x-this.manipulationStartLeft,y:n.y-this.manipulationStartTop},this.positionTip()}else e.prototype.manipulate.call(this,t)},t.prototype.setBgColor=function(e){this.bgRectangle&&this.tip&&(s.setAttributes(this.bgRectangle,[["fill",e]]),s.setAttributes(this.tip,[["fill",e]])),this.bgColor=e,this.fillColorChanged(e)},t.prototype.getTipPoints=function(){return this.setTipPoints("creating"===this.state),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},t.prototype.setTipPoints=function(e){void 0===e&&(e=!1);var t=Math.min(this.height/2,15),n=this.height/5;e&&(this.tipPosition={x:t+n/2,y:this.height+20});var i=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?i<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(n=this.width/5,t=Math.min(this.width/2,15),this.tipBase1Position={x:t,y:0},this.tipBase2Position={x:t+n,y:0}):(this.tipBase1Position={x:0,y:t},this.tipBase2Position={x:0,y:t+n}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?i<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(n=this.width/5,t=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-t-n,y:0},this.tipBase2Position={x:this.width-t,y:0}):(this.tipBase1Position={x:this.width,y:t},this.tipBase2Position={x:this.width,y:t+n}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?i<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(n=this.width/5,t=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-t-n,y:this.height},this.tipBase2Position={x:this.width-t,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-t-n},this.tipBase2Position={x:this.width,y:this.height-t}):i<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(n=this.width/5,t=Math.min(this.width/2,15),this.tipBase1Position={x:t,y:this.height},this.tipBase2Position={x:t+n,y:this.height}):(this.tipBase1Position={x:0,y:this.height-t},this.tipBase2Position={x:0,y:this.height-t-n})},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.positionTip()},t.prototype.positionTip=function(){s.setAttributes(this.tip,[["points",this.getTipPoints()]]);var e=this.tipGrip.visual.transform.baseVal.getItem(0);e.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(e,0)},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),t.prototype.select=function(){this.positionTip(),e.prototype.select.call(this)},t.prototype.getState=function(){var n=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){var n=t;this.bgColor=n.bgColor,this.tipPosition=n.tipPosition,e.prototype.restoreState.call(this,t),this.createTip(),this.setTipPoints()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.tipPosition={x:this.tipPosition.x*t,y:this.tipPosition.y*n},this.positionTip()},t.typeName="CalloutMarker",t.title="Callout marker",t.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>',t}(N),H=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.fillColor="transparent",r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.opacity=1,r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.fillColor=i.defaultFillColor,r.setStrokeColor=r.setStrokeColor.bind(r),r.setFillColor=r.setFillColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.setOpacity=r.setOpacity.bind(r),r.createVisual=r.createVisual.bind(r),r.strokePanel=new y("Line color",l(i.defaultColorSet,["transparent"]),i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.fillPanel=new y("Fill color",l(i.defaultColorSet,["transparent"]),r.fillColor,Z),r.fillPanel.onColorChanged=r.setFillColor,r.strokeWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new M("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r.opacityPanel=new R("Opacity",i.defaultOpacitySteps,r.opacity),r.opacityPanel.onOpacityChanged=r.setOpacity,r}return r(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual)},t.prototype.createVisual=function(){this.visual=s.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.setSize()},t.prototype.setSize=function(){e.prototype.setSize.call(this),s.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},t.prototype.pointerUp=function(t){e.prototype.pointerUp.call(this,t),this.setSize()},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.visual&&s.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(e),this.stateChanged()},t.prototype.setFillColor=function(e){this.fillColor=e,this.visual&&s.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(e),this.stateChanged()},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.visual&&s.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.visual&&s.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},t.prototype.setOpacity=function(e){this.opacity=e,this.visual&&s.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){var n=t;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.opacity=n.opacity,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setSize()},t.typeName="EllipseMarker",t.title="Ellipse marker",t.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>',t}(k),W=function(e){function t(t,n,i){return e.call(this,t,n,i)||this}return r(t,e),Object.defineProperty(t.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.tip1&&t!==this.tip2)},t.prototype.createTips=function(){this.tip1=s.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(s.createTransform()),this.visual.appendChild(this.tip1),this.tip2=s.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(s.createTransform()),this.visual.appendChild(this.tip2)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"creating"===this.state&&this.createTips()},t.prototype.adjustVisual=function(){if(e.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(s.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()]]),s.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 t=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),n=this.tip1.transform.baseVal.getItem(0);n.setRotate(t,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(n,0);var i=this.tip2.transform.baseVal.getItem(0);i.setRotate(t+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(i,0)}},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t),this.createTips(),this.adjustVisual()},t.typeName="MeasurementMarker",t.title="Measurement marker",t.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>',t}(D),G=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.strokePanel.colors=i.defaultColorSet,r.fillColor="transparent",r}return r(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="EllipseFrameMarker",t.title="Ellipse frame marker",t.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>',t}(H),V=function(){function e(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(e.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),e.prototype.addUndoStep=function(e){0!==this.undoStack.length&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(e)||(this.undoStack.push(e),JSON.stringify(this.lastRedoStep)!==JSON.stringify(e)&&this.redoStack.splice(0,this.redoStack.length))},e.prototype.replaceLastUndoStep=function(e){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=e)},e.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},e.prototype.undo=function(){if(this.undoStack.length>1){var e=this.undoStack.pop();return void 0!==e&&this.redoStack.push(e),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},e.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},e}(),U=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.curveX=0,r.curveY=0,r.manipulationStartCurveX=0,r.manipulationStartCurveY=0,r.setStrokeColor=r.setStrokeColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.positionGrips=r.positionGrips.bind(r),r.addControlGrips=r.addControlGrips.bind(r),r.adjustVisual=r.adjustVisual.bind(r),r.setupControlBox=r.setupControlBox.bind(r),r.resize=r.resize.bind(r),r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new y("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new M("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return r(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.selectorCurve&&t!==this.visibleCurve&&!this.curveGrip.ownsTarget(t))},t.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},t.prototype.createVisual=function(){this.visual=s.createGroup(),this.selectorCurve=s.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=s.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,"new"===this.state&&(this.curveX=t.x,this.curveY=t.y),"new"===this.state?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(n)&&(this.activeGrip=this.curveGrip,this._state="resize")},t.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),s.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),s.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),s.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},t.prototype.setupControlBox=function(){e.prototype.setupControlBox.call(this),this.curveControlLine1=s.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=s.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)},t.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,e.prototype.addControlGrips.call(this)},t.prototype.positionGrips=function(){e.prototype.positionGrips.call(this);var t=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-t/2,this.curveY-t/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()))},t.prototype.manipulate=function(t){"move"===this.state&&(this.curveX=this.manipulationStartCurveX+t.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+t.y-this.manipulationStartY),e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){this.activeGrip===this.curveGrip&&(this.curveX=t.x,this.curveY=t.y),e.prototype.resize.call(this,t),"creating"===this.state&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.adjustVisual(),this.colorChanged(e)},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.adjustVisual()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.adjustVisual()},t.prototype.scale=function(t,n){this.curveX=this.curveX*t,this.curveY=this.curveY*n,e.prototype.scale.call(this,t,n)},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.curveX=n.curveX,this.curveY=n.curveY,this.createVisual(),this.adjustVisual()},t.typeName="CurveMarker",t.title="Curve marker",t.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>',t}(A),q=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.fillColor="transparent",r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.textColor="transparent",r.fontSize="1rem",r.isMoved=!1,r.captionText="Caption",r.PADDING=5,r.captionBoxWidth=0,r.captionBoxHeight=0,r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.fillColor=i.defaultFillColor,r.textColor=i.defaultStrokeColor,r.fontFamily=i.defaultFontFamily,r.fontSize=i.defaultCaptionFontSize,r.captionText=i.defaultCaptionText,r.setStrokeColor=r.setStrokeColor.bind(r),r.setFillColor=r.setFillColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.createVisual=r.createVisual.bind(r),r.sizeCaption=r.sizeCaption.bind(r),r.setCaptionText=r.setCaptionText.bind(r),r.showTextEditor=r.showTextEditor.bind(r),r.positionTextEditor=r.positionTextEditor.bind(r),r.finishTextEditing=r.finishTextEditing.bind(r),r.setFont=r.setFont.bind(r),r.setTextColor=r.setTextColor.bind(r),r.strokePanel=new y("Line color",l(i.defaultColorSet,["transparent"]),r.strokeColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.fillPanel=new y("Fill color",l(i.defaultColorSet,["transparent"]),r.fillColor,Z),r.fillPanel.onColorChanged=r.setFillColor,r.strokeWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new M("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r.fontFamilyPanel=new P("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r.textColorPanel=new y("Text color",i.defaultColorSet,r.textColor,F),r.textColorPanel.onColorChanged=r.setTextColor,r}return r(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.frame&&t!==this.captionBg&&t!==this.captionElement)},t.prototype.createVisual=function(){this.visual=s.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=s.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=s.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=s.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()},t.prototype.setCaptionText=function(e){this.captionText=e,this.captionElement.textContent=this.captionText,this.sizeCaption()},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),this.isMoved=!1,this.pointerDownPoint=t,this.pointerDownTimestamp=Date.now(),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t),void 0!==this.pointerDownPoint&&(this.isMoved=Math.abs(t.x-this.pointerDownPoint.x)>5||Math.abs(t.y-this.pointerDownPoint.y)>5)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.setSize()},t.prototype.sizeCaption=function(){var e=this.captionElement.getBBox();""!==this.captionText.trim()?(this.captionBoxWidth=e.width+2*this.PADDING,this.captionBoxHeight=e.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),s.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')"]]),s.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')"]])},t.prototype.showTextEditor=function(){var e=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(e){e.stopPropagation()})),this.textEditBox.addEventListener("keypress",(function(t){"Enter"===t.key&&e.finishTextEditing(e.textEditBox.value)})),this.textEditBox.addEventListener("keyup",(function(e){e.cancelBubble=!0})),this.textEditBox.addEventListener("blur",(function(){e.finishTextEditing(e.textEditBox.value)})),this.textEditDiv.addEventListener("pointerup",(function(){e.finishTextEditing(e.textEditBox.value)})),this.positionTextEditor(),this.textEditBox.focus()},t.prototype.positionTextEditor=function(){"edit"===this.state&&(void 0===this.textEditBox?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"))},t.prototype.finishTextEditing=function(e){this.setCaptionText(e.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},t.prototype.setFont=function(e){this.captionElement&&s.setAttributes(this.captionElement,[["font-family",e]]),this.fontFamily=e,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},t.prototype.setTextColor=function(e){this.captionElement&&s.setAttributes(this.captionElement,[["fill",e]]),this.textColor=e,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},t.prototype.setSize=function(){e.prototype.setSize.call(this),s.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},t.prototype.pointerUp=function(t){e.prototype.pointerUp.call(this,t),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},t.prototype.dblClick=function(t,n){e.prototype.dblClick.call(this,t,n),this.showTextEditor()},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.frame&&s.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(e),this.stateChanged()},t.prototype.setFillColor=function(e){this.fillColor=e,this.captionBg&&s.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(e),this.stateChanged()},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.frame&&s.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.frame&&s.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var t=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},e.prototype.getState.call(this));return t.typeName=this.typeName,t},t.prototype.restoreState=function(t){var n=t;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.textColor=n.textColor,this.fontFamily=n.fontFamily,this.captionText=n.captionText,this.fontSize=n.fontSize,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setSize()},t.typeName="CaptionFrameMarker",t.title="Caption frame marker",t.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>',t}(k),K=function(){function e(e,t){void 0===t&&(t=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=e,this.cancelable=t}return Object.defineProperty(e.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){this._defaultPrevented=!0},e}(),Y=function(e){function t(t,n,i){var r=e.call(this,t,!1)||this;return r.dataUrl=n,r.state=i,r}return r(t,e),t}(K),X=function(e){function t(t,n,i){void 0===i&&(i=!1);var r=e.call(this,t,i)||this;return r.marker=n,r}return r(t,e),t}(K),J=function(){function e(){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 e.prototype.addEventListener=function(e,t){this[e].push(t)},e.prototype.removeEventListener=function(e,t){var n=this[e].indexOf(t);n>-1&&this[e].splice(n,1)},e}(),Q=function(){function e(t){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new L,this._isOpen=!1,this.undoRedoManager=new V,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 J,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=e.instanceCounter++,this.styles=new d(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=t,this.targetRoot=document.body,this.width=t.clientWidth,this.height=t.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(e.prototype,"ALL_MARKER_TYPES",{get:function(){return[T,B,I,N,G,H,j,z,W,O,D,U,q]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[T,B,I,N,H,j,z]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"BASIC_MARKER_TYPES",{get:function(){return[T,B,I,N,j]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(e){var t=this;this._availableMarkerTypes.splice(0),e.forEach((function(e){if("string"==typeof e){var n=t.ALL_MARKER_TYPES.find((function(t){return t.typeName===e}));void 0!==n&&t._availableMarkerTypes.push(n)}else t._availableMarkerTypes.push(e)}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(e){this._zoomLevel=e,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(e.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),e.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),"popup"===this.settings.displayMode&&this.onPopupTargetResize(),c.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},e.prototype.show=function(){var e=this;void 0===this.styles.styleSheetRoot&&void 0!==h.styleSheetRoot&&(this.styles.styleSheetRoot=h.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach((function(t){return t(new K(e))}))},e.prototype.render=function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return this.setCurrentMarker(),(e=new u).naturalSize=this.renderAtNaturalSize,e.imageType=this.renderImageType,e.imageQuality=this.renderImageQuality,e.markersOnly=this.renderMarkersOnly,e.width=this.renderWidth,e.height=this.renderHeight,[4,e.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return t.sent(),[4,e.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,t.sent()]}}))}))},e.prototype.close=function(e){var t=this;if(void 0===e&&(e=!1),this.isOpen){var n=!1;e||this.eventListeners.beforeclose.forEach((function(e){var i=new K(t,!0);e(i),i.defaultPrevented&&(n=!0)})),n||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),"popup"===this.settings.displayMode&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach((function(e){return e(new K(t))})),this.detachEvents(),this._isOpen=!1)}},e.prototype.addMarkersToToolbar=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];(e=this._availableMarkerTypes).push.apply(e,t)},e.prototype.addRenderEventListener=function(e){this.addEventListener("render",(function(t){e(t.dataUrl,t.state)}))},e.prototype.removeRenderEventListener=function(e){},e.prototype.addCloseEventListener=function(e){this.addEventListener("close",(function(){e()}))},e.prototype.removeCloseEventListener=function(e){},e.prototype.setupResizeObserver=function(){var e=this;"inline"===this.settings.displayMode?window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){e.resize(e.target.clientWidth,e.target.clientHeight)})),this.targetObserver.observe(this.target)):"popup"===this.settings.displayMode&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){return e.onPopupTargetResize()})),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},e.prototype.onPopupTargetResize=function(){var e=1*this.target.clientWidth/this.target.clientHeight,t=this.editorCanvas.clientWidth/e>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*e:this.editorCanvas.clientWidth,n=t<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/e;this.resize(t,n)},e.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},e.prototype.resize=function(e,t){this._isResizing=!0;var n=e/this.imageWidth,i=t/this.imageHeight;this.imageWidth=Math.round(e),this.imageHeight=Math.round(t),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","popup"!==this.settings.displayMode?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),void 0!==this.toolbar&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(n,i),this._isResizing=!1},e.prototype.scaleMarkers=function(e,t){var n,i=this;this._currentMarker&&this._currentMarker instanceof N?this._currentMarker.scale(e,t):(n=this._currentMarker,this.setCurrentMarker()),this.markers.forEach((function(n){n!==i._currentMarker&&n.scale(e,t)})),void 0!==n&&this.setCurrentMarker(n)},e.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"},e.prototype.setTopLeft=function(){var e=this.editingTarget.getBoundingClientRect(),t=this.editorCanvas.getBoundingClientRect();this.left=e.left-t.left,this.top=e.top-t.top},e.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)},e.prototype.addDefs=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.defs=s.createDefs(),this.addDefsToImage(),(e=this.defs).append.apply(e,t)},e.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},e.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)},e.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},e.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},e.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)},e.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},e.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)},e.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 e=document.createElement("a");e.href="https://markerjs.com/",e.target="_blank",e.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>',e.title="Powered by marker.js",e.style.display="grid",e.style.alignItems="center",e.style.justifyItems="center",e.style.padding="3px",e.style.width="20px",e.style.height="20px",this.logoUI.appendChild(e),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},e.prototype.positionLogo=function(){this.logoUI&&("right"!==this.uiStyleSettings.logoPosition?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")},e.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"},e.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},e.prototype.showUI=function(){switch("popup"===this.settings.displayMode&&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 e=void 0!==this.settings.uiOffsetTop?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=e+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=void 0!==this.uiStyleSettings.zIndex?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=void 0!==this.uiStyleSettings.zIndex?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="popup"===this.settings.displayMode?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new m(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","popup"===this.settings.displayMode&&(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","popup"===this.settings.displayMode&&(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"),void 0===this.settings.uiOffsetTop&&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 v(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},e.prototype.closeUI=function(){"popup"===this.settings.displayMode&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},e.prototype.removeMarker=function(e){this.markerImage.removeChild(e.container),this.markers.indexOf(e)>-1&&this.markers.splice(this.markers.indexOf(e),1),e.dispose()},e.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),void 0!==this._currentMarker&&("new"!==this._currentMarker.state?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},e.prototype.toolbarButtonClicked=function(e,t){if("marker"===e&&void 0!==t)this.createNewMarker(t);else if("action"===e)switch(t){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":void 0===this.notesArea?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},e.prototype.deleteSelectedMarker=function(){var e=this;if(void 0!==this._currentMarker){var t=!1;if(this.eventListeners.markerbeforedelete.forEach((function(n){var i=new X(e,e._currentMarker,!0);n(i),i.defaultPrevented&&(t=!0)})),!t){var n=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(t){return t(new X(e,n))}))}}},e.prototype.clear=function(){var e=this,t=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach((function(n){var i=new X(e,void 0,!0);n(i),i.defaultPrevented&&(t=!0)})),!t)){this.setCurrentMarker();for(var n=function(t){var n=i.markers[t];i.setCurrentMarker(i.markers[t]),i._currentMarker.dispose(),i.markerImage.removeChild(i._currentMarker.container),i.markers.splice(i.markers.indexOf(i._currentMarker),1),i.eventListeners.markerdelete.forEach((function(t){return t(new X(e,n))}))},i=this,r=this.markers.length-1;r>=0;r--)n(r);this.addUndoStep()}},Object.defineProperty(e.prototype,"isNotesAreaOpen",{get:function(){return void 0!==this.notesArea},enumerable:!1,configurable:!0}),e.prototype.showNotesEditor=function(){var e;void 0!==this._currentMarker&&(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=null!==(e=this._currentMarker.notes)&&void 0!==e?e:"",this.overlayContainer.appendChild(this.notesArea))},e.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(void 0!==this._currentMarker&&(this._currentMarker.notes=""!==this.notesArea.value.trim()?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},e.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},e.prototype.addUndoStep=function(){var e=this;if(void 0===this._currentMarker||"edit"!==this._currentMarker.state){var t=this.getState(),n=this.undoRedoManager.getLastUndoStep();if(!n||n.width===t.width&&n.height===t.height){var i=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(t),i<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach((function(t){return t(new K(e))}))}else this.undoRedoManager.replaceLastUndoStep(t),this.eventListeners.statechange.forEach((function(t){return t(new K(e))}))}},e.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},e.prototype.undoStep=function(){var e=this,t=this.undoRedoManager.undo();void 0!==t&&(this.restoreState(t),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach((function(t){return t(new K(e))})))},e.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},e.prototype.redoStep=function(){var e=this,t=this.undoRedoManager.redo();void 0!==t&&(this.restoreState(t),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach((function(t){return t(new K(e))})))},e.prototype.stepZoom=function(){var e=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=e<this.zoomSteps.length-1?this.zoomSteps[e+1]:this.zoomSteps[0]},e.prototype.panTo=function(e){this.contentDiv.scrollBy({left:this.prevPanPoint.x-e.x,top:this.prevPanPoint.y-e.y}),this.prevPanPoint=e},e.prototype.startRenderAndClose=function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(i){switch(i.label){case 0:return[4,this.render()];case 1:return e=i.sent(),t=this.getState(),this.eventListeners.render.forEach((function(i){return i(new Y(n,e,t))})),this.close(!0),[2]}}))}))},e.prototype.getState=function(e){!0===e&&this.setCurrentMarker();var t={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach((function(e){return t.markers.push(e.getState())})),t},e.prototype.restoreState=function(e){var t=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);e.markers.forEach((function(e){var n=t._availableMarkerTypes.find((function(t){return t.typeName===e.typeName}));if(void 0!==n){var i=t.addNewMarker(n);i.restoreState(e),t.markers.push(i)}})),e.width&&e.height&&(e.width!==this.imageWidth||e.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/e.width,this.imageHeight/e.height),this.eventListeners.restorestate.forEach((function(e){return e(new K(t))}))},e.prototype.addNewMarker=function(e){var t=s.createGroup();return this.markerImage.appendChild(t),new e(t,this.overlayContainer,this.settings)},e.prototype.createNewMarker=function(e){var t,n=this;(t="string"==typeof e?this._availableMarkerTypes.find((function(t){return t.typeName===e})):e)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(t),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(t.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach((function(e){return e(new X(n,n._currentMarker))})))},e.prototype.markerCreated=function(e){var t=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(e),this.setCurrentMarker(e),e instanceof B&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(B):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach((function(e){return e(new X(t,t._currentMarker))}))},e.prototype.colorChanged=function(e){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=e,this.settings.defaultStrokeColor=e)},e.prototype.fillColorChanged=function(e){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=e)},e.prototype.markerStateChanged=function(e){var t=this;this.eventListeners.markerchange.forEach((function(n){return n(new X(t,e))}))},e.prototype.setCurrentMarker=function(e){var t=this;this._currentMarker!==e&&void 0!==this._currentMarker&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach((function(e){return e(new X(t,t._currentMarker))}))),this._currentMarker=e,void 0===this._currentMarker||this._currentMarker.isSelected||("new"!==this._currentMarker.state&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach((function(e){return e(new X(t,t._currentMarker))})))},e.prototype.onPointerDown=function(e){if(this._isFocused||this.focus(),this.touchPoints++,1===this.touchPoints||"touch"!==e.pointerType)if(void 0===this._currentMarker||"new"!==this._currentMarker.state&&"creating"!==this._currentMarker.state){if("select"===this.mode){var t=this.markers.find((function(t){return t.ownsTarget(e.target)}));void 0!==t?(this.setCurrentMarker(t),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(e.clientX,e.clientY),e.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:e.clientX,y:e.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(e.clientX,e.clientY))},e.prototype.onDblClick=function(e){if(this._isFocused||this.focus(),"select"===this.mode){var t=this.markers.find((function(t){return t.ownsTarget(e.target)}));void 0!==t&&t!==this._currentMarker&&this.setCurrentMarker(t),void 0!==this._currentMarker?this._currentMarker.dblClick(this.clientToLocalCoordinates(e.clientX,e.clientY),e.target):this.setCurrentMarker()}},e.prototype.onPointerMove=function(e){1!==this.touchPoints&&"touch"===e.pointerType||(void 0!==this._currentMarker||this.isDragging)&&(void 0!==this._currentMarker&&"edit"===this._currentMarker.state||e.preventDefault(),void 0!==this._currentMarker?this._currentMarker.manipulate(this.clientToLocalCoordinates(e.clientX,e.clientY)):this.zoomLevel>1&&this.panTo({x:e.clientX,y:e.clientY}))},e.prototype.onPointerUp=function(e){this.touchPoints>0&&this.touchPoints--,0===this.touchPoints&&this.isDragging&&void 0!==this._currentMarker&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(e.clientX,e.clientY)),this.isDragging=!1,this.addUndoStep()},e.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},e.prototype.onKeyUp=function(e){void 0===this._currentMarker||void 0!==this.notesArea||"Delete"!==e.key&&"Backspace"!==e.key||this.deleteSelectedMarker()},e.prototype.clientToLocalCoordinates=function(e,t){var n=this.markerImage.getBoundingClientRect();return{x:(e-n.left)/this.zoomLevel,y:(t-n.top)/this.zoomLevel}},e.prototype.onWindowResize=function(){this.positionUI()},e.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var e=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=e+"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()},e.prototype.addLicenseKey=function(e){c.addKey(e)},e.prototype.addEventListener=function(e,t){this.eventListeners.addEventListener(e,t)},e.prototype.removeEventListener=function(e,t){this.eventListeners.removeEventListener(e,t)},e.prototype.renderState=function(e){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(e),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(e.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),e.prototype.focus=function(){var e=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,void 0!==this._previousCurrentMarker&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach((function(t){return t(new K(e))})))},e.prototype.blur=function(){var e=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach((function(t){return t(new K(e))})))},e.instanceCounter=0,e}()},63727:function(e,t,n){"use strict";n.d(t,{s:function(){return Q},default:function(){return te}});var i=n(54476),r=n(33885),o=n(94480),a=n(42978),l=n(75931),s=n(37463),c=n(6551),u=n(6089),h=n(18929),d=n(59301),p=d.createContext({}),f=n(76190),m=n(20068),v="__rc_cascader_search_mark__",g=function(e,t,n){var i=n.label,r=void 0===i?"":i;return t.some((function(t){return String(t[r]).toLowerCase().includes(e.toLowerCase())}))},y=function(e,t,n,i){return t.map((function(e){return e[i.label]})).join(" / ")},b=function(e,t,n,i,a,l){var s=a.filter,c=void 0===s?g:s,u=a.render,h=void 0===u?y:u,p=a.limit,f=void 0===p?50:p,b=a.sort;return d.useMemo((function(){var a=[];if(!e)return[];return function t(s,u){var d=arguments.length>2&&void 0!==arguments[2]&&arguments[2];s.forEach((function(s){if(!(!b&&!1!==f&&f>0&&a.length>=f)){var p,g=[].concat((0,o.Z)(u),[s]),y=s[n.children],x=d||s.disabled;if(!y||0===y.length||l)if(c(e,g,{label:n.label}))a.push((0,r.Z)((0,r.Z)({},s),{},(p={disabled:x},(0,m.Z)(p,n.label,h(e,g,i,n)),(0,m.Z)(p,v,g),(0,m.Z)(p,n.children,void 0),p)));y&&t(s[n.children],g,x)}}))}(t,[]),b&&a.sort((function(t,i){return b(t[v],i[v],e,n)})),!1!==f&&f>0?a.slice(0,f):a}),[e,t,n,i,h,l,c,b,f])},x="__RC_CASCADER_SPLIT__",w="SHOW_PARENT",C="SHOW_CHILD";function k(e){return e.join(x)}function S(e){return e.map(k)}function E(e){var t=e||{},n=t.label,i=t.value||"value";return{label:n||"label",value:i,key:i,children:t.children||"children"}}function M(e,t){var n,i;return null!==(n=e.isLeaf)&&void 0!==n?n:!(null!==(i=e[t.children])&&void 0!==i&&i.length)}function T(e){var t=e.parentElement;if(t){var n=e.offsetTop-t.offsetTop;n-t.scrollTop<0?t.scrollTo({top:n}):n+e.offsetHeight-t.scrollTop>t.offsetHeight&&t.scrollTo({top:n+e.offsetHeight-t.offsetHeight})}}function L(e,t){return e.map((function(e){var n;return null===(n=e[v])||void 0===n?void 0:n.map((function(e){return e[t.value]}))}))}function A(e){return e?function(e){return Array.isArray(e)&&Array.isArray(e[0])}(e)?e:(0===e.length?[]:[e]).map((function(e){return Array.isArray(e)?e:[e]})):[]}function D(e,t,n){var i=new Set(e),r=t();return e.filter((function(e){var t=r[e],o=t?t.parent:null,a=t?t.children:null;return!(!t||!t.node.disabled)||(n===C?!(a&&a.some((function(e){return e.key&&i.has(e.key)}))):!(o&&!o.node.disabled&&i.has(o.key)))}))}function P(e,t,n){for(var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t,o=[],a=function(){var t,a,s,c=e[l],u=null===(t=r)||void 0===t?void 0:t.findIndex((function(e){var t=e[n.value];return i?String(t)===String(c):t===c})),h=-1!==u?null===(a=r)||void 0===a?void 0:a[u]:null;o.push({value:null!==(s=null==h?void 0:h[n.value])&&void 0!==s?s:c,index:u,option:h}),r=null==h?void 0:h[n.children]},l=0;l<e.length;l+=1)a();return o}function N(e,t){return d.useCallback((function(n){var i=[],r=[];return n.forEach((function(n){P(n,e,t).every((function(e){return e.option}))?r.push(n):i.push(n)})),[r,i]}),[e,t])}var B=n(34061);function _(e,t){var n=d.useMemo((function(){return t||[]}),[t]),i=function(e,t){var n=d.useRef({options:[],info:{keyEntities:{},pathKeyEntities:{}}});return d.useCallback((function(){return n.current.options!==e&&(n.current.options=e,n.current.info=(0,B.I8)(e,{fieldNames:t,initWrapper:function(e){return(0,r.Z)((0,r.Z)({},e),{},{pathKeyEntities:{}})},processEntity:function(e,n){var i=e.nodes.map((function(e){return e[t.value]})).join(x);n.pathKeyEntities[i]=e,e.key=i}})),n.current.info.pathKeyEntities}),[t,e])}(n,e),o=d.useCallback((function(t){var n=i();return t.map((function(t){return n[t].nodes.map((function(t){return t[e.value]}))}))}),[i,e]);return[n,i,o]}n(48736);var I=n(34643);function O(e,t,n,i,r,a,l,s){return function(c){if(e){var u=k(c),h=S(n),d=S(i),p=h.includes(u),f=r.some((function(e){return k(e)===u})),m=n,v=r;if(f&&!p)v=r.filter((function(e){return k(e)!==u}));else{var g,y=p?h.filter((function(e){return e!==u})):[].concat((0,o.Z)(h),[u]),b=a();if(p)g=(0,I.S)(y,{checked:!1,halfCheckedKeys:d},b).checkedKeys;else g=(0,I.S)(y,!0,b).checkedKeys;var x=D(g,a,s);m=l(x)}t([].concat((0,o.Z)(v),(0,o.Z)(m)))}else t(c)}}function R(e,t,n,i,r){return d.useMemo((function(){var o=r(t),l=(0,a.Z)(o,2),s=l[0],c=l[1];if(!e||!t.length)return[s,[],c];var u=S(s),h=n(),d=(0,I.S)(u,!0,h),p=d.checkedKeys,f=d.halfCheckedKeys;return[i(p),i(f),c]}),[e,t,n,i,r])}var j=n(92310),F=n.n(j);var Z=d.memo((function(e){return e.children}),(function(e,t){return!t.open}));function z(e){var t,n=e.prefixCls,i=e.checked,r=e.halfChecked,o=e.disabled,a=e.onClick,l=e.disableCheckbox,s=d.useContext(p).checkable,c="boolean"!=typeof s?s:null;return d.createElement("span",{className:F()("".concat(n),(t={},(0,m.Z)(t,"".concat(n,"-checked"),i),(0,m.Z)(t,"".concat(n,"-indeterminate"),!i&&r),(0,m.Z)(t,"".concat(n,"-disabled"),o||l),t)),onClick:a},c)}var H="__cascader_fix_label__";function W(e){var t=e.prefixCls,n=e.multiple,i=e.options,r=e.activeValue,a=e.prevValuePath,l=e.onToggleOpen,s=e.onSelect,c=e.onActive,u=e.checkedSet,h=e.halfCheckedSet,f=e.loadingKeys,g=e.isSelectable,y=e.disabled,b="".concat(t,"-menu"),x="".concat(t,"-menu-item"),w=d.useContext(p),C=w.fieldNames,S=w.changeOnSelect,E=w.expandTrigger,T=w.expandIcon,L=w.loadingIcon,A=w.dropdownMenuColumnStyle,D=w.optionRender,P="hover"===E,N=function(e){return y||e},B=d.useMemo((function(){return i.map((function(e){var t,n=e.disabled,i=e.disableCheckbox,r=e[v],l=null!==(t=e[H])&&void 0!==t?t:e[C.label],s=e[C.value],c=M(e,C),d=r?r.map((function(e){return e[C.value]})):[].concat((0,o.Z)(a),[s]),p=k(d);return{disabled:n,label:l,value:s,isLeaf:c,isLoading:f.includes(p),checked:u.has(p),halfChecked:h.has(p),option:e,disableCheckbox:i,fullPath:d,fullPathKey:p}}))}),[i,u,C,h,f,a]);return d.createElement("ul",{className:b,role:"menu"},B.map((function(e){var i,a,u=e.disabled,h=e.label,p=e.value,f=e.isLeaf,v=e.isLoading,y=e.checked,b=e.halfChecked,w=e.option,C=e.fullPath,k=e.fullPathKey,E=e.disableCheckbox,M=function(){if(!N(u)){var e=(0,o.Z)(C);P&&f&&e.pop(),c(e)}},B=function(){g(w)&&!N(u)&&s(C,f)};return"string"==typeof w.title?a=w.title:"string"==typeof h&&(a=h),d.createElement("li",{key:k,className:F()(x,(i={},(0,m.Z)(i,"".concat(x,"-expand"),!f),(0,m.Z)(i,"".concat(x,"-active"),r===p||r===k),(0,m.Z)(i,"".concat(x,"-disabled"),N(u)),(0,m.Z)(i,"".concat(x,"-loading"),v),i)),style:A,role:"menuitemcheckbox",title:a,"aria-checked":y,"data-path-key":k,onClick:function(){M(),E||n&&!f||B()},onDoubleClick:function(){S&&l(!1)},onMouseEnter:function(){P&&M()},onMouseDown:function(e){e.preventDefault()}},n&&d.createElement(z,{prefixCls:"".concat(t,"-checkbox"),checked:y,halfChecked:b,disabled:N(u)||E,disableCheckbox:E,onClick:function(e){E||(e.stopPropagation(),B())}}),d.createElement("div",{className:"".concat(x,"-content")},D?D(w):h),!v&&T&&!f&&d.createElement("div",{className:"".concat(x,"-expand-icon")},T),v&&L&&d.createElement("div",{className:"".concat(x,"-loading-icon")},L))})))}var G=function(e,t){var n=d.useContext(p).values[0],i=d.useState([]),r=(0,a.Z)(i,2),o=r[0],l=r[1];return d.useEffect((function(){e||l(n||[])}),[t,n]),[o,l]},V=n(10228),U=function(e,t,n,i,r,l,s){var c=s.direction,u=s.searchValue,h=s.toggleOpen,p=s.open,f="rtl"===c,m=d.useMemo((function(){for(var e=-1,r=t,o=[],a=[],l=i.length,s=L(t,n),c=function(t){var l=r.findIndex((function(e,r){return(s[r]?k(s[r]):e[n.value])===i[t]}));if(-1===l)return 1;e=l,o.push(e),a.push(i[t]),r=r[e][n.children]},u=0;u<l&&r&&!c(u);u+=1);for(var h=t,d=0;d<o.length-1;d+=1)h=h[o[d]][n.children];return[a,e,h,s]}),[i,n,t]),g=(0,a.Z)(m,4),y=g[0],b=g[1],x=g[2],w=g[3],C=function(e){r(e)},S=function(){if(y.length>1){var e=y.slice(0,-1);C(e)}else h(!1)},E=function(){var e,t=((null===(e=x[b])||void 0===e?void 0:e[n.children])||[]).find((function(e){return!e.disabled}));if(t){var i=[].concat((0,o.Z)(y),[t[n.value]]);C(i)}};d.useImperativeHandle(e,(function(){return{onKeyDown:function(e){var t=e.which;switch(t){case V.Z.UP:case V.Z.DOWN:var i=0;t===V.Z.UP?i=-1:t===V.Z.DOWN&&(i=1),0!==i&&function(e){var t=x.length,i=b;-1===i&&e<0&&(i=t);for(var r=0;r<t;r+=1){var o=x[i=(i+e+t)%t];if(o&&!o.disabled){var a=y.slice(0,-1).concat(w[i]?k(w[i]):o[n.value]);return void C(a)}}}(i);break;case V.Z.LEFT:if(u)break;f?E():S();break;case V.Z.RIGHT:if(u)break;f?S():E();break;case V.Z.BACKSPACE:u||S();break;case V.Z.ENTER:if(y.length){var r=x[b],o=(null==r?void 0:r[v])||[];o.length?l(o.map((function(e){return e[n.value]})),o[o.length-1]):l(y,x[b])}break;case V.Z.ESC:h(!1),p&&e.stopPropagation()}},onKeyUp:function(){}}}))},q=d.forwardRef((function(e,t){var n,l,s,c=e.prefixCls,u=e.multiple,h=e.searchValue,f=e.toggleOpen,v=e.notFoundContent,g=e.direction,y=e.open,b=e.disabled,w=d.useRef(null),C="rtl"===g,E=d.useContext(p),A=E.options,D=E.values,N=E.halfValues,B=E.fieldNames,_=E.changeOnSelect,I=E.onSelect,O=E.searchOptions,R=E.dropdownPrefixCls,j=E.loadData,z=E.expandTrigger,V=R||c,q=d.useState([]),K=(0,a.Z)(q,2),Y=K[0],X=K[1];d.useEffect((function(){Y.length&&Y.forEach((function(e){var t=P(e.split(x),A,B,!0).map((function(e){return e.option})),n=t[t.length-1];(!n||n[B.children]||M(n,B))&&X((function(t){return t.filter((function(t){return t!==e}))}))}))}),[A,Y,B]);var J=d.useMemo((function(){return new Set(S(D))}),[D]),Q=d.useMemo((function(){return new Set(S(N))}),[N]),$=G(u,y),ee=(0,a.Z)($,2),te=ee[0],ne=ee[1],ie=function(e){ne(e),function(e){if(j&&!h){var t=P(e,A,B).map((function(e){return e.option})),n=t[t.length-1];if(n&&!M(n,B)){var i=k(e);X((function(e){return[].concat((0,o.Z)(e),[i])})),j(t)}}}(e)},re=function(e){if(b)return!1;var t=e.disabled,n=M(e,B);return!t&&(n||_||u)},oe=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];I(e),!u&&(t||_&&("hover"===z||n))&&f(!1)},ae=d.useMemo((function(){return h?O:A}),[h,O,A]),le=d.useMemo((function(){for(var e=[{options:ae}],t=ae,n=L(t,B),i=function(){var i=te[r],o=t.find((function(e,t){return(n[t]?k(n[t]):e[B.value])===i})),a=null==o?void 0:o[B.children];if(null==a||!a.length)return 1;t=a,e.push({options:a})},r=0;r<te.length&&!i();r+=1);return e}),[ae,te,B]);U(t,ae,B,te,ie,(function(e,t){re(t)&&oe(e,M(t,B),!0)}),{direction:g,searchValue:h,toggleOpen:f,open:y}),d.useEffect((function(){if(!h)for(var e=0;e<te.length;e+=1){var t,n=k(te.slice(0,e+1)),i=null===(t=w.current)||void 0===t?void 0:t.querySelector('li[data-path-key="'.concat(n.replace(/\\{0,2}"/g,'\\"'),'"]'));i&&T(i)}}),[te,h]);var se=!(null!==(n=le[0])&&void 0!==n&&null!==(n=n.options)&&void 0!==n&&n.length),ce=[(l={},(0,m.Z)(l,B.value,"__EMPTY__"),(0,m.Z)(l,H,v),(0,m.Z)(l,"disabled",!0),l)],ue=(0,r.Z)((0,r.Z)({},e),{},{multiple:!se&&u,onSelect:oe,onActive:ie,onToggleOpen:f,checkedSet:J,halfCheckedSet:Q,loadingKeys:Y,isSelectable:re}),he=(se?[{options:ce}]:le).map((function(e,t){var n=te.slice(0,t),r=te[t];return d.createElement(W,(0,i.Z)({key:t},ue,{prefixCls:V,options:e.options,prevValuePath:n,activeValue:r}))}));return d.createElement(Z,{open:y},d.createElement("div",{className:F()("".concat(V,"-menus"),(s={},(0,m.Z)(s,"".concat(V,"-menu-empty"),se),(0,m.Z)(s,"".concat(V,"-rtl"),C),s)),ref:w},he))}));var K=q,Y=d.forwardRef((function(e,t){var n=(0,s.lk)();return d.createElement(K,(0,i.Z)({},e,n,{ref:t}))})),X=n(70425);function J(){}function Q(e){var t,n=e,i=n.prefixCls,r=void 0===i?"rc-cascader":i,o=n.style,l=n.className,s=n.options,c=n.checkable,u=n.defaultValue,h=n.value,f=n.fieldNames,v=n.changeOnSelect,g=n.onChange,y=n.showCheckedStrategy,b=n.loadData,x=n.expandTrigger,w=n.expandIcon,C=void 0===w?">":w,k=n.loadingIcon,S=n.direction,M=n.notFoundContent,T=void 0===M?"Not Found":M,L=n.disabled,D=!!c,B=(0,X.C8)(u,{value:h,postState:A}),I=(0,a.Z)(B,2),j=I[0],Z=I[1],z=d.useMemo((function(){return E(f)}),[JSON.stringify(f)]),H=_(z,s),W=(0,a.Z)(H,3),G=W[0],V=W[1],U=W[2],q=N(G,z),Y=R(D,j,V,U,q),Q=(0,a.Z)(Y,3),$=Q[0],ee=Q[1],te=Q[2],ne=(0,X.zX)((function(e){if(Z(e),g){var t=A(e),n=t.map((function(e){return P(e,G,z).map((function(e){return e.option}))})),i=D?t:t[0],r=D?n:n[0];g(i,r)}})),ie=O(D,ne,$,ee,te,V,U,y),re=(0,X.zX)((function(e){ie(e)})),oe=d.useMemo((function(){return{options:G,fieldNames:z,values:$,halfValues:ee,changeOnSelect:v,onSelect:re,checkable:c,searchOptions:[],dropdownPrefixCls:void 0,loadData:b,expandTrigger:x,expandIcon:C,loadingIcon:k,dropdownMenuColumnStyle:void 0}}),[G,z,$,ee,v,re,c,b,x,C,k]),ae="".concat(r,"-panel"),le=!G.length;return d.createElement(p.Provider,{value:oe},d.createElement("div",{className:F()(ae,(t={},(0,m.Z)(t,"".concat(ae,"-rtl"),"rtl"===S),(0,m.Z)(t,"".concat(ae,"-empty"),le),t),l),style:o},le?T:d.createElement(K,{prefixCls:r,searchValue:"",multiple:D,toggleOpen:J,open:!0,direction:S,disabled:L})))}var $=["id","prefixCls","fieldNames","defaultValue","value","changeOnSelect","onChange","displayRender","checkable","autoClearSearchValue","searchValue","onSearch","showSearch","expandTrigger","options","dropdownPrefixCls","loadData","popupVisible","open","popupClassName","dropdownClassName","dropdownMenuColumnStyle","dropdownStyle","popupPlacement","placement","onDropdownVisibleChange","onPopupVisibleChange","expandIcon","loadingIcon","children","dropdownMatchSelectWidth","showCheckedStrategy","optionRender"],ee=d.forwardRef((function(e,t){var n=e.id,m=e.prefixCls,v=void 0===m?"rc-cascader":m,g=e.fieldNames,y=e.defaultValue,x=e.value,C=e.changeOnSelect,M=e.onChange,T=e.displayRender,L=e.checkable,B=e.autoClearSearchValue,I=void 0===B||B,j=e.searchValue,F=e.onSearch,Z=e.showSearch,z=e.expandTrigger,H=e.options,W=e.dropdownPrefixCls,G=e.loadData,V=e.popupVisible,U=e.open,q=e.popupClassName,K=e.dropdownClassName,X=e.dropdownMenuColumnStyle,J=e.dropdownStyle,Q=e.popupPlacement,ee=e.placement,te=e.onDropdownVisibleChange,ne=e.onPopupVisibleChange,ie=e.expandIcon,re=void 0===ie?">":ie,oe=e.loadingIcon,ae=e.children,le=e.dropdownMatchSelectWidth,se=void 0!==le&&le,ce=e.showCheckedStrategy,ue=void 0===ce?w:ce,he=e.optionRender,de=(0,l.Z)(e,$),pe=(0,c.ZP)(n),fe=!!L,me=(0,h.Z)(y,{value:x,postState:A}),ve=(0,a.Z)(me,2),ge=ve[0],ye=ve[1],be=d.useMemo((function(){return E(g)}),[JSON.stringify(g)]),xe=_(be,H),we=(0,a.Z)(xe,3),Ce=we[0],ke=we[1],Se=we[2],Ee=(0,h.Z)("",{value:j,postState:function(e){return e||""}}),Me=(0,a.Z)(Ee,2),Te=Me[0],Le=Me[1],Ae=function(e){return d.useMemo((function(){if(!e)return[!1,{}];var t={matchInputWidth:!0,limit:50};return e&&"object"===(0,f.Z)(e)&&(t=(0,r.Z)((0,r.Z)({},t),e)),t.limit<=0&&(t.limit=!1),[!0,t]}),[e])}(Z),De=(0,a.Z)(Ae,2),Pe=De[0],Ne=De[1],Be=b(Te,Ce,be,W||v,Ne,C||fe),_e=N(Ce,be),Ie=R(fe,ge,ke,Se,_e),Oe=(0,a.Z)(Ie,3),Re=Oe[0],je=Oe[1],Fe=Oe[2],Ze=function(e,t,n,i,r){return d.useMemo((function(){var a=r||function(e){var t=i?e.slice(-1):e;return t.every((function(e){return["string","number"].includes((0,f.Z)(e))}))?t.join(" / "):t.reduce((function(e,t,n){var i=d.isValidElement(t)?d.cloneElement(t,{key:n}):t;return 0===n?[i]:[].concat((0,o.Z)(e),[" / ",i])}),[])};return e.map((function(e){var i,r=P(e,t,n),o=a(r.map((function(e){var t,i=e.option,r=e.value;return null!==(t=null==i?void 0:i[n.label])&&void 0!==t?t:r})),r.map((function(e){return e.option}))),l=k(e);return{label:o,value:l,key:l,valueCells:e,disabled:null===(i=r[r.length-1])||void 0===i||null===(i=i.option)||void 0===i?void 0:i.disabled}}))}),[e,t,n,r,i])}(d.useMemo((function(){var e=D(S(Re),ke,ue);return[].concat((0,o.Z)(Fe),(0,o.Z)(Se(e)))}),[Re,ke,Se,Fe,ue]),Ce,be,fe,T),ze=(0,u.Z)((function(e){if(ye(e),M){var t=A(e),n=t.map((function(e){return P(e,Ce,be).map((function(e){return e.option}))})),i=fe?t:t[0],r=fe?n:n[0];M(i,r)}})),He=O(fe,ze,Re,je,Fe,ke,Se,ue),We=(0,u.Z)((function(e){fe&&!I||Le(""),He(e)})),Ge=void 0!==U?U:V,Ve=K||q,Ue=ee||Q;var qe=d.useMemo((function(){return{options:Ce,fieldNames:be,values:Re,halfValues:je,changeOnSelect:C,onSelect:We,checkable:L,searchOptions:Be,dropdownPrefixCls:W,loadData:G,expandTrigger:z,expandIcon:re,loadingIcon:oe,dropdownMenuColumnStyle:X,optionRender:he}}),[Ce,be,Re,je,C,We,L,Be,W,G,z,re,oe,X,he]),Ke=!(Te?Be:Ce).length,Ye=Te&&Ne.matchInputWidth||Ke?{}:{minWidth:"auto"};return d.createElement(p.Provider,{value:qe},d.createElement(s.Ac,(0,i.Z)({},de,{ref:t,id:pe,prefixCls:v,autoClearSearchValue:I,dropdownMatchSelectWidth:se,dropdownStyle:(0,r.Z)((0,r.Z)({},Ye),J),displayValues:Ze,onDisplayValuesChange:function(e,t){if("clear"!==t.type){var n=t.values[0].valueCells;We(n)}else ze([])},mode:fe?"multiple":void 0,searchValue:Te,onSearch:function(e,t){Le(e),"blur"!==t.source&&F&&F(e)},showSearch:Pe,OptionList:Y,emptyOptions:Ke,open:Ge,dropdownClassName:Ve,placement:Ue,onDropdownVisibleChange:function(e){null==te||te(e),null==ne||ne(e)},getRawInputElement:function(){return ae}})))}));ee.SHOW_PARENT=w,ee.SHOW_CHILD=C,ee.Panel=Q;var te=ee},66042:function(e,t,n){"use strict";n.d(t,{Z:function(){return T}});var i=n(33885),r=n(42978),o=n(43403),a=n(34280),l=n(59301),s=l.createContext(null),c=l.createContext({}),u=s,h=n(20068),d=n(54476),p=n(92310),f=n.n(p),m=n(77900),v=n(10228),g=n(26112),y=n(75931),b=n(8654),x=["prefixCls","className","containerRef"];var w=function(e){var t=e.prefixCls,n=e.className,i=e.containerRef,r=(0,y.Z)(e,x),o=l.useContext(c).panel,a=(0,b.x1)(o,i);return l.createElement("div",(0,d.Z)({className:f()("".concat(t,"-content"),n),role:"dialog",ref:a},(0,g.Z)(e,{aria:!0}),{"aria-modal":"true"},r))},C=n(48736);function k(e){return"string"==typeof e&&String(Number(e))===e?((0,C.ZP)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(e)):e}var S={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function E(e,t){var n,o,a,s=e.prefixCls,c=e.open,p=e.placement,y=e.inline,b=e.push,x=e.forceRender,C=e.autoFocus,E=e.keyboard,M=e.classNames,T=e.rootClassName,L=e.rootStyle,A=e.zIndex,D=e.className,P=e.id,N=e.style,B=e.motion,_=e.width,I=e.height,O=e.children,R=e.mask,j=e.maskClosable,F=e.maskMotion,Z=e.maskClassName,z=e.maskStyle,H=e.afterOpenChange,W=e.onClose,G=e.onMouseEnter,V=e.onMouseOver,U=e.onMouseLeave,q=e.onClick,K=e.onKeyDown,Y=e.onKeyUp,X=e.styles,J=e.drawerRender,Q=l.useRef(),$=l.useRef(),ee=l.useRef();l.useImperativeHandle(t,(function(){return Q.current}));l.useEffect((function(){var e;c&&C&&(null===(e=Q.current)||void 0===e||e.focus({preventScroll:!0}))}),[c]);var te=l.useState(!1),ne=(0,r.Z)(te,2),ie=ne[0],re=ne[1],oe=l.useContext(u),ae=null!==(n=null!==(o=null===(a="boolean"==typeof b?b?{}:{distance:0}:b||{})||void 0===a?void 0:a.distance)&&void 0!==o?o:null==oe?void 0:oe.pushDistance)&&void 0!==n?n:180,le=l.useMemo((function(){return{pushDistance:ae,push:function(){re(!0)},pull:function(){re(!1)}}}),[ae]);l.useEffect((function(){var e,t;c?null==oe||null===(e=oe.push)||void 0===e||e.call(oe):null==oe||null===(t=oe.pull)||void 0===t||t.call(oe)}),[c]),l.useEffect((function(){return function(){var e;null==oe||null===(e=oe.pull)||void 0===e||e.call(oe)}}),[]);var se=R&&l.createElement(m.default,(0,d.Z)({key:"mask"},F,{visible:c}),(function(e,t){var n=e.className,r=e.style;return l.createElement("div",{className:f()("".concat(s,"-mask"),n,null==M?void 0:M.mask,Z),style:(0,i.Z)((0,i.Z)((0,i.Z)({},r),z),null==X?void 0:X.mask),onClick:j&&c?W:void 0,ref:t})})),ce="function"==typeof B?B(p):B,ue={};if(ie&&ae)switch(p){case"top":ue.transform="translateY(".concat(ae,"px)");break;case"bottom":ue.transform="translateY(".concat(-ae,"px)");break;case"left":ue.transform="translateX(".concat(ae,"px)");break;default:ue.transform="translateX(".concat(-ae,"px)")}"left"===p||"right"===p?ue.width=k(_):ue.height=k(I);var he={onMouseEnter:G,onMouseOver:V,onMouseLeave:U,onClick:q,onKeyDown:K,onKeyUp:Y},de=l.createElement(m.default,(0,d.Z)({key:"panel"},ce,{visible:c,forceRender:x,onVisibleChanged:function(e){null==H||H(e)},removeOnLeave:!1,leavedClassName:"".concat(s,"-content-wrapper-hidden")}),(function(t,n){var r=t.className,o=t.style,a=l.createElement(w,(0,d.Z)({id:P,containerRef:n,prefixCls:s,className:f()(D,null==M?void 0:M.content),style:(0,i.Z)((0,i.Z)({},N),null==X?void 0:X.content)},(0,g.Z)(e,{aria:!0}),he),O);return l.createElement("div",(0,d.Z)({className:f()("".concat(s,"-content-wrapper"),null==M?void 0:M.wrapper,r),style:(0,i.Z)((0,i.Z)((0,i.Z)({},ue),o),null==X?void 0:X.wrapper)},(0,g.Z)(e,{data:!0})),J?J(a):a)})),pe=(0,i.Z)({},L);return A&&(pe.zIndex=A),l.createElement(u.Provider,{value:le},l.createElement("div",{className:f()(s,"".concat(s,"-").concat(p),T,(0,h.Z)((0,h.Z)({},"".concat(s,"-open"),c),"".concat(s,"-inline"),y)),style:pe,tabIndex:-1,ref:Q,onKeyDown:function(e){var t=e.keyCode,n=e.shiftKey;switch(t){case v.Z.TAB:var i;if(t===v.Z.TAB)if(n||document.activeElement!==ee.current){if(n&&document.activeElement===$.current){var r;null===(r=ee.current)||void 0===r||r.focus({preventScroll:!0})}}else null===(i=$.current)||void 0===i||i.focus({preventScroll:!0});break;case v.Z.ESC:W&&E&&(e.stopPropagation(),W(e))}}},se,l.createElement("div",{tabIndex:0,ref:$,style:S,"aria-hidden":"true","data-sentinel":"start"}),de,l.createElement("div",{tabIndex:0,ref:ee,style:S,"aria-hidden":"true","data-sentinel":"end"})))}var M=l.forwardRef(E);var T=function(e){var t=e.open,n=void 0!==t&&t,s=e.prefixCls,u=void 0===s?"rc-drawer":s,h=e.placement,d=void 0===h?"right":h,p=e.autoFocus,f=void 0===p||p,m=e.keyboard,v=void 0===m||m,g=e.width,y=void 0===g?378:g,b=e.mask,x=void 0===b||b,w=e.maskClosable,C=void 0===w||w,k=e.getContainer,S=e.forceRender,E=e.afterOpenChange,T=e.destroyOnClose,L=e.onMouseEnter,A=e.onMouseOver,D=e.onMouseLeave,P=e.onClick,N=e.onKeyDown,B=e.onKeyUp,_=e.panelRef,I=l.useState(!1),O=(0,r.Z)(I,2),R=O[0],j=O[1];var F=l.useState(!1),Z=(0,r.Z)(F,2),z=Z[0],H=Z[1];(0,a.Z)((function(){H(!0)}),[]);var W=!!z&&n,G=l.useRef(),V=l.useRef();(0,a.Z)((function(){W&&(V.current=document.activeElement)}),[W]);var U=l.useMemo((function(){return{panel:_}}),[_]);if(!S&&!R&&!W&&T)return null;var q={onMouseEnter:L,onMouseOver:A,onMouseLeave:D,onClick:P,onKeyDown:N,onKeyUp:B},K=(0,i.Z)((0,i.Z)({},e),{},{open:W,prefixCls:u,placement:d,autoFocus:f,keyboard:v,width:y,mask:x,maskClosable:C,inline:!1===k,afterOpenChange:function(e){var t,n;(j(e),null==E||E(e),e||!V.current||null!==(t=G.current)&&void 0!==t&&t.contains(V.current))||(null===(n=V.current)||void 0===n||n.focus({preventScroll:!0}))},ref:G},q);return l.createElement(c.Provider,{value:U},l.createElement(o.Z,{open:W||S||R,autoDestroy:!1,getContainer:k,autoLock:x&&(W||R)},l.createElement(M,K)))}},6551:function(e,t,n){"use strict";n.d(t,{ZP:function(){return s}});var i=n(42978),r=n(59301),o=n(47273),a=0,l=(0,o.Z)();function s(e){var t=r.useState(),n=(0,i.Z)(t,2),o=n[0],s=n[1];return r.useEffect((function(){var e;s("rc_select_".concat((l?(e=a,a+=1):e="TEST_OR_SSR",e)))}),[]),e||o}},37463:function(e,t,n){"use strict";n.d(t,{Ac:function(){return ee},Xo:function(){return ne},Wx:function(){return re},ZP:function(){return Ee},lk:function(){return x}});var i=n(54476),r=n(94480),o=n(20068),a=n(33885),l=n(42978),s=n(75931),c=n(76190),u=n(18929),h=n(48736),d=n(59301),p=n(92310),f=n.n(p),m=n(34280),v=n(49658),g=n(8654),y=function(e){var t=e.className,n=e.customizeIcon,i=e.customizeIconProps,r=e.children,o=e.onMouseDown,a=e.onClick,l="function"==typeof n?n(i):n;return d.createElement("span",{className:t,onMouseDown:function(e){e.preventDefault(),null==o||o(e)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:a,"aria-hidden":!0},void 0!==l?l:d.createElement("span",{className:f()(t.split(/\s+/).map((function(e){return"".concat(e,"-icon")})))},r))},b=d.createContext(null);function x(){return d.useContext(b)}function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,t=d.useRef(null),n=d.useRef(null);function i(i){(i||null===t.current)&&(t.current=i),window.clearTimeout(n.current),n.current=window.setTimeout((function(){t.current=null}),e)}return d.useEffect((function(){return function(){window.clearTimeout(n.current)}}),[]),[function(){return t.current},i]}var C=n(10228);var k=n(26112),S=n(11780);var E=function(e,t,n){var i=(0,a.Z)((0,a.Z)({},e),n?t:{});return Object.keys(t).forEach((function(n){var r=t[n];"function"==typeof r&&(i[n]=function(){for(var t,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r.apply(void 0,o),null===(t=e[n])||void 0===t?void 0:t.call.apply(t,[e].concat(o))})})),i},M=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],T=function(e,t){var n=e.prefixCls,i=e.id,r=e.inputElement,o=e.autoFocus,l=e.autoComplete,c=e.editable,u=e.activeDescendantId,p=e.value,m=e.open,v=e.attrs,y=(0,s.Z)(e,M),b=r||d.createElement("input",null),x=b,w=x.ref,C=x.props;return(0,h.Kp)(!("maxLength"in b.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),b=d.cloneElement(b,(0,a.Z)((0,a.Z)((0,a.Z)({type:"search"},E(y,C,!0)),{},{id:i,ref:(0,g.sQ)(t,w),autoComplete:l||"off",autoFocus:o,className:f()("".concat(n,"-selection-search-input"),null==C?void 0:C.className),role:"combobox","aria-expanded":m||!1,"aria-haspopup":"listbox","aria-owns":"".concat(i,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(i,"_list"),"aria-activedescendant":m?u:void 0},v),{},{value:c?p:"",readOnly:!c,unselectable:c?null:"on",style:(0,a.Z)((0,a.Z)({},C.style),{},{opacity:c?null:0})}))};var L=d.forwardRef(T);function A(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}var D="undefined"!=typeof window&&window.document&&window.document.documentElement;function P(e){return["string","number"].includes((0,c.Z)(e))}function N(e){var t=void 0;return e&&(P(e.title)?t=e.title.toString():P(e.label)&&(t=e.label.toString())),t}function B(e){var t;return null!==(t=e.key)&&void 0!==t?t:e.value}var _=function(e){e.preventDefault(),e.stopPropagation()},I=function(e){var t,n,i=e.id,r=e.prefixCls,a=e.values,s=e.open,c=e.searchValue,u=e.autoClearSearchValue,h=e.inputRef,p=e.placeholder,m=e.disabled,v=e.mode,g=e.showSearch,b=e.autoFocus,x=e.autoComplete,w=e.activeDescendantId,C=e.tabIndex,E=e.removeIcon,M=e.maxTagCount,T=e.maxTagTextLength,A=e.maxTagPlaceholder,P=void 0===A?function(e){return"+ ".concat(e.length," ...")}:A,I=e.tagRender,O=e.onToggleOpen,R=e.onRemove,j=e.onInputChange,F=e.onInputPaste,Z=e.onInputKeyDown,z=e.onInputMouseDown,H=e.onInputCompositionStart,W=e.onInputCompositionEnd,G=e.onInputBlur,V=d.useRef(null),U=(0,d.useState)(0),q=(0,l.Z)(U,2),K=q[0],Y=q[1],X=(0,d.useState)(!1),J=(0,l.Z)(X,2),Q=J[0],$=J[1],ee="".concat(r,"-selection"),te=s||"multiple"===v&&!1===u||"tags"===v?c:"",ne="tags"===v||"multiple"===v&&!1===u||g&&(s||Q);t=function(){Y(V.current.scrollWidth)},n=[te],D?d.useLayoutEffect(t,n):d.useEffect(t,n);var ie=function(e,t,n,i,r){return d.createElement("span",{title:N(e),className:f()("".concat(ee,"-item"),(0,o.Z)({},"".concat(ee,"-item-disabled"),n))},d.createElement("span",{className:"".concat(ee,"-item-content")},t),i&&d.createElement(y,{className:"".concat(ee,"-item-remove"),onMouseDown:_,onClick:r,customizeIcon:E},"×"))},re=function(e,t,n,i,r,o){return d.createElement("span",{onMouseDown:function(e){_(e),O(!s)}},I({label:t,value:e,disabled:n,closable:i,onClose:r,isMaxTag:!!o}))},oe=d.createElement("div",{className:"".concat(ee,"-search"),style:{width:K},onFocus:function(){$(!0)},onBlur:function(){$(!1)}},d.createElement(L,{ref:h,open:s,prefixCls:r,id:i,inputElement:null,disabled:m,autoFocus:b,autoComplete:x,editable:ne,activeDescendantId:w,value:te,onKeyDown:Z,onMouseDown:z,onChange:j,onPaste:F,onCompositionStart:H,onCompositionEnd:W,onBlur:G,tabIndex:C,attrs:(0,k.Z)(e,!0)}),d.createElement("span",{ref:V,className:"".concat(ee,"-search-mirror"),"aria-hidden":!0},te," ")),ae=d.createElement(S.Z,{prefixCls:"".concat(ee,"-overflow"),data:a,renderItem:function(e){var t=e.disabled,n=e.label,i=e.value,r=!m&&!t,o=n;if("number"==typeof T&&("string"==typeof n||"number"==typeof n)){var a=String(o);a.length>T&&(o="".concat(a.slice(0,T),"..."))}var l=function(t){t&&t.stopPropagation(),R(e)};return"function"==typeof I?re(i,o,t,r,l):ie(e,o,t,r,l)},renderRest:function(e){if(!a.length)return null;var t="function"==typeof P?P(e):P;return"function"==typeof I?re(void 0,t,!1,!1,void 0,!0):ie({title:t},t,!1)},suffix:oe,itemKey:B,maxCount:M});return d.createElement("span",{className:"".concat(ee,"-wrap")},ae,!a.length&&!te&&d.createElement("span",{className:"".concat(ee,"-placeholder")},p))},O=function(e){var t=e.inputElement,n=e.prefixCls,i=e.id,r=e.inputRef,o=e.disabled,a=e.autoFocus,s=e.autoComplete,c=e.activeDescendantId,u=e.mode,h=e.open,p=e.values,f=e.placeholder,m=e.tabIndex,v=e.showSearch,g=e.searchValue,y=e.activeValue,b=e.maxLength,x=e.onInputKeyDown,w=e.onInputMouseDown,C=e.onInputChange,S=e.onInputPaste,E=e.onInputCompositionStart,M=e.onInputCompositionEnd,T=e.onInputBlur,A=e.title,D=d.useState(!1),P=(0,l.Z)(D,2),B=P[0],_=P[1],I="combobox"===u,O=I||v,R=p[0],j=g||"";I&&y&&!B&&(j=y),d.useEffect((function(){I&&_(!1)}),[I,y]);var F=!("combobox"!==u&&!h&&!v)&&!!j,Z=void 0===A?N(R):A,z=d.useMemo((function(){return R?null:d.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:F?{visibility:"hidden"}:void 0},f)}),[R,F,f,n]);return d.createElement("span",{className:"".concat(n,"-selection-wrap")},d.createElement("span",{className:"".concat(n,"-selection-search")},d.createElement(L,{ref:r,prefixCls:n,id:i,open:h,inputElement:t,disabled:o,autoFocus:a,autoComplete:s,editable:O,activeDescendantId:c,value:j,onKeyDown:x,onMouseDown:w,onChange:function(e){_(!0),C(e)},onPaste:S,onCompositionStart:E,onCompositionEnd:M,onBlur:T,tabIndex:m,attrs:(0,k.Z)(e,!0),maxLength:I?b:void 0})),!I&&R?d.createElement("span",{className:"".concat(n,"-selection-item"),title:Z,style:F?{visibility:"hidden"}:void 0},R.label):null,z)},R=function(e,t){var n=(0,d.useRef)(null),r=(0,d.useRef)(!1),o=e.prefixCls,a=e.open,s=e.mode,c=e.showSearch,u=e.tokenWithEnter,h=e.disabled,p=e.prefix,f=e.autoClearSearchValue,m=e.onSearch,v=e.onSearchSubmit,g=e.onToggleOpen,y=e.onInputKeyDown,b=e.onInputBlur,x=e.domRef;d.useImperativeHandle(t,(function(){return{focus:function(e){n.current.focus(e)},blur:function(){n.current.blur()}}}));var k=w(0),S=(0,l.Z)(k,2),E=S[0],M=S[1],T=(0,d.useRef)(null),L=function(e){!1!==m(e,!0,r.current)&&g(!0)},A={inputRef:n,onInputKeyDown:function(e){var t,i=e.which,o=n.current instanceof HTMLTextAreaElement;(o||!a||i!==C.Z.UP&&i!==C.Z.DOWN||e.preventDefault(),y&&y(e),i!==C.Z.ENTER||"tags"!==s||r.current||a||null==v||v(e.target.value),o&&!a&&~[C.Z.UP,C.Z.DOWN,C.Z.LEFT,C.Z.RIGHT].indexOf(i))||(t=i)&&![C.Z.ESC,C.Z.SHIFT,C.Z.BACKSPACE,C.Z.TAB,C.Z.WIN_KEY,C.Z.ALT,C.Z.META,C.Z.WIN_KEY_RIGHT,C.Z.CTRL,C.Z.SEMICOLON,C.Z.EQUALS,C.Z.CAPS_LOCK,C.Z.CONTEXT_MENU,C.Z.F1,C.Z.F2,C.Z.F3,C.Z.F4,C.Z.F5,C.Z.F6,C.Z.F7,C.Z.F8,C.Z.F9,C.Z.F10,C.Z.F11,C.Z.F12].includes(t)&&g(!0)},onInputMouseDown:function(){M(!0)},onInputChange:function(e){var t=e.target.value;if(u&&T.current&&/[\r\n]/.test(T.current)){var n=T.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");t=t.replace(n,T.current)}T.current=null,L(t)},onInputPaste:function(e){var t=e.clipboardData,n=null==t?void 0:t.getData("text");T.current=n||""},onInputCompositionStart:function(){r.current=!0},onInputCompositionEnd:function(e){r.current=!1,"combobox"!==s&&L(e.target.value)},onInputBlur:b},D="multiple"===s||"tags"===s?d.createElement(I,(0,i.Z)({},e,A)):d.createElement(O,(0,i.Z)({},e,A));return d.createElement("div",{ref:x,className:"".concat(o,"-selector"),onClick:function(e){e.target!==n.current&&(void 0!==document.body.style.msTouchAction?setTimeout((function(){n.current.focus()})):n.current.focus())},onMouseDown:function(e){var t=E();e.target===n.current||t||"combobox"===s&&h||e.preventDefault(),("combobox"===s||c&&t)&&a||(a&&!1!==f&&m("",!0,!1),g())}},p&&d.createElement("div",{className:"".concat(o,"-prefix")},p),D)};var j=d.forwardRef(R),F=n(65030),Z=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],z=function(e,t){var n=e.prefixCls,r=(e.disabled,e.visible),l=e.children,c=e.popupElement,u=e.animation,h=e.transitionName,p=e.dropdownStyle,m=e.dropdownClassName,v=e.direction,g=void 0===v?"ltr":v,y=e.placement,b=e.builtinPlacements,x=e.dropdownMatchSelectWidth,w=e.dropdownRender,C=e.dropdownAlign,k=e.getPopupContainer,S=e.empty,E=e.getTriggerDOMNode,M=e.onPopupVisibleChange,T=e.onPopupMouseEnter,L=(0,s.Z)(e,Z),A="".concat(n,"-dropdown"),D=c;w&&(D=w(c));var P=d.useMemo((function(){return b||function(e){var t=!0===e?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"}}}(x)}),[b,x]),N=u?"".concat(A,"-").concat(u):h,B="number"==typeof x,_=d.useMemo((function(){return B?null:!1===x?"minWidth":"width"}),[x,B]),I=p;B&&(I=(0,a.Z)((0,a.Z)({},I),{},{width:x}));var O=d.useRef(null);return d.useImperativeHandle(t,(function(){return{getPopupElement:function(){var e;return null===(e=O.current)||void 0===e?void 0:e.popupElement}}})),d.createElement(F.Z,(0,i.Z)({},L,{showAction:M?["click"]:[],hideAction:M?["click"]:[],popupPlacement:y||("rtl"===g?"bottomRight":"bottomLeft"),builtinPlacements:P,prefixCls:A,popupTransitionName:N,popup:d.createElement("div",{onMouseEnter:T},D),ref:O,stretch:_,popupAlign:C,popupVisible:r,getPopupContainer:k,popupClassName:f()(m,(0,o.Z)({},"".concat(A,"-empty"),S)),popupStyle:I,getTriggerDOMNode:E,onPopupVisibleChange:M}),l)};var H=d.forwardRef(z),W=n(66712);function G(e,t){var n,i=e.key;return"value"in e&&(n=e.value),null!=i?i:void 0!==n?n:"rc-index-key-".concat(t)}function V(e){return void 0!==e&&!Number.isNaN(e)}function U(e,t){var n=e||{},i=n.label||(t?"children":"label");return{label:i,value:n.value||"value",options:n.options||"options",groupLabel:n.groupLabel||i}}function q(e){var t=(0,a.Z)({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return(0,h.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}var K=d.createContext(null);function Y(e){var t=e.visible,n=e.values;if(!t)return null;return d.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(n.slice(0,50).map((function(e){var t=e.label,n=e.value;return["number","string"].includes((0,c.Z)(t))?t:n})).join(", ")),n.length>50?", ...":null)}var X=["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","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],J=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],Q=function(e){return"tags"===e||"multiple"===e},$=d.forwardRef((function(e,t){var n,h=e.id,p=e.prefixCls,x=e.className,C=e.showSearch,k=e.tagRender,S=e.direction,E=e.omitDomProps,M=e.displayValues,T=e.onDisplayValuesChange,L=e.emptyOptions,A=e.notFoundContent,D=void 0===A?"Not Found":A,P=e.onClear,N=e.mode,B=e.disabled,_=e.loading,I=e.getInputElement,O=e.getRawInputElement,R=e.open,F=e.defaultOpen,Z=e.onDropdownVisibleChange,z=e.activeValue,G=e.onActiveValueChange,U=e.activeDescendantId,q=e.searchValue,$=e.autoClearSearchValue,ee=e.onSearch,te=e.onSearchSplit,ne=e.tokenSeparators,ie=e.allowClear,re=e.prefix,oe=e.suffixIcon,ae=e.clearIcon,le=e.OptionList,se=e.animation,ce=e.transitionName,ue=e.dropdownStyle,he=e.dropdownClassName,de=e.dropdownMatchSelectWidth,pe=e.dropdownRender,fe=e.dropdownAlign,me=e.placement,ve=e.builtinPlacements,ge=e.getPopupContainer,ye=e.showAction,be=void 0===ye?[]:ye,xe=e.onFocus,we=e.onBlur,Ce=e.onKeyUp,ke=e.onKeyDown,Se=e.onMouseDown,Ee=(0,s.Z)(e,X),Me=Q(N),Te=(void 0!==C?C:Me)||"combobox"===N,Le=(0,a.Z)({},Ee);J.forEach((function(e){delete Le[e]})),null==E||E.forEach((function(e){delete Le[e]}));var Ae=d.useState(!1),De=(0,l.Z)(Ae,2),Pe=De[0],Ne=De[1];d.useEffect((function(){Ne((0,v.Z)())}),[]);var Be=d.useRef(null),_e=d.useRef(null),Ie=d.useRef(null),Oe=d.useRef(null),Re=d.useRef(null),je=d.useRef(!1),Fe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=d.useState(!1),n=(0,l.Z)(t,2),i=n[0],r=n[1],o=d.useRef(null),a=function(){window.clearTimeout(o.current)};return d.useEffect((function(){return a}),[]),[i,function(t,n){a(),o.current=window.setTimeout((function(){r(t),n&&n()}),e)},a]}(),Ze=(0,l.Z)(Fe,3),ze=Ze[0],He=Ze[1],We=Ze[2];d.useImperativeHandle(t,(function(){var e,t;return{focus:null===(e=Oe.current)||void 0===e?void 0:e.focus,blur:null===(t=Oe.current)||void 0===t?void 0:t.blur,scrollTo:function(e){var t;return null===(t=Re.current)||void 0===t?void 0:t.scrollTo(e)},nativeElement:Be.current||_e.current}}));var Ge=d.useMemo((function(){var e;if("combobox"!==N)return q;var t=null===(e=M[0])||void 0===e?void 0:e.value;return"string"==typeof t||"number"==typeof t?String(t):""}),[q,N,M]),Ve="combobox"===N&&"function"==typeof I&&I()||null,Ue="function"==typeof O&&O(),qe=(0,g.x1)(_e,null==Ue||null===(n=Ue.props)||void 0===n?void 0:n.ref),Ke=d.useState(!1),Ye=(0,l.Z)(Ke,2),Xe=Ye[0],Je=Ye[1];(0,m.Z)((function(){Je(!0)}),[]);var Qe=(0,u.Z)(!1,{defaultValue:F,value:R}),$e=(0,l.Z)(Qe,2),et=$e[0],tt=$e[1],nt=!!Xe&&et,it=!D&&L;(B||it&&nt&&"combobox"===N)&&(nt=!1);var rt=!it&&nt,ot=d.useCallback((function(e){var t=void 0!==e?e:!nt;B||(tt(t),nt!==t&&(null==Z||Z(t)))}),[B,nt,tt,Z]),at=d.useMemo((function(){return(ne||[]).some((function(e){return["\n","\r\n"].includes(e)}))}),[ne]),lt=d.useContext(K)||{},st=lt.maxCount,ct=lt.rawValues,ut=function(e,t,n){if(!(Me&&V(st)&&(null==ct?void 0:ct.size)>=st)){var i=!0,o=e;null==G||G(null);var a=function(e,t,n){if(!t||!t.length)return null;var i=!1,o=function e(t,n){var o=(0,W.Z)(n),a=o[0],l=o.slice(1);if(!a)return[t];var s=t.split(a);return i=i||s.length>1,s.reduce((function(t,n){return[].concat((0,r.Z)(t),(0,r.Z)(e(n,l)))}),[]).filter(Boolean)}(e,t);return i?void 0!==n?o.slice(0,n):o:null}(e,ne,V(st)?st-ct.size:void 0),l=n?null:a;return"combobox"!==N&&l&&(o="",null==te||te(l),ot(!1),i=!1),ee&&Ge!==o&&ee(o,{source:t?"typing":"effect"}),i}};d.useEffect((function(){nt||Me||"combobox"===N||ut("",!1,!1)}),[nt]),d.useEffect((function(){et&&B&&tt(!1),B&&!je.current&&He(!1)}),[B]);var ht=w(),dt=(0,l.Z)(ht,2),pt=dt[0],ft=dt[1],mt=d.useRef(!1),vt=d.useRef(!1),gt=[];d.useEffect((function(){return function(){gt.forEach((function(e){return clearTimeout(e)})),gt.splice(0,gt.length)}}),[]);var yt,bt=d.useState({}),xt=(0,l.Z)(bt,2)[1];Ue&&(yt=function(e){ot(e)}),function(e,t,n,i){var r=d.useRef(null);r.current={open:t,triggerOpen:n,customizedTrigger:i},d.useEffect((function(){function t(t){var n;if(null===(n=r.current)||void 0===n||!n.customizedTrigger){var i=t.target;i.shadowRoot&&t.composed&&(i=t.composedPath()[0]||i),r.current.open&&e().filter((function(e){return e})).every((function(e){return!e.contains(i)&&e!==i}))&&r.current.triggerOpen(!1)}}return window.addEventListener("mousedown",t),function(){return window.removeEventListener("mousedown",t)}}),[])}((function(){var e;return[Be.current,null===(e=Ie.current)||void 0===e?void 0:e.getPopupElement()]}),rt,ot,!!Ue);var wt,Ct=d.useMemo((function(){return(0,a.Z)((0,a.Z)({},e),{},{notFoundContent:D,open:nt,triggerOpen:rt,id:h,showSearch:Te,multiple:Me,toggleOpen:ot})}),[e,D,rt,nt,h,Te,Me,ot]),kt=!!oe||_;kt&&(wt=d.createElement(y,{className:f()("".concat(p,"-arrow"),(0,o.Z)({},"".concat(p,"-arrow-loading"),_)),customizeIcon:oe,customizeIconProps:{loading:_,searchValue:Ge,open:nt,focused:ze,showSearch:Te}}));var St,Et=function(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,s=d.useMemo((function(){return"object"===(0,c.Z)(i)?i.clearIcon:r||void 0}),[i,r]),u=d.useMemo((function(){return!(o||!i||!n.length&&!a||"combobox"===l&&""===a)}),[i,o,n.length,a,l]);return{allowClear:u,clearIcon:d.createElement(y,{className:"".concat(e,"-clear"),onMouseDown:t,customizeIcon:s},"×")}}(p,(function(){var e;null==P||P(),null===(e=Oe.current)||void 0===e||e.focus(),T([],{type:"clear",values:M}),ut("",!1,!1)}),M,ie,ae,B,Ge,N),Mt=Et.allowClear,Tt=Et.clearIcon,Lt=d.createElement(le,{ref:Re}),At=f()(p,x,(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},"".concat(p,"-focused"),ze),"".concat(p,"-multiple"),Me),"".concat(p,"-single"),!Me),"".concat(p,"-allow-clear"),ie),"".concat(p,"-show-arrow"),kt),"".concat(p,"-disabled"),B),"".concat(p,"-loading"),_),"".concat(p,"-open"),nt),"".concat(p,"-customize-input"),Ve),"".concat(p,"-show-search"),Te)),Dt=d.createElement(H,{ref:Ie,disabled:B,prefixCls:p,visible:rt,popupElement:Lt,animation:se,transitionName:ce,dropdownStyle:ue,dropdownClassName:he,direction:S,dropdownMatchSelectWidth:de,dropdownRender:pe,dropdownAlign:fe,placement:me,builtinPlacements:ve,getPopupContainer:ge,empty:L,getTriggerDOMNode:function(e){return _e.current||e},onPopupVisibleChange:yt,onPopupMouseEnter:function(){xt({})}},Ue?d.cloneElement(Ue,{ref:qe}):d.createElement(j,(0,i.Z)({},e,{domRef:_e,prefixCls:p,inputElement:Ve,ref:Oe,id:h,prefix:re,showSearch:Te,autoClearSearchValue:$,mode:N,activeDescendantId:U,tagRender:k,values:M,open:nt,onToggleOpen:ot,activeValue:z,searchValue:Ge,onSearch:ut,onSearchSubmit:function(e){e&&e.trim()&&ee(e,{source:"submit"})},onRemove:function(e){var t=M.filter((function(t){return t!==e}));T(t,{type:"remove",values:[e]})},tokenWithEnter:at,onInputBlur:function(){mt.current=!1}})));return St=Ue?Dt:d.createElement("div",(0,i.Z)({className:At},Le,{ref:Be,onMouseDown:function(e){var t,n=e.target,i=null===(t=Ie.current)||void 0===t?void 0:t.getPopupElement();if(i&&i.contains(n)){var r=setTimeout((function(){var e,t=gt.indexOf(r);-1!==t&&gt.splice(t,1),We(),Pe||i.contains(document.activeElement)||null===(e=Oe.current)||void 0===e||e.focus()}));gt.push(r)}for(var o=arguments.length,a=new Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];null==Se||Se.apply(void 0,[e].concat(a))},onKeyDown:function(e){var t,n=pt(),i=e.key,o="Enter"===i;if(o&&("combobox"!==N&&e.preventDefault(),nt||ot(!0)),ft(!!Ge),"Backspace"===i&&!n&&Me&&!Ge&&M.length){for(var a=(0,r.Z)(M),l=null,s=a.length-1;s>=0;s-=1){var c=a[s];if(!c.disabled){a.splice(s,1),l=c;break}}l&&T(a,{type:"remove",values:[l]})}for(var u=arguments.length,h=new Array(u>1?u-1:0),d=1;d<u;d++)h[d-1]=arguments[d];!nt||o&&mt.current||(o&&(mt.current=!0),null===(t=Re.current)||void 0===t||t.onKeyDown.apply(t,[e].concat(h))),null==ke||ke.apply(void 0,[e].concat(h))},onKeyUp:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r;nt&&(null===(r=Re.current)||void 0===r||r.onKeyUp.apply(r,[e].concat(n))),"Enter"===e.key&&(mt.current=!1),null==Ce||Ce.apply(void 0,[e].concat(n))},onFocus:function(){He(!0),B||(xe&&!vt.current&&xe.apply(void 0,arguments),be.includes("focus")&&ot(!0)),vt.current=!0},onBlur:function(){je.current=!0,He(!1,(function(){vt.current=!1,je.current=!1,ot(!1)})),B||(Ge&&("tags"===N?ee(Ge,{source:"submit"}):"multiple"===N&&ee("",{source:"blur"})),we&&we.apply(void 0,arguments))}}),d.createElement(Y,{visible:ze&&!nt,values:M}),Dt,wt,Mt&&Tt),d.createElement(b.Provider,{value:Ct},St)}));var ee=$,te=function(){return null};te.isSelectOptGroup=!0;var ne=te,ie=function(){return null};ie.isSelectOption=!0;var re=ie,oe=n(80547),ae=n(2738),le=n(48911);var se=["disabled","title","children","style","className"];function ce(e){return"string"==typeof e||"number"==typeof e}var ue=function(e,t){var n=x(),a=n.prefixCls,c=n.id,u=n.open,h=n.multiple,p=n.mode,m=n.searchValue,v=n.toggleOpen,g=n.notFoundContent,b=n.onPopupScroll,w=d.useContext(K),S=w.maxCount,E=w.flattenOptions,M=w.onActiveValue,T=w.defaultActiveFirstOption,L=w.onSelect,A=w.menuItemSelectedIcon,D=w.rawValues,P=w.fieldNames,N=w.virtual,B=w.direction,_=w.listHeight,I=w.listItemHeight,O=w.optionRender,R="".concat(a,"-item"),j=(0,oe.Z)((function(){return E}),[u,E],(function(e,t){return t[0]&&e[1]!==t[1]})),F=d.useRef(null),Z=d.useMemo((function(){return h&&V(S)&&(null==D?void 0:D.size)>=S}),[h,S,null==D?void 0:D.size]),z=function(e){e.preventDefault()},H=function(e){var t;null===(t=F.current)||void 0===t||t.scrollTo("number"==typeof e?{index:e}:e)},W=d.useCallback((function(e){return"combobox"!==p&&D.has(e)}),[p,(0,r.Z)(D).toString(),D.size]),G=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=j.length,i=0;i<n;i+=1){var r=(e+i*t+n)%n,o=j[r]||{},a=o.group,l=o.data;if(!a&&(null==l||!l.disabled)&&(W(l.value)||!Z))return r}return-1},U=d.useState((function(){return G(0)})),q=(0,l.Z)(U,2),Y=q[0],X=q[1],J=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];X(e);var n={source:t?"keyboard":"mouse"},i=j[e];i?M(i.value,e,n):M(null,-1,n)};(0,d.useEffect)((function(){J(!1!==T?G(0):-1)}),[j.length,m]);var Q=d.useCallback((function(e){return"combobox"===p?String(e).toLowerCase()===m.toLowerCase():D.has(e)}),[p,m,(0,r.Z)(D).toString(),D.size]);(0,d.useEffect)((function(){var e,t=setTimeout((function(){if(!h&&u&&1===D.size){var e=Array.from(D)[0],t=j.findIndex((function(t){var n=t.data;return m?String(n.value).startsWith(m):n.value===e}));-1!==t&&(J(t),H(t))}}));u&&(null===(e=F.current)||void 0===e||e.scrollTo(void 0));return function(){return clearTimeout(t)}}),[u,m]);var $=function(e){void 0!==e&&L(e,{selected:!D.has(e)}),h||v(!1)};if(d.useImperativeHandle(t,(function(){return{onKeyDown:function(e){var t=e.which,n=e.ctrlKey;switch(t){case C.Z.N:case C.Z.P:case C.Z.UP:case C.Z.DOWN:var i=0;if(t===C.Z.UP?i=-1:t===C.Z.DOWN?i=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&n&&(t===C.Z.N?i=1:t===C.Z.P&&(i=-1)),0!==i){var r=G(Y+i,i);H(r),J(r,!0)}break;case C.Z.TAB:case C.Z.ENTER:var o,a=j[Y];!a||null!=a&&null!==(o=a.data)&&void 0!==o&&o.disabled||Z?$(void 0):$(a.value),u&&e.preventDefault();break;case C.Z.ESC:v(!1),u&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){H(e)}}})),0===j.length)return d.createElement("div",{role:"listbox",id:"".concat(c,"_list"),className:"".concat(R,"-empty"),onMouseDown:z},g);var ee=Object.keys(P).map((function(e){return P[e]})),te=function(e){return e.label};function ne(e,t){return{role:e.group?"presentation":"option",id:"".concat(c,"_list_").concat(t)}}var ie=function(e){var t=j[e];if(!t)return null;var n=t.data||{},r=n.value,o=t.group,a=(0,k.Z)(n,!0),l=te(t);return t?d.createElement("div",(0,i.Z)({"aria-label":"string"!=typeof l||o?null:l},a,{key:e},ne(t,e),{"aria-selected":Q(r)}),r):null},re={role:"listbox",id:"".concat(c,"_list")};return d.createElement(d.Fragment,null,N&&d.createElement("div",(0,i.Z)({},re,{style:{height:0,width:0,overflow:"hidden"}}),ie(Y-1),ie(Y),ie(Y+1)),d.createElement(le.Z,{itemKey:"key",ref:F,data:j,height:_,itemHeight:I,fullHeight:!1,onMouseDown:z,onScroll:b,virtual:N,direction:B,innerProps:N?null:re},(function(e,t){var n=e.group,r=e.groupOption,a=e.data,l=e.label,c=e.value,u=a.key;if(n){var h,p=null!==(h=a.title)&&void 0!==h?h:ce(l)?l.toString():void 0;return d.createElement("div",{className:f()(R,"".concat(R,"-group"),a.className),title:p},void 0!==l?l:u)}var m=a.disabled,v=a.title,g=(a.children,a.style),b=a.className,x=(0,s.Z)(a,se),w=(0,ae.Z)(x,ee),C=W(c),S=m||!C&&Z,E="".concat(R,"-option"),M=f()(R,E,b,(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},"".concat(E,"-grouped"),r),"".concat(E,"-active"),Y===t&&!S),"".concat(E,"-disabled"),S),"".concat(E,"-selected"),C)),T=te(e),L=!A||"function"==typeof A||C,D="number"==typeof T?T:T||c,P=ce(D)?D.toString():void 0;return void 0!==v&&(P=v),d.createElement("div",(0,i.Z)({},(0,k.Z)(w),N?{}:ne(e,t),{"aria-selected":Q(c),className:M,title:P,onMouseMove:function(){Y===t||S||J(t)},onClick:function(){S||$(c)},style:g}),d.createElement("div",{className:"".concat(E,"-content")},"function"==typeof O?O(e,{index:t}):D),d.isValidElement(A)||C,L&&d.createElement(y,{className:"".concat(R,"-option-state"),customizeIcon:A,customizeIconProps:{value:c,disabled:S,isSelected:C}},C?"✓":null))})))};var he=d.forwardRef(ue);function de(e,t){return A(e).join("").toUpperCase().includes(t)}var pe=n(6551),fe=n(11592),me=["children","value"],ve=["children"];function ge(e){var t=e,n=t.key,i=t.props,r=i.children,o=i.value,l=(0,s.Z)(i,me);return(0,a.Z)({key:n,value:void 0!==o?o:n,children:r},l)}function ye(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,fe.Z)(e).map((function(e,n){if(!d.isValidElement(e)||!e.type)return null;var i=e,r=i.type.isSelectOptGroup,o=i.key,l=i.props,c=l.children,u=(0,s.Z)(l,ve);return t||!r?ge(e):(0,a.Z)((0,a.Z)({key:"__RC_SELECT_GRP__".concat(null===o?n:o,"__"),label:o},u),{},{options:ye(c)})})).filter((function(e){return e}))}var be=function(e,t,n,i,r){return d.useMemo((function(){var o=e;!e&&(o=ye(t));var a=new Map,l=new Map,s=function(e,t,n){n&&"string"==typeof n&&e.set(t[n],t)};return function e(t){for(var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=0;c<t.length;c+=1){var u=t[c];!u[n.options]||o?(a.set(u[n.value],u),s(l,u,n.label),s(l,u,i),s(l,u,r)):e(u[n.options],!0)}}(o),{options:o,valueOptions:a,labelOptions:l}}),[e,t,n,i,r])};function xe(e){var t=d.useRef();t.current=e;var n=d.useCallback((function(){return t.current.apply(t,arguments)}),[]);return n}var we=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],Ce=["inputValue"];var ke=d.forwardRef((function(e,t){var n=e.id,h=e.mode,p=e.prefixCls,f=void 0===p?"rc-select":p,m=e.backfill,v=e.fieldNames,g=e.inputValue,y=e.searchValue,b=e.onSearch,x=e.autoClearSearchValue,w=void 0===x||x,C=e.onSelect,k=e.onDeselect,S=e.dropdownMatchSelectWidth,E=void 0===S||S,M=e.filterOption,T=e.filterSort,L=e.optionFilterProp,D=e.optionLabelProp,P=e.options,N=e.optionRender,B=e.children,_=e.defaultActiveFirstOption,I=e.menuItemSelectedIcon,O=e.virtual,R=e.direction,j=e.listHeight,F=void 0===j?200:j,Z=e.listItemHeight,z=void 0===Z?20:Z,H=e.labelRender,W=e.value,V=e.defaultValue,Y=e.labelInValue,X=e.onChange,J=e.maxCount,$=(0,s.Z)(e,we),te=(0,pe.ZP)(n),ne=Q(h),ie=!(P||!B),re=d.useMemo((function(){return(void 0!==M||"combobox"!==h)&&M}),[M,h]),oe=d.useMemo((function(){return U(v,ie)}),[JSON.stringify(v),ie]),ae=(0,u.Z)("",{value:void 0!==y?y:g,postState:function(e){return e||""}}),le=(0,l.Z)(ae,2),se=le[0],ce=le[1],ue=be(P,B,oe,L,D),fe=ue.valueOptions,me=ue.labelOptions,ve=ue.options,ge=d.useCallback((function(e){return A(e).map((function(e){var t,n,i,r,o,a;(function(e){return!e||"object"!==(0,c.Z)(e)})(e)?t=e:(i=e.key,n=e.label,t=null!==(a=e.value)&&void 0!==a?a:i);var l,s=fe.get(t);s&&(void 0===n&&(n=null==s?void 0:s[D||oe.label]),void 0===i&&(i=null!==(l=null==s?void 0:s.key)&&void 0!==l?l:t),r=null==s?void 0:s.disabled,o=null==s?void 0:s.title);return{label:n,value:t,key:i,disabled:r,title:o}}))}),[oe,D,fe]),ye=(0,u.Z)(V,{value:W}),ke=(0,l.Z)(ye,2),Se=ke[0],Ee=ke[1],Me=d.useMemo((function(){var e,t=ge(ne&&null===Se?[]:Se);return"combobox"===h&&function(e){return!e&&0!==e}(null===(e=t[0])||void 0===e?void 0:e.value)?[]:t}),[Se,ge,h,ne]),Te=function(e,t){var n=d.useRef({values:new Map,options:new Map});return[d.useMemo((function(){var i=n.current,r=i.values,o=i.options,l=e.map((function(e){var t;return void 0===e.label?(0,a.Z)((0,a.Z)({},e),{},{label:null===(t=r.get(e.value))||void 0===t?void 0:t.label}):e})),s=new Map,c=new Map;return l.forEach((function(e){s.set(e.value,e),c.set(e.value,t.get(e.value)||o.get(e.value))})),n.current.values=s,n.current.options=c,l}),[e,t]),d.useCallback((function(e){return t.get(e)||n.current.options.get(e)}),[t])]}(Me,fe),Le=(0,l.Z)(Te,2),Ae=Le[0],De=Le[1],Pe=d.useMemo((function(){if(!h&&1===Ae.length){var e=Ae[0];if(null===e.value&&(null===e.label||void 0===e.label))return[]}return Ae.map((function(e){var t;return(0,a.Z)((0,a.Z)({},e),{},{label:null!==(t="function"==typeof H?H(e):e.label)&&void 0!==t?t:e.value})}))}),[h,Ae,H]),Ne=d.useMemo((function(){return new Set(Ae.map((function(e){return e.value})))}),[Ae]);d.useEffect((function(){if("combobox"===h){var e,t=null===(e=Ae[0])||void 0===e?void 0:e.value;ce(function(e){return null!=e}(t)?String(t):"")}}),[Ae]);var Be=xe((function(e,t){var n=null!=t?t:e;return(0,o.Z)((0,o.Z)({},oe.value,e),oe.label,n)})),_e=function(e,t,n,i,r){return d.useMemo((function(){if(!n||!1===i)return e;var l=t.options,s=t.label,c=t.value,u=[],h="function"==typeof i,d=n.toUpperCase(),p=h?i:function(e,t){return r?de(t[r],d):t[l]?de(t["children"!==s?s:"label"],d):de(t[c],d)},f=h?function(e){return q(e)}:function(e){return e};return e.forEach((function(e){if(e[l])if(p(n,f(e)))u.push(e);else{var t=e[l].filter((function(e){return p(n,f(e))}));t.length&&u.push((0,a.Z)((0,a.Z)({},e),{},(0,o.Z)({},l,t)))}else p(n,f(e))&&u.push(e)})),u}),[e,i,r,n,t])}(d.useMemo((function(){if("tags"!==h)return ve;var e=(0,r.Z)(ve);return(0,r.Z)(Ae).sort((function(e,t){return e.value<t.value?-1:1})).forEach((function(t){var n=t.value;(function(e){return fe.has(e)})(n)||e.push(Be(n,t.label))})),e}),[Be,ve,fe,Ae,h]),oe,se,re,L),Ie=d.useMemo((function(){return"tags"!==h||!se||_e.some((function(e){return e[L||"value"]===se}))||_e.some((function(e){return e[oe.value]===se}))?_e:[Be(se)].concat((0,r.Z)(_e))}),[Be,L,h,_e,se,oe]),Oe=function e(t){return(0,r.Z)(t).sort((function(e,t){return T(e,t,{searchValue:se})})).map((function(t){return Array.isArray(t.options)?(0,a.Z)((0,a.Z)({},t),{},{options:t.options.length>0?e(t.options):t.options}):t}))},Re=d.useMemo((function(){return T?Oe(Ie):Ie}),[Ie,T,se]),je=d.useMemo((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fieldNames,i=t.childrenAsData,r=[],o=U(n,!1),a=o.label,l=o.value,s=o.options,c=o.groupLabel;function u(e,t){Array.isArray(e)&&e.forEach((function(e){if(t||!(s in e)){var n=e[l];r.push({key:G(e,r.length),groupOption:t,data:e,label:e[a],value:n})}else{var o=e[c];void 0===o&&i&&(o=e.label),r.push({key:G(e,r.length),group:!0,data:e,label:o}),u(e[s],!0)}}))}return u(e,!1),r}(Re,{fieldNames:oe,childrenAsData:ie})}),[Re,oe,ie]),Fe=function(e){var t=ge(e);if(Ee(t),X&&(t.length!==Ae.length||t.some((function(e,t){var n;return(null===(n=Ae[t])||void 0===n?void 0:n.value)!==(null==e?void 0:e.value)})))){var n=Y?t:t.map((function(e){return e.value})),i=t.map((function(e){return q(De(e.value))}));X(ne?n:n[0],ne?i:i[0])}},Ze=d.useState(null),ze=(0,l.Z)(Ze,2),He=ze[0],We=ze[1],Ge=d.useState(0),Ve=(0,l.Z)(Ge,2),Ue=Ve[0],qe=Ve[1],Ke=void 0!==_?_:"combobox"!==h,Ye=d.useCallback((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.source,r=void 0===i?"keyboard":i;qe(t),m&&"combobox"===h&&null!==e&&"keyboard"===r&&We(String(e))}),[m,h]),Xe=function(e,t,n){var i=function(){var t,n=De(e);return[Y?{label:null==n?void 0:n[oe.label],value:e,key:null!==(t=null==n?void 0:n.key)&&void 0!==t?t:e}:e,q(n)]};if(t&&C){var r=i(),o=(0,l.Z)(r,2),a=o[0],s=o[1];C(a,s)}else if(!t&&k&&"clear"!==n){var c=i(),u=(0,l.Z)(c,2),h=u[0],d=u[1];k(h,d)}},Je=xe((function(e,t){var n,i=!ne||t.selected;n=i?ne?[].concat((0,r.Z)(Ae),[e]):[e]:Ae.filter((function(t){return t.value!==e})),Fe(n),Xe(e,i),"combobox"===h?We(""):Q&&!w||(ce(""),We(""))})),Qe=d.useMemo((function(){var e=!1!==O&&!1!==E;return(0,a.Z)((0,a.Z)({},ue),{},{flattenOptions:je,onActiveValue:Ye,defaultActiveFirstOption:Ke,onSelect:Je,menuItemSelectedIcon:I,rawValues:Ne,fieldNames:oe,virtual:e,direction:R,listHeight:F,listItemHeight:z,childrenAsData:ie,maxCount:J,optionRender:N})}),[J,ue,je,Ye,Ke,Je,I,Ne,oe,O,E,R,F,z,ie,N]);return d.createElement(K.Provider,{value:Qe},d.createElement(ee,(0,i.Z)({},$,{id:te,prefixCls:f,ref:t,omitDomProps:Ce,mode:h,displayValues:Pe,onDisplayValuesChange:function(e,t){Fe(e);var n=t.type,i=t.values;"remove"!==n&&"clear"!==n||i.forEach((function(e){Xe(e.value,!1,n)}))},direction:R,searchValue:se,onSearch:function(e,t){if(ce(e),We(null),"submit"!==t.source)"blur"!==t.source&&("combobox"===h&&Fe(e),null==b||b(e));else{var n=(e||"").trim();if(n){var i=Array.from(new Set([].concat((0,r.Z)(Ne),[n])));Fe(i),Xe(n,!0),ce("")}}},autoClearSearchValue:w,onSearchSplit:function(e){var t=e;"tags"!==h&&(t=e.map((function(e){var t=me.get(e);return null==t?void 0:t.value})).filter((function(e){return void 0!==e})));var n=Array.from(new Set([].concat((0,r.Z)(Ne),(0,r.Z)(t))));Fe(n),n.forEach((function(e){Xe(e,!0)}))},dropdownMatchSelectWidth:E,OptionList:he,emptyOptions:!je.length,activeValue:He,activeDescendantId:"".concat(te,"_list_").concat(Ue)})))}));var Se=ke;Se.Option=re,Se.OptGroup=ne;var Ee=Se},63158:function(e,t,n){"use strict";var i=n(54476),r=n(20068),o=n(42978),a=n(75931),l=n(59301),s=n(92310),c=n.n(s),u=n(18929),h=n(10228),d=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],p=l.forwardRef((function(e,t){var n,s=e.prefixCls,p=void 0===s?"rc-switch":s,f=e.className,m=e.checked,v=e.defaultChecked,g=e.disabled,y=e.loadingIcon,b=e.checkedChildren,x=e.unCheckedChildren,w=e.onClick,C=e.onChange,k=e.onKeyDown,S=(0,a.Z)(e,d),E=(0,u.Z)(!1,{value:m,defaultValue:v}),M=(0,o.Z)(E,2),T=M[0],L=M[1];function A(e,t){var n=T;return g||(L(n=e),null==C||C(n,t)),n}var D=c()(p,f,(n={},(0,r.Z)(n,"".concat(p,"-checked"),T),(0,r.Z)(n,"".concat(p,"-disabled"),g),n));return l.createElement("button",(0,i.Z)({},S,{type:"button",role:"switch","aria-checked":T,disabled:g,className:D,ref:t,onKeyDown:function(e){e.which===h.Z.LEFT?A(!1,e):e.which===h.Z.RIGHT&&A(!0,e),null==k||k(e)},onClick:function(e){var t=A(!T,e);null==w||w(t,e)}}),y,l.createElement("span",{className:"".concat(p,"-inner")},l.createElement("span",{className:"".concat(p,"-inner-checked")},b),l.createElement("span",{className:"".concat(p,"-inner-unchecked")},x)))}));p.displayName="Switch",t.Z=p},22711:function(e,t,n){"use strict";n.r(t),n.d(t,{ResizableTextArea:function(){return T},default:function(){return A}});var i,r=n(54476),o=n(20068),a=n(33885),l=n(94480),s=n(42978),c=n(75931),u=n(92310),h=n.n(u),d=n(36901),p=n(66003),f=n(30292),m=n(18929),v=n(59301),g=n(76190),y=n(29301),b=n(34280),x=n(16089),w="\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n",C=["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"],k={};function S(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&k[n])return k[n];var i=window.getComputedStyle(e),r=i.getPropertyValue("box-sizing")||i.getPropertyValue("-moz-box-sizing")||i.getPropertyValue("-webkit-box-sizing"),o=parseFloat(i.getPropertyValue("padding-bottom"))+parseFloat(i.getPropertyValue("padding-top")),a=parseFloat(i.getPropertyValue("border-bottom-width"))+parseFloat(i.getPropertyValue("border-top-width")),l=C.map((function(e){return"".concat(e,":").concat(i.getPropertyValue(e))})).join(";"),s={sizingStyle:l,paddingSize:o,borderSize:a,boxSizing:r};return t&&n&&(k[n]=s),s}var E=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],M=v.forwardRef((function(e,t){var n=e,l=n.prefixCls,u=n.defaultValue,d=n.value,p=n.autoSize,f=n.onResize,C=n.className,k=n.style,M=n.disabled,T=n.onChange,L=(n.onInternalAutoSize,(0,c.Z)(n,E)),A=(0,m.Z)(u,{value:d,postState:function(e){return null!=e?e:""}}),D=(0,s.Z)(A,2),P=D[0],N=D[1],B=v.useRef();v.useImperativeHandle(t,(function(){return{textArea:B.current}}));var _=v.useMemo((function(){return p&&"object"===(0,g.Z)(p)?[p.minRows,p.maxRows]:[]}),[p]),I=(0,s.Z)(_,2),O=I[0],R=I[1],j=!!p,F=v.useState(2),Z=(0,s.Z)(F,2),z=Z[0],H=Z[1],W=v.useState(),G=(0,s.Z)(W,2),V=G[0],U=G[1],q=function(){H(0)};(0,b.Z)((function(){j&&q()}),[d,O,R,j]),(0,b.Z)((function(){if(0===z)H(1);else if(1===z){var e=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;i||((i=document.createElement("textarea")).setAttribute("tab-index","-1"),i.setAttribute("aria-hidden","true"),i.setAttribute("name","hiddenTextarea"),document.body.appendChild(i)),e.getAttribute("wrap")?i.setAttribute("wrap",e.getAttribute("wrap")):i.removeAttribute("wrap");var o=S(e,t),a=o.paddingSize,l=o.borderSize,s=o.boxSizing,c=o.sizingStyle;i.setAttribute("style","".concat(c,";").concat(w)),i.value=e.value||e.placeholder||"";var u,h=void 0,d=void 0,p=i.scrollHeight;if("border-box"===s?p+=l:"content-box"===s&&(p-=a),null!==n||null!==r){i.value=" ";var f=i.scrollHeight-a;null!==n&&(h=f*n,"border-box"===s&&(h=h+a+l),p=Math.max(h,p)),null!==r&&(d=f*r,"border-box"===s&&(d=d+a+l),u=p>d?"":"hidden",p=Math.min(d,p))}var m={height:p,overflowY:u,resize:"none"};return h&&(m.minHeight=h),d&&(m.maxHeight=d),m}(B.current,!1,O,R);H(2),U(e)}else!function(){try{if(document.activeElement===B.current){var e=B.current,t=e.selectionStart,n=e.selectionEnd,i=e.scrollTop;B.current.setSelectionRange(t,n),B.current.scrollTop=i}}catch(e){}}()}),[z]);var K=v.useRef(),Y=function(){x.Z.cancel(K.current)};v.useEffect((function(){return Y}),[]);var X=j?V:null,J=(0,a.Z)((0,a.Z)({},k),X);return 0!==z&&1!==z||(J.overflowY="hidden",J.overflowX="hidden"),v.createElement(y.Z,{onResize:function(e){2===z&&(null==f||f(e),p&&(Y(),K.current=(0,x.Z)((function(){q()}))))},disabled:!(p||f)},v.createElement("textarea",(0,r.Z)({},L,{ref:B,style:J,className:h()(l,C,(0,o.Z)({},"".concat(l,"-disabled"),M)),disabled:M,value:P,onChange:function(e){N(e.target.value),null==T||T(e)}})))})),T=M,L=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],A=v.forwardRef((function(e,t){var n,i=e.defaultValue,u=e.value,g=e.onFocus,y=e.onBlur,b=e.onChange,x=e.allowClear,w=e.maxLength,C=e.onCompositionStart,k=e.onCompositionEnd,S=e.suffix,E=e.prefixCls,M=void 0===E?"rc-textarea":E,A=e.showCount,D=e.count,P=e.className,N=e.style,B=e.disabled,_=e.hidden,I=e.classNames,O=e.styles,R=e.onResize,j=e.onClear,F=e.onPressEnter,Z=e.readOnly,z=e.autoSize,H=e.onKeyDown,W=(0,c.Z)(e,L),G=(0,m.Z)(i,{value:u,defaultValue:i}),V=(0,s.Z)(G,2),U=V[0],q=V[1],K=null==U?"":String(U),Y=v.useState(!1),X=(0,s.Z)(Y,2),J=X[0],Q=X[1],$=v.useRef(!1),ee=v.useState(null),te=(0,s.Z)(ee,2),ne=te[0],ie=te[1],re=(0,v.useRef)(null),oe=(0,v.useRef)(null),ae=function(){var e;return null===(e=oe.current)||void 0===e?void 0:e.textArea},le=function(){ae().focus()};(0,v.useImperativeHandle)(t,(function(){var e;return{resizableTextArea:oe.current,focus:le,blur:function(){ae().blur()},nativeElement:(null===(e=re.current)||void 0===e?void 0:e.nativeElement)||ae()}})),(0,v.useEffect)((function(){Q((function(e){return!B&&e}))}),[B]);var se=v.useState(null),ce=(0,s.Z)(se,2),ue=ce[0],he=ce[1];v.useEffect((function(){var e;ue&&(e=ae()).setSelectionRange.apply(e,(0,l.Z)(ue))}),[ue]);var de,pe=(0,p.Z)(D,A),fe=null!==(n=pe.max)&&void 0!==n?n:w,me=Number(fe)>0,ve=pe.strategy(K),ge=!!fe&&ve>fe,ye=function(e,t){var n=t;!$.current&&pe.exceedFormatter&&pe.max&&pe.strategy(t)>pe.max&&t!==(n=pe.exceedFormatter(t,{max:pe.max}))&&he([ae().selectionStart||0,ae().selectionEnd||0]),q(n),(0,f.rJ)(e.currentTarget,e,b,n)},be=S;pe.show&&(de=pe.showFormatter?pe.showFormatter({value:K,count:ve,maxLength:fe}):"".concat(ve).concat(me?" / ".concat(fe):""),be=v.createElement(v.Fragment,null,be,v.createElement("span",{className:h()("".concat(M,"-data-count"),null==I?void 0:I.count),style:null==O?void 0:O.count},de)));var xe=!z&&!A&&!x;return v.createElement(d.BaseInput,{ref:re,value:K,allowClear:x,handleReset:function(e){q(""),le(),(0,f.rJ)(ae(),e,b)},suffix:be,prefixCls:M,classNames:(0,a.Z)((0,a.Z)({},I),{},{affixWrapper:h()(null==I?void 0:I.affixWrapper,(0,o.Z)((0,o.Z)({},"".concat(M,"-show-count"),A),"".concat(M,"-textarea-allow-clear"),x))}),disabled:B,focused:J,className:h()(P,ge&&"".concat(M,"-out-of-range")),style:(0,a.Z)((0,a.Z)({},N),ne&&!xe?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":"string"==typeof de?de:void 0}},hidden:_,readOnly:Z,onClear:j},v.createElement(T,(0,r.Z)({},W,{autoSize:z,maxLength:w,onKeyDown:function(e){"Enter"===e.key&&F&&F(e),null==H||H(e)},onChange:function(e){ye(e,e.target.value)},onFocus:function(e){Q(!0),null==g||g(e)},onBlur:function(e){Q(!1),null==y||y(e)},onCompositionStart:function(e){$.current=!0,null==C||C(e)},onCompositionEnd:function(e){$.current=!1,ye(e,e.currentTarget.value),null==k||k(e)},className:h()(null==I?void 0:I.textarea),style:(0,a.Z)((0,a.Z)({},null==O?void 0:O.textarea),{},{resize:null==N?void 0:N.resize}),disabled:B,prefixCls:M,onResize:function(e){var t;null==R||R(e),null!==(t=ae())&&void 0!==t&&t.style.height&&ie(!0)},ref:oe,readOnly:Z})))}))},34643:function(e,t,n){"use strict";n.d(t,{S:function(){return l}});var i=n(48736),r=n(65065);function o(e,t){var n=new Set;return e.forEach((function(e){t.has(e)||n.add(e)})),n}function a(e){var t=e||{},n=t.disabled,i=t.disableCheckbox,r=t.checkable;return!(!n&&!i)||!1===r}function l(e,t,n,l){var s,c=[];s=l||a;var u,h=new Set(e.filter((function(e){var t=!!(0,r.Z)(n,e);return t||c.push(e),t}))),d=new Map,p=0;return Object.keys(n).forEach((function(e){var t=n[e],i=t.level,r=d.get(i);r||(r=new Set,d.set(i,r)),r.add(t),p=Math.max(p,i)})),(0,i.ZP)(!c.length,"Tree missing follow keys: ".concat(c.slice(0,100).map((function(e){return"'".concat(e,"'")})).join(", "))),u=!0===t?function(e,t,n,i){for(var r=new Set(e),a=new Set,l=0;l<=n;l+=1)(t.get(l)||new Set).forEach((function(e){var t=e.key,n=e.node,o=e.children,a=void 0===o?[]:o;r.has(t)&&!i(n)&&a.filter((function(e){return!i(e.node)})).forEach((function(e){r.add(e.key)}))}));for(var s=new Set,c=n;c>=0;c-=1)(t.get(c)||new Set).forEach((function(e){var t=e.parent,n=e.node;if(!i(n)&&e.parent&&!s.has(e.parent.key))if(i(e.parent.node))s.add(t.key);else{var o=!0,l=!1;(t.children||[]).filter((function(e){return!i(e.node)})).forEach((function(e){var t=e.key,n=r.has(t);o&&!n&&(o=!1),l||!n&&!a.has(t)||(l=!0)})),o&&r.add(t.key),l&&a.add(t.key),s.add(t.key)}}));return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(o(a,r))}}(h,d,p,s):function(e,t,n,i,r){for(var a=new Set(e),l=new Set(t),s=0;s<=i;s+=1)(n.get(s)||new Set).forEach((function(e){var t=e.key,n=e.node,i=e.children,o=void 0===i?[]:i;a.has(t)||l.has(t)||r(n)||o.filter((function(e){return!r(e.node)})).forEach((function(e){a.delete(e.key)}))}));l=new Set;for(var c=new Set,u=i;u>=0;u-=1)(n.get(u)||new Set).forEach((function(e){var t=e.parent,n=e.node;if(!r(n)&&e.parent&&!c.has(e.parent.key))if(r(e.parent.node))c.add(t.key);else{var i=!0,o=!1;(t.children||[]).filter((function(e){return!r(e.node)})).forEach((function(e){var t=e.key,n=a.has(t);i&&!n&&(i=!1),o||!n&&!l.has(t)||(o=!0)})),i||a.delete(t.key),o&&l.add(t.key),c.add(t.key)}}));return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(o(l,a))}}(h,t.halfCheckedKeys,d,p,s),u}},65065:function(e,t,n){"use strict";function i(e,t){return e[t]}n.d(t,{Z:function(){return i}})},34061:function(e,t,n){"use strict";n.d(t,{F:function(){return x},H8:function(){return b},I8:function(){return y},km:function(){return p},oH:function(){return v},w$:function(){return f},zn:function(){return m}});var i=n(76190),r=n(94480),o=n(33885),a=n(75931),l=n(11592),s=n(2738),c=n(48736),u=n(65065),h=["children"];function d(e,t){return"".concat(e,"-").concat(t)}function p(e,t){return null!=e?e:t}function f(e){var t=e||{},n=t.title||"title";return{title:n,_title:t._title||[n],key:t.key||"key",children:t.children||"children"}}function m(e){return function e(t){return(0,l.Z)(t).map((function(t){if(!function(e){return e&&e.type&&e.type.isTreeNode}(t))return(0,c.ZP)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var n=t.key,i=t.props,r=i.children,l=(0,a.Z)(i,h),s=(0,o.Z)({key:n},l),u=e(r);return u.length&&(s.children=u),s})).filter((function(e){return e}))}(e)}function v(e,t,n){var i=f(n),o=i._title,a=i.key,l=i.children,c=new Set(!0===t?[]:t),u=[];return function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.map((function(h,f){for(var m,v=d(i?i.pos:"0",f),g=p(h[a],v),y=0;y<o.length;y+=1){var b=o[y];if(void 0!==h[b]){m=h[b];break}}var x=Object.assign((0,s.Z)(h,[].concat((0,r.Z)(o),[a,l])),{title:m,key:g,parent:i,pos:v,children:null,data:h,isStart:[].concat((0,r.Z)(i?i.isStart:[]),[0===f]),isEnd:[].concat((0,r.Z)(i?i.isEnd:[]),[f===n.length-1])});return u.push(x),!0===t||c.has(g)?x.children=e(h[l]||[],x):x.children=[],x}))}(e),u}function g(e,t,n){var o,a=("object"===(0,i.Z)(n)?n:{externalGetKey:n})||{},l=a.childrenPropName,s=a.externalGetKey,c=f(a.fieldNames),u=c.key,h=c.children,m=l||h;s?"string"==typeof s?o=function(e){return e[s]}:"function"==typeof s&&(o=function(e){return s(e)}):o=function(e,t){return p(e[u],t)},function n(i,a,l,s){var c=i?i[m]:e,u=i?d(l.pos,a):"0",h=i?[].concat((0,r.Z)(s),[i]):[];if(i){var p=o(i,u),f={node:i,index:a,pos:u,key:p,parentPos:l.node?l.pos:null,level:l.level+1,nodes:h};t(f)}c&&c.forEach((function(e,t){n(e,t,{node:i,pos:u,level:l?l.level+1:-1},h)}))}(null)}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.initWrapper,i=t.processEntity,r=t.onProcessFinished,o=t.externalGetKey,a=t.childrenPropName,l=t.fieldNames,s=arguments.length>2?arguments[2]:void 0,c=o||s,u={},h={},d={posEntities:u,keyEntities:h};return n&&(d=n(d)||d),g(e,(function(e){var t=e.node,n=e.index,r=e.pos,o=e.key,a=e.parentPos,l=e.level,s={node:t,nodes:e.nodes,index:n,key:o,pos:r,level:l},c=p(o,r);u[r]=s,h[c]=s,s.parent=u[a],s.parent&&(s.parent.children=s.parent.children||[],s.parent.children.push(s)),i&&i(s,d)}),{externalGetKey:c,childrenPropName:a,fieldNames:l}),r&&r(d),d}function b(e,t){var n=t.expandedKeys,i=t.selectedKeys,r=t.loadedKeys,o=t.loadingKeys,a=t.checkedKeys,l=t.halfCheckedKeys,s=t.dragOverNodeKey,c=t.dropPosition,h=t.keyEntities,d=(0,u.Z)(h,e);return{eventKey:e,expanded:-1!==n.indexOf(e),selected:-1!==i.indexOf(e),loaded:-1!==r.indexOf(e),loading:-1!==o.indexOf(e),checked:-1!==a.indexOf(e),halfChecked:-1!==l.indexOf(e),pos:String(d?d.pos:""),dragOver:s===e&&0===c,dragOverGapTop:s===e&&-1===c,dragOverGapBottom:s===e&&1===c}}function x(e){var t=e.data,n=e.expanded,i=e.selected,r=e.checked,a=e.loaded,l=e.loading,s=e.halfChecked,u=e.dragOver,h=e.dragOverGapTop,d=e.dragOverGapBottom,p=e.pos,f=e.active,m=e.eventKey,v=(0,o.Z)((0,o.Z)({},t),{},{expanded:n,selected:i,checked:r,loaded:a,loading:l,halfChecked:s,dragOver:u,dragOverGapTop:h,dragOverGapBottom:d,pos:p,active:f,key:m});return"props"in v||Object.defineProperty(v,"props",{get:function(){return(0,c.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),v}},48911:function(e,t,n){"use strict";n.d(t,{Z:function(){return j}});var i=n(54476),r=n(76190),o=n(33885),a=n(20068),l=n(42978),s=n(75931),c=n(92310),u=n.n(c),h=n(29301),d=n(70425),p=n(34280),f=n(59301),m=n(4676),v=f.forwardRef((function(e,t){var n=e.height,r=e.offsetY,l=e.offsetX,s=e.children,c=e.prefixCls,d=e.onInnerResize,p=e.innerProps,m=e.rtl,v=e.extra,g={},y={display:"flex",flexDirection:"column"};return void 0!==r&&(g={height:n,position:"relative",overflow:"hidden"},y=(0,o.Z)((0,o.Z)({},y),{},(0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)({transform:"translateY(".concat(r,"px)")},m?"marginRight":"marginLeft",-l),"position","absolute"),"left",0),"right",0),"top",0))),f.createElement("div",{style:g},f.createElement(h.Z,{onResize:function(e){e.offsetHeight&&d&&d()}},f.createElement("div",(0,i.Z)({style:y,className:u()((0,a.Z)({},"".concat(c,"-holder-inner"),c)),ref:t},p),s,v)))}));v.displayName="Filler";var g=v;function y(e){var t=e.children,n=e.setRef,i=f.useCallback((function(e){n(e)}),[]);return f.cloneElement(t,{ref:i})}function b(e,t,n){var i=f.useState(e),r=(0,l.Z)(i,2),o=r[0],a=r[1],s=f.useState(null),c=(0,l.Z)(s,2),u=c[0],h=c[1];return f.useEffect((function(){var i=function(e,t,n){var i,r,o=e.length,a=t.length;if(0===o&&0===a)return null;o<a?(i=e,r=t):(i=t,r=e);var l={__EMPTY_ITEM__:!0};function s(e){return void 0!==e?n(e):l}for(var c=null,u=1!==Math.abs(o-a),h=0;h<r.length;h+=1){var d=s(i[h]);if(d!==s(r[h])){c=h,u=u||d!==s(r[h+1]);break}}return null===c?null:{index:c,multiple:u}}(o||[],e||[],t);void 0!==(null==i?void 0:i.index)&&(null==n||n(i.index),h(e[i.index])),a(e)}),[e]),[u]}var x=n(16089),w="object"===("undefined"==typeof navigator?"undefined":(0,r.Z)(navigator))&&/Firefox/i.test(navigator.userAgent),C=function(e,t,n,i){var r=(0,f.useRef)(!1),o=(0,f.useRef)(null);function a(){clearTimeout(o.current),r.current=!0,o.current=setTimeout((function(){r.current=!1}),50)}var l=(0,f.useRef)({top:e,bottom:t,left:n,right:i});return l.current.top=e,l.current.bottom=t,l.current.left=n,l.current.right=i,function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e?t<0&&l.current.left||t>0&&l.current.right:t<0&&l.current.top||t>0&&l.current.bottom;return n&&i?(clearTimeout(o.current),r.current=!1):i&&!r.current||a(),!r.current&&i}};function k(e,t,n,i,r,o,a){var l=(0,f.useRef)(0),s=(0,f.useRef)(null),c=(0,f.useRef)(null),u=(0,f.useRef)(!1),h=C(t,n,i,r);var d=(0,f.useRef)(null),p=(0,f.useRef)(null);return[function(t){if(e){x.Z.cancel(p.current),p.current=(0,x.Z)((function(){d.current=null}),2);var n=t.deltaX,i=t.deltaY,r=t.shiftKey,f=n,m=i;("sx"===d.current||!d.current&&r&&i&&!n)&&(f=i,m=0,d.current="sx");var v=Math.abs(f),g=Math.abs(m);null===d.current&&(d.current=o&&v>g?"x":"y"),"y"===d.current?function(e,t){if(x.Z.cancel(s.current),!h(!1,t)){var n=e;n._virtualHandled||(n._virtualHandled=!0,l.current+=t,c.current=t,w||n.preventDefault(),s.current=(0,x.Z)((function(){var e=u.current?10:1;a(l.current*e,!1),l.current=0})))}}(t,m):function(e,t){a(t,!0),w||e.preventDefault()}(t,f)}},function(t){e&&(u.current=t.detail===c.current)}]}var S=n(67732),E=n(83652),M=function(){function e(){(0,S.Z)(this,e),(0,a.Z)(this,"maps",void 0),(0,a.Z)(this,"id",0),(0,a.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,E.Z)(e,[{key:"set",value:function(e,t){this.diffRecords.set(e,this.maps[e]),this.maps[e]=t,this.id+=1}},{key:"get",value:function(e){return this.maps[e]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),e}();function T(e){var t=parseFloat(e);return isNaN(t)?0:t}var L=14/15;function A(e){return Math.floor(Math.pow(e,.5))}function D(e,t){return("touches"in e?e.touches[0]:e)[t?"pageX":"pageY"]-window[t?"scrollX":"scrollY"]}var P=f.forwardRef((function(e,t){var n=e.prefixCls,i=e.rtl,r=e.scrollOffset,s=e.scrollRange,c=e.onStartMove,h=e.onStopMove,d=e.onScroll,p=e.horizontal,m=e.spinSize,v=e.containerSize,g=e.style,y=e.thumbStyle,b=e.showScrollBar,w=f.useState(!1),C=(0,l.Z)(w,2),k=C[0],S=C[1],E=f.useState(null),M=(0,l.Z)(E,2),T=M[0],L=M[1],A=f.useState(null),P=(0,l.Z)(A,2),N=P[0],B=P[1],_=!i,I=f.useRef(),O=f.useRef(),R=f.useState(b),j=(0,l.Z)(R,2),F=j[0],Z=j[1],z=f.useRef(),H=function(){!0!==b&&!1!==b&&(clearTimeout(z.current),Z(!0),z.current=setTimeout((function(){Z(!1)}),3e3))},W=s-v||0,G=v-m||0,V=f.useMemo((function(){return 0===r||0===W?0:r/W*G}),[r,W,G]),U=f.useRef({top:V,dragging:k,pageY:T,startTop:N});U.current={top:V,dragging:k,pageY:T,startTop:N};var q=function(e){S(!0),L(D(e,p)),B(U.current.top),c(),e.stopPropagation(),e.preventDefault()};f.useEffect((function(){var e=function(e){e.preventDefault()},t=I.current,n=O.current;return t.addEventListener("touchstart",e,{passive:!1}),n.addEventListener("touchstart",q,{passive:!1}),function(){t.removeEventListener("touchstart",e),n.removeEventListener("touchstart",q)}}),[]);var K=f.useRef();K.current=W;var Y=f.useRef();Y.current=G,f.useEffect((function(){if(k){var e,t=function(t){var n=U.current,i=n.dragging,r=n.pageY,o=n.startTop;x.Z.cancel(e);var a=I.current.getBoundingClientRect(),l=v/(p?a.width:a.height);if(i){var s=(D(t,p)-r)*l,c=o;!_&&p?c-=s:c+=s;var u=K.current,h=Y.current,f=h?c/h:0,m=Math.ceil(f*u);m=Math.max(m,0),m=Math.min(m,u),e=(0,x.Z)((function(){d(m,p)}))}},n=function(){S(!1),h()};return window.addEventListener("mousemove",t,{passive:!0}),window.addEventListener("touchmove",t,{passive:!0}),window.addEventListener("mouseup",n,{passive:!0}),window.addEventListener("touchend",n,{passive:!0}),function(){window.removeEventListener("mousemove",t),window.removeEventListener("touchmove",t),window.removeEventListener("mouseup",n),window.removeEventListener("touchend",n),x.Z.cancel(e)}}}),[k]),f.useEffect((function(){return H(),function(){clearTimeout(z.current)}}),[r]),f.useImperativeHandle(t,(function(){return{delayHidden:H}}));var X="".concat(n,"-scrollbar"),J={position:"absolute",visibility:F?null:"hidden"},Q={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return p?(Object.assign(J,{height:8,left:0,right:0,bottom:0}),Object.assign(Q,(0,a.Z)({height:"100%",width:m},_?"left":"right",V))):(Object.assign(J,(0,a.Z)({width:8,top:0,bottom:0},_?"right":"left",0)),Object.assign(Q,{width:"100%",height:m,top:V})),f.createElement("div",{ref:I,className:u()(X,(0,a.Z)((0,a.Z)((0,a.Z)({},"".concat(X,"-horizontal"),p),"".concat(X,"-vertical"),!p),"".concat(X,"-visible"),F)),style:(0,o.Z)((0,o.Z)({},J),g),onMouseDown:function(e){e.stopPropagation(),e.preventDefault()},onMouseMove:H},f.createElement("div",{ref:O,className:u()("".concat(X,"-thumb"),(0,a.Z)({},"".concat(X,"-thumb-moving"),k)),style:(0,o.Z)((0,o.Z)({},Q),y),onMouseDown:q}))}));function N(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e/t*e;return isNaN(n)&&(n=0),n=Math.max(n,20),Math.floor(n)}var B=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],_=[],I={overflowY:"auto",overflowAnchor:"none"};function O(e,t){var n=e.prefixCls,c=void 0===n?"rc-virtual-list":n,v=e.className,w=e.height,S=e.itemHeight,E=e.fullHeight,O=void 0===E||E,R=e.style,j=e.data,F=e.children,Z=e.itemKey,z=e.virtual,H=e.direction,W=e.scrollWidth,G=e.component,V=void 0===G?"div":G,U=e.onScroll,q=e.onVirtualScroll,K=e.onVisibleChange,Y=e.innerProps,X=e.extraRender,J=e.styles,Q=e.showScrollBar,$=void 0===Q?"optional":Q,ee=(0,s.Z)(e,B),te=f.useCallback((function(e){return"function"==typeof Z?Z(e):null==e?void 0:e[Z]}),[Z]),ne=function(e,t,n){var i=f.useState(0),r=(0,l.Z)(i,2),o=r[0],a=r[1],s=(0,f.useRef)(new Map),c=(0,f.useRef)(new M),u=(0,f.useRef)(0);function h(){u.current+=1}function d(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];h();var t=function(){var e=!1;s.current.forEach((function(t,n){if(t&&t.offsetParent){var i=t.offsetHeight,r=getComputedStyle(t),o=r.marginTop,a=r.marginBottom,l=i+T(o)+T(a);c.current.get(n)!==l&&(c.current.set(n,l),e=!0)}})),e&&a((function(e){return e+1}))};if(e)t();else{u.current+=1;var n=u.current;Promise.resolve().then((function(){n===u.current&&t()}))}}return(0,f.useEffect)((function(){return h}),[]),[function(i,r){var o=e(i),a=s.current.get(o);r?(s.current.set(o,r),d()):s.current.delete(o),!a!=!r&&(r?null==t||t(i):null==n||n(i))},d,c.current,o]}(te,null,null),ie=(0,l.Z)(ne,4),re=ie[0],oe=ie[1],ae=ie[2],le=ie[3],se=!(!1===z||!w||!S),ce=f.useMemo((function(){return Object.values(ae.maps).reduce((function(e,t){return e+t}),0)}),[ae.id,ae.maps]),ue=se&&j&&(Math.max(S*j.length,ce)>w||!!W),he="rtl"===H,de=u()(c,(0,a.Z)({},"".concat(c,"-rtl"),he),v),pe=j||_,fe=(0,f.useRef)(),me=(0,f.useRef)(),ve=(0,f.useRef)(),ge=(0,f.useState)(0),ye=(0,l.Z)(ge,2),be=ye[0],xe=ye[1],we=(0,f.useState)(0),Ce=(0,l.Z)(we,2),ke=Ce[0],Se=Ce[1],Ee=(0,f.useState)(!1),Me=(0,l.Z)(Ee,2),Te=Me[0],Le=Me[1],Ae=function(){Le(!0)},De=function(){Le(!1)},Pe={getKey:te};function Ne(e){xe((function(t){var n=function(e){var t=e;Number.isNaN(Je.current)||(t=Math.min(t,Je.current));return t=Math.max(t,0),t}("function"==typeof e?e(t):e);return fe.current.scrollTop=n,n}))}var Be=(0,f.useRef)({start:0,end:pe.length}),_e=(0,f.useRef)(),Ie=b(pe,te),Oe=(0,l.Z)(Ie,1)[0];_e.current=Oe;var Re=f.useMemo((function(){if(!se)return{scrollHeight:void 0,start:0,end:pe.length-1,offset:void 0};var e;if(!ue)return{scrollHeight:(null===(e=me.current)||void 0===e?void 0:e.offsetHeight)||0,start:0,end:pe.length-1,offset:void 0};for(var t,n,i,r=0,o=pe.length,a=0;a<o;a+=1){var l=pe[a],s=te(l),c=ae.get(s),u=r+(void 0===c?S:c);u>=be&&void 0===t&&(t=a,n=r),u>be+w&&void 0===i&&(i=a),r=u}return void 0===t&&(t=0,n=0,i=Math.ceil(w/S)),void 0===i&&(i=pe.length-1),{scrollHeight:r,start:t,end:i=Math.min(i+1,pe.length-1),offset:n}}),[ue,se,be,pe,le,w]),je=Re.scrollHeight,Fe=Re.start,Ze=Re.end,ze=Re.offset;Be.current.start=Fe,Be.current.end=Ze,f.useLayoutEffect((function(){var e=ae.getRecord();if(1===e.size){var t=Array.from(e.keys())[0],n=e.get(t),i=pe[Fe];if(i&&void 0===n)if(te(i)===t){var r=ae.get(t)-S;Ne((function(e){return e+r}))}}ae.resetRecord()}),[je]);var He=f.useState({width:0,height:w}),We=(0,l.Z)(He,2),Ge=We[0],Ve=We[1],Ue=(0,f.useRef)(),qe=(0,f.useRef)(),Ke=f.useMemo((function(){return N(Ge.width,W)}),[Ge.width,W]),Ye=f.useMemo((function(){return N(Ge.height,je)}),[Ge.height,je]),Xe=je-w,Je=(0,f.useRef)(Xe);Je.current=Xe;var Qe=be<=0,$e=be>=Xe,et=ke<=0,tt=ke>=W,nt=C(Qe,$e,et,tt),it=function(){return{x:he?-ke:ke,y:be}},rt=(0,f.useRef)(it()),ot=(0,d.zX)((function(e){if(q){var t=(0,o.Z)((0,o.Z)({},it()),e);rt.current.x===t.x&&rt.current.y===t.y||(q(t),rt.current=t)}}));function at(e,t){var n=e;t?((0,m.flushSync)((function(){Se(n)})),ot()):Ne(n)}var lt=function(e){var t=e,n=W?W-Ge.width:0;return t=Math.max(t,0),t=Math.min(t,n)},st=(0,d.zX)((function(e,t){t?((0,m.flushSync)((function(){Se((function(t){return lt(t+(he?-e:e))}))})),ot()):Ne((function(t){return t+e}))})),ct=k(se,Qe,$e,et,tt,!!W,st),ut=(0,l.Z)(ct,2),ht=ut[0],dt=ut[1];!function(e,t,n){var i,r=(0,f.useRef)(!1),o=(0,f.useRef)(0),a=(0,f.useRef)(0),l=(0,f.useRef)(null),s=(0,f.useRef)(null),c=function(e){if(r.current){var t=Math.ceil(e.touches[0].pageX),i=Math.ceil(e.touches[0].pageY),l=o.current-t,c=a.current-i,u=Math.abs(l)>Math.abs(c);u?o.current=t:a.current=i;var h=n(u,u?l:c,!1,e);h&&e.preventDefault(),clearInterval(s.current),h&&(s.current=setInterval((function(){u?l*=L:c*=L;var e=Math.floor(u?l:c);(!n(u,e,!0)||Math.abs(e)<=.1)&&clearInterval(s.current)}),16))}},u=function(){r.current=!1,i()},h=function(e){i(),1!==e.touches.length||r.current||(r.current=!0,o.current=Math.ceil(e.touches[0].pageX),a.current=Math.ceil(e.touches[0].pageY),l.current=e.target,l.current.addEventListener("touchmove",c,{passive:!1}),l.current.addEventListener("touchend",u,{passive:!0}))};i=function(){l.current&&(l.current.removeEventListener("touchmove",c),l.current.removeEventListener("touchend",u))},(0,p.Z)((function(){return e&&t.current.addEventListener("touchstart",h,{passive:!0}),function(){var e;null===(e=t.current)||void 0===e||e.removeEventListener("touchstart",h),i(),clearInterval(s.current)}}),[e])}(se,fe,(function(e,t,n,i){var r=i;return!nt(e,t,n)&&((!r||!r._virtualHandled)&&(r&&(r._virtualHandled=!0),ht({preventDefault:function(){},deltaX:e?t:0,deltaY:e?0:t}),!0))})),function(e,t,n){f.useEffect((function(){var i=t.current;if(e&&i){var r,o,a=!1,l=function(){x.Z.cancel(r)},s=function e(){l(),r=(0,x.Z)((function(){n(o),e()}))},c=function(){a=!1,l()},u=function(e){if(!e.target.draggable&&0===e.button){var t=e;t._virtualHandled||(t._virtualHandled=!0,a=!0)}},h=function(e){if(a){var t=D(e,!1),n=i.getBoundingClientRect(),r=n.top,c=n.bottom;t<=r?(o=-A(r-t),s()):t>=c?(o=A(t-c),s()):l()}};return i.addEventListener("mousedown",u),i.ownerDocument.addEventListener("mouseup",c),i.ownerDocument.addEventListener("mousemove",h),i.ownerDocument.addEventListener("dragend",c),function(){i.removeEventListener("mousedown",u),i.ownerDocument.removeEventListener("mouseup",c),i.ownerDocument.removeEventListener("mousemove",h),i.ownerDocument.removeEventListener("dragend",c),l()}}}),[e])}(ue,fe,(function(e){Ne((function(t){return t+e}))})),(0,p.Z)((function(){function e(e){var t=Qe&&e.detail<0,n=$e&&e.detail>0;!se||t||n||e.preventDefault()}var t=fe.current;return t.addEventListener("wheel",ht,{passive:!1}),t.addEventListener("DOMMouseScroll",dt,{passive:!0}),t.addEventListener("MozMousePixelScroll",e,{passive:!1}),function(){t.removeEventListener("wheel",ht),t.removeEventListener("DOMMouseScroll",dt),t.removeEventListener("MozMousePixelScroll",e)}}),[se,Qe,$e]),(0,p.Z)((function(){if(W){var e=lt(ke);Se(e),ot({x:e})}}),[Ge.width,W]);var pt=function(){var e,t;null===(e=Ue.current)||void 0===e||e.delayHidden(),null===(t=qe.current)||void 0===t||t.delayHidden()},ft=function(e,t,n,i,a,s,c,u){var h=f.useRef(),d=f.useState(null),m=(0,l.Z)(d,2),v=m[0],g=m[1];return(0,p.Z)((function(){if(v&&v.times<10){if(!e.current)return void g((function(e){return(0,o.Z)({},e)}));s();var r=v.targetAlign,l=v.originAlign,u=v.index,h=v.offset,d=e.current.clientHeight,p=!1,f=r,m=null;if(d){for(var y=r||l,b=0,x=0,w=0,C=Math.min(t.length-1,u),k=0;k<=C;k+=1){var S=a(t[k]);x=b;var E=n.get(S);b=w=x+(void 0===E?i:E)}for(var M="top"===y?h:d-h,T=C;T>=0;T-=1){var L=a(t[T]),A=n.get(L);if(void 0===A){p=!0;break}if((M-=A)<=0)break}switch(y){case"top":m=x-h;break;case"bottom":m=w-d+h;break;default:var D=e.current.scrollTop;x<D?f="top":w>D+d&&(f="bottom")}null!==m&&c(m),m!==v.lastTop&&(p=!0)}p&&g((0,o.Z)((0,o.Z)({},v),{},{times:v.times+1,targetAlign:f,lastTop:m}))}}),[v,e.current]),function(e){if(null!=e){if(x.Z.cancel(h.current),"number"==typeof e)c(e);else if(e&&"object"===(0,r.Z)(e)){var n,i=e.align;n="index"in e?e.index:t.findIndex((function(t){return a(t)===e.key}));var o=e.offset;g({times:0,index:n,offset:void 0===o?0:o,originAlign:i})}}else u()}}(fe,pe,ae,S,te,(function(){return oe(!0)}),Ne,pt);f.useImperativeHandle(t,(function(){return{nativeElement:ve.current,getScrollInfo:it,scrollTo:function(e){var t;(t=e)&&"object"===(0,r.Z)(t)&&("left"in t||"top"in t)?(void 0!==e.left&&Se(lt(e.left)),ft(e.top)):ft(e)}}})),(0,p.Z)((function(){if(K){var e=pe.slice(Fe,Ze+1);K(e,pe)}}),[Fe,Ze,pe]);var mt=function(e,t,n,i){var r=f.useMemo((function(){return[new Map,[]]}),[e,n.id,i]),o=(0,l.Z)(r,2),a=o[0],s=o[1];return function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,l=a.get(r),c=a.get(o);if(void 0===l||void 0===c)for(var u=e.length,h=s.length;h<u;h+=1){var d,p=e[h],f=t(p);a.set(f,h);var m=null!==(d=n.get(f))&&void 0!==d?d:i;if(s[h]=(s[h-1]||0)+m,f===r&&(l=h),f===o&&(c=h),void 0!==l&&void 0!==c)break}return{top:s[l-1]||0,bottom:s[c]}}}(pe,te,ae,S),vt=null==X?void 0:X({start:Fe,end:Ze,virtual:ue,offsetX:ke,offsetY:ze,rtl:he,getSize:mt}),gt=function(e,t,n,i,r,o,a,l){var s=l.getKey;return e.slice(t,n+1).map((function(e,n){var l=a(e,t+n,{style:{width:i},offsetX:r}),c=s(e);return f.createElement(y,{key:c,setRef:function(t){return o(e,t)}},l)}))}(pe,Fe,Ze,W,ke,re,F,Pe),yt=null;w&&(yt=(0,o.Z)((0,a.Z)({},O?"height":"maxHeight",w),I),se&&(yt.overflowY="hidden",W&&(yt.overflowX="hidden"),Te&&(yt.pointerEvents="none")));var bt={};return he&&(bt.dir="rtl"),f.createElement("div",(0,i.Z)({ref:ve,style:(0,o.Z)((0,o.Z)({},R),{},{position:"relative"}),className:de},bt,ee),f.createElement(h.Z,{onResize:function(e){Ve({width:e.offsetWidth,height:e.offsetHeight})}},f.createElement(V,{className:"".concat(c,"-holder"),style:yt,ref:fe,onScroll:function(e){var t=e.currentTarget.scrollTop;t!==be&&Ne(t),null==U||U(e),ot()},onMouseEnter:pt},f.createElement(g,{prefixCls:c,height:je,offsetX:ke,offsetY:ze,scrollWidth:W,onInnerResize:oe,ref:me,innerProps:Y,rtl:he,extra:vt},gt))),ue&&je>w&&f.createElement(P,{ref:Ue,prefixCls:c,scrollOffset:be,scrollRange:je,rtl:he,onScroll:at,onStartMove:Ae,onStopMove:De,spinSize:Ye,containerSize:Ge.height,style:null==J?void 0:J.verticalScrollBar,thumbStyle:null==J?void 0:J.verticalScrollBarThumb,showScrollBar:$}),ue&&W>Ge.width&&f.createElement(P,{ref:qe,prefixCls:c,scrollOffset:ke,scrollRange:W,rtl:he,onScroll:at,onStartMove:Ae,onStopMove:De,spinSize:Ke,containerSize:Ge.width,horizontal:!0,style:null==J?void 0:J.horizontalScrollBar,thumbStyle:null==J?void 0:J.horizontalScrollBarThumb,showScrollBar:$}))}var R=f.forwardRef(O);R.displayName="List";var j=R},93314:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},16722:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});const i=e=>"object"==typeof e&&null!=e&&1===e.nodeType,r=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,o=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return r(n.overflowY,t)||r(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},a=(e,t,n,i,r,o,a,l)=>o<e&&a>t||o>e&&a<t?0:o<=e&&l<=n||a>=t&&l>=n?o-e-i:a>t&&l<n||o<e&&l>n?a-t+r:0,l=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t},s=(e,t)=>{var n,r,s,c;if("undefined"==typeof document)return[];const{scrollMode:u,block:h,inline:d,boundary:p,skipOverflowHiddenElements:f}=t,m="function"==typeof p?p:e=>e!==p;if(!i(e))throw new TypeError("Invalid target");const v=document.scrollingElement||document.documentElement,g=[];let y=e;for(;i(y)&&m(y);){if(y=l(y),y===v){g.push(y);break}null!=y&&y===document.body&&o(y)&&!o(document.documentElement)||null!=y&&o(y,f)&&g.push(y)}const b=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,x=null!=(c=null==(s=window.visualViewport)?void 0:s.height)?c:innerHeight,{scrollX:w,scrollY:C}=window,{height:k,width:S,top:E,right:M,bottom:T,left:L}=e.getBoundingClientRect(),{top:A,right:D,bottom:P,left:N}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let B="start"===h||"nearest"===h?E-A:"end"===h?T+P:E+k/2-A+P,_="center"===d?L+S/2-N+D:"end"===d?M+D:L-N;const I=[];for(let e=0;e<g.length;e++){const t=g[e],{height:n,width:i,top:r,right:l,bottom:s,left:c}=t.getBoundingClientRect();if("if-needed"===u&&E>=0&&L>=0&&T<=x&&M<=b&&(t===v&&!o(t)||E>=r&&T<=s&&L>=c&&M<=l))return I;const p=getComputedStyle(t),f=parseInt(p.borderLeftWidth,10),m=parseInt(p.borderTopWidth,10),y=parseInt(p.borderRightWidth,10),A=parseInt(p.borderBottomWidth,10);let D=0,P=0;const N="offsetWidth"in t?t.offsetWidth-t.clientWidth-f-y:0,O="offsetHeight"in t?t.offsetHeight-t.clientHeight-m-A:0,R="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,j="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(v===t)D="start"===h?B:"end"===h?B-x:"nearest"===h?a(C,C+x,x,m,A,C+B,C+B+k,k):B-x/2,P="start"===d?_:"center"===d?_-b/2:"end"===d?_-b:a(w,w+b,b,f,y,w+_,w+_+S,S),D=Math.max(0,D+C),P=Math.max(0,P+w);else{D="start"===h?B-r-m:"end"===h?B-s+A+O:"nearest"===h?a(r,s,n,m,A+O,B,B+k,k):B-(r+n/2)+O/2,P="start"===d?_-c-f:"center"===d?_-(c+i/2)+N/2:"end"===d?_-l+y+N:a(c,l,i,f,y+N,_,_+S,S);const{scrollLeft:e,scrollTop:o}=t;D=0===j?0:Math.max(0,Math.min(o+D/j,t.scrollHeight-n/j+O)),P=0===R?0:Math.max(0,Math.min(e+P/R,t.scrollWidth-i/R+N)),B+=o-D,_+=e-P}I.push({el:t,top:D,left:P})}return I};function c(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;const n=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>"object"==typeof e&&"function"==typeof e.behavior)(t))return t.behavior(s(e,t));const i="boolean"==typeof t||null==t?void 0:t.behavior;for(const{el:r,top:o,left:a}of s(e,(e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"})(t))){const e=o-n.top+n.bottom,t=a-n.left+n.right;r.scroll({top:e,left:t,behavior:i})}}}}]);