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.
1159 lines
1.8 MiB
1159 lines
1.8 MiB
!(function(){var oS=Object.defineProperty,sS=Object.defineProperties;var aS=Object.getOwnPropertyDescriptors;var Jm=Object.getOwnPropertySymbols;var yw=Object.prototype.hasOwnProperty,xw=Object.prototype.propertyIsEnumerable;var mw=(Li,ai,Mt)=>ai in Li?oS(Li,ai,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):Li[ai]=Mt,dc=(Li,ai)=>{for(var Mt in ai||(ai={}))yw.call(ai,Mt)&&mw(Li,Mt,ai[Mt]);if(Jm)for(var Mt of Jm(ai))xw.call(ai,Mt)&&mw(Li,Mt,ai[Mt]);return Li},Yy=(Li,ai)=>sS(Li,aS(ai));var ww=(Li,ai)=>{var Mt={};for(var pt in Li)yw.call(Li,pt)&&ai.indexOf(pt)<0&&(Mt[pt]=Li[pt]);if(Li!=null&&Jm)for(var pt of Jm(Li))ai.indexOf(pt)<0&&xw.call(Li,pt)&&(Mt[pt]=Li[pt]);return Mt};(self.webpackChunk=self.webpackChunk||[]).push([[8447],{4887:function(){"use strict"},27431:function(Li,ai){"use strict";ai.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},47114:function(Li,ai){"use strict";ai.Z={flex_box_center:"flex_box_center___vG4eV",flex_space_between:"flex_space_between___qVVxe",flex_box_vertical_center:"flex_box_vertical_center___P8Z8s",flex_box_center_end:"flex_box_center_end___VMme3",flex_box_column:"flex_box_column___VMHwm",dropdownmenus:"dropdownmenus___oVzoj",popupClassNames:"popupClassNames___OcZq7",selectdown:"selectdown___mmcA8"}},63089:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(){if(typeof window.GGBApplet=="function"){console.warn("deployggb.js was loaded twice");return}var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var Li={},ai="5.0",Mt={},pt=null,_t=!1,ce=!1,me=null,Ut=!1,fe=null,$t=null,Ae=0;Ae<arguments.length;Ae++){var re=arguments[Ae];if(re!==null)switch(typeof re){case"number":ai=re.toFixed(1);break;case"string":re.match(new RegExp("^[0-9]\\.[0-9]+$"))?ai=re:me=re;break;case"object":typeof re.is3D!="undefined"?pt=re:Mt=re;break;case"boolean":_t=re,ce=!0;break}}pt===null&&(pt={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},Mt.material_id!==void 0&&!ce&&(_t=!0)),me!==null&&Mt.id===void 0&&(Mt.id=me);var Dt="",de="",zt=!1,Ne=null,ue=null,qt=null,Qt=!1,Jt=null,Pe=null,je=null,De=null,Yt=null;Mt.height!==void 0&&(Mt.height=Math.round(Mt.height)),Mt.width!==void 0&&(Mt.width=Math.round(Mt.width));var Vt=function(oe){return parseFloat(oe)>4?parseFloat(oe):5};Li.setHTML5Codebase=function(oe,Ve){$t=oe,ge(oe,Ve)},Li.setJavaCodebase=Li.setJavaCodebaseVersion=Li.isCompiledInstalled=Li.setPreCompiledScriptPath=Li.setPreCompiledResourcePath=function(){},Li.setHTML5CodebaseVersion=function(oe,Ve){var Ze=parseFloat(oe);if(Ze!==NaN&&Ze<5){console.log("The GeoGebra HTML5 codebase version "+Ze+" is deprecated. Using version latest instead.");return}fe=oe,bt(oe,Ve)},Li.getHTML5CodebaseVersion=function(){return ue},Li.getParameters=function(){return Mt},Li.setFontsCSSURL=function(oe){De=oe},Li.setGiacJSURL=function(oe){},Li.setJNLPFile=function(oe){Dt=oe},Li.setJNLPBaseDir=function(oe){},Li.inject=function(){function oe(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var Ve="auto",Ze=Mt.id,Ni,Se=!1,ie=0;ie<arguments.length;ie++){var ee=arguments[ie];typeof ee=="string"?(ee=ee.toLowerCase(),ee.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?Ve=ee:Ze=arguments[ie]):typeof ee=="boolean"?Se=ee:ee instanceof HTMLElement&&(Ni=ee)}ve();function ve(){if(!Ut){setTimeout(ve,200);return}Ve=oi(Ve);var ti=Ni||document.getElementById(Ze);if(!ti){console.log("possibly bug on ajax loading? ");return}if(Li.removeExistingApplet(ti,!1),Mt.width===void 0&&ti.clientWidth&&(Mt.width=ti.clientWidth),Mt.height===void 0&&ti.clientHeight&&(Mt.height=ti.clientHeight),!(Mt.width&&Mt.height)&&Ve==="html5"&&(delete Mt.width,delete Mt.height),Ne=Ve,Ve==="screenshot")ye(ti,Mt);else{var he=!1;Mt.hasOwnProperty("playButton")&&Mt.playButton||Mt.hasOwnProperty("clickToLoad")&&Mt.clickToLoad?he=!0:Mt.hasOwnProperty("playButtonAutoDecide")&&Mt.playButtonAutoDecide&&(he=(!pe()||oe())&&Xt()),he?(Ne="screenshot",Ai(ti,Mt,Se,Ve)):Re(ti,Mt,Se)}}};function pe(){try{return window.self!==window.top}catch(oe){return!0}}function Xt(){return Mt.hasOwnProperty("screenshotGenerator")&&Mt.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}Li.getViews=function(){return pt},Li.isJavaInstalled=function(){return!1};var Le=function(oe){var Ve=function(ie){var ee=JSON.parse(ie),ve=function(We){return We.type=="G"||We.type=="E"},ti=ee.elements?ee.elements.filter(ve)[0]:ee;if(!ti||!ti.url){Ze();return}Mt.fileName=ti.url,Wt(ti.settings||{}),pt.is3D=!0;var he="https://www.geogebra.org/images/";Li.setPreviewImage(Jt||ti.previewUrl,he+"GeoGebra_loading.png",he+"applet_play.png"),oe()},Ze=function(){Mt.onError&&Mt.onError(),Ge("Error: Fetching material (id "+Mt.material_id+") failed.",Mt)},Ni=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",Se="/materials/"+Mt.material_id+"?scope=basic";Ce("https://"+Ni+"/api/proxy.php?path="+encodeURIComponent(Se),Ve,Ze)};function Wt(oe){var Ve=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(Ze){oe[Ze]=!!oe[Ze]}),Ve.forEach(function(Ze){Mt[Ze]===void 0&&oe[Ze]!==void 0&&(Mt[Ze]=oe[Ze])}),Mt.showToolBarHelp===void 0&&(Mt.showToolBarHelp=Mt.showToolBar)}function Ce(oe,Ve,Ze){var Ni=new XMLHttpRequest;Ni.open("GET",oe),Ni.onload=function(){Ve(Ni.responseText)},Ni.onerror=Ze,Ni.send()}Li.isHTML5Installed=function(){return!0},Li.getLoadedAppletType=function(){return Ne},Li.setPreviewImage=function(oe,Ve,Ze){Jt=oe,Pe=Ve,je=Ze},Li.removeExistingApplet=function(oe,Ve){var Ze;typeof oe=="string"&&(oe=document.getElementById(oe)),Ne=null;var Ni=null;for(Ze=0;Ze<oe.childNodes.length;Ze++){var Se=oe.childNodes[Ze],ie=Se.className;ie==="applet_screenshot"?Ve?(Se.style.display="block",Ne="screenshot"):Se.style.display="none":ie!=="applet_scaler prerender"&&(oe.removeChild(Se),Ni=ie&&ie.indexOf("appletParameters")!=-1?Se.id:null,Ze--)}var ee=Mt.id!==void 0?Mt.id:Ni,ve=window[ee];ve&&typeof ve.getBase64=="function"&&(ve.remove(),window[ee]=null)},Li.refreshHitPoints=function(){if(Vt(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var oe=Li.getAppletObject();return oe&&typeof oe.recalculateEnvironments=="function"?(oe.recalculateEnvironments(),!0):!1},Li.startAnimation=function(){var oe=Li.getAppletObject();return oe&&typeof oe.startAnimation=="function"?(oe.startAnimation(),!0):!1},Li.stopAnimation=function(){var oe=Li.getAppletObject();return oe&&typeof oe.stopAnimation=="function"?(oe.stopAnimation(),!0):!1},Li.getAppletObject=function(){var oe=Mt.id!==void 0?Mt.id:"ggbApplet";return window[oe]},Li.resize=function(){};var Te=function(oe,Ve,Ze){var Ni=document.createElement("param");Ni.setAttribute("name",Ve),Ni.setAttribute("value",Ze),oe.appendChild(Ni)},ne=function(oe){return oe&&oe!=="false"},Re=function(oe,Ve,Ze){Vt(ue)<=4.2&&(Ze=!0);var Ni=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==ue||ggbHTML5LoadedCodebaseIsWebSimple&&!Qt)&&(Ni=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var Se=document.createElement("div");Se.classList.add("appletParameters","notranslate");var ie=Ve.width,ee=Ve.height;if(Ve.disableAutoScale=Ve.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():Ve.disableAutoScale,Ve.width!==void 0)if(Vt(ue)<=4.4)ne(Ve.showToolBar)&&(Ve.height-=7),ne(Ve.showAlgebraInput)&&(Ve.height-=37),Ve.width<605&&ne(Ve.showToolBar)&&(Ve.width=605,ie=605);else{var ve=100;(ne(Ve.showToolBar)||ne(Ve.showMenuBar))&&(Ve.hasOwnProperty("customToolBar")&&(Ve.customToolbar=Ve.customToolBar),ve=ne(Ve.showMenuBar)?245:155),ie<ve&&(Ve.width=ve,ie=ve)}Se.style.border="none",Se.style.display="inline-block";for(var ti in Ve)Ve.hasOwnProperty(ti)&&ti!=="appletOnLoad"&&Se.setAttribute("data-param-"+ti,Ve[ti]);De&&Se.setAttribute("data-param-fontscssurl",De),Li.resize=function(){GGBAppletUtils.responsiveResize(oe,Ve)},window.addEventListener("resize",function(ft){Li.resize()});var he=typeof Ve.appletOnLoad=="function"?Ve.appletOnLoad:function(){};if(!Ze&&Ve.width!==void 0){Ve.hasOwnProperty("showSplash")||Se.setAttribute("data-param-showSplash","false");var We=oe.querySelector(".applet_scaler.prerender"),He=We!==null;if(He)var we=We.querySelector(".ggb_preview");else{var we=gi(ie,ee,Ve.borderColor,!1);We=document.createElement("div"),We.className="applet_scaler",We.style.position="relative",We.style.display="block",We.style.width=ie+"px",We.style.height=ee+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(We,"66%"),Vt(ue)>=5?(Ve.appletOnLoad=function(ft){var St=oe.querySelector(".ggb_preview");St&&St.parentNode.removeChild(St),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(We),window.GGBT_wsf_view&&$(window).trigger("resize"),he(ft)},He||We.appendChild(we)):Se.appendChild(we),We.appendChild(Se),He||oe.appendChild(We),setTimeout(function(){Li.resize()},1)}else{var ei=document.createElement("div");ei.className="applet_scaler",ei.style.position="relative",ei.style.display="block",ei.appendChild(Se),oe.appendChild(ei),Ve.appletOnLoad=function(ft){Li.resize(),he(ft)}}function Be(ft,St){St&&typeof St.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(ft,St.appletOnLoad):renderGGBElement(ft),Ge("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",St)}function Zt(ft,St){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:ft,params:St}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(At){Be(At.article,At.params)}),html5AppletsToProcess=null)},Vt(ue)<5&&(ft.className+=" geogebraweb")):Be(ft,St)}if(Ni){scriptLoadStarted=!0;for(var Je=0;Je<Se.childNodes.length;Je++){var Ri=Se.childNodes[Je].tagName;Ri==="TABLE"&&(Se.removeChild(Se.childNodes[Je]),Je--)}if(ggbHTML5LoadedScript!==null){var Pi=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');Pi!=null&&Pi.parentNode.removeChild(Pi)}var Ct=document.createElement("script"),gt=function(){Zt(Se,Ve)};Ct.src=de+qt,ggbHTML5LoadedCodebaseIsWebSimple=Qt,ggbHTML5LoadedCodebaseVersion=ue,ggbHTML5LoadedScript=Ct.src,Ge("GeoGebra HTML5 codebase loaded: '"+de+"'.",Ve),!$t&&(!fe||fe=="5.0")?(Qt?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),gt()):de.requirejs?__webpack_require__.e(6954).then(function(){var ft=[__webpack_require__(76954)];gt.apply(null,ft)}.bind(this)).catch(__webpack_require__.oe):(Ct.onload=gt,oe.appendChild(Ct))}else Zt(Se,Ve);Ve.height=ee,Ve.width=ie},ye=function(oe,Ve,Ze){var Ni=gi(Ve.width,Ve.height,Ve.borderColor,Ze),Se=document.createElement("div");Se.style.position="relative",Se.style.display="block",Se.style.width=Ve.width+"px",Se.style.height=Ve.height+"px",Se.className="applet_screenshot applet_scaler"+(Ze?" applet_screenshot_play":""),Se.appendChild(Ni);var ie=GGBAppletUtils.getScale(Ve,oe,Ze);Ze?(oe.appendChild(yi()),window.GGBT_wsf_view||(oe.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Se,"66%"),oe.appendChild(Se),ie!==1&&!isNaN(ie)&&(GGBAppletUtils.scaleElement(Se,ie),Se.style.width=Ve.width+"px",Se.style.height=Ve.height+"px",Se.parentNode.style.width=Ve.width*ie+"px",Se.parentNode.style.height=Ve.height*ie+"px"),Li.resize=function(){Ie(oe,Ni,Se,Ze)},window.addEventListener("resize",function(ee){Li.resize()}),Li.resize()};function Ie(oe,Ve,Ze,Ni){if(oe.contains(Ve)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(oe.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(oe)}var Se=GGBAppletUtils.getScale(Mt,oe,Ni);Ze.parentNode!==null&&(!isNaN(Se)&&Se!==1?(GGBAppletUtils.scaleElement(Ze,Se),Ze.parentNode.style.width=Mt.width*Se+"px",Ze.parentNode.style.height=Mt.height*Se+"px"):(GGBAppletUtils.scaleElement(Ze,1),Ze.parentNode.style.width=Mt.width+"px",Ze.parentNode.style.height=Mt.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(oe),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}Li.onExitFullscreen=function(oe,Ve){Ve.appendChild(oe)};var Ai=function(oe,Ve,Ze,Ni){ye(oe,Ve,!0);for(var Se=function(){var ve=[];for(ee=0;ee<oe.childNodes.length;ee++)ve.push(oe.childNodes[ee]);if(window.GGBT_wsf_view){var ti=window.GGBT_wsf_view.renderFullScreen(oe,Ve.id),he=document.getElementById("fullscreencontainer"),We=jQuery(oe).find(".fullscreencontent");We.length>0?(ti.remove(),We.attr("id","fullscreencontent").show(),jQuery(he).append(We),window.dispatchEvent(new Event("resize"))):Re(ti,Ve,!1),window.GGBT_wsf_view.launchFullScreen(he)}else Ne=Ni,Re(oe,Ve,!1);if(!window.GGBT_wsf_view)for(ee=0;ee<ve.length;ee++)oe.removeChild(ve[ee])},ie=oe.getElementsByClassName("ggb_preview_play"),ee=0;ee<ie.length;ee++)ie[ee].addEventListener("click",Se,!1),ie[ee].addEventListener("ontouchstart",Se,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(oe),Xt()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},yi=function(){var oe=document.createElement("div");if(oe.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var Ve='.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");}',Ze=document.createElement("style");Ze.styleSheet?Ze.styleSheet.cssText=Ve:Ze.appendChild(document.createTextNode(Ve)),document.getElementsByTagName("head")[0].appendChild(Ze)}return oe},gi=function(oe,Ve,Ze,Ni){var Se=document.createElement("div");Se.className="ggb_preview",Se.style.position="absolute",Se.style.zIndex="90",Se.style.width=oe-2+"px",Se.style.height=Ve-2+"px",Se.style.top="0px",Se.style.left="0px",Se.style.overflow="hidden",Se.style.backgroundColor="white";var ie="lightgrey";Ze!==void 0&&(Ze==="none"?ie="transparent":ie=Ze),Se.style.border="1px solid "+ie;var ee=document.createElement("img");if(ee.style.position="relative",ee.style.zIndex="1000",ee.style.top="-1px",ee.style.left="-1px",Jt!==null&&ee.setAttribute("src",Jt),ee.style.opacity=.7,Pe!==null){var ve,ti,he;if(!Ni){ve=document.createElement("img"),ve.style.position="absolute",ve.style.zIndex="1001",ve.style.opacity=1,ee.style.opacity=.3,ti=360,ti>oe/4*3&&(ti=oe/4*3),he=ti/5.8,ve.setAttribute("src",Pe),ve.setAttribute("width",ti),ve.setAttribute("height",he);var We=(oe-ti)/2,He=(Ve-he)/2;ve.style.left=We+"px",ve.style.top=He+"px",Se.appendChild(ve)}}return Se.appendChild(ee),Se},oi=function(oe){return oe=oe.toLowerCase(),oe==="html5"||oe==="screenshot"?oe:"html5"},Bt=["web","webSimple","web3d","tablet","tablet3d","phone"],bt=function(oe,Ve){if(ue=oe,Ve){ge(ue,!0);return}var Ze=!_t;if(Ze){var Ni=Vt(ue);!isNaN(Ni)&&Ni<4.4&&(Ze=!1)}var Se,ie;window.location.protocol.substr(0,4)==="http"?Se=window.location.protocol:Se="http:";var ee=ue.indexOf("//");ee>0?ie=ue:ee===0?ie=Se+ue:ie="https://www.geogebra.org/apps/5.2.814.0/";for(var ve in Bt)if(ue.slice(Bt[ve].length*-1)===Bt[ve]||ue.slice((Bt[ve].length+1)*-1)===Bt[ve]+"/"){ge(ie,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&Ze&&!pt.is3D&&!pt.AV&&!pt.SV&&!pt.CV&&!pt.EV2&&!pt.CP&&!pt.PC&&!pt.DA&&!pt.FI&&!pt.PV&&!ne(Mt.showToolBar)&&!ne(Mt.showMenuBar)&&!ne(Mt.showAlgebraInput)&&!ne(Mt.enableRightClick)&&(!Mt.appName||Mt.appName=="classic")?ie+="webSimple/":ie+="web3d/",ge(ie,!1)},ge=function(oe,Ve){if(oe.requirejs){de=oe;return}oe.slice(-1)!=="/"&&(oe+="/"),de=oe,Ve===null&&(Ve=oe.indexOf("http")===-1),zt=Ve,qt="web.nocache.js",Qt=!1;var Ze=de.split("/");Ze.length>1&&(!Ve&&Ze[Ze.length-2]==="webSimple"?(qt="webSimple.nocache.js",Qt=!0):Bt.indexOf(Ze[Ze.length-2])>=0&&(qt=Ze[Ze.length-2]+".nocache.js")),Ze=oe.split("/"),ue=Ze[Ze.length-3],ue.substr(0,4)==="test"?ue=ue.substr(4,1)+"."+ue.substr(5,1):(ue.substr(0,3)==="war"||ue.substr(0,4)==="beta")&&(ue="5.0");var Ni=parseFloat(ue);Ni!==NaN&&Ni<5&&oe.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+Ni+" is deprecated. Using version latest instead."),bt("5.0",Ve))},Ge=function(oe,Ve){window.console&&window.console.log&&(!Ve||typeof Ve.showLogging=="undefined"||Ve.showLogging&&Ve.showLogging!=="false")&&console.log(oe)};Mt.material_id!==void 0?Le(Ye):Ye();function Ye(){var oe=ai;fe!==null?oe=fe:parseFloat(oe)<5&&(oe="5.0"),bt(oe,!1),$t!==null&&ge($t,zt),Ut=!0}return Li},GGBAppletUtils=function(){"use strict";function Li(){return window.GGBT_wsf_edit!==void 0}function ai(Ut,fe){fe!=1?(Ut.style.transformOrigin="0% 0% 0px",Ut.style.webkitTransformOrigin="0% 0% 0px",Ut.style.transform="scale("+fe+","+fe+")",Ut.style.webkitTransform="scale("+fe+","+fe+")",Ut.style.maxWidth="initial",Ut.querySelector(".ggb_preview")!==null&&(Ut.querySelector(".ggb_preview").style.maxWidth="initial"),Ut.querySelectorAll(".ggb_preview img")[0]!==void 0&&(Ut.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),Ut.querySelectorAll(".ggb_preview img")[1]!==void 0&&(Ut.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(Ut.style.transform="none",Ut.style.webkitTransform="none")}function Mt(Ut,fe,$t,Ae,re,Dt){var de=null;if(Dt!=null&&Dt!="")for(var zt=Ut.parentNode;zt!=null;)if((" "+zt.className+" ").indexOf(" "+Dt+" ")>-1){de=zt;break}else zt=zt.parentNode;var Ne=0,ue=0,qt=0,Qt=0,Jt=0,Pe=0,je=0;if(de)Ne=de.offsetWidth,ue=Math.max(Ae?de.offsetWidth:0,de.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(Ne=Math.min(window.innerWidth,document.documentElement.clientWidth),ue=Math.min(window.innerHeight,document.documentElement.clientHeight),qt=Ne):(Ne=window.innerWidth,ue=window.innerHeight,qt=window.innerWidth),Ut){var De=Ut.getBoundingClientRect();De.left>0&&De.left<=Ne&&(re===void 0||!re)&&(document.dir==="rtl"?(Jt=Ne-De.width-De.left,Pe=qt<=480?10:30):(Pe=De.left,Jt=qt<=480?10:30),Qt=Pe+Jt)}if(Ut&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var Yt=Ut.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(Qt=40,je=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Qt=0,je=40)}}return Ut&&(($t===void 0||!$t)&&fe>0&&fe+Qt<Ne?Ne=fe:Ne-=Qt,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&($t===void 0||!$t)&&(ue-=je)),{width:Ne,height:ue}}function pt(Ut,fe,$t,Ae,re){if(Ut.isScreenshoGenerator)return 1;var Dt=Ae!==void 0&&Ae,de=Ut.noScaleMargin!=null&&Ut.noScaleMargin,zt=function(Yt){return Yt&&Yt!=="false"},Ne=zt(Ut.autoHeight),ue=Mt(fe,Ut.width,$t,Ne,Dt&&window.GGBT_wsf_view||de,re),qt=parseInt(ue.width),Qt=Ut.width,Jt=Ut.height;if(Qt===void 0){var Pe=fe.querySelector(".appletParameters");Pe&&(Qt=Pe.offsetWidth,Jt=Pe.offsetHeight)}var je=qt/Qt,De=Dt?1:ue.height/Jt;return $t!==void 0&&!$t&&(je=Math.min(1,je),De=Math.min(1,De)),Math.min(je,De)}function _t(Ut,fe,$t){var Ae=1,re,Dt=!1;if(Ut.hasOwnProperty("allowUpscale")&&(Dt=Ut.allowUpscale),Ut.hasOwnProperty("scale")&&(Ae=parseFloat(Ut.scale),(isNaN(Ae)||Ae===null||Ae===0)&&(Ae=1),Ae>1&&(Dt=!0)),fe&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Dt=!0),!(Ut.hasOwnProperty("disableAutoScale")&&Ut.disableAutoScale))re=pt(Ut,fe,Dt,$t,Ut.scaleContainerClass);else return Ae;return Dt&&(!Ut.hasOwnProperty("scale")||Ae===1)?re:Math.min(Ae,re)}function ce(Ut){var fe=Math.min(window.innerWidth,document.documentElement.clientWidth),$t=Math.min(window.innerHeight,document.documentElement.clientHeight),Ae=Ut.getBoundingClientRect(),re=(fe-Ae.width)/2,Dt=($t-Ae.height)/2;Dt<0&&(Dt=0),Ut.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(re<40?Ut.style.left="40px":Ut.style.left=re+"px",Ut.style.top=Dt+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Dt<40?Ut.style.top="40px":Ut.style.top=Dt+"px",Ut.style.left=re+"px")}function me(Ut,fe){var $t=Ut.querySelector(".appletParameters");if($t){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(fe.id!==$t.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(Ut)}if($t.parentElement&&/fullscreen/.test($t.parentElement.className))return;var Ae=_t(fe,Ut);Li()&&$t.setAttribute("data-param-scale",Ae);for(var re=null,Dt=0;Dt<Ut.childNodes.length;Dt++)if(Ut.childNodes[Dt].className!==void 0&&Ut.childNodes[Dt].className.match(/^applet_scaler/)){re=Ut.childNodes[Dt];break}if(re!==null&&re.querySelector(".noscale")!==null)return;var de=fe.id!==void 0?fe.id:"ggbApplet",zt=window[de];(zt==null||!zt.recalculateEnvironments)&&re!==null&&!re.className.match(/fullscreen/)&&(re.parentNode.style.transform="",!isNaN(Ae)&&Ae!==1?(re.parentNode.style.width=fe.width*Ae+"px",re.parentNode.style.height=fe.height*Ae+"px",ai(re,Ae)):(ai(re,1),re.parentNode.style.width=fe.width+"px",re.parentNode.style.height=fe.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&ce(Ut),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($($t).parents(".content-added-content"))}}return{responsiveResize:me,isFlexibleWorksheetEditor:Li,positionCenter:ce,getScale:_t,scaleElement:ai}}();__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return GGBApplet}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),__WEBPACK_AMD_DEFINE_RESULT__!==void 0&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__),GGBAppletUtils.makeModule=function(name,permutation){function webModule(){var H="bootstrap",I="begin",J="gwt.codesvr."+name+"=",K="gwt.codesvr=",L=name,M="startup",N="DUMMY",O=0,P=1,Q="iframe",R="position:absolute; width:0; height:0; border:none; left: -1000px;",S=" top: -1000px;",T="Chrome",U="CSS1Compat",V="<!doctype html>",W="",X="<html><head></head><body></body></html>",Y="undefined",Z="readystatechange",$=10,_="script",ab="javascript",bb="Failed to load ",cb="moduleStartup",db="scriptTagAdded",eb="moduleRequested",fb="meta",gb="name",hb=name+"::",ib="::",jb="gwt:property",kb="content",lb="=",mb="gwt:onPropertyErrorFn",nb='Bad handler "',ob='" for "gwt:onPropertyErrorFn"',pb="gwt:onLoadErrorFn",qb='" for "gwt:onLoadErrorFn"',rb="#",sb="?",tb="/",ub="img",vb="clear.cache.gif",wb="baseUrl",xb=name+".nocache.js",yb="base",zb="//",Ab="selectingPermutation",Bb=name+".devmode.js",Cb=permutation,Db=":",Eb=".cache.js",Fb="loadExternalRefs",Gb="end",n=window,o=document;function p(){var Li=n.location.search;return Li.indexOf(J)!=-1||Li.indexOf(K)!=-1}function q(Li,ai){}webModule.__sendStats=q,webModule.__moduleName=L,webModule.__errFn=null,webModule.__moduleBase=N,webModule.__softPermutationId=O,webModule.__computePropValue=null,webModule.__getPropMap=null,webModule.__installRunAsyncCode=function(){},webModule.__gwtStartLoadingFragment=function(){return null},webModule.__gwt_isKnownPropertyValue=function(){return!1},webModule.__gwt_getMetaProperty=function(){return null};var r=null,s=n.__gwt_activeModules=n.__gwt_activeModules||{};s[L]={moduleName:L},webModule.__moduleStartupDone=function(Li){var ai=s[L].bindings;s[L].bindings=function(){for(var Mt=ai?ai():{},pt=Li[webModule.__softPermutationId],_t=O;_t<pt.length;_t++){var ce=pt[_t];Mt[ce[O]]=ce[P]}return Mt}};var t;function u(){return v(),t}function v(){if(!t){var Li=o.createElement(Q);if(Li.id=L,Li.style.cssText=R+S,Li.tabIndex=-1,o.body.appendChild(Li),t=Li.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var ai=document.compatMode==U?V:W;t.write(ai+X),t.close()}}}function w(Li){function ai(pt){function _t(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var ce=_t();if(ce){pt();return}function me(){if(!ce){if(!_t())return;ce=!0,pt(),o.removeEventListener&&o.removeEventListener(Z,me,!1),Ut&&clearInterval(Ut)}}o.addEventListener&&o.addEventListener(Z,me,!1);var Ut=setInterval(function(){me()},$)}function Mt(pt){var _t=u(),ce=_t.body,me=_t.createElement(_);me.language=ab,me.crossOrigin=W,me.src=pt,webModule.__errFn&&(me.onerror=function(){webModule.__errFn(L,new Error(bb+pt))}),ce.appendChild(me)}ai(function(){Mt(Li)})}webModule.__startLoadingFragment=function(Li){return C(Li)},webModule.__installRunAsyncCode=function(Li){var ai=u(),Mt=ai.body,pt=ai.createElement(_);pt.language=ab,pt.text=Li,Mt.appendChild(pt),Mt.removeChild(pt)};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(Li){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(Li){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(Li){var ai=c[Li];return ai==null?null:ai},r=d,webModule.__errFn=e}function B(){function Li(Ut){var fe=Ut.lastIndexOf(rb);fe==-1&&(fe=Ut.length);var $t=Ut.indexOf(sb);$t==-1&&($t=Ut.length);var Ae=Ut.lastIndexOf(tb,Math.min($t,fe));return Ae>=O?Ut.substring(O,Ae+P):W}function ai(Ut){if(!Ut.match(/^\w+:\/\//)){var fe=o.createElement(ub);fe.src=Ut+vb,Ut=Li(fe.src)}return Ut}function Mt(){var Ut=__gwt_getMetaProperty(wb);return Ut!=null?Ut:W}function pt(){for(var Ut=o.getElementsByTagName(_),fe=O;fe<Ut.length;++fe)if(Ut[fe].src.indexOf(xb)!=-1)return Li(Ut[fe].src);return W}function _t(){var Ut=o.getElementsByTagName(yb);return Ut.length>O?Ut[Ut.length-P].href:W}function ce(){var Ut=o.location;return Ut.href==Ut.protocol+zb+Ut.host+Ut.pathname+Ut.search+Ut.hash}var me=Mt();return me==W&&(me=pt()),me==W&&(me=_t()),me==W&&ce()&&(me=Li(o.location.href)),me=ai(me),me}function C(Li){return Li.match(/^\//)||Li.match(/^[a-zA-Z]+:\/\//)?Li:webModule.__moduleBase+Li}function D(){var Li=[],ai=O,Mt=[],pt=[];function _t(Ut){var fe=pt[Ut](),$t=Mt[Ut];if(fe in $t)return fe;var Ae=[];for(var re in $t)Ae[$t[re]]=re;throw r&&r(Ut,Ae,fe),null}if(__gwt_isKnownPropertyValue=function(Ut,fe){return fe in Mt[Ut]},webModule.__getPropMap=function(){var Ut={};for(var fe in Mt)Mt.hasOwnProperty(fe)&&(Ut[fe]=_t(fe));return Ut},webModule.__computePropValue=_t,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var ce;try{ce=Cb;var me=ce.indexOf(Db);me!=-1&&(ai=parseInt(ce.substring(me+P),$),ce=ce.substring(O,me))}catch(Ut){}return webModule.__softPermutationId=ai,C(ce+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}A(),webModule.__moduleBase="/js/mathematicalGraphics/"+name+"/",s[L].moduleBase=webModule.__moduleBase;var G=D();return F(),w(G),!0}return webModule},typeof window.web3d!="function"&&(window.web3d=GGBAppletUtils.makeModule("web3d","A18F540516513B1292CA7CEF2F6AFC7E")),typeof window.webSimple!="function"&&(window.webSimple=GGBAppletUtils.makeModule("webSimple","96B09BF1B436BF53F0DF54116700F16A")),window.GGBApplet=GGBApplet})()},88457:function(Li,ai,Mt){"use strict";Mt.d(ai,{Ax:function(){return me},Ds:function(){return Ut},KI:function(){return $t},SI:function(){return ce},f1:function(){return _t}});var pt=Mt(78323);function _t(Ae){let re=!0;if(Ae.length>0){for(let Dt=0;Dt<Ae.length;Dt++)if(Ae[Dt].compile_success==0||!Ae[Dt].compile_success){re=!1;break}}else re=!1;return re}function ce(Ae,re=""){let Dt=[];for(let de=0;de<Ae.length;de++){let zt=Ae[de],Ne=re?`${re}/${zt.name}`:`${zt.name}`;Dt.push({title:zt.name,type:zt.type,isLeaf:zt.type!=="tree",key:Ne})}return Dt}function me(Ae,re,Dt){for(let de=0;de<Ae.length;de++){let zt=Ae[de];if(zt.key===re){zt.children=Dt;break}zt.children&&me(zt.children,re,Dt)}return Ae}function Ut(Ae,re,Dt){let de;return function(){let zt=this,Ne=arguments,ue=function(){de=null,Dt||Ae.apply(zt,Ne)},qt=Dt&&!de;clearTimeout(de),de=setTimeout(ue,re),qt&&Ae.apply(zt,Ne)}}const fe=!0,$t=pt.Z.API_SERVER},54344:function(Li,ai,Mt){"use strict";Mt.d(ai,{Z:function(){return Pi}});var pt=Mt(59301),_t={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},ce=Mt(92310),me=Mt.n(ce),Ut=Mt(29787);var fe=function(Ct,gt){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ft,St){ft.__proto__=St}||function(ft,St){for(var At in St)Object.prototype.hasOwnProperty.call(St,At)&&(ft[At]=St[At])})(Ct,gt)};function $t(Ct,gt){function ft(){this.constructor=Ct}fe(Ct,gt),Ct.prototype=gt===null?Object.create(gt):(ft.prototype=gt.prototype,new ft)}function Ae(Ct,gt,ft,St){return new(ft||(ft=Promise))(function(At,wt){function te(qe){try{ui(St.next(qe))}catch(xe){wt(xe)}}function ni(qe){try{ui(St.throw(qe))}catch(xe){wt(xe)}}function ui(qe){var xe;qe.done?At(qe.value):(xe=qe.value,xe instanceof ft?xe:new ft(function(Zi){Zi(xe)})).then(te,ni)}ui((St=St.apply(Ct,gt||[])).next())})}function re(Ct,gt){var ft,St,At,wt,te={label:0,sent:function(){if(1&At[0])throw At[1];return At[1]},trys:[],ops:[]};return wt={next:ni(0),throw:ni(1),return:ni(2)},typeof Symbol=="function"&&(wt[Symbol.iterator]=function(){return this}),wt;function ni(ui){return function(qe){return function(xe){if(ft)throw new TypeError("Generator is already executing.");for(;te;)try{if(ft=1,St&&(At=2&xe[0]?St.return:xe[0]?St.throw||((At=St.return)&&At.call(St),0):St.next)&&!(At=At.call(St,xe[1])).done)return At;switch(St=0,At&&(xe=[2&xe[0],At.value]),xe[0]){case 0:case 1:At=xe;break;case 4:return te.label++,{value:xe[1],done:!1};case 5:te.label++,St=xe[1],xe=[0];continue;case 7:xe=te.ops.pop(),te.trys.pop();continue;default:if(At=te.trys,!((At=At.length>0&&At[At.length-1])||xe[0]!==6&&xe[0]!==2)){te=0;continue}if(xe[0]===3&&(!At||xe[1]>At[0]&&xe[1]<At[3])){te.label=xe[1];break}if(xe[0]===6&&te.label<At[1]){te.label=At[1],At=xe;break}if(At&&te.label<At[2]){te.label=At[2],te.ops.push(xe);break}At[2]&&te.ops.pop(),te.trys.pop();continue}xe=gt.call(Ct,te)}catch(Zi){xe=[6,Zi],St=0}finally{ft=At=0}if(5&xe[0])throw xe[1];return{value:xe[0]?xe[1]:void 0,done:!0}}([ui,qe])}}}function Dt(){for(var Ct=0,gt=0,ft=arguments.length;gt<ft;gt++)Ct+=arguments[gt].length;var St=Array(Ct),At=0;for(gt=0;gt<ft;gt++)for(var wt=arguments[gt],te=0,ni=wt.length;te<ni;te++,At++)St[At]=wt[te];return St}var de=function(){function Ct(){}return Ct.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Ct.setAttributes=function(gt,ft){for(var St=0,At=ft;St<At.length;St++){var wt=At[St],te=wt[0],ni=wt[1];gt.setAttribute(te,ni)}},Ct.createRect=function(gt,ft,St){var At=document.createElementNS("http://www.w3.org/2000/svg","rect");return At.setAttribute("width",gt.toString()),At.setAttribute("height",ft.toString()),St&&Ct.setAttributes(At,St),At},Ct.createLine=function(gt,ft,St,At,wt){var te=document.createElementNS("http://www.w3.org/2000/svg","line");return te.setAttribute("x1",gt.toString()),te.setAttribute("y1",ft.toString()),te.setAttribute("x2",St.toString()),te.setAttribute("y2",At.toString()),wt&&Ct.setAttributes(te,wt),te},Ct.createPolygon=function(gt,ft){var St=document.createElementNS("http://www.w3.org/2000/svg","polygon");return St.setAttribute("points",gt),ft&&Ct.setAttributes(St,ft),St},Ct.createCircle=function(gt,ft){var St=document.createElementNS("http://www.w3.org/2000/svg","circle");return St.setAttribute("cx",(gt/2).toString()),St.setAttribute("cy",(gt/2).toString()),St.setAttribute("r",gt.toString()),ft&&Ct.setAttributes(St,ft),St},Ct.createEllipse=function(gt,ft,St){var At=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return At.setAttribute("cx",(gt/2).toString()),At.setAttribute("cy",(ft/2).toString()),At.setAttribute("rx",(gt/2).toString()),At.setAttribute("ry",(ft/2).toString()),St&&Ct.setAttributes(At,St),At},Ct.createGroup=function(gt){var ft=document.createElementNS("http://www.w3.org/2000/svg","g");return gt&&Ct.setAttributes(ft,gt),ft},Ct.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Ct.createMarker=function(gt,ft,St,At,wt,te,ni){var ui=document.createElementNS("http://www.w3.org/2000/svg","marker");return Ct.setAttributes(ui,[["id",gt],["orient",ft],["markerWidth",St.toString()],["markerHeight",At.toString()],["refX",wt.toString()],["refY",te.toString()]]),ui.appendChild(ni),ui},Ct.createText=function(gt){var ft=document.createElementNS("http://www.w3.org/2000/svg","text");return ft.setAttribute("x","0"),ft.setAttribute("y","0"),gt&&Ct.setAttributes(ft,gt),ft},Ct.createTSpan=function(gt,ft){var St=document.createElementNS("http://www.w3.org/2000/svg","tspan");return St.textContent=gt,ft&&Ct.setAttributes(St,ft),St},Ct.createImage=function(gt){var ft=document.createElementNS("http://www.w3.org/2000/svg","image");return gt&&Ct.setAttributes(ft,gt),ft},Ct.createPoint=function(gt,ft){var St=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return St.x=gt,St.y=ft,St},Ct.createPath=function(gt,ft){var St=document.createElementNS("http://www.w3.org/2000/svg","path");return St.setAttribute("d",gt),ft&&Ct.setAttributes(St,ft),St},Ct}(),zt=function(){function Ct(){}return Ct.addKey=function(gt){Ct.key=gt},Object.defineProperty(Ct,"isLicensed",{get:function(){return!!Ct.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Ct.key)},enumerable:!1,configurable:!0}),Ct}(),Ne=function(){function Ct(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Ct.prototype.rasterize=function(gt,ft,St){var At=this;return new Promise(function(wt){var te=St!==void 0?St:document.createElement("canvas");gt===null&&(At.markersOnly=!0,At.naturalSize=!1);var ni=document.createElementNS("http://www.w3.org/2000/svg","svg");ni.setAttribute("xmlns","http://www.w3.org/2000/svg"),ni.setAttribute("width",ft.width.baseVal.valueAsString),ni.setAttribute("height",ft.height.baseVal.valueAsString),ni.setAttribute("viewBox","0 0 "+ft.viewBox.baseVal.width.toString()+" "+ft.viewBox.baseVal.height.toString()),ni.innerHTML=ft.innerHTML,At.naturalSize===!0?(ni.width.baseVal.value=gt.naturalWidth,ni.height.baseVal.value=gt.naturalHeight):At.width!==void 0&&At.height!==void 0&&(ni.width.baseVal.value=At.width,ni.height.baseVal.value=At.height),te.width=ni.width.baseVal.value,te.height=ni.height.baseVal.value;var ui=ni.outerHTML,qe=te.getContext("2d");At.markersOnly!==!0&&qe.drawImage(gt,0,0,te.width,te.height);var xe=window.URL,Zi=new Image(te.width,te.height);Zi.setAttribute("crossOrigin","anonymous");var Si=new Blob([ui],{type:"image/svg+xml"}),Oi=xe.createObjectURL(Si);Zi.onload=function(){qe.drawImage(Zi,0,0),xe.revokeObjectURL(Oi);var Qi=te.toDataURL(At.imageType,At.imageQuality);wt(Qi)},Zi.src=Oi})},Ct}(),ue=function(){},qt=function(){function Ct(gt){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+gt+"_"}return Object.defineProperty(Ct.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.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(Ct.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Ct.prototype.addClass=function(gt){return this.styleSheet===void 0&&this.addStyleSheet(),gt.name=""+this.classNamePrefix+gt.localName,this.classes.push(gt),this.styleSheet.sheet.insertRule("."+gt.name+" {"+gt.style+"}",this.styleSheet.sheet.cssRules.length),gt},Ct.prototype.addRule=function(gt){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(gt),this.styleSheet.sheet.insertRule(gt.selector+" {"+gt.style+"}",this.styleSheet.sheet.cssRules.length)},Ct.prototype.addStyleSheet=function(){var gt;this.styleSheet=document.createElement("style"),((gt=this.styleSheetRoot)!==null&>!==void 0?gt:document.head).appendChild(this.styleSheet),this.addRule(new Qt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Qt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Qt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Jt("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Jt("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},Ct.prototype.removeStyleSheet=function(){var gt;this.styleSheet&&(((gt=this.styleSheetRoot)!==null&>!==void 0?gt:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Ct}(),Qt=function(Ct,gt){this.selector=Ct,this.style=gt},Jt=function(Ct,gt){this.localName=Ct,this.style=gt},Pe=function(){function Ct(gt,ft,St,At,wt){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=gt,this.displayMode=ft,this.markerItems=St,this.uiStyleSettings=At,this.styles=wt,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Ct.prototype.show=function(gt){var ft=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=gt,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var St=document.createElement("div");St.className=this.toolbarBlockStyleClass.name,St.style.whiteSpace="nowrap",this.uiContainer.appendChild(St),this.addActionButton(St,'<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(St,'<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(St,'<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(St,'<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(St,'<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(St,'<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(St,'<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(St,'<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(wt){var te=document.createElement("div");te.className=""+ft.toolbarButtonStyleClass.name,te.setAttribute("data-type-name",wt.typeName),te.innerHTML=wt.icon,te.addEventListener("click",function(){ft.markerToolbarButtonClicked(te,wt)}),ft.buttons.push(te),ft.markerButtons.push(te)}),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 At=document.createElement("div");At.className=this.toolbarBlockStyleClass.name,At.style.whiteSpace="nowrap",At.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(At),this.addActionButton(At,'<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(At,'<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()},Ct.prototype.addButtonClickListener=function(gt){this.buttonClickListeners.push(gt)},Ct.prototype.removeButtonClickListener=function(gt){this.buttonClickListeners.indexOf(gt)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(gt),1)},Ct.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Ct.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var gt=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var ft=0;ft<this.markerButtons.length;ft++)ft<gt||ft===gt&&this.markerButtons.length-1===gt?this.markerButtonBlock.appendChild(this.markerButtons[ft]):(ft===gt&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[ft]))}},Ct.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},Ct.prototype.resetButtonStyles=function(){var gt=this;this.buttons.forEach(function(ft){ft.className=ft.className.replace(gt.uiStyleSettings.toolbarButtonStyleColorsClassName?gt.uiStyleSettings.toolbarButtonStyleColorsClassName:gt.toolbarButtonStyleColorsClass.name,"").trim(),ft.className=ft.className.replace(gt.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?gt.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:gt.toolbarActiveButtonStyleColorsClass.name,"").trim(),ft.className+=" "+(gt.uiStyleSettings.toolbarButtonStyleColorsClassName?gt.uiStyleSettings.toolbarButtonStyleColorsClassName:gt.toolbarButtonStyleColorsClass.name)})},Ct.prototype.addActionButton=function(gt,ft,St){var At=this,wt=document.createElement("div");switch(wt.className=""+this.toolbarButtonStyleClass.name,wt.innerHTML=ft,wt.setAttribute("data-action",St),wt.addEventListener("click",function(){At.actionToolbarButtonClicked(wt,St)}),St){case"select":wt.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":wt.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":wt.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":wt.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":wt.style.fill=this.uiStyleSettings.closeButtonColor}gt.appendChild(wt),this.buttons.push(wt)},Ct.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Jt("toolbar",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Jt("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Jt("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Jt("toolbar-overflow-block",`
|
|
position: absolute;
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
z-index: 10;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new Jt("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var gt=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Jt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*gt)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*gt)+`px;
|
|
padding: `+gt+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Jt("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Jt("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Qt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Qt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},Ct.prototype.markerToolbarButtonClicked=function(gt,ft){this.setActiveButton(gt),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(St){return St("marker",ft)}),this.markerButtonOverflowBlock.style.display="none"},Ct.prototype.actionToolbarButtonClicked=function(gt,ft){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(St){return St("action",ft)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Ct.prototype.setActiveButton=function(gt){this.resetButtonStyles(),gt.className=gt.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),gt.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Ct.prototype.setActiveMarkerButton=function(gt){var ft=this.markerButtons.find(function(St){return St.getAttribute("data-type-name")===gt});ft&&this.setActiveButton(ft)},Ct.prototype.setCurrentMarker=function(gt){var ft=this;this.currentMarker=gt,this.buttons.filter(function(St){return/delete|notes/.test(St.getAttribute("data-action"))}).forEach(function(St){ft.currentMarker===void 0?(St.style.fillOpacity="0.4",St.style.pointerEvents="none"):(St.style.fillOpacity="1",St.style.pointerEvents="all")})},Ct}(),je=function(){function Ct(gt,ft,St,At){this.panels=[],this.panelButtons=[],this.markerjsContainer=gt,this.displayMode=ft,this.uiStyleSettings=St,this.styles=At,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Ct.prototype.addStyles=function(){var gt;this.toolboxStyleClass=this.styles.addClass(new Jt("toolbox",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
font-family: sans-serif;
|
|
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolboxStyleColorsClass=this.styles.addClass(new Jt("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var ft=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Jt("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Jt("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Jt("toolbox-panel-row",`
|
|
display: flex;
|
|
`+(this.displayMode==="inline"?"position: absolute;":"")+`
|
|
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
cursor: default;
|
|
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
|
|
`+(this.displayMode==="inline"?"width: 100%;":"")+`
|
|
box-sizing: content-box;
|
|
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Jt("toolbox-panel-row_colors",`
|
|
background-color: `+((gt=this.uiStyleSettings.toolboxBackgroundColor)!==null&>!==void 0?gt:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Jt("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*ft)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*ft)+`px;
|
|
padding: `+ft+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Jt("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Jt("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Qt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Qt("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},Ct.prototype.show=function(gt){var ft;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=gt,this.uiContainer.className=this.toolboxStyleClass.name+" "+((ft=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&ft!==void 0?ft:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Ct.prototype.setPanelButtons=function(gt){var ft,St,At=this;this.panels=gt,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((ft=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&ft!==void 0?ft:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((St=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&St!==void 0?St:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(wt){var te;wt.uiStyleSettings=At.uiStyleSettings;var ni=document.createElement("div");ni.className=At.toolboxButtonStyleClass.name+" "+((te=At.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&te!==void 0?te:At.toolboxButtonStyleColorsClass.name),ni.innerHTML=wt.icon,ni.title=wt.title,ni.addEventListener("click",function(){At.panelButtonClick(wt)}),At.panelButtons.push(ni),At.buttonRow.appendChild(ni)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Ct.prototype.panelButtonClick=function(gt){var ft=this,St=-1;if(gt!==this.activePanel){St=this.panels.indexOf(gt),this.panelRow.innerHTML="";var At=gt.getUi();At.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(At),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=gt}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){ft.displayMode==="inline"?ft.panelRow.style.display="none":ft.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(wt,te){var ni,ui;wt.className=ft.toolboxButtonStyleClass.name+" "+(te===St?""+((ni=ft.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ni!==void 0?ni:ft.toolboxActiveButtonStyleColorsClass.name):""+((ui=ft.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ui!==void 0?ui:ft.toolboxButtonStyleColorsClass.name))})},Ct}(),De=function(Ct,gt){this.title=Ct,this.icon=gt},Yt=function(Ct){function gt(ft,St,At,wt){var te=Ct.call(this,ft,wt||'<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 te.colors=[],te.addTransparent=!1,te.colorBoxes=[],te.colors=St,te.currentColor=At,te.setCurrentColor=te.setCurrentColor.bind(te),te.getColorBox=te.getColorBox.bind(te),te}return $t(gt,Ct),gt.prototype.getUi=function(){var ft=this,St=document.createElement("div");return St.style.overflow="hidden",St.style.whiteSpace="nowrap",this.colors.forEach(function(At){var wt=ft.getColorBox(At);St.appendChild(wt),ft.colorBoxes.push(wt)}),St},gt.prototype.getColorBox=function(ft){var St=this,At=this.uiStyleSettings.toolbarHeight/4,wt=this.uiStyleSettings.toolbarHeight-At,te=document.createElement("div");te.style.display="inline-block",te.style.boxSizing="content-box",te.style.width=wt-2+"px",te.style.height=wt-2+"px",te.style.padding="1px",te.style.marginRight="2px",te.style.marginBottom="2px",te.style.borderWidth="2px",te.style.borderStyle="solid",te.style.borderRadius=(wt+2)/2+"px",te.style.borderColor=ft===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",te.addEventListener("click",function(){St.setCurrentColor(ft,te)});var ni=document.createElement("div");return ni.style.display="inline-block",ni.style.width=wt-2+"px",ni.style.height=wt-2+"px",ni.style.backgroundColor=ft,ni.style.borderRadius=wt/2+"px",ft==="transparent"&&(ni.style.fill=this.uiStyleSettings.toolboxAccentColor,ni.innerHTML=`<svg viewBox="0 0 24 24">
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
</svg>`),te.appendChild(ni),te},gt.prototype.setCurrentColor=function(ft,St){var At=this;this.currentColor=ft,this.colorBoxes.forEach(function(wt){wt.style.borderColor=wt===St?At.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(ft)},gt}(De),Vt=function(){function Ct(gt,ft,St){this._state="new",this._isSelected=!1,this._container=gt,this._overlayContainer=ft,this.globalSettings=St,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Ct.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Ct.prototype.ownsTarget=function(gt){return!1},Object.defineProperty(Ct.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Ct.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Ct.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Ct.prototype.pointerDown=function(gt,ft){},Ct.prototype.dblClick=function(gt,ft){},Ct.prototype.manipulate=function(gt){},Ct.prototype.pointerUp=function(gt){this.stateChanged()},Ct.prototype.dispose=function(){},Ct.prototype.addMarkerVisualToContainer=function(gt){this.container.childNodes.length>0?this.container.insertBefore(gt,this.container.childNodes[0]):this.container.appendChild(gt)},Ct.prototype.getState=function(){return{typeName:Ct.typeName,state:this.state,notes:this.notes}},Ct.prototype.restoreState=function(gt){this._state=gt.state,this.notes=gt.notes},Ct.prototype.scale=function(gt,ft){},Ct.prototype.colorChanged=function(gt){this.onColorChanged&&this.onColorChanged(gt),this.stateChanged()},Ct.prototype.fillColorChanged=function(gt){this.onFillColorChanged&&this.onFillColorChanged(gt),this.stateChanged()},Ct.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var gt=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),gt.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(gt)&&this.onStateChanged(this)}},Ct.typeName="MarkerBase",Ct}(),pe=function(){function Ct(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Ct.prototype.findGripByVisual=function(gt){return this.topLeft.ownsTarget(gt)?this.topLeft:this.topCenter.ownsTarget(gt)?this.topCenter:this.topRight.ownsTarget(gt)?this.topRight:this.centerLeft.ownsTarget(gt)?this.centerLeft:this.centerRight.ownsTarget(gt)?this.centerRight:this.bottomLeft.ownsTarget(gt)?this.bottomLeft:this.bottomCenter.ownsTarget(gt)?this.bottomCenter:this.bottomRight.ownsTarget(gt)?this.bottomRight:void 0},Ct}(),Xt=function(){function Ct(){this.GRIP_SIZE=10,this.visual=de.createGroup(),this.visual.appendChild(de.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(de.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Ct.prototype.ownsTarget=function(gt){return gt===this.visual||gt===this.visual.childNodes[0]||gt===this.visual.childNodes[1]},Ct}(),Le=function(){function Ct(){}return Ct.toITransformMatrix=function(gt){return{a:gt.a,b:gt.b,c:gt.c,d:gt.d,e:gt.e,f:gt.f}},Ct.toSVGMatrix=function(gt,ft){return gt.a=ft.a,gt.b=ft.b,gt.c=ft.c,gt.d=ft.d,gt.e=ft.e,gt.f=ft.f,gt},Ct}(),Wt=function(Ct){function gt(ft,St,At){var wt=Ct.call(this,ft,St,At)||this;return wt.left=0,wt.top=0,wt.width=0,wt.height=0,wt.defaultSize={x:50,y:20},wt.offsetX=0,wt.offsetY=0,wt.rotationAngle=0,wt.CB_DISTANCE=10,wt._suppressMarkerCreateEvent=!1,wt.container.transform.baseVal.appendItem(de.createTransform()),wt.setupControlBox(),wt}return $t(gt,Ct),Object.defineProperty(gt.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(gt.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(gt.prototype,"visual",{get:function(){return this._visual},set:function(ft){this._visual=ft;var St=de.createTransform();this._visual.transform.baseVal.appendItem(St)},enumerable:!1,configurable:!0}),gt.prototype.ownsTarget=function(ft){return!!Ct.prototype.ownsTarget.call(this,ft)||!!(this.controlGrips.findGripByVisual(ft)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ft))},gt.prototype.pointerDown=function(ft,St){Ct.prototype.pointerDown.call(this,ft,St),this.state==="new"&&(this.left=ft.x,this.top=ft.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var At=this.unrotatePoint(ft);if(this.manipulationStartX=At.x,this.manipulationStartY=At.y,this.offsetX=At.x-this.left,this.offsetY=At.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(St),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(St)){this.activeGrip=this.rotatorGrip;var wt=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=wt.x-this.width/2,this.top=wt.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var te=this.container.transform.baseVal.getItem(0);te.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(te,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},gt.prototype.pointerUp=function(ft){var St=this.state;Ct.prototype.pointerUp.call(this,ft),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(ft),this._state="select",St==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},gt.prototype.moveVisual=function(ft){this.visual.style.transform="translate("+ft.x+"px, "+ft.y+"px)"},gt.prototype.manipulate=function(ft){var St=this.unrotatePoint(ft);this.state==="creating"?this.resize(ft):this.state==="move"?(this.left=this.manipulationStartLeft+(St.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(St.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(St):this.state==="rotate"&&this.rotate(ft)},gt.prototype.resize=function(ft){var St=this.manipulationStartLeft,At=this.manipulationStartWidth,wt=this.manipulationStartTop,te=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:St=this.manipulationStartLeft+ft.x-this.manipulationStartX,At=this.manipulationStartWidth+this.manipulationStartLeft-St;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:At=this.manipulationStartWidth+ft.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:wt=this.manipulationStartTop+ft.y-this.manipulationStartY,te=this.manipulationStartHeight+this.manipulationStartTop-wt;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:te=this.manipulationStartHeight+ft.y-this.manipulationStartY}At>=0?(this.left=St,this.width=At):(this.left=St+At,this.width=-At),te>=0?(this.top=wt,this.height=te):(this.top=wt+te,this.height=-te),this.setSize()},gt.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},gt.prototype.rotate=function(ft){if(Math.abs(ft.x-this.centerX)>.1){var St=Math.sign(ft.x-this.centerX);this.rotationAngle=180*Math.atan((ft.y-this.centerY)/(ft.x-this.centerX))/Math.PI+90*St,this.applyRotation()}},gt.prototype.applyRotation=function(){var ft=this.container.transform.baseVal.getItem(0);ft.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ft,0)},gt.prototype.rotatePoint=function(ft){if(this.rotationAngle===0)return ft;var St=this.container.getCTM(),At=de.createPoint(ft.x,ft.y);return{x:(At=At.matrixTransform(St)).x,y:At.y}},gt.prototype.unrotatePoint=function(ft){if(this.rotationAngle===0)return ft;var St=this.container.getCTM();St=St.inverse();var At=de.createPoint(ft.x,ft.y);return{x:(At=At.matrixTransform(St)).x,y:At.y}},gt.prototype.select=function(){Ct.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},gt.prototype.deselect=function(){Ct.prototype.deselect.call(this),this.controlBox.style.display="none"},gt.prototype.setupControlBox=function(){this.controlBox=de.createGroup();var ft=de.createTransform();ft.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(ft),this.container.appendChild(this.controlBox),this.controlRect=de.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=de.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new pe,this.addControlGrips(),this.controlBox.style.display="none"},gt.prototype.adjustControlBox=function(){var ft=this.controlBox.transform.baseVal.getItem(0);ft.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(ft,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},gt.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},gt.prototype.createGrip=function(){var ft=new Xt;return ft.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(ft.visual),ft},gt.prototype.positionGrips=function(){var ft=this.controlGrips.topLeft.GRIP_SIZE,St=-ft/2,At=St,wt=(this.width+this.CB_DISTANCE)/2-ft/2,te=(this.height+this.CB_DISTANCE)/2-ft/2,ni=this.height+this.CB_DISTANCE-ft/2,ui=this.width+this.CB_DISTANCE-ft/2;this.positionGrip(this.controlGrips.topLeft.visual,St,At),this.positionGrip(this.controlGrips.topCenter.visual,wt,At),this.positionGrip(this.controlGrips.topRight.visual,ui,At),this.positionGrip(this.controlGrips.centerLeft.visual,St,te),this.positionGrip(this.controlGrips.centerRight.visual,ui,te),this.positionGrip(this.controlGrips.bottomLeft.visual,St,ni),this.positionGrip(this.controlGrips.bottomCenter.visual,wt,ni),this.positionGrip(this.controlGrips.bottomRight.visual,ui,ni),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,wt,At-3*this.CB_DISTANCE)},gt.prototype.positionGrip=function(ft,St,At){var wt=ft.transform.baseVal.getItem(0);wt.setTranslate(St,At),ft.transform.baseVal.replaceItem(wt,0)},gt.prototype.hideControlBox=function(){this.controlBox.style.display="none"},gt.prototype.showControlBox=function(){this.controlBox.style.display=""},gt.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Le.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Le.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Ct.prototype.getState.call(this))},gt.prototype.restoreState=function(ft){Ct.prototype.restoreState.call(this,ft);var St=ft;this.left=St.left,this.top=St.top,this.width=St.width,this.height=St.height,this.rotationAngle=St.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Le.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,St.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Le.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,St.containerTransformMatrix))},gt.prototype.scale=function(ft,St){Ct.prototype.scale.call(this,ft,St);var At=this.rotatePoint({x:this.left,y:this.top}),wt=this.unrotatePoint({x:At.x*ft,y:At.y*St});this.left=wt.x,this.top=wt.y,this.width=this.width*ft,this.height=this.height*St,this.adjustControlBox()},gt}(Vt),Ce=function(Ct){function gt(ft,St,At){var wt=Ct.call(this,ft,St,At)||this;return wt.fillColor="transparent",wt.strokeColor="transparent",wt.strokeWidth=0,wt.strokeDasharray="",wt.opacity=1,wt.setStrokeColor=wt.setStrokeColor.bind(wt),wt.setFillColor=wt.setFillColor.bind(wt),wt.setStrokeWidth=wt.setStrokeWidth.bind(wt),wt.setStrokeDasharray=wt.setStrokeDasharray.bind(wt),wt.createVisual=wt.createVisual.bind(wt),wt}return $t(gt,Ct),gt.prototype.ownsTarget=function(ft){return!(!Ct.prototype.ownsTarget.call(this,ft)&&ft!==this.visual)},gt.prototype.createVisual=function(){this.visual=de.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},gt.prototype.pointerDown=function(ft,St){Ct.prototype.pointerDown.call(this,ft,St),this.state==="new"&&(this.createVisual(),this.moveVisual(ft),this._state="creating")},gt.prototype.manipulate=function(ft){Ct.prototype.manipulate.call(this,ft)},gt.prototype.resize=function(ft){Ct.prototype.resize.call(this,ft),this.setSize()},gt.prototype.setSize=function(){Ct.prototype.setSize.call(this),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},gt.prototype.pointerUp=function(ft){Ct.prototype.pointerUp.call(this,ft),this.setSize()},gt.prototype.setStrokeColor=function(ft){this.strokeColor=ft,this.visual&&de.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(ft),this.stateChanged()},gt.prototype.setFillColor=function(ft){this.fillColor=ft,this.visual&&de.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},gt.prototype.setStrokeWidth=function(ft){this.strokeWidth=ft,this.visual&&de.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},gt.prototype.setStrokeDasharray=function(ft){this.strokeDasharray=ft,this.visual&&de.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},gt.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Ct.prototype.getState.call(this))},gt.prototype.restoreState=function(ft){var St=ft;this.fillColor=St.fillColor,this.strokeColor=St.strokeColor,this.strokeWidth=St.strokeWidth,this.strokeDasharray=St.strokeDasharray,this.opacity=St.opacity,this.createVisual(),Ct.prototype.restoreState.call(this,ft),this.setSize()},gt.prototype.scale=function(ft,St){Ct.prototype.scale.call(this,ft,St),this.setSize()},gt.title="Rectangle marker",gt}(Wt),Te=function(Ct){function gt(ft,St,At,wt){var te=Ct.call(this,ft,wt||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return te.widths=[],te.widthBoxes=[],te.widths=St,te.currentWidth=At,te.setCurrentWidth=te.setCurrentWidth.bind(te),te}return $t(gt,Ct),gt.prototype.getUi=function(){var ft=this,St=document.createElement("div");return St.style.display="flex",St.style.overflow="hidden",St.style.flexGrow="2",this.widths.forEach(function(At){var wt=document.createElement("div");wt.style.display="flex",wt.style.flexGrow="2",wt.style.alignItems="center",wt.style.justifyContent="space-between",wt.style.padding="5px",wt.style.borderWidth="2px",wt.style.borderStyle="solid",wt.style.borderColor=At===ft.currentWidth?ft.uiStyleSettings.toolboxAccentColor:"transparent",wt.addEventListener("click",function(){ft.setCurrentWidth(At,wt)}),St.appendChild(wt);var te=document.createElement("div");te.innerText=At.toString(),te.style.marginRight="5px",wt.appendChild(te);var ni=document.createElement("div");ni.style.minHeight="20px",ni.style.flexGrow="2",ni.style.display="flex",ni.style.alignItems="center";var ui=document.createElement("hr");ui.style.minWidth="20px",ui.style.border="0px",ui.style.borderTop=At+"px solid "+ft.uiStyleSettings.toolboxColor,ui.style.flexGrow="2",ni.appendChild(ui),wt.appendChild(ni),ft.widthBoxes.push(wt)}),St},gt.prototype.setCurrentWidth=function(ft,St){var At=this;this.currentWidth=ft,this.widthBoxes.forEach(function(wt){wt.style.borderColor=wt===St?At.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},gt}(De),ne=function(Ct){function gt(ft,St,At,wt){var te=Ct.call(this,ft,wt||'<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 te.styles=[],te.styleBoxes=[],te.styles=St,te.currentStyle=At,te.setCurrentStyle=te.setCurrentStyle.bind(te),te}return $t(gt,Ct),gt.prototype.getUi=function(){var ft=this,St=document.createElement("div");return St.style.display="flex",St.style.overflow="hidden",St.style.flexGrow="2",this.styles.forEach(function(At){var wt=document.createElement("div");wt.style.display="flex",wt.style.alignItems="center",wt.style.justifyContent="space-between",wt.style.padding="5px",wt.style.borderWidth="2px",wt.style.borderStyle="solid",wt.style.overflow="hidden",wt.style.maxWidth=100/ft.styles.length-5+"%",wt.style.borderColor=At===ft.currentStyle?ft.uiStyleSettings.toolboxAccentColor:"transparent",wt.addEventListener("click",function(){ft.setCurrentStyle(At,wt)}),St.appendChild(wt);var te=document.createElement("div");te.style.minHeight="20px",te.style.flexGrow="2",te.style.overflow="hidden";var ni=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+ft.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(At!==""?'stroke-dasharray="'+At+'"':"")+` />
|
|
</svg>`;te.innerHTML=ni,wt.appendChild(te),ft.styleBoxes.push(wt)}),St},gt.prototype.setCurrentStyle=function(ft,St){var At=this;this.currentStyle=ft,this.styleBoxes.forEach(function(wt){wt.style.borderColor=wt===St?At.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},gt}(De),Re=function(Ct){function gt(ft,St,At){var wt=Ct.call(this,ft,St,At)||this;return wt.strokeColor=At.defaultColor,wt.strokeWidth=At.defaultStrokeWidth,wt.strokeDasharray=At.defaultStrokeDasharray,wt.strokePanel=new Yt("Line color",At.defaultColorSet,At.defaultColor),wt.strokePanel.onColorChanged=wt.setStrokeColor,wt.strokeWidthPanel=new Te("Line width",At.defaultStrokeWidths,At.defaultStrokeWidth),wt.strokeWidthPanel.onWidthChanged=wt.setStrokeWidth,wt.strokeStylePanel=new ne("Line style",At.defaultStrokeDasharrays,At.defaultStrokeDasharray),wt.strokeStylePanel.onStyleChanged=wt.setStrokeDasharray,wt}return $t(gt,Ct),Object.defineProperty(gt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),gt.prototype.getState=function(){var ft=Ct.prototype.getState.call(this);return ft.typeName=gt.typeName,ft},gt.typeName="FrameMarker",gt.title="Frame marker",gt.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',gt}(Ce),ye=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"},Ie=function(Ct){function gt(ft,St,At){var wt=Ct.call(this,ft,St,At)||this;return wt.x1=0,wt.y1=0,wt.x2=0,wt.y2=0,wt.defaultLength=50,wt.manipulationStartX=0,wt.manipulationStartY=0,wt.manipulationStartX1=0,wt.manipulationStartY1=0,wt.manipulationStartX2=0,wt.manipulationStartY2=0,wt.setupControlBox(),wt}return $t(gt,Ct),gt.prototype.ownsTarget=function(ft){return!!Ct.prototype.ownsTarget.call(this,ft)||!(!this.grip1.ownsTarget(ft)&&!this.grip2.ownsTarget(ft))},gt.prototype.pointerDown=function(ft,St){Ct.prototype.pointerDown.call(this,ft,St),this.manipulationStartX=ft.x,this.manipulationStartY=ft.y,this.state==="new"&&(this.x1=ft.x,this.y1=ft.y,this.x2=ft.x,this.y2=ft.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(St)?this.activeGrip=this.grip1:this.grip2.ownsTarget(St)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},gt.prototype.pointerUp=function(ft){var St=this.state;Ct.prototype.pointerUp.call(this,ft),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(ft),this._state="select",St==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},gt.prototype.adjustVisual=function(){},gt.prototype.manipulate=function(ft){this.state==="creating"?this.resize(ft):this.state==="move"?(this.x1=this.manipulationStartX1+ft.x-this.manipulationStartX,this.y1=this.manipulationStartY1+ft.y-this.manipulationStartY,this.x2=this.manipulationStartX2+ft.x-this.manipulationStartX,this.y2=this.manipulationStartY2+ft.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(ft)},gt.prototype.resize=function(ft){switch(this.activeGrip){case this.grip1:this.x1=ft.x,this.y1=ft.y;break;case this.grip2:case void 0:this.x2=ft.x,this.y2=ft.y}this.adjustVisual(),this.adjustControlBox()},gt.prototype.select=function(){Ct.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},gt.prototype.deselect=function(){Ct.prototype.deselect.call(this),this.controlBox.style.display="none"},gt.prototype.setupControlBox=function(){this.controlBox=de.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},gt.prototype.adjustControlBox=function(){this.positionGrips()},gt.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},gt.prototype.createGrip=function(){var ft=new Xt;return ft.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(ft.visual),ft},gt.prototype.positionGrips=function(){var ft=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-ft/2,this.y1-ft/2),this.positionGrip(this.grip2.visual,this.x2-ft/2,this.y2-ft/2)},gt.prototype.positionGrip=function(ft,St,At){var wt=ft.transform.baseVal.getItem(0);wt.setTranslate(St,At),ft.transform.baseVal.replaceItem(wt,0)},gt.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Ct.prototype.getState.call(this))},gt.prototype.restoreState=function(ft){Ct.prototype.restoreState.call(this,ft);var St=ft;this.x1=St.x1,this.y1=St.y1,this.x2=St.x2,this.y2=St.y2},gt.prototype.scale=function(ft,St){Ct.prototype.scale.call(this,ft,St),this.x1=this.x1*ft,this.y1=this.y1*St,this.x2=this.x2*ft,this.y2=this.y2*St,this.adjustVisual(),this.adjustControlBox()},gt}(Vt),Ai=function(Ct){function gt(ft,St,At){var wt=Ct.call(this,ft,St,At)||this;return wt.strokeColor="transparent",wt.strokeWidth=0,wt.strokeDasharray="",wt.setStrokeColor=wt.setStrokeColor.bind(wt),wt.setStrokeWidth=wt.setStrokeWidth.bind(wt),wt.setStrokeDasharray=wt.setStrokeDasharray.bind(wt),wt.strokeColor=At.defaultColor,wt.strokeWidth=At.defaultStrokeWidth,wt.strokeDasharray=At.defaultStrokeDasharray,wt.strokePanel=new Yt("Line color",At.defaultColorSet,At.defaultColor),wt.strokePanel.onColorChanged=wt.setStrokeColor,wt.strokeWidthPanel=new Te("Line width",At.defaultStrokeWidths,At.defaultStrokeWidth),wt.strokeWidthPanel.onWidthChanged=wt.setStrokeWidth,wt.strokeStylePanel=new ne("Line style",At.defaultStrokeDasharrays,At.defaultStrokeDasharray),wt.strokeStylePanel.onStyleChanged=wt.setStrokeDasharray,wt}return $t(gt,Ct),gt.prototype.ownsTarget=function(ft){return!(!Ct.prototype.ownsTarget.call(this,ft)&&ft!==this.visual&&ft!==this.selectorLine&&ft!==this.visibleLine)},gt.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorLine=de.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=de.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},gt.prototype.pointerDown=function(ft,St){Ct.prototype.pointerDown.call(this,ft,St),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},gt.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),de.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},gt.prototype.setStrokeColor=function(ft){this.strokeColor=ft,this.adjustVisual(),this.colorChanged(ft)},gt.prototype.setStrokeWidth=function(ft){this.strokeWidth=ft,this.adjustVisual()},gt.prototype.setStrokeDasharray=function(ft){this.strokeDasharray=ft,this.adjustVisual(),this.stateChanged()},Object.defineProperty(gt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),gt.prototype.getState=function(){var ft=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Ct.prototype.getState.call(this));return ft.typeName=gt.typeName,ft},gt.prototype.restoreState=function(ft){Ct.prototype.restoreState.call(this,ft);var St=ft;this.strokeColor=St.strokeColor,this.strokeWidth=St.strokeWidth,this.strokeDasharray=St.strokeDasharray,this.createVisual(),this.adjustVisual()},gt.typeName="LineMarker",gt.title="Line marker",gt.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',gt}(Ie),yi=function(Ct){function gt(ft,St,At,wt){var te=Ct.call(this,ft,wt||'<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 te.fonts=[],te.fontBoxes=[],te.fonts=St,te.currentFont=At,te.setCurrentFont=te.setCurrentFont.bind(te),te}return $t(gt,Ct),gt.prototype.getUi=function(){var ft=this,St=document.createElement("div");return St.style.overflow="hidden",St.style.flexGrow="2",this.fonts.forEach(function(At){var wt=document.createElement("div");wt.style.display="inline-block",wt.style.alignItems="center",wt.style.justifyContent="space-between",wt.style.padding="5px",wt.style.borderWidth="2px",wt.style.borderStyle="solid",wt.style.overflow="hidden",wt.style.maxWidth=100/ft.fonts.length-5+"%",wt.style.borderColor=At===ft.currentFont?ft.uiStyleSettings.toolboxAccentColor:"transparent",wt.addEventListener("click",function(){ft.setCurrentFont(At,wt)}),St.appendChild(wt);var te=document.createElement("div");te.style.display="flex",te.style.minHeight="20px",te.style.flexGrow="2",te.style.fontFamily=At,te.style.overflow="hidden";var ni=document.createElement("div");ni.style.whiteSpace="nowrap",ni.style.overflow="hidden",ni.style.textOverflow="ellipsis",ni.innerHTML="The quick brown fox jumps over the lazy dog",te.appendChild(ni),wt.appendChild(te),ft.fontBoxes.push(wt)}),St},gt.prototype.setCurrentFont=function(ft,St){var At=this;this.currentFont=ft,this.fontBoxes.forEach(function(wt){wt.style.borderColor=wt===St?At.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},gt}(De),gi=function(Ct){function gt(ft,St,At){var wt=Ct.call(this,ft,St,At)||this;return wt.color="transparent",wt.padding=5,wt.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",wt.text=wt.DEFAULT_TEXT,wt.isMoved=!1,wt.color=At.defaultColor,wt.fontFamily=At.defaultFontFamily,wt.defaultSize={x:100,y:30},wt.setColor=wt.setColor.bind(wt),wt.setFont=wt.setFont.bind(wt),wt.renderText=wt.renderText.bind(wt),wt.sizeText=wt.sizeText.bind(wt),wt.textEditDivClicked=wt.textEditDivClicked.bind(wt),wt.showTextEditor=wt.showTextEditor.bind(wt),wt.setSize=wt.setSize.bind(wt),wt.positionTextEditor=wt.positionTextEditor.bind(wt),wt.colorPanel=new Yt("Color",At.defaultColorSet,At.defaultColor),wt.colorPanel.onColorChanged=wt.setColor,wt.fontFamilyPanel=new yi("Font",At.defaultFontFamilies,At.defaultFontFamily),wt.fontFamilyPanel.onFontChanged=wt.setFont,wt}return $t(gt,Ct),gt.prototype.ownsTarget=function(ft){if(Ct.prototype.ownsTarget.call(this,ft)||ft===this.visual||ft===this.textElement||ft===this.bgRectangle)return!0;var St=!1;return this.textElement.childNodes.forEach(function(At){At===ft&&(St=!0)}),St},gt.prototype.createVisual=function(){this.visual=de.createGroup(),this.bgRectangle=de.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=de.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},gt.prototype.pointerDown=function(ft,St){Ct.prototype.pointerDown.call(this,ft,St),this.isMoved=!1,this.pointerDownPoint=ft,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(ft),this._state="creating")},gt.prototype.renderText=function(){var ft=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(St){ft.textElement.appendChild(de.createTSpan(St.trim()===""?" ":St.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},gt.prototype.getTextScale=function(){var ft=this.textElement.getBBox(),St=1;if(ft.width>0&&ft.height>0){var At=(1*this.width-this.width*this.padding*2/100)/ft.width,wt=(1*this.height-this.height*this.padding*2/100)/ft.height;St=Math.min(At,wt)}return St},gt.prototype.getTextPosition=function(ft){var St=this.textElement.getBBox(),At=0,wt=0;return St.width>0&&St.height>0&&(At=(this.width-St.width*ft)/2,wt=this.height/2-St.height*ft/2),{x:At,y:wt}},gt.prototype.sizeText=function(){var ft=this.textElement.getBBox(),St=this.getTextScale(),At=this.getTextPosition(St);At.y-=ft.y*St,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+At.x+"px, "+At.y+"px) scale("+St+", "+St+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(At.x,At.y),this.textElement.transform.baseVal.getItem(1).setScale(St,St))},gt.prototype.manipulate=function(ft){Ct.prototype.manipulate.call(this,ft),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(ft.x-this.pointerDownPoint.x)>5||Math.abs(ft.y-this.pointerDownPoint.y)>5)},gt.prototype.resize=function(ft){Ct.prototype.resize.call(this,ft),this.isMoved=!0,this.setSize(),this.sizeText()},gt.prototype.setSize=function(){Ct.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},gt.prototype.pointerUp=function(ft){var St=this.state;St==="creating"&&(this._suppressMarkerCreateEvent=!0),Ct.prototype.pointerUp.call(this,ft),this.setSize(),(St==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},gt.prototype.showTextEditor=function(){var ft=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(St){St.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var St=Number.parseFloat(ft.textEditor.style.fontSize);ft.textEditor.clientWidth>=Number.parseInt(ft.textEditor.style.maxWidth)&&St>.9;)St-=.1,ft.textEditor.style.fontSize=Math.max(St,.9)+"em"}),this.textEditor.addEventListener("keyup",function(St){St.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(St){if(St.clipboardData){var At=St.clipboardData.getData("text"),wt=window.getSelection();if(!wt.rangeCount)return!1;wt.deleteFromDocument(),wt.getRangeAt(0).insertNode(document.createTextNode(At)),St.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){ft.textEditDivClicked(ft.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},gt.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var ft=this.getTextScale(),St=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),At=this.textElement.getBBox(),wt={x:At.width*ft,y:At.height*ft};St.x-=wt.x/2,St.y-=wt.y/2,this.textEditor.style.top=St.y+"px",this.textEditor.style.left=St.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-St.x+"px",this.textEditor.style.fontSize=Math.max(16*ft,12)+"px",this.textElement.style.display="none"}},gt.prototype.textEditDivClicked=function(ft){this.text=ft.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},gt.prototype.select=function(){Ct.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},gt.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Ct.prototype.deselect.call(this)},gt.prototype.dblClick=function(ft,St){Ct.prototype.dblClick.call(this,ft,St),this.showTextEditor()},gt.prototype.setColor=function(ft){this.textElement&&de.setAttributes(this.textElement,[["fill",ft]]),this.color=ft,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(ft)},gt.prototype.setFont=function(ft){this.textElement&&de.setAttributes(this.textElement,[["font-family",ft]]),this.fontFamily=ft,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},gt.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},gt.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(gt.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),gt.prototype.getState=function(){var ft=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Ct.prototype.getState.call(this));return ft.typeName=gt.typeName,ft},gt.prototype.restoreState=function(ft){var St=ft;this.color=St.color,this.fontFamily=St.fontFamily,this.padding=St.padding,this.text=St.text,this.createVisual(),Ct.prototype.restoreState.call(this,ft),this.setSize()},gt.prototype.scale=function(ft,St){Ct.prototype.scale.call(this,ft,St),this.setSize(),this.sizeText(),this.positionTextEditor()},gt.typeName="TextMarker",gt.title="Text marker",gt.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>',gt}(Wt),oi=function(Ct){function gt(ft,St,At){var wt=Ct.call(this,ft,St,At)||this;return wt.color="transparent",wt.lineWidth=3,wt.drawing=!1,wt.pixelRatio=1,wt.color=At.defaultColor,wt.lineWidth=At.defaultStrokeWidth,wt.pixelRatio=At.freehandPixelRatio,wt.setColor=wt.setColor.bind(wt),wt.addCanvas=wt.addCanvas.bind(wt),wt.finishCreation=wt.finishCreation.bind(wt),wt.setLineWidth=wt.setLineWidth.bind(wt),wt.colorPanel=new Yt("Color",At.defaultColorSet,At.defaultColor),wt.colorPanel.onColorChanged=wt.setColor,wt.lineWidthPanel=new Te("Line width",At.defaultStrokeWidths,At.defaultStrokeWidth),wt.lineWidthPanel.onWidthChanged=wt.setLineWidth,wt}return $t(gt,Ct),gt.prototype.ownsTarget=function(ft){return!(!Ct.prototype.ownsTarget.call(this,ft)&&ft!==this.visual&&ft!==this.drawingImage)},gt.prototype.createVisual=function(){this.visual=de.createGroup(),this.drawingImage=de.createImage(),this.visual.appendChild(this.drawingImage);var ft=de.createTransform();this.visual.transform.baseVal.appendItem(ft),this.addMarkerVisualToContainer(this.visual)},gt.prototype.pointerDown=function(ft,St){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(ft.x,ft.y),this.drawing=!0):Ct.prototype.pointerDown.call(this,ft,St)},gt.prototype.manipulate=function(ft){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(ft.x,ft.y),this.canvasContext.stroke()):Ct.prototype.manipulate.call(this,ft)},gt.prototype.resize=function(ft){Ct.prototype.resize.call(this,ft),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},gt.prototype.pointerUp=function(ft){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Ct.prototype.pointerUp.call(this,ft)},gt.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)},gt.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Ct.prototype.select.call(this)},gt.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Ct.prototype.deselect.call(this)},gt.prototype.finishCreation=function(){for(var ft=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),St=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],At=St[0],wt=St[1],te=St[2],ni=St[3],ui=!1,qe=0;qe<this.canvasElement.height;qe++)for(var xe=0;xe<this.canvasElement.width;xe++)ft.data[qe*this.canvasElement.width*4+4*xe+3]>0&&(ui=!0,qe<wt&&(wt=qe),xe<At&&(At=xe),qe>ni&&(ni=qe),xe>te&&(te=xe));if(ui){this.left=At/this.pixelRatio,this.top=wt/this.pixelRatio,this.width=(te-At)/this.pixelRatio,this.height=(ni-wt)/this.pixelRatio;var Zi=document.createElement("canvas");Zi.width=te-At,Zi.height=ni-wt,Zi.getContext("2d").putImageData(this.canvasContext.getImageData(At,wt,te-At,ni-wt),0,0),this.drawingImgUrl=Zi.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},gt.prototype.setDrawingImage=function(){de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},gt.prototype.setColor=function(ft){this.color=ft,this.colorChanged(ft)},gt.prototype.setLineWidth=function(ft){this.lineWidth=ft},Object.defineProperty(gt.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),gt.prototype.getState=function(){var ft=Object.assign({drawingImgUrl:this.drawingImgUrl},Ct.prototype.getState.call(this));return ft.typeName=gt.typeName,ft},gt.prototype.restoreState=function(ft){this.createVisual(),Ct.prototype.restoreState.call(this,ft),this.drawingImgUrl=ft.drawingImgUrl,this.setDrawingImage()},gt.prototype.scale=function(ft,St){Ct.prototype.scale.call(this,ft,St),this.setDrawingImage()},gt.typeName="FreehandMarker",gt.title="Freehand marker",gt.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>',gt}(Wt),Bt=function(Ct){function gt(ft,St,At){var wt=Ct.call(this,ft,At||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return wt.typeBoxes=[],wt.currentType=St,wt.setCurrentType=wt.setCurrentType.bind(wt),wt}return $t(gt,Ct),gt.prototype.getUi=function(){var ft=this,St=document.createElement("div");St.style.display="flex",St.style.overflow="hidden",St.style.flexGrow="2";for(var At=function(ni){var ui="both";switch(ni){case 0:ui="both";break;case 1:ui="start";break;case 2:ui="end";break;case 3:ui="none"}var qe=document.createElement("div");if(qe.style.display="flex",qe.style.flexGrow="2",qe.style.alignItems="center",qe.style.justifyContent="space-between",qe.style.padding="5px",qe.style.borderWidth="2px",qe.style.borderStyle="solid",qe.style.borderColor=ui===wt.currentType?wt.uiStyleSettings.toolboxAccentColor:"transparent",qe.addEventListener("click",function(){ft.setCurrentType(ui,qe)}),St.appendChild(qe),ui==="both"||ui==="start"){var xe=document.createElement("div");xe.style.display="flex",xe.style.alignItems="center",xe.style.minHeight="20px",xe.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(wt.uiStyleSettings!==void 0?wt.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,xe.style.marginLeft="5px",qe.appendChild(xe)}var Zi=document.createElement("div");Zi.style.display="flex",Zi.style.alignItems="center",Zi.style.minHeight="20px",Zi.style.flexGrow="2";var Si=document.createElement("hr");if(Si.style.minWidth="20px",Si.style.border="0px",Si.style.borderTop="3px solid "+(wt.uiStyleSettings!==void 0?wt.uiStyleSettings.toolboxColor:"#eeeeee"),Si.style.flexGrow="2",Zi.appendChild(Si),qe.appendChild(Zi),ui==="both"||ui==="end"){var Oi=document.createElement("div");Oi.style.display="flex",Oi.style.alignItems="center",Oi.style.minHeight="20px",Oi.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,0 10,5 0,10" fill="`+(wt.uiStyleSettings!==void 0?wt.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Oi.style.marginRight="5px",qe.appendChild(Oi)}wt.typeBoxes.push(qe)},wt=this,te=0;te<4;te++)At(te);return St},gt.prototype.setCurrentType=function(ft,St){var At=this;this.currentType=ft,this.typeBoxes.forEach(function(wt){wt.style.borderColor=wt===St?At.uiStyleSettings!==void 0?At.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},gt}(De),bt=function(Ct){function gt(ft,St,At){var wt=Ct.call(this,ft,St,At)||this;return wt.arrowType="end",wt.arrowBaseHeight=10,wt.arrowBaseWidth=10,wt.getArrowPoints=wt.getArrowPoints.bind(wt),wt.setArrowType=wt.setArrowType.bind(wt),wt.arrowTypePanel=new Bt("Arrow type","end"),wt.arrowTypePanel.onArrowTypeChanged=wt.setArrowType,wt}return $t(gt,Ct),gt.prototype.ownsTarget=function(ft){return!(!Ct.prototype.ownsTarget.call(this,ft)&&ft!==this.arrow1&&ft!==this.arrow2)},gt.prototype.getArrowPoints=function(ft,St){var At=this.arrowBaseWidth+2*this.strokeWidth,wt=this.arrowBaseHeight+2*this.strokeWidth;return ft-At/2+","+(St+wt/2)+" "+ft+","+(St-wt/2)+" "+(ft+At/2)+","+(St+wt/2)},gt.prototype.createTips=function(){this.arrow1=de.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=de.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow2)},gt.prototype.pointerDown=function(ft,St){Ct.prototype.pointerDown.call(this,ft,St),this.state==="creating"&&this.createTips()},gt.prototype.adjustVisual=function(){if(Ct.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2){this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",de.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),de.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var ft=0;Math.abs(this.x1-this.x2)>.1&&(ft=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var St=this.arrow1.transform.baseVal.getItem(0);St.setRotate(ft,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(St,0);var At=this.arrow2.transform.baseVal.getItem(0);At.setRotate(ft+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(At,0)}},gt.prototype.setArrowType=function(ft){this.arrowType=ft,this.adjustVisual(),this.stateChanged()},Object.defineProperty(gt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),gt.prototype.getState=function(){var ft=Object.assign({arrowType:this.arrowType},Ct.prototype.getState.call(this));return ft.typeName=gt.typeName,ft},gt.prototype.restoreState=function(ft){Ct.prototype.restoreState.call(this,ft);var St=ft;this.arrowType=St.arrowType,this.createTips(),this.adjustVisual()},gt.typeName="ArrowMarker",gt.title="Arrow marker",gt.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',gt}(Ai),ge=function(Ct){function gt(ft,St,At){var wt=Ct.call(this,ft,St,At)||this;return wt.fillColor=At.defaultFillColor,wt.strokeWidth=0,wt.fillPanel=new Yt("Color",At.defaultColorSet,At.defaultFillColor),wt.fillPanel.onColorChanged=wt.setFillColor,wt}return $t(gt,Ct),Object.defineProperty(gt.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),gt.prototype.getState=function(){var ft=Ct.prototype.getState.call(this);return ft.typeName=gt.typeName,ft},gt.typeName="CoverMarker",gt.title="Cover marker",gt.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',gt}(Ce),Ge=function(Ct){function gt(ft,St,At,wt){var te=Ct.call(this,ft,wt||'<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 te.opacities=[],te.opacityBoxes=[],te.opacities=St,te.currentOpacity=At,te.setCurrentOpacity=te.setCurrentOpacity.bind(te),te}return $t(gt,Ct),gt.prototype.getUi=function(){var ft=this,St=document.createElement("div");return St.style.display="flex",St.style.overflow="hidden",St.style.flexGrow="2",St.style.justifyContent="space-between",this.opacities.forEach(function(At){var wt=document.createElement("div");wt.style.display="flex",wt.style.alignItems="center",wt.style.justifyContent="center",wt.style.padding="5px",wt.style.borderWidth="2px",wt.style.borderStyle="solid",wt.style.borderColor=At===ft.currentOpacity?ft.uiStyleSettings.toolboxAccentColor:"transparent",wt.addEventListener("click",function(){ft.setCurrentOpacity(At,wt)}),St.appendChild(wt);var te=document.createElement("div");te.innerText=100*At+"%",wt.appendChild(te),ft.opacityBoxes.push(wt)}),St},gt.prototype.setCurrentOpacity=function(ft,St){var At=this;this.currentOpacity=ft,this.opacityBoxes.forEach(function(wt){wt.style.borderColor=wt===St?At.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},gt}(De),Ye=function(Ct){function gt(ft,St,At){var wt=Ct.call(this,ft,St,At)||this;return wt.setOpacity=wt.setOpacity.bind(wt),wt.fillColor=At.defaultHighlightColor,wt.strokeWidth=0,wt.opacity=At.defaultHighlightOpacity,wt.fillPanel=new Yt("Color",At.defaultColorSet,wt.fillColor),wt.fillPanel.onColorChanged=wt.setFillColor,wt.opacityPanel=new Ge("Opacity",At.defaultOpacitySteps,wt.opacity),wt.opacityPanel.onOpacityChanged=wt.setOpacity,wt}return $t(gt,Ct),gt.prototype.setOpacity=function(ft){this.opacity=ft,this.visual&&de.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(gt.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),gt.prototype.getState=function(){var ft=Ct.prototype.getState.call(this);return ft.typeName=gt.typeName,ft},gt.typeName="HighlightMarker",gt.title="Highlight marker",gt.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>',gt}(ge),oe='<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>',Ve='<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>',Ze=function(Ct){function gt(ft,St,At){var wt=Ct.call(this,ft,St,At)||this;return wt.bgColor="transparent",wt.tipPosition={x:0,y:0},wt.tipBase1Position={x:0,y:0},wt.tipBase2Position={x:0,y:0},wt.tipMoving=!1,wt.color=At.defaultStrokeColor,wt.bgColor=At.defaultFillColor,wt.fontFamily=At.defaultFontFamily,wt.defaultSize={x:100,y:30},wt.setBgColor=wt.setBgColor.bind(wt),wt.getTipPoints=wt.getTipPoints.bind(wt),wt.positionTip=wt.positionTip.bind(wt),wt.setTipPoints=wt.setTipPoints.bind(wt),wt.colorPanel=new Yt("Text color",At.defaultColorSet,wt.color,oe),wt.colorPanel.onColorChanged=wt.setColor,wt.bgColorPanel=new Yt("Fill color",At.defaultColorSet,wt.bgColor,Ve),wt.bgColorPanel.onColorChanged=wt.setBgColor,wt.fontFamilyPanel=new yi("Font",At.defaultFontFamilies,At.defaultFontFamily),wt.fontFamilyPanel.onFontChanged=wt.setFont,wt.tipGrip=new Xt,wt.tipGrip.visual.transform.baseVal.appendItem(de.createTransform()),wt.controlBox.appendChild(wt.tipGrip.visual),wt}return $t(gt,Ct),gt.prototype.ownsTarget=function(ft){return Ct.prototype.ownsTarget.call(this,ft)||this.tipGrip.ownsTarget(ft)||this.tip===ft},gt.prototype.createTip=function(){de.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=de.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},gt.prototype.pointerDown=function(ft,St){this.state==="new"&&Ct.prototype.pointerDown.call(this,ft,St),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(St)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Ct.prototype.pointerDown.call(this,ft,St)},gt.prototype.pointerUp=function(ft){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Ct.prototype.pointerUp.call(this,ft);else{var St=this.state==="creating";Ct.prototype.pointerUp.call(this,ft),this.setTipPoints(St),this.positionTip()}},gt.prototype.manipulate=function(ft){if(this.tipMoving){var St=this.unrotatePoint(ft);this.tipPosition={x:St.x-this.manipulationStartLeft,y:St.y-this.manipulationStartTop},this.positionTip()}else Ct.prototype.manipulate.call(this,ft)},gt.prototype.setBgColor=function(ft){this.bgRectangle&&this.tip&&(de.setAttributes(this.bgRectangle,[["fill",ft]]),de.setAttributes(this.tip,[["fill",ft]])),this.bgColor=ft,this.fillColorChanged(ft)},gt.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},gt.prototype.setTipPoints=function(ft){ft===void 0&&(ft=!1);var St=Math.min(this.height/2,15),At=this.height/5;ft&&(this.tipPosition={x:St+At/2,y:this.height+20});var wt=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?wt<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(At=this.width/5,St=Math.min(this.width/2,15),this.tipBase1Position={x:St,y:0},this.tipBase2Position={x:St+At,y:0}):(this.tipBase1Position={x:0,y:St},this.tipBase2Position={x:0,y:St+At}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?wt<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(At=this.width/5,St=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-St-At,y:0},this.tipBase2Position={x:this.width-St,y:0}):(this.tipBase1Position={x:this.width,y:St},this.tipBase2Position={x:this.width,y:St+At}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?wt<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(At=this.width/5,St=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-St-At,y:this.height},this.tipBase2Position={x:this.width-St,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-St-At},this.tipBase2Position={x:this.width,y:this.height-St}):wt<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(At=this.width/5,St=Math.min(this.width/2,15),this.tipBase1Position={x:St,y:this.height},this.tipBase2Position={x:St+At,y:this.height}):(this.tipBase1Position={x:0,y:this.height-St},this.tipBase2Position={x:0,y:this.height-St-At})},gt.prototype.resize=function(ft){Ct.prototype.resize.call(this,ft),this.positionTip()},gt.prototype.positionTip=function(){de.setAttributes(this.tip,[["points",this.getTipPoints()]]);var ft=this.tipGrip.visual.transform.baseVal.getItem(0);ft.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(ft,0)},Object.defineProperty(gt.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),gt.prototype.select=function(){this.positionTip(),Ct.prototype.select.call(this)},gt.prototype.getState=function(){var ft=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Ct.prototype.getState.call(this));return ft.typeName=gt.typeName,ft},gt.prototype.restoreState=function(ft){var St=ft;this.bgColor=St.bgColor,this.tipPosition=St.tipPosition,Ct.prototype.restoreState.call(this,ft),this.createTip(),this.setTipPoints()},gt.prototype.scale=function(ft,St){Ct.prototype.scale.call(this,ft,St),this.tipPosition={x:this.tipPosition.x*ft,y:this.tipPosition.y*St},this.positionTip()},gt.typeName="CalloutMarker",gt.title="Callout marker",gt.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>',gt}(gi),Ni=function(Ct){function gt(ft,St,At){var wt=Ct.call(this,ft,St,At)||this;return wt.fillColor="transparent",wt.strokeColor="transparent",wt.strokeWidth=0,wt.strokeDasharray="",wt.opacity=1,wt.strokeColor=At.defaultColor,wt.strokeWidth=At.defaultStrokeWidth,wt.strokeDasharray=At.defaultStrokeDasharray,wt.fillColor=At.defaultFillColor,wt.setStrokeColor=wt.setStrokeColor.bind(wt),wt.setFillColor=wt.setFillColor.bind(wt),wt.setStrokeWidth=wt.setStrokeWidth.bind(wt),wt.setStrokeDasharray=wt.setStrokeDasharray.bind(wt),wt.setOpacity=wt.setOpacity.bind(wt),wt.createVisual=wt.createVisual.bind(wt),wt.strokePanel=new Yt("Line color",Dt(At.defaultColorSet,["transparent"]),At.defaultColor),wt.strokePanel.onColorChanged=wt.setStrokeColor,wt.fillPanel=new Yt("Fill color",Dt(At.defaultColorSet,["transparent"]),wt.fillColor,Ve),wt.fillPanel.onColorChanged=wt.setFillColor,wt.strokeWidthPanel=new Te("Line width",At.defaultStrokeWidths,At.defaultStrokeWidth),wt.strokeWidthPanel.onWidthChanged=wt.setStrokeWidth,wt.strokeStylePanel=new ne("Line style",At.defaultStrokeDasharrays,At.defaultStrokeDasharray),wt.strokeStylePanel.onStyleChanged=wt.setStrokeDasharray,wt.opacityPanel=new Ge("Opacity",At.defaultOpacitySteps,wt.opacity),wt.opacityPanel.onOpacityChanged=wt.setOpacity,wt}return $t(gt,Ct),gt.prototype.ownsTarget=function(ft){return!(!Ct.prototype.ownsTarget.call(this,ft)&&ft!==this.visual)},gt.prototype.createVisual=function(){this.visual=de.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},gt.prototype.pointerDown=function(ft,St){Ct.prototype.pointerDown.call(this,ft,St),this.state==="new"&&(this.createVisual(),this.moveVisual(ft),this._state="creating")},gt.prototype.manipulate=function(ft){Ct.prototype.manipulate.call(this,ft)},gt.prototype.resize=function(ft){Ct.prototype.resize.call(this,ft),this.setSize()},gt.prototype.setSize=function(){Ct.prototype.setSize.call(this),de.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},gt.prototype.pointerUp=function(ft){Ct.prototype.pointerUp.call(this,ft),this.setSize()},gt.prototype.setStrokeColor=function(ft){this.strokeColor=ft,this.visual&&de.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(ft),this.stateChanged()},gt.prototype.setFillColor=function(ft){this.fillColor=ft,this.visual&&de.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(ft),this.stateChanged()},gt.prototype.setStrokeWidth=function(ft){this.strokeWidth=ft,this.visual&&de.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},gt.prototype.setStrokeDasharray=function(ft){this.strokeDasharray=ft,this.visual&&de.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},gt.prototype.setOpacity=function(ft){this.opacity=ft,this.visual&&de.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(gt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),gt.prototype.getState=function(){var ft=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Ct.prototype.getState.call(this));return ft.typeName=gt.typeName,ft},gt.prototype.restoreState=function(ft){var St=ft;this.fillColor=St.fillColor,this.strokeColor=St.strokeColor,this.strokeWidth=St.strokeWidth,this.strokeDasharray=St.strokeDasharray,this.opacity=St.opacity,this.createVisual(),Ct.prototype.restoreState.call(this,ft),this.setSize()},gt.prototype.scale=function(ft,St){Ct.prototype.scale.call(this,ft,St),this.setSize()},gt.typeName="EllipseMarker",gt.title="Ellipse marker",gt.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>',gt}(Wt),Se=function(Ct){function gt(ft,St,At){return Ct.call(this,ft,St,At)||this}return $t(gt,Ct),Object.defineProperty(gt.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),gt.prototype.ownsTarget=function(ft){return!(!Ct.prototype.ownsTarget.call(this,ft)&&ft!==this.tip1&&ft!==this.tip2)},gt.prototype.createTips=function(){this.tip1=de.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.tip1),this.tip2=de.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.tip2)},gt.prototype.pointerDown=function(ft,St){Ct.prototype.pointerDown.call(this,ft,St),this.state==="creating"&&this.createTips()},gt.prototype.adjustVisual=function(){if(Ct.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(de.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var ft=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),St=this.tip1.transform.baseVal.getItem(0);St.setRotate(ft,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(St,0);var At=this.tip2.transform.baseVal.getItem(0);At.setRotate(ft+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(At,0)}},Object.defineProperty(gt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),gt.prototype.getState=function(){var ft=Ct.prototype.getState.call(this);return ft.typeName=gt.typeName,ft},gt.prototype.restoreState=function(ft){Ct.prototype.restoreState.call(this,ft),this.createTips(),this.adjustVisual()},gt.typeName="MeasurementMarker",gt.title="Measurement marker",gt.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>',gt}(Ai),ie=function(Ct){function gt(ft,St,At){var wt=Ct.call(this,ft,St,At)||this;return wt.strokePanel.colors=At.defaultColorSet,wt.fillColor="transparent",wt}return $t(gt,Ct),Object.defineProperty(gt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),gt.prototype.getState=function(){var ft=Ct.prototype.getState.call(this);return ft.typeName=gt.typeName,ft},gt.typeName="EllipseFrameMarker",gt.title="Ellipse frame marker",gt.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>',gt}(Ni),ee=function(){function Ct(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Ct.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Ct.prototype.addUndoStep=function(gt){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(gt)||(this.undoStack.push(gt),JSON.stringify(this.lastRedoStep)!==JSON.stringify(gt)&&this.redoStack.splice(0,this.redoStack.length))},Ct.prototype.replaceLastUndoStep=function(gt){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=gt)},Ct.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Ct.prototype.undo=function(){if(this.undoStack.length>1){var gt=this.undoStack.pop();return gt!==void 0&&this.redoStack.push(gt),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Ct.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Ct}(),ve=function(Ct){function gt(ft,St,At){var wt=Ct.call(this,ft,St,At)||this;return wt.strokeColor="transparent",wt.strokeWidth=0,wt.strokeDasharray="",wt.curveX=0,wt.curveY=0,wt.manipulationStartCurveX=0,wt.manipulationStartCurveY=0,wt.setStrokeColor=wt.setStrokeColor.bind(wt),wt.setStrokeWidth=wt.setStrokeWidth.bind(wt),wt.setStrokeDasharray=wt.setStrokeDasharray.bind(wt),wt.positionGrips=wt.positionGrips.bind(wt),wt.addControlGrips=wt.addControlGrips.bind(wt),wt.adjustVisual=wt.adjustVisual.bind(wt),wt.setupControlBox=wt.setupControlBox.bind(wt),wt.resize=wt.resize.bind(wt),wt.strokeColor=At.defaultColor,wt.strokeWidth=At.defaultStrokeWidth,wt.strokeDasharray=At.defaultStrokeDasharray,wt.strokePanel=new Yt("Line color",At.defaultColorSet,At.defaultColor),wt.strokePanel.onColorChanged=wt.setStrokeColor,wt.strokeWidthPanel=new Te("Line width",At.defaultStrokeWidths,At.defaultStrokeWidth),wt.strokeWidthPanel.onWidthChanged=wt.setStrokeWidth,wt.strokeStylePanel=new ne("Line style",At.defaultStrokeDasharrays,At.defaultStrokeDasharray),wt.strokeStylePanel.onStyleChanged=wt.setStrokeDasharray,wt}return $t(gt,Ct),gt.prototype.ownsTarget=function(ft){return!(!Ct.prototype.ownsTarget.call(this,ft)&&ft!==this.visual&&ft!==this.selectorCurve&&ft!==this.visibleCurve&&!this.curveGrip.ownsTarget(ft))},gt.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},gt.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorCurve=de.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=de.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},gt.prototype.pointerDown=function(ft,St){Ct.prototype.pointerDown.call(this,ft,St),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=ft.x,this.curveY=ft.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(St)&&(this.activeGrip=this.curveGrip,this._state="resize")},gt.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),de.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},gt.prototype.setupControlBox=function(){Ct.prototype.setupControlBox.call(this),this.curveControlLine1=de.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=de.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},gt.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Ct.prototype.addControlGrips.call(this)},gt.prototype.positionGrips=function(){Ct.prototype.positionGrips.call(this);var ft=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-ft/2,this.curveY-ft/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()))},gt.prototype.manipulate=function(ft){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+ft.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+ft.y-this.manipulationStartY),Ct.prototype.manipulate.call(this,ft)},gt.prototype.resize=function(ft){this.activeGrip===this.curveGrip&&(this.curveX=ft.x,this.curveY=ft.y),Ct.prototype.resize.call(this,ft),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},gt.prototype.setStrokeColor=function(ft){this.strokeColor=ft,this.adjustVisual(),this.colorChanged(ft)},gt.prototype.setStrokeWidth=function(ft){this.strokeWidth=ft,this.adjustVisual()},gt.prototype.setStrokeDasharray=function(ft){this.strokeDasharray=ft,this.adjustVisual()},gt.prototype.scale=function(ft,St){this.curveX=this.curveX*ft,this.curveY=this.curveY*St,Ct.prototype.scale.call(this,ft,St)},Object.defineProperty(gt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),gt.prototype.getState=function(){var ft=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Ct.prototype.getState.call(this));return ft.typeName=gt.typeName,ft},gt.prototype.restoreState=function(ft){Ct.prototype.restoreState.call(this,ft);var St=ft;this.strokeColor=St.strokeColor,this.strokeWidth=St.strokeWidth,this.strokeDasharray=St.strokeDasharray,this.curveX=St.curveX,this.curveY=St.curveY,this.createVisual(),this.adjustVisual()},gt.typeName="CurveMarker",gt.title="Curve marker",gt.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>',gt}(Ie),ti=function(Ct){function gt(ft,St,At){var wt=Ct.call(this,ft,St,At)||this;return wt.fillColor="transparent",wt.strokeColor="transparent",wt.strokeWidth=0,wt.strokeDasharray="",wt.textColor="transparent",wt.fontSize="1rem",wt.isMoved=!1,wt.captionText="Caption",wt.PADDING=5,wt.captionBoxWidth=0,wt.captionBoxHeight=0,wt.strokeColor=At.defaultColor,wt.strokeWidth=At.defaultStrokeWidth,wt.strokeDasharray=At.defaultStrokeDasharray,wt.fillColor=At.defaultFillColor,wt.textColor=At.defaultStrokeColor,wt.fontFamily=At.defaultFontFamily,wt.fontSize=At.defaultCaptionFontSize,wt.captionText=At.defaultCaptionText,wt.setStrokeColor=wt.setStrokeColor.bind(wt),wt.setFillColor=wt.setFillColor.bind(wt),wt.setStrokeWidth=wt.setStrokeWidth.bind(wt),wt.setStrokeDasharray=wt.setStrokeDasharray.bind(wt),wt.createVisual=wt.createVisual.bind(wt),wt.sizeCaption=wt.sizeCaption.bind(wt),wt.setCaptionText=wt.setCaptionText.bind(wt),wt.showTextEditor=wt.showTextEditor.bind(wt),wt.positionTextEditor=wt.positionTextEditor.bind(wt),wt.finishTextEditing=wt.finishTextEditing.bind(wt),wt.setFont=wt.setFont.bind(wt),wt.setTextColor=wt.setTextColor.bind(wt),wt.strokePanel=new Yt("Line color",Dt(At.defaultColorSet,["transparent"]),wt.strokeColor),wt.strokePanel.onColorChanged=wt.setStrokeColor,wt.fillPanel=new Yt("Fill color",Dt(At.defaultColorSet,["transparent"]),wt.fillColor,Ve),wt.fillPanel.onColorChanged=wt.setFillColor,wt.strokeWidthPanel=new Te("Line width",At.defaultStrokeWidths,At.defaultStrokeWidth),wt.strokeWidthPanel.onWidthChanged=wt.setStrokeWidth,wt.strokeStylePanel=new ne("Line style",At.defaultStrokeDasharrays,At.defaultStrokeDasharray),wt.strokeStylePanel.onStyleChanged=wt.setStrokeDasharray,wt.fontFamilyPanel=new yi("Font",At.defaultFontFamilies,At.defaultFontFamily),wt.fontFamilyPanel.onFontChanged=wt.setFont,wt.textColorPanel=new Yt("Text color",At.defaultColorSet,wt.textColor,oe),wt.textColorPanel.onColorChanged=wt.setTextColor,wt}return $t(gt,Ct),gt.prototype.ownsTarget=function(ft){return!(!Ct.prototype.ownsTarget.call(this,ft)&&ft!==this.visual&&ft!==this.frame&&ft!==this.captionBg&&ft!==this.captionElement)},gt.prototype.createVisual=function(){this.visual=de.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=de.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=de.createText([["fill",this.textColor],["font-family",this.fontFamily]]),this.captionElement.style.fontSize=this.fontSize,this.captionElement.style.textAnchor="start",this.captionElement.style.dominantBaseline="text-before-edge",this.captionElement.textContent=this.captionText,this.visual.appendChild(this.captionElement),this.frame=de.createRect(this.width,this.height,[["fill","transparent"],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray]]),this.visual.appendChild(this.frame),this.sizeCaption()},gt.prototype.setCaptionText=function(ft){this.captionText=ft,this.captionElement.textContent=this.captionText,this.sizeCaption()},gt.prototype.pointerDown=function(ft,St){Ct.prototype.pointerDown.call(this,ft,St),this.isMoved=!1,this.pointerDownPoint=ft,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(ft),this._state="creating")},gt.prototype.manipulate=function(ft){Ct.prototype.manipulate.call(this,ft),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(ft.x-this.pointerDownPoint.x)>5||Math.abs(ft.y-this.pointerDownPoint.y)>5)},gt.prototype.resize=function(ft){Ct.prototype.resize.call(this,ft),this.setSize()},gt.prototype.sizeCaption=function(){var ft=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=ft.width+2*this.PADDING,this.captionBoxHeight=ft.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),de.setAttributes(this.captionBg,[["width",this.captionBoxWidth.toString()],["height",this.captionBoxHeight.toString()],["clip-path","path('M0,0 H"+this.width+" V"+this.height+" H"+-this.width+" Z')"]]),de.setAttributes(this.captionElement,[["x",this.PADDING.toString()],["y",this.PADDING.toString()],["clip-path","path('M0,0 H"+(this.width-this.PADDING)+" V"+this.height+" H"+(-this.width-this.PADDING)+" Z')"]])},gt.prototype.showTextEditor=function(){var ft=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(St){St.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(St){St.key==="Enter"&&ft.finishTextEditing(ft.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(St){St.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){ft.finishTextEditing(ft.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){ft.finishTextEditing(ft.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},gt.prototype.positionTextEditor=function(){this.state==="edit"&&(this.textEditBox===void 0?this.showTextEditor():(this.textEditBox.style.left=this.left+"px",this.textEditBox.style.top=this.top+"px",this.textEditBox.style.transform="rotate("+this.rotationAngle+"deg)",this.textEditBox.style.transformOrigin=this.width/2+"px "+this.height/2+"px"))},gt.prototype.finishTextEditing=function(ft){this.setCaptionText(ft.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},gt.prototype.setFont=function(ft){this.captionElement&&de.setAttributes(this.captionElement,[["font-family",ft]]),this.fontFamily=ft,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},gt.prototype.setTextColor=function(ft){this.captionElement&&de.setAttributes(this.captionElement,[["fill",ft]]),this.textColor=ft,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},gt.prototype.setSize=function(){Ct.prototype.setSize.call(this),de.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},gt.prototype.pointerUp=function(ft){Ct.prototype.pointerUp.call(this,ft),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},gt.prototype.dblClick=function(ft,St){Ct.prototype.dblClick.call(this,ft,St),this.showTextEditor()},gt.prototype.setStrokeColor=function(ft){this.strokeColor=ft,this.frame&&de.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(ft),this.stateChanged()},gt.prototype.setFillColor=function(ft){this.fillColor=ft,this.captionBg&&de.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(ft),this.stateChanged()},gt.prototype.setStrokeWidth=function(ft){this.strokeWidth=ft,this.frame&&de.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},gt.prototype.setStrokeDasharray=function(ft){this.strokeDasharray=ft,this.frame&&de.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(gt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),gt.prototype.getState=function(){var ft=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},Ct.prototype.getState.call(this));return ft.typeName=this.typeName,ft},gt.prototype.restoreState=function(ft){var St=ft;this.fillColor=St.fillColor,this.strokeColor=St.strokeColor,this.strokeWidth=St.strokeWidth,this.strokeDasharray=St.strokeDasharray,this.textColor=St.textColor,this.fontFamily=St.fontFamily,this.captionText=St.captionText,this.fontSize=St.fontSize,this.createVisual(),Ct.prototype.restoreState.call(this,ft),this.setSize()},gt.prototype.scale=function(ft,St){Ct.prototype.scale.call(this,ft,St),this.setSize()},gt.typeName="CaptionFrameMarker",gt.title="Caption frame marker",gt.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>',gt}(Wt),he=function(){function Ct(gt,ft){ft===void 0&&(ft=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=gt,this.cancelable=ft}return Object.defineProperty(Ct.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Ct.prototype.preventDefault=function(){this._defaultPrevented=!0},Ct}(),We=function(Ct){function gt(ft,St,At){var wt=Ct.call(this,ft,!1)||this;return wt.dataUrl=St,wt.state=At,wt}return $t(gt,Ct),gt}(he),He=function(Ct){function gt(ft,St,At){At===void 0&&(At=!1);var wt=Ct.call(this,ft,At)||this;return wt.marker=St,wt}return $t(gt,Ct),gt}(he),we=function(){function Ct(){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 Ct.prototype.addEventListener=function(gt,ft){this[gt].push(ft)},Ct.prototype.removeEventListener=function(gt,ft){var St=this[gt].indexOf(ft);St>-1&&this[gt].splice(St,1)},Ct}(),ei=function(){function Ct(gt){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ye,this._isOpen=!1,this.undoRedoManager=new ee,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 we,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Ct.instanceCounter++,this.styles=new qt(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=gt,this.targetRoot=document.body,this.width=gt.clientWidth,this.height=gt.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(Ct.prototype,"ALL_MARKER_TYPES",{get:function(){return[Re,oi,bt,gi,ie,Ni,Ye,Ze,Se,ge,Ai,ve,ti]},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Re,oi,bt,gi,Ni,Ye,Ze]},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Re,oi,bt,gi,Ye]},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(gt){var ft=this;this._availableMarkerTypes.splice(0),gt.forEach(function(St){if(typeof St=="string"){var At=ft.ALL_MARKER_TYPES.find(function(wt){return wt.typeName===St});At!==void 0&&ft._availableMarkerTypes.push(At)}else ft._availableMarkerTypes.push(St)})},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Ct.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(gt){this._zoomLevel=gt,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(Ct.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Ct.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),zt.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Ct.prototype.show=function(){var gt=this;this.styles.styleSheetRoot===void 0&&ue.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ue.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(ft){return ft(new he(gt))})},Ct.prototype.render=function(){return Ae(this,void 0,void 0,function(){var gt;return re(this,function(ft){switch(ft.label){case 0:return this.setCurrentMarker(),(gt=new Ne).naturalSize=this.renderAtNaturalSize,gt.imageType=this.renderImageType,gt.imageQuality=this.renderImageQuality,gt.markersOnly=this.renderMarkersOnly,gt.width=this.renderWidth,gt.height=this.renderHeight,[4,gt.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return ft.sent(),[4,gt.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,ft.sent()]}})})},Ct.prototype.close=function(gt){var ft=this;if(gt===void 0&&(gt=!1),this.isOpen){var St=!1;gt||this.eventListeners.beforeclose.forEach(function(At){var wt=new he(ft,!0);At(wt),wt.defaultPrevented&&(St=!0)}),St||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(At){return At(new he(ft))}),this.detachEvents(),this._isOpen=!1)}},Ct.prototype.addMarkersToToolbar=function(){for(var gt,ft=[],St=0;St<arguments.length;St++)ft[St]=arguments[St];(gt=this._availableMarkerTypes).push.apply(gt,ft)},Ct.prototype.addRenderEventListener=function(gt){this.addEventListener("render",function(ft){gt(ft.dataUrl,ft.state)})},Ct.prototype.removeRenderEventListener=function(gt){},Ct.prototype.addCloseEventListener=function(gt){this.addEventListener("close",function(){gt()})},Ct.prototype.removeCloseEventListener=function(gt){},Ct.prototype.setupResizeObserver=function(){var gt=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){gt.resize(gt.target.clientWidth,gt.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return gt.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Ct.prototype.onPopupTargetResize=function(){var gt=1*this.target.clientWidth/this.target.clientHeight,ft=this.editorCanvas.clientWidth/gt>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*gt:this.editorCanvas.clientWidth,St=ft<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/gt;this.resize(ft,St)},Ct.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Ct.prototype.resize=function(gt,ft){this._isResizing=!0;var St=gt/this.imageWidth,At=ft/this.imageHeight;this.imageWidth=Math.round(gt),this.imageHeight=Math.round(ft),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(St,At),this._isResizing=!1},Ct.prototype.scaleMarkers=function(gt,ft){var St,At=this;this._currentMarker&&this._currentMarker instanceof gi?this._currentMarker.scale(gt,ft):(St=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(wt){wt!==At._currentMarker&&wt.scale(gt,ft)}),St!==void 0&&this.setCurrentMarker(St)},Ct.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"},Ct.prototype.setTopLeft=function(){var gt=this.editingTarget.getBoundingClientRect(),ft=this.editorCanvas.getBoundingClientRect();this.left=gt.left-ft.left,this.top=gt.top-ft.top},Ct.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)},Ct.prototype.addDefs=function(){for(var gt,ft=[],St=0;St<arguments.length;St++)ft[St]=arguments[St];this.defs=de.createDefs(),this.addDefsToImage(),(gt=this.defs).append.apply(gt,ft)},Ct.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Ct.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)},Ct.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Ct.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Ct.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)},Ct.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Ct.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)},Ct.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 gt=document.createElement("a");gt.href="https://markerjs.com/",gt.target="_blank",gt.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>',gt.title="Powered by marker.js",gt.style.display="grid",gt.style.alignItems="center",gt.style.justifyItems="center",gt.style.padding="3px",gt.style.width="20px",gt.style.height="20px",this.logoUI.appendChild(gt),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Ct.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},Ct.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"},Ct.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Ct.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var gt=this.settings.uiOffsetTop!==void 0?this.target.offsetTop+this.settings.uiOffsetTop:this.target.offsetTop>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=gt+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Pe(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.settings.uiOffsetTop===void 0&&this.target.offsetTop<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new je(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Ct.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Ct.prototype.removeMarker=function(gt){this.markerImage.removeChild(gt.container),this.markers.indexOf(gt)>-1&&this.markers.splice(this.markers.indexOf(gt),1),gt.dispose()},Ct.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},Ct.prototype.toolbarButtonClicked=function(gt,ft){if(gt==="marker"&&ft!==void 0)this.createNewMarker(ft);else if(gt==="action")switch(ft){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},Ct.prototype.deleteSelectedMarker=function(){var gt=this;if(this._currentMarker!==void 0){var ft=!1;if(this.eventListeners.markerbeforedelete.forEach(function(At){var wt=new He(gt,gt._currentMarker,!0);At(wt),wt.defaultPrevented&&(ft=!0)}),!ft){var St=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(At){return At(new He(gt,St))})}}},Ct.prototype.clear=function(){var gt=this,ft=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(te){var ni=new He(gt,void 0,!0);te(ni),ni.defaultPrevented&&(ft=!0)}),!ft)){this.setCurrentMarker();for(var St=function(te){var ni=At.markers[te];At.setCurrentMarker(At.markers[te]),At._currentMarker.dispose(),At.markerImage.removeChild(At._currentMarker.container),At.markers.splice(At.markers.indexOf(At._currentMarker),1),At.eventListeners.markerdelete.forEach(function(ui){return ui(new He(gt,ni))})},At=this,wt=this.markers.length-1;wt>=0;wt--)St(wt);this.addUndoStep()}},Object.defineProperty(Ct.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Ct.prototype.showNotesEditor=function(){var gt;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(gt=this._currentMarker.notes)!==null&>!==void 0?gt:"",this.overlayContainer.appendChild(this.notesArea))},Ct.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},Ct.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Ct.prototype.addUndoStep=function(){var gt=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var ft=this.getState(),St=this.undoRedoManager.getLastUndoStep();if(!St||St.width===ft.width&&St.height===ft.height){var At=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(ft),At<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(wt){return wt(new he(gt))})}else this.undoRedoManager.replaceLastUndoStep(ft),this.eventListeners.statechange.forEach(function(wt){return wt(new he(gt))})}},Ct.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Ct.prototype.undoStep=function(){var gt=this,ft=this.undoRedoManager.undo();ft!==void 0&&(this.restoreState(ft),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(St){return St(new he(gt))}))},Ct.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Ct.prototype.redoStep=function(){var gt=this,ft=this.undoRedoManager.redo();ft!==void 0&&(this.restoreState(ft),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(St){return St(new he(gt))}))},Ct.prototype.stepZoom=function(){var gt=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=gt<this.zoomSteps.length-1?this.zoomSteps[gt+1]:this.zoomSteps[0]},Ct.prototype.panTo=function(gt){this.contentDiv.scrollBy({left:this.prevPanPoint.x-gt.x,top:this.prevPanPoint.y-gt.y}),this.prevPanPoint=gt},Ct.prototype.startRenderAndClose=function(){return Ae(this,void 0,void 0,function(){var gt,ft,St=this;return re(this,function(At){switch(At.label){case 0:return[4,this.render()];case 1:return gt=At.sent(),ft=this.getState(),this.eventListeners.render.forEach(function(wt){return wt(new We(St,gt,ft))}),this.close(!0),[2]}})})},Ct.prototype.getState=function(gt){gt===!0&&this.setCurrentMarker();var ft={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(St){return ft.markers.push(St.getState())}),ft},Ct.prototype.restoreState=function(gt){var ft=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);gt.markers.forEach(function(St){var At=ft._availableMarkerTypes.find(function(te){return te.typeName===St.typeName});if(At!==void 0){var wt=ft.addNewMarker(At);wt.restoreState(St),ft.markers.push(wt)}}),gt.width&>.height&&(gt.width!==this.imageWidth||gt.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/gt.width,this.imageHeight/gt.height),this.eventListeners.restorestate.forEach(function(St){return St(new he(ft))})},Ct.prototype.addNewMarker=function(gt){var ft=de.createGroup();return this.markerImage.appendChild(ft),new gt(ft,this.overlayContainer,this.settings)},Ct.prototype.createNewMarker=function(gt){var ft,St=this;(ft=typeof gt=="string"?this._availableMarkerTypes.find(function(At){return At.typeName===gt}):gt)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(ft),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(ft.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(At){return At(new He(St,St._currentMarker))}))},Ct.prototype.markerCreated=function(gt){var ft=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(gt),this.setCurrentMarker(gt),gt instanceof oi&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(oi):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(St){return St(new He(ft,ft._currentMarker))})},Ct.prototype.colorChanged=function(gt){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=gt,this.settings.defaultStrokeColor=gt)},Ct.prototype.fillColorChanged=function(gt){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=gt)},Ct.prototype.markerStateChanged=function(gt){var ft=this;this.eventListeners.markerchange.forEach(function(St){return St(new He(ft,gt))})},Ct.prototype.setCurrentMarker=function(gt){var ft=this;this._currentMarker!==gt&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(St){return St(new He(ft,ft._currentMarker))})),this._currentMarker=gt,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(St){return St(new He(ft,ft._currentMarker))}))},Ct.prototype.onPointerDown=function(gt){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||gt.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var ft=this.markers.find(function(St){return St.ownsTarget(gt.target)});ft!==void 0?(this.setCurrentMarker(ft),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(gt.clientX,gt.clientY),gt.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:gt.clientX,y:gt.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(gt.clientX,gt.clientY))},Ct.prototype.onDblClick=function(gt){if(this._isFocused||this.focus(),this.mode==="select"){var ft=this.markers.find(function(St){return St.ownsTarget(gt.target)});ft!==void 0&&ft!==this._currentMarker&&this.setCurrentMarker(ft),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(gt.clientX,gt.clientY),gt.target):this.setCurrentMarker()}},Ct.prototype.onPointerMove=function(gt){this.touchPoints!==1&>.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||gt.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(gt.clientX,gt.clientY)):this.zoomLevel>1&&this.panTo({x:gt.clientX,y:gt.clientY}))},Ct.prototype.onPointerUp=function(gt){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(gt.clientX,gt.clientY)),this.isDragging=!1,this.addUndoStep()},Ct.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Ct.prototype.onKeyUp=function(gt){this._currentMarker===void 0||this.notesArea!==void 0||gt.key!=="Delete"&>.key!=="Backspace"||this.deleteSelectedMarker()},Ct.prototype.clientToLocalCoordinates=function(gt,ft){var St=this.markerImage.getBoundingClientRect();return{x:(gt-St.left)/this.zoomLevel,y:(ft-St.top)/this.zoomLevel}},Ct.prototype.onWindowResize=function(){this.positionUI()},Ct.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var gt=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=gt+"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()},Ct.prototype.addLicenseKey=function(gt){zt.addKey(gt)},Ct.prototype.addEventListener=function(gt,ft){this.eventListeners.addEventListener(gt,ft)},Ct.prototype.removeEventListener=function(gt,ft){this.eventListeners.removeEventListener(gt,ft)},Ct.prototype.renderState=function(gt){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(gt),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Ct.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Ct.prototype.focus=function(){var gt=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(ft){return ft(new he(gt))}))},Ct.prototype.blur=function(){var gt=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(ft){return ft(new he(gt))}))},Ct.instanceCounter=0,Ct}(),Be=Mt(57193),Zt=Mt(63949),Je=(Ct,gt,ft)=>new Promise((St,At)=>{var wt=ui=>{try{ni(ft.next(ui))}catch(qe){At(qe)}},te=ui=>{try{ni(ft.throw(ui))}catch(qe){At(qe)}},ni=ui=>ui.done?St(ui.value):Promise.resolve(ui.value).then(wt,te);ni((ft=ft.apply(Ct,gt)).next())}),Pi=({data:Ct,className:gt,fullWidth:ft,style:St={},onClose:At,onOk:wt,showFullTools:te,noAssociationId:ni})=>{const ui=(0,pt.useRef)(null),qe=(0,pt.useRef)(null),xe=(0,pt.useRef)(null),Zi=(0,pt.useRef)(null),[Si,Oi]=(0,pt.useState)(!1),[Qi,Cn]=(0,pt.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,pt.useEffect)(()=>(xe.current||(xe.current=document.createElement("style"),document.head.appendChild(xe.current)),Ct!=null&&Ct.visible?(document.body.setAttribute("data-custom","y-hidden"),xe.current.innerHTML=" html { overflow-y: hidden; }",Ct!=null&&Ct.src&&_i()):(document.body.removeAttribute("data-custom"),xe.current&&(document.head.removeChild(xe.current),xe.current=null)),()=>{document.body.removeAttribute("data-custom"),xe.current&&(document.head.removeChild(xe.current),xe.current=null)}),[Ct==null?void 0:Ct.visible]);const _i=()=>Je(void 0,null,function*(){Oi(!0),Cn("\u6B63\u5728\u52A0\u8F7D\u4E2D");const fr=yield(0,Zt.ZJ)(Ct==null?void 0:Ct.src);ui.current.src="",ui.current.src=fr,ui.current.onload=function(){ir()},Oi(!1),Cn("")}),Mn=fr=>Je(void 0,null,function*(){Oi(!0),Cn("\u6B63\u5728\u4FDD\u5B58\u4E2D");const ar=yield(0,Be.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Ct.title,file:fr.dataUrl}});ar!=null&&ar.id&&!ni?(yield(0,Be.ZP)(`/api/attachments/${Ct.id}/add_subitem.json`,{method:"post",body:{subitem_id:ar==null?void 0:ar.id,settings:JSON.stringify(fr.state)}})).status===0&&wt():ar!=null&&ar.id&&wt(ar),Oi(!1),Cn("")}),er=()=>{const fr=document.querySelector('a[href="https://markerjs.com/"]');fr&&fr.parentNode&&(fr.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"\u9009\u62E9"},{name:'[data-action="delete"]',title:"\u5220\u9664\u5143\u7D20"},{name:'[data-action="undo"]',title:"\u64A4\u9500"},{name:'[data-type-name="FrameMarker"]',title:"\u77E9\u5F62"},{name:'[data-type-name="FreehandMarker"]',title:"\u753B\u7EBF"},{name:'[data-type-name="ArrowMarker"]',title:"\u7BAD\u5934"},{name:'[data-type-name="TextMarker"]',title:"\u6587\u672C"},{name:'[data-type-name="EllipseMarker"]',title:"\u692D\u5706"},{name:'[data-type-name="HighlightMarker"]',title:"\u65B9\u5757"},{name:'[data-type-name="CalloutMarker"]',title:"\u6CE8\u91CA"},{name:'[data-action="render"]',title:"\u4FDD\u5B58"},{name:'[data-action="close"]',title:"\u9000\u51FA"}].forEach(br=>{const Qn=document.querySelector(br.name);Qn&&Qn.setAttribute("title",br.title)})},ir=()=>{qe.current=new ei(ui.current),qe.current.targetRoot=Zi.current,qe.current.addEventListener("render",Mn),qe.current.addEventListener("beforeclose",At),te&&(qe.current.availableMarkerTypes=qe.current.ALL_MARKER_TYPES,qe.current.uiStyleSettings.redoButtonVisible=!0,qe.current.uiStyleSettings.notesButtonVisible=!0,qe.current.uiStyleSettings.zoomButtonVisible=!0,qe.current.uiStyleSettings.zoomOutButtonVisible=!0,qe.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=qe.current.uiStyleSettings,qe.current.show(),Ct!=null&&Ct.snapshotData&&qe.current.restoreState(Ct.snapshotData),setTimeout(()=>{window.scrollTo(0,0),er()},300)};return pt.createElement(pt.Fragment,null,(Ct==null?void 0:Ct.visible)&&pt.createElement(Ut.Z,{spinning:Si,tip:Qi,style:{position:"absolute",width:"100vw"}},pt.createElement("div",{ref:Zi,className:me()(_t.imageDimensions,gt,ft?_t.fullWidth:""),style:St},pt.createElement("img",{className:_t.img,ref:ui}))))}},24638:function(Li,ai,Mt){"use strict";var pt=Mt(59301),_t=Mt(77019),ce=Mt(5269),me=Mt(20554),Ut=Mt(99571),fe=Mt(97231),$t=Mt(27431),Ae=Mt(48136),re=Mt(59301);const Dt=(0,pt.forwardRef)(({callback:de,showSaveButton:zt,value:Ne=""},ue)=>{const qt=(0,pt.useRef)(),Qt=[{name:"\u5206\u6570\u5F97\u5206",value:"\\frac{x}{y}",children:[{name:"\u5206\u6570 Fractions",data:[{value:"\\frac{a}{b}"},{value:"x\\tfrac{x}{a} "},{value:"\\mathrm{d}t"},{value:"\\partial t"},{value:"\\frac{\\partial y}{\\partial x}"},{value:"\\nabla\\psi"},{value:"\\frac{\\partial^2}{\\partial x_1\\partial x_2}y"},{value:"\\cfrac{1}{a + \\cfrac{7}{b + \\cfrac{2}{9}}} = c"}]},{name:"\u5BFC\u6570 Derivative",data:[{value:"\\dot{a} "},{value:"\\ddot{a}"},{value:"{f}^{\\prime}"},{value:"{f}^{\\prime\\prime}"},{value:"{f}^{(n)}"}]},{name:"\u6A21\u7B97\u672F Modular arithmetic",data:[{value:"a \\bmod b"},{value:"a \\equiv b \\pmod{m} "},{value:"\\gcd(m, n) "},{value:"\\operatorname{lcm}(m, n) "}]}]},{name:"\u6839\u5F0F\u89D2\u6807",value:"\\sqrt{x}",children:[{name:"\u6839\u5F0F Radicals",data:[{value:"\\sqrt{x}"},{value:"\\sqrt[y]{x}"}]},{name:"\u4E0A\u4E0B\u6807 Sub&Super",data:[{value:"x^{a}"},{value:"x_{a}"},{value:"x_{a}^{b} "},{value:"_{a}^{b} x"},{value:"x_{a}^{b} "}]},{name:"\u91CD\u97F3\u7B26\u53CA\u5176\u4ED6 Accents and Others",data:[{value:"\\hat{a} "},{value:"\\sqrt[y]{x}"},{value:"\\check{} "},{value:"\\grave{a} "},{value:"\\acute{a}"},{value:"\\tilde{a}"},{value:"\\breve{a}"},{value:"\\bar{a}"},{value:"\\vec{a}"},{value:"\\not{a}"},{value:"\\widetilde{abc}"},{value:"\\widehat{abc}"},{value:"\\overleftarrow{abc} "},{value:"\\overrightarrow{abc}"},{value:"\\overline{abc}"},{value:"\\underline{abc}"},{value:"\\overbrace{abc}"},{value:"\\underbrace{abc}"},{value:"\\overset{a}{abc}"},{value:"\\underset{a}{abc} \\stackrel\\frown{ab}"},{value:"\\overline{ab} "},{value:"\\overleftrightarrow{ab}"},{value:"\\overset{a}{\\leftarrow}"},{value:"\\overset{a}{\\rightarrow}"},{value:"\\xleftarrow[abc]{a}"},{value:"\\xrightarrow[abc]{a} "}]}]},{name:"\u6781\u9650\u5BF9\u6570",value:"\\lim_{x \\to 0}",children:[{name:"\u6781\u9650 Limits",data:[{value:"\\lim a"},{value:"\\lim_{x \\to 0}"},{value:"\\lim_{x \\to \\infty}"},{value:"\\max_b{a}"},{value:"\\min_a{b}"}]},{name:"\u5BF9\u6570\u6307\u6570 Logarithms and exponentials",data:[{value:"\\log_{a}{b}"},{value:"\\lg_{a}{b}"},{value:"\\ln_{a}{b}"},{value:"\\exp a"}]},{name:"\u754C\u9650 Bounds",data:[{value:"\\min x"},{value:"\\sup t"},{value:"\\inf s"},{value:"\\lim u"},{value:"\\limsup w"},{value:"\\dim p"},{value:"\\ker\\phi "}]}]},{name:"\u4E09\u89D2\u51FD\u6570",value:"\\sin a",children:[{name:"\u4E09\u89D2\u51FD\u6570 Trigonometric functions",data:[{value:"\\sin a"},{value:"\\cos a"},{value:"\\tan a"},{value:"\\cot a "},{value:"\\sec a "},{value:"\\csc a "}]},{name:"\u53CD\u4E09\u89D2\u51FD\u6570 Inverse trigonometric functions",data:[{value:"\\sin^{-1}"},{value:"\\cos^{-1}"},{value:"\\tan^{-1}"},{value:"\\cot^{-1}"},{value:"\\sec^{-1}"},{value:"\\csc^{-1}"},{value:"\\arcsin a"},{value:"\\arccos a"},{value:"\\arctan a"},{value:"\\operatorname{arccot} a"},{value:"\\operatorname{arcsec} a"},{value:"\\operatorname{arccsc} a"}]},{name:"\u53CC\u66F2\u51FD\u6570 Hyperblic functions",data:[{value:"\\sinh a"},{value:"\\cosh a"},{value:"\\tanh a"},{value:"\\coth a"},{value:"\\operatorname{sech} a"},{value:"\\operatorname{csch} a"}]},{name:"\u53CD\u53CC\u66F2\u51FD\u6570 Inverse hyperbolic functions",data:[{value:"\\sinh^{-1}"},{value:"a\\cosh^{-1} a"},{value:"\\tanh^{-1} a"},{value:"\\coth^{-1} a"},{value:"\\operatorname{sech}^{-1} a"},{value:"\\operatorname{csch}^{-1} a"}]}]},{name:"\u79EF\u5206\u8FD0\u7B97",value:"\\int_{a}^{b}",children:[{name:"\u79EF\u5206 Integral",data:[{value:"\\int"},{value:"\\int_{a}^{b}"},{value:"\\int\\limits_{a}^{b}"}]},{name:"\u53CC\u91CD\u79EF\u5206 Double integral",data:[{value:"\\iint"},{value:"\\iint_{a}^{b} "},{value:"\\iint\\limits_{a}^{b} "}]},{name:"\u4E09\u91CD\u79EF\u5206 Triple integral",data:[{value:"\\iiint"},{value:"\\iiint_{a}^{b}"},{value:"\\iiint\\limits_{a}^{b} "}]},{name:"\u66F2\u7EBF\u79EF\u5206 Closed line or path integral",data:[{value:"\\oint"},{value:"\\oint_{a}^{b} "}]}]},{name:"\u5927\u578B\u8FD0\u7B97",value:"\\sum_{a}^{b}",children:[{name:"\u6C42\u548C Summation",data:[{value:"\\sum"},{value:"\\sum_{a}^{b}"},{value:"{\\textstyle \\sum_{a}^{b}} "}]},{name:"\u4E58\u79EF\u4F59\u79EF Product and coproduct",data:[{value:"\\prod"},{value:"\\prod_{a}^{b}"},{value:"{\\textstyle \\prod_{a}^{b}}"},{value:"\\coprod"},{value:"\\coprod_{a}^{b}"},{value:"{\\textstyle \\coprod_{a}^{b}} "}]},{name:"\u5E76\u96C6\u4EA4\u96C6 Union and intersection",data:[{value:"\\bigcup"},{value:"\\bigcup_{a}^{b}"},{value:"{\\textstyle \\bigcup_{a}^{b}}"},{value:"\\bigcap"},{value:"\\bigcap_{a}^{b}"}]},{name:"\u6790\u53D6\u5408\u53D6 Disjunction and conjunction",data:[{value:"\\bigvee"},{value:"\\bigvee_{a}^{b}"},{value:"\\bigwedge"},{value:"\\bigwedge_{a}^{b}"}]}]},{name:"\u62EC\u53F7\u53D6\u6574",value:"\\left [ \\left ( \\right ) \\right ] ",children:[{name:"\u62EC\u53F7 Brackets",data:[{value:"\\left ( \\right )"},{value:"\\left [ \\right ]"},{value:"\\left \\langle \\right \\rangle "},{value:"\\left | \\right | "},{value:"\\left \\lfloor \\right \\rfloor "},{value:"\\left \\lceil \\right \\rceil "}]}]}],Jt=[{name:"\u4EE3\u6570",value:"\\sqrt{a^2+b^2}",children:[{data:[{value:"\\left(x-1\\right)\\left(x+3\\right) "},{value:"\\sqrt{a^2+b^2}"},{value:"\\left ( \\frac{a}{b}\\right )^{n}= \\frac{a^{n}}{b^{n}}"},{value:"\\frac{a}{b}\\pm \\frac{c}{d}= \\frac{ad \\pm bc}{bd} "},{value:"\\frac{x^{2}}{a^{2}}-\\frac{y^{2}}{b^{2}}=1 "},{value:"\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0 "},{value:"\\sqrt[n]{a^{n}}=\\left ( \\sqrt[n]{a}\\right )^{n} "},{value:"x ={-b \\pm \\sqrt{b^2-4ac}\\over 2a} "},{value:"y-y_{1}=k \\left( x-x_{1}\\right) "},{value:`\\left\\{\\begin{matrix} \r
|
|
x=a + r\\text{cos}\\theta \\ \r
|
|
y=b + r\\text{sin}\\theta \r
|
|
\\end{matrix}\\right. `},{value:`\\begin{array}{l} \r
|
|
\\text{\u5BF9\u4E8E\u65B9\u7A0B\u5F62\u5982\uFF1A}x^{3}-1=0 \\ \r
|
|
\\text{\u8BBE}\\text{:}\\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
|
|
x_{1}=1,x_{2}= \\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
|
|
x_{3}= \\omega ^{2}=\\frac{-1-\\sqrt{3}i}{2} \r
|
|
\\end{array} `},{value:`\\begin{array}{l} \r
|
|
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
|
|
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
|
|
\\left\\{\\begin{matrix} \r
|
|
\\Delta \\gt 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u4E0D\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
|
|
\\Delta = 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
|
|
\\Delta \\lt 0\\text{\u65B9\u7A0B\u65E0\u5B9E\u6839} \r
|
|
\\end{matrix}\\right. \r
|
|
\\end{array} `},{value:`\\begin{array}{l} \r
|
|
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
|
|
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
|
|
\\mathop{{x}}\\nolimits_{{1,2}}=\\frac{{-b \\pm \r
|
|
\\sqrt{{\\mathop{{b}}\\nolimits^{{2}}-4ac}}}}{{2a}} \\ \r
|
|
\\mathop{{x}}\\nolimits_{{1}}+\\mathop{{x}}\\nolimits_{{2}}=-\\frac{{b}}{{a}} \\ \r
|
|
\\mathop{{x}}\\nolimits_{{1}}\\mathop{{x}}\\nolimits_{{2}}=\\frac{{c}}{{a}} \r
|
|
\\end{array} `}]}]},{name:"\u51E0\u4F55",value:"\\Delta A B C ",children:[{data:[{value:"\\Delta A B C "},{value:"a \\parallel c,b \\parallel c \\Rightarrow a \\parallel b "},{value:"l \\perp \\beta ,l \\subset \\alpha \\Rightarrow \\alpha \\perp \\beta"},{value:`\\left.\\begin{matrix} \r
|
|
a \\perp \\alpha \\ \r
|
|
b \\perp \\alpha \r
|
|
\\end{matrix}\\right\\}\\Rightarrow a \\parallel b`},{value:"P \\in \\alpha ,P \\in \\beta , \\alpha \\cap \\beta =l \\Rightarrow P \\in l "},{value:`\\alpha \\perp \\beta , \\alpha \\cap \\beta =l,a \\subset \\alpha ,a \\perp l \r
|
|
\\Rightarrow a \\perp \\beta `},{value:`\\left.\\begin{matrix} \r
|
|
a \\subset \\beta ,b \\subset \\beta ,a \\cap b=P \\ \r
|
|
a \\parallel \\partial ,b \\parallel \\partial \r
|
|
\\end{matrix}\\right\\}\\Rightarrow \\beta \\parallel \\alpha `},{value:"\\alpha \\parallel \\beta , \\gamma \\cap \\alpha =a, \\gamma \\cap \\beta =b \\Rightarrow a \\parallel b "},{value:"A \\in l,B \\in l,A \\in \\alpha ,B \\in \\alpha \\Rightarrow l \\subset \\alpha "},{value:`\\left.\\begin{matrix} \r
|
|
m \\subset \\alpha ,n \\subset \\alpha ,m \\cap n=P \\ \r
|
|
a \\perp m,a \\perp n \r
|
|
\\end{matrix}\\right\\}\\Rightarrow a \\perp \\alpha `},{value:`\\begin{array}{c} \r
|
|
\\text{\u76F4\u89D2\u4E09\u89D2\u5F62\u4E2D,\u76F4\u89D2\u8FB9\u957Fa,b,\u659C\u8FB9\u8FB9\u957Fc} \\ \r
|
|
a^{2}+b^{2}=c^{2} \r
|
|
\\end{array}`}]}]},{name:"\u4E0D\u7B49\u5F0F",value:"a > b",children:[{data:[{value:"a > b,b > c \\Rightarrow a > c "},{value:"a > b,c > d \\Rightarrow a+c > b+d "},{value:"a > b > 0,c > d > 0 \\Rightarrow ac bd "},{value:`\\begin{array}{c} \r
|
|
a \\gt b,c \\gt 0 \\Rightarrow ac \\gt bc \\ \r
|
|
a \\gt b,c \\lt 0 \\Rightarrow ac \\lt bc \r
|
|
\\end{array}`},{value:"\\left | a-b \\right | \\geqslant \\left | a \\right | -\\left | b \\right | "},{value:"-\\left | a \\right |\\leq a\\leqslant \\left | a \\right | "},{value:"\\left | a \\right |\\leqslant b \\Rightarrow -b \\leqslant a \\leqslant \\left | b \\right | "},{value:"\\left | a+b \\right | \\leqslant \\left | a \\right | + \\left | b \\right | "},{value:`\\begin{array}{c} \r
|
|
a \\gt b \\gt 0,n \\in N^{\\ast},n \\gt 1 \\ \r
|
|
\\Rightarrow a^{n}\\gt b^{n}, \\sqrt[n]{a}\\gt \\sqrt[n]{b} \r
|
|
\\end{array}`},{value:`\\left( \\sum_{k=1}^n a_k b_k \\right)^{\\!\\!2}\\leq \r
|
|
\\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) `},{value:`\\begin{array}{c} \r
|
|
a,b \\in R^{+} \\ \r
|
|
\\Rightarrow \\frac{a+b}{{2}}\\ge \\sqrt{ab} \\ \r
|
|
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
|
|
\\end{array}`},{value:`\\begin{array}{c} \r
|
|
a,b \\in R \\ \r
|
|
\\Rightarrow a^{2}+b^{2}\\gt 2ab \\ \r
|
|
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
|
|
\\end{array}`},{value:`\\begin{array}{c} \r
|
|
H_{n}=\\frac{n}{\\sum \\limits_{i=1}^{n}\\frac{1}{x_{i}}}= \\frac{n}{\\frac{1}{x_{1}}+ \\frac{1}{x_{2}}+ \\cdots + \\frac{1}{x_{n}}} \\ G_{n}=\\sqrt[n]{\\prod \\limits_{i=1}^{n}x_{i}}= \\sqrt[n]{x_{1}x_{2}\\cdots x_{n}} \\ A_{n}=\\frac{1}{n}\\sum \\limits_{i=1}^{n}x_{i}=\\frac{x_{1}+ x_{2}+ \\cdots + x_{n}}{n} \\ Q_{n}=\\sqrt{\\sum \\limits_{i=1}^{n}x_{i}^{2}}= \\sqrt{\\frac{x_{1}^{2}+ x_{2}^{2}+ \\cdots + x_{n}^{2}}{n}} \\ H_{n}\\leq G_{n}\\leq A_{n}\\leq Q_{n} \r
|
|
\\end{array}`}]}]},{name:"\u79EF\u5206",value:"\\frac{\\mathrm{d}\\partial}{\\partial x}",children:[{data:[{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}x^n=nx^{n-1} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}e^{ax}=a\\,e^{ax} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\ln(x)=\\frac{1}{x} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\sin x=\\cos x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cos x=-\\sin x "},{value:"\\int k\\mathrm{d}x = kx+C "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\tan x=\\sec^2 x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cot x=-\\csc^2 x "},{value:"\\int \\frac{1}{x}\\mathrm{d}x= \\ln \\left| x \\right| +C "},{value:"\\int \\frac{1}{\\sqrt{1-x^{2}}}\\mathrm{d}x= \\arcsin x +C "},{value:"\\int \\frac{1}{1+x^{2}}\\mathrm{d}x= \\arctan x +C "},{value:"\\int u \\frac{\\mathrm{d}v}{\\mathrm{d}x}\\,\\mathrm{d}x=uv-\\int \\frac{\\mathrm{d}u}{\\mathrm{d}x}v\\,\\mathrm{d}x "},{value:"f(x) = \\int_{-\\infty}^\\infty \\hat f(x)\\xi\\,e^{2 \\pi i \\xi x} \\,\\mathrm{d}\\xi "},{value:"\\int x^{\\mu}\\mathrm{d}x=\\frac{x^{\\mu +1}}{\\mu +1}+C, \\left({\\mu \\neq -1}\\right) "}]}]},{name:"\u4E09\u89D2",value:"e^{i \\theta}",children:[{name:"\u6C42\u548C Summation",data:[{value:"e^{i \\theta} "},{value:"\\left(\\frac{\\pi}{2}-\\theta \\right ) "},{value:"\\text{sin}^{2}\\frac{\\alpha}{2}=\\frac{1- \\text{cos}\\alpha}{2} "},{value:"\\text{cos}^{2}\\frac{\\alpha}{2}=\\frac{1+ \\text{cos}\\alpha}{2} "},{value:"\\text{tan}\\frac{\\alpha}{2}=\\frac{\\text{sin}\\alpha}{1+ \\text{cos}\\alpha} "},{value:"\\sin \\alpha + \\sin \\beta =2 \\sin \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\sin \\alpha - \\sin \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha + \\cos \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha - \\cos \\beta =-2\\sin \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"a^{2}=b^{2}+c^{2}-2bc\\cos A "},{value:"\\frac{\\sin A}{a}=\\frac{\\sin B}{b}=\\frac{\\sin C}{c}=\\frac{1}{2R} "},{value:"\\sin \\left ( \\frac{\\pi}{2}-\\alpha \\right ) = \\cos \\alpha "},{value:"\\sin \\left ( \\frac{\\pi}{2}+\\alpha \\right ) = \\cos \\alpha "}]}]},{name:"\u7EDF\u8BA1",value:"C_{r}^{n}",children:[{data:[{value:"C_{r}^{n} "},{value:"\\frac{n!}{r!(n-r)!} "},{value:"\\sum_{i=1}^{n}{X_i} "},{value:"\\sum_{i=1}^{n}{X_i^2} "},{value:"X_1, \\cdots,X_n "},{value:"\\frac{x-\\mu}{\\sigma} "},{value:"\\sum_{i=1}^{n}{(X_i - \\overline{X})^2} "},{value:`\\begin{array}{c} \r
|
|
\\text{\u82E5}P \\left( AB \\right) =P \\left( A \\right) P \\left( B \\right) \\\\ \r
|
|
\\text{\u5219}P \\left( A \\left| B\\right. \\right) =P \\left({B}\\right) \r
|
|
\\end{array}`},{value:"P(E) ={n \\choose k}p^k (1-p)^{n-k} "},{value:"P \\left( A \\right) = \\lim \\limits_{n \\to \\infty}f_{n}\\left ( A \\right ) "},{value:"P \\left( \\bigcup \\limits_{i=1}^{+ \\infty}A_{i}\\right) = \\prod \\limits_{i=1}^{+ \\infty}P{\\left( A_{i}\\right)} "},{value:`\\begin{array}{c} \r
|
|
P \\left( \\emptyset \\right) =0 \\\\ \r
|
|
P \\left( S \\right) =1 \r
|
|
\\end{array}`},{value:`\\begin{array}{c} \r
|
|
\\forall A \\in S \\\\ \r
|
|
P \\left( A \\right) \\ge 0 \r
|
|
\\end{array}`},{value:"P \\left( \\bigcup \\limits_{i=1}^{n}A_{i}\\right) = \\prod \\limits_{i=1}^{n}P \\left( A_{i}\\right) "},{value:`\\begin{array}{c} \r
|
|
S= \\binom{N}{n},A_{k}=\\binom{M}{k}\\cdot \\binom{N-M}{n-k} \\\\ \r
|
|
P\\left ( A_{k}\\right ) = \\frac{\\binom{M}{k}\\cdot \\binom{N-M}{n-k}}{\\binom{N}{n}} \r
|
|
\\end{array}`},{value:`\\begin{array}{c} \r
|
|
P_{n}=n! \\\\ \r
|
|
A_{n}^{k}=\\frac{n!}{\\left( n-k \\left) !\\right. \\right.} \r
|
|
\\end{array}`}]}]}],Pe=Yt=>{qt.current.setValue(qt.current.getValue()+" "+Yt.value+" ")},je=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:re.createElement(_t.Z,{className:$t.Z.lists,gutter:[10,10]},Qt.map((Yt,Vt)=>re.createElement(ce.Z,{flex:"110px",className:$t.Z.item},re.createElement("div",null,re.createElement(fe.Z,{value:`$$${Yt.value}$$`}),Yt.name),re.createElement("div",{className:$t.Z.children},Yt.children.map((pe,Xt)=>re.createElement("div",{key:Xt},re.createElement("h1",null,pe.name),re.createElement(_t.Z,{gutter:[10,10]},pe.data.map((Le,Wt)=>re.createElement(ce.Z,{key:Wt,onClick:()=>Pe(Le),className:$t.Z.diamond},re.createElement(fe.Z,{value:"`$$"+Le.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:re.createElement(_t.Z,{className:$t.Z.lists,gutter:[10,10]},Jt.map((Yt,Vt)=>re.createElement(ce.Z,{flex:"110px",className:$t.Z.item},re.createElement("div",null,re.createElement(fe.Z,{value:"`$$"+Yt.value+"$$`"}),Yt.name),re.createElement("div",{className:$t.Z.children},Yt.children.map((pe,Xt)=>re.createElement("div",{key:Xt},pe.name&&re.createElement("h1",null,pe.name),re.createElement(_t.Z,{gutter:[10,10]},pe.data.map((Le,Wt)=>re.createElement(ce.Z,{key:Wt,onClick:()=>Pe(Le),className:$t.Z.diamond},re.createElement(fe.Z,{value:"`$$"+Le.value+"$$`"}))))))))))}],De=()=>{var Yt=document.createElement("div");Yt.innerHTML=qt.current.getValue();var Vt=Yt.innerText;return de&&de(Vt),Vt};return(0,pt.useImperativeHandle)(ue,()=>({getData:De})),re.createElement("div",{className:$t.Z.mathWrap},re.createElement(me.default,{defaultActiveKey:"1",items:je}),re.createElement("math-field",{locale:"zh_cn",className:$t.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:qt,style:{width:800,marginTop:30,fontSize:18}},Ne||""),zt&&re.createElement("div",{className:$t.Z.button},re.createElement(Ut.ZP,{size:"large",onClick:De,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});ai.Z=Dt},13922:function(Li,ai,Mt){"use strict";var pt=Mt(59301),_t=Mt(93314),ce=Mt(99571),me=Object.defineProperty,Ut=Object.defineProperties,fe=Object.getOwnPropertyDescriptors,$t=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable,Dt=(ue,qt,Qt)=>qt in ue?me(ue,qt,{enumerable:!0,configurable:!0,writable:!0,value:Qt}):ue[qt]=Qt,de=(ue,qt)=>{for(var Qt in qt||(qt={}))Ae.call(qt,Qt)&&Dt(ue,Qt,qt[Qt]);if($t)for(var Qt of $t(qt))re.call(qt,Qt)&&Dt(ue,Qt,qt[Qt]);return ue},zt=(ue,qt)=>Ut(ue,fe(qt));const Ne=({img:ue,buttonProps:qt={},styles:Qt={},customText:Jt,ButtonText:Pe,ButtonClick:je,Buttonclass:De,ButtonTwo:Yt,imgStyles:Vt,loading:pe=!1,className:Xt=""})=>pt.createElement("section",{className:`tc animated fadeIn ${Xt}`,style:de({color:"#999",margin:"100px auto",visibility:pe?"hidden":"visible"},Qt)},pt.createElement("img",{src:ue||_t,style:zt(de({},Vt),{pointerEvents:"none",userSelect:"none"})}),pt.createElement("p",{className:"mt20 font14"},Jt||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),Pe&&pt.createElement(ce.ZP,de({className:De,onClick:je},qt),Pe),Yt&&Yt);ai.Z=Ne},9931:function(Li,ai,Mt){"use strict";Mt.d(ai,{Z:function(){return De}});var pt=Mt(59301),_t={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},ce=Mt(99571),me=Mt(70557),Ut=Mt(95440),fe=Mt(25399),$t=Mt(63949),Ae=Mt(75823),re=Mt(13922),Dt=Mt(78323),de=Mt(14084),zt=Mt(59301),Ne=Object.defineProperty,ue=Object.getOwnPropertySymbols,qt=Object.prototype.hasOwnProperty,Qt=Object.prototype.propertyIsEnumerable,Jt=(Yt,Vt,pe)=>Vt in Yt?Ne(Yt,Vt,{enumerable:!0,configurable:!0,writable:!0,value:pe}):Yt[Vt]=pe,Pe=(Yt,Vt)=>{for(var pe in Vt||(Vt={}))qt.call(Vt,pe)&&Jt(Yt,pe,Vt[pe]);if(ue)for(var pe of ue(Vt))Qt.call(Vt,pe)&&Jt(Yt,pe,Vt[pe]);return Yt},je=(Yt,Vt,pe)=>new Promise((Xt,Le)=>{var Wt=ne=>{try{Te(pe.next(ne))}catch(Re){Le(Re)}},Ce=ne=>{try{Te(pe.throw(ne))}catch(Re){Le(Re)}},Te=ne=>ne.done?Xt(ne.value):Promise.resolve(ne.value).then(Wt,Ce);Te((pe=pe.apply(Yt,Vt)).next())}),De=({editOffice:Yt="view",data:Vt,issaver:pe,onSaver:Xt,theme:Le,type:Wt,filename:Ce,monacoEditor:Te,className:ne,style:Re,close:ye,onClose:Ie,hasMask:Ai,disabledDownload:yi,onImgDimensions:gi,showNodata:oi,recordInfo:Bt})=>{const[bt,ge]=(0,pt.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[Ge,Ye]=(0,pt.useState)(""),[oe,Ve]=(0,pt.useState)(),Ze=window.ENV==="build"?"/react/build":"",Ni=location.host.startsWith("localhost")?Dt.Z.PROXY_SERVER:Dt.Z.API_SERVER,ie=10*(1024*1024),ee=(0,pt.useRef)();Vt!=null&&Vt.startsWith("/api")&&Wt!=="txt"&&(Vt=Dt.Z.API_SERVER+Vt);const ve=we=>we.substring(we.lastIndexOf("/")+1).split(".").pop();Ce&&Te&&(Te.filename=Ce),(0,pt.useEffect)(()=>{var we,ei;const Be=(ei=(we=document.cookie)==null?void 0:we.replace(/\s/g,""))==null?void 0:ei.split(";");Be==null||Be.map(Zt=>{let Je=Zt.split("=");Je[0]==="_educoder_session"&&Ye(Je[1])})},[]),(0,pt.useEffect)(()=>{Wt==="office"&&(Vt.indexOf("bigfilescdn.")>-1||Vt.indexOf("bigfiles1")>-1?Ve({url:Vt,fileType:ve(Vt),model:Vt.indexOf("model=edit")?"edit":"view"}):he())},[Wt,Vt]);function ti(we){return je(this,null,function*(){we.data.type==="pdfdata"&&(Xt(we.data.data),window.removeEventListener("message",ti,!1)),console.log("mess---:",we.data)})}const he=()=>je(void 0,null,function*(){console.log("data:",Vt);let we=Vt;Vt.startsWith("http")||(we=location.origin+we);let ei=new URL(we).pathname.split("/").pop();const Be=yield(0,Ae.gJ)({attachment_id:ei});Be.url=Ni+Be.url,Ve(Be)}),We=()=>{if(Vt.startsWith("http")||Vt.startsWith("blob:")){He();return}(0,$t.Sv)(Ce||"educoder",Vt,Ce)},He=()=>{Bt&&(0,de.fc)({id:Bt==null?void 0:Bt.id,watch_type:1,course_id:Bt==null?void 0:Bt.course_id}),(0,$t.Nd)(Ce||"educoder",decodeURIComponent(Vt))};return zt.createElement("div",{style:Pe({},Re||{}),className:`${Ai&&_t.bgBlack} ${Wt?_t.wrp:"hide"}`},ye&&zt.createElement("div",{className:_t.close,ref:ee},!!gi&&zt.createElement(fe.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>ee.current},zt.createElement("span",{onClick:()=>{Ie(),gi()}},zt.createElement("i",{className:"icon-yulanpizhu"}))),!yi&&zt.createElement(fe.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>ee.current},zt.createElement("span",{onClick:He},zt.createElement("i",{className:"icon-quxiaozhiding"}))),pe&&zt.createElement(fe.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>ee.current},zt.createElement("span",{className:"",onClick:()=>{const we=document.getElementById("pdfiframe");window.addEventListener("message",ti,!1),setTimeout(()=>{we.contentWindow.postMessage("getData","*")},300)}},zt.createElement("i",{className:"icon-baocun"}))),zt.createElement(fe.Z,{title:"\u5173\u95ED",getPopupContainer:()=>ee.current},zt.createElement("span",{className:"",onClick:()=>{Ie()}},zt.createElement("i",{className:"icon-guanbi1"})))),zt.createElement("div",{className:`${_t[ne]} ${ne} ${_t.monaco} ${Wt==="txt"?"show":"hide"}`},Wt==="txt"&&zt.createElement(zt.Fragment,null,zt.createElement(Ut.ZP,Pe({},Te)))),Wt==="audio"&&zt.createElement("audio",{src:`${(Vt==null?void 0:Vt.indexOf("http://"))>-1||(Vt==null?void 0:Vt.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${Vt}`,autoPlay:!0}),Wt==="video"&&zt.createElement(zt.Fragment,null,(Vt==null?void 0:Vt.indexOf("http"))>-1?zt.createElement("video",{controls:!0,src:`${Vt}`,autoPlay:!0}):zt.createElement("video",{controls:!0,src:`data:video/mp4;base64,${Vt}`,autoPlay:!0})),Wt==="office"&&oe&&zt.createElement("iframe",{src:`${Ze}/office.html?key=${oe.key}&url=${btoa(oe.url)}&callbackUrl=${Ni+(oe.callbackUrl||"")}&fileType=${oe.fileType}&title=${oe.title||""}&model=${Yt}&officeServer=${Dt.Z.ONLYOFFICE}&disabledDownload=${!!yi}`}),Wt==="html"&&zt.createElement("iframe",{src:Vt+"&disposition=inline"}),Wt==="pdf"&&zt.createElement("iframe",{id:"pdfiframe",src:`${Ze}/js/pdfview/index.html?filename=${Ce||"educoder.pdf"}&url=${encodeURIComponent(Vt)}&disabledDownload=${!!yi}&model=${Yt}`}),Wt==="image"&&zt.createElement("img",{src:`${(Vt==null?void 0:Vt.indexOf("http://"))>-1||(Vt==null?void 0:Vt.indexOf("https://"))>-1?"":"data:image/png;base64,"}${Vt}`}),(Wt==="other"||Wt==="download")&&zt.createElement(zt.Fragment,null,oi?zt.createElement(re.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:zt.createElement(ce.ZP,{icon:zt.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:We,disabled:yi},"\u4E0B\u8F7D")}):zt.createElement(ce.ZP,{type:"primary",size:"middle",onClick:We,disabled:yi},zt.createElement(me.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")),Wt==="flowChart"&&zt.createElement("div",{className:"embed"},zt.createElement("iframe",{src:`/drawio/src/main/webapp/viewer.html?id=${Vt||""}&gapi=0&od=0&db=0&gh=0&gl=0`,width:"100%",height:"100%",frameBorder:"0"})))}},97231:function(Li,ai,Mt){"use strict";Mt.d(ai,{z:function(){return Te},Z:function(){return ne}});var pt=Mt(59301),_t=Mt(79562),ce=Mt(901),me=Mt(64018),Ut=Mt(80360),fe=Mt(78323),$t=Mt(63949),Ae=Mt(15342),re=Mt(44104),Dt=Mt(99571),de=Mt(1012),zt=Mt(9931),Ne=Mt(59301),qt=({html:Re})=>{const ye=(0,pt.useRef)(null),Ie=(0,pt.useRef)(null),Ai=`.markdown-body p {
|
|
margin: 0 0 16px 0 !important;
|
|
line-height: 28px;
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
ol,
|
|
ul,
|
|
li {
|
|
list-style-type: none
|
|
}
|
|
|
|
ol,
|
|
ul,
|
|
dl {
|
|
margin-bottom: 0px;
|
|
}
|
|
|
|
.markdown-body {
|
|
-ms-text-size-adjust: 100%;
|
|
-webkit-text-size-adjust: 100%;
|
|
color: #333;
|
|
overflow: hidden;
|
|
font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "\u534E\u6587\u7EC6\u9ED1", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "\u5B8B\u4F53", Heiti, "\u9ED1\u4F53", sans-serif;
|
|
word-break: break-word;
|
|
font-size: 16px;
|
|
line-height: 1.6;
|
|
white-space: normal;
|
|
word-wrap: break-word;
|
|
position: relative;
|
|
}
|
|
|
|
.markdown-body ul>li {
|
|
list-style-type: disc;
|
|
}
|
|
|
|
.markdown-body ol>li {
|
|
list-style-type: decimal;
|
|
}
|
|
|
|
.markdown-body a {
|
|
background: transparent;
|
|
}
|
|
|
|
.markdown-body a:active,
|
|
.markdown-body a:hover {
|
|
outline: 0;
|
|
}
|
|
|
|
.markdown-body strong {
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
font-size: 2em;
|
|
margin: 0.67em 0;
|
|
}
|
|
|
|
.markdown-body img {
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body hr {
|
|
-moz-box-sizing: content-box;
|
|
box-sizing: content-box;
|
|
height: 0;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
overflow: auto;
|
|
}
|
|
|
|
.markdown-body code,
|
|
.markdown-body kbd,
|
|
.markdown-body pre {
|
|
font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
|
|
font-size: 1em;
|
|
}
|
|
|
|
.markdown-body input {
|
|
color: inherit;
|
|
font: inherit;
|
|
margin: 0;
|
|
}
|
|
|
|
.markdown-body html input[disabled] {
|
|
cursor: default;
|
|
}
|
|
|
|
.markdown-body input {
|
|
line-height: normal;
|
|
}
|
|
|
|
.markdown-body input[type="checkbox"] {
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body table {
|
|
border-collapse: collapse;
|
|
border-spacing: 0;
|
|
}
|
|
|
|
.markdown-body td,
|
|
.markdown-body th {
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body * {
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.markdown-body input {
|
|
font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
|
|
}
|
|
|
|
.markdown-body a {
|
|
color: #4183c4;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.markdown-body a:hover,
|
|
.markdown-body a:active {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.markdown-body hr {
|
|
height: 0;
|
|
margin: 15px 0;
|
|
overflow: hidden;
|
|
background: transparent;
|
|
border: 0;
|
|
border-bottom: 1px solid #ddd;
|
|
}
|
|
|
|
.markdown-body hr:before {
|
|
display: table;
|
|
content: "";
|
|
}
|
|
|
|
.markdown-body hr:after {
|
|
display: table;
|
|
clear: both;
|
|
content: "";
|
|
}
|
|
|
|
.markdown-body h1,
|
|
.markdown-body h2,
|
|
.markdown-body h3,
|
|
.markdown-body h4,
|
|
.markdown-body h5,
|
|
.markdown-body h6 {
|
|
margin-top: 15px;
|
|
margin-bottom: 15px;
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
font-size: 30px;
|
|
}
|
|
|
|
.markdown-body h2 {
|
|
font-size: 21px;
|
|
}
|
|
|
|
.markdown-body h3 {
|
|
font-size: 16px;
|
|
}
|
|
|
|
.markdown-body h4 {
|
|
font-size: 14px;
|
|
}
|
|
|
|
.markdown-body h5 {
|
|
font-size: 12px;
|
|
}
|
|
|
|
.markdown-body h6 {
|
|
font-size: 11px;
|
|
}
|
|
|
|
.markdown-body blockquote {
|
|
margin: 0;
|
|
}
|
|
|
|
.markdown-body ul,
|
|
.markdown-body ol {
|
|
padding: 0;
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
ul.linenums,
|
|
ol.linenums {
|
|
padding: 16px 0 0 56px !important;
|
|
}
|
|
|
|
.markdown-body ul,
|
|
.markdown-body ol {
|
|
padding-left: 2em;
|
|
}
|
|
|
|
|
|
.markdown-body ol ol,
|
|
.markdown-body ul ol {
|
|
list-style-type: lower-roman;
|
|
}
|
|
|
|
.markdown-body ul ul ol,
|
|
.markdown-body ul ol ol,
|
|
.markdown-body ol ul ol,
|
|
.markdown-body ol ol ol {
|
|
list-style-type: lower-alpha;
|
|
}
|
|
|
|
.markdown-body dd {
|
|
margin-left: 0;
|
|
}
|
|
|
|
.markdown-body code {
|
|
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
}
|
|
|
|
.markdown-body .octicon {
|
|
font: normal normal 16px octicons-anchor;
|
|
line-height: 1;
|
|
display: inline-block;
|
|
text-decoration: none;
|
|
-webkit-font-smoothing: antialiased;
|
|
-moz-osx-font-smoothing: grayscale;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
}
|
|
|
|
.markdown-body .octicon-link:before {
|
|
content: '\f05c';
|
|
}
|
|
|
|
.markdown-body>*:first-child {
|
|
margin-top: 0 !important;
|
|
}
|
|
|
|
.markdown-body>*:last-child {
|
|
margin-bottom: 0 !important;
|
|
}
|
|
|
|
.markdown-body .anchor {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
display: block;
|
|
padding-right: 6px;
|
|
padding-left: 30px;
|
|
margin-left: -30px;
|
|
}
|
|
|
|
.markdown-body .anchor:focus {
|
|
outline: none;
|
|
}
|
|
|
|
.markdown-body h1,
|
|
.markdown-body h2,
|
|
.markdown-body h3,
|
|
.markdown-body h4,
|
|
.markdown-body h5,
|
|
.markdown-body h6 {
|
|
position: relative;
|
|
margin-top: 1em;
|
|
margin-bottom: 16px;
|
|
font-weight: bold;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.markdown-body h1 .octicon-link,
|
|
.markdown-body h2 .octicon-link,
|
|
.markdown-body h3 .octicon-link,
|
|
.markdown-body h4 .octicon-link,
|
|
.markdown-body h5 .octicon-link,
|
|
.markdown-body h6 .octicon-link {
|
|
display: none;
|
|
color: #000;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.markdown-body h1:hover .anchor,
|
|
.markdown-body h2:hover .anchor,
|
|
.markdown-body h3:hover .anchor,
|
|
.markdown-body h4:hover .anchor,
|
|
.markdown-body h5:hover .anchor,
|
|
.markdown-body h6:hover .anchor {
|
|
padding-left: 8px;
|
|
margin-left: -30px;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.markdown-body h1:hover .anchor .octicon-link,
|
|
.markdown-body h2:hover .anchor .octicon-link,
|
|
.markdown-body h3:hover .anchor .octicon-link,
|
|
.markdown-body h4:hover .anchor .octicon-link,
|
|
.markdown-body h5:hover .anchor .octicon-link,
|
|
.markdown-body h6:hover .anchor .octicon-link {
|
|
display: inline-block;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
padding-bottom: 0.3em;
|
|
font-size: 2.25em;
|
|
line-height: 1.2;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
|
|
.markdown-body h1 .anchor {
|
|
line-height: 1;
|
|
}
|
|
|
|
.markdown-body h2 {
|
|
padding-bottom: 0.3em;
|
|
font-size: 1.75em;
|
|
line-height: 1.225;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
|
|
.markdown-body h2 .anchor {
|
|
line-height: 1;
|
|
}
|
|
|
|
.markdown-body h3 {
|
|
font-size: 1.5em;
|
|
line-height: 1.43;
|
|
}
|
|
|
|
.markdown-body h3 .anchor {
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.markdown-body h4 {
|
|
font-size: 1.25em;
|
|
}
|
|
|
|
.markdown-body h4 .anchor {
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.markdown-body h5 {
|
|
font-size: 1em;
|
|
}
|
|
|
|
.markdown-body h5 .anchor {
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body h6 {
|
|
font-size: 1em;
|
|
color: #777;
|
|
}
|
|
|
|
.markdown-body h6 .anchor {
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body p,
|
|
.markdown-body blockquote,
|
|
.markdown-body ul,
|
|
.markdown-body ol,
|
|
.markdown-body dl,
|
|
.markdown-body table,
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body ul ul,
|
|
.markdown-body ul ol,
|
|
.markdown-body ol ol,
|
|
.markdown-body ol ul {
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.markdown-body li>p {
|
|
margin-top: 16px;
|
|
}
|
|
|
|
.markdown-body dl {
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body dl dt {
|
|
padding: 0;
|
|
margin-top: 16px;
|
|
font-size: 1em;
|
|
font-style: italic;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body dl dd {
|
|
padding: 0 16px;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body blockquote {
|
|
padding: 0 15px;
|
|
color: #777;
|
|
border-left: 4px solid #ddd;
|
|
}
|
|
|
|
.markdown-body blockquote> :first-child {
|
|
margin-top: 0;
|
|
}
|
|
|
|
.markdown-body blockquote> :last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.markdown-body table {
|
|
display: block;
|
|
width: 100%;
|
|
overflow: auto;
|
|
word-break: normal;
|
|
word-break: keep-all;
|
|
}
|
|
|
|
.markdown-body table th {
|
|
font-weight: bold;
|
|
text-align: revert;
|
|
}
|
|
|
|
.markdown-body table th,
|
|
.markdown-body table td {
|
|
padding: 6px 13px;
|
|
border: 1px solid #ddd;
|
|
}
|
|
|
|
.markdown-body table tr {
|
|
background-color: #fff;
|
|
border-top: 1px solid #ccc;
|
|
}
|
|
|
|
.markdown-body table tr:nth-child(2n) {
|
|
background-color: #f8f8f8;
|
|
}
|
|
|
|
.markdown-body img {
|
|
max-width: 100%;
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.markdown-body code {
|
|
padding: 0;
|
|
padding-top: 0.2em;
|
|
padding-bottom: 0.2em;
|
|
margin: 0;
|
|
font-size: 85%;
|
|
background-color: rgba(0, 0, 0, 0.04);
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.markdown-body code:has(.katex) {
|
|
background-color: transparent;
|
|
}
|
|
|
|
.markdown-body code:before,
|
|
.markdown-body code:after {
|
|
letter-spacing: -0.2em;
|
|
content: "\\00a0";
|
|
}
|
|
|
|
.markdown-body pre>code {
|
|
padding: 0;
|
|
margin: 0;
|
|
font-size: 100%;
|
|
word-break: normal;
|
|
white-space: pre;
|
|
background: transparent;
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body .highlight {
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body .highlight pre,
|
|
.markdown-body pre {
|
|
padding: 16px;
|
|
overflow: auto;
|
|
font-size: 85%;
|
|
line-height: 1.45;
|
|
background-color: #f7f7f7;
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.markdown-body .highlight pre {
|
|
margin-bottom: 0;
|
|
word-break: normal;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
word-wrap: normal;
|
|
}
|
|
|
|
.markdown-body pre code {
|
|
display: inline;
|
|
max-width: initial;
|
|
padding: 0;
|
|
margin: 0;
|
|
overflow: initial;
|
|
line-height: inherit;
|
|
word-wrap: normal;
|
|
background-color: transparent;
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body pre code:before,
|
|
.markdown-body pre code:after {
|
|
content: normal;
|
|
}
|
|
|
|
.markdown-body kbd {
|
|
display: inline-block;
|
|
padding: 3px 5px;
|
|
font-size: 11px;
|
|
line-height: 10px;
|
|
color: #555;
|
|
vertical-align: middle;
|
|
background-color: #fcfcfc;
|
|
border: solid 1px #ccc;
|
|
border-bottom-color: #bbb;
|
|
border-radius: 3px;
|
|
box-shadow: inset 0 -1px 0 #bbb;
|
|
}
|
|
|
|
.markdown-body .pl-c {
|
|
color: #969896;
|
|
}
|
|
|
|
.markdown-body .pl-c1,
|
|
.markdown-body .pl-mdh,
|
|
.markdown-body .pl-mm,
|
|
.markdown-body .pl-mp,
|
|
.markdown-body .pl-mr,
|
|
.markdown-body .pl-s1 .pl-v,
|
|
.markdown-body .pl-s3,
|
|
.markdown-body .pl-sc,
|
|
.markdown-body .pl-sv {
|
|
color: #0086b3;
|
|
}
|
|
|
|
.markdown-body .pl-e,
|
|
.markdown-body .pl-en {
|
|
color: #795da3;
|
|
}
|
|
|
|
.markdown-body .pl-s1 .pl-s2,
|
|
.markdown-body .pl-smi,
|
|
.markdown-body .pl-smp,
|
|
.markdown-body .pl-stj,
|
|
.markdown-body .pl-vo,
|
|
.markdown-body .pl-vpf {
|
|
color: #333;
|
|
}
|
|
|
|
.markdown-body .pl-ent {
|
|
color: #63a35c;
|
|
}
|
|
|
|
.markdown-body .pl-k,
|
|
.markdown-body .pl-s,
|
|
.markdown-body .pl-st {
|
|
color: #a71d5d;
|
|
}
|
|
|
|
.markdown-body .pl-pds,
|
|
.markdown-body .pl-s1,
|
|
.markdown-body .pl-s1 .pl-pse .pl-s2,
|
|
.markdown-body .pl-sr,
|
|
.markdown-body .pl-sr .pl-cce,
|
|
.markdown-body .pl-sr .pl-sra,
|
|
.markdown-body .pl-sr .pl-sre,
|
|
.markdown-body .pl-src {
|
|
color: #df5000;
|
|
}
|
|
|
|
.markdown-body .pl-mo,
|
|
.markdown-body .pl-v {
|
|
color: #1d3e81;
|
|
}
|
|
|
|
.markdown-body .pl-id {
|
|
color: #b52a1d;
|
|
}
|
|
|
|
.markdown-body .pl-ii {
|
|
background-color: #b52a1d;
|
|
color: #f8f8f8;
|
|
}
|
|
|
|
.markdown-body .pl-sr .pl-cce {
|
|
color: #63a35c;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-ml {
|
|
color: #693a17;
|
|
}
|
|
|
|
.markdown-body .pl-mh,
|
|
.markdown-body .pl-mh .pl-en,
|
|
.markdown-body .pl-ms {
|
|
color: #1d3e81;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-mq {
|
|
color: #008080;
|
|
}
|
|
|
|
.markdown-body .pl-mi {
|
|
color: #333;
|
|
font-style: italic;
|
|
}
|
|
|
|
.markdown-body .pl-mb {
|
|
color: #333;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-md,
|
|
.markdown-body .pl-mdhf {
|
|
background-color: #ffecec;
|
|
color: #bd2c00;
|
|
}
|
|
|
|
.markdown-body .pl-mdht,
|
|
.markdown-body .pl-mi1 {
|
|
background-color: #eaffea;
|
|
color: #55a532;
|
|
}
|
|
|
|
.markdown-body .pl-mdr {
|
|
color: #795da3;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body kbd {
|
|
display: inline-block;
|
|
padding: 3px 5px;
|
|
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
line-height: 10px;
|
|
color: #555;
|
|
vertical-align: middle;
|
|
background-color: #fcfcfc;
|
|
border: solid 1px #ccc;
|
|
border-bottom-color: #bbb;
|
|
border-radius: 3px;
|
|
box-shadow: inset 0 -1px 0 #bbb;
|
|
}
|
|
|
|
.markdown-body .task-list-item {
|
|
list-style-type: none;
|
|
}
|
|
|
|
.markdown-body .task-list-item+.task-list-item {
|
|
margin-top: 3px;
|
|
}
|
|
|
|
.markdown-body .task-list-item input {
|
|
float: left;
|
|
margin: 0.3em 0 0.25em -1.6em;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.markdown-body :checked+.radio-label {
|
|
z-index: 1;
|
|
position: relative;
|
|
border-color: #4183c4;
|
|
}
|
|
|
|
|
|
/*! Pretty printing styles. Used with prettify.js. */
|
|
/* SPAN elements with the classes below are added by prettyprint. */
|
|
.pln {
|
|
color: #000
|
|
}
|
|
|
|
/* plain text */
|
|
|
|
@media screen {
|
|
.str {
|
|
color: #080
|
|
}
|
|
|
|
/* string content */
|
|
.kwd {
|
|
color: #008
|
|
}
|
|
|
|
/* a keyword */
|
|
.com {
|
|
color: #800
|
|
}
|
|
|
|
/* a comment */
|
|
.typ {
|
|
color: #606
|
|
}
|
|
|
|
/* a type name */
|
|
.lit {
|
|
color: #066
|
|
}
|
|
|
|
/* a literal value */
|
|
/* punctuation, lisp open bracket, lisp close bracket */
|
|
.pun,
|
|
.opn,
|
|
.clo {
|
|
color: #660
|
|
}
|
|
|
|
.tag {
|
|
color: #008
|
|
}
|
|
|
|
/* a markup tag name */
|
|
.atn {
|
|
color: #606
|
|
}
|
|
|
|
/* a markup attribute name */
|
|
.atv {
|
|
color: #080
|
|
}
|
|
|
|
/* a markup attribute value */
|
|
.dec,
|
|
.var {
|
|
color: #606
|
|
}
|
|
|
|
/* a declaration; a variable name */
|
|
.fun {
|
|
color: red
|
|
}
|
|
|
|
/* a function name */
|
|
}
|
|
|
|
/* Use higher contrast and text-weight for printable form. */
|
|
@media print,
|
|
projection {
|
|
.str {
|
|
color: #060
|
|
}
|
|
|
|
.kwd {
|
|
color: #006;
|
|
font-weight: bold
|
|
}
|
|
|
|
.com {
|
|
color: #600;
|
|
font-style: italic
|
|
}
|
|
|
|
.typ {
|
|
color: #404;
|
|
font-weight: bold
|
|
}
|
|
|
|
.lit {
|
|
color: #044
|
|
}
|
|
|
|
.pun,
|
|
.opn,
|
|
.clo {
|
|
color: #440
|
|
}
|
|
|
|
.tag {
|
|
color: #006;
|
|
font-weight: bold
|
|
}
|
|
|
|
.atn {
|
|
color: #404
|
|
}
|
|
|
|
.atv {
|
|
color: #060
|
|
}
|
|
}
|
|
|
|
/* Put a border around prettyprinted code snippets. */
|
|
pre.prettyprint {
|
|
padding: 2px;
|
|
/* border: 1px solid #888 */
|
|
}
|
|
|
|
/* Specify class=linenums on a pre to get line numbering */
|
|
ol.linenums {
|
|
margin-top: 0;
|
|
margin-bottom: 0
|
|
}
|
|
|
|
/* IE indents via margin-left */
|
|
li.L0,
|
|
li.L1,
|
|
li.L2,
|
|
li.L3,
|
|
li.L5,
|
|
li.L6,
|
|
li.L7,
|
|
li.L8 {
|
|
list-style-type: none
|
|
}
|
|
|
|
/* Alternate shading for lines */
|
|
li.L1,
|
|
li.L3,
|
|
li.L5,
|
|
li.L7,
|
|
li.L9 {
|
|
background: #eee
|
|
}
|
|
|
|
.markdown-body p,
|
|
.markdown-body blockquote,
|
|
.markdown-body ul,
|
|
.markdown-body ol,
|
|
.markdown-body dl,
|
|
.markdown-body table,
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 16px;
|
|
}`;return(0,pt.useEffect)(()=>{const yi=ye.current.attachShadow({mode:"open"});Ie.current=document.createElement("div"),Ie.current.className="markdown-body",Ie.current.innerHTML=Re,yi.appendChild(Ie.current);const gi=document.createElement("style");return gi.textContent=Ai,yi.appendChild(gi),()=>{yi.innerHTML=""}},[]),(0,pt.useEffect)(()=>{Ie.current&&(Ie.current.innerHTML=Re)},[Re]),Ne.createElement("div",{ref:ye})};function Qt(Re){const ye=["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"],Ie=new RegExp(`\\b(${ye.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi");return Re.replace(Ie,"").trim()}var Jt={mdBody:"mdBody___raKXb",button:"button___Ch5Pc",previewFlowChart:"previewFlowChart___vY1dq"},Pe=Object.defineProperty,je=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable,Vt=(Re,ye,Ie)=>ye in Re?Pe(Re,ye,{enumerable:!0,configurable:!0,writable:!0,value:Ie}):Re[ye]=Ie,pe=(Re,ye)=>{for(var Ie in ye||(ye={}))De.call(ye,Ie)&&Vt(Re,Ie,ye[Ie]);if(je)for(var Ie of je(ye))Yt.call(ye,Ie)&&Vt(Re,Ie,ye[Ie]);return Re};const Xt="@\u2581\u2581@",Le="@\u2581@",Wt=/<pre[^>]*>/g;function Ce(Re){let ye=document.createElement("div");return ye.innerHTML=Re,ye.childNodes.length===0?"":ye.childNodes[0].nodeValue}const Te=(Re,ye)=>{Re=Re||"";const Ie=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Ai=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,yi=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,gi=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return ye?Re.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(Ie,(oi,Bt,bt,ge,Ge,Ye,oe)=>{const Ve=Bt||ge||Ye,Ze=bt||Ge||oe||"?";return fe.Z.API_SERVER+"/api/attachments/"+Ve+Ze+"&t="+(0,$t.Jn)(Ve,Date.now())+(oi.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(Re=Re.replace(gi,(oi,Bt,bt,ge,Ge,Ye,oe)=>{const Ve=Bt||ge||Ye,Ze=bt||Ge||oe||"?";return fe.Z.API_SERVER+"/attachments/download/"+Ve+Ze+"&t="+(0,$t.Jn)(Ve,Date.now())+(oi.indexOf(")")>-1?")":"&")}).replace(Ie,(oi,Bt,bt,ge,Ge,Ye,oe)=>{const Ve=Bt||ge||Ye,Ze=bt||Ge||oe||"?";return fe.Z.API_SERVER+"/api/attachments/"+Ve+Ze+"&t="+(0,$t.Jn)(Ve,Date.now())+(oi.indexOf(")")>-1?")":"&")}).replace(Ai,(oi,Bt,bt,ge,Ge)=>{const Ye=Bt||ge,oe=bt||Ge||"";return'"'+fe.Z.API_SERVER+"/api/attachments/"+Ye+oe+Ye+oe+"&t="+(0,$t.Jn)(Ye,Date.now())}).replace(yi,(oi,Bt,bt,ge,Ge)=>{const Ye=Bt||ge,oe=bt||Ge||"";return"("+fe.Z.API_SERVER+"/files/uploads/"+Ye+oe+Ye+oe+"&t="+(0,$t.Jn)(Ye,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,`
|
|
`),Re)};var ne=({value:Re="",edit:ye=!1,className:Ie,showTextOnly:Ai,showLines:yi,style:gi={},stylesPrev:oi={},highlightKeywords:Bt,showProgramFill:bt,isProgramFill:ge,disabledFill:Ge=!1,programFillValue:Ye,openEditor:oe=()=>{},onFillChange:Ve=Se=>{},onFillBlur:Ze=()=>{},onFillFocus:Ni=()=>{}})=>{let Se=Qt(String(Re||""));const ie=(0,pt.useRef)(),ee=(0,pt.useRef)(),[ve,ti]=(0,pt.useState)(""),[he,We]=(0,pt.useState)("office"),[He,we]=(0,pt.useState)([]),ei=(0,pt.useRef)("a"+(0,de.Z)()),Be={},Zt=xe=>/<style[\s\S]*?>/i.test(xe||""),Je=(xe,Zi,Si)=>{const Oi=document.createElement(xe===Le?"input":"textarea");Oi.style.width="100%",Oi.style.height=xe===Le?"40px":"151px",Oi.rows=5,Oi.spellcheck=!1,Oi.name="edu-program-fill",Oi.placeholder="\u8BF7\u8F93\u5165",Oi.dataset.id=Zi;const Qi=Object.keys(Be).length;return Be[Qi]=Oi,`<span class="edu-program-fill-wrap ${xe===Le?"":"show"}" style="width:${xe===Le?"600px":"100%"}" title=${Si||""}><span>${Oi.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function Ri(xe){return xe=xe.replace(/!\[.*?\]\(.*?\)/g,""),xe=xe.replace(/\[.*?\]\(.*?\)/g,""),xe=xe.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),xe=xe.replace(/<embed.*?>/g,""),xe=xe.replace(/<img.*?>/g,""),xe=xe.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),xe=xe.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),xe=xe.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),xe=xe.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),xe}const Pi=xe=>!Ai&&Zt(Se)?xe:xe.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(Zi,Si){let Oi=Si.replace(/(\n|\r)/g,"").split("}"),Qi=[];return Oi.map(Cn=>{Cn!=""&&Qi.push(`.${ei.current} ${Cn}`)}),`<style>${Qi.join("}")}</style>`}),Ct=(0,pt.useMemo)(()=>{try{const Oi=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,Qi=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Cn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,_i=/\(\/attachments\/download\//g;Se=Se.replace(_i,"("+fe.Z.API_SERVER+"/attachments/download/").replace(Oi,"("+fe.Z.API_SERVER+"/api/attachments/").replace(Qi,'"'+fe.Z.API_SERVER+"/api/attachments/").replace(Cn,'"'+fe.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,`
|
|
`),ie.current.style.display="none"}catch(Oi){}if(bt){let Oi=-1;return Se=Se.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,function(Qi,Cn,_i){var Mn;return++Oi,Je(Qi,Oi,(Mn=Ye==null?void 0:Ye[Oi])==null?void 0:Mn.value.replaceAll("<","<").replaceAll(">",">"))}),`<pre style="background:#fff;padding:4px">${Pi(Se||"")}</pre>`}let xe=Pi(Se);xe=(0,ce.ZP)(xe);const Zi=(0,ce.ez)();Se.match(/\[TOC\]/)&&(xe=xe.replace("<p>[TOC]</p>",(0,ce.Qv)()),(0,ce.Iy)()),xe=xe.replace(/(__special_katext_id_\d+__)/g,(Oi,Qi)=>{const{type:Cn,expression:_i}=Zi[Qi];return(0,Ae.renderToString)(Ce(_i)||"",{displayMode:Cn==="block",throwOnError:!1,output:"html"})}),xe=xe.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,ce.AL)();const Si=document.createElement("div");if(Si.innerHTML=xe,Ai)return Si.innerText;if(Bt){const Oi=Bt.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return At(Si,Oi),Si.innerHTML}return setTimeout(()=>ni(),500),Si.innerHTML},[Se,Bt]);(0,pt.useEffect)(()=>{wt.current&&wt.current.querySelectorAll(["input","textarea"]).forEach(Zi=>{Zi.oninput=gt,Zi.onblur=ft,Zi.onfocus=St})},[He]),(0,pt.useEffect)(()=>{var xe,Zi,Si,Oi,Qi;if(Ye!=null&&Ye.length)try{const Cn=wt.current.querySelectorAll(".edu-program-fill-score"),_i=wt.current.querySelectorAll('[name="edu-program-fill"]');for(const[Mn,er]of _i.entries())er.value=((xe=Ye==null?void 0:Ye[Mn])==null?void 0:xe.value)||"",((Zi=Ye==null?void 0:Ye[Mn])==null?void 0:Zi.type)==="warning"?er.className="program-fill-warning":((Si=Ye==null?void 0:Ye[Mn])==null?void 0:Si.type)==="success"?er.className="program-fill-success":er.className="";for(const[Mn,er]of Cn.entries())er.innerHTML=(Oi=Ye==null?void 0:Ye[Mn])!=null&&Oi.score?`${(Qi=Ye==null?void 0:Ye[Mn])==null?void 0:Qi.score}\u5206`:"";we(Ye)}catch(Cn){console.log(Cn,"error")}},[Ye]);const gt=xe=>{He[xe.target.dataset.id]=He[xe.target.dataset.id]||{},He[xe.target.dataset.id].value=xe.target.value,we([...He]),Ve(He,xe.target.dataset.id)},ft=xe=>{He[xe.target.dataset.id]=He[xe.target.dataset.id]||{},He[xe.target.dataset.id].value=xe.target.value,we([...He]),Ze(He,xe.target.dataset.id)},St=xe=>{He[xe.target.dataset.id]=He[xe.target.dataset.id]||{},He[xe.target.dataset.id].value=xe.target.value,we([...He]),Ni(He,xe.target.dataset.id)};function At(xe,Zi){return xe.childNodes.forEach(Si=>{var Oi;if(Si.childNodes.length>0)At(Si,Zi);else if(Si.nodeName!=="IMG")if(Si.innerHTML)Si.innerHTML=(Oi=Si.innerHTML)==null?void 0:Oi.replace(new RegExp(Zi,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const Qi=document.createElement("span");Qi.innerHTML=Si.textContent.replace(new RegExp(Zi,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),Si.replaceWith(Qi)}})}const wt=(0,pt.useRef)();ce.jb.WebkitLineClamp=yi,yi&&(gi=pe(pe({},gi),ce.jb));function te(xe){let Zi=xe.target;if(Zi.tagName.toUpperCase()==="A"){let Si=Zi.getAttribute("href");if(Si.indexOf("office")>-1)xe.preventDefault(),ti(Si),We("office");else if(Si.indexOf("application/pdf")>-1)xe.preventDefault(),ti(Si),We("pdf");else if(Si.indexOf("text/html")>-1)xe.preventDefault(),ti(Si),We("html");else if(Si.startsWith("#")){xe.preventDefault();let Oi=document.getElementById(Si.replace("#",""));Oi&&Oi.scrollIntoView(!0)}}}const ni=()=>{var xe;const Zi=(xe=wt.current)==null?void 0:xe.querySelectorAll("video");Zi==null||Zi.forEach(Si=>{if(Si.oncontextmenu=()=>!1,Si.src.indexOf(".m3u8")>-1&&!Si.canPlayType("application/vnd.apple.mpegurl")){if(Ut.ZP.isSupported()){var Oi=new Ut.ZP;Oi.loadSource(Si.src),Oi.attachMedia(Si)}}})};(0,pt.useEffect)(()=>{if(wt.current&&Ct&&Ct.match(Wt)&&window.PR.prettyPrint(),wt.current)return wt.current.addEventListener("click",te),()=>{var xe;(xe=wt.current)==null||xe.removeEventListener("click",te),(0,ce.AL)(),(0,ce.Iy)()}},[Ct,wt.current,te]);const ui=xe=>{xe.target.nodeName==="IMG"&&xe.target.className.indexOf("draw-flowchart")>-1?(ie.current.style.zIndex=1,ie.current.style.display="flex",ie.current.style.width=xe.target.clientWidth+"px",ie.current.style.height=xe.target.clientHeight+"px",ie.current.style.top=xe.target.offsetTop+"px",ie.current.style.left=xe.target.offsetLeft+"px",xe.target.id&&(ee.current=xe.target.id)):ie.current.style.display="none"},qe=()=>{ie.current.style.display="none"};return(0,pt.useEffect)(()=>{var xe;const Zi=Si=>{Si.preventDefault(),Si.clipboardData.setData("text",window.getSelection().toString())};return(xe=wt.current)==null||xe.addEventListener("copy",Zi),()=>{var Si;(Si=wt.current)==null||Si.removeEventListener("copy",Zi)}},[wt.current]),pt.createElement("div",{style:{position:"relative"},onMouseLeave:qe},Ai&&pt.createElement("div",{ref:wt,className:`${Jt.mdBody} `},Ct),!Ai&&!Zt(Ct)&&pt.createElement("div",{ref:wt,style:pe({},gi),onMouseOver:ui,className:`${Ie||""} ${Ge?"disabled-fill":""} markdown-body ${Jt.mdBody} ${ei.current}`,dangerouslySetInnerHTML:{__html:Ct}}),!Ai&&Zt(Ct)&&pt.createElement(qt,{html:Ct}),pt.createElement("div",{ref:ie,className:`${Jt.button} ${ye?"":Jt.previewFlowChart}`},pt.createElement(re.Z,null,pt.createElement(Dt.ZP,{onClick:()=>{ye?oe(ee.current):(ti(ee.current),We("flowChart"))}},ye?"\u7F16\u8F91":"\u9884\u89C8"))),pt.createElement(zt.Z,{close:!0,data:ve,type:ve!=null&&ve.length?he:"",style:pe({},oi),onClose:()=>ti("")}))}},99678:function(Li,ai,Mt){"use strict";Mt.d(ai,{h:function(){return Yt},Z:function(){return De}});var pt=Mt(59301),_t=Mt(82326),ce=Mt(28284),me=Mt(99571),Ut=Mt(89780),fe=Mt.n(Ut),$t=Mt(4887),Ae=Object.defineProperty,re=Object.defineProperties,Dt=Object.getOwnPropertyDescriptors,de=Object.getOwnPropertySymbols,zt=Object.prototype.hasOwnProperty,Ne=Object.prototype.propertyIsEnumerable,ue=(Vt,pe,Xt)=>pe in Vt?Ae(Vt,pe,{enumerable:!0,configurable:!0,writable:!0,value:Xt}):Vt[pe]=Xt,qt=(Vt,pe)=>{for(var Xt in pe||(pe={}))zt.call(pe,Xt)&&ue(Vt,Xt,pe[Xt]);if(de)for(var Xt of de(pe))Ne.call(pe,Xt)&&ue(Vt,Xt,pe[Xt]);return Vt},Qt=(Vt,pe)=>re(Vt,Dt(pe));const Jt=_t.default.Option,Pe={labelCol:{span:4},wrapperCol:{span:20}},je={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};var De=({callback:Vt,onCancel:pe})=>{const[Xt,Le]=(0,pt.useState)("python");function Wt(Te){Le(je[Te][1])}function Ce(Te){Vt(Te)}return pt.createElement(ce.default,Qt(qt({},Pe),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Ce,style:{width:500}}),pt.createElement(ce.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},pt.createElement(_t.default,{getPopupContainer:Te=>Te.parentNode,onChange:Wt},Object.keys(je).map(Te=>pt.createElement(Jt,{key:Te,value:Te},je[Te][0])))),pt.createElement(ce.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},pt.createElement(Yt,{mode:Xt})),pt.createElement("div",{className:"flex-container flex-end"},pt.createElement(me.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),pt.createElement(me.ZP,{type:"ghost",onClick:pe},"\u53D6\u6D88")))};function Yt({value:Vt,onChange:pe,mode:Xt,options:Le={}}){const Wt=(0,pt.useRef)(),[Ce,Te]=(0,pt.useState)();return(0,pt.useEffect)(()=>{if(Ce){let ne=function(Re){const ye=Re.getValue();pe&&pe(ye)};return Ce.on("change",ne),()=>{Ce.off("change",ne)}}},[Ce,pe]),(0,pt.useEffect)(()=>{Ce&&Ce.setOption("mode",Xt)},[Ce,Xt]),(0,pt.useEffect)(()=>{Ce&&(Vt!==Ce.getValue()||Vt==="")&&setTimeout(()=>{Ce.setValue(Vt||"")},300)},[Ce,Vt]),(0,pt.useEffect)(()=>{if(Wt.current&&!Ce){const ne=fe().fromTextArea(Wt.current,qt({mode:Xt,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Le));Te(ne)}},[Wt.current,Ce]),pt.createElement("div",{className:"my-codemirror-container"},pt.createElement("textarea",{ref:Wt}))}},17949:function(Li,ai,Mt){"use strict";Mt.d(ai,{Z:function(){return an}});var pt=Mt(59301),_t=Mt(95392),ce=Mt(89780),me=Mt.n(ce),Ut=Mt(76374),fe=Mt(4887),$t=Mt(6313),Ae=Mt(25717),re=Mt(99498),Dt=Mt(25419),de=Mt(67549),zt=Mt(97231),Ne=({value:vi="",className:di,showTextOnly:xn,showLines:en,style:hn={}})=>{const Vi=(0,pt.useMemo)(()=>"",[vi]);return pt.createElement(pt.Fragment,null,pt.createElement("div",{dangerouslySetInnerHTML:{__html:Vi}}))},ue=Object.defineProperty,qt=Object.defineProperties,Qt=Object.getOwnPropertyDescriptors,Jt=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,De=(vi,di,xn)=>di in vi?ue(vi,di,{enumerable:!0,configurable:!0,writable:!0,value:xn}):vi[di]=xn,Yt=(vi,di)=>{for(var xn in di||(di={}))Pe.call(di,xn)&&De(vi,xn,di[xn]);if(Jt)for(var xn of Jt(di))je.call(di,xn)&&De(vi,xn,di[xn]);return vi},Vt=(vi,di)=>qt(vi,Qt(di));let pe=[{title:"\u7C97\u4F53",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"md-iconfont icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"\u6570\u5B66\u516C\u5F0F",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"md-iconfont icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"\u63D2\u5165\u753B\u56FE",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"\u63D2\u5165\u6D41\u7A0B\u56FE",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"\u8868\u683C",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function Xt({onActionCallback:vi,title:di,icon:xn,actionName:en,className:hn="",children:Vi}){function zi(){vi(en)}return pt.createElement("a",{title:di,className:hn,onClick:zi},pt.createElement("i",{className:`${xn}`}),Vi)}var Le=({watch:vi,showNullButton:di,showNullProgramButton:xn,onActionCallback:en,fullScreen:hn,insertTemp:Vi,hidetoolBar:zi,extraUse:ur})=>{const Vn=[...pe,{title:`${vi?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${vi?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return pt.createElement("ul",{className:"markdown-toolbar-container"},!zi&&Vn.map(($n,Xe)=>pt.createElement("li",{key:Xe},$n.actionName?pt.createElement(Xt,Vt(Yt({},$n),{onActionCallback:en})):pt.createElement("span",{className:"v-line"}))),di?pt.createElement("li",null,pt.createElement(Xt,{icon:"iconfont icon-tianjia5 insert-blank",className:"btn-null ml5",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:en},pt.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u65B0\u589E\u586B\u7A7A\u9879"))):null,xn?pt.createElement(pt.Fragment,null,pt.createElement("li",null,pt.createElement(Xt,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:en},pt.createElement("span",{className:"fill-tip"},"\u6DFB\u52A0\u5355\u884C\u586B\u7A7A\u9879"))),pt.createElement("li",null,pt.createElement(Xt,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:en},pt.createElement("span",{className:"fill-tip"},"\u6DFB\u52A0\u591A\u884C\u586B\u7A7A\u9879")))):null,Vi&&pt.createElement("li",null,pt.createElement(Xt,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${Vi}`,onActionCallback:en},pt.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),ur&&pt.createElement("li",null,ur),pt.createElement("li",{className:"btn-full-screen"},pt.createElement(Xt,{icon:`${hn?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:hn?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:en})))},Wt=Mt(81123),Ce=Mt(28284),Te=Mt(37568),ne=Mt(99571),Re=Object.defineProperty,ye=Object.defineProperties,Ie=Object.getOwnPropertyDescriptors,Ai=Object.getOwnPropertySymbols,yi=Object.prototype.hasOwnProperty,gi=Object.prototype.propertyIsEnumerable,oi=(vi,di,xn)=>di in vi?Re(vi,di,{enumerable:!0,configurable:!0,writable:!0,value:xn}):vi[di]=xn,Bt=(vi,di)=>{for(var xn in di||(di={}))yi.call(di,xn)&&oi(vi,xn,di[xn]);if(Ai)for(var xn of Ai(di))gi.call(di,xn)&&oi(vi,xn,di[xn]);return vi},bt=(vi,di)=>ye(vi,Ie(di));const ge={labelCol:{span:4},wrapperCol:{span:20}};var Ge=({callback:vi,onCancel:di})=>{function xn(en){vi(en)}return pt.createElement(Ce.default,bt(Bt({},ge),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:xn,style:{width:500}}),pt.createElement(Ce.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},pt.createElement(Te.default,null)),pt.createElement(Ce.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},pt.createElement(Te.default,null)),pt.createElement("div",{className:"flex-container flex-end"},pt.createElement(ne.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),pt.createElement(ne.ZP,{type:"ghost",onClick:di},"\u53D6\u6D88")))},Ye=Mt(99678),oe=Mt(90443),Ve=Mt(62957),Ze=Mt(77019),Ni=Mt(54344),Se=Mt(59301),ie=({callback:vi,onCancel:di})=>{const xn=document.createElement("canvas"),en=xn.getContext("2d");xn.width=1e3,xn.height=800,en.fillStyle="#ffffff",en.fillRect(0,0,xn.width,xn.height);const hn=xn.toDataURL("image/png");return Se.createElement(Ve.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},Se.createElement(Ze.Z,{style:{height:"100vh"}},Se.createElement(Ni.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:hn,visible:!0,title:String(Date.now())},onOk:Vi=>{vi({src:Vi.url})},onClose:di})))},ee=Mt(30641),ve=Mt(5269),ti=Mt(6767),he={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re",drawerWrap:"drawerWrap___MfDw8"},We=Mt(59301),we=(0,pt.forwardRef)(({onCancel:vi,editImgId:di,callback:xn},en)=>{let hn=(0,pt.useRef)(),Vi=(0,pt.useRef)(),zi=(0,pt.useRef)(),ur=(0,pt.useRef)(!1);const Vn=(0,pt.useRef)(!1);console.log("ref:",en);const[$n,Xe]=(0,pt.useState)(0),[mi,fn]=(0,pt.useState)("100vh");return(0,pt.useEffect)(()=>{Xe(1)},[]),(0,pt.useImperativeHandle)(en,()=>({setHeight:fn})),We.createElement("div",{ref:Vn,className:"body-overflow-initial"},We.createElement(ee.Z,{width:"100vw",height:mi,footer:null,closable:!0,placement:"bottom",open:!!$n,destroyOnClose:!0,maskClosable:!1,mask:!1,rootClassName:`zIndex-9999 ${he.drawerWrap}`,onClose:()=>{window.saveDrawData(On=>{xn({src:`/api/attachments/${On}`,id:On})})},title:We.createElement(Ze.Z,{align:"middle"},We.createElement(ve.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),We.createElement(ve.Z,{onClick:()=>{fn(mi==="60px"?"100vh":"60px")}},We.createElement("span",{className:"current c-blue",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77")),We.createElement(ve.Z,{onClick:()=>{window.saveDrawData(On=>{if(On===null){ti.ZP.warning({content:"\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u8BF7\u5148\u7ED8\u5236\u6D41\u7A0B\u56FE",key:"saveFlowChart"});return}ti.ZP.success({content:"\u4FDD\u5B58\u6210\u529F",key:"saveFlowChart",style:{zIndex:999999999}}),xn({src:`/api/attachments/${On}`,id:On,disabledClose:!0})})}},We.createElement(ne.ZP,{type:"primary",className:"ml20"},"\u4FDD\u5B58")))},We.createElement("iframe",{src:`/drawio/src/main/webapp/?id=${di||""}&gapi=0&od=0&db=0&gh=0&gl=0&local=0`,width:"100%",height:"100%",frameBorder:"0",ref:Vi})))}),ei=Mt(78323),Be=Mt(47889),Zt=Mt(1439);const Je=Be.ZP.Group,Ri={margin:"0 8px"};var Pi=({callback:vi,onCancel:di})=>{function xn(en){vi(en)}return pt.createElement(Ce.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:xn},pt.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},pt.createElement("span",{style:Ri},"\u5355\u5143\u683C\u6570\uFF1A"),pt.createElement("span",{style:Ri},"\u884C\u6570"),pt.createElement(Ce.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},pt.createElement(Zt.Z,null)),pt.createElement("span",{style:Ri},"\u5217\u6570"),pt.createElement(Ce.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},pt.createElement(Zt.Z,null))),pt.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},pt.createElement("span",{style:Ri},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),pt.createElement(Ce.default.Item,{name:"align"},pt.createElement(Je,null,pt.createElement(Be.ZP,{value:"default"},pt.createElement("i",{className:"fa fa-align-justify"})),pt.createElement(Be.ZP,{value:"left"},pt.createElement("i",{className:"fa fa-align-left"})),pt.createElement(Be.ZP,{value:"center"},pt.createElement("i",{className:"fa fa-align-center"})),pt.createElement(Be.ZP,{value:"right"},pt.createElement("i",{className:"fa fa-align-right"}))))),pt.createElement("div",{className:"flex-container flex-end"},pt.createElement(ne.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),pt.createElement(ne.ZP,{type:"ghost",onClick:di},"\u53D6\u6D88")))},Ct=Mt(71411),gt=Mt(63089),ft=Mt.n(gt),At=(0,pt.forwardRef)(({use3d:vi,width:di,height:xn,callback:en,showSaveButton:hn},Vi)=>{const zi=(0,pt.useRef)(),ur=(0,pt.useRef)(),[Vn,$n]=(0,pt.useState)(!1),Xe=(0,pt.useRef)({id:zi,appName:"graphing",width:di||1e3,height:xn||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,pt.useEffect)(()=>{ur.current=new(ft())(Xe.current,!0),window.onload=function(){ur.current.inject("applet_container")}},[]);const mi=()=>{var fn=window.ggbApplet.getPNGBase64(1,!0,72);return en&&en(fn),fn};return(0,pt.useEffect)(()=>{Xe.current.appName=Vn?"3D":"graphing",ur.current.inject("applet_container")},[Vn]),(0,pt.useEffect)(()=>{$n(vi)},[vi]),(0,pt.useImperativeHandle)(Vi,()=>({getImgData:mi})),pt.createElement(pt.Fragment,null,pt.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:zi}),pt.createElement(Ze.Z,{align:"middle"},pt.createElement(ve.Z,{flex:1},pt.createElement(Ct.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Vn,onChange:fn=>$n(fn)})),pt.createElement(ve.Z,null,pt.createElement(ne.ZP,{size:"large",onClick:mi,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),wt=Mt(24638);const te="link",ni="upload-image",ui="add-flowchart",qe="draw-image",xe="add-flowchart",Zi="code-block",Si="add-table",Oi="------------",Qi={default:Oi,left:`:${Oi}`,center:`:${Oi}:`,right:`${Oi}:`};var Cn=Mt(66991),_i=Mt(63949);function Mn(){}let er=0;const ir=1e4,fr="\u2581",ar="@\u2581\u2581@",br="@\u2581@",Qn=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`,Nn=["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 yr(vi){return/^\d+$/.test(vi)?`${vi}px`:vi}const Mi=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",on={[Mi+"-B"]:"bold",[Mi+"-I"]:"italic"},Ui={[te]:"\u6DFB\u52A0\u94FE\u63A5",[Zi]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[ni]:"\u6DFB\u52A0\u56FE\u7247",[qe]:"\u6DFB\u52A0\u753B\u56FE",[ui]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[Si]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var an=({defaultValue:vi="",onChange:di,width:xn="100%",height:en=400,miniToolbar:hn=!1,isFocus:Vi=!1,watch:zi,insertTemp:ur,mode:Vn="markdown",id:$n="markdown-editor-id",showResizeBar:Xe=!1,noStorage:mi=!1,showNullButton:fn=!1,showNullProgramButton:On=!1,hidetoolBar:Gn=!1,fullScreen:It=!1,onBlur:se,onCMBeforeChange:xi,onFullScreen:Di,className:Oe="",disablePaste:Ti=!1,disabled:rn=!1,disabledFill:ln=!1,placeholder:yn="",values:ii="",extraUse:Hi,onAddBlank:Xi})=>{const[ki,En]=(0,pt.useState)(null),[Fn,qi]=(0,pt.useState)(vi),[rr,Sr]=(0,pt.useState)(zi),[Kr,ze]=(0,pt.useState)(It),[gn,nr]=(0,pt.useState)(""),[Sn,Ke]=(0,pt.useState)(0),[Fe,ke]=(0,pt.useState)(en),[$e,pi]=(0,pt.useState)(!1),[Ei,Me]=(0,pt.useState)(0),[cn,_e]=(0,pt.useState)(0),bi=(0,pt.useRef)(),pn=(0,pt.useRef)(),kn=(0,pt.useRef)(),zn=(0,pt.useRef)(),Bn=(0,pt.useRef)(),Tn=(0,pt.useRef)(),or=(0,_t.useDispatch)();(0,pt.useEffect)(()=>{const un=window.scrollY||window.pageYOffset;qi(ii),ki==null||ki.setValue(ii),window.scrollTo(0,un)},[ii]),(0,pt.useEffect)(()=>{Di==null||Di(Kr)},[Kr]),(0,pt.useEffect)(()=>{if(bi.current){let un=function(li,Pn){var wr;if(Ti){Pn.preventDefault();return}const Tr=Pn.clipboardData;if(Tr){const Lr=Tr.types.toString(),Xr=Tr.items;if(Lr==="Files"||Tr.types.indexOf("Files")>-1){if(Pn.preventDefault(),Vn=="stex")return;try{let oo=Xr[1];((wr=Xr[0])==null?void 0:wr.kind)==="file"&&(oo=Xr[0]);const so=oo.getAsFile(),bo=so.name.split(".").pop();(0,oe.I)(so,io=>{var go,be,Oo;io.id?((go=so==null?void 0:so.type)==null?void 0:go.indexOf("image"))>-1?Wi.replaceSelection(`<img width="100%" src="/api/attachments/${io.id}?type=${io.content_type})" alt="" />`):((be=so==null?void 0:so.type)==null?void 0:be.indexOf("video"))>-1?Wi.replaceSelection(`<video width="100%" controls src="/api/attachments/${io.id}"></video>`):((Oo=so==null?void 0:so.type)==null?void 0:Oo.indexOf("pdf"))>-1?Wi.replaceSelection(`<a href="/api/attachments/${io.id}?type=${so.type}&disposition=inline" target="_blank">${so.name}</a>`):Nn.includes(bo)?Wi.replaceSelection(`<a href="/api/attachments/${io.id}?type=office&disposition=inline" target="_blank">${so.name}</a>`):Wi.replaceSelection(`[${so.name}](/api/attachments/${io.id}?type=${io.content_type})`):(io==null?void 0:io.status)===401&&(document.location.href="/user/login")})}catch(oo){ti.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const Wi=me().fromTextArea(bi.current,{mode:Vn,lineNumbers:!hn,lineWrapping:!0,value:vi,autoCloseTags:!0,autoCloseBrackets:!0});return Wi.on("keyup",function(li,Pn){Pn.keyCode===8&&(li.getValue()==""?Wi.setOption("placeholder",yn):Wi.setOption("placeholder",null))}),Wi.on("keydown",function(li,Pn){if(Pn.keyCode===8){var wr=Zn(li);wr&&Pn.preventDefault()}}),Vi&&Wi.focus(),Wi.on("paste",un),rn&&Wi.on("beforeChange",function(li,Pn){(Pn.origin==="paste"||Pn.origin==="+input")&&Pn.cancel()}),En(Wi),()=>{Wi.off("paste",un)}}},[]);const Fr=(0,pt.useCallback)(()=>{if(pn.current)try{}catch(un){console.log(un,"---- to set md editor body height")}},[Fe,pn,Kr]);(0,pt.useEffect)(()=>{function un(){let Wi=new Ut.Z(li=>{for(let Pn of li)(Pn.target.offsetHeight>0||Pn.target.offsetWidth>0)&&(Fr(),ki.setSize("100%","100%"),ki.refresh())});return Wi.observe(bi.current.parentElement),Wi}if(ki){const Wi=un();return()=>{var li,Pn;(li=bi.current)!=null&&li.parentElement&&Wi.unobserve((Pn=bi.current)==null?void 0:Pn.parentElement)}}},[ki,Fr]),(0,pt.useEffect)(()=>{if(ki){let un=[];for(const[Wi,li]of Object.entries(on)){let Pn={[Wi]:()=>{ji(li)}};un.push(Pn),ki.addKeyMap(Pn)}return()=>{for(let Wi of un)ki.removeKeyMap(Wi)}}},[ki]),(0,pt.useEffect)(()=>{It!==Kr&&ze(It)},[It]),(0,Cn.Z)(()=>{if(!mi&&Sn>0){let un=new Date().getTime(),Wi=window.sessionStorage.getItem($n);un>=Sn+ir&&(!Wi||Wi!==Fn)&&(window.sessionStorage.setItem($n,Fn),pi(!0))}},ir),(0,pt.useEffect)(()=>{Sr(zi)},[ki,zi]),(0,pt.useEffect)(()=>{ki&&Vi&&ki.focus()},[ki,Vi]),(0,pt.useEffect)(()=>{if(rr&&ki){let un=function(li){let Pn=li.target;if(zn.current){let wr=Pn.scrollTop/Pn.scrollHeight;zn.current.scrollTop=zn.current.scrollHeight*wr}};const Wi=ki.getScrollerElement();return Wi.addEventListener("scroll",un),()=>{Wi.removeEventListener("scroll",un)}}},[ki,rr]),(0,pt.useEffect)(()=>{if(ki&&xi){let un=function(Wi,li){xi(Wi,li)};return ki.on("beforeChange",un),()=>{ki.off("beforeChange",un)}}},[ki,xi]),(0,pt.useEffect)(()=>{if(ki&&se){let un=function(){se(ki.getValue())};return ki.on("blur",un),()=>{ki.off("blur",un)}}},[ki,se]);function Zn(un,Wi){var li=un.getDoc(),Pn=li.getCursor(),wr=li.getLine(Pn.line),Tr=wr.charAt(Pn.ch-1),Lr=wr.lastIndexOf("@\u2581@",Pn.ch),Xr=wr.lastIndexOf("@\u2581\u2581@",Pn.ch),oo=Lr>Xr?Lr:Xr,so=Lr>Xr?3:4;if(ar.indexOf(Tr)===-1)return null;if(console.log("change1:",Wi,un,wr,Pn,oo,Lr,Xr,Tr),oo>=0&&Pn.ch-oo<5){var bo=oo+so;return li.replaceRange("",{line:Pn.line,ch:oo},{line:Pn.line,ch:bo}),{line:Pn.line,ch:bo}}return null}(0,pt.useEffect)(()=>{if(ki){let un=function(Wi,li){const Pn=Wi.getValue();qi(Pn),Ke(new Date().getTime()),Wi.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),di&&(On?di(Pn,vn(Pn)):di(Pn))};return ki.on("change",un),()=>{ki.off("change",un)}}},[ki,di]),(0,pt.useEffect)(()=>{if(ki)if(vi==null)ki.setValue(""),qi("");else{const un=window.scrollY||window.pageYOffset;vi!==ki.getValue()&&(ki.setValue(vi),qi(vi),ki.setCursor(rn?1:ki.lineCount(),0),window.scrollTo(0,un))}},[ki,vi]);const ji=(0,pt.useCallback)(un=>{const Wi=ki.getCursor(),li=ki.getSelection();let Pn=li.split(`
|
|
`);switch(un){case"bold":return ki.replaceSelection("**"+li+"**"),li===""&&ki.setCursor(Wi.line,Wi.ch+2),ki.focus();case"italic":return ki.replaceSelection("*"+li+"*"),li===""&&ki.setCursor(Wi.line,Wi.ch+1),ki.focus();case"code":return ki.replaceSelection("`"+li+"`"),li===""&&ki.setCursor(Wi.line,Wi.ch+1),ki.focus();case"inline-latex":return(0,_i.Ye)(or)?void 0:(nr("inline-latex"),ki.focus());case"latex":return ki.replaceSelection("```latex\n"+li+"\n```"),ki.setCursor(Wi.line+1,li.length+1),ki.focus();case"line-break":return ki.replaceSelection(`<br/>
|
|
`),ki.focus();case"list-ul":return li===""?ki.replaceSelection("- "+li):ki.replaceSelection(Pn.map(wr=>wr===""?"":`- ${wr}`).join(`
|
|
`)),ki.focus();case"list-ol":return li===""?ki.replaceSelection("1. "+li):ki.replaceSelection(Pn.map((wr,Tr)=>wr===""?"":`${Tr+1}. ${wr}`).join(`
|
|
`)),ki.focus();case"add-null-ch":Xi==null||Xi();return;case"add-signal":return li===""&&ki.setCursor(Wi.line,Wi.ch),ki.replaceSelection(br),ki.focus();case"add-multiple":return li===""&&ki.setCursor(Wi.line,Wi.ch),ki.replaceSelection(ar),ki.focus();case"inster-template-1":return li===""&&ki.setCursor(Wi.line,Wi.ch),ki.replaceSelection(Qn),ki.focus();case"eraser":return ki.setValue(""),ki.focus();case"trigger-watch":return Sr(!rr),ki.focus();case"trigger-full-screen":return ze(!Kr),ki.focus();case te:nr(te);return;case Zi:nr(Zi);return;case ni:nr(ni);return;case qe:nr(qe);return;case"maths-latex":if((0,_i.Ye)(or))return;nr("maths-latex");return;case ui:Bn.current="",sessionStorage.removeItem("file_id"),nr(ui);return;case Si:nr(Si);return;default:throw new Error}},[ki,rr,Kr]),Pt=(0,pt.useCallback)((un,Wi)=>{var li,Pn,wr,Tr,Lr,Xr;un!=null&&un.disabledClose||nr("");const{src:oo,alt:so,id:bo}=un||{};switch(gn){case te:const{title:rs,link:po}=un;return ki.replaceSelection(`[${rs}](${po})`),ki.focus();case Zi:const{language:Qr,content:ps}=un;return ki.replaceSelection(["```"+Qr,ps,"```"].join(`
|
|
`)),ki.focus();case"maths-latex":for(var io=atob(un),go=new Uint8Array(io.length),be=0;be<io.length;be++)go[be]=io.charCodeAt(be);var Oo=new Blob([go],{type:"image/png"});(0,oe.I)(Oo,ho=>{ho.id?ki.replaceSelection(``):(ho==null?void 0:ho.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":if((0,_i.Ye)(or))return;ki.replaceSelection("`$$"+un+"$$`");break;case xe:if(!bo)return;ki.getValue().indexOf(oo)===-1?ki.replaceSelection(`<center><img id="${bo}" width="80%" src="${oo}" class="draw-flowchart" alt="${so||""}" /></center>`):document.getElementById(bo).src=ei.Z.API_SERVER+oo+"?t="+Date.now();break;case ni:case qe:const ao=Wi,Pl=(wr=(Pn=(li=ao==null?void 0:ao.name)==null?void 0:li.split("."))==null?void 0:Pn.pop)==null?void 0:wr.call(Pn);return((Tr=ao==null?void 0:ao.type)==null?void 0:Tr.indexOf("image"))>-1||!(ao!=null&&ao.type)?ao!=null&&ao.align||ao!=null&&ao.width?ki.replaceSelection(`<p style="text-align:${ao.align||"initial"}"><img width="${ao.width?ao.width+"%":"initial"}" src="${oo}" alt="${so||""}" /></p>`):ki.replaceSelection(`<img width="100%" src="${oo}" alt="${so||""}" />`):((Lr=ao==null?void 0:ao.type)==null?void 0:Lr.indexOf("video"))>-1?ki.replaceSelection(`<video width="100%" controls src="${oo}"></video>`):((Xr=ao==null?void 0:ao.type)==null?void 0:Xr.indexOf("pdf"))>-1?ki.replaceSelection(`<a href="${oo}?type=${ao.type}&disposition=inline" target="_blank">${ao.name}</a>`):Nn.includes(Pl)?ki.replaceSelection(`<a href="${oo}?type=office&disposition=inline" target="_blank">${ao.name}</a>`):ki.replaceSelection(`[${ao.name}](${oo})`),ki.focus();case Si:const{row:jr,col:Io,align:hl}=un;let Bo=`
|
|
`;for(let ho=0;ho<jr;ho++){let ta=[],jn=[];for(let Ba=0;Ba<Io;Ba++)ho===1&&jn.push(Qi[hl]),ta.push(" ");ho===1&&(Bo+=`| ${jn.join(" | ")} |
|
|
`),Bo+=`| ${ta.join(Io===1?"":" | ")} |
|
|
`}return ki.replaceSelection(Bo+`
|
|
`),ki.focus();default:throw new Error}},[ki,gn]),gr=(0,pt.useMemo)(()=>{switch(gn){case te:return pt.createElement(Ge,{callback:Pt,onCancel:Un});case Zi:return pt.createElement(Ye.Z,{callback:Pt,onCancel:Un});case ni:return pt.createElement(oe.Z,{callback:Pt,onCancel:Un});case ui:return pt.createElement(we,{editImgId:Bn.current,callback:Pt,onCancel:Un});case Si:return pt.createElement(Pi,{callback:Pt,onCancel:Un});case"maths-latex":return pt.createElement(At,{showSaveButton:!0,callback:Pt});case"inline-latex":return pt.createElement(wt.Z,{showSaveButton:!0,callback:Pt});default:return null}},[gn]);function Un(){nr("")}(0,pt.useEffect)(()=>{if(kn.current){let un=function(Lr){wr=!0,Tr=Lr.pageY},Wi=function(){wr=!1},li=function(Lr){if(wr){let Xr=Lr.pageY-Tr;Xr<0&&(Xr=0),Xr>300&&(Xr=300);let oo=en+Xr+"px";ke(oo)}},Pn=kn.current,wr=!1,Tr=0;return Pn.addEventListener("mousedown",un),document.addEventListener("mousemove",li),document.addEventListener("mouseup",Wi),()=>{Pn.removeEventListener("mousedown",un),document.removeEventListener("mousemove",li),document.removeEventListener("mouseup",Wi)}}},[ki,kn]),(0,pt.useEffect)(()=>{ke(en)},[en]);const Ar=yr(xn),Dr=yr(Fe),Cr={width:Ar,height:Dr},sn=(0,pt.useMemo)(()=>{if(Sn){let un=new Date(Sn),Wi=un.getHours(),li=un.getMinutes(),Pn=un.getSeconds();return Wi=Wi<10?"0"+Wi:Wi,li=li<10?"0"+li:li,Pn=Pn<10?"0"+Pn:Pn,`${Wi}:${li}:${Pn}`}return 0},[Sn]),vn=un=>{const Wi=[];if(On){let li=-1;un=un.replace(/(@▁▁@|@▁@)/g,function(Pn,wr,Tr){Wi.push({multiLine:Pn!==br})})}return Wi};function Yn(){window.sessionStorage.removeItem($n),pi(!1),Ke(0)}function Gi(){pi(!1),Ke(0),ki.setValue(window.sessionStorage.getItem($n))}(0,pt.useEffect)(()=>{Ui[gn]&&gn!==qe&&gn!==ui&&setTimeout(()=>{const un=document.getElementsByClassName("markdown-popup-form")[0],Wi=window.innerWidth/2-un.offsetWidth/2,li=window.innerHeight/2-un.offsetHeight/2;Me(Wi),_e(li)},0)},[gn]);const mn=un=>{un.preventDefault();const Wi=un.clientX-Ei,li=un.clientY-cn;document.body.onmousemove=Pn=>{let wr=Pn.clientX-Wi,Tr=Pn.clientY-li;const Lr=document.getElementsByClassName("markdown-popup-form")[0],Xr=window.innerWidth-Lr.offsetWidth,oo=window.innerHeight-Lr.offsetHeight;wr=Math.max(0,Math.min(wr,Xr)),Tr=Math.max(0,Math.min(Tr,oo)),Kn(Pn.clientX,Pn.clientY,Wi,li)&&(Me(wr),_e(Tr))},document.body.onmouseup=function(){document.body.onmousemove=null}},Kn=(un,Wi,li,Pn)=>{const wr=document.body.clientHeight,Tr=document.body.clientWidth;return un<20&&li>un||un>Tr-20&&li<un||Wi<20&&Pn>Wi||Wi>wr-20&&Pn<Wi?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return pt.createElement(pt.Fragment,null,pt.createElement("div",{className:"markdown-editor-wrapper",ref:pn},pt.createElement("div",{className:`markdown-editor-container ${Oe} ${rr?"on-preview":""} ${hn?"mini":""} ${Kr?"full-screen":""}`,style:Cr},pt.createElement(Le,{insertTemp:ur,watch:rr,fullScreen:Kr,showNullButton:fn,showNullProgramButton:On,onActionCallback:ji,hidetoolBar:Gn,extraUse:Hi}),pt.createElement("div",{className:"markdown-editor-body"},pt.createElement("div",{className:"codemirror-container"},pt.createElement("textarea",{ref:bi,placeholder:yn})),rr?pt.createElement("div",{ref:zn,className:"preview-container"},Vn==="stex"&&pt.createElement(Ne,{value:Fn}),Vn!=="stex"&&pt.createElement(zt.Z,{edit:!0,disabledFill:ln,showProgramFill:On,value:Fn,openEditor:un=>{var Wi;Bn.current=un,(Wi=Tn.current)==null||Wi.setHeight("100vh"),setTimeout(()=>{nr("add-flowchart")},150)}})):null))),Xe?pt.createElement("a",{ref:kn,className:"editor-resize"}):null,gn===qe&&pt.createElement(ie,{callback:Pt,onCancel:Un}),gn===ui&&pt.createElement(we,{ref:Tn,editImgId:Bn.current,callback:Pt,onCancel:Un}),pt.createElement(Wt.Z,null,Ui[gn]&&gn!==qe&&gn!==ui?pt.createElement(Ve.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Ei,top:cn},title:pt.createElement("div",{style:{cursor:"move"},onMouseDown:mn},Ui[gn]),open:!0,onCancel:Un,footer:null,destroyOnClose:!0,width:gn===ui?"1200px":null,height:gn===ui?"80vh":null,className:"markdown-popup-form"},gr):null))}},90443:function(Li,ai,Mt){"use strict";Mt.d(ai,{Z:function(){return pe},I:function(){return Le}});var pt=Mt(28284),_t=Mt(6767),ce=Mt(37568),me=Mt(44104),Ut=Mt(1439),fe=Mt(47889),$t=Mt(99571),Ae=Mt(88457),re=Mt(59301),Dt=Mt(59301),de=Object.defineProperty,zt=Object.defineProperties,Ne=Object.getOwnPropertyDescriptors,ue=Object.getOwnPropertySymbols,qt=Object.prototype.hasOwnProperty,Qt=Object.prototype.propertyIsEnumerable,Jt=(Wt,Ce,Te)=>Ce in Wt?de(Wt,Ce,{enumerable:!0,configurable:!0,writable:!0,value:Te}):Wt[Ce]=Te,Pe=(Wt,Ce)=>{for(var Te in Ce||(Ce={}))qt.call(Ce,Te)&&Jt(Wt,Te,Ce[Te]);if(ue)for(var Te of ue(Ce))Qt.call(Ce,Te)&&Jt(Wt,Te,Ce[Te]);return Wt},je=(Wt,Ce)=>zt(Wt,Ne(Ce));const{useForm:De}=pt.default,Yt={width:280,marginRight:10},Vt={labelCol:{span:5},wrapperCol:{span:19}};var pe=({callback:Wt,onCancel:Ce})=>{const[Te]=De();let ne=(0,re.useRef)();function Re(Ai){ne.current.width=Te.getFieldValue("width"),ne.current.align=Te.getFieldValue("align"),Wt(Ai,ne.current)}function ye(Ai,yi){if(Ai.status===-1){_t.ZP.error(Ai.message);return}Te.setFieldsValue({src:`/api/attachments/${Ai.id}`,type:yi.type})}function Ie(Ai){let yi=Ai.target.files[0];ne.current=yi,Le(yi,ye)}return Dt.createElement(pt.default,je(Pe({form:Te},Vt),{className:"upload-image-panel",onFinish:Re,style:{width:470,overflow:"hidden"}}),Dt.createElement(pt.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},Dt.createElement("div",{className:"flex-container"},Dt.createElement(pt.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},Dt.createElement(ce.default,{style:Yt})),Dt.createElement(Xt,{onFileChange:Ie}))),Dt.createElement(pt.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},Dt.createElement(ce.default,{style:{width:264}})),Dt.createElement(pt.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},Dt.createElement(me.Z,null,Dt.createElement(pt.default.Item,{name:"width",style:{margin:0}},Dt.createElement(Ut.Z,{style:{width:264}})),Dt.createElement("span",{className:"ml8"},"%"))),Dt.createElement(pt.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},Dt.createElement(fe.ZP.Group,{name:"align",defaultValue:1,options:[{value:"left",label:"\u5DE6\u5BF9\u9F50"},{value:"center",label:"\u5C45\u4E2D\u5BF9\u9F50"},{value:"right",label:"\u53F3\u5BF9\u9F50"}]})),Dt.createElement("aside",null,Dt.createElement(pt.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},Dt.createElement($t.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),Dt.createElement($t.ZP,{type:"default",onClick:Ce},"\u53D6\u6D88"))))};function Xt({onFileChange:Wt}){return Dt.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",Dt.createElement("input",{type:"file",onChange:Wt}))}function Le(Wt,Ce){if(!Wt)throw new String("\u6CA1\u6709\u6587\u4EF6");let Te=new FormData;Te.append("editormd-image-file",Wt),Te.append("file_param_name","editormd-image-file"),Te.append("byxhr","true");var ne=new window.XMLHttpRequest;ne.withCredentials=!0,ne.addEventListener("load",function(Re){Ce(JSON.parse(Re.target.responseText),Wt)},!1),ne.addEventListener("error",function(Re){console.error(Re)},!1),ne.open("POST",`${Ae.KI}/api/attachments.json`),ne.send(Te)}},81123:function(Li,ai,Mt){"use strict";Mt.d(ai,{Z:function(){return ce}});var pt=Mt(59301),_t=Mt(4676);class ce extends pt.Component{constructor(Ut){super(Ut);const fe=window.document;this.node=fe.createElement("div"),fe.body.appendChild(this.node)}render(){const{children:Ut}=this.props;return(0,_t.createPortal)(Ut,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},95440:function(Li,ai,Mt){"use strict";Mt.d(ai,{SV:function(){return ie},ZP:function(){return Se}});var pt=Mt(59301),_t=Mt(76374);const ce={keywords:["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"]},me={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],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"]},Ut={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}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std",content:["using namespace std"].join(`
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},fe={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(`
|
|
`)}]},$t={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(`
|
|
`)}]};var Ae=Mt(53184),re=Mt.n(Ae),Dt=(ee,ve,ti)=>new Promise((he,We)=>{var He=Be=>{try{ei(ti.next(Be))}catch(Zt){We(Zt)}},we=Be=>{try{ei(ti.throw(Be))}catch(Zt){We(Zt)}},ei=Be=>Be.done?he(Be.value):Promise.resolve(Be.value).then(He,we);ei((ti=ti.apply(ee,ve)).next())});const de={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"]}},zt=(ee,ve,ti,he)=>{const We=ve.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:ti.lineNumber,endColumn:ti.column});return Array.from(new Set(We.match(/\b\w{2,}\b/g)||[])).map(we=>({label:we,kind:ee.languages.CompletionItemKind.Text,insertText:we,range:he}))},Ne=(ee,ve,ti,he)=>{ee.languages.registerCompletionItemProvider(ve,{provideCompletionItems(We,He){const we=We.getWordUntilPosition(He),ei={startLineNumber:He.lineNumber,endLineNumber:He.lineNumber,startColumn:we.startColumn,endColumn:we.endColumn},Be=We.getLineContent(He.lineNumber).substring(we.startColumn-2,we.endColumn);return{suggestions:[...zt(ee,We,He,ei),...ti.map(Je=>({label:Je,kind:ee.languages.CompletionItemKind.Keyword,documentation:Je,insertText:Je,insertTextRules:ee.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ei})),...he.map(Je=>({label:Je.label,kind:ee.languages.CompletionItemKind.Snippet,documentation:Je.content,insertText:Be.startsWith("#")?Je.content.replace(/#/,""):Je.content,insertTextRules:ee.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ei}))]}}})};var ue=ee=>{de.languages.forEach(ve=>{ee.languages.registerDocumentFormattingEditProvider(ve,{provideDocumentFormattingEdits(ti){return Dt(this,null,function*(){const he=re()(ti.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});return[{range:ti.getFullModelRange(),text:he}]})}})}),Ne(ee,"java",me.keywords,me.quickKey),Ne(ee,"cpp",Ut.keywords,Ut.quickKey),Ne(ee,"c",ce.keywords,[]),Ne(ee,"python",fe.keywords,fe.quickKey),Ne(ee,"scala",$t.keywords,$t.quickKey)};const qt="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var Qt=Object.defineProperty,Jt=(ee,ve,ti)=>ve in ee?Qt(ee,ve,{enumerable:!0,configurable:!0,writable:!0,value:ti}):ee[ve]=ti,Pe=(ee,ve,ti)=>Jt(ee,typeof ve!="symbol"?ve+"":ve,ti);const je=class Sw{constructor(ve,ti,he){this.placeholder=ve,this.editor=ti,this.monaco=he,ti.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Sw.ID}getDomNode(){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}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};Pe(je,"ID","editor.widget.placeholderHint");var Yt=je,Vt=Mt(96236),pe=Mt(6767),Xt=Mt(25399),Le=Mt(89392),Wt=Mt(27035),Ce=Mt(56102),Te=Object.defineProperty,ne=Object.defineProperties,Re=Object.getOwnPropertyDescriptors,ye=Object.getOwnPropertySymbols,Ie=Object.prototype.hasOwnProperty,Ai=Object.prototype.propertyIsEnumerable,yi=(ee,ve,ti)=>ve in ee?Te(ee,ve,{enumerable:!0,configurable:!0,writable:!0,value:ti}):ee[ve]=ti,gi=(ee,ve)=>{for(var ti in ve||(ve={}))Ie.call(ve,ti)&&yi(ee,ti,ve[ti]);if(ye)for(var ti of ye(ve))Ai.call(ve,ti)&&yi(ee,ti,ve[ti]);return ee},oi=(ee,ve)=>ne(ee,Re(ve)),Bt=(ee,ve)=>{var ti={};for(var he in ee)Ie.call(ee,he)&&ve.indexOf(he)<0&&(ti[he]=ee[he]);if(ee!=null&&ye)for(var he of ye(ee))ve.indexOf(he)<0&&Ai.call(ee,he)&&(ti[he]=ee[he]);return ti},bt=(ee,ve,ti)=>new Promise((he,We)=>{var He=Be=>{try{ei(ti.next(Be))}catch(Zt){We(Zt)}},we=Be=>{try{ei(ti.throw(Be))}catch(Zt){We(Zt)}},ei=Be=>Be.done?he(Be.value):Promise.resolve(Be.value).then(He,we);ei((ti=ti.apply(ee,ve)).next())});function ge(ee){return/^\d+$/.test(ee)?`${ee}px`:ee}function Ge(){}let Ye=!1;const oe={"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 Ve(ee=[]){let ve=ee;if(Array.isArray(ee)){for(let ti=0;ti<ee.length;ti++){let he=oe[ee[ti]];if(he)return he}return ve[0]}return oe[ve]||ve}let Ze=null;const Ni=()=>bt(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(ee){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",ee)}});var Se=ee=>{var ve=ee,{width:ti="100%",height:he="100%",value:We,language:He="javascript",style:we={},options:ei={},overrideServices:Be={},theme:Zt="vs-dark",onEditBlur:Je,isCopy:Ri=!1,onSave:Pi,autoHeight:Ct=!1,forbidCopy:gt=!1,onChange:ft=Ge,editorDidMount:St=Ge,onFocus:At=Ge,onBreakPoint:wt=Ge,breakPointValue:te=[],filename:ni="educoder.txt",errorLine:ui,errorContent:qe="",highlightLine:xe,openBreakPoint:Zi=!1,placeholder:Si="",showMiniMap:Oi=!0}=ve,Qi=Bt(ve,["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"]);const Cn=(0,pt.useRef)(),_i=(0,pt.useRef)({}),Mn=(0,pt.useRef)(),er=(0,pt.useRef)(),ir=(0,pt.useRef)([]),fr=(0,pt.useRef)(!1),ar=(0,pt.useRef)(),br=(0,pt.useRef)(),Qn=(0,pt.useRef)(!1),[Nn,yr]=(0,pt.useState)(!1);function yt(){let Xe;return Cn.current&&(Xe=new _t.Z(mi=>{for(let fn of mi)(fn.target.offsetHeight>0||fn.target.offsetWidth>0)&&_i.current.instance.layout()}),Xe.observe(Cn.current)),Xe}function Mi(){pe.ZP.warning({content:decodeURIComponent(qt),key:"monaco-editor-tip"})}const on=()=>{let Xe=_i.current.instance;if(We!=null&&Xe&&Nn){const mi=Xe.getModel();mi&&We!==mi.getValue()&&(Ye=!0,mi.setValue(We),Xe.layout(),Ye=!1)}};(0,pt.useEffect)(()=>{const Xe=Wt.Z.subscribe("formatDocument",mi=>{var fn;let On=_i.current.instance;(fn=On==null?void 0:On.getAction)==null||fn.call(On,"editor.action.formatDocument").run()});return window.updateMonacoValue=mi=>{ft(mi)},Xe},[]),(0,pt.useEffect)(()=>{var Xe;let mi=_i.current.instance;er.current&&clearTimeout(er.current),er.current=setTimeout(()=>{on()},500),We&&(We!=null&&We.length)&&((Xe=mi==null?void 0:mi.updateOptions)==null||Xe.call(mi,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(We.split(/\r\n|\r|\n/g).length))+3,5)}))},[We,Nn,_i.current]),(0,pt.useEffect)(()=>{if(ui&&_i.current&&_i.current.instance){let mi=_i.current.instance;mi.changeViewZones(function(fn){var On=document.createElement("div");On.style.padding="10px 20px",On.style.width="calc(100% - 20px)",On.className="my-error-line-wrp",On.innerHTML=qe,fn.addZone({afterLineNumber:ui||11,heightInLines:3,domNode:On})});var Xe={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}};mi.addOverlayWidget(Xe),mi.revealPositionInCenter({lineNumber:20,column:1})}},[ui,_i.current,Nn]);const Ui=(Xe="",mi)=>{if(!Xe||Xe.trim()==="")return!0;const On=_i.current.instance.getModel().getLineTokens(mi);let Gn=!1;for(let It=0;It<2;It++)On.getStandardTokenType(It)===1&&(Gn=!0);return Gn};(0,pt.useEffect)(()=>{var Xe;const mi=(Xe=_i.current)==null?void 0:Xe.instance;if(mi&&Nn&>){const fn=mi.onDidBlurEditorWidget(()=>{Qn.current=!1}),On=mi.onDidFocusEditorText(()=>{Qn.current=!0});return()=>{fn.dispose(),On.dispose()}}},[_i.current,Nn,gt]),(0,pt.useEffect)(()=>{var Xe;if((Xe=_i.current)!=null&&Xe.instance&&Nn&&Zi){let mi=_i.current.instance,fn=mi.getModel();if(!fn)return;(()=>{var ii;let Hi=[],Xi=[];const ki=fn.getAllDecorations();for(let Fn of ki)Fn.options.className==="highlighted-line"&&(Hi.push((ii=Fn==null?void 0:Fn.range)==null?void 0:ii.startLineNumber),Xi.push(Fn==null?void 0:Fn.id));if(xe===Hi[0])return;fn.deltaDecorations(Xi,[]);const En=fn.getLineCount();xe&&xe<=En&&(mi.deltaDecorations([],[{range:new Ze.Range(xe,1,xe,fn.getLineMaxColumn(xe)),options:{isWholeLine:!0,className:"highlighted-line"}}]),mi.revealLineInCenter(xe))})();const Gn=(ii=!1)=>{var Hi;let Xi=[],ki=[];const En=fn.getAllDecorations();for(let Fn of En)Fn.options.linesDecorationsClassName==="breakpoints-select"&&(Xi.push((Hi=Fn==null?void 0:Fn.range)==null?void 0:Hi.startLineNumber),ki.push(Fn==null?void 0:Fn.id));if(ii)return{lines:Xi,ids:ki};wt(Xi)},It=ii=>bt(void 0,null,function*(){let Hi={range:new Ze.Range(ii,1,ii,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield fn.deltaDecorations([],[Hi]),Gn()}),se=ii=>bt(void 0,null,function*(){let Hi=[];const Xi=mi.getLineDecorations(ii);for(let ki of Xi)ki.options.linesDecorationsClassName==="breakpoints-select"&&Hi.push(ki.id);yield fn.deltaDecorations(Hi,[]),Gn()}),xi=ii=>{let Hi=mi.getLineDecorations(ii);for(let Xi of Hi)if(Xi.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,Le.isEqual)(te,Gn(!0).lines)){fn.deltaDecorations(Gn(!0).ids,[]);const ii=te.map(Hi=>({range:new Ze.Range(Hi,1,Hi,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));fn.deltaDecorations([],ii)}const Di=mi.onDidChangeModelContent(ii=>{let Hi=mi.getPosition();if(Hi){let Xi=Hi.lineNumber;clearTimeout(br.current),br.current=setTimeout(()=>{Ui(fn.getLineContent(Xi),Xi)?se(Xi):xi(Xi)?(se(Xi),It(Xi)):Gn()},100)}}),Oe=mi.onMouseDown(ii=>{var Hi,Xi,ki;if(ii.target.detail&&((ki=(Xi=(Hi=ii.target)==null?void 0:Hi.element)==null?void 0:Xi.className)!=null&&ki.includes("line-numbers"))){let En=ii.target.position.lineNumber;if(Ui(fn.getLineContent(En),En))return;xi(En)?se(En):It(En)}}),Ti=ii=>{let Hi={range:new Ze.Range(ii,1,ii,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};ir.current=mi.deltaDecorations(ir.current,[Hi])},rn=()=>{ir.current=mi.deltaDecorations(ir.current,[])},ln=mi.onMouseMove(ii=>{var Hi,Xi,ki;if(rn(),ii.target.detail&&((ki=(Xi=(Hi=ii.target)==null?void 0:Hi.element)==null?void 0:Xi.className)!=null&&ki.includes("line-numbers"))){let En=ii.target.position.lineNumber;if(Ui(fn.getLineContent(En),En))return;Ti(En)}}),yn=mi.onMouseLeave(()=>{rn()});return()=>{Di.dispose(),Oe.dispose(),ln.dispose(),yn.dispose()}}},[_i.current,Nn,te,xe,Zi,He]),(0,pt.useEffect)(()=>{var Xe;(Xe=_i.current)!=null&&Xe.instance&&Zi&&_i.current.instance.setPosition({lineNumber:0,column:0})},[xe]);function an(){let Xe=_i.current.instance;if(Xe){const mi=Xe.getSelection(),fn=_i.current.pastePos||{},On=new Ze.Range(fn.startLineNumber||mi.endLineNumber,fn.startColumn||mi.endColumn,fn.endLineNumber||mi.endLineNumber,fn.endColumn||mi.endColumn);setTimeout(()=>{Xe.executeEdits("",[{range:On,text:""}])},300)}}function vi(Xe){(window.navigator.platform.match("Mac")?Xe.metaKey:Xe.ctrlKey)&&Xe.keyCode==83&&(Xe.preventDefault(),Pi())}const di=()=>{if(Ct&&_i.current.instance){const Xe=_i.current.instance.getContentHeight();Vn(Xe<he?he:Xe)}else Vn(he)};function xn(Xe){var mi=document.createEvent("MouseEvents");mi.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Xe.dispatchEvent(mi)}const en=Xe=>{if(!Qn.current)return;const{keyCode:mi,ctrlKey:fn,metaKey:On,target:Gn,type:It}=Xe;return(It==="paste"||(mi===67||mi===86)&&(On||fn))&&Gn.nodeName==="TEXTAREA"&&(Mi(),Xe.preventDefault()),!1};function hn(Xe,mi){var fn=window.URL||window.webkitURL||window,On=new Blob([mi]),Gn=document.createElementNS("http://www.w3.org/1999/xhtml","a");Gn.href=fn.createObjectURL(On),Gn.download=Xe,xn(Gn)}(0,pt.useEffect)(()=>{di()},[di]),(0,pt.useEffect)(()=>{Cn.current&&!Nn&&Promise.all([Mt.e(8909),Mt.e(4100)]).then(Mt.bind(Mt,71448)).then(Xe=>{try{Ze=Xe,_i.current.instance=Ze.editor.create(Cn.current,{value:We,language:Ve(He),theme:Zt,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:Oi||!1}},Be);const mi=_i.current.instance;let Gn=[...Vt.BH._menuItems].find(Di=>Di[0]._debugName=="EditorContext")[1],It=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],se=(Di,Oe)=>{var Ti,rn;let ln=Di._first;do Oe.includes((rn=(Ti=ln.element)==null?void 0:Ti.command)==null?void 0:rn.id)&&Di._remove(ln);while(ln=ln.next)};if(St(mi,Ze),setTimeout(()=>{di(),_i.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{hn(ni||"educoder.txt",mi.getValue())}})},500),_i.current.subscription=mi.onDidChangeModelContent(Di=>{fr.current?clearTimeout(ar.current):(di(),ft(mi.getValue(),Di)),ar.current=setTimeout(()=>{fr.current=!1},500)}),window.Monaco||ue(Ze,Ve(He)),gt&&(se(Gn,It),Cn.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",en),window.removeEventListener("paste",en),window.addEventListener("keydown",en),window.addEventListener("paste",en)),window.Monaco=Ze,Je&&mi.onDidBlurEditorWidget(()=>{Je(mi.getValue())}),At&&mi.onDidFocusEditorText(()=>{gt&&Ni(),At(mi.getValue())}),gt){Ni();try{mi.onDidPaste(Di=>{const Oe=mi.getSelection(),Ti=_i.current.pastePos||{},rn=new Ze.Range(Ti.startLineNumber||Oe.endLineNumber,Ti.startColumn||Oe.endColumn,Ti.endLineNumber||Oe.endLineNumber,Ti.endColumn||Oe.endColumn);mi.executeEdits("",[{range:Di.range,text:""}])})}catch(Di){}}let xi=yt();return Si&&typeof Si=="string"&&new Yt(Si,mi,Ze),yr(!0),()=>{const Di=_i.current.instance;Di.dispose();const Oe=Di.getModel();Oe&&Oe.dispose(),_i.current.subscription&&_i.current.subscription.dispose(),xi.unobserve(Cn.current)}}catch(mi){}})},[]),(0,pt.useEffect)(()=>{if(_i.current.instance&&Nn)return document.addEventListener("keydown",vi,!1),()=>{document.removeEventListener("keydown",vi)}},[Pi,Nn]),(0,pt.useEffect)(()=>{let Xe=_i.current.instance;if(Xe&&Nn){let mi=Ve(He);Ze.editor.setModelLanguage(Xe.getModel(),mi)}},[He,Nn]),(0,pt.useEffect)(()=>{_i.current.instance&&Nn&&Ze.editor.setTheme(Zt)},[Zt,Nn]),(0,pt.useEffect)(()=>{let Xe=_i.current.instance;Mn.current=ei,Xe&&Nn&&(Xe.updateOptions(gi({},ei)),setTimeout(()=>{Xe.getModel().updateOptions(gi({},ei))},200))},[JSON.stringify(ei),Nn]),(0,pt.useEffect)(()=>{let Xe=_i.current.instance;Xe&&Nn&&Xe.layout()},[ti,he,Nn]);const[Vi,zi]=(0,pt.useState)(ge(ti)),[ur,Vn]=(0,pt.useState)(ge(he)),$n=oi(gi({},we),{width:Vi,height:ur,position:"relative"});return pt.createElement("div",{className:"my-monaco-editor",ref:Cn,style:$n},Ri&&pt.createElement(Ce.CopyToClipboard,{text:We,onCopy:()=>pe.ZP.success("\u590D\u5236\u6210\u529F")},pt.createElement(Xt.Z,{title:"\u590D\u5236\u4EE3\u7801"},pt.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},pt.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function ie({width:ee="100%",height:ve="100%",original:ti,modified:he,language:We,options:He={}}){const we=(0,pt.useRef)(),[ei,Be]=(0,pt.useState)(null);function Zt(Ct){let gt;return we.current&&(gt=new _t.Z(ft=>{for(let St of ft)(St.target.offsetHeight>0||St.target.offsetWidth>0)&&Ct.layout()}),gt.observe(we.current)),gt}(0,pt.useEffect)(()=>(we.current&&Promise.all([Mt.e(8909),Mt.e(9404)]).then(Mt.bind(Mt,2550)).then(Ct=>{Ze=Ct;const gt=Ze.editor.createDiffEditor(we.current,oi(gi({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},He),{wordWrap:!0}));Be(gt);let ft=Zt(gt);return()=>{gt.dispose();const St=gt.getModel();St&&St.dispose(),ft.unobserve(we.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,pt.useEffect)(()=>{ei&&ei.setModel({original:Ze.editor.createModel(ti,We),modified:Ze.editor.createModel(he,We)})},[ti,he,We,ei]);const Je=ge(ee),Ri=ge(ve),Pi={width:Je,height:Ri};return pt.createElement("div",{className:"my-diff-editor",ref:we,style:Pi})}},47140:function(Li,ai,Mt){"use strict";Mt.d(ai,{Z:function(){return zt}});var pt={flex_box_center:"flex_box_center___AQ53o",flex_space_between:"flex_space_between___i2aIa",flex_box_vertical_center:"flex_box_vertical_center___sPEKB",flex_box_center_end:"flex_box_center_end___GhSSH",flex_box_column:"flex_box_column___R9_Hb",list:"list___jb2Ay",wrap:"wrap___VsQDr",lockWrap:"lockWrap___g1k1T",li:"li___IxCLC",cover:"cover___Mu8wr",img:"img___IpFLA",movebq:"movebq___mF7wt",bq:"bq___Bil0T",sign:"sign___DXJ4d",name:"name___l7FoJ",e:"e___pXQUG",unit:"unit___wCIFR",tags:"tags___w_Mil",tag1:"tag1___dxm7r",tag2:"tag2___llZkf",wrapisCurrent:"wrapisCurrent___qIfQT",tagsDom:"tagsDom___COQg7"},_t=Mt(29787),ce=Mt(25399),me=Mt(60242),Ut=Mt(92310),fe=Mt.n(Ut),$t=Mt(63949),Ae=Mt(13922),re=Mt(81779),Dt=Mt(59301),zt=({className:Ne,dataSource:ue=[],col:qt=4,right:Qt,bottom:Jt=23,precision:Pe=0,wrapWidth:je=1200,trackEventItems:De,loading:Yt,onRemove:Vt=()=>{},isCurrent:pe=!0,showProgress:Xt=!1,showAlias:Le=!1})=>{const Wt=Math.floor((je-(qt-1)*Qt)/qt),Ce=[{name:"\u63A8\u8350\u81EA\u5B66",ptimg:"/images/tjzx.png",swimg:"/images/sw_tjzx.png"},{name:"101\u8BA1\u5212",ptimg:"/images/jh.png",swimg:"/images/sw_jh.png"},{name:"\u56FD\u5BB6\u4E00\u6D41",ptimg:"/images/gjyl.png",swimg:"/images/sw_gjyl.png"},{name:"\u7701\u7EA7\u4E00\u6D41",ptimg:"/images/sjyl.png",swimg:"/images/sw_sjyl.png"},{name:"\u7CBE\u54C1\u8BFE\u7A0B",ptimg:"/images/jpkc.png",swimg:"/images/sw_jpkc.png"},{name:"\u519B\u961F\u4E00\u6D41",ptimg:"/images/jdyl.png",swimg:"/images/sw_jdyl.png"},{name:"\u65B0\u578B\u6559\u6750",ptimg:"/images/xxjc.png",swimg:"/images/sw_xxjc.png"}];return Dt.createElement(_t.Z,{spinning:Yt},Dt.createElement("div",{className:fe()(pt.list,Ne)},!!(ue!=null&&ue.length)&&(ue==null?void 0:ue.map((Te,ne)=>{var Re,ye,Ie,Ai,yi,gi,oi,Bt,bt;const{name:ge,id:Ge,identifier:Ye,featured:oe,school_name:Ve,image_url:Ze,excellent:Ni,is_plan:Se}=Te;return Dt.createElement("div",{key:Ge,className:pe&&Xt?pt.wrapisCurrent:pt.wrap,style:{width:Wt,marginRight:(1+ne)%qt===0?0:Qt+Pe,marginBottom:Jt}},Dt.createElement("a",{className:pt.li,onClick:ie=>{ie.preventDefault(),ie.stopPropagation(),De&&(0,$t.L9)([De]),(0,$t.xg)(`/paths/${Ye}`)}},Dt.createElement("div",{className:pt.img},Dt.createElement("img",{className:pt.cover,src:`${Ze}`}),pe&&(0,re.bg)()&&(Te==null?void 0:Te.studying)&&Dt.createElement("div",{className:`${pt.movebq} user-path-items`,onClick:ie=>{ie.stopPropagation(),Vt(Te)}},Dt.createElement("i",{className:"iconfont icon-yichu1 mr5 c-red"}),Dt.createElement("span",{className:"c-red"},"\u79FB\u9664")),(Re=Te==null?void 0:Te.subject_tags)==null?void 0:Re.map((ie,ee)=>{var ve,ti;if(ee===0){const We=(ve=Ce.find(He=>He.name==ie))==null?void 0:ve.swimg;return Dt.createElement("img",{className:pt.sign,src:We,style:{left:"-4px"}})}const he=(ti=Ce.find(We=>We.name==ie))==null?void 0:ti.ptimg;return Dt.createElement("img",{className:pt.sign,src:he,style:{left:`${48+52*(ee-1)+2*ee}px`}})}),Dt.createElement("div",{className:pt.tagsDom},Dt.createElement("div",{className:"flex flex-wrap gap-10px item-center"},(Te==null?void 0:Te.excellent)&&Dt.createElement("div",{className:pt.bq},"\u5F00\u653E\u8BFE\u7A0B"),((ye=Te==null?void 0:Te.custom_tags)==null?void 0:ye.length)>0&&Dt.createElement(ce.Z,{title:(Ie=Te==null?void 0:Te.custom_tags)==null?void 0:Ie.slice(-1)},Dt.createElement("div",{className:"px-6px rounded-2px c-white h-16px flex item-center",style:{maxWidth:"62px",background:"#3061D0",border:"0.5px solid #8FAFF8"}},Dt.createElement("span",{className:"multi-llipsis1e text-10px"},(Ai=Te==null?void 0:Te.custom_tags)==null?void 0:Ai.slice(-1))))))),Dt.createElement("div",{className:pt.name},Dt.createElement(ce.Z,{title:Le&&(Te!=null&&Te.excellent_alias_name)?Dt.createElement("span",null,`\u8BFE\u7A0B\u539F\u540D\uFF1A${ge}`,Dt.createElement("br",null),Dt.createElement("span",null,`\u8BFE\u7A0B\u522B\u540D\uFF1A${Te==null?void 0:Te.excellent_alias_name}`)):ge},Dt.createElement("span",{className:pt.e},Le&&(Te==null?void 0:Te.excellent_alias_name)||ge))),pe&&Xt&&((yi=Te==null?void 0:Te.progress)==null?void 0:yi.all_score)!=0&&Dt.createElement("div",{style:{padding:"0px 10px",color:"#333",marginTop:10}},Dt.createElement(me.Z,{strokeColor:"#44d7b6",gap:"small",percent:(((gi=Te==null?void 0:Te.progress)==null?void 0:gi.my_score)/((oi=Te==null?void 0:Te.progress)==null?void 0:oi.all_score)*100).toFixed(),showInfo:!1}),"\u5DF2\u5B8C\u6210 ",(Bt=Te==null?void 0:Te.progress)==null?void 0:Bt.my_score,"/",(bt=Te==null?void 0:Te.progress)==null?void 0:bt.all_score),(!pe||!Xt)&&Dt.createElement(ce.Z,{title:`\u53D1\u5E03\u5355\u4F4D\uFF1A${Ve}`},Dt.createElement("div",{className:pt.unit},Dt.createElement("i",{className:"iconfont icon-danwei1 font14 mr3"}),Ve)),(!pe||!Xt)&&Dt.createElement("div",{className:pt.tags},Dt.createElement("div",null,Dt.createElement(ce.Z,{placement:"bottom",title:"\u7AE0\u8282\u6570"},Dt.createElement("span",null,Dt.createElement("i",{className:"iconfont icon-zhangjie1 font14 mr3"}),Dt.createElement("span",null,Te.stages_count))),Dt.createElement(ce.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},Dt.createElement("span",null,Dt.createElement("i",{className:"iconfont icon-chengyuan font14 mr3"}),Dt.createElement("span",null,Te.members_count)))))))})),!ue.length&&Dt.createElement(Ae.Z,null)))}},71951:function(Li,ai,Mt){"use strict";Mt.d(ai,{jL:function(){return Ut},w9:function(){return ge},QD:function(){return ui},cQ:function(){return yi.Z},op:function(){return ft},O5:function(){return on},_b:function(){return Qi},t7:function(){return Pe},Gi:function(){return Ni},YG:function(){return Ve},qp:function(){return de},vr:function(){return Zi},qE:function(){return wt},Je:function(){return Yt},wb:function(){return Ai},cq:function(){return he},tp:function(){return ue}});var pt=Mt(59301),_t={flex_box_center:"flex_box_center___NeSU8",flex_space_between:"flex_space_between___ImTGl",flex_box_vertical_center:"flex_box_vertical_center___BtRd9",flex_box_center_end:"flex_box_center_end___qcLe3",flex_box_column:"flex_box_column___Ze_3q",banner:"banner___PoUBO",content:"content___XoDjy",btns:"btns___Pb35j"},ce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE4AAAA0CAYAAAAkEw66AAAAAXNSR0IArs4c6QAAGNVJREFUeF7VmwmwHVWdxr9zuvvu9+3ZXsxCiNkIQZOwEzMgyADjggsWgzPqOAJaMiCjYiGKqDBQAo4iWGAxA+ooMm7gBhSyhBBRIIBSAQlrHuTt7913t97PmfpOd4cXlLAFGO6rW9237719+/z6+6/nPIHX+XHttddaex38nlW2lLO1svq1wJ4aeFMM9CqFnNKoaYVapDAOicfjGEMKqKk2nrx59Lbt5xx6aPR6DEG8Hj/K3xwY0YtjSx2vYnlspLEsX0BRKUBrINtyX+PZp0r3fR+IIgzFSo9EsahFUfSHWIj7Pa919zvf2vlo+rFXdWivObjHJvR8S6vTJORHckV0+4GBAF4InwQlBCAIkEMXgCLA9Mn9WCef4ft8HWkgVIDn6ckwUA/HQfCzoFX71TsP6n/41aL3moHTWotnJnGysPEFx8ZcAtMqGTjh2NmVTL+iDB6BZurjsRSe2SogjhNwMZIngbZbqgXom8N26/KjV3femB7ebRxfE3DbRnW/k8c3LQvv5yCjOFVVqhgCyNnJmAhoxyOFasz1OeCM2lLTJryI4BQQUn1RAhI24Lc1dBjc2K6Nnv2edfP+sLvIvergxqb0vpHA1fk8lre9xBZpZsYKU9sMYiDvAHKaqU4HuANcZrIpcILiezRdo7z0aUw3BoJYI4gELAeI/bjZmBq9+PGNd5x/+unHua8U4KsKbriujxUSV9gW+rwg9WPTfpHgpEgUQgAFJwU6LSDwjSxA8F2jslSBBJaZKwVGJRv1pSAJLyQ8qlwLOA4Q1us31Z58+OTj3rX/E68E3qsGbmhK/6Nt40oIFMJwZ5URFh/cZoGgHQKODeSsaUEiA5iSy6IqYRnfmPq66YojPILbYbqpGXuhRhRrFPMSUaP+6OTAtuPff8ze97xceK8KuJGG/oBl4XsaKMTTsiwDKVXZjm1qsgRBU84TXi5VXqo24/syP5ce2xEg0gBDeAZWFijo79JnpLQxXSo7iICiIyD8qUfdxuQRRx24x5MvB95uBzfW1G+XFn4GoMMojQNOYWUK45b+jG9mW+PvFNAKEkqVYgI583VZcOB7WRrCqGwiaQovU1lAlaXKM/BMQNIGbN0FLGh0lySCVv0OP3aPOnKf2a2XCm+3ghuc1AvzOdwmLSwIwkQlBoxMtgZYCkvwQLafBYo0l2v6gBcCxRxQyifwM9PckRCniXIGbjo8wiI4bgnRRFul0XAZMABbaggVoytvo12vff7Qt/Rc8LqBm5jQndrBr3MFHOwyemaJbGaaAKzMp00zV2O+6VVnSTCPcYCNdrItEGAOcKxpVUQKLjPZ6VHVgEuf3Kf/rLk0Y4ViTpiAEUYKJaEgVDg2OTq1+j3r5w68FHi7TXFDU/El1Yr8VLudDM4IjUpLVWW2Mg0GgubybATNfN/0C5+eqjQ9oO0ngAmR0ZF5X2bKjLRZBUFgNE03AKhcPqk62wJsm+qjvyM4Aa0idFN1zcmvHraq90uvObihqej4YsH6nzCEyHwRB0WFZeZJ05xupsZSp6sty+2mXX2a/5rP0fT8MAHRZpmWph48J38zi6xUF1Vqft9KAg2BES6PmyChGGFTBVJ1kb/dq7XeeuTBs0deLLxXrLhHn2nP6+4s3Gk7Yl6Q5mpZMMjAGWjT0o+dgkR6BVnUzJSW2PpzhpHVqIygdPiEET3rzwiHP2QCSlrjUm1epE0el+R1/E6SmjDa2nGEat5Bu9089bC9O7/1moDT0GJkMv5eR6f1oVY7MRfjp2SiNgOO5pkFBpnkadmD/qflRrAtiUrBhJFdPnauJhI6SU6noXSyb2BmUZUqzYKEqSSSZ6SUSU34WagYVUsg9N27R7DtkONWrmRcf8HHK1Lc4EjrqHJn6ZdxBIsXkXU2MqVZqU/ja5ZU/MyWR5/Bps1/wfD2p+G7TUy1QziWRHfZgVXsREd3H1YtnoW+vl709nSjv7f0V4MwPnRaRUGlxSm8rG7N0pAMlim/CE4Jk+tRbTxmAoYK4Qit/Mhb9/a9eze9ILW/YQwv5jvmM/fcs720YMnMDeWStabtJrmVUVaqtsy3sRqgAm+96yH85qbb4DZqWNjfi57uHlRKJViWjSCM0Wr5aDRaqDebqDeaqLkRLFugp7OIQudMrFn+JvT3z8Ee8+dgVldxp+tkpUB42ZZgqLrEnyUq89MkODkunjVVoREFMao5G367een6lZ2fejEQXrbiBgbbn+qZUbyETcWs2KZ/Ynsoi6aMgEPjLVz6Xz/B1OjT2P8tyzB7Zm/i6IMQYRghDGk2ielkLaKIPiiM4PshGk0XzWYDU40a6m6Ickmi3N2Lt+y1B5a+eQ+sXLIQM7rLxi1QiR47I2l3xPizFFyitsQnmqhq8juNks1go2BrDRG4WwMv3veItT1TLwTvZYH7w0NP9y7sn3NPqSgXMiCYRuNz1MbE9eEnRnDhpVdh1fxu7L1iCYIwghcECKMYUfaMY4Rh8jogxJgQNQjP+CECpUK4H8bwPR8tgmzW0Ao8lEsW+vrn4sA1S7Fs2VKsXDIP1UrO3BymMD7PEwvj6wJjnjTTJFAEsUJOJj4y8iMUWIfE8bp1Kzs2virgtg23PtHTV7os9JI0wASFNPWg4vI54LGBMZz/je/i71YvQv/sWXA9D2EYIooiAzCOYoRxDM/z4Xo+PC+Az2MR31NpkU4fpKGUQKRkoiSCjCSiSCAKVPLddgON9hQsK0TXjA7su3YVDjt0Hdbu82ZzbQYgVZb6OJOW0GQjZW54XtACInTkHXjt5kXr9+r4zG4Hd/bZZ8uTTz1rY7liHxiHiR9h+sFAQHNxJMulCGed/x2jtHlv6ofruogILaZpEl6MIAiML2u1XQRhaIDxeKZGqoEAObgoTkBGkUp7bvRRfC0QRpZRkYqk6SjHcYDQryNXVNj/oLX4yIc/iMULZyVVSFr0GxVmlQWDg0xSFG5j372rV1fXr1wpdhldX7Kpbn2mtbqrs7jRkqLIC6VDzgIBwZUKwGXfuwFjA49g331WoO26CSwDh/BieK6HyakaPM9LTZbv0WQJL0r2o9ioMkhN2gDka0JkDhYpExW1FtCQEMKGlg6gbWhTxjPFaKBvZgUfP/njOHz9WrRS5QXG9AkvzeXoHxXrVw0n9puxEm8+dGVlaFeqe8ngBifiT1Y65aUha7+0+M7Sj0IeeOixYXznO1fiHQfvY1REs4wiBoIAcRQZkBOTk/B9P1GSCRBBoraQn/dTmDxOiATGLV+nioxjA49wINjAY4YtIaQFwX1hQYtkn/AtW+Okfzsdf/+OA9H2Uj+XdoiZltBebaGh2a9DrONYvfdtK8q/2L3gaurXxaI4WqUJJH2ETTPltVsaX73wvzG7IjGrrwce4RhoieKCMMDY+LiBZ2AwGJjAQKg0Sx6jCrWBmQAlTJo3vx+ZvIvOXLBEEAJCMPFNQrkBBwnNfcuGMFAFlIqRyxdw+he/gv1WL0PDTftzSicd41jBYaURa/SUHLTrjc+vX9mxy47JS1LcpoGB4qKOuZvzebFMpyUPT0BoTD023P0wfvWL67DfPsvhut4O80z8Woip+hQma41UWVQRDMwEXIQ43Se4OApSYEAYeAijwADSmp1RghPGt3Kb5MMJxEx9VJ2QNu8mYNlQUYj+hUtx9nnnolIpw83KrrSSMOCURmfOQejWr37bis6P7DbFba/ptZal77SlyPFy6WC5ZedBKYWLLrkKs6oOCvl8AoR+zWwjeL6L4dFRuJ5CEGpTsEeBQBD4iFWMWEWIwjpU6Ca+kNswNll+zCgECSkcKM02CQtS/nK0oxPDFDzRIYFSfYRIcFRfzgDktRz7z5/E8Scci7ar0g4xc0aePen0VaSAiLxHutVTe6/cRfn1khQ3OBEdU6xYv4oZbzjJopJISrX96aFtuOaH12D5ogXw/QABVZQFhCDC5NQ4xienEIQCbijh+RKTvXPhVYrIPTGAXLOOOJ4AwhAxzTKomTTEdHy1l/guc5voWTmXSPWFSVAwf7FRH83YuD5jxgQooS3HqE9Bomf2fJx9wcXo7KjAp3swLSZApjPeJUvDioLBkttYvHZtf/v5VPeSwD09Fp9Z7pDnEhzvD1MEqo2d2ut+swEPbr4fM3p7jIqYbhjlBKHxdcMjQ0ZtXmjDbSsMLFqJx048AWDWv/kvWPjNy2DXB5hXAHEIpZqwZNVct1INSFkyoJRyE1g6hjaFnp2IDyrxezqFaMClHQdjsjljsrzuk8/4Cg46ZF9zPQYc05k0qpYswFH+uCW9VYcsm7F994CbiL5fKlkf4lyC1nSswnRlWcBfftVP0RgZRqGQR2jKKd/4JZrpxOQExicmEIQWvDCHhu9gyz99FN76VQCt0AZmnnUxSg/cAUuGEKoJaBdSZjVpBCk7EnDahxRlKHCfjbccNPMis29mWSGMH6TqNKQxWStJVayccQvrjv4ATj7lRLTcpL1k2kym0GUJJlASvuvo6JADV3RtfsngbtXa3gsoBA3k3Rakb8GtiuiaUtk+xveUqRjoU9gmKuYFLr/yGkwMjSBH5xrQ4dNPBaYiGBwehOu24QUCXuhgSnTjsTPOQDxvRjqjrNB31tdRfvwB5O0cEI9BaA9SVhCpGqA56+NAa/oIC5AER2XlmfdDhT60FLBoxlYAof0UnjLukAo1arPyxhev2vcAnHbWOSaJNmWe6elRCAm4TukrS0XvOGivrt+9aHDba8GaQt56r4A8XADztYIVKgimXH6M7iDUebackzJLIm8LlIsSP/jRz/HU1ieQcywDLnHwAWq1BsbGR5M6lYrzJEZmLsHw5z8LlOm0AWwfQ885X0Ol/oypHRFPwpZF2FYXwngEgoBEHpEaNwpTyJsqROsCgupMtFeshLt8Oap/ug8d998CKQgvgICfRFppm/QEBAdg1oIlOOMrF6BcLsAPlCnHIjPvClQcgW4nhFThPxy8ovPXLwjugaGh8uxyzwXlvPOxsoPC9PUaZpYoLZobHtAMtAEhoVDKSXSUHdy+YSN+d9MGFKm4NK0gwKHhUTSaNZPL+ZEFzwXGVrwNk6edlkDjHMLmrei78DzkLR8W18qoEUiRgxR5xKoJ2+ox4EJVh5B9UDqPel8vWgccAW/Naug5Myk84OkJzDn3FOTbIwacFASXJMSC/XOZhxISHTP6ceZ5F6GzuxNekEb5IKlIOvISvU7AhPiog5ZVbtgluE0DurigHPx4RnfunXQXbNJm8wEZQAYCphDs99c9YMqDKbALtjJNyNGRQVx++dWwtDA5GHMyz/ewfXAYntdE4AfwjFkINHsXY+JzXwPmdptGXunKH6D79uuRzxVhqwBKDSFnzTTRNIrHIQXz+RAxTVF1obFqPcY/ehLQVU2CLG+AApwNGzHjR99GTk0Bqg0pvCQ9sRxIY6o5aGmjWOnCmed/A70zZ8INmCpxbGwoAF0Fgd5cEBVkfNj+Szvu2CW4rUPumTN6C+faCijwxqTTeNmXssV+bM1w9oiqm2wToELgt1AtSHQULVxzzU/w5/u2mKUMcRCg3W7hmeFhBF4rKaPY6WDGJDrQnrcUrdX7wRkcQuXe22HHU7CFgDT+zE/AKR9au7CsPkSqAWWiaieG3nkCvPe9G+DSGQrqwUdRuHUjylvvQS4ahaObELoBAVqFSCsJzto4Jkg4OQdn/sd/ord/Plw/MtAIj5Y1oywxq+DXrThae8CKzq3PC+6ux4dndRZ67uut2nM68sn6jWxtx/QvZebKiWKCq7WAmtm2IZSPGR0FjI9uxxVXfB+tqTokYgNu++AQVOSZ1EErunSWRBXTyYASkLIAbdGnMBhI6Lhu5COlA61Ck39JUTHRVAtO73ej0TMbEyeeBj1vjlGauP8RVL7/A+SDQdiowVF1SN02UVaa2fAkl2NU5TNnC5z+5QswY/5iuG4EN1KmhtWxwNwuBws7w+G85S1ftaBr8nnB3f1Y8/hqtfzDzhzQU0qm0v4WOLam6ecIjl2GWhuYaFF5IcamJtFZtNDX4WDzvZvxv9dej9BzoaIIo+Oj0FEAzSxfhyYSa50W5iAU20RNafIuwmol/k0yGPAGJJ0OZSJqHkqWEcU22vPegua/nAR0dxvVWZv+iI6fXomcrsNRDWhNU9UmAWZoVVYOgsFBOCjlLXzqjC+ia+6eaHsRmp5GMScxu8NCf4eF7qKIRBQ8mnfkz4PQ/83SuX/d2BSbHmne3Fktv72vDHQUEsWxGnjuIwPH3hf93FQbGKnTXDUeGhiCFDFmVHPoKlu49dYN+O1vb4alYozXpqBjggvNBHDyYIHDhJVQ+IiSYolFuXHqBQhGT+VCWiUTGaOYQIuIhYWQ34tLcBeugH/ch4DuXmBkEJXvXoB8ewwWXGiT77GWSBoA9G9cKBcLB92dFZx02umI8r0m9Vszv4QVsx10FYUZu7GuNHeuN1XkB9FN7Xbwmb0XVh/KuIhNWwOvs2Tn+6rCZAecITezU9PWc5i0Ml0JZKbfwsTHDU0Bky6wYcs20w7qrThGeaW8xJ0bN+HW2+5Eo9k0lQT9jWkEMVHl2dnhoNp4VLBc4uI4JrKRAcgEO7HDXFLQE64oGNz0k0pUkvUhCxZDrz4A4tEHkXvwLtgihNSJa0gEQNfAXp0NZTnGVSxeuADHHHcCpJXD+9f0YcUc2zRgn6sXnr9O3yeBlqeGJyfDE1cvKlxvkuvfP6512QF6y8kCFwYHllHZsgSezAwh7ZhyPIRHH/fMJDDWAn72x8dQb7XRVbZNoKgWLBRyAvfe/wBuuf0u1CYnIWVaQ9K5pRMrdNw8v5khM2rjZ2iYVGJWfxJunJbwBGjm0kx6ohj/zQpryyS82lKQpopgI0AnLodmaop9C4rVAwTWH3wgluy9Fh/cbxbWLSqa6idbJfpcS3PNupNkQnuioVrDk976I1eV7xW3b2lvL5eKczoLQKWQrIqk6rIeWwYuWw1kymwFTLaAgQlgsK5xxa1bUGu66ChYqOSpXMss4Ms5EtsGnsatGzahMTaWhutsLWsaug2s7F5nix7S/CKZ/08L+7RlZMqpDJ4hk62JShWbLj805Ve2II9zlCbJQqW7C/sftA4HrZiPUw/vRweD7S7A0a/XXW1SsLYSeGpIbxiZeOpIccufG8dVOys/5r2o5JNVQaw9WUrxhDRbk46k62/5moobbySKu397gK/9ZgsKFlDNSZQJzhHI2xKOJVDISTRbbfzpwS0YePxxxL73rJzNwNJZ62yG2dzydNlOUqVnK4PTdpKRWLqfLe/JPpO9nuZnTFRNyFj5Apbtswr5rpn4wpELcPiyqhHKrhTHsTJ4TLnCWNdgA3Dr/lHiuo2j1XJf7x2VvNiHTbZyBs9OA8U02zcTMjKJrsNTwEgT+NE9ow9864Ytt/dVZVDNW6LsSBT5XUsgZ7P7L5BzbDPX+qeHH8HAlr+YZQeJjSWpwk4P2pdhk05mcHfHa3YyzXKa9GD6mez9hOiOhHjHwjzzOzZ65s3B/D2XolSt7nnh+5a9a0mfZcZLkTz3MrJronVxoQ+ziPEWsL3GXDZ60NjIr/6sjynk8EsHEPRxDBK8E1ztw+k+njhHFTqJCTMl4Qm21eDd/KR7+NePLt35fPnO/8fj592ljz5sPn49rwBUC4mF0bqmp2HZMguKhOC4kpPpF8fNgLEjkPzyz/qzjo3zcwKSyqOfy2avePKuNHgwUjEB3j4FbB1R973/3zfsh9ten/+nerk35RM36MPfswdu2qMDoqOY9BO59jhb6zJdbVneyhSMixPpnphR7BSBr3tAf9i2cH45j9k0Dy58Zreitwr0dSRK5J0YbwJDLfo39eWTDrTOebkDeL2+13e5nnPZfrh/UTdmVvOJb6fq6OsIzziK9H8lCI6RldtMcX46ZbDT9V//oJ6fAz4iBI7VMfYp5SBmEFw1uTNcezFcB56YQPv329qHfPXo8n2vF4BX8rsXbdS/WD0L72ZThfA4NrqiLIdlMGSfjtBYn1Nx9HH1wDQ7Nj9v6/zGB3S5HWCvUlFfvWiGWMYFQpQzzXSoAfxlWD1w0X1y33tPEkyy33CPk6/TBx8yF7f05pDjuIrOzuaaVUoExxKT43a5akFCtVys3+Wcwweu1dbHV+LxN3VhPsEx8jANGfOAh4eiL5x0iHPeG47YtAv+9I3xp9f0yIvLDAw6ySIY/ExSnpkqVcels/x/syLgtXHpx9bhlF2CO/tanVuzHHfPqmJVOf0nNdr5SFP7D02Eb/3iEfkdtdsbFeCXbtYfXlDGueU85iKZsjXZklnpyZdpGmgWFcS4pGsQnzvuOBG/4CzXFX/Qp+zZi28pPzkZHeNIS337X2+Qp+IckWajb1RsyXWffqOeN8tRH+rKyWOhsSBnYyYziiCAa0k8EQKb2kF01acPc3akXS8IbsW1Onf6AnVib16ewqWz21vq9qu2yNPeqL7thW7xZ65391jcV1jE/1qKFcaeCfDwOYeK9D83nv32/wHzrWgvjJ8Q7AAAAABJRU5ErkJggg==",Ut=({dataSource:Ui=[],img:an,imgWidth:vi=346,title:di,sunTitle:xn,bannerExtraContent:en})=>pt.createElement("div",{className:_t.banner},pt.createElement("div",{className:_t.content},pt.createElement("aside",null,pt.createElement("p",null,pt.createElement("b",null,di),pt.createElement("span",null,xn)),Ui.length>0&&pt.createElement("div",{className:_t.btns},Ui.map((hn,Vi)=>pt.createElement("div",{key:Vi,onClick:hn.click},hn.name,hn.sign?pt.createElement("img",{src:ce,width:39}):null))),en),an&&pt.createElement("img",{style:{marginTop:33,marginRight:38},src:an,width:vi}))),fe={flex_box_center:"flex_box_center___hG6RI",flex_space_between:"flex_space_between___ss3Fh",flex_box_vertical_center:"flex_box_vertical_center___K80p9",flex_box_center_end:"flex_box_center_end___qmXX3",flex_box_column:"flex_box_column___GFV8F",row:"row___aXJjm",title:"title___HUKL0",tagsWrap:"tagsWrap___XB2W3",action:"action___VdHb1",bar:"bar___t1kKC",tag:"tag___V7Eft",name:"name___Hk1Ip",num:"num___xQpcH",active:"active___XryTX",tagsBorderWrap:"tagsBorderWrap___OMxjs"},$t=Mt(92310),Ae=Mt.n($t),re=Mt(89392),de=({dataSource:Ui=[],value:an,onChange:vi,onTitleChange:di,className:xn,title:en,titleWidth:hn=41,style:Vi={},fontColor:zi="#6A7283",showCount:ur})=>{const[Vn,$n]=(0,pt.useState)(1),[Xe,mi]=(0,pt.useState)(!1),fn=(0,pt.useRef)(null),On=(0,pt.useRef)(null);return(0,pt.useEffect)(()=>{var Gn;Ui.length!==0&&(((Gn=fn==null?void 0:fn.current)==null?void 0:Gn.clientHeight)>97?$n(1):$n(0)),Ui.length===0&&$n(0),mi(!1)},[Ui]),pt.createElement("div",{className:Ae()(fe.row,xn,"fadeIn","animated"),style:Vi},pt.createElement("div",{onClick:(0,re.throttle)(()=>di==null?void 0:di(),2e3),style:{width:hn,marginTop:Xe?12:4},className:`${fe.title} ${di?"current":""}`},en),pt.createElement("div",{className:Xe?`${fe.tagsWrap} ${fe.tagsBorderWrap}`:fe.tagsWrap},pt.createElement("div",{className:fe.bar,ref:On,style:Vn>0?{height:Vn===1?97:"auto",overflow:Vn===1?"hidden":"auto",paddingRight:55}:{paddingRight:0}},pt.createElement("div",{className:fe.tag,ref:fn},Ui==null?void 0:Ui.map(Gn=>pt.createElement("span",{onClick:()=>vi(Gn.id),key:Gn.id,style:{color:zi},className:an===Gn.id?fe.active:""},pt.createElement("span",{title:Gn.name,className:fe.name},Gn.name),!!ur&&pt.createElement("span",{className:fe.num},Gn.count))))),!!Vn&&pt.createElement(pt.Fragment,null,Vn===1?pt.createElement("div",{onClick:()=>{var Gn;$n(2),((Gn=fn==null?void 0:fn.current)==null?void 0:Gn.clientHeight)>245?mi(!0):mi(!1)},className:fe.action},"\u5C55\u5F00",pt.createElement("i",{style:{transform:"translateY(1px) scale(0.6)"},className:"iconfont icon-zhankai4"})):pt.createElement("div",{onClick:()=>{On.current.scrollTop=0,$n(1),mi(!1)},className:fe.action},"\u6536\u8D77",pt.createElement("i",{style:{transform:"translateY(0px) scale(0.6)"},className:"iconfont icon-shouqi3"})))))},zt={flex_box_center:"flex_box_center___aK2n3",flex_space_between:"flex_space_between___HX0Oh",flex_box_vertical_center:"flex_box_vertical_center___LJOJr",flex_box_center_end:"flex_box_center_end___SCakF",flex_box_column:"flex_box_column___AYv4m",tabs:"tabs___GTqPV",active:"active___F26E8"},ue=({dataSource:Ui=[],value:an,onChange:vi,className:di,style:xn={}})=>pt.createElement("div",{style:xn,className:Ae()(zt.tabs,di)},Ui.map(en=>pt.createElement("span",{onClick:()=>vi(en.id),className:an===en.id?zt.active:"",key:en.id},en.name))),qt={flex_box_center:"flex_box_center___yX6Oa",flex_space_between:"flex_space_between___t7oqF",flex_box_vertical_center:"flex_box_vertical_center___dEIHy",flex_box_center_end:"flex_box_center_end___taQDF",flex_box_column:"flex_box_column___xY_Lr",input:"input___PW2zI",dropdown:"dropdown___vSy8B",menu:"menu___NiyBu",text:"text___Grueu",b1:"b1___ZKryM",b2:"b2___aKyGa"},Qt=Mt(37568),Pe=({dataSource:Ui=[],value:an="",onChange:vi,onInputChange:di=()=>{},className:xn,style:en={},placeholder:hn,allowClear:Vi=!1})=>{var zi;const[ur,Vn]=(0,pt.useState)(""),[$n,Xe]=(0,pt.useState)("");(0,pt.useEffect)(()=>{var On;let Gn=an;(On=JSON.stringify(an))!=null&&On.includes("{")&&(Vn(an.id),Gn=an.value||"");try{Xe(decodeURIComponent(Gn||""))}catch(It){Xe(decodeURIComponent(Gn||""))}},[an]);const mi=()=>{vi(encodeURIComponent($n),ur||null)},fn=On=>{On!==ur&&(Vn(On),vi(encodeURIComponent($n),On))};return pt.createElement("div",{className:Ae()(qt.input,xn),style:en},!!Ui.length&&pt.createElement("div",{className:qt.dropdown},pt.createElement("div",{className:qt.text},(zi=Ui.find(On=>On.id===ur))==null?void 0:zi.name,pt.createElement("i",{className:"iconfont icon-zhankai4"}),pt.createElement("b",{className:qt.b1}),pt.createElement("b",{className:qt.b2})),pt.createElement("div",{className:qt.menu},Ui.map((On,Gn)=>pt.createElement("div",{key:Gn,onClick:()=>fn(On.id)},On.name)))),pt.createElement(Qt.default,{onPressEnter:mi,value:$n,onChange:On=>{Xe(On.target.value),di(encodeURIComponent(On.target.value),ur||null)},placeholder:hn,variant:"borderless",allowClear:Vi,onClear:()=>vi("",ur||null)}),pt.createElement("i",{onClick:mi,className:"iconfont icon-sousuo9 font14 current"}))},je={flex_box_center:"flex_box_center___tol8o",flex_space_between:"flex_space_between___Z235C",flex_box_vertical_center:"flex_box_vertical_center___Wq1sZ",flex_box_center_end:"flex_box_center_end___LLxom",flex_box_column:"flex_box_column___DbMSN",quickPager:"quickPager___GM30J",disabled:"disabled___Ozc8I"},Yt=({value:Ui,onChange:an,className:vi,total:di,pageSize:xn,style:en={}})=>{const hn=Ui<2,Vi=Ui>=Math.ceil(di/xn);return di<=xn?pt.createElement(pt.Fragment,null):pt.createElement("div",{className:Ae()(je.quickPager,vi),style:en},pt.createElement("div",{onClick:()=>{hn||an(Ui-1,"prev")},className:hn?je.disabled:""},"\u4E0A\u4E00\u9875"),pt.createElement("div",{onClick:()=>{Vi||an(Ui+1,"next")},className:Vi?je.disabled:""},"\u4E0B\u4E00\u9875"))},Vt={flex_box_center:"flex_box_center___FO7TP",flex_space_between:"flex_space_between___LotYx",flex_box_vertical_center:"flex_box_vertical_center___bWdaw",flex_box_center_end:"flex_box_center_end___mVJ1o",flex_box_column:"flex_box_column___M83Mm",list:"list___oOsiS",wrap:"wrap___G6T7F",lockWrap:"lockWrap___Rl79E",li:"li___oZZ7l",cover:"cover___b2bYW",img:"img___IQX7w",sign:"sign___HkT6C",name:"name___SsJx8",e:"e___TMqq0",tags:"tags___bcjyo",rate:"rate___YACg7"},pe=Mt(29787),Xt=Mt(25399),Le=Mt(58018),Wt=Mt(78323),Ce=Mt(63949),Te=Mt(96908),ne=Mt(57177),Re=Mt(81378),ye=Mt(13922),Ai=({className:Ui,dataSource:an=[],col:vi=4,right:di,bottom:xn=23,precision:en=0,wrapWidth:hn=1200,trackEventItems:Vi,loading:zi})=>{const ur=Math.floor((hn-(vi-1)*di)/vi);return pt.createElement(pe.Z,{spinning:zi},pt.createElement("div",{className:Ae()(Vt.list,Ui)},!!an.length&&an.map((Vn,$n)=>{const{name:Xe,id:mi,identifier:fn,power:On,cover_image_id:Gn,pic:It}=Vn;return pt.createElement("div",{className:Vt.wrap,key:mi,style:{width:ur,marginRight:(1+$n)%vi===0?0:di+en,marginBottom:xn}},pt.createElement("a",{target:"_blank",href:`/shixuns/${fn}/challenges`,className:Vt.li,onClick:se=>{se.preventDefault(),Vi&&(0,Ce.L9)([Vi]),On&&(0,Ce.xg)(`/shixuns/${fn}/challenges`)}},pt.createElement("div",{className:Vt.img},pt.createElement("img",{className:Vt.cover,src:`${It}`}),Vn.is_jupyter&&pt.createElement("img",{className:Vt.sign,src:Te}),Vn.is_jupyter_lab&&pt.createElement("img",{className:Vt.sign,src:ne}),Vn.is_unity_3d&&pt.createElement("img",{className:Vt.sign,src:Re})),pt.createElement("div",{className:Vt.name},pt.createElement(Xt.Z,{title:Xe||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"},pt.createElement("span",{className:Vt.e},Xe||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"))),pt.createElement("div",{className:Vt.tags},pt.createElement(Xt.Z,{placement:"bottom",title:"\u5173\u5361\u6570"},pt.createElement("span",null,pt.createElement("i",{className:"iconfont icon-shixunguanqia font14 mr2"}),pt.createElement("span",null,Vn.challenges_count))),!!Vn.myshixuns_count&&pt.createElement(Xt.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},pt.createElement("span",null,pt.createElement("i",{className:"iconfont icon-chengyuan font14 mr2"}),pt.createElement("span",null,Vn.myshixuns_count))),pt.createElement(Xt.Z,{placement:"bottom",title:"\u96BE\u5EA6\u7B49\u7EA7"},pt.createElement("span",null,pt.createElement("span",null,Vn.level))),pt.createElement("div",{className:Vt.rate},pt.createElement(Le.Z,{allowHalf:!0,disabled:!0,defaultValue:Vn.score_info}),pt.createElement("span",null,"\xA0",Vn.score_info?`${Vn.score_info}\u5206`:"5\u5206")))),!On&&pt.createElement("div",{className:Vt.lockWrap},pt.createElement("img",{src:`${Wt.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),pt.createElement("span",{className:"mt15 font16 c-white"},"\u5B9A\u5411\u5F00\u653E\u5185\u5BB9\uFF0C\u9700\u8981\u6388\u6743")))}),!an.length&&pt.createElement(ye.Z,null)))},yi=Mt(47140),gi={flex_box_center:"flex_box_center___eMcr7",flex_space_between:"flex_space_between___HcNca",flex_box_vertical_center:"flex_box_vertical_center___ZnvVN",flex_box_center_end:"flex_box_center_end___fdgDf",flex_box_column:"flex_box_column___SEKvd",list:"list___L1hmU",wrap:"wrap___pKgcW",lockWrap:"lockWrap___SMhkK",top:"top___udHSB",sign:"sign___uwRpq",name:"name___Fpf90",img:"img___AMLhL",text:"text___KiTb7",btns:"btns___i6IuZ",bottom:"bottom____k2sh"},oi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXWmQXFd1/s59r3t6nX00o93GluV9AQNxiAkIB0OMISFsFQqSAhOohFR+JKmEQPILClJZfpEfIUAChFQSHIJxnGDiDYwsb8KRLUuWZcmSxqN9pJF6nV7eSZ373u1509Mzvd2eGVt6VV2z9Ht3+9459+yX8Bq4mDmWK2GLqla3MvFWZt4KpjVMSBNzGoQ0M6WJkJbpMiNDxBkwMkyUIUYGxCeJaB8x7fMcZ18yiv1EVHy1Lw+9GicwO8tXlSrlbSB6O4HfANAmZlY250JEHsBHGLQTzA9H3chDfX2012Yfy9HWqwJgZh7NF6vvY/a2gWkbgyeWY3Hq+yDQcRA/RKQeSsSce4jo9EqMo50+Vy3AzNxXKFTv9MAfB/AuZo60M7Fe30tEZQA/UqBvx+POvUQ02+s+O2l/1QGcy5Xe6Cn1SXj8YYAHO5nU8j9DM1D0b8rzvpFMRp9a/v4X73HVAJwplN9GHj7P4NtW0wK1OxYCPcAKX0rHI4+0+2wv7l9xgHPFyrs9j78A5l/sxQRXrE2ix5SiLyZj7v+s2BgArBjA+XzpzR7oq8x880ouQK/7JqKnFfiziUT0iV731aj9ZQeYmYez+fJXiOguZl72/ldkkYmYmb+eSkT+lIjOLOcYlm2BBcx8sfoJz+O/BHhkOSe5evqiaaXoTxIx55tExMsxrmUBOJ/njVVUvgvmW5djUqu+D6JHHbgfTSRostdj7TnAuWLlDq/K37pwqXYxCGlaOfRbyZh7Xy9B7hnAzOzmCpUvA/jDC2WvbReogE3/TTLufo6IKu0+38r9PQE4n+f1VVS+B+ZbWhnEBX8P0Q4H7gcTCZqyvRbWARZHQLlavp8ZG20P9rXcHhEmI07kdtsODasA5/OlX6gy/dfF/bbTV5GmHeL3JBLRxzttof45awCLRYo9vpuZE7YGdyG2Q0R5UvQBWxYwKwBn8pWPEPg7IlhdiKDYnrMIXAz6WDrh/mu3bXcNcEC5P7wIbrdQzH9eQCZF7+2WkrsCWPZcD/TgRbZsF1zTmrBrBX5HN3tyxwD7YTOVRy8KVL0Bd65Vmo667q2dStcdASx6rofyjouqUK/B9dsXFUohcksnenLbAMtemy1UfnrRiLE84NZ6IdqRirtvbdfi1TbA2Xz5r5j5j5Z5ehe705RMf51KRP64ncVoC2BxHLDH9/batlz2gJPnFc7PArNVgvjViABH6Zhm/ZErQoxkH7AmxYhHlsX71s7aWr9XbNek6M52HBQtA6xdflx5pldCVaEMHDuvcK5A8AjI5oB8EShXgEoZKFeBSgVQCohEgKjr/4z3AUP9gCIg7jLWpBn9fa9lsMXa5d7UqquxJYCFYrOFyk964c8V4F44oVCsEs5lgfNZIJcHPMFIk27wU0sbof/V0UcyBgz2AyMDQDQCbBzwXrtAEz2airu/3ErQQEsA5wqVT3qe93WbPKfqAS+eUsiWCWdmgJPTQLVaB2gjw6oB3U9B0azbsGz5XV6KsWFg01pAzGqXjniIua89ilZK3ZWMu99ohklTgP0YqsqLNlnz+SJh7ymF8xkf2JKEkFu+BOx1Y8CGNcBAH2P9gGe5h5VujqZTCfeKZjFeTQHO5EpfA/ApW9N5ZYYweU5h6jhwPlfHcpux5Ha/BxCLAldfBqSijMtHX2sg4x/SyejvLIXNkgAHoa07bEnNe48rnCkQDr8CFBokehh2q1ntIizYsOVG3y/g6AH7dl3gykuAvj4gAkahSihUCCVP9nryJfNgj1dguIrQ5wKJCCMZZaSjjOGEh6jV9LbuSUb2YAW+ZamQ3CUBzubLT9mKW95zTOFkhnDoqC8NL8clL0oqSYgnCSoCVIM92580axAjji+BuyqQ4RgQOq8wUKrK/0jv83Ilo8BQzMO6VBUDseWYQfM+JO46lYi8cbE7FwVYZxxUvf9u3kXzOyZnCIfPKuw/FAhSgcxTz3GbyFQLpOh6Ics877qE9AAQiZEGSyJUI6JGOT5VxlxocEWvdgTcAGQBUtQwWRTDTQTkYhXIlQnZElD2fMBjDmMizdjYX0VkhSlbOepXF/M6LQpwJl/ebiOd5FyR8PxxhQNHgGKP8+9EL04PKU2tAr5LjIQLJB0DJmswDbACpuP41KuBFYDlEwBsKFdz72ClZqvA2SJpI4yALc+PJ6rYPCDSevOXvSd3EG1PJyK/1KjthgBLIhg8frjbwYgq9MRhB5PHgXOZha01k5nq9d4FalEgowk4/UMKTp/fR59iJBX0nqkBo8ASpsGVPdYHVD7yuwY8uLcGcrAyNZCljbopZErAqQKhWPGB3pD2cEl/RUyK3S5d+88renujhLeGI8nmyv9rI8vv+aMKh6cJk8eC8Tbjye1Oi4BEkpDo91lxVDFSjghS/lVjuQZgMXc6DDdgxRrYEAWbl0GDHwC6FMBmuLkycKJAKFUJMQe4YriCwdjy6t6S1ZhKRn6l0TY37386Pxd4st21rr9fWNnTkw72HeyNnit7Z/+YAsn+CUbaBWJ68wzADbFZQ8GaJSuex6INy9ZCVmDvNkBLW2Y/DrPpxdbmTBGYLhCYCBvSVWzury4rNSvgTfX5yQsoOJMr/T2AJXWrVsDfeUThldOEoydbubu9e9wIYWBUFtJnxwPOHPuct28KyHWs1yHWVCsgCgULwAZkDXBA3ealaAdgmYWoXlNZ0vtzfx9wzUhZ97NM19fSyeinw33NA1jKJmTzlePdZtaL40Cod8+BQGq2OLtIFBgcVVrlSTiMtDPXeHgy+ndDgYFkrPfZEBUb9cgA7H8X7M/B3m0o17QXNLvkjGRsx/OkJW+R2q8erWjW3fuLZlIJdyJcTmIewPl85QNV9r7X7UD2nVTYd4wweXTplpoZNuqf7osB6WEFD4xBw5IbdFG/b8rfMlENoKZQn01rISvYg42qNPcSzLFneRH0FWL/razR6QLh7KxvNLl2tLwsUrZD6oOJhHu3Gd88gLP5skRH3tnK4Je6Z/tBBwenGkvOnbYtHqL+Nb5DeFgMFK2wPSNBB9gYdu2zaNZg14QsvZfPl6r1ixH+NFCfms3nfBk4lSdEXcK1Y2X0tTLuZo0u8T0R3ZtKRN67AGApVZQrVI52W81GDANPHnGw64XA5RcaTODsWbSswGJCthguhsYJHjNGWwXXEJ0BSChYfjdsGKzB05Qb/M/swWGVSb8MwbMycNNGeG9uhse5EnC6qLShRUAWga5Xl1T/ScbddabEU42CbbkEX55W2DtFONAg87WZltToBZAFHV4rbBkYiDASLSzOPLYUAtgA6APFvkFD2HQAvBikjSQt1C036BdAKDt4EbSEbQwjIQNIM8BEXz5fJu3Zunqkt7basCuxthbZfOm7zPjNZgNt9v3OSYWXpgjHpxf655sB3Kjt0XEhLyDpMvrrBZVGqmadXlDbPo3QFLJUacOJYuhce+NXDu4z0nRY0hbDiTgu6oWxZmsi30sXIniJk0NUKDGK9Ooiwr+kEtGPhsQGCZEpH7NRQc7sv9PnlgzA0HNrZslKpgnxftKq0FCHZkAjYEl/AkxNWBKngo4aYWxdR7h8Qr5f3AJVKDF2H/FNnZHASSHgmz26FbCkv6kcoQrCVaMVpHsUiCAV+VLJyNoawEHtxz2tDLLZPT894OClI37oTTeXcoHRCaUdBbLvLrH2S3YzT481+CrA84CKJ2oc49feRHA1T176+vlBT8eGxSJ+PJgxc7ZjmRQ9+WiOEHMJ142WemYIibqRqyVYXs8qkyv9HoCvNptgK98/+rKD3S8CxVIrdy9+z8ioguoDBiOMePO1X9hQ6JkwFcuNQkns+UaJSpnx4V8iOC28QY+/6KFSBeIxaJVHuxoDo0k7sz1bIpwrETalq5hI9oxVfzadjP6dD3C+/B9gfn87g1zs3u2HHDz9/CIGjmY8OWhUjBlD4wpR8lWijq6wcyD4XW/ZQTBfqeJHbM5WGB9/W2sA/2yvp6k+0Qckoj6rNlaxdsYoe/8reV/6u3GsBKcdFtBqR0T/kU5EPqABzuZLLzPjklafXeq+n73s4JkXgFIXFDw2IdIMMBbh1vTdRgOqM0roNQwiN8TLpcEtC6dhfPK25gCLivbALtZUm4wDcQFYjCQdbh/ioDg1q3TwwIaUfSomwqFUInqpVOiK5QqVnK16yz854OCFg/LSLBSi6nFopBaJnXlkgtBHjCEb9WVDDgPDmiVao6zBBUR4+sztPsAvHmU89KwvOMn+KuDJfhuLsLZ7y/8kPFc+ArDEZndCwWYdROAShnLjmjKUZSqWetfJuJuk7Cxfx5XyszaoV9rQQtYkMD3TWYsjYwQ3ThgV6u1k7w11G1aRTJy1sEfJnBAOU5DPLOOzd/gA//wA49+3+/ZoAU8C9hIxRqoPSCeAlAG3zwc+2uEebIaYKQPTswqbByoYj9t3L5IbuZ5s2Z/NoB9/WWH/FOHY6QZ6cIM45nAQnbQxsVHpSIzRaGcvSPgpAViANTZvEazEEWDYswB8+QTjnTdKGA7hbJbx7YeBM1mgT8CNCqjsAxuHTpOR/Ve+kxfA2LE7JT6zF8vLcs2wfeOH2KUpVyh/3vP4i90vp9/CnuMKe15pbMlqxqJF700PkdYPJSKjkyvs9dEB8SEjhuy9IgUbAeuWrcC1m+aziVKF8cOngJdPCKA8n3KjQFxYdjRwMYZiuToZqzxzukjIVwnXj5T1S2PzUoq+QNl86dvM+JithjNFwtOTCk8+17zFeqF6fK2CijLWRHyvTzeX5gwBBUs7QrkSzSl6rLDW224A1gws3snOA4xnXvapt541a0NHKOynm3FKQN+JosLGlIeJpKR22LuI8B3K5sr3M/id9pr19+Fn9/sJZK3mFkn/Gy5ROjpj1IJwpfdcAVhin4U1e6ISARMDwLbrhAqbv0FHzzCeeInR5wCpuL/v9sneKy9gyG/czdrJMEVlSrmErcN2UzwI9GPK5MuP2U7mfmZS4YVX/Bjo8LWUGizS85p1hGSdE7+txTP6bqAOCRVrlajqS83XbwbecJnOs2252fwsQ6hZ2pFMRtl/ayG3gamy5cYWufFkUYLwCTeNWbZsEe2gbK70LAPXdTvI8PPTeYKA/OTu4L9GQFzCXzgwAKSGFIYc7spnKtgZdUgAFvelsOZrNwE3X946sOH5VD3Gjn2sbdkxAdmCgBVuX9yJ58oKVw1XkLSY50zAc7IHWzNyhAf96AEH+yehpelWrjVjhGiSMBZlcR51fIUBFoFKqFcMGrddD1w63hnAMpgn93uQUCRRmbQU3aWKFJ5gvgKcLilc2l/FSMye0UOMHZTJlU/bzBw0Az+dIzx3TGHHLn8PbHZt2KSgHMZ4N+qRsVYFrFnSUWXfFYPGO28ELptYCHClyrjnCeCJF32Hxi1XAnfcLFLy/Hu37w0ADqxYhoprHqpmE1zie9HLjxUUxpNVLWzZu2iasvnyLDN3s6yLjuexgw4OHAUOmbjoJUa++RKlY5bFc9TxFQZY2HPZ/+RngXe/Hrh87UKAv79DTJDzA99Fwn7PG+ff+8huD/kS0C/6cNwXtsRUaSNiUnawyRxhKAZcNmBPHyaiUk8Bzs4SnplSePw5P5uwfgsOC12XvE7BdRgjXfDnmr3ZWKvEHBkAfMfrgS3rFgL8Z//M+gUQsIxrUSTmP//Q/Hsf2OXp+/qTvtokurCoSyaeuuOXMnjwlRwhFSVcMWRPktYA94pFmwnvO6EgyWdPPOdLtDUvf92KXHKZ7z3qxLEvL4oSyVli8uTEQckOrPgClrxYuSLjzpsJV6xfCPBf/AvrPVrAMi+gWKw+5/thatf9z3g4XwAGk0DaOBsCn7D2NNZnQrSJ+NG8H30pgpa9S7Po3ghZ4UE+dUjh+DnCzr3zSy6E77lsi9KpJ+0ArM2QoRIe2lsURGr4rkDfW5QtAu97E+HKBgDf97RIyHMAS5ti4br9pvkA3/e0h5k8MBAALGZM0Yd1THUQ01XLoOhAljteJN3ONRbjtbSQ1Qs1qf4NFIqS/fjISWDfoSDZuq6myqVbFGLi/zXSQJ3tPaxpSfvakCFxVAFXEEuV1nsFYDFJGndghZErAO+/hXDVhsZC1oPPAruP+C/LdZuBt1+3UMj6wROM0xnGQMKn4Hk26SDHycRxmQS2dijxaIEQUaQzIWxdWk2ylSbabFCirkim4akZ4NmXfBDCe/DlW5SOvdJOBpNxv0ijJiPfUKuxVA0lgY0jvgAkL4BsCcb+fOm4sNcOSCsYw6GTrL1P2gccfKTfmTxr27b8XwcAhCxcbdhTMCUsOgJcPWSRRRM9JqbKHzH49mYA2fheFuSpIw7OFYCn9wRhPQHKW7YqXdhsIsicr0VfBB2HKdgYMgyI8vKsHwLeek17Viobc2Jm7J1iZIq+AaRmp24zlMcXsoArLAJMoPutOxtaWbTnjymcLRB27YcOr5Vr6xWkY5Q3JedaMKCaMknyjfEQyXeyzwqFFivAnW/ojkJbGfdi92SLjJ0HWbsXta06FAjQChXLnCbzhOE+xusG7TkctLPBtruw1YU6lSHsP62QLQC7DwJrxhWqirFloI5FByjXtuTQPlsTpMrAb79t+anXzFWo+Me7WEd6yN4sTgmTEtMKwBL8d7ygsDZZxXqLhg7tLrTt8G8VYHPfoWmF4znC0TMKmSrwun5PmwH9sjfBj9CebGpVihnSWKlyReBTv9KhA7ndAS9y/z1PeugPoj5MOE+rEZe5ih/ZIUaOIYuJ49rhbztkp5P1kr10+wEXB2cIG/s9DPbNVa+rUYnZi4N4ZpGShTVLPctMAfjM7Z0BfOgE4+cHgfN5YP0ocOtVrbkS6+f5b9s9DKUCCTtg1SbdpdmazJT8tJZrR+xmIOqQHdtBd80ms9j3UtTkP3dHMBpnbOpnQ8C1MoXmOSMxi+QqUq2w+Ewe+My72gf4wV2Me570JV/tpPB8gH7/DmDNYHsS93d/4gNcs3QFOnIrtmrRgUWWuGmNPQm6FnQnC7ccxo5WgL/72QgqHuPGCV4ArBG05Kdmz2UgN+sDfDYL/O672wN4aprxt/fMpaEIECacdt0w8Ad3tgfwPz3kYbQfWk/WwQFBWG0zgEWNFwl6oA/YMmgT4CBsVhY+ky/fDebfaAWEXt7zyAEHR2YUbpjwEHfnDCI1cg4iNLQLMGDPYj48m2kfYKHeR3b7QpGoNgZg8TzJnv4XH5bvWgf5Hx/0MNLvmzLDADdzRuSrUqlH6XoeaxIWPUnhwHebqSvdvABTM8CDByLYMMDYPNA4jNQYLjQQs5J240dBtsuif/A4Y9+UgMFatRGAhTMUSqT39N/eBmwYaR3gbz7oYTQNDKR8Z4REf7TibZJojlmPcMOo9bzhudQVm8ln3QAsz37vWVez5zdvDAEc+tUALM53EbBmAoA//c72WPR9TzFePsma2kR/FR1cABbqPZ8nfPhWYP1wewCPpIHBNgAWs6qwZynWstWigUPWcV7ymd6HLaWPdgvwzikHe04oXD/uYbjBIXnzKLgInAsAvqtNNen+ZxiTp1mrNkJtYkcWwU24grT5628mrG0DYM2iDcChPXgpFi2hOjNlhcstq0cL0kcDQctKAni3AIv/9vu7I7rK683rF7LpBQAXgDMZ4BPvaI+CJc/o2FnW3iHRW8UTJHu7ULAIbe+5mTAx1DoFf+thD8MCcEjIMtV7Gq2JCXqX6gLXj5XbCgRstsYNE8BtlXBo1nkr3+84pPDSGQc3rfMwUkfFJq9XVCRh0YaCP/QWQryFUFjTv0RonJzxU1I0BSs/+kMoeCbruwvHW1SVJL/p7sdYAyxStE5Oa6ImCfWeLYlwVcF4wm7aSsMSDraKsLQCYLN7ciXgnr0RXQfrzZt4XtEWDXCdFC37sGQoXLe5dYr72R4PJ87DZ9GBkGUo+FweeMd1tGRgfHgOzx1mPH+E9f4rAGtX4hIAy94r3iOXCNePlawmni1ahMVn03bKKDUDsJXv/++4g+eOKlw55mHT4NwT2oMU6MEiaIkeLFQsku8Nl0jUhqScNAf68X0eTmXmwm8MixbOIJXof/kawmj/0u3kZhn7p4Bdh31hTbPn4IURgBfLPJR0lUyZsGWwiuG4RdXIP1upcRklWcKVtkuHgfc8xg/3RFGsspaoE0G2gzZ0BA59baoUVSnvmxoF5GyBtIVL9nJxRsglViqxb+uEMskUjPvClXwkPEe8P1pNEs9UYB0TKpb2MtKelA4O0l5M6SVxKMjeLWqWBOJJW8LujbNBUk8bxWsVKuJYIKTlqAGL0Rtm7ZYshGarlGErFNrKPScyhAdecrXA9cYNfhlgk60gYMii66C6or93SuSGRD4KSKUKaVYuFK9LFjoCJOv9Viq362zBIM9Xx2OJqTJg/aYt+SltSx+Vqm9OlMu0pdNLg7YkXlpKOwi7X6x+R1lYc9Yv43PDSFn7j+1eTUoZSme2ipHaGviuowq7TzgYTTJuWucLI8Yebfbi2QBUne8rlBscpCXgGoAFZDE8SByVpj5x64XSQOV7aVf2YT8x3P+ISVTUJ+nLpLqatvTBXAElS1smrSVc+9Ksg6mwU2afNY9YZs26H6X+Ph13PxNe+wWbjK1ywrYAFl/rAy9FcSoHbB5kbBllDZpJKtPpoKGUUJGEBSShNh35EQiopui3T30+0Pr0tKDAmc4hDgQ4kw1hgJW/dX9BrrGpVGteGOEAus0glMcUSgvXddHFSSukzZGXWXTqh9e5pXLCWtiyVBDcFsiywD960UVmlnDNuIe16YCKg2o5RjfWe7MAEQBsYrfmFSM1Vd5DZYRN8W8twAVCnGlT/5T4MX34g++gNtXwxN+rSz0EFfG0V6pW8HRu9lKUVFyCUuXuqhH75Rq0nNFqQXDNpi2V9LcFsLQjqtOPX3Qhhca3jjHWpX1nhA7eC1ixYd36b3koFCigIx39lai5B8Phrvr2IGHcsHbNBYLgwHDYkC6FGDows1Yhvu5QD2nTgCv7vtTFsl2Lo7bG7ZT01yBbOpTDJsiZWeDhgxEtSIlDQth1GBQTqFeLugx1HsSm+1uVsOPQWQ4B7r7TKngpwjU9arFhcxWF5yrBm1LFQQeGLcvzx/KEfIV0wtq1wz0sDE70WDoReUujtV5U0bN5rI5NkCUT75EDEQjYw3HGNeNz0nWAT8jP2KDnYMZm4o1ipswLop9eysgUqsUVbsdUs9NV36OMa0Z7w5bN7Do6VkfvxRYPxrIJsuzJ2w9HcCLrn4N07bicUGazh87bkvpXx3JySAhhPCkCVaV3bNk3bHR2MJZM0fbRdp0vW+Mnxeu055QDqTa1cRDYNMAd17TsdmyyX5+UksEl2eMJW4aqGLPpwG/EjLo92k7vxZYPp+x2Ieufl1NOdr7i4lxRLEuMSwcYo6mFZxzZ7te0J3vtzKwvTMk5iAMxxpXDlR4YMRrOoLvDKX3J0v7xsrYXW3Rl8T7tOen4xUIjrIWwsYSd/N1G4xXVSYA9UyRUPKkeC1w+WMVo74qL1g3D0vGy0upqciUu9XJIwN6+0w4OTit9rI2rWLsb1yQZ6b7OSxKbPkVHlvMLZ2ZJq23i55LDpzcNVrE26fV0r62ft7UDogMq7tkR77apWdqrMuPwjMLhGQdydqI2TijW8dZyVKzYjyWoT2zBi1URFtYrOrcOrq+I98ePwxbmLwYNOdlsfdrDaHx5D7/S62X7iHdf4OKNVa4804t6Hr0A2bQpOvPRjIOTOYWzRd/VOFel3a9ma8yYNcNJrQSir0zJ/RHJXY5D25BFOhYz5cpcNO2Qe1MiQQ1OxVg4ouaO09AzuWLlDvb4XlsHRi/3AklJ4POzCjkpyD0rjgmlvUQV5uBsYXHC+6BHHKF01npsqo+RtFCcrdv5yoHQpOjOZMy9r9W22gJYGs3my3/FzH/UagcX77O3AkT016lE5I/babFtgJnZzRYqP7VdHa+dQV+Q9xLtSMXdtxJRW+kPbQMc7MfrPZR3MGPjBbnYyzxpIkwqRG5JJGiq3a47Alg68YPlK4++2oSudhdo5e+n6ajr3ionqHQylo4B9im59Ase6EFmbhCi3slwLj4TXgEiyivwOxKJ6OOdrkxXAEun4nVij+VQS+sRRp1O6rXwnOy1pOi9yZj7P93Mp2uApfNMvvIRAn/nIsjdQDH3rIDLoI+lE+6/dtuiFYBDlHz3RXbdHSTClknRB7qlXDMKawCbPbnK9F8XBa9OQRYrFb+nmz23vmerABvpulwt339RhWoPZFGFIk7k9k6l5cV6sw6w0ZOrqHzvojGkRZCJdjhwP9iJntush54ALJ2KwJUrVL4M4A9frbbrZovX7fdiWwbwN8m4+7l2LVSt9t0zgM0AxEHhVflbF/flBbvjtHLot9pxHLQK6jxdupOH2n1GuxpR+S6Yb2332dfk/USPOnA/2qrLr5s16DkFm8EJm84Xq5/wPP7LC5eaaVop+pNEzPlmwJ67wa6lZ5cN4BDQw9l8+StEdNeFsjcLmMz89VQi8qdEdKYlZCzdtOwAm3EHIblfZeabLc1lVTYjccsK/NlEIvrESgxwxQAOCWHv9jz+Aph/cSUWoGd9Ej2mFH3RlkWq03GuOMBm4JLwRh4+z+DbOp3ManhOsvxY4UvpeOSR1TGe1TCK0BiC/OS7APoQwKHqHKtsoPOGQzMA/7sCvp5MRp9aTSNdNRRcvyhSTqJQqN7pgT8O4F3MvArC3uZGKdVsAPxIgb4djzv3EtHsagLWjGXVAhxeLCnxlC9W38fsbQPTNgZPrMRiSgU5ED9EpB5KxJx7iKjFkxlXYrR+n68KgOuXJ6ituQ1E2wj8eoA2McuxWPYuqbcM8BEG7QTzw1E38pBtR4C90S7e0qsS4AbsPJYrYYuqVrcy8VZm3gqmcSakiTkFQpqZ0kRIy7PMyBBxBowME2WJkQHxCSLaR0z7PMfZl4xiPxFdXaKvAAAADElEQVQVlwOEXvbx/3Bccpan8cseAAAAAElFTkSuQmCC",Bt=Mt(59301),ge=({className:Ui,dataSource:an=[],col:vi=4,right:di,bottom:xn=23,precision:en=0,wrapWidth:hn=1200,trackEventItems:Vi,loading:zi,handleVery:ur=()=>!0})=>{const Vn=Math.floor((hn-(vi-1)*di)/vi);return Bt.createElement(pe.Z,{spinning:zi},Bt.createElement("div",{className:Ae()(gi.list,Ui)},!!an.length&&an.map(($n,Xe)=>{const{subject_identifier:mi,id:fn,identifier:On,power:Gn}=$n,It=$n.is_public!=0&&$n.is_public;return Bt.createElement("div",{className:gi.wrap,key:fn,style:{width:Vn,marginRight:(1+Xe)%vi===0?0:di+en,marginBottom:xn}},Bt.createElement("a",{className:gi.li,onClick:se=>{se.preventDefault(),ur($n==null?void 0:$n.first_category_url)&&(Vi&&(0,Ce.L9)([Vi]),(0,Ce.xg)($n.first_category_url))}},Bt.createElement("div",{className:gi.top},Bt.createElement(Xt.Z,{title:$n.name},Bt.createElement("div",{className:gi.name},$n.name)),Bt.createElement("img",{className:gi.img,src:Wt.Z.IMG_SERVER+"/images/"+$n.avatar_url}),Bt.createElement("div",{className:gi.text,title:$n.creator},$n.creator),mi&&Bt.createElement("div",{className:gi.btns},Bt.createElement("div",null,"\u5F00\u653E\u8BFE\u7A0B"),Bt.createElement("aside",null,"\u5F00\u653E\u8BFE\u5802")),It&&Bt.createElement("div",{className:gi.sign},"\u516C\u5F00")),Bt.createElement("div",{className:gi.bottom},$n.visits>0&&Bt.createElement(Xt.Z,{title:"\u8BBF\u95EE\u91CF",placement:"bottom"},Bt.createElement("span",null,Bt.createElement("i",{className:"iconfont icon-liulanyan"}),Bt.createElement("span",null,$n.visits))),$n.course_members_count>0&&Bt.createElement(Xt.Z,{title:"\u6210\u5458",placement:"bottom"},Bt.createElement("span",null,Bt.createElement("i",{className:"iconfont icon-chengyuan"}),$n.course_members_count)),$n.tasks_count>0&&Bt.createElement(Xt.Z,{title:"\u4F5C\u4E1A",placement:"bottom"},Bt.createElement("span",null,Bt.createElement("i",{className:"iconfont icon-zuoye"}),$n.tasks_count)),$n.is_end?Bt.createElement("div",{style:{color:"#6B758B"}},"\u5DF2\u7ED3\u675F"):Bt.createElement("div",{style:{color:"#00B187"}},"\u8FDB\u884C\u4E2D"))),!$n.is_accessible&&Bt.createElement("div",{className:gi.lockWrap},Bt.createElement("img",{src:`${Wt.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),Bt.createElement("span",{className:"mt15 font16 c-white"},"\u975E\u8BFE\u5802\u6210\u5458\u4E0D\u53EF\u8FDB\u5165")))}),!an.length&&Bt.createElement(ye.Z,null)))},Ge={flex_box_center:"flex_box_center___d27mZ",flex_space_between:"flex_space_between___qfRU9",flex_box_vertical_center:"flex_box_vertical_center___fCRld",flex_box_center_end:"flex_box_center_end___ORMV8",flex_box_column:"flex_box_column___PNKtZ",tabs:"tabs___alpa7",tabsWrap:"tabsWrap___aCQjw",tab:"tab___MKLr4",active:"active___nl_4v"},Ye=Mt(95392),Ve=({dataSource:Ui=[],value:an,onChange:vi,className:di,style:xn={},tabBarExtraContent:en})=>pt.createElement("div",{className:Ae()(Ge.tabs,di),style:xn},pt.createElement("div",{className:Ge.tabsWrap},Ui.map((hn,Vi)=>!(hn!=null&&hn.hide)&&pt.createElement("aside",{className:Ge.tab,onClick:()=>{vi(hn.id),hn.link&&Ye.history.push(hn.link)},key:Vi},pt.createElement("div",{className:an===hn.id?Ge.active:""},hn.name),(hn==null?void 0:hn.resetCount)==null&&(hn==null?void 0:hn.total)!==void 0&&pt.createElement("span",null,"\uFF08",hn==null?void 0:hn.total,"\uFF09"),(hn==null?void 0:hn.resetCount)!==void 0&&(hn==null?void 0:hn.total)!==void 0&&pt.createElement(Xt.Z,{title:(hn==null?void 0:hn.tip)!=null?hn==null?void 0:hn.tip:""},pt.createElement("span",{style:{color:"#9096A3"}},"\uFF08",pt.createElement("span",{style:{color:"#000"}},hn==null?void 0:hn.resetCount),"/",pt.createElement("span",null,hn==null?void 0:hn.total),"\uFF09"))))),pt.createElement("div",{className:Ge.tabBar},en)),Ni=({className:Ui,style:an={},children:vi})=>pt.createElement("div",{className:Ae()(Ui),style:an},vi),Se={flex_box_center:"flex_box_center___e6HxQ",flex_space_between:"flex_space_between___RnXYe",flex_box_vertical_center:"flex_box_vertical_center___lVxPk",flex_box_center_end:"flex_box_center_end___bu8yv",flex_box_column:"flex_box_column___JczGj",orderWrap:"orderWrap___ZfyGX",orderIconWrap:"orderIconWrap___XTB_O",orderAsc:"orderAsc___KWHmA",orderDesc:"orderDesc___rHdbB",active:"active___a7eSP",cursorPointer:"cursorPointer___gs9kL",orderTextWrap:"orderTextWrap___teAKn"},ie=Mt(75727),ee=Mt(93041);const ve=[{id:"updated_at",name:"\u6700\u65B0\u52A8\u6001"},{id:"created_at",name:"\u6700\u65B0\u521B\u5EFA"},{id:"name",name:"\u540D\u79F0\u6392\u5E8F"}];var he=({sortValue:Ui,dropValue:an,className:vi,onSort:di,onDrop:xn,dataSource:en=ve})=>{var hn;return pt.createElement("div",{className:Ae()(Se.orderWrap,vi)},pt.createElement(ie.Z,{dropdownRender:()=>pt.createElement(ee.default,null,en.map((Vi,zi)=>pt.createElement(ee.default.Item,{key:zi,onClick:()=>xn(Vi.id)},Vi.name)))},pt.createElement("span",{className:Se.orderTextWrap},(hn=en.find(Vi=>an===Vi.id))==null?void 0:hn.name)),pt.createElement("span",{className:Se.orderIconWrap},pt.createElement("span",{className:Se.orderAsc},pt.createElement("i",{className:Ui==="asc"?`iconfont icon-sanjiaoxing-up font12 ${Se.cursorPointer} ${Se.active}`:`iconfont icon-sanjiaoxing-up font12 ${Se.cursorPointer}`,onClick:()=>di(Ui==="asc"?"desc":"asc")})),pt.createElement("span",{className:Se.orderDesc},pt.createElement("i",{className:Ui==="desc"?`iconfont icon-sanjiaoxing-down font12 ${Se.cursorPointer} ${Se.active}`:`iconfont icon-sanjiaoxing-down font12 ${Se.cursorPointer}`,onClick:()=>di(Ui==="asc"?"desc":"asc")}))))},We={flex_box_center:"flex_box_center___LCi0B",flex_space_between:"flex_space_between___hzONe",flex_box_vertical_center:"flex_box_vertical_center___ZyQRE",flex_box_center_end:"flex_box_center_end___XKM74",flex_box_column:"flex_box_column___p8LCU",btn:"btn___In02G","mediacy-round":"mediacy-round___uveEv","mediacy-default":"mediacy-default___dDxsd",default:"default___K791v"},He=Mt(99571),we=Object.defineProperty,ei=Object.getOwnPropertySymbols,Be=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable,Je=(Ui,an,vi)=>an in Ui?we(Ui,an,{enumerable:!0,configurable:!0,writable:!0,value:vi}):Ui[an]=vi,Ri=(Ui,an)=>{for(var vi in an||(an={}))Be.call(an,vi)&&Je(Ui,vi,an[vi]);if(ei)for(var vi of ei(an))Zt.call(an,vi)&&Je(Ui,vi,an[vi]);return Ui},Pi=(Ui,an)=>{var vi={};for(var di in Ui)Be.call(Ui,di)&&an.indexOf(di)<0&&(vi[di]=Ui[di]);if(Ui!=null&&ei)for(var di of ei(Ui))an.indexOf(di)<0&&Zt.call(Ui,di)&&(vi[di]=Ui[di]);return vi},Ct=(Ui,an,vi)=>new Promise((di,xn)=>{var en=zi=>{try{Vi(vi.next(zi))}catch(ur){xn(ur)}},hn=zi=>{try{Vi(vi.throw(zi))}catch(ur){xn(ur)}},Vi=zi=>zi.done?di(zi.value):Promise.resolve(zi.value).then(en,hn);Vi((vi=vi.apply(Ui,an)).next())}),ft=Ui=>{var an=Ui,{className:vi,style:di,children:xn,loading:en=!1,openLoading:hn,onClick:Vi=()=>{},size:zi="middle",shape:ur="round"}=an,Vn=Pi(an,["className","style","children","loading","openLoading","onClick","size","shape"]);const[$n,Xe]=(0,pt.useState)(!1);return pt.createElement(He.ZP,Ri({onClick:(0,re.throttle)(mi=>Ct(void 0,null,function*(){hn&&Xe(!0);try{yield Vi(mi)}catch(fn){console.log("error",fn)}hn&&Xe(!1)}),2e3,{leading:!0,trailing:!1}),className:Ae()(We.btn,We[`${zi}-${ur}`],vi),style:di,size:zi,shape:ur,loading:$n||en},Vn),xn)},St={flex_box_center:"flex_box_center___TB7bQ",flex_space_between:"flex_space_between___oBlTb",flex_box_vertical_center:"flex_box_vertical_center___b5XbB",flex_box_center_end:"flex_box_center_end___CNhe7",flex_box_column:"flex_box_column___yHXKW",head:"head___ghH72",node:"node___mjPEy"},wt=({className:Ui,style:an,children:vi=null,onClick:di,title:xn})=>pt.createElement("div",{className:Ae()(St.head,Ui),style:an},pt.createElement("span",{className:"primary-hover",onClick:di},pt.createElement("i",{className:"iconfont icon-fanhui2 font12"}),"\u8FD4\u56DE"),pt.createElement("b",{title:xn},xn),pt.createElement("div",{className:St.node},vi)),te={flex_box_center:"flex_box_center___AlHuF",flex_space_between:"flex_space_between___vN2LW",flex_box_vertical_center:"flex_box_vertical_center___Ac7D2",flex_box_center_end:"flex_box_center_end___y38I7",flex_box_column:"flex_box_column___iQE6P",btns:"btns___sNgTb",confirm:"confirm___Ozirl",cancel:"cancel___aiq1I"},ui=({confirmShow:Ui=!0,confirmTitle:an,confirmClick:vi,cancelShow:di=!0,cancelTitle:xn,cancelClick:en,className:hn,style:Vi,confirmLoading:zi=!1})=>pt.createElement("div",{className:Ae()(te.btns,hn),style:Vi},Ui&&pt.createElement(He.ZP,{loading:zi,onClick:vi,type:"primary",className:te.confirm},an),di&&pt.createElement(He.ZP,{onClick:en,className:te.cancel},xn)),qe={flex_box_center:"flex_box_center___jkpdr",flex_space_between:"flex_space_between___OtsL8",flex_box_vertical_center:"flex_box_vertical_center___rbcb_",flex_box_center_end:"flex_box_center_end___zBR21",flex_box_column:"flex_box_column___nS_eP",fixedBottom:"fixedBottom___oJl7m",wrap:"wrap___A3Oq1",center:"center____VL1y"},Zi=({className:Ui,style:an={},LeftContent:vi,children:di,RightContent:xn})=>pt.createElement("div",{className:Ae()(qe.fixedBottom,Ui),style:an},pt.createElement("div",{className:qe.wrap},pt.createElement("div",{className:qe.left},vi),pt.createElement("div",{className:qe.center},di),pt.createElement("div",{className:qe.right},xn))),Si={flex_box_center:"flex_box_center___tY8Yn",flex_space_between:"flex_space_between___vHdYA",flex_box_vertical_center:"flex_box_vertical_center___pa61F",flex_box_center_end:"flex_box_center_end___HyDXt",flex_box_column:"flex_box_column___UjZek",crumbs:"crumbs___V41Oe",hover:"hover___bEIVd"},Qi=({className:Ui,style:an={},dataSource:vi=[]})=>pt.createElement("div",{className:Ae()(Si.crumbs,Ui),style:an},vi.map((di,xn)=>xn<vi.length-1?pt.createElement(pt.Fragment,{key:xn},di.path||di.onClick?pt.createElement("span",{className:Si.hover,onClick:di!=null&&di.onClick?di.onClick:()=>Ye.history.push(di.path)},di.name):pt.createElement("span",null,di.name),pt.createElement("span",null,"\xA0",">","\xA0")):pt.createElement("span",{key:xn,style:{color:"#5F6368"}},di.name))),Cn=Mt(11938),_i=Object.defineProperty,Mn=Object.defineProperties,er=Object.getOwnPropertyDescriptors,ir=Object.getOwnPropertySymbols,fr=Object.prototype.hasOwnProperty,ar=Object.prototype.propertyIsEnumerable,br=(Ui,an,vi)=>an in Ui?_i(Ui,an,{enumerable:!0,configurable:!0,writable:!0,value:vi}):Ui[an]=vi,Qn=(Ui,an)=>{for(var vi in an||(an={}))fr.call(an,vi)&&br(Ui,vi,an[vi]);if(ir)for(var vi of ir(an))ar.call(an,vi)&&br(Ui,vi,an[vi]);return Ui},Nn=(Ui,an)=>Mn(Ui,er(an)),yr=(Ui,an)=>{var vi={};for(var di in Ui)fr.call(Ui,di)&&an.indexOf(di)<0&&(vi[di]=Ui[di]);if(Ui!=null&&ir)for(var di of ir(Ui))an.indexOf(di)<0&&ar.call(Ui,di)&&(vi[di]=Ui[di]);return vi};const{Countdown:yt}=Cn.default;var on=Ui=>{var an=Ui,{onChange:vi}=an,di=yr(an,["onChange"]);const[xn,en]=(0,pt.useState)(null);(0,pt.useEffect)(()=>{typeof xn=="number"&&xn>=0&&vi(xn)},[xn]);const hn=Vi=>{const zi=Math.floor(Vi/1e3);en(zi)};return pt.createElement(yt,Nn(Qn({},di),{onChange:hn}))}},66991:function(Li,ai,Mt){"use strict";Mt.d(ai,{Z:function(){return _t}});var pt=Mt(59301);function _t(ce,me){const Ut=(0,pt.useRef)();(0,pt.useEffect)(()=>{Ut.current=ce}),(0,pt.useEffect)(()=>{function fe(){Ut.current()}if(me!==null){let $t=setInterval(fe,me);return()=>clearInterval($t)}},[me])}},19421:function(Li,ai,Mt){"use strict";Mt.r(ai),Mt.d(ai,{default:function(){return Sn}});var pt=Mt(59301),_t=Mt(95392),ce=Mt(28284),me=Mt(62957),Ut=Mt(77019),fe=Mt(29787),$t=Mt(6767),Ae=Mt(62673),re={flex_box_center:"flex_box_center___JKPl3",flex_space_between:"flex_space_between___QuVBb",flex_box_vertical_center:"flex_box_vertical_center___Ksaxh",flex_box_center_end:"flex_box_center_end___nIhjx",flex_box_column:"flex_box_column___NAJ16",wrap:"wrap___NZWPs",content:"content___OLcvS",name:"name____Thh2",list:"list___F7fxl",head:"head___ffJpn",models:"models___kudCc",btns:"btns___CQDPq",rowsHead:"rowsHead___oC1SU",time:"time___r7Qed",rowsBody:"rowsBody___ZNF9c"},Dt=Mt(57193),de=Mt(71951),zt=Mt(17949),Ne=Mt(97231),ue=Mt(47114),qt=Mt(81779),Qt=Mt(63949),Jt=Mt(99571),Pe=Mt(25399),je=Mt(75727),De=Mt(82326),Yt=Mt(37568),Vt=Mt(18287),pe=Mt(5269),Xt=Mt(14566),Le=Mt(26906),Wt=Mt(92310),Ce=Mt.n(Wt),Te=Mt(29301),ne=Mt(8654),Re=Mt(47999),ye=Mt(48755),Ie=Mt(83397),Ai=Mt(31756),yi=Mt(13783),oi=pt.createContext({}),Bt=Mt(36237),bt=Mt(63356),ge=Mt(16931),Ge=Mt(51636);const Ye=Ke=>{const{antCls:Fe,componentCls:ke,iconCls:$e,avatarBg:pi,avatarColor:Ei,containerSize:Me,containerSizeLG:cn,containerSizeSM:_e,textFontSize:bi,textFontSizeLG:pn,textFontSizeSM:kn,borderRadius:zn,borderRadiusLG:Bn,borderRadiusSM:Tn,lineWidth:or,lineType:Fr}=Ke,Zn=(ji,Pt,gr)=>({width:ji,height:ji,borderRadius:"50%",[`&${ke}-square`]:{borderRadius:gr},[`&${ke}-icon`]:{fontSize:Pt,[`> ${$e}`]:{margin:0}}});return{[ke]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,bt.Wf)(Ke)),{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",overflow:"hidden",color:Ei,whiteSpace:"nowrap",textAlign:"center",verticalAlign:"middle",background:pi,border:`${(0,Bt.unit)(or)} ${Fr} transparent`,"&-image":{background:"transparent"},[`${Fe}-image-img`]:{display:"block"}}),Zn(Me,bi,zn)),{"&-lg":Object.assign({},Zn(cn,pn,Bn)),"&-sm":Object.assign({},Zn(_e,kn,Tn)),"> img":{display:"block",width:"100%",height:"100%",objectFit:"cover"}})}},oe=Ke=>{const{componentCls:Fe,groupBorderColor:ke,groupOverlapping:$e,groupSpace:pi}=Ke;return{[`${Fe}-group`]:{display:"inline-flex",[Fe]:{borderColor:ke},"> *:not(:first-child)":{marginInlineStart:$e}},[`${Fe}-group-popover`]:{[`${Fe} + ${Fe}`]:{marginInlineStart:pi}}}},Ve=Ke=>{const{controlHeight:Fe,controlHeightLG:ke,controlHeightSM:$e,fontSize:pi,fontSizeLG:Ei,fontSizeXL:Me,fontSizeHeading3:cn,marginXS:_e,marginXXS:bi,colorBorderBg:pn}=Ke;return{containerSize:Fe,containerSizeLG:ke,containerSizeSM:$e,textFontSize:Math.round((Ei+Me)/2),textFontSizeLG:cn,textFontSizeSM:pi,groupSpace:bi,groupOverlapping:-_e,groupBorderColor:pn}};var Ze=(0,ge.I$)("Avatar",Ke=>{const{colorTextLightSolid:Fe,colorTextPlaceholder:ke}=Ke,$e=(0,Ge.mergeToken)(Ke,{avatarBg:ke,avatarColor:Fe});return[Ye($e),oe($e)]},Ve),Ni=function(Ke,Fe){var ke={};for(var $e in Ke)Object.prototype.hasOwnProperty.call(Ke,$e)&&Fe.indexOf($e)<0&&(ke[$e]=Ke[$e]);if(Ke!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pi=0,$e=Object.getOwnPropertySymbols(Ke);pi<$e.length;pi++)Fe.indexOf($e[pi])<0&&Object.prototype.propertyIsEnumerable.call(Ke,$e[pi])&&(ke[$e[pi]]=Ke[$e[pi]]);return ke},ie=pt.forwardRef((Ke,Fe)=>{const{prefixCls:ke,shape:$e,size:pi,src:Ei,srcSet:Me,icon:cn,className:_e,rootClassName:bi,style:pn,alt:kn,draggable:zn,children:Bn,crossOrigin:Tn,gap:or=4,onError:Fr}=Ke,Zn=Ni(Ke,["prefixCls","shape","size","src","srcSet","icon","className","rootClassName","style","alt","draggable","children","crossOrigin","gap","onError"]),[ji,Pt]=pt.useState(1),[gr,Un]=pt.useState(!1),[Ar,Dr]=pt.useState(!0),Cr=pt.useRef(null),sn=pt.useRef(null),vn=(0,ne.sQ)(Fe,Cr),{getPrefixCls:Yn,avatar:Gi}=pt.useContext(ye.E_),mn=pt.useContext(oi),Kn=()=>{if(!sn.current||!Cr.current)return;const po=sn.current.offsetWidth,Qr=Cr.current.offsetWidth;po!==0&&Qr!==0&&or*2<Qr&&Pt(Qr-or*2<po?(Qr-or*2)/po:1)};pt.useEffect(()=>{Un(!0)},[]),pt.useEffect(()=>{Dr(!0),Pt(1)},[Ei]),pt.useEffect(Kn,[or]);const un=()=>{(Fr==null?void 0:Fr())!==!1&&Dr(!1)},Wi=(0,Ai.Z)(po=>{var Qr,ps;return(ps=(Qr=pi!=null?pi:mn==null?void 0:mn.size)!==null&&Qr!==void 0?Qr:po)!==null&&ps!==void 0?ps:"default"}),li=Object.keys(typeof Wi=="object"?Wi||{}:{}).some(po=>["xs","sm","md","lg","xl","xxl"].includes(po)),Pn=(0,yi.Z)(li),wr=pt.useMemo(()=>{if(typeof Wi!="object")return{};const po=Re.c4.find(ps=>Pn[ps]),Qr=Wi[po];return Qr?{width:Qr,height:Qr,fontSize:Qr&&(cn||Bn)?Qr/2:18}:{}},[Pn,Wi]),Tr=Yn("avatar",ke),Lr=(0,Ie.Z)(Tr),[Xr,oo,so]=Ze(Tr,Lr),bo=Ce()({[`${Tr}-lg`]:Wi==="large",[`${Tr}-sm`]:Wi==="small"}),io=pt.isValidElement(Ei),go=$e||(mn==null?void 0:mn.shape)||"circle",be=Ce()(Tr,bo,Gi==null?void 0:Gi.className,`${Tr}-${go}`,{[`${Tr}-image`]:io||Ei&&Ar,[`${Tr}-icon`]:!!cn},so,Lr,_e,bi,oo),Oo=typeof Wi=="number"?{width:Wi,height:Wi,fontSize:cn?Wi/2:18}:{};let rs;if(typeof Ei=="string"&&Ar)rs=pt.createElement("img",{src:Ei,draggable:zn,srcSet:Me,onError:un,alt:kn,crossOrigin:Tn});else if(io)rs=Ei;else if(cn)rs=cn;else if(gr||ji!==1){const po=`scale(${ji})`,Qr={msTransform:po,WebkitTransform:po,transform:po};rs=pt.createElement(Te.Z,{onResize:Kn},pt.createElement("span",{className:`${Tr}-string`,ref:sn,style:Object.assign({},Qr)},Bn))}else rs=pt.createElement("span",{className:`${Tr}-string`,style:{opacity:0},ref:sn},Bn);return Xr(pt.createElement("span",Object.assign({},Zn,{style:Object.assign(Object.assign(Object.assign(Object.assign({},Oo),wr),Gi==null?void 0:Gi.style),pn),className:be,ref:vn}),rs))}),ee=Mt(11592),ve=Mt(22703),ti=Mt(37639);const he=Ke=>{const{size:Fe,shape:ke}=pt.useContext(oi),$e=pt.useMemo(()=>({size:Ke.size||Fe,shape:Ke.shape||ke}),[Ke.size,Ke.shape,Fe,ke]);return pt.createElement(oi.Provider,{value:$e},Ke.children)};var He=Ke=>{var Fe,ke,$e,pi;const{getPrefixCls:Ei,direction:Me}=pt.useContext(ye.E_),{prefixCls:cn,className:_e,rootClassName:bi,style:pn,maxCount:kn,maxStyle:zn,size:Bn,shape:Tn,maxPopoverPlacement:or,maxPopoverTrigger:Fr,children:Zn,max:ji}=Ke,Pt=Ei("avatar",cn),gr=`${Pt}-group`,Un=(0,Ie.Z)(Pt),[Ar,Dr,Cr]=Ze(Pt,Un),sn=Ce()(gr,{[`${gr}-rtl`]:Me==="rtl"},Cr,Un,_e,bi,Dr),vn=(0,ee.Z)(Zn).map((mn,Kn)=>(0,ve.Tm)(mn,{key:`avatar-key-${Kn}`})),Yn=(ji==null?void 0:ji.count)||kn,Gi=vn.length;if(Yn&&Yn<Gi){const mn=vn.slice(0,Yn),Kn=vn.slice(Yn,Gi),un=(ji==null?void 0:ji.style)||zn,Wi=((Fe=ji==null?void 0:ji.popover)===null||Fe===void 0?void 0:Fe.trigger)||Fr||"hover",li=((ke=ji==null?void 0:ji.popover)===null||ke===void 0?void 0:ke.placement)||or||"top",Pn=Object.assign(Object.assign({content:Kn},ji==null?void 0:ji.popover),{classNames:{root:Ce()(`${gr}-popover`,(pi=($e=ji==null?void 0:ji.popover)===null||$e===void 0?void 0:$e.classNames)===null||pi===void 0?void 0:pi.root)},placement:li,trigger:Wi});return mn.push(pt.createElement(ti.Z,Object.assign({key:"avatar-popover-key",destroyTooltipOnHide:!0},Pn),pt.createElement(ie,{style:un},`+${Gi-Yn}`))),Ar(pt.createElement(he,{shape:Tn,size:Bn},pt.createElement("div",{className:sn,style:pn},mn)))}return Ar(pt.createElement(he,{shape:Tn,size:Bn},pt.createElement("div",{className:sn,style:pn},vn)))};const we=ie;we.Group=He;var ei=we,Be=function(Ke,Fe){return Be=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ke,$e){ke.__proto__=$e}||function(ke,$e){for(var pi in $e)Object.prototype.hasOwnProperty.call($e,pi)&&(ke[pi]=$e[pi])},Be(Ke,Fe)};function Zt(Ke,Fe){if(typeof Fe!="function"&&Fe!==null)throw new TypeError("Class extends value "+String(Fe)+" is not a constructor or null");Be(Ke,Fe);function ke(){this.constructor=Ke}Ke.prototype=Fe===null?Object.create(Fe):(ke.prototype=Fe.prototype,new ke)}var Je=function(){return Je=Object.assign||function(Fe){for(var ke,$e=1,pi=arguments.length;$e<pi;$e++){ke=arguments[$e];for(var Ei in ke)Object.prototype.hasOwnProperty.call(ke,Ei)&&(Fe[Ei]=ke[Ei])}return Fe},Je.apply(this,arguments)};function Ri(Ke,Fe){var ke={};for(var $e in Ke)Object.prototype.hasOwnProperty.call(Ke,$e)&&Fe.indexOf($e)<0&&(ke[$e]=Ke[$e]);if(Ke!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pi=0,$e=Object.getOwnPropertySymbols(Ke);pi<$e.length;pi++)Fe.indexOf($e[pi])<0&&Object.prototype.propertyIsEnumerable.call(Ke,$e[pi])&&(ke[$e[pi]]=Ke[$e[pi]]);return ke}function Pi(Ke,Fe,ke,$e){var pi=arguments.length,Ei=pi<3?Fe:$e===null?$e=Object.getOwnPropertyDescriptor(Fe,ke):$e,Me;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Ei=Reflect.decorate(Ke,Fe,ke,$e);else for(var cn=Ke.length-1;cn>=0;cn--)(Me=Ke[cn])&&(Ei=(pi<3?Me(Ei):pi>3?Me(Fe,ke,Ei):Me(Fe,ke))||Ei);return pi>3&&Ei&&Object.defineProperty(Fe,ke,Ei),Ei}function Ct(Ke,Fe){return function(ke,$e){Fe(ke,$e,Ke)}}function gt(Ke,Fe,ke,$e,pi,Ei){function Me(Zn){if(Zn!==void 0&&typeof Zn!="function")throw new TypeError("Function expected");return Zn}for(var cn=$e.kind,_e=cn==="getter"?"get":cn==="setter"?"set":"value",bi=!Fe&&Ke?$e.static?Ke:Ke.prototype:null,pn=Fe||(bi?Object.getOwnPropertyDescriptor(bi,$e.name):{}),kn,zn=!1,Bn=ke.length-1;Bn>=0;Bn--){var Tn={};for(var or in $e)Tn[or]=or==="access"?{}:$e[or];for(var or in $e.access)Tn.access[or]=$e.access[or];Tn.addInitializer=function(Zn){if(zn)throw new TypeError("Cannot add initializers after decoration has completed");Ei.push(Me(Zn||null))};var Fr=(0,ke[Bn])(cn==="accessor"?{get:pn.get,set:pn.set}:pn[_e],Tn);if(cn==="accessor"){if(Fr===void 0)continue;if(Fr===null||typeof Fr!="object")throw new TypeError("Object expected");(kn=Me(Fr.get))&&(pn.get=kn),(kn=Me(Fr.set))&&(pn.set=kn),(kn=Me(Fr.init))&&pi.unshift(kn)}else(kn=Me(Fr))&&(cn==="field"?pi.unshift(kn):pn[_e]=kn)}bi&&Object.defineProperty(bi,$e.name,pn),zn=!0}function ft(Ke,Fe,ke){for(var $e=arguments.length>2,pi=0;pi<Fe.length;pi++)ke=$e?Fe[pi].call(Ke,ke):Fe[pi].call(Ke);return $e?ke:void 0}function St(Ke){return typeof Ke=="symbol"?Ke:"".concat(Ke)}function At(Ke,Fe,ke){return typeof Fe=="symbol"&&(Fe=Fe.description?"[".concat(Fe.description,"]"):""),Object.defineProperty(Ke,"name",{configurable:!0,value:ke?"".concat(ke," ",Fe):Fe})}function wt(Ke,Fe){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(Ke,Fe)}function te(Ke,Fe,ke,$e){function pi(Ei){return Ei instanceof ke?Ei:new ke(function(Me){Me(Ei)})}return new(ke||(ke=Promise))(function(Ei,Me){function cn(pn){try{bi($e.next(pn))}catch(kn){Me(kn)}}function _e(pn){try{bi($e.throw(pn))}catch(kn){Me(kn)}}function bi(pn){pn.done?Ei(pn.value):pi(pn.value).then(cn,_e)}bi(($e=$e.apply(Ke,Fe||[])).next())})}function ni(Ke,Fe){var ke={label:0,sent:function(){if(Ei[0]&1)throw Ei[1];return Ei[1]},trys:[],ops:[]},$e,pi,Ei,Me;return Me={next:cn(0),throw:cn(1),return:cn(2)},typeof Symbol=="function"&&(Me[Symbol.iterator]=function(){return this}),Me;function cn(bi){return function(pn){return _e([bi,pn])}}function _e(bi){if($e)throw new TypeError("Generator is already executing.");for(;Me&&(Me=0,bi[0]&&(ke=0)),ke;)try{if($e=1,pi&&(Ei=bi[0]&2?pi.return:bi[0]?pi.throw||((Ei=pi.return)&&Ei.call(pi),0):pi.next)&&!(Ei=Ei.call(pi,bi[1])).done)return Ei;switch(pi=0,Ei&&(bi=[bi[0]&2,Ei.value]),bi[0]){case 0:case 1:Ei=bi;break;case 4:return ke.label++,{value:bi[1],done:!1};case 5:ke.label++,pi=bi[1],bi=[0];continue;case 7:bi=ke.ops.pop(),ke.trys.pop();continue;default:if(Ei=ke.trys,!(Ei=Ei.length>0&&Ei[Ei.length-1])&&(bi[0]===6||bi[0]===2)){ke=0;continue}if(bi[0]===3&&(!Ei||bi[1]>Ei[0]&&bi[1]<Ei[3])){ke.label=bi[1];break}if(bi[0]===6&&ke.label<Ei[1]){ke.label=Ei[1],Ei=bi;break}if(Ei&&ke.label<Ei[2]){ke.label=Ei[2],ke.ops.push(bi);break}Ei[2]&&ke.ops.pop(),ke.trys.pop();continue}bi=Fe.call(Ke,ke)}catch(pn){bi=[6,pn],pi=0}finally{$e=Ei=0}if(bi[0]&5)throw bi[1];return{value:bi[0]?bi[1]:void 0,done:!0}}}var ui=Object.create?function(Ke,Fe,ke,$e){$e===void 0&&($e=ke);var pi=Object.getOwnPropertyDescriptor(Fe,ke);(!pi||("get"in pi?!Fe.__esModule:pi.writable||pi.configurable))&&(pi={enumerable:!0,get:function(){return Fe[ke]}}),Object.defineProperty(Ke,$e,pi)}:function(Ke,Fe,ke,$e){$e===void 0&&($e=ke),Ke[$e]=Fe[ke]};function qe(Ke,Fe){for(var ke in Ke)ke!=="default"&&!Object.prototype.hasOwnProperty.call(Fe,ke)&&ui(Fe,Ke,ke)}function xe(Ke){var Fe=typeof Symbol=="function"&&Symbol.iterator,ke=Fe&&Ke[Fe],$e=0;if(ke)return ke.call(Ke);if(Ke&&typeof Ke.length=="number")return{next:function(){return Ke&&$e>=Ke.length&&(Ke=void 0),{value:Ke&&Ke[$e++],done:!Ke}}};throw new TypeError(Fe?"Object is not iterable.":"Symbol.iterator is not defined.")}function Zi(Ke,Fe){var ke=typeof Symbol=="function"&&Ke[Symbol.iterator];if(!ke)return Ke;var $e=ke.call(Ke),pi,Ei=[],Me;try{for(;(Fe===void 0||Fe-- >0)&&!(pi=$e.next()).done;)Ei.push(pi.value)}catch(cn){Me={error:cn}}finally{try{pi&&!pi.done&&(ke=$e.return)&&ke.call($e)}finally{if(Me)throw Me.error}}return Ei}function Si(){for(var Ke=[],Fe=0;Fe<arguments.length;Fe++)Ke=Ke.concat(Zi(arguments[Fe]));return Ke}function Oi(){for(var Ke=0,Fe=0,ke=arguments.length;Fe<ke;Fe++)Ke+=arguments[Fe].length;for(var $e=Array(Ke),pi=0,Fe=0;Fe<ke;Fe++)for(var Ei=arguments[Fe],Me=0,cn=Ei.length;Me<cn;Me++,pi++)$e[pi]=Ei[Me];return $e}function Qi(Ke,Fe,ke){if(ke||arguments.length===2)for(var $e=0,pi=Fe.length,Ei;$e<pi;$e++)(Ei||!($e in Fe))&&(Ei||(Ei=Array.prototype.slice.call(Fe,0,$e)),Ei[$e]=Fe[$e]);return Ke.concat(Ei||Array.prototype.slice.call(Fe))}function Cn(Ke){return this instanceof Cn?(this.v=Ke,this):new Cn(Ke)}function _i(Ke,Fe,ke){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var $e=ke.apply(Ke,Fe||[]),pi,Ei=[];return pi={},Me("next"),Me("throw"),Me("return"),pi[Symbol.asyncIterator]=function(){return this},pi;function Me(zn){$e[zn]&&(pi[zn]=function(Bn){return new Promise(function(Tn,or){Ei.push([zn,Bn,Tn,or])>1||cn(zn,Bn)})})}function cn(zn,Bn){try{_e($e[zn](Bn))}catch(Tn){kn(Ei[0][3],Tn)}}function _e(zn){zn.value instanceof Cn?Promise.resolve(zn.value.v).then(bi,pn):kn(Ei[0][2],zn)}function bi(zn){cn("next",zn)}function pn(zn){cn("throw",zn)}function kn(zn,Bn){zn(Bn),Ei.shift(),Ei.length&&cn(Ei[0][0],Ei[0][1])}}function Mn(Ke){var Fe,ke;return Fe={},$e("next"),$e("throw",function(pi){throw pi}),$e("return"),Fe[Symbol.iterator]=function(){return this},Fe;function $e(pi,Ei){Fe[pi]=Ke[pi]?function(Me){return(ke=!ke)?{value:Cn(Ke[pi](Me)),done:!1}:Ei?Ei(Me):Me}:Ei}}function er(Ke){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Fe=Ke[Symbol.asyncIterator],ke;return Fe?Fe.call(Ke):(Ke=typeof xe=="function"?xe(Ke):Ke[Symbol.iterator](),ke={},$e("next"),$e("throw"),$e("return"),ke[Symbol.asyncIterator]=function(){return this},ke);function $e(Ei){ke[Ei]=Ke[Ei]&&function(Me){return new Promise(function(cn,_e){Me=Ke[Ei](Me),pi(cn,_e,Me.done,Me.value)})}}function pi(Ei,Me,cn,_e){Promise.resolve(_e).then(function(bi){Ei({value:bi,done:cn})},Me)}}function ir(Ke,Fe){return Object.defineProperty?Object.defineProperty(Ke,"raw",{value:Fe}):Ke.raw=Fe,Ke}var fr=Object.create?function(Ke,Fe){Object.defineProperty(Ke,"default",{enumerable:!0,value:Fe})}:function(Ke,Fe){Ke.default=Fe};function ar(Ke){if(Ke&&Ke.__esModule)return Ke;var Fe={};if(Ke!=null)for(var ke in Ke)ke!=="default"&&Object.prototype.hasOwnProperty.call(Ke,ke)&&ui(Fe,Ke,ke);return fr(Fe,Ke),Fe}function br(Ke){return Ke&&Ke.__esModule?Ke:{default:Ke}}function Qn(Ke,Fe,ke,$e){if(ke==="a"&&!$e)throw new TypeError("Private accessor was defined without a getter");if(typeof Fe=="function"?Ke!==Fe||!$e:!Fe.has(Ke))throw new TypeError("Cannot read private member from an object whose class did not declare it");return ke==="m"?$e:ke==="a"?$e.call(Ke):$e?$e.value:Fe.get(Ke)}function Nn(Ke,Fe,ke,$e,pi){if($e==="m")throw new TypeError("Private method is not writable");if($e==="a"&&!pi)throw new TypeError("Private accessor was defined without a setter");if(typeof Fe=="function"?Ke!==Fe||!pi:!Fe.has(Ke))throw new TypeError("Cannot write private member to an object whose class did not declare it");return $e==="a"?pi.call(Ke,ke):pi?pi.value=ke:Fe.set(Ke,ke),ke}function yr(Ke,Fe){if(Fe===null||typeof Fe!="object"&&typeof Fe!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof Ke=="function"?Fe===Ke:Ke.has(Fe)}var yt={__extends:Zt,__assign:Je,__rest:Ri,__decorate:Pi,__param:Ct,__metadata:wt,__awaiter:te,__generator:ni,__createBinding:ui,__exportStar:qe,__values:xe,__read:Zi,__spread:Si,__spreadArrays:Oi,__spreadArray:Qi,__await:Cn,__asyncGenerator:_i,__asyncDelegator:Mn,__asyncValues:er,__makeTemplateObject:ir,__importStar:ar,__importDefault:br,__classPrivateFieldGet:Qn,__classPrivateFieldSet:Nn,__classPrivateFieldIn:yr},Mi=Mt(12378);var on=function(Ke){Zt(Fe,Ke);function Fe(ke){var $e=Ke.call(this,ke)||this;return $e.wasCleared=!1,$e.modelChangedListener=null,$e.divRef=pt.createRef(),$e}return Fe.prototype.getDiagram=function(){return this.divRef.current===null?null:Mi.S0.fromDiv(this.divRef.current)},Fe.prototype.clear=function(){var ke=this.getDiagram();ke!==null&&(ke.clear(),this.wasCleared=!0)},Fe.prototype.componentDidMount=function(){var ke=this;if(this.divRef.current!==null){var $e=this.props.initDiagram();$e.div=this.divRef.current,this.modelChangedListener=function(pi){if(pi.isTransactionFinished&&pi.model&&!pi.model.isReadOnly&&ke.props.onModelChange){var Ei=pi.model.toIncrementalData(pi);Ei!==null&&ke.props.onModelChange(Ei,pi)}},$e.addModelChangedListener(this.modelChangedListener),$e.delayInitialization(function(){ke.mergeData($e,!0)})}},Fe.prototype.componentWillUnmount=function(){var ke=this.getDiagram();ke!==null&&(ke.div=null,this.modelChangedListener!==null&&(ke.removeModelChangedListener(this.modelChangedListener),this.modelChangedListener=null))},Fe.prototype.shouldComponentUpdate=function(ke,$e){return ke.divClassName!==this.props.divClassName||ke.style!==this.props.style?!0:!(ke.skipsDiagramUpdate||ke.nodeDataArray===this.props.nodeDataArray&&ke.linkDataArray===this.props.linkDataArray&&ke.modelData===this.props.modelData)},Fe.prototype.componentDidUpdate=function(ke,$e){var pi=this;if(!(ke.nodeDataArray===this.props.nodeDataArray&&ke.linkDataArray===this.props.linkDataArray&&ke.modelData===this.props.modelData)){var Ei=this.getDiagram();Ei!==null&&(this.wasCleared?Ei.delayInitialization(function(){pi.mergeData(Ei,!0),pi.wasCleared=!1}):this.mergeData(Ei,!1))}},Fe.prototype.mergeData=function(ke,$e){var pi=this,Ei=ke.model;Ei.commit(function(Me){pi.props.modelData!==void 0&&Me.assignAllDataProperties(Me.modelData,pi.props.modelData),Me.mergeNodeDataArray(pi.props.nodeDataArray),pi.props.linkDataArray!==void 0&&Me instanceof Mi.FJ&&Me.mergeLinkDataArray(pi.props.linkDataArray)},$e?"initial merge":"merge data")},Fe.prototype.render=function(){return pt.createElement("div",{ref:this.divRef,className:this.props.divClassName,style:this.props.style})},Fe}(pt.Component),Ui=function(Ke){Zt(Fe,Ke);function Fe(ke){var $e=Ke.call(this,ke)||this;return $e.divRef=pt.createRef(),$e}return Fe.prototype.getOverview=function(){return this.divRef.current===null?null:Mi.S0.fromDiv(this.divRef.current)},Fe.prototype.componentDidMount=function(){if(this.divRef.current!==null){var ke;this.props.initOverview!==void 0?ke=this.props.initOverview():(ke=new Mi.g2,ke.contentAlignment=Mi.z6.Center),ke.div=this.divRef.current,ke.observed=this.props.observedDiagram}},Fe.prototype.componentWillUnmount=function(){var ke=this.getOverview();ke!==null&&(ke.div=null,ke.observed=null)},Fe.prototype.shouldComponentUpdate=function(ke,$e){return ke.divClassName!==this.props.divClassName||ke.style!==this.props.style?!0:ke.observedDiagram!==this.props.observedDiagram},Fe.prototype.componentDidUpdate=function(ke,$e){if(ke.observedDiagram!==this.props.observedDiagram){var pi=this.getOverview();pi!==null&&(pi.observed=this.props.observedDiagram)}},Fe.prototype.render=function(){return pt.createElement("div",{ref:this.divRef,className:this.props.divClassName,style:this.props.style})},Fe}(pt.Component),an=function(Ke){Zt(Fe,Ke);function Fe(ke){var $e=Ke.call(this,ke)||this;return $e.wasCleared=!1,$e.divRef=pt.createRef(),$e}return Fe.prototype.getPalette=function(){return this.divRef.current===null?null:Mi.S0.fromDiv(this.divRef.current)},Fe.prototype.clear=function(){var ke=this.getPalette();ke!==null&&(ke.clear(),this.wasCleared=!0)},Fe.prototype.componentDidMount=function(){var ke=this;if(this.divRef.current!==null){var $e=this.props.initPalette();$e.div=this.divRef.current,$e.delayInitialization(function(){ke.mergeData($e,!0)})}},Fe.prototype.componentWillUnmount=function(){var ke=this.getPalette();ke!==null&&(ke.div=null)},Fe.prototype.shouldComponentUpdate=function(ke,$e){return ke.divClassName!==this.props.divClassName||ke.style!==this.props.style?!0:!(ke.nodeDataArray===this.props.nodeDataArray&&ke.linkDataArray===this.props.linkDataArray&&ke.modelData===this.props.modelData)},Fe.prototype.componentDidUpdate=function(ke,$e){var pi=this;if(!(ke.nodeDataArray===this.props.nodeDataArray&&ke.linkDataArray===this.props.linkDataArray&&ke.modelData===this.props.modelData)){var Ei=this.getPalette();Ei!==null&&(this.wasCleared?Ei.delayInitialization(function(){pi.mergeData(Ei,!0),pi.wasCleared=!1}):this.mergeData(Ei,!1))}},Fe.prototype.mergeData=function(ke,$e){var pi=this,Ei=ke.model;Ei.commit(function(Me){pi.props.modelData!==void 0&&Me.assignAllDataProperties(Me.modelData,pi.props.modelData),Me.mergeNodeDataArray(pi.props.nodeDataArray),pi.props.linkDataArray!==void 0&&Me instanceof Mi.FJ&&Me.mergeLinkDataArray(pi.props.linkDataArray)},$e?"initial merge":"merge data")},Fe.prototype.render=function(){return pt.createElement("div",{ref:this.divRef,className:this.props.divClassName,style:this.props.style})},Fe}(pt.Component),vi=Mt(91415),di={flex_box_center:"flex_box_center___dw6yv",flex_space_between:"flex_space_between___bkc32",flex_box_vertical_center:"flex_box_vertical_center___jDpm2",flex_box_center_end:"flex_box_center_end___g9JOB",flex_box_column:"flex_box_column___ngIjI","diagram-component":"diagram-component___fHDp0",rightmodal:"rightmodal___Fwj_F",title:"title___YZZgl",button:"button___yQKxh",linetitles:"linetitles___CFVw5",line:"line___hSEjG",additem:"additem___cy1wv",lebels:"lebels___E2znG",describe:"describe___emw2X",describetitle:"describetitle___bgNOs",ehover:"ehover____RCDx",dhover:"dhover___IP_3b",header:"header___PCDQg",headeractivite:"headeractivite___x56tJ",a:"a___QYqeC"},xn=Mt(13922),en=Mt(78323),hn=Mt(96249),Vi=Mt.n(hn),zi=Mt(26724),ur=Mt.n(zi),Vn=Object.defineProperty,$n=Object.defineProperties,Xe=Object.getOwnPropertyDescriptors,mi=Object.getOwnPropertySymbols,fn=Object.prototype.hasOwnProperty,On=Object.prototype.propertyIsEnumerable,Gn=(Ke,Fe,ke)=>Fe in Ke?Vn(Ke,Fe,{enumerable:!0,configurable:!0,writable:!0,value:ke}):Ke[Fe]=ke,It=(Ke,Fe)=>{for(var ke in Fe||(Fe={}))fn.call(Fe,ke)&&Gn(Ke,ke,Fe[ke]);if(mi)for(var ke of mi(Fe))On.call(Fe,ke)&&Gn(Ke,ke,Fe[ke]);return Ke},se=(Ke,Fe)=>$n(Ke,Xe(Fe)),xi=(Ke,Fe,ke)=>new Promise(($e,pi)=>{var Ei=_e=>{try{cn(ke.next(_e))}catch(bi){pi(bi)}},Me=_e=>{try{cn(ke.throw(_e))}catch(bi){pi(bi)}},cn=_e=>_e.done?$e(_e.value):Promise.resolve(_e.value).then(Ei,Me);cn((ke=ke.apply(Ke,Fe)).next())});class Di extends Mi.hD{isFixed(Fe){return Fe.node.isSelected}doLayout(Fe){this._isObserving||(this._isObserving=!0,this.diagram.addModelChangedListener($e=>{($e.modelChange!==""||$e.change===Mi.Vk.Transaction&&$e.propertyName==="StartingFirstTransaction")&&(this.network=null)}));var ke=this.network;ke===null?this.network=ke=this.makeNetwork(Fe):this.diagram.nodes.each($e=>{var pi=ke.findVertex($e);pi!==null&&(pi.bounds=$e.actualBounds)}),super.doLayout(Fe),this.network=ke}}let Oe=["\u6839\u8282\u70B9","\u7AE0\u8282\u77E5\u8BC6\u5355\u5143","\u8D44\u6E90\u77E5\u8BC6\u5355\u5143","\u77E5\u8BC6\u70B9"],Ti=["#3CDAA3","#30A7F1","#F84F90","#6656FF"],rn=[{name:"\u5B9E\u8BAD",type:"Shixun"},{name:"\u8BFE\u4EF6",type:"Attachment"},{name:"\u89C6\u9891",type:"VideoItem"},{name:"\u8003\u8BD5",type:"ExaminationBank"},{name:"\u4F5C\u4E1A",type:"SubjectHomework"},{name:"\u7EC3\u4E60",type:"Practice"},{name:"\u6587\u672C",type:"Text"}];const ln=({globalSetting:Ke,dispatch:Fe,virtualSpaces:ke})=>{var $e,pi,Ei,Me;const cn=(0,_t.useParams)(),_e=(0,pt.useRef)(),[bi,pn]=(0,pt.useState)(!1),[kn,zn]=(0,pt.useState)(!1),[Bn,Tn]=(0,pt.useState)(!1),[or,Fr]=(0,pt.useState)(!1),[Zn,ji]=(0,pt.useState)(!0),[Pt,gr]=(0,pt.useState)(!1);let[Un,Ar]=(0,pt.useState)({});const[Dr]=ce.default.useForm(),[Cr,sn]=(0,pt.useState)(!1),[vn,Yn]=(0,pt.useState)(!0),[Gi,mn]=(0,pt.useState)({index:"",name:"",add:!1});let[Kn,un]=(0,pt.useState)({});const Wi=(0,pt.useRef)(null),[li,Pn]=(0,pt.useState)(!1),[wr,Tr]=(0,pt.useState)(!1),[Lr,Xr]=(0,pt.useState)([]),[oo,so]=(0,pt.useState)([]),[bo,io]=(0,pt.useState)([]),[go,be]=(0,pt.useState)(""),[Oo,rs]=(0,pt.useState)(!0),[po,Qr]=(0,pt.useState)(),[ps,ao]=(0,pt.useState)([]),[Pl,jr]=(0,pt.useState)(!1),[Io,hl]=(0,pt.useState)(!1),Bo=(0,pt.useRef)(),ho=(0,pt.useRef)(),[ta,jn]=(0,pt.useState)(!1),[Ba,Oa]=(0,pt.useState)({left:0,top:0,bottom:0,right:0}),Vs=(0,pt.useRef)(null),{virtualSpacesDetails:Qo}=ke,Gs=(Qo==null?void 0:Qo.is_member)||(0,qt.Ny)(),[nn,Jn]=(0,pt.useState)(!1),[qn,mr]=(0,pt.useState)(!1),[Nr,no]=(0,pt.useState)([]),[Hn,ea]=(0,pt.useState)(!1),[os,$o]=(0,pt.useState)(1),[vo,Ps]=(0,pt.useState)(!1),ha=(Bi,Fi)=>{var In;const{clientWidth:dr,clientHeight:xr}=window.document.documentElement,Hr=(In=Vs.current)==null?void 0:In.getBoundingClientRect();Oa({left:-Hr.left+Fi.x,right:dr-(Hr.right-Fi.x),top:-Hr.top+Fi.y,bottom:xr-(Hr.bottom-Fi.y)-70})};let[Ns,ia]=(0,pt.useState)(600);(0,pt.useEffect)(()=>{un({}),gs()},[cn,Zn]),(0,pt.useEffect)(()=>{cl(),$t.ZP.config({getContainer:()=>Wi.current,top:100})},[]);const cl=()=>{if(ho.current)return;const Bi=Mi.bx.make;var Fi=new Mi.S0("myDiagramDiv",{"commandHandler.copiesTree":!1,"commandHandler.copiesParentKey":!1,"commandHandler.deletesTree":!1,"draggingTool.dragsTree":!1,"undoManager.isEnabled":!1,doubleClick:!1});ho.current=Fi;var In=Mi.bx.make(Mi.FF);In.angle=0,In.arrangement=Mi.FF.ArrangementFixedRoots,Fi.layout=In,Fi.nodeTemplate=Bi(Mi.NB,"Vertical",{selectionObjectName:"TEXT"},Bi(Mi.al,{name:"TEXT",minSize:new Mi.$u(30,15)},new Mi.KX("text","text").makeTwoWay(),new Mi.KX("scale","scale").makeTwoWay(),new Mi.KX("font","font").makeTwoWay()),Bi(Mi.bn,"LineH",{stretch:Mi.bx.Horizontal,strokeWidth:3,height:3,portId:"",fromSpot:Mi.z6.LeftRightSides,toSpot:Mi.z6.LeftRightSides},new Mi.KX("stroke","brush"),new Mi.KX("fromSpot","dir",xr=>ql(xr,!0)),new Mi.KX("toSpot","dir",xr=>ql(xr,!1))),new Mi.KX("location","loc",Mi.E9.parse).makeTwoWay(Mi.E9.stringify),new Mi.KX("locationSpot","dir",xr=>ql(xr,!1)),{click(xr,Hr){mr(!1),Ar(Hr==null?void 0:Hr.data),Oa({left:0,top:0,bottom:0,right:0})}}),Fi.allowDoubleClick=!1,Fi.allowSelect="single",Fi.commandHandler.canDeleteSelection=!1,Fi.commandHandler.canUndo=!1;const dr=Fi.toolManager.clickSelectingTool;dr.canStartMulti=!1,Fi.linkTemplate=Bi(Mi.rU,{curve:Mi.rU.Bezier,fromShortLength:-2,toShortLength:-2,selectable:!1},Bi(Mi.bn,{strokeWidth:3},new Mi.KX("stroke","toNode",xr=>xr.data.brush?xr.data.brush:"black").ofObject()))};function Ia(Bi,Fi){var In=Bi.findNodeForKey(Fi);if(In!==null){Bi.startTransaction("Layout");var dr=new Mi.l4,xr=new Mi.l4;In.findLinksConnected().each(Hr=>{var ro=Hr.toNode;ro.data.dir==="left"?(xr.add(In),xr.add(Hr),xr.addAll(ro.findTreeParts())):(dr.add(In),dr.add(Hr),dr.addAll(ro.findTreeParts()))}),_l(dr,0),_l(xr,180),Bi.commitTransaction("Layout")}}function _l(Bi,Fi){var In=Mi.bx.make(Mi.FF,{angle:Fi,arrangement:Mi.FF.ArrangementFixedRoots,nodeSpacing:5,layerSpacing:20,setsPortSpot:!1,setsChildPortSpot:!1});In.doLayout(Bi)}function bh(Bi){var Fi;const In=(Fi=Bi==null?void 0:Bi[0])==null?void 0:Fi.id;let dr=0;ho.current.model=Mi.Hn.fromJson(JSON.stringify({class:"go.TreeModel",nodeDataArray:Bi.map(xr=>(xr.parent==In&&(dr%2===0?xr.dir="left":xr.dir="right",++dr),xr.brush=xr.unit_type===0?"#3CDAA3":[1,2,5,6,7,8].includes(xr.unit_type)?"#F84F90":xr.unit_type===3?"#30A7F1":"#6656FF",xr))})),Ia(ho.current,In)}function gs(){return xi(this,null,function*(){var Bi,Fi;let In=Zn?"/api/knowledge_graphs/tree.json":"/api/knowledge_graphs/map.json",dr=yield(0,Dt.ZP)(In,{method:"get",params:{type:2,identifier:cn.virtual_spacesId,type:2,virtual_module_id:window.localStorage.getItem("vtrsModuleId")}});if(dr.status===0){let xr=(Bi=dr==null?void 0:dr.nodeData)==null?void 0:Bi.map((ro,Ro)=>se(It({},ro),{bgcolor:ro.unit_type===0?"#3CDAA3":[1,2,5,6,7,8].includes(ro.unit_type)?"#F84F90":ro.unit_type===3?"#30A7F1":"#6656FF",parent:ro.parent_id}));un(se(It({},dr),{nodeData:xr})),Zn?(bh(xr),setTimeout(()=>{tu()},300)):tu();let Hr=(Fi=dr==null?void 0:dr.nodeData)==null?void 0:Fi.filter(ro=>ro.id===Un.id);(Hr==null?void 0:Hr.length)>0&&Ar(It({},Hr==null?void 0:Hr[0]))}})}const Ja={onRemove:()=>{Xr([])},beforeUpload:Bi=>{if(console.log(Bi),(Bi==null?void 0:Bi.size)>1024*1024*50)return $t.ZP.info("\u6587\u4EF6\u8D85\u8FC750M\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42"),!1;let Fi=[];return Fi.push(Bi),Xr([...Fi]),!1},fileList:Lr,accept:".xls,.xlsx"},fl=(0,pt.useMemo)(()=>{const Bi=Fi=>Fi.map(In=>{const dr=In.title,xr=dr.indexOf(go),Hr=dr.substring(0,xr),ro=dr.slice(xr+go.length),Ro=xr>-1?pt.createElement("span",null,Hr,pt.createElement("span",{style:{color:"#f50"}},go),ro):pt.createElement("span",null,dr);return In.children?{title:Ro,key:In.key,children:Bi(In.children)}:{title:Ro,key:In.key}});return Bi(oo)},[go,oo]);function Ca(){const Bi=Mi.bx.make,Fi=Bi(Mi.S0,{allowSelect:!1,"undoManager.isEnabled":!0,initialAutoScale:Mi.S0.Uniform,contentAlignment:Mi.z6.Center,layout:Bi(Di,{defaultSpringLength:30,defaultElectricalCharge:100}),SelectionMoved:dr=>dr.diagram.layout.invalidateLayout(),model:Bi(Mi.FJ,{linkKeyProperty:"key",makeUniqueKeyFunction:(dr,xr)=>{let Hr=xr.key||1;for(;dr.findNodeDataForKey(Hr);)Hr++;return xr.key=Hr,Hr},makeUniqueLinkKeyFunction:(dr,xr)=>{let Hr=xr.key||-1;for(;dr.findLinkDataForKey(Hr);)Hr--;return xr.key=Hr,Hr}})});Fi.toolManager.draggingTool.doMouseMove=function(){Mi.h1.prototype.doMouseMove.call(this),this.isActive&&this.diagram.layout.doLayout(!0)},Fi.nodeTemplate=Bi(Mi.NB,"Auto",{minSize:new Mi.$u(100,100)},Bi(Mi.bn,"Circle",{stroke:"white",spot1:new Mi.z6(0,0,5,5),spot2:new Mi.z6(1,1,-5,-5)},new Mi.KX("fill","bgcolor")),Bi(Mi.al,{font:"bold 10pt helvetica, bold arial, sans-serif",stroke:"white",textAlign:"center",maxSize:new Mi.$u(100,NaN)},new Mi.KX("text","text")),{click(dr,xr){mr(!1),Ar(xr==null?void 0:xr.data),Oa({left:0,top:0,bottom:0,right:0})}}),Fi.linkTemplate=Bi(Mi.rU,{layerName:"Background"},Bi(Mi.bn,{stroke:"black"}),Bi(Mi.bn,{toArrow:"standard",stroke:null}),Bi(Mi.s_,"Auto",Bi(Mi.bn,{fill:Bi(Mi.BD,"Radial",{0:"rgb(240, 240, 240)",.3:"rgb(240, 240, 240)",1:"rgba(240, 240, 240, 0)"}),stroke:null}),Bi(Mi.al,{textAlign:"center",font:"10pt helvetica, arial, sans-serif",stroke:"#555555",margin:4},new Mi.KX("text","text")))),Fi.doubleClick=!1,Fi.allowDoubleClick=!1,Fi.allowSelect="single",Fi.commandHandler.canDeleteSelection=!1,Fi.commandHandler.canUndo=!1,Fi.allowInsert=!1;const In=Fi.toolManager.clickSelectingTool;return In.canStartMulti=!1,Bo.current=Fi,Fi}function ql(Bi,Fi){return Bi==="left"?Fi?Mi.z6.Left:Mi.z6.Right:Fi?Mi.z6.Right:Mi.z6.Left}function tu(){var Bi,Fi,In,dr;ia(600),(Fi=(Bi=ho.current)==null?void 0:Bi.zoomToFit)==null||Fi.call(Bi),(dr=(In=Bo.current)==null?void 0:In.zoomToFit)==null||dr.call(In)}return pt.createElement("div",{ref:Wi,style:{paddingBottom:20,background:"#FFF",position:"relative",height:"100vh"}},pt.createElement(fe.Z,{spinning:Pt},(Kn==null?void 0:Kn.is_root)&&pt.createElement(xn.Z,{ButtonClick:()=>xi(void 0,null,function*(){gr(!0);let Bi=yield(0,Dt.ZP)("/api/knowledge_graphs/set_root.json",{method:"post",body:{type:2,identifier:cn.virtual_spacesId,virtual_module_id:window.localStorage.getItem("vtrsModuleId")}});gr(!1),Bi.status===0&&gs()}),buttonProps:{type:"primary"},ButtonText:Gs&&"\u65B0\u589E\u8282\u70B9",ButtonTwo:Gs&&pt.createElement(Jt.ZP,{style:{marginLeft:20},onClick:()=>{Tr(!0)},type:"primary"},"\u6587\u4EF6\u5BFC\u5165"),styles:{margin:"auto",paddingTop:100}}),!(Kn!=null&&Kn.is_root)&&pt.createElement("div",{style:{height:60,border:"1px solid #e7e7e7",display:"flex"}},pt.createElement("div",{onClick:()=>{ji(!0),Ar({})},className:Zn?di.headeractivite:di.header},pt.createElement("div",null," ",pt.createElement("i",{className:"iconfont icon-zhishishu"})),pt.createElement("div",null,"\u77E5\u8BC6\u6811")),pt.createElement("div",{onClick:()=>{ji(!1),Ar({})},className:Zn?di.header:di.headeractivite},pt.createElement("div",null," ",pt.createElement("i",{className:"iconfont icon-guanxitu"})),pt.createElement("div",null,"\u5173\u7CFB\u56FE")),pt.createElement("div",{onClick:()=>{var Bi,Fi,In,dr,xr=Zn?ho.current.viewportBounds.width:Bo.current.viewportBounds.width,Hr=Zn?ho.current.viewportBounds.height:Bo.current.viewportBounds.height;(Fi=(Bi=ho.current)==null?void 0:Bi.zoomToRect)==null||Fi.call(Bi,new Mi.UL(1,1,xr/1.1,Hr/1.1)),(dr=(In=Bo.current)==null?void 0:In.zoomToRect)==null||dr.call(In,new Mi.UL(1,1,xr/1.1,Hr/1.1))},className:di.header},pt.createElement("div",null," ",pt.createElement("i",{className:"iconfont icon-fangda3"})),pt.createElement("div",null,"\u653E\u5927")),pt.createElement("div",{onClick:()=>{var Bi,Fi,In,dr,xr=Zn?ho.current.viewportBounds.width:Bo.current.viewportBounds.width,Hr=Zn?ho.current.viewportBounds.height:Bo.current.viewportBounds.height;(Fi=(Bi=ho.current)==null?void 0:Bi.zoomToRect)==null||Fi.call(Bi,new Mi.UL(1,1,xr*1.1,Hr*1.1)),(dr=(In=Bo.current)==null?void 0:In.zoomToRect)==null||dr.call(In,new Mi.UL(1,1,xr*1.1,Hr*1.1))},className:di.header},pt.createElement("div",null," ",pt.createElement("i",{className:"iconfont icon-suoxiao3"})),pt.createElement("div",null,"\u7F29\u5C0F")),pt.createElement("div",{onClick:()=>{var Bi,Fi,In,dr;ia(600),(Fi=(Bi=ho.current)==null?void 0:Bi.zoomToFit)==null||Fi.call(Bi),(dr=(In=Bo.current)==null?void 0:In.zoomToFit)==null||dr.call(In)},className:di.header},pt.createElement("div",null," ",pt.createElement("i",{className:"iconfont icon-zishiying"})),pt.createElement("div",null,"\u6700\u4F73\u9002\u5E94")),pt.createElement("div",{onClick:()=>xi(void 0,null,function*(){var Bi;hl(!0);let Fi=yield(0,Dt.ZP)("/api/knowledge_graphs.json",{method:"get",params:{type:2,identifier:cn.virtual_spacesId}});Fi.status===0&&(ao(Fi==null?void 0:Fi.list),so(Fi==null?void 0:Fi.knowledge_graphs),io((Bi=Fi==null?void 0:Fi.list)==null?void 0:Bi.map(In=>In.key)))}),className:di.header},pt.createElement("div",null," ",pt.createElement("i",{className:"iconfont icon-chazhao"})),pt.createElement("div",null,"\u67E5\u627E")),Gs&&pt.createElement("div",{onClick:()=>{Tr(!0)},className:di.header},pt.createElement("div",null," ",pt.createElement("i",{className:"iconfont icon-daoru"})),pt.createElement("div",null,"\u5BFC\u5165")),pt.createElement("div",{style:{flex:1,textAlign:"end",lineHeight:"60px"}},Gs&&pt.createElement(Pe.Z,{title:"\u5386\u53F2\u8BB0\u5F55"},pt.createElement("i",{className:`iconfont icon-lishijilu ${di.ehover}`,onClick:()=>xi(void 0,null,function*(){var Bi;let Fi=yield(0,Dt.ZP)("/api/knowledge_graphs/history.json",{method:"get",params:{identifier:cn.virtual_spacesId,limit:10,type:2,page:os}});Fi.status===0&&(Ps(!0),((Bi=Fi==null?void 0:Fi.histories)==null?void 0:Bi.length)<10&&ea(!1),no(Fi==null?void 0:Fi.histories))}),style:{marginRight:30}})),Gs&&pt.createElement(Pe.Z,{title:"\u6E05\u7A7A\u6240\u6709\u6570\u636E",getPopupContainer:()=>Wi.current},pt.createElement("i",{onClick:()=>{me.default.confirm({title:"\u63D0\u793A",icon:null,centered:!0,getContainer:()=>Wi.current,content:"\u8BF7\u786E\u5B9A\u662F\u5426\u5C06\u77E5\u8BC6\u56FE\u8C31\u6240\u6709\u7684\u6570\u636E\u6E05\u7A7A\uFF0C\u6062\u590D\u7A7A\u72B6\u6001\uFF0C\u6E05\u7A7A\u540E\u6570\u636E\u4E0D\u53EF\u6062\u590D\uFF01\u672C\u6B21\u6E05\u7A7A\u4E0D\u4F1A\u5F71\u54CD\u5230\u8BFE\u7A0B\u7AE0\u8282\u5185\u5BB9\uFF0C\u4EC5\u4F5C\u7528\u4E8E\u77E5\u8BC6\u56FE\u8C31\u7684\u6570\u636E\u3002",onOk:()=>xi(void 0,null,function*(){(yield(0,Dt.ZP)("/api/knowledge_graphs/delete_all.json",{method:"DELETE",body:{type:2,identifier:cn.virtual_spacesId,virtual_module_id:window.localStorage.getItem("vtrsModuleId")}})).status===0&&(gs(),Ar({}))})})},className:`iconfont icon-shanchu14 ${di.dhover}`})),Gs&&pt.createElement(Pe.Z,{title:"\u540C\u6B65\u8BFE\u7A0B\u77E5\u8BC6\u7ED3\u6784",getPopupContainer:()=>Wi.current},pt.createElement("i",{onClick:()=>{me.default.confirm({title:"\u63D0\u793A",icon:null,centered:!0,getContainer:()=>Wi.current,content:"\u8BF7\u786E\u5B9A\u662F\u5426\u5C06\u540C\u6B65\u8BFE\u7A0B\u77E5\u8BC6\u7ED3\u6784\uFF0C\u66F4\u65B0\u540E\u539F\u6709\u77E5\u8BC6\u7ED3\u6784\u5C06\u88AB\u8986\u76D6\uFF0C\u8986\u76D6\u540E\u4E0D\u53EF\u64A4\u9500\u6062\u590D\u3002",onOk:()=>xi(void 0,null,function*(){gr(!0);let Bi=yield(0,Dt.ZP)("/api/knowledge_graphs/sync.json",{method:"post",body:{identifier:cn.pathId,type:2}});gr(!1),Bi.status===0&&gs()})})},style:{margin:"0px 30px"},className:`iconfont icon-jiazai_shuaxin_o ${di.ehover}`})),Gs&&pt.createElement(je.Z,{getPopupContainer:()=>Wi.current,menu:{items:[{key:"1",style:{width:100},label:pt.createElement("a",{href:`${en.Z.API_SERVER}/api/knowledge_graphs/export.xlsx?identifier=${cn.virtual_spacesId}&type=2`},"\u5BFC\u51FAExcel")},{key:"2",label:pt.createElement("a",{href:`${en.Z.API_SERVER}/api/knowledge_graphs/export.json?identifier=${cn.virtual_spacesId}&type=2`},"\u5BFC\u51FAWord")}]}},pt.createElement("i",{className:`iconfont icon-xiazai6 ${di.ehover}`})),pt.createElement("i",{onClick:()=>{(0,vi.vp)()?(Pn(!1),(0,vi.BU)()):(Pn(!0),(0,vi.Dj)(Wi.current)),tu()},style:{marginLeft:30,marginRight:20},className:`iconfont ${li?"icon-tuichuquanping3":"icon-quanping4"} ${di.ehover}`}))),pt.createElement("div",{className:"relative"},!Zn&&pt.createElement(on,{ref:_e,divClassName:"diagram-component",style:{backgroundColor:"#fff",height:li?"calc(100vh - 100px)":540,visibility:Kn!=null&&Kn.is_root?"hidden":"visible"},initDiagram:Ca,nodeDataArray:Kn==null?void 0:Kn.nodeData,linkDataArray:Kn==null?void 0:Kn.linkData}),pt.createElement("div",{id:"myDiagramDiv",style:{height:li?"calc(100vh - 100px)":540,width:"100%",visibility:Kn!=null&&Kn.is_root?"hidden":Zn?"visible":"hidden",position:Zn?"relative":"absolute"}})),pt.createElement("div",null,!(Kn!=null&&Kn.is_root)&&Oe.map((Bi,Fi)=>pt.createElement("span",{style:{marginLeft:Fi===0&&20,marginRight:30}},pt.createElement("span",{style:{marginRight:6,width:16,height:8,background:Ti[Fi],display:"inline-flex",borderRadius:4}}),pt.createElement("span",{style:{color:"#9096A3"}},Bi))))),pt.createElement("div",{style:{zIndex:1e3}},pt.createElement(Vi(),{disabled:ta,bounds:Ba,onStart:(Bi,Fi)=>ha(Bi,Fi)},pt.createElement("div",{ref:Vs,style:{position:"fixed",cursor:"move",right:0,top:li?60:260,zIndex:12}},pt.createElement("div",{onMouseOver:()=>{ta&&jn(!vn)},onMouseOut:()=>{jn(!0)}},Un.id&&pt.createElement("div",{className:di.rightmodal},pt.createElement(fe.Z,{spinning:Pt},pt.createElement("div",{style:{display:"flex",padding:25,paddingBottom:0}},pt.createElement("div",{className:di.title},Un.text," ",qn&&pt.createElement("i",{onClick:()=>{pn(!0),Dr.setFieldsValue({name:Un.text})},className:"iconfont icon-bianji3",style:{marginLeft:14,color:"#666666",cursor:"pointer"}})),pt.createElement("div",null,pt.createElement("i",{style:{cursor:"pointer"},onClick:()=>{var Bi,Fi;if(qn){mr(!1);return}Ar({}),(Bi=ho.current)==null||Bi.clearSelection(),(Fi=Bo.current)==null||Fi.clearSelection()},className:"iconfont icon-danchuangguanbi"}))),pt.createElement("div",{style:{maxHeight:580,overflow:"auto",padding:25,paddingTop:0}},qn&&pt.createElement("div",{style:{marginTop:25}},pt.createElement("span",{className:di.button,onClick:()=>{if(Un.unit_type>=4||Un.unit_type===0){Un.unit_type===0?$t.ZP.info("\u6839\u8282\u70B9\u6682\u4E0D\u652F\u6301\u63D2\u5165\u77E5\u8BC6\u70B9"):$t.ZP.info("\u77E5\u8BC6\u70B9\u4E3A\u6700\u5C0F\u5355\u4F4D\u6682\u4E0D\u652F\u6301\u63D2\u5165\u77E5\u8BC6\u70B9");return}Dr.setFieldsValue({name:""}),Tn(!0)}},pt.createElement("i",{style:{marginRight:8},className:"iconfont icon-charuzhishidian1"})," \u63D2\u5165\u77E5\u8BC6\u70B9"),pt.createElement("span",{className:di.button,onClick:()=>{if(Un.unit_type>=4){$t.ZP.info("\u77E5\u8BC6\u70B9\u4E3A\u6700\u5C0F\u5355\u4F4D\u6682\u4E0D\u652F\u6301\u63D2\u5165\u77E5\u8BC6\u5355\u5143");return}Dr.setFieldsValue({name:"",unit_type:3,url:""}),Fr(!0)}},pt.createElement("i",{style:{marginRight:8},className:"iconfont icon-charuzhishidanyuan"})," \u63D2\u5165\u77E5\u8BC6\u5355\u5143"),pt.createElement("span",{className:di.button,onClick:()=>{me.default.confirm({icon:null,title:"\u63D0\u793A",centered:!0,getContainer:()=>Wi.current,content:"\u5220\u9664\u8BE5\u8282\u70B9\u4F1A\u5BFC\u81F4\u5B83\u7684\u5B50\u8282\u70B9\u4E00\u5E76\u5220\u9664\uFF0C\u5220\u9664\u8282\u70B9\u4E0D\u4F1A\u5F71\u54CD\u5230\u8BFE\u7A0B\u7AE0\u8282\u5185\u5BB9\uFF0C\u5220\u9664\u540E\uFF0C\u6570\u636E\u4E0D\u53EF\u6062\u590D\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664",onOk:()=>xi(void 0,null,function*(){gr(!0);let Bi=yield(0,Dt.ZP)(`/api/knowledge_graphs/${Un.id}.json`,{method:"DELETE"});gr(!1),(Bi==null?void 0:Bi.status)===0&&(Ar({}),gs())})})}},pt.createElement("i",{style:{marginRight:8},className:"iconfont icon-shanchujiedian"})," \u5220\u9664\u8282\u70B9"),pt.createElement("span",{className:di.button,onClick:()=>xi(void 0,null,function*(){var Bi;sn(!0);let Fi=yield(0,Dt.ZP)("/api/knowledge_graphs.json",{method:"get",params:{identifier:cn.pathId,type:2}});Fi.status===0&&(ao(Fi==null?void 0:Fi.list),so(Fi==null?void 0:Fi.knowledge_graphs),io((Bi=Fi==null?void 0:Fi.list)==null?void 0:Bi.map(In=>In.key)))})},pt.createElement("i",{style:{marginRight:8},className:"iconfont icon-guanxi"})," \u5173\u7CFB")),qn&&pt.createElement("div",{style:{marginTop:20}},pt.createElement("div",{className:di.linetitles},pt.createElement("span",{className:di.line}),"\u5C5E\u6027"),Un.unit_type!=4&&Un.unit_type>0&&pt.createElement("div",{style:{paddingLeft:8}},pt.createElement("label",{className:di.lebels},"\u7C7B\u578B"),pt.createElement(De.default,{size:"large",getPopupContainer:()=>Wi.current,style:{width:"100%",marginTop:6},value:Un.unit_type,onChange:Bi=>xi(void 0,null,function*(){Un.unit_type=Bi,Ar(It({},Un)),gr(!0);let Fi=yield(0,Dt.ZP)(`/api/knowledge_graphs/${Un.id}.json`,{method:"put",body:{unit_type:Bi}});gr(!1),Fi.status===0&&(pn(!1),gs())}),placeholder:"\u8BF7\u9009\u62E9\u7C7B\u578B"},pt.createElement(De.default.Option,{value:1},"\u8BFE\u4EF6"),pt.createElement(De.default.Option,{value:3},"\u6587\u672C"),pt.createElement(De.default.Option,{value:2},"\u5B9E\u8BAD"),pt.createElement(De.default.Option,{value:5},"\u8003\u8BD5"),pt.createElement(De.default.Option,{value:6},"\u4F5C\u4E1A"),pt.createElement(De.default.Option,{value:7},"\u7EC3\u4E60"),pt.createElement(De.default.Option,{value:8},"\u89C6\u9891"))),pt.createElement("div",{style:{paddingLeft:8,marginTop:15}},pt.createElement("label",{className:di.lebels,style:{display:"flex"}},"\u8DF3\u8F6C\u5730\u5740"),pt.createElement(Yt.default,{size:"large",value:Un.url,onChange:Bi=>{Un.url=Bi.target.value,Ar(It({},Un))},disabled:vn,onBlur:Bi=>xi(void 0,null,function*(){if(jn(!1),Bi.target.value){var Fi=new RegExp(/^(https?:\/\/)?([\w.-]+)\.([a-z]{2,})(\/\S*)?$/,"i");if(!Fi.test(Bi.target.value)){$t.ZP.info("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u8DF3\u8F6C\u5730\u5740");return}}gr(!0);let In=yield(0,Dt.ZP)(`/api/knowledge_graphs/${Un.id}.json`,{method:"put",body:{url:Bi.target.value}});gr(!1),Yn(!0),In.status===0&&(pn(!1),gs())}),style:{width:"81%",marginTop:6}}),pt.createElement("i",{onClick:()=>{Yn(!1)},className:"iconfont icon-bianji3",style:{marginLeft:12,marginRight:20,color:"#666666",cursor:"pointer"}}),pt.createElement("span",{className:di.button,style:{marginRight:0},onClick:()=>{if(!Un.url){$t.ZP.info("\u94FE\u63A5\u4E0D\u80FD\u4E3A\u7A7A");return}window.open(Un.url)}},"\u8DF3\u8F6C"))),qn&&pt.createElement("div",{style:{marginTop:20}},pt.createElement("div",{className:di.linetitles},pt.createElement("span",{className:di.line}),"\u5173\u7CFB"),($e=Un==null?void 0:Un.relations)==null?void 0:$e.map((Bi,Fi)=>pt.createElement("div",{style:{display:"flex",paddingLeft:8}},pt.createElement("div",{className:di.multi_ellipsis1},"\u4E0E\u8282\u70B9\u201C",pt.createElement("span",{style:{fontWeight:600,color:"#000000"}},Bi.name),"\u201D\u4E3A",Bi.relation,"\u5173\u7CFB"),pt.createElement("div",{style:{width:"10%",textAlign:"end"}},pt.createElement("i",{onClick:()=>{me.default.confirm({icon:null,title:"\u63D0\u793A",getContainer:()=>Wi.current,centered:!0,content:"\u8BF7\u786E\u8BA4\u662F\u5426\u5C06\u8282\u70B9\u4E4B\u95F4\u7684\u5173\u7CFB\u89E3\u7ED1",onOk:()=>xi(void 0,null,function*(){var In;gr(!0);let dr=yield(0,Dt.ZP)(`/api/knowledge_graphs/${Un==null?void 0:Un.id}/delete_relation.json`,{method:"POST",body:{relation_id:Bi.relation_id}});gr(!1),dr.status===0&&((In=Un.relations)==null||In.splice(Fi,1),Ar(It({},Un)),gs())})})},className:`${di.dhover} iconfont icon-shanchu10`}))))),!qn&&pt.createElement("div",{style:{marginTop:20}},pt.createElement("div",{className:di.linetitles},pt.createElement("span",{className:di.line}),"\u5B66\u4E60\u8D44\u6E90"),(pi=Un==null?void 0:Un.sub_knowledge_graphs)==null?void 0:pi.map((Bi,Fi)=>{var In,dr;return pt.createElement("div",{className:di.a,onClick:()=>{window.open(Bi==null?void 0:Bi.url)},style:{display:"flex",paddingLeft:8,alignItems:"center",cursor:"pointer"}},pt.createElement("i",{className:"iconfont icon-lianjie2",style:{marginRight:10,fontSize:12}}),pt.createElement("span",{className:`${di.multi_ellipsis1} ${di.a}`,style:{fontWeight:600,marginTop:0,width:"90%",display:"inline-flex"}}," \u3010",((dr=(In=rn==null?void 0:rn.filter(xr=>Bi.type===xr.type))==null?void 0:In[0])==null?void 0:dr.name)||"\u6587\u672C","\u3011 ",Bi.name," "),pt.createElement("div",null,"\u67E5\u770B"))})),!qn&&pt.createElement("div",{style:{marginTop:20}},pt.createElement("div",{className:di.linetitles},pt.createElement("span",{className:di.line}),"\u5B58\u5728\u5173\u7CFB\u7684\u77E5\u8BC6\u8282\u70B9"),(Ei=Un==null?void 0:Un.relations)==null?void 0:Ei.map((Bi,Fi)=>pt.createElement("div",{className:di.a,onClick:()=>{var In,dr,xr,Hr,ro,Ro,jo,Uo,Qa,ka,yo,$r;(In=ho.current)==null||In.clearSelection(),(dr=Bo.current)==null||dr.clearSelection();const zr=(Hr=(xr=Bo.current)==null?void 0:xr.findNodeForKey)==null?void 0:Hr.call(xr,Bi==null?void 0:Bi.relation_id),fs=(Ro=(ro=ho.current)==null?void 0:ro.findNodeForKey)==null?void 0:Ro.call(ro,Bi==null?void 0:Bi.relation_id);(Uo=(jo=ho.current)==null?void 0:jo.commandHandler)==null||Uo.scrollToPart(fs),(ka=(Qa=Bo.current)==null?void 0:Qa.commandHandler)==null||ka.scrollToPart(zr),zr&&(zr.isSelected=!0),fs&&(fs.isSelected=!0);let bn=($r=(yo=Kn==null?void 0:Kn.nodeData)==null?void 0:yo.filter(qo=>(qo==null?void 0:qo.id)===(Bi==null?void 0:Bi.relation_id)))==null?void 0:$r[0];Ar(It({},bn))},style:{display:"flex",paddingLeft:8,cursor:"pointer"}},pt.createElement("div",{className:di.multi_ellipsis1},"\u3010",Bi.relation,"\u3011",Bi.name)))),pt.createElement("div",{style:{marginTop:20}},pt.createElement("div",{className:di.linetitles},pt.createElement("span",{className:di.line}),"\u63CF\u8FF0",pt.createElement("div",{style:{flex:1,textAlign:"end"}},qn&&pt.createElement("span",{onClick:()=>{mn({add:!0,name:""}),Dr.setFieldsValue({describe:""})},className:di.additem},pt.createElement("i",{style:{fontSize:12},className:"iconfont icon-tianjiashitixiaojiahao"})," \u6DFB\u52A0"))),pt.createElement("div",{style:{height:200,overflow:"auto"}},(Me=Un.descriptions)==null?void 0:Me.map((Bi,Fi)=>pt.createElement("div",{className:di.describe},pt.createElement("div",{className:di.describetitle},pt.createElement("div",{style:{fontSize:14,color:"#000000",fontWeight:500}},"\u63CF\u8FF0",Fi+1),qn&&pt.createElement("div",null,pt.createElement("i",{onClick:()=>{mn({index:Fi,name:Bi}),Dr.setFieldsValue({describe:Bi})},style:{marginRight:10},className:`iconfont icon-bianji-moren ${di.ehover}`}),pt.createElement("i",{onClick:()=>{me.default.confirm({icon:null,title:"\u63D0\u793A",getContainer:()=>Wi.current,centered:!0,content:"\u5220\u9664\u63CF\u8FF0\u540E\uFF0C\u6570\u636E\u4E0D\u53EF\u6062\u590D\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664",onOk:()=>xi(void 0,null,function*(){var In;(In=Un.descriptions)==null||In.splice(Fi,1),Ar(It({},Un)),gr(!0);let dr=yield(0,Dt.ZP)(`/api/knowledge_graphs/${Un.id}.json`,{method:"put",body:{descriptions:Un.descriptions}});gr(!1),dr.status===0&&(pn(!1),gs())})})},className:`iconfont icon-shanchutimu ${di.dhover}`}))),pt.createElement(Ne.Z,{value:Bi||""})))),!qn&&Gs&&pt.createElement("div",{style:{textAlign:"center",marginTop:10}},pt.createElement(Jt.ZP,{type:"primary",style:{width:120},onClick:()=>{mr(!0)}},"\u7F16\u8F91")))))))))),pt.createElement(me.default,{open:bi,centered:!0,title:"\u7F16\u8F91",getContainer:()=>Wi.current,onCancel:()=>pn(!1),okButtonProps:{loading:kn},onOk:()=>{Dr.submit()}},pt.createElement(ce.default,{size:"large",form:Dr,onFinish:Bi=>xi(void 0,null,function*(){zn(!0);let Fi=yield(0,Dt.ZP)(`/api/knowledge_graphs/${Un.id}.json`,{method:"put",body:{type:2,name:Bi.name}});zn(!1),Fi.status===0&&(Zn&&(Un.text=Bi.name,Ar(Un)),pn(!1),$t.ZP.info("\u4FEE\u6539\u6210\u529F"),gs())})},pt.createElement(ce.default.Item,{name:"name",label:"\u540D\u79F0",rules:[{required:!0,validator:(Bi,Fi)=>{var In;return((In=Fi==null?void 0:Fi.replaceAll(" ",""))==null?void 0:In.length)>0?Promise.resolve():Promise.reject("\u8BF7\u8F93\u5165\u540D\u79F0")}}]},pt.createElement(Yt.default,{maxLength:30})))),pt.createElement(me.default,{open:Bn,centered:!0,title:"\u63D2\u5165\u77E5\u8BC6\u70B9",getContainer:()=>Wi.current,onCancel:()=>Tn(!1),okButtonProps:{loading:kn},onOk:()=>{Dr.submit()}},pt.createElement(ce.default,{size:"large",form:Dr,onFinish:Bi=>xi(void 0,null,function*(){zn(!0);let Fi=yield(0,Dt.ZP)("/api/knowledge_graphs.json",{method:"post",body:se(It({},Bi),{unit_type:4,type:2,identifier:cn.virtual_spacesId,parent_id:Un.id,virtual_module_id:window.localStorage.getItem("vtrsModuleId")})});zn(!1),Fi.status===0&&(Tn(!1),gs(),$t.ZP.info("\u63D2\u5165\u77E5\u8BC6\u70B9\u6210\u529F"))})},pt.createElement(ce.default.Item,{name:"name",label:"\u77E5\u8BC6\u70B9\u540D\u79F0",rules:[{required:!0,validator:(Bi,Fi)=>{var In;return((In=Fi==null?void 0:Fi.replaceAll(" ",""))==null?void 0:In.length)>0?Promise.resolve():Promise.reject("\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0")}}]},pt.createElement(Yt.default,{maxLength:20})))),pt.createElement(me.default,{open:or,centered:!0,width:550,title:"\u63D2\u5165\u77E5\u8BC6\u5355\u5143",getContainer:()=>Wi.current,onCancel:()=>Fr(!1),okButtonProps:{loading:kn},onOk:()=>{Dr.submit()}},pt.createElement(ce.default,{size:"large",form:Dr,labelCol:{span:5},onFinish:Bi=>xi(void 0,null,function*(){let Fi=yield(0,Dt.ZP)("/api/knowledge_graphs.json",{method:"post",body:se(It({},Bi),{type:2,identifier:cn.virtual_spacesId,parent_id:Un.id,virtual_module_id:window.localStorage.getItem("vtrsModuleId")})});zn(!1),Fi.status===0&&(Fr(!1),gs(),$t.ZP.info("\u63D2\u5165\u77E5\u8BC6\u5355\u5143\u6210\u529F"))})},pt.createElement(ce.default.Item,{name:"name",label:"\u77E5\u8BC6\u5355\u5143\u540D\u79F0",rules:[{required:!0,validator:(Bi,Fi)=>{var In;return((In=Fi==null?void 0:Fi.replaceAll(" ",""))==null?void 0:In.length)>0?Promise.resolve():Promise.reject("\u8BF7\u8F93\u5165\u77E5\u8BC6\u5355\u5143\u540D\u79F0")}}]},pt.createElement(Yt.default,{placeholder:"\u8BF7\u8F93\u5165\u77E5\u8BC6\u5355\u5143\u540D\u79F0",maxLength:20})),pt.createElement(ce.default.Item,{name:"unit_type",label:"\u7C7B\u578B"},pt.createElement(De.default,{getPopupContainer:()=>Wi.current,placeholder:"\u8BF7\u9009\u62E9\u7C7B\u578B"},pt.createElement(De.default.Option,{value:1},"\u8BFE\u4EF6"),pt.createElement(De.default.Option,{value:3},"\u6587\u672C"),pt.createElement(De.default.Option,{value:2},"\u5B9E\u8BAD"),pt.createElement(De.default.Option,{value:5},"\u8003\u8BD5"),pt.createElement(De.default.Option,{value:6},"\u4F5C\u4E1A"),pt.createElement(De.default.Option,{value:7},"\u7EC3\u4E60"),pt.createElement(De.default.Option,{value:8},"\u89C6\u9891"))),pt.createElement(ce.default.Item,{name:"url",label:"\u8DF3\u8F6C\u5730\u5740",rules:[{pattern:new RegExp(/^(https?:\/\/)?([\w.-]+)\.([a-z]{2,})(\/\S*)?$/,"i"),message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u5730\u5740"}]},pt.createElement(Yt.default,{placeholder:"\u8BF7\u8F93\u5165\u70B9\u51FB\u8BE5\u8282\u70B9\u8DF3\u8F6C\u7684\u94FE\u63A5\u5730\u5740"})))),Cr&&pt.createElement(me.default,{open:Cr,centered:!0,width:550,title:"\u6DFB\u52A0\u5173\u7CFB",getContainer:()=>Wi.current,onCancel:()=>{Qr(""),sn(!1)},okButtonProps:{loading:kn},onOk:()=>{if(!po){$t.ZP.info("\u8BF7\u5148\u9009\u62E9\u8282\u70B9");return}sn(!1),jr(!0),Dr.setFieldsValue({relation:1}),be("")}},pt.createElement(Yt.default.Search,{size:"large",onChange:Bi=>{let Fi=Bi.target.value;const In=ps.filter(dr=>dr.title.indexOf(Fi)>-1).map(dr=>dr.key);io(In),rs(!0),be(Bi.target.value)}}),pt.createElement(Vt.default,{onExpand:Bi=>{io(Bi),rs(!1)},style:{maxHeight:300,height:300,marginTop:20,overflow:"auto"},onSelect:Bi=>{console.log("---",Bi),Qr(Bi==null?void 0:Bi[0])},expandedKeys:bo,defaultExpandAll:!0,autoExpandParent:Oo,treeData:fl})),(Gi.name||Gi.add)&&pt.createElement(me.default,{open:Gi.name||Gi.add,title:"\u63CF\u8FF0",width:900,getContainer:()=>Wi.current,centered:!0,onCancel:()=>{mn("")},okButtonProps:{loading:kn},onOk:()=>{Dr.submit()}},pt.createElement(ce.default,{form:Dr,onFinish:Bi=>xi(void 0,null,function*(){zn(!0),Gi.add?(Un.descriptions.push(Bi.describe),Ar(It({},Un))):(Un.descriptions[Gi.index]=Bi.describe,Ar(It({},Un)));let Fi=yield(0,Dt.ZP)(`/api/knowledge_graphs/${Un.id}.json`,{method:"put",body:{type:2,descriptions:Un.descriptions}});zn(!1),mn(""),Fi.status===0&&(pn(!1),gs())})},pt.createElement(ce.default.Item,{name:"describe",style:{marginBottom:-10},rules:[{required:!0,validator:(Bi,Fi)=>{var In;return((In=Fi==null?void 0:Fi.replaceAll(" ",""))==null?void 0:In.length)>0?Promise.resolve():Promise.reject("\u8BF7\u8F93\u5165\u63CF\u8FF0\u5185\u5BB9")}}]},pt.createElement(zt.Z,{placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u5185\u5BB9\uFF0C\u6700\u5927\u9650\u5236\u4E3A65000\u4E2A\u5B57\u7B26",watch:!0,defaultValue:Gi.name})))),pt.createElement(me.default,{title:"\u6587\u4EF6\u5BFC\u5165",open:wr,centered:!0,getContainer:()=>Wi.current,okButtonProps:{loading:kn},onCancel:()=>{Tr(!1),Xr([])},onOk:()=>xi(void 0,null,function*(){var Bi;const Fi=new FormData;if(Lr.length>0)Fi.append("file",Lr[0]);else{$t.ZP.warning("\u8BF7\u9009\u62E9\u6587\u4EF6");return}zn(!0),Fi.append("ec_year_id",cn.ec_year_id),Fi.append("identifier",cn.virtual_spacesId),Fi.append("type","2"),Fi.append("virtual_module_id",window.localStorage.getItem("vtrsModuleId"));let In=yield(0,Dt.ZP)("/api/knowledge_graphs/import.json",{method:"post",body:Fi},!0);zn(!1),(In==null?void 0:In.status)===0&&(((Bi=In==null?void 0:In.fail)==null?void 0:Bi.length)>0&&me.default.confirm({icon:null,title:"\u5BFC\u5165\u5931\u8D25",content:pt.createElement("span",null,"\u68C0\u6D4B\u5230\u672C\u6B21\u5BFC\u5165\u5B58\u5728\u4E0D\u7B26\u5408\u8981\u6C42\u7684\u6570\u636E\uFF0C\u70B9\u51FB\u4E0B\u8F7D",pt.createElement("a",{href:`${en.Z.API_SERVER}${In==null?void 0:In.url}`,download:"\u5931\u8D25\u6570\u636E.xlsx"},"\u5BFC\u5165\u5931\u8D25\u7684\u6570\u636E"),"\u67E5\u770B")}),Xr([]),Un={},Ar({}),(In==null?void 0:In.success)>0&&$t.ZP.info("\u6DFB\u52A0\u6210\u529F"),gs(),Tr(!1))})},!(Kn!=null&&Kn.is_root)&&pt.createElement("div",{style:{marginBottom:30,color:"#333333"}},"\u68C0\u6D4B\u5F53\u524D\u5DF2\u5B58\u5728\u6570\u636E\uFF0C\u5BFC\u5165\u540E\u539F\u6570\u636E\u5C06\u4F1A\u88AB\u5220\u9664\uFF0C\u6309\u7167\u6700\u65B0\u5BFC\u5165\u7684\u4E3A\u4E3B\uFF0C\u5982\u7EE7\u7EED\u5BFC\u5165\uFF0C\u8BF7\u6309\u7167\u4E0B\u65B9\u6B65\u9AA4\u8FDB\u884C"),pt.createElement("p",{style:{color:"#5F6368"}},"\u6B65\u9AA41\uFF1A",pt.createElement("span",{style:{color:"#000000"}},"\u4E0B\u8F7D"),pt.createElement("a",{href:`${en.Z.API_SERVER}/api/knowledge_graphs/down_template.json`,download:"\u6A21\u7248.xlsx"},"\u77E5\u8BC6\u56FE\u8C31\u5BFC\u5165\u6A21\u7248")),pt.createElement(Ut.Z,null,pt.createElement(pe.Z,{style:{color:"#5F6368"}},"\u6B65\u9AA42\uFF1A",pt.createElement("span",{style:{color:"#000000"}},"\u4E0A\u4F20\u586B\u5199\u597D\u7684\u300A\u77E5\u8BC6\u56FE\u8C31\u5BFC\u5165\u6A21\u7248\u300B"))),pt.createElement(Ut.Z,{style:{marginTop:10,marginLeft:50}},pt.createElement(Xt.default,It({},Ja),pt.createElement("span",{style:{padding:"0px 16px",color:"#3061D0",cursor:"pointer",height:32,alignItems:"center",display:"inline-flex",borderRadius:2,border:"1px solid #BACFFE",background:"#F6F7F9 linear-gradient(180deg, #FFFFFF 0%, #F6F7F9 100%)",boxShadow:"0px 2px 4px 0px #E0DFE1, inset 0px 1px 3px 0px rgba(255,255,255,0.5)"}},pt.createElement("i",{style:{fontSize:12,marginRight:6},className:"iconfont icon-tianjiashitixiaojiahao"})," \u9009\u62E9\u6587\u4EF6")))),pt.createElement(me.default,{open:Pl,title:"\u6DFB\u52A0\u5173\u7CFB",width:500,getContainer:()=>Wi.current,centered:!0,onCancel:()=>{jr(!1),Dr.setFieldsValue({relation:null})},okButtonProps:{loading:kn},onOk:()=>{Dr.submit()}},pt.createElement(ce.default,{form:Dr,onFinish:Bi=>xi(void 0,null,function*(){zn(!0);let Fi=yield(0,Dt.ZP)(`/api/knowledge_graphs/${Un.id}/relation.json`,{method:"post",body:It({type:2,parent_id:po},Bi)});zn(!1),Fi.status===0&&($t.ZP.info("\u5173\u8054\u6210\u529F"),gs(),Qr(""),jr(!1),Dr.setFieldsValue({relation:null}))})},pt.createElement(ce.default.Item,{name:"relation",label:"\u7C7B\u578B"},pt.createElement(De.default,{getPopupContainer:()=>Wi.current,placeholder:"\u8BF7\u9009\u62E9\u7C7B\u578B"},pt.createElement(De.default.Option,{value:1},"\u5173\u8054"),pt.createElement(De.default.Option,{value:2},"\u540E\u5E8F"))))),Io&&pt.createElement(me.default,{open:Io,centered:!0,width:550,title:"\u67E5\u627E",getContainer:()=>Wi.current,onCancel:()=>{Qr(""),hl(!1)},okButtonProps:{loading:kn},onOk:()=>{var Bi,Fi,In,dr,xr,Hr,ro,Ro,jo,Uo;hl(!1),(Bi=ho.current)==null||Bi.clearSelection(),(Fi=Bo.current)==null||Fi.clearSelection();const Qa=(dr=(In=Bo.current)==null?void 0:In.findNodeForKey)==null?void 0:dr.call(In,po),ka=(Hr=(xr=ho.current)==null?void 0:xr.findNodeForKey)==null?void 0:Hr.call(xr,po);(Ro=(ro=ho.current)==null?void 0:ro.commandHandler)==null||Ro.scrollToPart(ka),(Uo=(jo=Bo.current)==null?void 0:jo.commandHandler)==null||Uo.scrollToPart(Qa),Qa&&(Qa.isSelected=!0,Gs&&(Oa({left:0,top:0,bottom:0,right:0}),Ar(Qa.data))),ka&&(ka.isSelected=!0,Gs&&(Oa({left:0,top:0,bottom:0,right:0}),Ar(ka.data))),Qr(""),be("")}},pt.createElement(Yt.default.Search,{size:"large",allowClear:!0,onChange:Bi=>{let Fi=Bi.target.value;const In=ps.filter(dr=>dr.title.indexOf(Fi)>-1).map(dr=>dr.key);io(In),In.length<=0?Jn(!0):Jn(!1),rs(!0),be(Bi.target.value)}}),nn?pt.createElement(xn.Z,null):pt.createElement(Vt.default,{onExpand:Bi=>{io(Bi),rs(!1)},style:{maxHeight:400,height:400,marginTop:20,overflow:"auto"},onSelect:Bi=>{Qr(Bi==null?void 0:Bi[0])},expandedKeys:bo,defaultExpandAll:!0,autoExpandParent:Oo,treeData:fl})),pt.createElement(me.default,{title:"\u5386\u53F2\u8BB0\u5F55",open:vo,onCancel:()=>Ps(!1),footer:!1},pt.createElement("div",{style:{maxHeight:200,overflow:"auto",padding:10}},pt.createElement(ur(),{initialLoad:!1,pageStart:1,threshold:20,loadMore:()=>xi(void 0,null,function*(){var Bi;$o(os+1);let Fi=yield(0,Dt.ZP)("/api/knowledge_graphs/history.json",{method:"get",params:{identifier:cn.virtual_spacesId,limit:10,page:os+1}});Fi.status===0&&(no([...Nr,...Fi==null?void 0:Fi.histories]),((Bi=Fi==null?void 0:Fi.histories)==null?void 0:Bi.length)<10&&ea(!1))}),hasMore:Hn,useWindow:!1},pt.createElement(Le.Z,{dataSource:Nr,renderItem:Bi=>pt.createElement(Le.Z.Item,{key:Bi.id},pt.createElement(Le.Z.Item.Meta,{avatar:pt.createElement(ei,{src:en.Z.IMG_SERVER+"/images/"+Bi.avatar_url}),title:pt.createElement("span",null,Bi.real_name),description:Bi.content}),pt.createElement("div",null,Bi.created_at))})))))};var yn=(0,_t.connect)(({virtualSpaces:Ke,globalSetting:Fe})=>({globalSetting:Fe,virtualSpaces:Ke}))(ln),ii=Mt(59301),Hi=Object.defineProperty,Xi=Object.defineProperties,ki=Object.getOwnPropertyDescriptors,En=Object.getOwnPropertySymbols,Fn=Object.prototype.hasOwnProperty,qi=Object.prototype.propertyIsEnumerable,rr=(Ke,Fe,ke)=>Fe in Ke?Hi(Ke,Fe,{enumerable:!0,configurable:!0,writable:!0,value:ke}):Ke[Fe]=ke,Sr=(Ke,Fe)=>{for(var ke in Fe||(Fe={}))Fn.call(Fe,ke)&&rr(Ke,ke,Fe[ke]);if(En)for(var ke of En(Fe))qi.call(Fe,ke)&&rr(Ke,ke,Fe[ke]);return Ke},Kr=(Ke,Fe)=>Xi(Ke,ki(Fe)),ze=(Ke,Fe,ke)=>new Promise(($e,pi)=>{var Ei=_e=>{try{cn(ke.next(_e))}catch(bi){pi(bi)}},Me=_e=>{try{cn(ke.throw(_e))}catch(bi){pi(bi)}},cn=_e=>_e.done?$e(_e.value):Promise.resolve(_e.value).then(Ei,Me);cn((ke=ke.apply(Ke,Fe)).next())});const gn={1:"position_and_target",2:"desc",3:"knowledge_graph",4:"knowledge"},nr=({globalSetting:Ke,dispatch:Fe,virtualSpaces:ke})=>{var $e;const[pi]=(0,_t.useSearchParams)(),[Ei,Me]=(0,pt.useState)(!0),[cn,_e]=(0,pt.useState)(!1),[bi,pn]=(0,pt.useState)(!1),[kn,zn]=(0,pt.useState)(!1),[Bn,Tn]=(0,pt.useState)({}),[or,Fr]=(0,pt.useState)(""),[Zn,ji]=(0,pt.useState)((pi==null?void 0:pi.get("active"))||"position_and_target"),{virtualSpacesDetails:Pt}=ke,gr=(0,_t.useParams)(),Un=(Pt==null?void 0:Pt.is_member)||(0,qt.Ny)(),[Ar]=ce.default.useForm();(0,pt.useEffect)(()=>{sn()},[Zn,window.localStorage.getItem("vtrsModuleId")]);const[Dr,Cr]=(0,pt.useState)([]),sn=()=>ze(void 0,null,function*(){Me(!0);let Gi=yield(0,Dt.ZP)(`/api/virtual_classrooms/${gr.virtual_spacesId}/knowledge_systems/show.json`,{method:"get",params:{column:Zn,virtual_module_id:window.localStorage.getItem("vtrsModuleId")}});if((Gi==null?void 0:Gi.status)!==-1){Tn(Sr({},Gi)),Fr((Gi==null?void 0:Gi[Zn])||"");let mn=[],Kn=[],un=[];const Wi=Gi==null?void 0:Gi.knowledge_tabs;Object.entries(Wi).forEach(([li,Pn])=>{if(Pn)switch(li){case"show_position_and_target":mn.push(1),un.push("position_and_target"),Kn.push({id:"position_and_target",name:"\u8BFE\u7A0B\u5B9A\u4F4D\u4E0E\u76EE\u6807"});break;case"show_knowledge_point":mn.push(2),un.push("desc"),Kn.push({id:"desc",name:"\u8BFE\u7A0B\u77E5\u8BC6\u70B9"});break;case"show_knowledge_graph_desc":mn.push(3),un.push("knowledge_graph"),Kn.push({id:"knowledge_graph",name:"\u77E5\u8BC6\u56FE\u8C31\u63CF\u8FF0"});break;case"show_knowledge_graph":mn.push(4),un.push("knowledge"),Kn.push({id:"knowledge",name:"\u77E5\u8BC6\u56FE\u8C31"});break;default:break}}),Ar.setFieldValue("checkData",mn),Cr([...Kn]),un!=null&&un.includes(Zn)||ji(gn[mn[0]])}Me(!1)}),vn=()=>ze(void 0,null,function*(){_e(!0);const Gi={};Gi[Zn]=or;let mn=yield(0,Dt.ZP)(`/api/virtual_classrooms/${gr.virtual_spacesId}/knowledge_systems/edit.json`,{method:"put",body:Kr(Sr({},Gi),{virtual_module_id:window.localStorage.getItem("vtrsModuleId")})});(mn==null?void 0:mn.status)!==-1&&(sn(),pn(!1)),_e(!1)}),Yn=(Gi,mn)=>{me.default.confirm({title:"\u63D0\u793A",okText:"\u786E\u5B9A\u5220\u9664",okButtonProps:{danger:!0},icon:!1,className:ue.Z.CustomTipsModalCss,cancelText:"\u53D6\u6D88",content:ii.createElement("div",null,ii.createElement("div",null,"\u786E\u8BA4\u5220\u9664 ",mn," \u5417\uFF1F"),ii.createElement("div",{className:"mt10"},"\u5220\u9664\u540E\uFF0C\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u8BF7\u8C28\u614E\u64CD\u4F5C")),onOk:()=>ze(void 0,null,function*(){const Kn=yield(0,Dt.ZP)(`/api/virtual_classrooms/${gr.virtual_spacesId}/knowledge_systems/${Gi}/del_content.json`,{method:"delete"});(Kn==null?void 0:Kn.status)!==-1&&sn()})})};return ii.createElement("section",{className:re.wrap},ii.createElement(de.YG,{value:Zn,onChange:Gi=>{Gi!==Zn&&(ji(Gi),pn(!1))},tabBarExtraContent:Un&&ii.createElement("div",{style:{display:"flex",alignItems:"center"}},ii.createElement("i",{className:"iconfont icon-a-bianzu21 font20 mr20",style:{cursor:"pointer"},onClick:()=>{zn(!0)}}),Zn==="position_and_target"&&ii.createElement(de.op,{onClick:()=>pn(!0)}," ",ii.createElement("i",{className:"iconfont icon-bianji7 font14 mr5"}),"\u7F16\u8F91"),Zn==="desc"&&ii.createElement(Ut.Z,{align:"middle"},ii.createElement(de.op,{onClick:()=>pn(!0)}," ",ii.createElement("i",{className:"iconfont icon-bianji7 font14 mr5"}),"\u7F16\u8F91\u8BF4\u660E"),ii.createElement(de.op,{onClick:()=>{_t.history.push(`/${Qt.AS}/${gr.virtual_spacesId}/knowledge/add?leftMenuId=${window.localStorage.getItem("vtrsModuleId")}`)},className:"ml20"}," ",ii.createElement("i",{className:"iconfont icon-tianjiashitixiaojiahao font14 mr5"}),"\u65B0\u589E\u77E5\u8BC6\u70B9\u6A21\u5757")),Zn==="knowledge_graph"&&ii.createElement(de.op,{onClick:()=>pn(!0)}," ",ii.createElement("i",{className:"iconfont icon-bianji7 font14 mr5"}),"\u7F16\u8F91\u77E5\u8BC6\u56FE\u8C31")),dataSource:Dr}),ii.createElement(fe.Z,{spinning:Ei},Zn!=="desc"&&ii.createElement("div",{className:Zn!=="knowledge"&&"mt20"},bi?ii.createElement(ii.Fragment,null,ii.createElement(zt.Z,{onChange:Gi=>Fr(Gi),watch:!0,defaultValue:or}),ii.createElement(de.QD,{confirmTitle:"\u4FDD\u5B58",confirmLoading:cn,confirmClick:vn,cancelClick:()=>{pn(!1),Fr(Bn[Zn]||"")},cancelTitle:"\u53D6\u6D88",className:"mb25"})):ii.createElement(Ne.Z,{value:or})),Zn==="knowledge"&&ii.createElement(yn,null),Zn==="desc"&&ii.createElement("div",{className:re.content},!!or&&ii.createElement("div",{className:re.name},ii.createElement("aside",null,"\u8BF4\u660E"),ii.createElement(Ne.Z,{value:or})),($e=Bn==null?void 0:Bn.subject_modules)==null?void 0:$e.map(Gi=>{const{members:{module_content:mn,module_name:Kn,subject_module_id:un}}=Gi;return ii.createElement("div",{className:re.list,key:un},ii.createElement("div",{className:re.head},ii.createElement("div",{className:re.models},Kn),Un&&ii.createElement("div",{className:re.btns},ii.createElement("div",{onClick:()=>_t.history.push(`/${Qt.AS}/${gr.virtual_spacesId}/knowledge/${un}/edit?leftMenuId=${window.localStorage.getItem("vtrsModuleId")}`)},ii.createElement("span",{className:"primary-hover"},ii.createElement("i",{className:"iconfont icon-bianji7 font14 mr5"}),"\u7F16\u8F91")),ii.createElement("div",{onClick:()=>Yn(un,Kn)},ii.createElement("span",{className:"delete-hover"}," ",ii.createElement("i",{className:"iconfont icon-piliangshanchubeifen font14 mr5"}),"\u5220\u9664")))),ii.createElement("div",{className:re.rowsHead},ii.createElement("div",null,"\u77E5\u8BC6\u70B9"),ii.createElement("div",null,"\u4E3B\u8981\u5185\u5BB9"),ii.createElement("div",null,"\u80FD\u529B\u76EE\u6807"),ii.createElement("div",{className:re.time},"\u5B66\u65F6"),ii.createElement("div",{style:{marginRight:0}},"\u6559\u6848")),mn==null?void 0:mn.map((Wi,li)=>{const{knowledge_point:Pn,content:wr,target:Tr,class_hour:Lr,lesson_plan:Xr}=Wi;return ii.createElement("div",{className:re.rowsBody,key:li},ii.createElement("div",null,Pn),ii.createElement("pre",null,wr),ii.createElement("pre",null,Tr),ii.createElement("div",{className:re.time},Lr),ii.createElement("div",{style:{marginRight:0}},ii.createElement(Ne.Z,{value:Xr})))}))})),ii.createElement(me.default,{title:"\u7F16\u8F91\u8BF4\u660E",destroyOnClose:!0,open:Zn==="desc"&&bi,onOk:vn,centered:!0,onCancel:()=>{pn(!1),Fr(Bn[Zn]||"")},confirmLoading:cn,width:686,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",wrapClassName:ue.Z.CustomCss},ii.createElement("div",null,"\u8BF4\u660E\uFF1A"),ii.createElement(zt.Z,{onChange:Gi=>Fr(Gi),watch:!0,defaultValue:or})),ii.createElement(me.default,{title:"\u77E5\u8BC6\u4F53\u7CFB\u6A21\u5757\u8BBE\u7F6E",destroyOnClose:!0,open:kn,onOk:()=>ze(void 0,null,function*(){var Gi,mn,Kn,un,Wi;if(((Gi=Ar.getFieldValue("checkData"))==null?void 0:Gi.length)==0)return $t.ZP.error("\u81F3\u5C11\u9700\u8981\u9009\u62E9\u4E00\u4E2A\u9009\u9879"),!1;const li=yield(0,Dt.ZP)(`/api/virtual_classrooms/${gr.virtual_spacesId}/knowledge_systems/tabs_setting.json`,{method:"put",body:{virtual_module_id:window.localStorage.getItem("vtrsModuleId"),knowledge_system_id:Bn==null?void 0:Bn.id,show_position_and_target:(mn=Ar.getFieldValue("checkData"))==null?void 0:mn.includes(1),show_knowledge_point:(Kn=Ar.getFieldValue("checkData"))==null?void 0:Kn.includes(2),show_knowledge_graph_desc:(un=Ar.getFieldValue("checkData"))==null?void 0:un.includes(3),show_knowledge_graph:(Wi=Ar.getFieldValue("checkData"))==null?void 0:Wi.includes(4)}});(li==null?void 0:li.status)!==-1&&(sn(),zn(!1))}),centered:!0,onCancel:()=>{zn(!1)},confirmLoading:cn,width:530,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",wrapClassName:ue.Z.CustomCss},ii.createElement(ce.default,{form:Ar,style:{marginBottom:"-20px",marginTop:"10px"}},ii.createElement(ce.default.Item,{name:"checkData"},ii.createElement(Ae.default.Group,null,ii.createElement(Ae.default,{value:1},"\u8BFE\u7A0B\u5B9A\u4F4D\u4E0E\u76EE\u6807"),ii.createElement(Ae.default,{value:2},"\u8BFE\u7A0B\u77E5\u8BC6\u70B9"),ii.createElement(Ae.default,{value:3},"\u77E5\u8BC6\u56FE\u8C31\u63CF\u8FF0"),ii.createElement(Ae.default,{value:4},"\u77E5\u8BC6\u56FE\u8C31")))))))};var Sn=(0,_t.connect)(({virtualSpaces:Ke,globalSetting:Fe})=>({globalSetting:Fe,virtualSpaces:Ke}))(nr)},91415:function(Li,ai,Mt){"use strict";Mt.d(ai,{BU:function(){return _t},Dj:function(){return pt},gH:function(){return ce},vp:function(){return me}});function pt(Ut){try{Ut.mozRequestFullScreen?Ut.mozRequestFullScreen():Ut.webkitRequestFullScreen&&Ut.webkitRequestFullScreen()}catch(fe){console.log(fe,":e")}}function _t(){window.top.document.webkitExitFullscreen?window.top.document.webkitExitFullscreen():document.exitFullscreen?window.top.document.exitFullscreen():document.msExitFullscreen?window.top.document.msExitFullscreen():document.mozCancelFullScreen&&window.top.document.mozCancelFullScreen()}const ce=()=>{if(document.webkitExitFullscreen)return"webkitfullscreenchange";if(document.exitFullscreen)return"fullscreenchange";if(document.msExitFullscreen)return"msfullscreenchange";if(document.mozCancelFullScreen)return"mozfullscreenchange"};function me(){var Ut=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement,fe=document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",Ut),window.isFullScreen?window.isFullScreen:Ut!=null}},901:function(Li,ai,Mt){"use strict";Mt.d(ai,{AL:function(){return Yt},Iy:function(){return de},Qv:function(){return ue},ez:function(){return De},jb:function(){return zt}});var pt=Mt(32834),_t=Mt.n(pt),ce=Mt(11690),me=Mt.n(ce);let Ut=1;function fe(Wt,Ce){const Te=Wt.match(/^(\s+)(?:```)/);if(Te===null)return Ce;const ne=Te[1];return Ce.split(`
|
|
`).map(Re=>{const ye=Re.match(/^\s+/);if(ye===null)return Re;const[Ie]=ye;return Ie.length>=ne.length?Re.slice(ne.length):Re}).join(`
|
|
`)}let $t=[],Ae=["<ul>"];const re=new(_t()).Renderer,Dt=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function de(){$t.length=0,Ae=["<ul>"]}const zt={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function Ne(Wt,Ce,Te,ne){if(Ce>=Wt.length||Wt[Ce].level<=Te)return Ce;var Re=Wt[Ce];ne.push("<li><a href='#"+Ut+Re.anchor+"'>"+Re.text+"</a>"),Ce++;var ye=[];return Ce=Ne(Wt,Ce,Re.level,ye),ye.length>0&&(ne.push("<ul>"),ye.forEach(function(Ie){ne.push(Ie)}),ne.push("</ul>")),ne.push("</li>"),Ce=Ne(Wt,Ce,Te,ne),Ce}function ue(){return Ne($t,0,0,Ae),Ae.push("</ul>"),Ae.join("")}const qt={heading(Wt){const Ce=Dt.exec(Wt);if(Ut+=1,Ce)return{type:"heading",raw:Ce[0],depth:Ce[1].length,text:Ce[2]}},fences(Wt){const Ce=this.rules.block.fences.exec(Wt);if(Ce){const Te=Ce[0];let ne=fe(Te,Ce[3]||"");const Re=Ce[2]?Ce[2].trim():Ce[2];if(["latex","katex","math"].indexOf(Re)>=0){const ye=Pe(),Ie=ne;ne=ye,je[ye]={type:"block",expression:Ie}}return{type:"code",raw:Te,lang:Re,text:ne}}}},Qt=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let Jt=0;const Pe=()=>`__special_katext_id_${Jt++}__`;let je={};function De(){return je}function Yt(){Jt=0,je={}}function Vt(Wt){return Wt=Wt.replace(Qt,(Ce,Te)=>{const ne=Pe();return je[ne]={type:"inline",expression:Te},ne}),Wt}const pe=re.listitem;re.listitem=function(Wt){return pe(Vt(Wt))};const Xt=re.paragraph;re.paragraph=function(Wt){return Xt(Vt(Wt))};const Le=re.tablecell;re.tablecell=function(Wt,Ce){return Le(Vt(Wt),Ce)},re.code=function(Wt,Ce,Te){const ne=(Ce||"").match(/\S*/)[0];return ne?["latex","katex","math"].indexOf(ne)>=0?`<p class='editormd-tex'>${Wt}</p>`:`<pre class="prettyprint linenums"><code class="language-${Ce}">${Te?Wt:(0,ce.escape)(Wt,!0)}</code></pre>
|
|
`:'<pre class="prettyprint linenums"><code>'+(Te?Wt:(0,ce.escape)(Wt,!0))+"</code></pre>"},re.heading=function(Wt,Ce,Te){let ne=this.options.headerPrefix+Te.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return $t.push({anchor:ne,level:Ce,text:Wt}),"<h"+Ce+' id="'+Ut+ne+'">'+Wt+"</h"+Ce+">"},_t().setOptions({silent:!0,gfm:!0,pedantic:!1}),_t().use({tokenizer:qt,renderer:re}),ai.ZP=_t()},26906:function(Li,ai,Mt){"use strict";Mt.d(ai,{Z:function(){return oi}});var pt=Mt(94480),_t=Mt(59301),ce=Mt(92310),me=Mt.n(ce),Ut=Mt(9981),fe=Mt(47999),$t=Mt(48755),Ae=Mt(38406),re=Mt(31756),Dt=Mt(65970),de=Mt(13783),zt=Mt(13747),Ne=Mt(29787);const ue=_t.createContext({}),qt=ue.Consumer;var Qt=Mt(22703),Jt=Mt(5472),Pe=function(Bt,bt){var ge={};for(var Ge in Bt)Object.prototype.hasOwnProperty.call(Bt,Ge)&&bt.indexOf(Ge)<0&&(ge[Ge]=Bt[Ge]);if(Bt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ye=0,Ge=Object.getOwnPropertySymbols(Bt);Ye<Ge.length;Ye++)bt.indexOf(Ge[Ye])<0&&Object.prototype.propertyIsEnumerable.call(Bt,Ge[Ye])&&(ge[Ge[Ye]]=Bt[Ge[Ye]]);return ge};const je=Bt=>{var{prefixCls:bt,className:ge,avatar:Ge,title:Ye,description:oe}=Bt,Ve=Pe(Bt,["prefixCls","className","avatar","title","description"]);const{getPrefixCls:Ze}=(0,_t.useContext)($t.E_),Ni=Ze("list",bt),Se=me()(`${Ni}-item-meta`,ge),ie=_t.createElement("div",{className:`${Ni}-item-meta-content`},Ye&&_t.createElement("h4",{className:`${Ni}-item-meta-title`},Ye),oe&&_t.createElement("div",{className:`${Ni}-item-meta-description`},oe));return _t.createElement("div",Object.assign({},Ve,{className:Se}),Ge&&_t.createElement("div",{className:`${Ni}-item-meta-avatar`},Ge),(Ye||oe)&&ie)},Yt=_t.forwardRef((Bt,bt)=>{const{prefixCls:ge,children:Ge,actions:Ye,extra:oe,styles:Ve,className:Ze,classNames:Ni,colStyle:Se}=Bt,ie=Pe(Bt,["prefixCls","children","actions","extra","styles","className","classNames","colStyle"]),{grid:ee,itemLayout:ve}=(0,_t.useContext)(ue),{getPrefixCls:ti,list:he}=(0,_t.useContext)($t.E_),We=Pi=>{var Ct,gt;return me()((gt=(Ct=he==null?void 0:he.item)===null||Ct===void 0?void 0:Ct.classNames)===null||gt===void 0?void 0:gt[Pi],Ni==null?void 0:Ni[Pi])},He=Pi=>{var Ct,gt;return Object.assign(Object.assign({},(gt=(Ct=he==null?void 0:he.item)===null||Ct===void 0?void 0:Ct.styles)===null||gt===void 0?void 0:gt[Pi]),Ve==null?void 0:Ve[Pi])},we=()=>{let Pi=!1;return _t.Children.forEach(Ge,Ct=>{typeof Ct=="string"&&(Pi=!0)}),Pi&&_t.Children.count(Ge)>1},ei=()=>ve==="vertical"?!!oe:!we(),Be=ti("list",ge),Zt=Ye&&Ye.length>0&&_t.createElement("ul",{className:me()(`${Be}-item-action`,We("actions")),key:"actions",style:He("actions")},Ye.map((Pi,Ct)=>_t.createElement("li",{key:`${Be}-item-action-${Ct}`},Pi,Ct!==Ye.length-1&&_t.createElement("em",{className:`${Be}-item-action-split`})))),Je=ee?"div":"li",Ri=_t.createElement(Je,Object.assign({},ie,ee?{}:{ref:bt},{className:me()(`${Be}-item`,{[`${Be}-item-no-flex`]:!ei()},Ze)}),ve==="vertical"&&oe?[_t.createElement("div",{className:`${Be}-item-main`,key:"content"},Ge,Zt),_t.createElement("div",{className:me()(`${Be}-item-extra`,We("extra")),key:"extra",style:He("extra")},oe)]:[Ge,Zt,(0,Qt.Tm)(oe,{key:"extra"})]);return ee?_t.createElement(Jt.Z,{ref:bt,flex:1,style:Se},Ri):Ri});Yt.Meta=je;var Vt=Yt,pe=Mt(36237),Xt=Mt(63356),Le=Mt(16931),Wt=Mt(51636);const Ce=Bt=>{const{listBorderedCls:bt,componentCls:ge,paddingLG:Ge,margin:Ye,itemPaddingSM:oe,itemPaddingLG:Ve,marginLG:Ze,borderRadiusLG:Ni}=Bt;return{[bt]:{border:`${(0,pe.unit)(Bt.lineWidth)} ${Bt.lineType} ${Bt.colorBorder}`,borderRadius:Ni,[`${ge}-header,${ge}-footer,${ge}-item`]:{paddingInline:Ge},[`${ge}-pagination`]:{margin:`${(0,pe.unit)(Ye)} ${(0,pe.unit)(Ze)}`}},[`${bt}${ge}-sm`]:{[`${ge}-item,${ge}-header,${ge}-footer`]:{padding:oe}},[`${bt}${ge}-lg`]:{[`${ge}-item,${ge}-header,${ge}-footer`]:{padding:Ve}}}},Te=Bt=>{const{componentCls:bt,screenSM:ge,screenMD:Ge,marginLG:Ye,marginSM:oe,margin:Ve}=Bt;return{[`@media screen and (max-width:${Ge}px)`]:{[bt]:{[`${bt}-item`]:{[`${bt}-item-action`]:{marginInlineStart:Ye}}},[`${bt}-vertical`]:{[`${bt}-item`]:{[`${bt}-item-extra`]:{marginInlineStart:Ye}}}},[`@media screen and (max-width: ${ge}px)`]:{[bt]:{[`${bt}-item`]:{flexWrap:"wrap",[`${bt}-action`]:{marginInlineStart:oe}}},[`${bt}-vertical`]:{[`${bt}-item`]:{flexWrap:"wrap-reverse",[`${bt}-item-main`]:{minWidth:Bt.contentWidth},[`${bt}-item-extra`]:{margin:`auto auto ${(0,pe.unit)(Ve)}`}}}}}},ne=Bt=>{const{componentCls:bt,antCls:ge,controlHeight:Ge,minHeight:Ye,paddingSM:oe,marginLG:Ve,padding:Ze,itemPadding:Ni,colorPrimary:Se,itemPaddingSM:ie,itemPaddingLG:ee,paddingXS:ve,margin:ti,colorText:he,colorTextDescription:We,motionDurationSlow:He,lineWidth:we,headerBg:ei,footerBg:Be,emptyTextPadding:Zt,metaMarginBottom:Je,avatarMarginRight:Ri,titleMarginBottom:Pi,descriptionFontSize:Ct}=Bt;return{[bt]:Object.assign(Object.assign({},(0,Xt.Wf)(Bt)),{position:"relative","*":{outline:"none"},[`${bt}-header`]:{background:ei},[`${bt}-footer`]:{background:Be},[`${bt}-header, ${bt}-footer`]:{paddingBlock:oe},[`${bt}-pagination`]:{marginBlockStart:Ve,[`${ge}-pagination-options`]:{textAlign:"start"}},[`${bt}-spin`]:{minHeight:Ye,textAlign:"center"},[`${bt}-items`]:{margin:0,padding:0,listStyle:"none"},[`${bt}-item`]:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:Ni,color:he,[`${bt}-item-meta`]:{display:"flex",flex:1,alignItems:"flex-start",maxWidth:"100%",[`${bt}-item-meta-avatar`]:{marginInlineEnd:Ri},[`${bt}-item-meta-content`]:{flex:"1 0",width:0,color:he},[`${bt}-item-meta-title`]:{margin:`0 0 ${(0,pe.unit)(Bt.marginXXS)} 0`,color:he,fontSize:Bt.fontSize,lineHeight:Bt.lineHeight,"> a":{color:he,transition:`all ${He}`,"&:hover":{color:Se}}},[`${bt}-item-meta-description`]:{color:We,fontSize:Ct,lineHeight:Bt.lineHeight}},[`${bt}-item-action`]:{flex:"0 0 auto",marginInlineStart:Bt.marginXXL,padding:0,fontSize:0,listStyle:"none","& > li":{position:"relative",display:"inline-block",padding:`0 ${(0,pe.unit)(ve)}`,color:We,fontSize:Bt.fontSize,lineHeight:Bt.lineHeight,textAlign:"center","&:first-child":{paddingInlineStart:0}},[`${bt}-item-action-split`]:{position:"absolute",insetBlockStart:"50%",insetInlineEnd:0,width:we,height:Bt.calc(Bt.fontHeight).sub(Bt.calc(Bt.marginXXS).mul(2)).equal(),transform:"translateY(-50%)",backgroundColor:Bt.colorSplit}}},[`${bt}-empty`]:{padding:`${(0,pe.unit)(Ze)} 0`,color:We,fontSize:Bt.fontSizeSM,textAlign:"center"},[`${bt}-empty-text`]:{padding:Zt,color:Bt.colorTextDisabled,fontSize:Bt.fontSize,textAlign:"center"},[`${bt}-item-no-flex`]:{display:"block"}}),[`${bt}-grid ${ge}-col > ${bt}-item`]:{display:"block",maxWidth:"100%",marginBlockEnd:ti,paddingBlock:0,borderBlockEnd:"none"},[`${bt}-vertical ${bt}-item`]:{alignItems:"initial",[`${bt}-item-main`]:{display:"block",flex:1},[`${bt}-item-extra`]:{marginInlineStart:Ve},[`${bt}-item-meta`]:{marginBlockEnd:Je,[`${bt}-item-meta-title`]:{marginBlockStart:0,marginBlockEnd:Pi,color:he,fontSize:Bt.fontSizeLG,lineHeight:Bt.lineHeightLG}},[`${bt}-item-action`]:{marginBlockStart:Ze,marginInlineStart:"auto","> li":{padding:`0 ${(0,pe.unit)(Ze)}`,"&:first-child":{paddingInlineStart:0}}}},[`${bt}-split ${bt}-item`]:{borderBlockEnd:`${(0,pe.unit)(Bt.lineWidth)} ${Bt.lineType} ${Bt.colorSplit}`,"&:last-child":{borderBlockEnd:"none"}},[`${bt}-split ${bt}-header`]:{borderBlockEnd:`${(0,pe.unit)(Bt.lineWidth)} ${Bt.lineType} ${Bt.colorSplit}`},[`${bt}-split${bt}-empty ${bt}-footer`]:{borderTop:`${(0,pe.unit)(Bt.lineWidth)} ${Bt.lineType} ${Bt.colorSplit}`},[`${bt}-loading ${bt}-spin-nested-loading`]:{minHeight:Ge},[`${bt}-split${bt}-something-after-last-item ${ge}-spin-container > ${bt}-items > ${bt}-item:last-child`]:{borderBlockEnd:`${(0,pe.unit)(Bt.lineWidth)} ${Bt.lineType} ${Bt.colorSplit}`},[`${bt}-lg ${bt}-item`]:{padding:ee},[`${bt}-sm ${bt}-item`]:{padding:ie},[`${bt}:not(${bt}-vertical)`]:{[`${bt}-item-no-flex`]:{[`${bt}-item-action`]:{float:"right"}}}}},Re=Bt=>({contentWidth:220,itemPadding:`${(0,pe.unit)(Bt.paddingContentVertical)} 0`,itemPaddingSM:`${(0,pe.unit)(Bt.paddingContentVerticalSM)} ${(0,pe.unit)(Bt.paddingContentHorizontal)}`,itemPaddingLG:`${(0,pe.unit)(Bt.paddingContentVerticalLG)} ${(0,pe.unit)(Bt.paddingContentHorizontalLG)}`,headerBg:"transparent",footerBg:"transparent",emptyTextPadding:Bt.padding,metaMarginBottom:Bt.padding,avatarMarginRight:Bt.padding,titleMarginBottom:Bt.paddingSM,descriptionFontSize:Bt.fontSize});var ye=(0,Le.I$)("List",Bt=>{const bt=(0,Wt.mergeToken)(Bt,{listBorderedCls:`${Bt.componentCls}-bordered`,minHeight:Bt.controlHeightLG});return[ne(bt),Ce(bt),Te(bt)]},Re),Ie=function(Bt,bt){var ge={};for(var Ge in Bt)Object.prototype.hasOwnProperty.call(Bt,Ge)&&bt.indexOf(Ge)<0&&(ge[Ge]=Bt[Ge]);if(Bt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ye=0,Ge=Object.getOwnPropertySymbols(Bt);Ye<Ge.length;Ye++)bt.indexOf(Ge[Ye])<0&&Object.prototype.propertyIsEnumerable.call(Bt,Ge[Ye])&&(ge[Ge[Ye]]=Bt[Ge[Ye]]);return ge};function Ai(Bt,bt){var{pagination:ge=!1,prefixCls:Ge,bordered:Ye=!1,split:oe=!0,className:Ve,rootClassName:Ze,style:Ni,children:Se,itemLayout:ie,loadMore:ee,grid:ve,dataSource:ti=[],size:he,header:We,footer:He,loading:we=!1,rowKey:ei,renderItem:Be,locale:Zt}=Bt,Je=Ie(Bt,["pagination","prefixCls","bordered","split","className","rootClassName","style","children","itemLayout","loadMore","grid","dataSource","size","header","footer","loading","rowKey","renderItem","locale"]);const Ri=ge&&typeof ge=="object"?ge:{},[Pi,Ct]=_t.useState(Ri.defaultCurrent||1),[gt,ft]=_t.useState(Ri.defaultPageSize||10),{getPrefixCls:St,direction:At,className:wt,style:te}=(0,$t.dj)("list"),{renderEmpty:ni}=_t.useContext($t.E_),ui={current:1,total:0},qe=en=>(hn,Vi)=>{var zi;Ct(hn),ft(Vi),ge&&((zi=ge==null?void 0:ge[en])===null||zi===void 0||zi.call(ge,hn,Vi))},xe=qe("onChange"),Zi=qe("onShowSizeChange"),Si=(en,hn)=>{if(!Be)return null;let Vi;return typeof ei=="function"?Vi=ei(en):ei?Vi=en[ei]:Vi=en.key,Vi||(Vi=`list-item-${hn}`),_t.createElement(_t.Fragment,{key:Vi},Be(en,hn))},Oi=()=>!!(ee||ge||He),Qi=St("list",Ge),[Cn,_i,Mn]=ye(Qi);let er=we;typeof er=="boolean"&&(er={spinning:er});const ir=!!(er!=null&&er.spinning),fr=(0,re.Z)(he);let ar="";switch(fr){case"large":ar="lg";break;case"small":ar="sm";break;default:break}const br=me()(Qi,{[`${Qi}-vertical`]:ie==="vertical",[`${Qi}-${ar}`]:ar,[`${Qi}-split`]:oe,[`${Qi}-bordered`]:Ye,[`${Qi}-loading`]:ir,[`${Qi}-grid`]:!!ve,[`${Qi}-something-after-last-item`]:Oi(),[`${Qi}-rtl`]:At==="rtl"},wt,Ve,Ze,_i,Mn),Qn=(0,Ut.Z)(ui,{total:ti.length,current:Pi,pageSize:gt},ge||{}),Nn=Math.ceil(Qn.total/Qn.pageSize);Qn.current>Nn&&(Qn.current=Nn);const yr=ge&&_t.createElement("div",{className:me()(`${Qi}-pagination`)},_t.createElement(zt.Z,Object.assign({align:"end"},Qn,{onChange:xe,onShowSizeChange:Zi})));let yt=(0,pt.Z)(ti);ge&&ti.length>(Qn.current-1)*Qn.pageSize&&(yt=(0,pt.Z)(ti).splice((Qn.current-1)*Qn.pageSize,Qn.pageSize));const Mi=Object.keys(ve||{}).some(en=>["xs","sm","md","lg","xl","xxl"].includes(en)),on=(0,de.Z)(Mi),Ui=_t.useMemo(()=>{for(let en=0;en<fe.c4.length;en+=1){const hn=fe.c4[en];if(on[hn])return hn}},[on]),an=_t.useMemo(()=>{if(!ve)return;const en=Ui&&ve[Ui]?ve[Ui]:ve.column;if(en)return{width:`${100/en}%`,maxWidth:`${100/en}%`}},[JSON.stringify(ve),Ui]);let vi=ir&&_t.createElement("div",{style:{minHeight:53}});if(yt.length>0){const en=yt.map((hn,Vi)=>Si(hn,Vi));vi=ve?_t.createElement(Dt.Z,{gutter:ve.gutter},_t.Children.map(en,hn=>_t.createElement("div",{key:hn==null?void 0:hn.key,style:an},hn))):_t.createElement("ul",{className:`${Qi}-items`},en)}else!Se&&!ir&&(vi=_t.createElement("div",{className:`${Qi}-empty-text`},(Zt==null?void 0:Zt.emptyText)||(ni==null?void 0:ni("List"))||_t.createElement(Ae.Z,{componentName:"List"})));const di=Qn.position||"bottom",xn=_t.useMemo(()=>({grid:ve,itemLayout:ie}),[JSON.stringify(ve),ie]);return Cn(_t.createElement(ue.Provider,{value:xn},_t.createElement("div",Object.assign({ref:bt,style:Object.assign(Object.assign({},te),Ni),className:br},Je),(di==="top"||di==="both")&&yr,We&&_t.createElement("div",{className:`${Qi}-header`},We),_t.createElement(Ne.Z,Object.assign({},er),vi,Se),He&&_t.createElement("div",{className:`${Qi}-footer`},He),ee||(di==="bottom"||di==="both")&&yr)))}const gi=_t.forwardRef(Ai);gi.Item=Vt;var oi=gi},14625:function(Li){function ai(pt){var _t,ce,me="";if(typeof pt=="string"||typeof pt=="number")me+=pt;else if(typeof pt=="object")if(Array.isArray(pt)){var Ut=pt.length;for(_t=0;_t<Ut;_t++)pt[_t]&&(ce=ai(pt[_t]))&&(me&&(me+=" "),me+=ce)}else for(ce in pt)pt[ce]&&(me&&(me+=" "),me+=ce);return me}function Mt(){for(var pt,_t,ce=0,me="",Ut=arguments.length;ce<Ut;ce++)(pt=arguments[ce])&&(_t=ai(pt))&&(me&&(me+=" "),me+=_t);return me}Li.exports=Mt,Li.exports.clsx=Mt},99498:function(Li,ai,Mt){(function(pt){pt(Mt(89780))})(function(pt){pt.defineOption("placeholder","",function(Ae,re,Dt){var de=Dt&&Dt!=pt.Init;if(re&&!de)Ae.on("blur",Ut),Ae.on("change",fe),Ae.on("swapDoc",fe),pt.on(Ae.getInputField(),"compositionupdate",Ae.state.placeholderCompose=function(){me(Ae)}),fe(Ae);else if(!re&&de){Ae.off("blur",Ut),Ae.off("change",fe),Ae.off("swapDoc",fe),pt.off(Ae.getInputField(),"compositionupdate",Ae.state.placeholderCompose),_t(Ae);var zt=Ae.getWrapperElement();zt.className=zt.className.replace(" CodeMirror-empty","")}re&&!Ae.hasFocus()&&Ut(Ae)});function _t(Ae){Ae.state.placeholder&&(Ae.state.placeholder.parentNode.removeChild(Ae.state.placeholder),Ae.state.placeholder=null)}function ce(Ae){_t(Ae);var re=Ae.state.placeholder=document.createElement("pre");re.style.cssText="height: 0; overflow: visible",re.style.direction=Ae.getOption("direction"),re.className="CodeMirror-placeholder CodeMirror-line-like";var Dt=Ae.getOption("placeholder");typeof Dt=="string"&&(Dt=document.createTextNode(Dt)),re.appendChild(Dt),Ae.display.lineSpace.insertBefore(re,Ae.display.lineSpace.firstChild)}function me(Ae){setTimeout(function(){var re=!1,Dt=Ae.getInputField();Dt.nodeName=="TEXTAREA"?re=!Dt.value:Ae.lineCount()==1&&(re=!/[^\u200b]/.test(Dt.querySelector(".CodeMirror-line").textContent)),re?ce(Ae):_t(Ae)},20)}function Ut(Ae){$t(Ae)&&ce(Ae)}function fe(Ae){var re=Ae.getWrapperElement(),Dt=$t(Ae);re.className=re.className.replace(" CodeMirror-empty","")+(Dt?" CodeMirror-empty":""),Dt?ce(Ae):_t(Ae)}function $t(Ae){return Ae.lineCount()===1&&Ae.getLine(0)===""}})},25717:function(Li,ai,Mt){(function(pt){pt(Mt(89780))})(function(pt){var _t={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},ce=pt.Pos;pt.defineOption("autoCloseBrackets",!1,function(qt,Qt,Jt){Jt&&Jt!=pt.Init&&(qt.removeKeyMap(Ut),qt.state.closeBrackets=null),Qt&&(fe(me(Qt,"pairs")),qt.state.closeBrackets=Qt,qt.addKeyMap(Ut))});function me(qt,Qt){return Qt=="pairs"&&typeof qt=="string"?qt:typeof qt=="object"&&qt[Qt]!=null?qt[Qt]:_t[Qt]}var Ut={Backspace:re,Enter:Dt};function fe(qt){for(var Qt=0;Qt<qt.length;Qt++){var Jt=qt.charAt(Qt),Pe="'"+Jt+"'";Ut[Pe]||(Ut[Pe]=$t(Jt))}}fe(_t.pairs+"`");function $t(qt){return function(Qt){return zt(Qt,qt)}}function Ae(qt){var Qt=qt.state.closeBrackets;if(!Qt||Qt.override)return Qt;var Jt=qt.getModeAt(qt.getCursor());return Jt.closeBrackets||Qt}function re(qt){var Qt=Ae(qt);if(!Qt||qt.getOption("disableInput"))return pt.Pass;for(var Jt=me(Qt,"pairs"),Pe=qt.listSelections(),je=0;je<Pe.length;je++){if(!Pe[je].empty())return pt.Pass;var De=Ne(qt,Pe[je].head);if(!De||Jt.indexOf(De)%2!=0)return pt.Pass}for(var je=Pe.length-1;je>=0;je--){var Yt=Pe[je].head;qt.replaceRange("",ce(Yt.line,Yt.ch-1),ce(Yt.line,Yt.ch+1),"+delete")}}function Dt(qt){var Qt=Ae(qt),Jt=Qt&&me(Qt,"explode");if(!Jt||qt.getOption("disableInput"))return pt.Pass;for(var Pe=qt.listSelections(),je=0;je<Pe.length;je++){if(!Pe[je].empty())return pt.Pass;var De=Ne(qt,Pe[je].head);if(!De||Jt.indexOf(De)%2!=0)return pt.Pass}qt.operation(function(){var Yt=qt.lineSeparator()||`
|
|
`;qt.replaceSelection(Yt+Yt,null),qt.execCommand("goCharLeft"),Pe=qt.listSelections();for(var Vt=0;Vt<Pe.length;Vt++){var pe=Pe[Vt].head.line;qt.indentLine(pe,null,!0),qt.indentLine(pe+1,null,!0)}})}function de(qt){var Qt=pt.cmpPos(qt.anchor,qt.head)>0;return{anchor:new ce(qt.anchor.line,qt.anchor.ch+(Qt?-1:1)),head:new ce(qt.head.line,qt.head.ch+(Qt?1:-1))}}function zt(qt,Qt){var Jt=Ae(qt);if(!Jt||qt.getOption("disableInput"))return pt.Pass;var Pe=me(Jt,"pairs"),je=Pe.indexOf(Qt);if(je==-1)return pt.Pass;for(var De=me(Jt,"closeBefore"),Yt=me(Jt,"triples"),Vt=Pe.charAt(je+1)==Qt,pe=qt.listSelections(),Xt=je%2==0,Le,Wt=0;Wt<pe.length;Wt++){var Ce=pe[Wt],Te=Ce.head,ne,Re=qt.getRange(Te,ce(Te.line,Te.ch+1));if(Xt&&!Ce.empty())ne="surround";else if((Vt||!Xt)&&Re==Qt)Vt&&ue(qt,Te)?ne="both":Yt.indexOf(Qt)>=0&&qt.getRange(Te,ce(Te.line,Te.ch+3))==Qt+Qt+Qt?ne="skipThree":ne="skip";else if(Vt&&Te.ch>1&&Yt.indexOf(Qt)>=0&&qt.getRange(ce(Te.line,Te.ch-2),Te)==Qt+Qt){if(Te.ch>2&&/\bstring/.test(qt.getTokenTypeAt(ce(Te.line,Te.ch-2))))return pt.Pass;ne="addFour"}else if(Vt){var ye=Te.ch==0?" ":qt.getRange(ce(Te.line,Te.ch-1),Te);if(!pt.isWordChar(Re)&&ye!=Qt&&!pt.isWordChar(ye))ne="both";else return pt.Pass}else if(Xt&&(Re.length===0||/\s/.test(Re)||De.indexOf(Re)>-1))ne="both";else return pt.Pass;if(!Le)Le=ne;else if(Le!=ne)return pt.Pass}var Ie=je%2?Pe.charAt(je-1):Qt,Ai=je%2?Qt:Pe.charAt(je+1);qt.operation(function(){if(Le=="skip")qt.execCommand("goCharRight");else if(Le=="skipThree")for(var yi=0;yi<3;yi++)qt.execCommand("goCharRight");else if(Le=="surround"){for(var gi=qt.getSelections(),yi=0;yi<gi.length;yi++)gi[yi]=Ie+gi[yi]+Ai;qt.replaceSelections(gi,"around"),gi=qt.listSelections().slice();for(var yi=0;yi<gi.length;yi++)gi[yi]=de(gi[yi]);qt.setSelections(gi)}else Le=="both"?(qt.replaceSelection(Ie+Ai,null),qt.triggerElectric(Ie+Ai),qt.execCommand("goCharLeft")):Le=="addFour"&&(qt.replaceSelection(Ie+Ie+Ie+Ie,"before"),qt.execCommand("goCharRight"))})}function Ne(qt,Qt){var Jt=qt.getRange(ce(Qt.line,Qt.ch-1),ce(Qt.line,Qt.ch+1));return Jt.length==2?Jt:null}function ue(qt,Qt){var Jt=qt.getTokenAt(ce(Qt.line,Qt.ch+1));return/\bstring/.test(Jt.type)&&Jt.start==Qt.ch&&(Qt.ch==0||!/\bstring/.test(qt.getTokenTypeAt(Qt)))}})},6313:function(Li,ai,Mt){(function(pt){pt(Mt(89780),Mt(32855))})(function(pt){pt.defineOption("autoCloseTags",!1,function(re,Dt,de){if(de!=pt.Init&&de&&re.removeKeyMap("autoCloseTags"),!!Dt){var zt={name:"autoCloseTags"};(typeof Dt!="object"||Dt.whenClosing!==!1)&&(zt["'/'"]=function(Ne){return fe(Ne)}),(typeof Dt!="object"||Dt.whenOpening!==!1)&&(zt["'>'"]=function(Ne){return me(Ne)}),re.addKeyMap(zt)}});var _t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],ce=["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 me(re){if(re.getOption("disableInput"))return pt.Pass;for(var Dt=re.listSelections(),de=[],zt=re.getOption("autoCloseTags"),Ne=0;Ne<Dt.length;Ne++){if(!Dt[Ne].empty())return pt.Pass;var ue=Dt[Ne].head,qt=re.getTokenAt(ue),Qt=pt.innerMode(re.getMode(),qt.state),Jt=Qt.state,Pe=Qt.mode.xmlCurrentTag&&Qt.mode.xmlCurrentTag(Jt),je=Pe&&Pe.name;if(!je)return pt.Pass;var De=Qt.mode.configuration=="html",Yt=typeof zt=="object"&&zt.dontCloseTags||De&&_t,Vt=typeof zt=="object"&&zt.indentTags||De&&ce;qt.end>ue.ch&&(je=je.slice(0,je.length-qt.end+ue.ch));var pe=je.toLowerCase();if(!je||qt.type=="string"&&(qt.end!=ue.ch||!/[\"\']/.test(qt.string.charAt(qt.string.length-1))||qt.string.length==1)||qt.type=="tag"&&Pe.close||qt.string.indexOf("/")==ue.ch-qt.start-1||Yt&&$t(Yt,pe)>-1||Ae(re,Qt.mode.xmlCurrentContext&&Qt.mode.xmlCurrentContext(Jt)||[],je,ue,!0))return pt.Pass;var Xt=typeof zt=="object"&&zt.emptyTags;if(Xt&&$t(Xt,je)>-1){de[Ne]={text:"/>",newPos:pt.Pos(ue.line,ue.ch+2)};continue}var Le=Vt&&$t(Vt,pe)>-1;de[Ne]={indent:Le,text:">"+(Le?`
|
|
|
|
`:"")+"</"+je+">",newPos:Le?pt.Pos(ue.line+1,0):pt.Pos(ue.line,ue.ch+1)}}for(var Wt=typeof zt=="object"&&zt.dontIndentOnAutoClose,Ne=Dt.length-1;Ne>=0;Ne--){var Ce=de[Ne];re.replaceRange(Ce.text,Dt[Ne].head,Dt[Ne].anchor,"+insert");var Te=re.listSelections().slice(0);Te[Ne]={head:Ce.newPos,anchor:Ce.newPos},re.setSelections(Te),!Wt&&Ce.indent&&(re.indentLine(Ce.newPos.line,null,!0),re.indentLine(Ce.newPos.line+1,null,!0))}}function Ut(re,Dt){for(var de=re.listSelections(),zt=[],Ne=Dt?"/":"</",ue=re.getOption("autoCloseTags"),qt=typeof ue=="object"&&ue.dontIndentOnSlash,Qt=0;Qt<de.length;Qt++){if(!de[Qt].empty())return pt.Pass;var Jt=de[Qt].head,Pe=re.getTokenAt(Jt),je=pt.innerMode(re.getMode(),Pe.state),De=je.state;if(Dt&&(Pe.type=="string"||Pe.string.charAt(0)!="<"||Pe.start!=Jt.ch-1))return pt.Pass;var Yt,Vt=je.mode.name!="xml"&&re.getMode().name=="htmlmixed";if(Vt&&je.mode.name=="javascript")Yt=Ne+"script";else if(Vt&&je.mode.name=="css")Yt=Ne+"style";else{var pe=je.mode.xmlCurrentContext&&je.mode.xmlCurrentContext(De);if(!pe||pe.length&&Ae(re,pe,pe[pe.length-1],Jt))return pt.Pass;Yt=Ne+pe[pe.length-1]}re.getLine(Jt.line).charAt(Pe.end)!=">"&&(Yt+=">"),zt[Qt]=Yt}if(re.replaceSelections(zt),de=re.listSelections(),!qt)for(var Qt=0;Qt<de.length;Qt++)(Qt==de.length-1||de[Qt].head.line<de[Qt+1].head.line)&&re.indentLine(de[Qt].head.line)}function fe(re){return re.getOption("disableInput")?pt.Pass:Ut(re,!0)}pt.commands.closeTag=function(re){return Ut(re)};function $t(re,Dt){if(re.indexOf)return re.indexOf(Dt);for(var de=0,zt=re.length;de<zt;++de)if(re[de]==Dt)return de;return-1}function Ae(re,Dt,de,zt,Ne){if(!pt.scanForClosingTag)return!1;var ue=Math.min(re.lastLine()+1,zt.line+500),qt=pt.scanForClosingTag(re,zt,null,ue);if(!qt||qt.tag!=de)return!1;for(var Qt=Ne?1:0,Jt=Dt.length-1;Jt>=0&&Dt[Jt]==de;Jt--)++Qt;zt=qt.to;for(var Jt=1;Jt<Qt;Jt++){var Pe=pt.scanForClosingTag(re,zt,null,ue);if(!Pe||Pe.tag!=de)return!1;zt=Pe.to}return!0}})},32855:function(Li,ai,Mt){(function(pt){pt(Mt(89780))})(function(pt){"use strict";var _t=pt.Pos;function ce(Jt,Pe){return Jt.line-Pe.line||Jt.ch-Pe.ch}var me="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",Ut=me+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",fe=new RegExp("<(/?)(["+me+"]["+Ut+"]*)","g");function $t(Jt,Pe,je,De){this.line=Pe,this.ch=je,this.cm=Jt,this.text=Jt.getLine(Pe),this.min=De?Math.max(De.from,Jt.firstLine()):Jt.firstLine(),this.max=De?Math.min(De.to-1,Jt.lastLine()):Jt.lastLine()}function Ae(Jt,Pe){var je=Jt.cm.getTokenTypeAt(_t(Jt.line,Pe));return je&&/\btag\b/.test(je)}function re(Jt){if(!(Jt.line>=Jt.max))return Jt.ch=0,Jt.text=Jt.cm.getLine(++Jt.line),!0}function Dt(Jt){if(!(Jt.line<=Jt.min))return Jt.text=Jt.cm.getLine(--Jt.line),Jt.ch=Jt.text.length,!0}function de(Jt){for(;;){var Pe=Jt.text.indexOf(">",Jt.ch);if(Pe==-1){if(re(Jt))continue;return}if(!Ae(Jt,Pe+1)){Jt.ch=Pe+1;continue}var je=Jt.text.lastIndexOf("/",Pe),De=je>-1&&!/\S/.test(Jt.text.slice(je+1,Pe));return Jt.ch=Pe+1,De?"selfClose":"regular"}}function zt(Jt){for(;;){var Pe=Jt.ch?Jt.text.lastIndexOf("<",Jt.ch-1):-1;if(Pe==-1){if(Dt(Jt))continue;return}if(!Ae(Jt,Pe+1)){Jt.ch=Pe;continue}fe.lastIndex=Pe,Jt.ch=Pe;var je=fe.exec(Jt.text);if(je&&je.index==Pe)return je}}function Ne(Jt){for(;;){fe.lastIndex=Jt.ch;var Pe=fe.exec(Jt.text);if(!Pe){if(re(Jt))continue;return}if(!Ae(Jt,Pe.index+1)){Jt.ch=Pe.index+1;continue}return Jt.ch=Pe.index+Pe[0].length,Pe}}function ue(Jt){for(;;){var Pe=Jt.ch?Jt.text.lastIndexOf(">",Jt.ch-1):-1;if(Pe==-1){if(Dt(Jt))continue;return}if(!Ae(Jt,Pe+1)){Jt.ch=Pe;continue}var je=Jt.text.lastIndexOf("/",Pe),De=je>-1&&!/\S/.test(Jt.text.slice(je+1,Pe));return Jt.ch=Pe+1,De?"selfClose":"regular"}}function qt(Jt,Pe){for(var je=[];;){var De=Ne(Jt),Yt,Vt=Jt.line,pe=Jt.ch-(De?De[0].length:0);if(!De||!(Yt=de(Jt)))return;if(Yt!="selfClose")if(De[1]){for(var Xt=je.length-1;Xt>=0;--Xt)if(je[Xt]==De[2]){je.length=Xt;break}if(Xt<0&&(!Pe||Pe==De[2]))return{tag:De[2],from:_t(Vt,pe),to:_t(Jt.line,Jt.ch)}}else je.push(De[2])}}function Qt(Jt,Pe){for(var je=[];;){var De=ue(Jt);if(!De)return;if(De=="selfClose"){zt(Jt);continue}var Yt=Jt.line,Vt=Jt.ch,pe=zt(Jt);if(!pe)return;if(pe[1])je.push(pe[2]);else{for(var Xt=je.length-1;Xt>=0;--Xt)if(je[Xt]==pe[2]){je.length=Xt;break}if(Xt<0&&(!Pe||Pe==pe[2]))return{tag:pe[2],from:_t(Jt.line,Jt.ch),to:_t(Yt,Vt)}}}}pt.registerHelper("fold","xml",function(Jt,Pe){for(var je=new $t(Jt,Pe.line,0);;){var De=Ne(je);if(!De||je.line!=Pe.line)return;var Yt=de(je);if(!Yt)return;if(!De[1]&&Yt!="selfClose"){var Vt=_t(je.line,je.ch),pe=qt(je,De[2]);return pe&&ce(pe.from,Vt)>0?{from:Vt,to:pe.from}:null}}}),pt.findMatchingTag=function(Jt,Pe,je){var De=new $t(Jt,Pe.line,Pe.ch,je);if(!(De.text.indexOf(">")==-1&&De.text.indexOf("<")==-1)){var Yt=de(De),Vt=Yt&&_t(De.line,De.ch),pe=Yt&&zt(De);if(!(!Yt||!pe||ce(De,Pe)>0)){var Xt={from:_t(De.line,De.ch),to:Vt,tag:pe[2]};return Yt=="selfClose"?{open:Xt,close:null,at:"open"}:pe[1]?{open:Qt(De,pe[2]),close:Xt,at:"close"}:(De=new $t(Jt,Vt.line,Vt.ch,je),{open:Xt,close:qt(De,pe[2]),at:"open"})}}},pt.findEnclosingTag=function(Jt,Pe,je,De){for(var Yt=new $t(Jt,Pe.line,Pe.ch,je);;){var Vt=Qt(Yt,De);if(!Vt)break;var pe=new $t(Jt,Pe.line,Pe.ch,je),Xt=qt(pe,Vt.tag);if(Xt)return{open:Vt,close:Xt}}},pt.scanForClosingTag=function(Jt,Pe,je,De){var Yt=new $t(Jt,Pe.line,Pe.ch,De?{from:0,to:De}:null);return qt(Yt,je)}})},89780:function(Li){(function(ai,Mt){Li.exports=Mt()})(this,function(){"use strict";var ai=navigator.userAgent,Mt=navigator.platform,pt=/gecko\/\d/i.test(ai),_t=/MSIE \d/.test(ai),ce=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ai),me=/Edge\/(\d+)/.exec(ai),Ut=_t||ce||me,fe=Ut&&(_t?document.documentMode||6:+(me||ce)[1]),$t=!me&&/WebKit\//.test(ai),Ae=$t&&/Qt\/\d+\.\d+/.test(ai),re=!me&&/Chrome\//.test(ai),Dt=/Opera\//.test(ai),de=/Apple Computer/.test(navigator.vendor),zt=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ai),Ne=/PhantomJS/.test(ai),ue=!me&&/AppleWebKit/.test(ai)&&/Mobile\/\w+/.test(ai),qt=/Android/.test(ai),Qt=ue||qt||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ai),Jt=ue||/Mac/.test(Mt),Pe=/\bCrOS\b/.test(ai),je=/win/i.test(Mt),De=Dt&&ai.match(/Version\/(\d*\.\d*)/);De&&(De=Number(De[1])),De&&De>=15&&(Dt=!1,$t=!0);var Yt=Jt&&(Ae||Dt&&(De==null||De<12.11)),Vt=pt||Ut&&fe>=9;function pe(et){return new RegExp("(^|\\s)"+et+"(?:$|\\s)\\s*")}var Xt=function(et,rt){var lt=et.className,at=pe(rt).exec(lt);if(at){var ht=lt.slice(at.index+at[0].length);et.className=lt.slice(0,at.index)+(ht?at[1]+ht:"")}};function Le(et){for(var rt=et.childNodes.length;rt>0;--rt)et.removeChild(et.firstChild);return et}function Wt(et,rt){return Le(et).appendChild(rt)}function Ce(et,rt,lt,at){var ht=document.createElement(et);if(lt&&(ht.className=lt),at&&(ht.style.cssText=at),typeof rt=="string")ht.appendChild(document.createTextNode(rt));else if(rt)for(var mt=0;mt<rt.length;++mt)ht.appendChild(rt[mt]);return ht}function Te(et,rt,lt,at){var ht=Ce(et,rt,lt,at);return ht.setAttribute("role","presentation"),ht}var ne;document.createRange?ne=function(et,rt,lt,at){var ht=document.createRange();return ht.setEnd(at||et,lt),ht.setStart(et,rt),ht}:ne=function(et,rt,lt){var at=document.body.createTextRange();try{at.moveToElementText(et.parentNode)}catch(ht){return at}return at.collapse(!0),at.moveEnd("character",lt),at.moveStart("character",rt),at};function Re(et,rt){if(rt.nodeType==3&&(rt=rt.parentNode),et.contains)return et.contains(rt);do if(rt.nodeType==11&&(rt=rt.host),rt==et)return!0;while(rt=rt.parentNode)}function ye(){var et;try{et=document.activeElement}catch(rt){et=document.body||null}for(;et&&et.shadowRoot&&et.shadowRoot.activeElement;)et=et.shadowRoot.activeElement;return et}function Ie(et,rt){var lt=et.className;pe(rt).test(lt)||(et.className+=(lt?" ":"")+rt)}function Ai(et,rt){for(var lt=et.split(" "),at=0;at<lt.length;at++)lt[at]&&!pe(lt[at]).test(rt)&&(rt+=" "+lt[at]);return rt}var yi=function(et){et.select()};ue?yi=function(et){et.selectionStart=0,et.selectionEnd=et.value.length}:Ut&&(yi=function(et){try{et.select()}catch(rt){}});function gi(et){var rt=Array.prototype.slice.call(arguments,1);return function(){return et.apply(null,rt)}}function oi(et,rt,lt){rt||(rt={});for(var at in et)et.hasOwnProperty(at)&&(lt!==!1||!rt.hasOwnProperty(at))&&(rt[at]=et[at]);return rt}function Bt(et,rt,lt,at,ht){rt==null&&(rt=et.search(/[^\s\u00a0]/),rt==-1&&(rt=et.length));for(var mt=at||0,kt=ht||0;;){var Lt=et.indexOf(" ",mt);if(Lt<0||Lt>=rt)return kt+(rt-mt);kt+=Lt-mt,kt+=lt-kt%lt,mt=Lt+1}}var bt=function(){this.id=null,this.f=null,this.time=0,this.handler=gi(this.onTimeout,this)};bt.prototype.onTimeout=function(et){et.id=0,et.time<=+new Date?et.f():setTimeout(et.handler,et.time-+new Date)},bt.prototype.set=function(et,rt){this.f=rt;var lt=+new Date+et;(!this.id||lt<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,et),this.time=lt)};function ge(et,rt){for(var lt=0;lt<et.length;++lt)if(et[lt]==rt)return lt;return-1}var Ge=50,Ye={toString:function(){return"CodeMirror.Pass"}},oe={scroll:!1},Ve={origin:"*mouse"},Ze={origin:"+move"};function Ni(et,rt,lt){for(var at=0,ht=0;;){var mt=et.indexOf(" ",at);mt==-1&&(mt=et.length);var kt=mt-at;if(mt==et.length||ht+kt>=rt)return at+Math.min(kt,rt-ht);if(ht+=mt-at,ht+=lt-ht%lt,at=mt+1,ht>=rt)return at}}var Se=[""];function ie(et){for(;Se.length<=et;)Se.push(ee(Se)+" ");return Se[et]}function ee(et){return et[et.length-1]}function ve(et,rt){for(var lt=[],at=0;at<et.length;at++)lt[at]=rt(et[at],at);return lt}function ti(et,rt,lt){for(var at=0,ht=lt(rt);at<et.length&<(et[at])<=ht;)at++;et.splice(at,0,rt)}function he(){}function We(et,rt){var lt;return Object.create?lt=Object.create(et):(he.prototype=et,lt=new he),rt&&oi(rt,lt),lt}var He=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function we(et){return/\w/.test(et)||et>"\x80"&&(et.toUpperCase()!=et.toLowerCase()||He.test(et))}function ei(et,rt){return rt?rt.source.indexOf("\\w")>-1&&we(et)?!0:rt.test(et):we(et)}function Be(et){for(var rt in et)if(et.hasOwnProperty(rt)&&et[rt])return!1;return!0}var Zt=/[\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 Je(et){return et.charCodeAt(0)>=768&&Zt.test(et)}function Ri(et,rt,lt){for(;(lt<0?rt>0:rt<et.length)&&Je(et.charAt(rt));)rt+=lt;return rt}function Pi(et,rt,lt){for(var at=rt>lt?-1:1;;){if(rt==lt)return rt;var ht=(rt+lt)/2,mt=at<0?Math.ceil(ht):Math.floor(ht);if(mt==rt)return et(mt)?rt:lt;et(mt)?lt=mt:rt=mt+at}}function Ct(et,rt,lt,at){if(!et)return at(rt,lt,"ltr",0);for(var ht=!1,mt=0;mt<et.length;++mt){var kt=et[mt];(kt.from<lt&&kt.to>rt||rt==lt&&kt.to==rt)&&(at(Math.max(kt.from,rt),Math.min(kt.to,lt),kt.level==1?"rtl":"ltr",mt),ht=!0)}ht||at(rt,lt,"ltr")}var gt=null;function ft(et,rt,lt){var at;gt=null;for(var ht=0;ht<et.length;++ht){var mt=et[ht];if(mt.from<rt&&mt.to>rt)return ht;mt.to==rt&&(mt.from!=mt.to&<=="before"?at=ht:gt=ht),mt.from==rt&&(mt.from!=mt.to&<!="before"?at=ht:gt=ht)}return at!=null?at:gt}var St=function(){var et="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",rt="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function lt(jt){return jt<=247?et.charAt(jt):1424<=jt&&jt<=1524?"R":1536<=jt&&jt<=1785?rt.charAt(jt-1536):1774<=jt&&jt<=2220?"r":8192<=jt&&jt<=8203?"w":jt==8204?"b":"L"}var at=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,ht=/[stwN]/,mt=/[LRr]/,kt=/[Lb1n]/,Lt=/[1n]/;function Nt(jt,Ee,Kt){this.level=jt,this.from=Ee,this.to=Kt}return function(jt,Ee){var Kt=Ee=="ltr"?"L":"R";if(jt.length==0||Ee=="ltr"&&!at.test(jt))return!1;for(var ri=jt.length,Qe=[],Yi=0;Yi<ri;++Yi)Qe.push(lt(jt.charCodeAt(Yi)));for(var $i=0,dn=Kt;$i<ri;++$i){var Dn=Qe[$i];Dn=="m"?Qe[$i]=dn:dn=Dn}for(var tr=0,Wn=Kt;tr<ri;++tr){var lr=Qe[tr];lr=="1"&&Wn=="r"?Qe[tr]="n":mt.test(lr)&&(Wn=lr,lr=="r"&&(Qe[tr]="R"))}for(var Pr=1,_n=Qe[0];Pr<ri-1;++Pr){var Zr=Qe[Pr];Zr=="+"&&_n=="1"&&Qe[Pr+1]=="1"?Qe[Pr]="1":Zr==","&&_n==Qe[Pr+1]&&(_n=="1"||_n=="n")&&(Qe[Pr]=_n),_n=Zr}for(var Ho=0;Ho<ri;++Ho){var ks=Qe[Ho];if(ks==",")Qe[Ho]="N";else if(ks=="%"){var Xo=void 0;for(Xo=Ho+1;Xo<ri&&Qe[Xo]=="%";++Xo);for(var Na=Ho&&Qe[Ho-1]=="!"||Xo<ri&&Qe[Xo]=="1"?"1":"N",ra=Ho;ra<Xo;++ra)Qe[ra]=Na;Ho=Xo-1}}for(var ms=0,Ha=Kt;ms<ri;++ms){var Ys=Qe[ms];Ha=="L"&&Ys=="1"?Qe[ms]="L":mt.test(Ys)&&(Ha=Ys)}for(var ys=0;ys<ri;++ys)if(ht.test(Qe[ys])){var uo=void 0;for(uo=ys+1;uo<ri&&ht.test(Qe[uo]);++uo);for(var es=(ys?Qe[ys-1]:Kt)=="L",Bs=(uo<ri?Qe[uo]:Kt)=="L",Xs=es==Bs?es?"L":"R":Kt,Ll=ys;Ll<uo;++Ll)Qe[Ll]=Xs;ys=uo-1}for(var Jo=[],yl,ss=0;ss<ri;)if(kt.test(Qe[ss])){var wf=ss;for(++ss;ss<ri&&kt.test(Qe[ss]);++ss);Jo.push(new Nt(0,wf,ss))}else{var il=ss,Wa=Jo.length,Ta=Ee=="rtl"?1:0;for(++ss;ss<ri&&Qe[ss]!="L";++ss);for(var No=il;No<ss;)if(Lt.test(Qe[No])){il<No&&(Jo.splice(Wa,0,new Nt(1,il,No)),Wa+=Ta);var Os=No;for(++No;No<ss&&Lt.test(Qe[No]);++No);Jo.splice(Wa,0,new Nt(2,Os,No)),Wa+=Ta,il=No}else++No;il<ss&&Jo.splice(Wa,0,new Nt(1,il,ss))}return Ee=="ltr"&&(Jo[0].level==1&&(yl=jt.match(/^\s+/))&&(Jo[0].from=yl[0].length,Jo.unshift(new Nt(0,0,yl[0].length))),ee(Jo).level==1&&(yl=jt.match(/\s+$/))&&(ee(Jo).to-=yl[0].length,Jo.push(new Nt(0,ri-yl[0].length,ri)))),Ee=="rtl"?Jo.reverse():Jo}}();function At(et,rt){var lt=et.order;return lt==null&&(lt=et.order=St(et.text,rt)),lt}var wt=[],te=function(et,rt,lt){if(et.addEventListener)et.addEventListener(rt,lt,!1);else if(et.attachEvent)et.attachEvent("on"+rt,lt);else{var at=et._handlers||(et._handlers={});at[rt]=(at[rt]||wt).concat(lt)}};function ni(et,rt){return et._handlers&&et._handlers[rt]||wt}function ui(et,rt,lt){if(et.removeEventListener)et.removeEventListener(rt,lt,!1);else if(et.detachEvent)et.detachEvent("on"+rt,lt);else{var at=et._handlers,ht=at&&at[rt];if(ht){var mt=ge(ht,lt);mt>-1&&(at[rt]=ht.slice(0,mt).concat(ht.slice(mt+1)))}}}function qe(et,rt){var lt=ni(et,rt);if(lt.length)for(var at=Array.prototype.slice.call(arguments,2),ht=0;ht<lt.length;++ht)lt[ht].apply(null,at)}function xe(et,rt,lt){return typeof rt=="string"&&(rt={type:rt,preventDefault:function(){this.defaultPrevented=!0}}),qe(et,lt||rt.type,et,rt),_i(rt)||rt.codemirrorIgnore}function Zi(et){var rt=et._handlers&&et._handlers.cursorActivity;if(rt)for(var lt=et.curOp.cursorActivityHandlers||(et.curOp.cursorActivityHandlers=[]),at=0;at<rt.length;++at)ge(lt,rt[at])==-1&<.push(rt[at])}function Si(et,rt){return ni(et,rt).length>0}function Oi(et){et.prototype.on=function(rt,lt){te(this,rt,lt)},et.prototype.off=function(rt,lt){ui(this,rt,lt)}}function Qi(et){et.preventDefault?et.preventDefault():et.returnValue=!1}function Cn(et){et.stopPropagation?et.stopPropagation():et.cancelBubble=!0}function _i(et){return et.defaultPrevented!=null?et.defaultPrevented:et.returnValue==!1}function Mn(et){Qi(et),Cn(et)}function er(et){return et.target||et.srcElement}function ir(et){var rt=et.which;return rt==null&&(et.button&1?rt=1:et.button&2?rt=3:et.button&4&&(rt=2)),Jt&&et.ctrlKey&&rt==1&&(rt=3),rt}var fr=function(){if(Ut&&fe<9)return!1;var et=Ce("div");return"draggable"in et||"dragDrop"in et}(),ar;function br(et){if(ar==null){var rt=Ce("span","\u200B");Wt(et,Ce("span",[rt,document.createTextNode("x")])),et.firstChild.offsetHeight!=0&&(ar=rt.offsetWidth<=1&&rt.offsetHeight>2&&!(Ut&&fe<8))}var lt=ar?Ce("span","\u200B"):Ce("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return lt.setAttribute("cm-text",""),lt}var Qn;function Nn(et){if(Qn!=null)return Qn;var rt=Wt(et,document.createTextNode("A\u062EA")),lt=ne(rt,0,1).getBoundingClientRect(),at=ne(rt,1,2).getBoundingClientRect();return Le(et),!lt||lt.left==lt.right?!1:Qn=at.right-lt.right<3}var yr=`
|
|
|
|
b`.split(/\n/).length!=3?function(et){for(var rt=0,lt=[],at=et.length;rt<=at;){var ht=et.indexOf(`
|
|
`,rt);ht==-1&&(ht=et.length);var mt=et.slice(rt,et.charAt(ht-1)=="\r"?ht-1:ht),kt=mt.indexOf("\r");kt!=-1?(lt.push(mt.slice(0,kt)),rt+=kt+1):(lt.push(mt),rt=ht+1)}return lt}:function(et){return et.split(/\r\n?|\n/)},yt=window.getSelection?function(et){try{return et.selectionStart!=et.selectionEnd}catch(rt){return!1}}:function(et){var rt;try{rt=et.ownerDocument.selection.createRange()}catch(lt){}return!rt||rt.parentElement()!=et?!1:rt.compareEndPoints("StartToEnd",rt)!=0},Mi=function(){var et=Ce("div");return"oncopy"in et?!0:(et.setAttribute("oncopy","return;"),typeof et.oncopy=="function")}(),on=null;function Ui(et){if(on!=null)return on;var rt=Wt(et,Ce("span","x")),lt=rt.getBoundingClientRect(),at=ne(rt,0,1).getBoundingClientRect();return on=Math.abs(lt.left-at.left)>1}var an={},vi={};function di(et,rt){arguments.length>2&&(rt.dependencies=Array.prototype.slice.call(arguments,2)),an[et]=rt}function xn(et,rt){vi[et]=rt}function en(et){if(typeof et=="string"&&vi.hasOwnProperty(et))et=vi[et];else if(et&&typeof et.name=="string"&&vi.hasOwnProperty(et.name)){var rt=vi[et.name];typeof rt=="string"&&(rt={name:rt}),et=We(rt,et),et.name=rt.name}else{if(typeof et=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(et))return en("application/xml");if(typeof et=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(et))return en("application/json")}return typeof et=="string"?{name:et}:et||{name:"null"}}function hn(et,rt){rt=en(rt);var lt=an[rt.name];if(!lt)return hn(et,"text/plain");var at=lt(et,rt);if(Vi.hasOwnProperty(rt.name)){var ht=Vi[rt.name];for(var mt in ht)ht.hasOwnProperty(mt)&&(at.hasOwnProperty(mt)&&(at["_"+mt]=at[mt]),at[mt]=ht[mt])}if(at.name=rt.name,rt.helperType&&(at.helperType=rt.helperType),rt.modeProps)for(var kt in rt.modeProps)at[kt]=rt.modeProps[kt];return at}var Vi={};function zi(et,rt){var lt=Vi.hasOwnProperty(et)?Vi[et]:Vi[et]={};oi(rt,lt)}function ur(et,rt){if(rt===!0)return rt;if(et.copyState)return et.copyState(rt);var lt={};for(var at in rt){var ht=rt[at];ht instanceof Array&&(ht=ht.concat([])),lt[at]=ht}return lt}function Vn(et,rt){for(var lt;et.innerMode&&(lt=et.innerMode(rt),!(!lt||lt.mode==et));)rt=lt.state,et=lt.mode;return lt||{mode:et,state:rt}}function $n(et,rt,lt){return et.startState?et.startState(rt,lt):!0}var Xe=function(et,rt,lt){this.pos=this.start=0,this.string=et,this.tabSize=rt||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=lt};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(et){var rt=this.string.charAt(this.pos),lt;if(typeof et=="string"?lt=rt==et:lt=rt&&(et.test?et.test(rt):et(rt)),lt)return++this.pos,rt},Xe.prototype.eatWhile=function(et){for(var rt=this.pos;this.eat(et););return this.pos>rt},Xe.prototype.eatSpace=function(){for(var et=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>et},Xe.prototype.skipToEnd=function(){this.pos=this.string.length},Xe.prototype.skipTo=function(et){var rt=this.string.indexOf(et,this.pos);if(rt>-1)return this.pos=rt,!0},Xe.prototype.backUp=function(et){this.pos-=et},Xe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Bt(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Bt(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.indentation=function(){return Bt(this.string,null,this.tabSize)-(this.lineStart?Bt(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.match=function(et,rt,lt){if(typeof et=="string"){var at=function(kt){return lt?kt.toLowerCase():kt},ht=this.string.substr(this.pos,et.length);if(at(ht)==at(et))return rt!==!1&&(this.pos+=et.length),!0}else{var mt=this.string.slice(this.pos).match(et);return mt&&mt.index>0?null:(mt&&rt!==!1&&(this.pos+=mt[0].length),mt)}},Xe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Xe.prototype.hideFirstChars=function(et,rt){this.lineStart+=et;try{return rt()}finally{this.lineStart-=et}},Xe.prototype.lookAhead=function(et){var rt=this.lineOracle;return rt&&rt.lookAhead(et)},Xe.prototype.baseToken=function(){var et=this.lineOracle;return et&&et.baseToken(this.pos)};function mi(et,rt){if(rt-=et.first,rt<0||rt>=et.size)throw new Error("There is no line "+(rt+et.first)+" in the document.");for(var lt=et;!lt.lines;)for(var at=0;;++at){var ht=lt.children[at],mt=ht.chunkSize();if(rt<mt){lt=ht;break}rt-=mt}return lt.lines[rt]}function fn(et,rt,lt){var at=[],ht=rt.line;return et.iter(rt.line,lt.line+1,function(mt){var kt=mt.text;ht==lt.line&&(kt=kt.slice(0,lt.ch)),ht==rt.line&&(kt=kt.slice(rt.ch)),at.push(kt),++ht}),at}function On(et,rt,lt){var at=[];return et.iter(rt,lt,function(ht){at.push(ht.text)}),at}function Gn(et,rt){var lt=rt-et.height;if(lt)for(var at=et;at;at=at.parent)at.height+=lt}function It(et){if(et.parent==null)return null;for(var rt=et.parent,lt=ge(rt.lines,et),at=rt.parent;at;rt=at,at=at.parent)for(var ht=0;at.children[ht]!=rt;++ht)lt+=at.children[ht].chunkSize();return lt+rt.first}function se(et,rt){var lt=et.first;t:do{for(var at=0;at<et.children.length;++at){var ht=et.children[at],mt=ht.height;if(rt<mt){et=ht;continue t}rt-=mt,lt+=ht.chunkSize()}return lt}while(!et.lines);for(var kt=0;kt<et.lines.length;++kt){var Lt=et.lines[kt],Nt=Lt.height;if(rt<Nt)break;rt-=Nt}return lt+kt}function xi(et,rt){return rt>=et.first&&rt<et.first+et.size}function Di(et,rt){return String(et.lineNumberFormatter(rt+et.firstLineNumber))}function Oe(et,rt,lt){if(lt===void 0&&(lt=null),!(this instanceof Oe))return new Oe(et,rt,lt);this.line=et,this.ch=rt,this.sticky=lt}function Ti(et,rt){return et.line-rt.line||et.ch-rt.ch}function rn(et,rt){return et.sticky==rt.sticky&&Ti(et,rt)==0}function ln(et){return Oe(et.line,et.ch)}function yn(et,rt){return Ti(et,rt)<0?rt:et}function ii(et,rt){return Ti(et,rt)<0?et:rt}function Hi(et,rt){return Math.max(et.first,Math.min(rt,et.first+et.size-1))}function Xi(et,rt){if(rt.line<et.first)return Oe(et.first,0);var lt=et.first+et.size-1;return rt.line>lt?Oe(lt,mi(et,lt).text.length):ki(rt,mi(et,rt.line).text.length)}function ki(et,rt){var lt=et.ch;return lt==null||lt>rt?Oe(et.line,rt):lt<0?Oe(et.line,0):et}function En(et,rt){for(var lt=[],at=0;at<rt.length;at++)lt[at]=Xi(et,rt[at]);return lt}var Fn=function(et,rt){this.state=et,this.lookAhead=rt},qi=function(et,rt,lt,at){this.state=rt,this.doc=et,this.line=lt,this.maxLookAhead=at||0,this.baseTokens=null,this.baseTokenPos=1};qi.prototype.lookAhead=function(et){var rt=this.doc.getLine(this.line+et);return rt!=null&&et>this.maxLookAhead&&(this.maxLookAhead=et),rt},qi.prototype.baseToken=function(et){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=et;)this.baseTokenPos+=2;var rt=this.baseTokens[this.baseTokenPos+1];return{type:rt&&rt.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-et}},qi.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},qi.fromSaved=function(et,rt,lt){return rt instanceof Fn?new qi(et,ur(et.mode,rt.state),lt,rt.lookAhead):new qi(et,ur(et.mode,rt),lt)},qi.prototype.save=function(et){var rt=et!==!1?ur(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Fn(rt,this.maxLookAhead):rt};function rr(et,rt,lt,at){var ht=[et.state.modeGen],mt={};ke(et,rt.text,et.doc.mode,lt,function(jt,Ee){return ht.push(jt,Ee)},mt,at);for(var kt=lt.state,Lt=function(jt){lt.baseTokens=ht;var Ee=et.state.overlays[jt],Kt=1,ri=0;lt.state=!0,ke(et,rt.text,Ee.mode,lt,function(Qe,Yi){for(var $i=Kt;ri<Qe;){var dn=ht[Kt];dn>Qe&&ht.splice(Kt,1,Qe,ht[Kt+1],dn),Kt+=2,ri=Math.min(Qe,dn)}if(Yi)if(Ee.opaque)ht.splice($i,Kt-$i,Qe,"overlay "+Yi),Kt=$i+2;else for(;$i<Kt;$i+=2){var Dn=ht[$i+1];ht[$i+1]=(Dn?Dn+" ":"")+"overlay "+Yi}},mt),lt.state=kt,lt.baseTokens=null,lt.baseTokenPos=1},Nt=0;Nt<et.state.overlays.length;++Nt)Lt(Nt);return{styles:ht,classes:mt.bgClass||mt.textClass?mt:null}}function Sr(et,rt,lt){if(!rt.styles||rt.styles[0]!=et.state.modeGen){var at=Kr(et,It(rt)),ht=rt.text.length>et.options.maxHighlightLength&&ur(et.doc.mode,at.state),mt=rr(et,rt,at);ht&&(at.state=ht),rt.stateAfter=at.save(!ht),rt.styles=mt.styles,mt.classes?rt.styleClasses=mt.classes:rt.styleClasses&&(rt.styleClasses=null),lt===et.doc.highlightFrontier&&(et.doc.modeFrontier=Math.max(et.doc.modeFrontier,++et.doc.highlightFrontier))}return rt.styles}function Kr(et,rt,lt){var at=et.doc,ht=et.display;if(!at.mode.startState)return new qi(at,!0,rt);var mt=$e(et,rt,lt),kt=mt>at.first&&mi(at,mt-1).stateAfter,Lt=kt?qi.fromSaved(at,kt,mt):new qi(at,$n(at.mode),mt);return at.iter(mt,rt,function(Nt){ze(et,Nt.text,Lt);var jt=Lt.line;Nt.stateAfter=jt==rt-1||jt%5==0||jt>=ht.viewFrom&&jt<ht.viewTo?Lt.save():null,Lt.nextLine()}),lt&&(at.modeFrontier=Lt.line),Lt}function ze(et,rt,lt,at){var ht=et.doc.mode,mt=new Xe(rt,et.options.tabSize,lt);for(mt.start=mt.pos=at||0,rt==""&&gn(ht,lt.state);!mt.eol();)nr(ht,mt,lt.state),mt.start=mt.pos}function gn(et,rt){if(et.blankLine)return et.blankLine(rt);if(et.innerMode){var lt=Vn(et,rt);if(lt.mode.blankLine)return lt.mode.blankLine(lt.state)}}function nr(et,rt,lt,at){for(var ht=0;ht<10;ht++){at&&(at[0]=Vn(et,lt).mode);var mt=et.token(rt,lt);if(rt.pos>rt.start)return mt}throw new Error("Mode "+et.name+" failed to advance stream.")}var Sn=function(et,rt,lt){this.start=et.start,this.end=et.pos,this.string=et.current(),this.type=rt||null,this.state=lt};function Ke(et,rt,lt,at){var ht=et.doc,mt=ht.mode,kt;rt=Xi(ht,rt);var Lt=mi(ht,rt.line),Nt=Kr(et,rt.line,lt),jt=new Xe(Lt.text,et.options.tabSize,Nt),Ee;for(at&&(Ee=[]);(at||jt.pos<rt.ch)&&!jt.eol();)jt.start=jt.pos,kt=nr(mt,jt,Nt.state),at&&Ee.push(new Sn(jt,kt,ur(ht.mode,Nt.state)));return at?Ee:new Sn(jt,kt,Nt.state)}function Fe(et,rt){if(et)for(;;){var lt=et.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!lt)break;et=et.slice(0,lt.index)+et.slice(lt.index+lt[0].length);var at=lt[1]?"bgClass":"textClass";rt[at]==null?rt[at]=lt[2]:new RegExp("(?:^|\\s)"+lt[2]+"(?:$|\\s)").test(rt[at])||(rt[at]+=" "+lt[2])}return et}function ke(et,rt,lt,at,ht,mt,kt){var Lt=lt.flattenSpans;Lt==null&&(Lt=et.options.flattenSpans);var Nt=0,jt=null,Ee=new Xe(rt,et.options.tabSize,at),Kt,ri=et.options.addModeClass&&[null];for(rt==""&&Fe(gn(lt,at.state),mt);!Ee.eol();){if(Ee.pos>et.options.maxHighlightLength?(Lt=!1,kt&&ze(et,rt,at,Ee.pos),Ee.pos=rt.length,Kt=null):Kt=Fe(nr(lt,Ee,at.state,ri),mt),ri){var Qe=ri[0].name;Qe&&(Kt="m-"+(Kt?Qe+" "+Kt:Qe))}if(!Lt||jt!=Kt){for(;Nt<Ee.start;)Nt=Math.min(Ee.start,Nt+5e3),ht(Nt,jt);jt=Kt}Ee.start=Ee.pos}for(;Nt<Ee.pos;){var Yi=Math.min(Ee.pos,Nt+5e3);ht(Yi,jt),Nt=Yi}}function $e(et,rt,lt){for(var at,ht,mt=et.doc,kt=lt?-1:rt-(et.doc.mode.innerMode?1e3:100),Lt=rt;Lt>kt;--Lt){if(Lt<=mt.first)return mt.first;var Nt=mi(mt,Lt-1),jt=Nt.stateAfter;if(jt&&(!lt||Lt+(jt instanceof Fn?jt.lookAhead:0)<=mt.modeFrontier))return Lt;var Ee=Bt(Nt.text,null,et.options.tabSize);(ht==null||at>Ee)&&(ht=Lt-1,at=Ee)}return ht}function pi(et,rt){if(et.modeFrontier=Math.min(et.modeFrontier,rt),!(et.highlightFrontier<rt-10)){for(var lt=et.first,at=rt-1;at>lt;at--){var ht=mi(et,at).stateAfter;if(ht&&(!(ht instanceof Fn)||at+ht.lookAhead<rt)){lt=at+1;break}}et.highlightFrontier=Math.min(et.highlightFrontier,lt)}}var Ei=!1,Me=!1;function cn(){Ei=!0}function _e(){Me=!0}function bi(et,rt,lt){this.marker=et,this.from=rt,this.to=lt}function pn(et,rt){if(et)for(var lt=0;lt<et.length;++lt){var at=et[lt];if(at.marker==rt)return at}}function kn(et,rt){for(var lt,at=0;at<et.length;++at)et[at]!=rt&&(lt||(lt=[])).push(et[at]);return lt}function zn(et,rt){et.markedSpans=et.markedSpans?et.markedSpans.concat([rt]):[rt],rt.marker.attachLine(et)}function Bn(et,rt,lt){var at;if(et)for(var ht=0;ht<et.length;++ht){var mt=et[ht],kt=mt.marker,Lt=mt.from==null||(kt.inclusiveLeft?mt.from<=rt:mt.from<rt);if(Lt||mt.from==rt&&kt.type=="bookmark"&&(!lt||!mt.marker.insertLeft)){var Nt=mt.to==null||(kt.inclusiveRight?mt.to>=rt:mt.to>rt);(at||(at=[])).push(new bi(kt,mt.from,Nt?null:mt.to))}}return at}function Tn(et,rt,lt){var at;if(et)for(var ht=0;ht<et.length;++ht){var mt=et[ht],kt=mt.marker,Lt=mt.to==null||(kt.inclusiveRight?mt.to>=rt:mt.to>rt);if(Lt||mt.from==rt&&kt.type=="bookmark"&&(!lt||mt.marker.insertLeft)){var Nt=mt.from==null||(kt.inclusiveLeft?mt.from<=rt:mt.from<rt);(at||(at=[])).push(new bi(kt,Nt?null:mt.from-rt,mt.to==null?null:mt.to-rt))}}return at}function or(et,rt){if(rt.full)return null;var lt=xi(et,rt.from.line)&&mi(et,rt.from.line).markedSpans,at=xi(et,rt.to.line)&&mi(et,rt.to.line).markedSpans;if(!lt&&!at)return null;var ht=rt.from.ch,mt=rt.to.ch,kt=Ti(rt.from,rt.to)==0,Lt=Bn(lt,ht,kt),Nt=Tn(at,mt,kt),jt=rt.text.length==1,Ee=ee(rt.text).length+(jt?ht:0);if(Lt)for(var Kt=0;Kt<Lt.length;++Kt){var ri=Lt[Kt];if(ri.to==null){var Qe=pn(Nt,ri.marker);Qe?jt&&(ri.to=Qe.to==null?null:Qe.to+Ee):ri.to=ht}}if(Nt)for(var Yi=0;Yi<Nt.length;++Yi){var $i=Nt[Yi];if($i.to!=null&&($i.to+=Ee),$i.from==null){var dn=pn(Lt,$i.marker);dn||($i.from=Ee,jt&&(Lt||(Lt=[])).push($i))}else $i.from+=Ee,jt&&(Lt||(Lt=[])).push($i)}Lt&&(Lt=Fr(Lt)),Nt&&Nt!=Lt&&(Nt=Fr(Nt));var Dn=[Lt];if(!jt){var tr=rt.text.length-2,Wn;if(tr>0&&Lt)for(var lr=0;lr<Lt.length;++lr)Lt[lr].to==null&&(Wn||(Wn=[])).push(new bi(Lt[lr].marker,null,null));for(var Pr=0;Pr<tr;++Pr)Dn.push(Wn);Dn.push(Nt)}return Dn}function Fr(et){for(var rt=0;rt<et.length;++rt){var lt=et[rt];lt.from!=null&<.from==lt.to&<.marker.clearWhenEmpty!==!1&&et.splice(rt--,1)}return et.length?et:null}function Zn(et,rt,lt){var at=null;if(et.iter(rt.line,lt.line+1,function(Qe){if(Qe.markedSpans)for(var Yi=0;Yi<Qe.markedSpans.length;++Yi){var $i=Qe.markedSpans[Yi].marker;$i.readOnly&&(!at||ge(at,$i)==-1)&&(at||(at=[])).push($i)}}),!at)return null;for(var ht=[{from:rt,to:lt}],mt=0;mt<at.length;++mt)for(var kt=at[mt],Lt=kt.find(0),Nt=0;Nt<ht.length;++Nt){var jt=ht[Nt];if(!(Ti(jt.to,Lt.from)<0||Ti(jt.from,Lt.to)>0)){var Ee=[Nt,1],Kt=Ti(jt.from,Lt.from),ri=Ti(jt.to,Lt.to);(Kt<0||!kt.inclusiveLeft&&!Kt)&&Ee.push({from:jt.from,to:Lt.from}),(ri>0||!kt.inclusiveRight&&!ri)&&Ee.push({from:Lt.to,to:jt.to}),ht.splice.apply(ht,Ee),Nt+=Ee.length-3}}return ht}function ji(et){var rt=et.markedSpans;if(rt){for(var lt=0;lt<rt.length;++lt)rt[lt].marker.detachLine(et);et.markedSpans=null}}function Pt(et,rt){if(rt){for(var lt=0;lt<rt.length;++lt)rt[lt].marker.attachLine(et);et.markedSpans=rt}}function gr(et){return et.inclusiveLeft?-1:0}function Un(et){return et.inclusiveRight?1:0}function Ar(et,rt){var lt=et.lines.length-rt.lines.length;if(lt!=0)return lt;var at=et.find(),ht=rt.find(),mt=Ti(at.from,ht.from)||gr(et)-gr(rt);if(mt)return-mt;var kt=Ti(at.to,ht.to)||Un(et)-Un(rt);return kt||rt.id-et.id}function Dr(et,rt){var lt=Me&&et.markedSpans,at;if(lt)for(var ht=void 0,mt=0;mt<lt.length;++mt)ht=lt[mt],ht.marker.collapsed&&(rt?ht.from:ht.to)==null&&(!at||Ar(at,ht.marker)<0)&&(at=ht.marker);return at}function Cr(et){return Dr(et,!0)}function sn(et){return Dr(et,!1)}function vn(et,rt){var lt=Me&&et.markedSpans,at;if(lt)for(var ht=0;ht<lt.length;++ht){var mt=lt[ht];mt.marker.collapsed&&(mt.from==null||mt.from<rt)&&(mt.to==null||mt.to>rt)&&(!at||Ar(at,mt.marker)<0)&&(at=mt.marker)}return at}function Yn(et,rt,lt,at,ht){var mt=mi(et,rt),kt=Me&&mt.markedSpans;if(kt)for(var Lt=0;Lt<kt.length;++Lt){var Nt=kt[Lt];if(Nt.marker.collapsed){var jt=Nt.marker.find(0),Ee=Ti(jt.from,lt)||gr(Nt.marker)-gr(ht),Kt=Ti(jt.to,at)||Un(Nt.marker)-Un(ht);if(!(Ee>=0&&Kt<=0||Ee<=0&&Kt>=0)&&(Ee<=0&&(Nt.marker.inclusiveRight&&ht.inclusiveLeft?Ti(jt.to,lt)>=0:Ti(jt.to,lt)>0)||Ee>=0&&(Nt.marker.inclusiveRight&&ht.inclusiveLeft?Ti(jt.from,at)<=0:Ti(jt.from,at)<0)))return!0}}}function Gi(et){for(var rt;rt=Cr(et);)et=rt.find(-1,!0).line;return et}function mn(et){for(var rt;rt=sn(et);)et=rt.find(1,!0).line;return et}function Kn(et){for(var rt,lt;rt=sn(et);)et=rt.find(1,!0).line,(lt||(lt=[])).push(et);return lt}function un(et,rt){var lt=mi(et,rt),at=Gi(lt);return lt==at?rt:It(at)}function Wi(et,rt){if(rt>et.lastLine())return rt;var lt=mi(et,rt),at;if(!li(et,lt))return rt;for(;at=sn(lt);)lt=at.find(1,!0).line;return It(lt)+1}function li(et,rt){var lt=Me&&rt.markedSpans;if(lt){for(var at=void 0,ht=0;ht<lt.length;++ht)if(at=lt[ht],!!at.marker.collapsed){if(at.from==null)return!0;if(!at.marker.widgetNode&&at.from==0&&at.marker.inclusiveLeft&&Pn(et,rt,at))return!0}}}function Pn(et,rt,lt){if(lt.to==null){var at=lt.marker.find(1,!0);return Pn(et,at.line,pn(at.line.markedSpans,lt.marker))}if(lt.marker.inclusiveRight&<.to==rt.text.length)return!0;for(var ht=void 0,mt=0;mt<rt.markedSpans.length;++mt)if(ht=rt.markedSpans[mt],ht.marker.collapsed&&!ht.marker.widgetNode&&ht.from==lt.to&&(ht.to==null||ht.to!=lt.from)&&(ht.marker.inclusiveLeft||lt.marker.inclusiveRight)&&Pn(et,rt,ht))return!0}function wr(et){et=Gi(et);for(var rt=0,lt=et.parent,at=0;at<lt.lines.length;++at){var ht=lt.lines[at];if(ht==et)break;rt+=ht.height}for(var mt=lt.parent;mt;lt=mt,mt=lt.parent)for(var kt=0;kt<mt.children.length;++kt){var Lt=mt.children[kt];if(Lt==lt)break;rt+=Lt.height}return rt}function Tr(et){if(et.height==0)return 0;for(var rt=et.text.length,lt,at=et;lt=Cr(at);){var ht=lt.find(0,!0);at=ht.from.line,rt+=ht.from.ch-ht.to.ch}for(at=et;lt=sn(at);){var mt=lt.find(0,!0);rt-=at.text.length-mt.from.ch,at=mt.to.line,rt+=at.text.length-mt.to.ch}return rt}function Lr(et){var rt=et.display,lt=et.doc;rt.maxLine=mi(lt,lt.first),rt.maxLineLength=Tr(rt.maxLine),rt.maxLineChanged=!0,lt.iter(function(at){var ht=Tr(at);ht>rt.maxLineLength&&(rt.maxLineLength=ht,rt.maxLine=at)})}var Xr=function(et,rt,lt){this.text=et,Pt(this,rt),this.height=lt?lt(this):1};Xr.prototype.lineNo=function(){return It(this)},Oi(Xr);function oo(et,rt,lt,at){et.text=rt,et.stateAfter&&(et.stateAfter=null),et.styles&&(et.styles=null),et.order!=null&&(et.order=null),ji(et),Pt(et,lt);var ht=at?at(et):1;ht!=et.height&&Gn(et,ht)}function so(et){et.parent=null,ji(et)}var bo={},io={};function go(et,rt){if(!et||/^\s*$/.test(et))return null;var lt=rt.addModeClass?io:bo;return lt[et]||(lt[et]=et.replace(/\S+/g,"cm-$&"))}function be(et,rt){var lt=Te("span",null,null,$t?"padding-right: .1px":null),at={pre:Te("pre",[lt],"CodeMirror-line"),content:lt,col:0,pos:0,cm:et,trailingSpace:!1,splitSpaces:et.getOption("lineWrapping")};rt.measure={};for(var ht=0;ht<=(rt.rest?rt.rest.length:0);ht++){var mt=ht?rt.rest[ht-1]:rt.line,kt=void 0;at.pos=0,at.addToken=rs,Nn(et.display.measure)&&(kt=At(mt,et.doc.direction))&&(at.addToken=Qr(at.addToken,kt)),at.map=[];var Lt=rt!=et.display.externalMeasured&&It(mt);ao(mt,at,Sr(et,mt,Lt)),mt.styleClasses&&(mt.styleClasses.bgClass&&(at.bgClass=Ai(mt.styleClasses.bgClass,at.bgClass||"")),mt.styleClasses.textClass&&(at.textClass=Ai(mt.styleClasses.textClass,at.textClass||""))),at.map.length==0&&at.map.push(0,0,at.content.appendChild(br(et.display.measure))),ht==0?(rt.measure.map=at.map,rt.measure.cache={}):((rt.measure.maps||(rt.measure.maps=[])).push(at.map),(rt.measure.caches||(rt.measure.caches=[])).push({}))}if($t){var Nt=at.content.lastChild;(/\bcm-tab\b/.test(Nt.className)||Nt.querySelector&&Nt.querySelector(".cm-tab"))&&(at.content.className="cm-tab-wrap-hack")}return qe(et,"renderLine",et,rt.line,at.pre),at.pre.className&&(at.textClass=Ai(at.pre.className,at.textClass||"")),at}function Oo(et){var rt=Ce("span","\u2022","cm-invalidchar");return rt.title="\\u"+et.charCodeAt(0).toString(16),rt.setAttribute("aria-label",rt.title),rt}function rs(et,rt,lt,at,ht,mt,kt){if(rt){var Lt=et.splitSpaces?po(rt,et.trailingSpace):rt,Nt=et.cm.state.specialChars,jt=!1,Ee;if(!Nt.test(rt))et.col+=rt.length,Ee=document.createTextNode(Lt),et.map.push(et.pos,et.pos+rt.length,Ee),Ut&&fe<9&&(jt=!0),et.pos+=rt.length;else{Ee=document.createDocumentFragment();for(var Kt=0;;){Nt.lastIndex=Kt;var ri=Nt.exec(rt),Qe=ri?ri.index-Kt:rt.length-Kt;if(Qe){var Yi=document.createTextNode(Lt.slice(Kt,Kt+Qe));Ut&&fe<9?Ee.appendChild(Ce("span",[Yi])):Ee.appendChild(Yi),et.map.push(et.pos,et.pos+Qe,Yi),et.col+=Qe,et.pos+=Qe}if(!ri)break;Kt+=Qe+1;var $i=void 0;if(ri[0]==" "){var dn=et.cm.options.tabSize,Dn=dn-et.col%dn;$i=Ee.appendChild(Ce("span",ie(Dn),"cm-tab")),$i.setAttribute("role","presentation"),$i.setAttribute("cm-text"," "),et.col+=Dn}else ri[0]=="\r"||ri[0]==`
|
|
`?($i=Ee.appendChild(Ce("span",ri[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),$i.setAttribute("cm-text",ri[0]),et.col+=1):($i=et.cm.options.specialCharPlaceholder(ri[0]),$i.setAttribute("cm-text",ri[0]),Ut&&fe<9?Ee.appendChild(Ce("span",[$i])):Ee.appendChild($i),et.col+=1);et.map.push(et.pos,et.pos+1,$i),et.pos++}}if(et.trailingSpace=Lt.charCodeAt(rt.length-1)==32,lt||at||ht||jt||mt||kt){var tr=lt||"";at&&(tr+=at),ht&&(tr+=ht);var Wn=Ce("span",[Ee],tr,mt);if(kt)for(var lr in kt)kt.hasOwnProperty(lr)&&lr!="style"&&lr!="class"&&Wn.setAttribute(lr,kt[lr]);return et.content.appendChild(Wn)}et.content.appendChild(Ee)}}function po(et,rt){if(et.length>1&&!/ /.test(et))return et;for(var lt=rt,at="",ht=0;ht<et.length;ht++){var mt=et.charAt(ht);mt==" "&<&&(ht==et.length-1||et.charCodeAt(ht+1)==32)&&(mt="\xA0"),at+=mt,lt=mt==" "}return at}function Qr(et,rt){return function(lt,at,ht,mt,kt,Lt,Nt){ht=ht?ht+" cm-force-border":"cm-force-border";for(var jt=lt.pos,Ee=jt+at.length;;){for(var Kt=void 0,ri=0;ri<rt.length&&(Kt=rt[ri],!(Kt.to>jt&&Kt.from<=jt));ri++);if(Kt.to>=Ee)return et(lt,at,ht,mt,kt,Lt,Nt);et(lt,at.slice(0,Kt.to-jt),ht,mt,null,Lt,Nt),mt=null,at=at.slice(Kt.to-jt),jt=Kt.to}}}function ps(et,rt,lt,at){var ht=!at&<.widgetNode;ht&&et.map.push(et.pos,et.pos+rt,ht),!at&&et.cm.display.input.needsContentAttribute&&(ht||(ht=et.content.appendChild(document.createElement("span"))),ht.setAttribute("cm-marker",lt.id)),ht&&(et.cm.display.input.setUneditable(ht),et.content.appendChild(ht)),et.pos+=rt,et.trailingSpace=!1}function ao(et,rt,lt){var at=et.markedSpans,ht=et.text,mt=0;if(!at){for(var kt=1;kt<lt.length;kt+=2)rt.addToken(rt,ht.slice(mt,mt=lt[kt]),go(lt[kt+1],rt.cm.options));return}for(var Lt=ht.length,Nt=0,jt=1,Ee="",Kt,ri,Qe=0,Yi,$i,dn,Dn,tr;;){if(Qe==Nt){Yi=$i=dn=ri="",tr=null,Dn=null,Qe=1/0;for(var Wn=[],lr=void 0,Pr=0;Pr<at.length;++Pr){var _n=at[Pr],Zr=_n.marker;if(Zr.type=="bookmark"&&_n.from==Nt&&Zr.widgetNode)Wn.push(Zr);else if(_n.from<=Nt&&(_n.to==null||_n.to>Nt||Zr.collapsed&&_n.to==Nt&&_n.from==Nt)){if(_n.to!=null&&_n.to!=Nt&&Qe>_n.to&&(Qe=_n.to,$i=""),Zr.className&&(Yi+=" "+Zr.className),Zr.css&&(ri=(ri?ri+";":"")+Zr.css),Zr.startStyle&&_n.from==Nt&&(dn+=" "+Zr.startStyle),Zr.endStyle&&_n.to==Qe&&(lr||(lr=[])).push(Zr.endStyle,_n.to),Zr.title&&((tr||(tr={})).title=Zr.title),Zr.attributes)for(var Ho in Zr.attributes)(tr||(tr={}))[Ho]=Zr.attributes[Ho];Zr.collapsed&&(!Dn||Ar(Dn.marker,Zr)<0)&&(Dn=_n)}else _n.from>Nt&&Qe>_n.from&&(Qe=_n.from)}if(lr)for(var ks=0;ks<lr.length;ks+=2)lr[ks+1]==Qe&&($i+=" "+lr[ks]);if(!Dn||Dn.from==Nt)for(var Xo=0;Xo<Wn.length;++Xo)ps(rt,0,Wn[Xo]);if(Dn&&(Dn.from||0)==Nt){if(ps(rt,(Dn.to==null?Lt+1:Dn.to)-Nt,Dn.marker,Dn.from==null),Dn.to==null)return;Dn.to==Nt&&(Dn=!1)}}if(Nt>=Lt)break;for(var Na=Math.min(Lt,Qe);;){if(Ee){var ra=Nt+Ee.length;if(!Dn){var ms=ra>Na?Ee.slice(0,Na-Nt):Ee;rt.addToken(rt,ms,Kt?Kt+Yi:Yi,dn,Nt+ms.length==Qe?$i:"",ri,tr)}if(ra>=Na){Ee=Ee.slice(Na-Nt),Nt=Na;break}Nt=ra,dn=""}Ee=ht.slice(mt,mt=lt[jt++]),Kt=go(lt[jt++],rt.cm.options)}}}function Pl(et,rt,lt){this.line=rt,this.rest=Kn(rt),this.size=this.rest?It(ee(this.rest))-lt+1:1,this.node=this.text=null,this.hidden=li(et,rt)}function jr(et,rt,lt){for(var at=[],ht,mt=rt;mt<lt;mt=ht){var kt=new Pl(et.doc,mi(et.doc,mt),mt);ht=mt+kt.size,at.push(kt)}return at}var Io=null;function hl(et){Io?Io.ops.push(et):et.ownsGroup=Io={ops:[et],delayedCallbacks:[]}}function Bo(et){var rt=et.delayedCallbacks,lt=0;do{for(;lt<rt.length;lt++)rt[lt].call(null);for(var at=0;at<et.ops.length;at++){var ht=et.ops[at];if(ht.cursorActivityHandlers)for(;ht.cursorActivityCalled<ht.cursorActivityHandlers.length;)ht.cursorActivityHandlers[ht.cursorActivityCalled++].call(null,ht.cm)}}while(lt<rt.length)}function ho(et,rt){var lt=et.ownsGroup;if(lt)try{Bo(lt)}finally{Io=null,rt(lt)}}var ta=null;function jn(et,rt){var lt=ni(et,rt);if(lt.length){var at=Array.prototype.slice.call(arguments,2),ht;Io?ht=Io.delayedCallbacks:ta?ht=ta:(ht=ta=[],setTimeout(Ba,0));for(var mt=function(Lt){ht.push(function(){return lt[Lt].apply(null,at)})},kt=0;kt<lt.length;++kt)mt(kt)}}function Ba(){var et=ta;ta=null;for(var rt=0;rt<et.length;++rt)et[rt]()}function Oa(et,rt,lt,at){for(var ht=0;ht<rt.changes.length;ht++){var mt=rt.changes[ht];mt=="text"?nn(et,rt):mt=="gutter"?qn(et,rt,lt,at):mt=="class"?Jn(et,rt):mt=="widget"&&mr(et,rt,at)}rt.changes=null}function Vs(et){return et.node==et.text&&(et.node=Ce("div",null,null,"position: relative"),et.text.parentNode&&et.text.parentNode.replaceChild(et.node,et.text),et.node.appendChild(et.text),Ut&&fe<8&&(et.node.style.zIndex=2)),et.node}function Qo(et,rt){var lt=rt.bgClass?rt.bgClass+" "+(rt.line.bgClass||""):rt.line.bgClass;if(lt&&(lt+=" CodeMirror-linebackground"),rt.background)lt?rt.background.className=lt:(rt.background.parentNode.removeChild(rt.background),rt.background=null);else if(lt){var at=Vs(rt);rt.background=at.insertBefore(Ce("div",null,lt),at.firstChild),et.display.input.setUneditable(rt.background)}}function Gs(et,rt){var lt=et.display.externalMeasured;return lt&<.line==rt.line?(et.display.externalMeasured=null,rt.measure=lt.measure,lt.built):be(et,rt)}function nn(et,rt){var lt=rt.text.className,at=Gs(et,rt);rt.text==rt.node&&(rt.node=at.pre),rt.text.parentNode.replaceChild(at.pre,rt.text),rt.text=at.pre,at.bgClass!=rt.bgClass||at.textClass!=rt.textClass?(rt.bgClass=at.bgClass,rt.textClass=at.textClass,Jn(et,rt)):lt&&(rt.text.className=lt)}function Jn(et,rt){Qo(et,rt),rt.line.wrapClass?Vs(rt).className=rt.line.wrapClass:rt.node!=rt.text&&(rt.node.className="");var lt=rt.textClass?rt.textClass+" "+(rt.line.textClass||""):rt.line.textClass;rt.text.className=lt||""}function qn(et,rt,lt,at){if(rt.gutter&&(rt.node.removeChild(rt.gutter),rt.gutter=null),rt.gutterBackground&&(rt.node.removeChild(rt.gutterBackground),rt.gutterBackground=null),rt.line.gutterClass){var ht=Vs(rt);rt.gutterBackground=Ce("div",null,"CodeMirror-gutter-background "+rt.line.gutterClass,"left: "+(et.options.fixedGutter?at.fixedPos:-at.gutterTotalWidth)+"px; width: "+at.gutterTotalWidth+"px"),et.display.input.setUneditable(rt.gutterBackground),ht.insertBefore(rt.gutterBackground,rt.text)}var mt=rt.line.gutterMarkers;if(et.options.lineNumbers||mt){var kt=Vs(rt),Lt=rt.gutter=Ce("div",null,"CodeMirror-gutter-wrapper","left: "+(et.options.fixedGutter?at.fixedPos:-at.gutterTotalWidth)+"px");if(et.display.input.setUneditable(Lt),kt.insertBefore(Lt,rt.text),rt.line.gutterClass&&(Lt.className+=" "+rt.line.gutterClass),et.options.lineNumbers&&(!mt||!mt["CodeMirror-linenumbers"])&&(rt.lineNumber=Lt.appendChild(Ce("div",Di(et.options,lt),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+at.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+et.display.lineNumInnerWidth+"px"))),mt)for(var Nt=0;Nt<et.display.gutterSpecs.length;++Nt){var jt=et.display.gutterSpecs[Nt].className,Ee=mt.hasOwnProperty(jt)&&mt[jt];Ee&&Lt.appendChild(Ce("div",[Ee],"CodeMirror-gutter-elt","left: "+at.gutterLeft[jt]+"px; width: "+at.gutterWidth[jt]+"px"))}}}function mr(et,rt,lt){rt.alignable&&(rt.alignable=null);for(var at=pe("CodeMirror-linewidget"),ht=rt.node.firstChild,mt=void 0;ht;ht=mt)mt=ht.nextSibling,at.test(ht.className)&&rt.node.removeChild(ht);no(et,rt,lt)}function Nr(et,rt,lt,at){var ht=Gs(et,rt);return rt.text=rt.node=ht.pre,ht.bgClass&&(rt.bgClass=ht.bgClass),ht.textClass&&(rt.textClass=ht.textClass),Jn(et,rt),qn(et,rt,lt,at),no(et,rt,at),rt.node}function no(et,rt,lt){if(Hn(et,rt.line,rt,lt,!0),rt.rest)for(var at=0;at<rt.rest.length;at++)Hn(et,rt.rest[at],rt,lt,!1)}function Hn(et,rt,lt,at,ht){if(rt.widgets)for(var mt=Vs(lt),kt=0,Lt=rt.widgets;kt<Lt.length;++kt){var Nt=Lt[kt],jt=Ce("div",[Nt.node],"CodeMirror-linewidget"+(Nt.className?" "+Nt.className:""));Nt.handleMouseEvents||jt.setAttribute("cm-ignore-events","true"),ea(Nt,jt,lt,at),et.display.input.setUneditable(jt),ht&&Nt.above?mt.insertBefore(jt,lt.gutter||lt.text):mt.appendChild(jt),jn(Nt,"redraw")}}function ea(et,rt,lt,at){if(et.noHScroll){(lt.alignable||(lt.alignable=[])).push(rt);var ht=at.wrapperWidth;rt.style.left=at.fixedPos+"px",et.coverGutter||(ht-=at.gutterTotalWidth,rt.style.paddingLeft=at.gutterTotalWidth+"px"),rt.style.width=ht+"px"}et.coverGutter&&(rt.style.zIndex=5,rt.style.position="relative",et.noHScroll||(rt.style.marginLeft=-at.gutterTotalWidth+"px"))}function os(et){if(et.height!=null)return et.height;var rt=et.doc.cm;if(!rt)return 0;if(!Re(document.body,et.node)){var lt="position: relative;";et.coverGutter&&(lt+="margin-left: -"+rt.display.gutters.offsetWidth+"px;"),et.noHScroll&&(lt+="width: "+rt.display.wrapper.clientWidth+"px;"),Wt(rt.display.measure,Ce("div",[et.node],null,lt))}return et.height=et.node.parentNode.offsetHeight}function $o(et,rt){for(var lt=er(rt);lt!=et.wrapper;lt=lt.parentNode)if(!lt||lt.nodeType==1&<.getAttribute("cm-ignore-events")=="true"||lt.parentNode==et.sizer&<!=et.mover)return!0}function vo(et){return et.lineSpace.offsetTop}function Ps(et){return et.mover.offsetHeight-et.lineSpace.offsetHeight}function ha(et){if(et.cachedPaddingH)return et.cachedPaddingH;var rt=Wt(et.measure,Ce("pre","x","CodeMirror-line-like")),lt=window.getComputedStyle?window.getComputedStyle(rt):rt.currentStyle,at={left:parseInt(lt.paddingLeft),right:parseInt(lt.paddingRight)};return!isNaN(at.left)&&!isNaN(at.right)&&(et.cachedPaddingH=at),at}function Ns(et){return Ge-et.display.nativeBarWidth}function ia(et){return et.display.scroller.clientWidth-Ns(et)-et.display.barWidth}function cl(et){return et.display.scroller.clientHeight-Ns(et)-et.display.barHeight}function Ia(et,rt,lt){var at=et.options.lineWrapping,ht=at&&ia(et);if(!rt.measure.heights||at&&rt.measure.width!=ht){var mt=rt.measure.heights=[];if(at){rt.measure.width=ht;for(var kt=rt.text.firstChild.getClientRects(),Lt=0;Lt<kt.length-1;Lt++){var Nt=kt[Lt],jt=kt[Lt+1];Math.abs(Nt.bottom-jt.bottom)>2&&mt.push((Nt.bottom+jt.top)/2-lt.top)}}mt.push(lt.bottom-lt.top)}}function _l(et,rt,lt){if(et.line==rt)return{map:et.measure.map,cache:et.measure.cache};for(var at=0;at<et.rest.length;at++)if(et.rest[at]==rt)return{map:et.measure.maps[at],cache:et.measure.caches[at]};for(var ht=0;ht<et.rest.length;ht++)if(It(et.rest[ht])>lt)return{map:et.measure.maps[ht],cache:et.measure.caches[ht],before:!0}}function bh(et,rt){rt=Gi(rt);var lt=It(rt),at=et.display.externalMeasured=new Pl(et.doc,rt,lt);at.lineN=lt;var ht=at.built=be(et,at);return at.text=ht.pre,Wt(et.display.lineMeasure,ht.pre),at}function gs(et,rt,lt,at){return Ca(et,fl(et,rt),lt,at)}function Ja(et,rt){if(rt>=et.display.viewFrom&&rt<et.display.viewTo)return et.display.view[$a(et,rt)];var lt=et.display.externalMeasured;if(lt&&rt>=lt.lineN&&rt<lt.lineN+lt.size)return lt}function fl(et,rt){var lt=It(rt),at=Ja(et,lt);at&&!at.text?at=null:at&&at.changes&&(Oa(et,at,lt,Su(et)),et.curOp.forceUpdate=!0),at||(at=bh(et,rt));var ht=_l(at,rt,lt);return{line:rt,view:at,rect:null,map:ht.map,cache:ht.cache,before:ht.before,hasHeights:!1}}function Ca(et,rt,lt,at,ht){rt.before&&(lt=-1);var mt=lt+(at||""),kt;return rt.cache.hasOwnProperty(mt)?kt=rt.cache[mt]:(rt.rect||(rt.rect=rt.view.text.getBoundingClientRect()),rt.hasHeights||(Ia(et,rt.view,rt.rect),rt.hasHeights=!0),kt=Fi(et,rt,lt,at),kt.bogus||(rt.cache[mt]=kt)),{left:kt.left,right:kt.right,top:ht?kt.rtop:kt.top,bottom:ht?kt.rbottom:kt.bottom}}var ql={left:0,right:0,top:0,bottom:0};function tu(et,rt,lt){for(var at,ht,mt,kt,Lt,Nt,jt=0;jt<et.length;jt+=3)if(Lt=et[jt],Nt=et[jt+1],rt<Lt?(ht=0,mt=1,kt="left"):rt<Nt?(ht=rt-Lt,mt=ht+1):(jt==et.length-3||rt==Nt&&et[jt+3]>rt)&&(mt=Nt-Lt,ht=mt-1,rt>=Nt&&(kt="right")),ht!=null){if(at=et[jt+2],Lt==Nt&<==(at.insertLeft?"left":"right")&&(kt=lt),lt=="left"&&ht==0)for(;jt&&et[jt-2]==et[jt-3]&&et[jt-1].insertLeft;)at=et[(jt-=3)+2],kt="left";if(lt=="right"&&ht==Nt-Lt)for(;jt<et.length-3&&et[jt+3]==et[jt+4]&&!et[jt+5].insertLeft;)at=et[(jt+=3)+2],kt="right";break}return{node:at,start:ht,end:mt,collapse:kt,coverStart:Lt,coverEnd:Nt}}function Bi(et,rt){var lt=ql;if(rt=="left")for(var at=0;at<et.length&&(lt=et[at]).left==lt.right;at++);else for(var ht=et.length-1;ht>=0&&(lt=et[ht]).left==lt.right;ht--);return lt}function Fi(et,rt,lt,at){var ht=tu(rt.map,lt,at),mt=ht.node,kt=ht.start,Lt=ht.end,Nt=ht.collapse,jt;if(mt.nodeType==3){for(var Ee=0;Ee<4;Ee++){for(;kt&&Je(rt.line.text.charAt(ht.coverStart+kt));)--kt;for(;ht.coverStart+Lt<ht.coverEnd&&Je(rt.line.text.charAt(ht.coverStart+Lt));)++Lt;if(Ut&&fe<9&&kt==0&&Lt==ht.coverEnd-ht.coverStart?jt=mt.parentNode.getBoundingClientRect():jt=Bi(ne(mt,kt,Lt).getClientRects(),at),jt.left||jt.right||kt==0)break;Lt=kt,kt=kt-1,Nt="right"}Ut&&fe<11&&(jt=In(et.display.measure,jt))}else{kt>0&&(Nt=at="right");var Kt;et.options.lineWrapping&&(Kt=mt.getClientRects()).length>1?jt=Kt[at=="right"?Kt.length-1:0]:jt=mt.getBoundingClientRect()}if(Ut&&fe<9&&!kt&&(!jt||!jt.left&&!jt.right)){var ri=mt.parentNode.getClientRects()[0];ri?jt={left:ri.left,right:ri.left+Nl(et.display),top:ri.top,bottom:ri.bottom}:jt=ql}for(var Qe=jt.top-rt.rect.top,Yi=jt.bottom-rt.rect.top,$i=(Qe+Yi)/2,dn=rt.view.measure.heights,Dn=0;Dn<dn.length-1&&!($i<dn[Dn]);Dn++);var tr=Dn?dn[Dn-1]:0,Wn=dn[Dn],lr={left:(Nt=="right"?jt.right:jt.left)-rt.rect.left,right:(Nt=="left"?jt.left:jt.right)-rt.rect.left,top:tr,bottom:Wn};return!jt.left&&!jt.right&&(lr.bogus=!0),et.options.singleCursorHeightPerLine||(lr.rtop=Qe,lr.rbottom=Yi),lr}function In(et,rt){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ui(et))return rt;var lt=screen.logicalXDPI/screen.deviceXDPI,at=screen.logicalYDPI/screen.deviceYDPI;return{left:rt.left*lt,right:rt.right*lt,top:rt.top*at,bottom:rt.bottom*at}}function dr(et){if(et.measure&&(et.measure.cache={},et.measure.heights=null,et.rest))for(var rt=0;rt<et.rest.length;rt++)et.measure.caches[rt]={}}function xr(et){et.display.externalMeasure=null,Le(et.display.lineMeasure);for(var rt=0;rt<et.display.view.length;rt++)dr(et.display.view[rt])}function Hr(et){xr(et),et.display.cachedCharWidth=et.display.cachedTextHeight=et.display.cachedPaddingH=null,et.options.lineWrapping||(et.display.maxLineChanged=!0),et.display.lineNumChars=null}function ro(){return re&&qt?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ro(){return re&&qt?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function jo(et){var rt=0;if(et.widgets)for(var lt=0;lt<et.widgets.length;++lt)et.widgets[lt].above&&(rt+=os(et.widgets[lt]));return rt}function Uo(et,rt,lt,at,ht){if(!ht){var mt=jo(rt);lt.top+=mt,lt.bottom+=mt}if(at=="line")return lt;at||(at="local");var kt=wr(rt);if(at=="local"?kt+=vo(et.display):kt-=et.display.viewOffset,at=="page"||at=="window"){var Lt=et.display.lineSpace.getBoundingClientRect();kt+=Lt.top+(at=="window"?0:Ro());var Nt=Lt.left+(at=="window"?0:ro());lt.left+=Nt,lt.right+=Nt}return lt.top+=kt,lt.bottom+=kt,lt}function Qa(et,rt,lt){if(lt=="div")return rt;var at=rt.left,ht=rt.top;if(lt=="page")at-=ro(),ht-=Ro();else if(lt=="local"||!lt){var mt=et.display.sizer.getBoundingClientRect();at+=mt.left,ht+=mt.top}var kt=et.display.lineSpace.getBoundingClientRect();return{left:at-kt.left,top:ht-kt.top}}function ka(et,rt,lt,at,ht){return at||(at=mi(et.doc,rt.line)),Uo(et,at,gs(et,at,rt.ch,ht),lt)}function yo(et,rt,lt,at,ht,mt){at=at||mi(et.doc,rt.line),ht||(ht=fl(et,at));function kt(Yi,$i){var dn=Ca(et,ht,Yi,$i?"right":"left",mt);return $i?dn.left=dn.right:dn.right=dn.left,Uo(et,at,dn,lt)}var Lt=At(at,et.doc.direction),Nt=rt.ch,jt=rt.sticky;if(Nt>=at.text.length?(Nt=at.text.length,jt="before"):Nt<=0&&(Nt=0,jt="after"),!Lt)return kt(jt=="before"?Nt-1:Nt,jt=="before");function Ee(Yi,$i,dn){var Dn=Lt[$i],tr=Dn.level==1;return kt(dn?Yi-1:Yi,tr!=dn)}var Kt=ft(Lt,Nt,jt),ri=gt,Qe=Ee(Nt,Kt,jt=="before");return ri!=null&&(Qe.other=Ee(Nt,ri,jt!="before")),Qe}function $r(et,rt){var lt=0;rt=Xi(et.doc,rt),et.options.lineWrapping||(lt=Nl(et.display)*rt.ch);var at=mi(et.doc,rt.line),ht=wr(at)+vo(et.display);return{left:lt,right:lt,top:ht,bottom:ht+at.height}}function zr(et,rt,lt,at,ht){var mt=Oe(et,rt,lt);return mt.xRel=ht,at&&(mt.outside=at),mt}function fs(et,rt,lt){var at=et.doc;if(lt+=et.display.viewOffset,lt<0)return zr(at.first,0,null,-1,-1);var ht=se(at,lt),mt=at.first+at.size-1;if(ht>mt)return zr(at.first+at.size-1,mi(at,mt).text.length,null,1,1);rt<0&&(rt=0);for(var kt=mi(at,ht);;){var Lt=ci(et,kt,ht,rt,lt),Nt=vn(kt,Lt.ch+(Lt.xRel>0||Lt.outside>0?1:0));if(!Nt)return Lt;var jt=Nt.find(1);if(jt.line==ht)return jt;kt=mi(at,ht=jt.line)}}function bn(et,rt,lt,at){at-=jo(rt);var ht=rt.text.length,mt=Pi(function(kt){return Ca(et,lt,kt-1).bottom<=at},ht,0);return ht=Pi(function(kt){return Ca(et,lt,kt).top>at},mt,ht),{begin:mt,end:ht}}function qo(et,rt,lt,at){lt||(lt=fl(et,rt));var ht=Uo(et,rt,Ca(et,lt,at),"line").top;return bn(et,rt,lt,ht)}function Gt(et,rt,lt,at){return et.bottom<=lt?!1:et.top>lt?!0:(at?et.left:et.right)>rt}function ci(et,rt,lt,at,ht){ht-=wr(rt);var mt=fl(et,rt),kt=jo(rt),Lt=0,Nt=rt.text.length,jt=!0,Ee=At(rt,et.doc.direction);if(Ee){var Kt=(et.options.lineWrapping?eu:dl)(et,rt,lt,mt,Ee,at,ht);jt=Kt.level!=1,Lt=jt?Kt.from:Kt.to-1,Nt=jt?Kt.to:Kt.from-1}var ri=null,Qe=null,Yi=Pi(function(Pr){var _n=Ca(et,mt,Pr);return _n.top+=kt,_n.bottom+=kt,Gt(_n,at,ht,!1)?(_n.top<=ht&&_n.left<=at&&(ri=Pr,Qe=_n),!0):!1},Lt,Nt),$i,dn,Dn=!1;if(Qe){var tr=at-Qe.left<Qe.right-at,Wn=tr==jt;Yi=ri+(Wn?0:1),dn=Wn?"after":"before",$i=tr?Qe.left:Qe.right}else{!jt&&(Yi==Nt||Yi==Lt)&&Yi++,dn=Yi==0?"after":Yi==rt.text.length?"before":Ca(et,mt,Yi-(jt?1:0)).bottom+kt<=ht==jt?"after":"before";var lr=yo(et,Oe(lt,Yi,dn),"line",rt,mt);$i=lr.left,Dn=ht<lr.top?-1:ht>=lr.bottom?1:0}return Yi=Ri(rt.text,Yi,1),zr(lt,Yi,dn,Dn,at-$i)}function dl(et,rt,lt,at,ht,mt,kt){var Lt=Pi(function(Kt){var ri=ht[Kt],Qe=ri.level!=1;return Gt(yo(et,Oe(lt,Qe?ri.to:ri.from,Qe?"before":"after"),"line",rt,at),mt,kt,!0)},0,ht.length-1),Nt=ht[Lt];if(Lt>0){var jt=Nt.level!=1,Ee=yo(et,Oe(lt,jt?Nt.from:Nt.to,jt?"after":"before"),"line",rt,at);Gt(Ee,mt,kt,!0)&&Ee.top>kt&&(Nt=ht[Lt-1])}return Nt}function eu(et,rt,lt,at,ht,mt,kt){var Lt=bn(et,rt,at,kt),Nt=Lt.begin,jt=Lt.end;/\s/.test(rt.text.charAt(jt-1))&&jt--;for(var Ee=null,Kt=null,ri=0;ri<ht.length;ri++){var Qe=ht[ri];if(!(Qe.from>=jt||Qe.to<=Nt)){var Yi=Qe.level!=1,$i=Ca(et,at,Yi?Math.min(jt,Qe.to)-1:Math.max(Nt,Qe.from)).right,dn=$i<mt?mt-$i+1e9:$i-mt;(!Ee||Kt>dn)&&(Ee=Qe,Kt=dn)}}return Ee||(Ee=ht[ht.length-1]),Ee.from<Nt&&(Ee={from:Nt,to:Ee.to,level:Ee.level}),Ee.to>jt&&(Ee={from:Ee.from,to:jt,level:Ee.level}),Ee}var Ma;function ca(et){if(et.cachedTextHeight!=null)return et.cachedTextHeight;if(Ma==null){Ma=Ce("pre",null,"CodeMirror-line-like");for(var rt=0;rt<49;++rt)Ma.appendChild(document.createTextNode("x")),Ma.appendChild(Ce("br"));Ma.appendChild(document.createTextNode("x"))}Wt(et.measure,Ma);var lt=Ma.offsetHeight/50;return lt>3&&(et.cachedTextHeight=lt),Le(et.measure),lt||1}function Nl(et){if(et.cachedCharWidth!=null)return et.cachedCharWidth;var rt=Ce("span","xxxxxxxxxx"),lt=Ce("pre",[rt],"CodeMirror-line-like");Wt(et.measure,lt);var at=rt.getBoundingClientRect(),ht=(at.right-at.left)/10;return ht>2&&(et.cachedCharWidth=ht),ht||10}function Su(et){for(var rt=et.display,lt={},at={},ht=rt.gutters.clientLeft,mt=rt.gutters.firstChild,kt=0;mt;mt=mt.nextSibling,++kt){var Lt=et.display.gutterSpecs[kt].className;lt[Lt]=mt.offsetLeft+mt.clientLeft+ht,at[Lt]=mt.clientWidth}return{fixedPos:Jc(rt),gutterTotalWidth:rt.gutters.offsetWidth,gutterLeft:lt,gutterWidth:at,wrapperWidth:rt.wrapper.clientWidth}}function Jc(et){return et.scroller.getBoundingClientRect().left-et.sizer.getBoundingClientRect().left}function zo(et){var rt=ca(et.display),lt=et.options.lineWrapping,at=lt&&Math.max(5,et.display.scroller.clientWidth/Nl(et.display)-3);return function(ht){if(li(et.doc,ht))return 0;var mt=0;if(ht.widgets)for(var kt=0;kt<ht.widgets.length;kt++)ht.widgets[kt].height&&(mt+=ht.widgets[kt].height);return lt?mt+(Math.ceil(ht.text.length/at)||1)*rt:mt+rt}}function pr(et){var rt=et.doc,lt=zo(et);rt.iter(function(at){var ht=lt(at);ht!=at.height&&Gn(at,ht)})}function fa(et,rt,lt,at){var ht=et.display;if(!lt&&er(rt).getAttribute("cm-not-content")=="true")return null;var mt,kt,Lt=ht.lineSpace.getBoundingClientRect();try{mt=rt.clientX-Lt.left,kt=rt.clientY-Lt.top}catch(Kt){return null}var Nt=fs(et,mt,kt),jt;if(at&&Nt.xRel>0&&(jt=mi(et.doc,Nt.line).text).length==Nt.ch){var Ee=Bt(jt,jt.length,et.options.tabSize)-jt.length;Nt=Oe(Nt.line,Math.max(0,Math.round((mt-ha(et.display).left)/Nl(et.display))-Ee))}return Nt}function $a(et,rt){if(rt>=et.display.viewTo||(rt-=et.display.viewFrom,rt<0))return null;for(var lt=et.display.view,at=0;at<lt.length;at++)if(rt-=lt[at].size,rt<0)return at}function _o(et,rt,lt,at){rt==null&&(rt=et.doc.first),lt==null&&(lt=et.doc.first+et.doc.size),at||(at=0);var ht=et.display;if(at&<<ht.viewTo&&(ht.updateLineNumbers==null||ht.updateLineNumbers>rt)&&(ht.updateLineNumbers=rt),et.curOp.viewChanged=!0,rt>=ht.viewTo)Me&&un(et.doc,rt)<ht.viewTo&&as(et);else if(lt<=ht.viewFrom)Me&&Wi(et.doc,lt+at)>ht.viewFrom?as(et):(ht.viewFrom+=at,ht.viewTo+=at);else if(rt<=ht.viewFrom&<>=ht.viewTo)as(et);else if(rt<=ht.viewFrom){var mt=Ea(et,lt,lt+at,1);mt?(ht.view=ht.view.slice(mt.index),ht.viewFrom=mt.lineN,ht.viewTo+=at):as(et)}else if(lt>=ht.viewTo){var kt=Ea(et,rt,rt,-1);kt?(ht.view=ht.view.slice(0,kt.index),ht.viewTo=kt.lineN):as(et)}else{var Lt=Ea(et,rt,rt,-1),Nt=Ea(et,lt,lt+at,1);Lt&&Nt?(ht.view=ht.view.slice(0,Lt.index).concat(jr(et,Lt.lineN,Nt.lineN)).concat(ht.view.slice(Nt.index)),ht.viewTo+=at):as(et)}var jt=ht.externalMeasured;jt&&(lt<jt.lineN?jt.lineN+=at:rt<jt.lineN+jt.size&&(ht.externalMeasured=null))}function _r(et,rt,lt){et.curOp.viewChanged=!0;var at=et.display,ht=et.display.externalMeasured;if(ht&&rt>=ht.lineN&&rt<ht.lineN+ht.size&&(at.externalMeasured=null),!(rt<at.viewFrom||rt>=at.viewTo)){var mt=at.view[$a(et,rt)];if(mt.node!=null){var kt=mt.changes||(mt.changes=[]);ge(kt,lt)==-1&&kt.push(lt)}}}function as(et){et.display.viewFrom=et.display.viewTo=et.doc.first,et.display.view=[],et.display.viewOffset=0}function Ea(et,rt,lt,at){var ht=$a(et,rt),mt,kt=et.display.view;if(!Me||lt==et.doc.first+et.doc.size)return{index:ht,lineN:lt};for(var Lt=et.display.viewFrom,Nt=0;Nt<ht;Nt++)Lt+=kt[Nt].size;if(Lt!=rt){if(at>0){if(ht==kt.length-1)return null;mt=Lt+kt[ht].size-rt,ht++}else mt=Lt-rt;rt+=mt,lt+=mt}for(;un(et.doc,lt)!=lt;){if(ht==(at<0?0:kt.length-1))return null;lt+=at*kt[ht-(at<0?1:0)].size,ht+=at}return{index:ht,lineN:lt}}function Eo(et,rt,lt){var at=et.display,ht=at.view;ht.length==0||rt>=at.viewTo||lt<=at.viewFrom?(at.view=jr(et,rt,lt),at.viewFrom=rt):(at.viewFrom>rt?at.view=jr(et,rt,at.viewFrom).concat(at.view):at.viewFrom<rt&&(at.view=at.view.slice($a(et,rt))),at.viewFrom=rt,at.viewTo<lt?at.view=at.view.concat(jr(et,at.viewTo,lt)):at.viewTo>lt&&(at.view=at.view.slice(0,$a(et,lt)))),at.viewTo=lt}function Ra(et){for(var rt=et.display.view,lt=0,at=0;at<rt.length;at++){var ht=rt[at];!ht.hidden&&(!ht.node||ht.changes)&&++lt}return lt}function ws(et){et.display.input.showSelection(et.display.input.prepareSelection())}function Hu(et,rt){rt===void 0&&(rt=!0);for(var lt=et.doc,at={},ht=at.cursors=document.createDocumentFragment(),mt=at.selection=document.createDocumentFragment(),kt=0;kt<lt.sel.ranges.length;kt++)if(!(!rt&&kt==lt.sel.primIndex)){var Lt=lt.sel.ranges[kt];if(!(Lt.from().line>=et.display.viewTo||Lt.to().line<et.display.viewFrom)){var Nt=Lt.empty();(Nt||et.options.showCursorWhenSelecting)&&Jr(et,Lt.head,ht),Nt||Yr(et,Lt,mt)}}return at}function Jr(et,rt,lt){var at=yo(et,rt,"div",null,null,!et.options.singleCursorHeightPerLine),ht=lt.appendChild(Ce("div","\xA0","CodeMirror-cursor"));if(ht.style.left=at.left+"px",ht.style.top=at.top+"px",ht.style.height=Math.max(0,at.bottom-at.top)*et.options.cursorHeight+"px",at.other){var mt=lt.appendChild(Ce("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));mt.style.display="",mt.style.left=at.other.left+"px",mt.style.top=at.other.top+"px",mt.style.height=(at.other.bottom-at.other.top)*.85+"px"}}function da(et,rt){return et.top-rt.top||et.left-rt.left}function Yr(et,rt,lt){var at=et.display,ht=et.doc,mt=document.createDocumentFragment(),kt=ha(et.display),Lt=kt.left,Nt=Math.max(at.sizerWidth,ia(et)-at.sizer.offsetLeft)-kt.right,jt=ht.direction=="ltr";function Ee(Wn,lr,Pr,_n){lr<0&&(lr=0),lr=Math.round(lr),_n=Math.round(_n),mt.appendChild(Ce("div",null,"CodeMirror-selected","position: absolute; left: "+Wn+`px;
|
|
top: `+lr+"px; width: "+(Pr==null?Nt-Wn:Pr)+`px;
|
|
height: `+(_n-lr)+"px"))}function Kt(Wn,lr,Pr){var _n=mi(ht,Wn),Zr=_n.text.length,Ho,ks;function Xo(ms,Ha){return ka(et,Oe(Wn,ms),"div",_n,Ha)}function Na(ms,Ha,Ys){var ys=qo(et,_n,null,ms),uo=Ha=="ltr"==(Ys=="after")?"left":"right",es=Ys=="after"?ys.begin:ys.end-(/\s/.test(_n.text.charAt(ys.end-1))?2:1);return Xo(es,uo)[uo]}var ra=At(_n,ht.direction);return Ct(ra,lr||0,Pr==null?Zr:Pr,function(ms,Ha,Ys,ys){var uo=Ys=="ltr",es=Xo(ms,uo?"left":"right"),Bs=Xo(Ha-1,uo?"right":"left"),Xs=lr==null&&ms==0,Ll=Pr==null&&Ha==Zr,Jo=ys==0,yl=!ra||ys==ra.length-1;if(Bs.top-es.top<=3){var ss=(jt?Xs:Ll)&&Jo,wf=(jt?Ll:Xs)&&yl,il=ss?Lt:(uo?es:Bs).left,Wa=wf?Nt:(uo?Bs:es).right;Ee(il,es.top,Wa-il,es.bottom)}else{var Ta,No,Os,au;uo?(Ta=jt&&Xs&&Jo?Lt:es.left,No=jt?Nt:Na(ms,Ys,"before"),Os=jt?Lt:Na(Ha,Ys,"after"),au=jt&&Ll&&yl?Nt:Bs.right):(Ta=jt?Na(ms,Ys,"before"):Lt,No=!jt&&Xs&&Jo?Nt:es.right,Os=!jt&&Ll&&yl?Lt:Bs.left,au=jt?Na(Ha,Ys,"after"):Nt),Ee(Ta,es.top,No-Ta,es.bottom),es.bottom<Bs.top&&Ee(Lt,es.bottom,null,Bs.top),Ee(Os,Bs.top,au-Os,Bs.bottom)}(!Ho||da(es,Ho)<0)&&(Ho=es),da(Bs,Ho)<0&&(Ho=Bs),(!ks||da(es,ks)<0)&&(ks=es),da(Bs,ks)<0&&(ks=Bs)}),{start:Ho,end:ks}}var ri=rt.from(),Qe=rt.to();if(ri.line==Qe.line)Kt(ri.line,ri.ch,Qe.ch);else{var Yi=mi(ht,ri.line),$i=mi(ht,Qe.line),dn=Gi(Yi)==Gi($i),Dn=Kt(ri.line,ri.ch,dn?Yi.text.length+1:null).end,tr=Kt(Qe.line,dn?0:null,Qe.ch).start;dn&&(Dn.top<tr.top-2?(Ee(Dn.right,Dn.top,null,Dn.bottom),Ee(Lt,tr.top,tr.left,tr.bottom)):Ee(Dn.right,Dn.top,tr.left-Dn.right,Dn.bottom)),Dn.bottom<tr.top&&Ee(Lt,Dn.bottom,null,tr.top)}lt.appendChild(mt)}function xo(et){if(et.state.focused){var rt=et.display;clearInterval(rt.blinker);var lt=!0;rt.cursorDiv.style.visibility="",et.options.cursorBlinkRate>0?rt.blinker=setInterval(function(){et.hasFocus()||Ph(et),rt.cursorDiv.style.visibility=(lt=!lt)?"":"hidden"},et.options.cursorBlinkRate):et.options.cursorBlinkRate<0&&(rt.cursorDiv.style.visibility="hidden")}}function Ao(et){et.state.focused||(et.display.input.focus(),qr(et))}function Ko(et){et.state.delayingBlurEvent=!0,setTimeout(function(){et.state.delayingBlurEvent&&(et.state.delayingBlurEvent=!1,Ph(et))},100)}function qr(et,rt){et.state.delayingBlurEvent&&(et.state.delayingBlurEvent=!1),et.options.readOnly!="nocursor"&&(et.state.focused||(qe(et,"focus",et,rt),et.state.focused=!0,Ie(et.display.wrapper,"CodeMirror-focused"),!et.curOp&&et.display.selForContextMenu!=et.doc.sel&&(et.display.input.reset(),$t&&setTimeout(function(){return et.display.input.reset(!0)},20)),et.display.input.receivedFocus()),xo(et))}function Ph(et,rt){et.state.delayingBlurEvent||(et.state.focused&&(qe(et,"blur",et,rt),et.state.focused=!1,Xt(et.display.wrapper,"CodeMirror-focused")),clearInterval(et.display.blinker),setTimeout(function(){et.state.focused||(et.display.shift=!1)},150))}function hr(et){for(var rt=et.display,lt=rt.lineDiv.offsetTop,at=0;at<rt.view.length;at++){var ht=rt.view[at],mt=et.options.lineWrapping,kt=void 0,Lt=0;if(!ht.hidden){if(Ut&&fe<8){var Nt=ht.node.offsetTop+ht.node.offsetHeight;kt=Nt-lt,lt=Nt}else{var jt=ht.node.getBoundingClientRect();kt=jt.bottom-jt.top,!mt&&ht.text.firstChild&&(Lt=ht.text.firstChild.getBoundingClientRect().right-jt.left-1)}var Ee=ht.line.height-kt;if((Ee>.005||Ee<-.005)&&(Gn(ht.line,kt),Bg(ht.line),ht.rest))for(var Kt=0;Kt<ht.rest.length;Kt++)Bg(ht.rest[Kt]);if(Lt>et.display.sizerWidth){var ri=Math.ceil(Lt/Nl(et.display));ri>et.display.maxLineLength&&(et.display.maxLineLength=ri,et.display.maxLine=ht.line,et.display.maxLineChanged=!0)}}}}function Bg(et){if(et.widgets)for(var rt=0;rt<et.widgets.length;++rt){var lt=et.widgets[rt],at=lt.node.parentNode;at&&(lt.height=at.offsetHeight)}}function Ur(et,rt,lt){var at=lt&<.top!=null?Math.max(0,lt.top):et.scroller.scrollTop;at=Math.floor(at-vo(et));var ht=lt&<.bottom!=null?lt.bottom:at+et.wrapper.clientHeight,mt=se(rt,at),kt=se(rt,ht);if(lt&<.ensure){var Lt=lt.ensure.from.line,Nt=lt.ensure.to.line;Lt<mt?(mt=Lt,kt=se(rt,wr(mi(rt,Lt))+et.wrapper.clientHeight)):Math.min(Nt,rt.lastLine())>=kt&&(mt=se(rt,wr(mi(rt,Nt))-et.wrapper.clientHeight),kt=Nt)}return{from:mt,to:Math.max(kt,mt+1)}}function Og(et,rt){if(!xe(et,"scrollCursorIntoView")){var lt=et.display,at=lt.sizer.getBoundingClientRect(),ht=null;if(rt.top+at.top<0?ht=!0:rt.bottom+at.top>(window.innerHeight||document.documentElement.clientHeight)&&(ht=!1),ht!=null&&!Ne){var mt=Ce("div","\u200B",null,`position: absolute;
|
|
top: `+(rt.top-lt.viewOffset-vo(et.display))+`px;
|
|
height: `+(rt.bottom-rt.top+Ns(et)+lt.barHeight)+`px;
|
|
left: `+rt.left+"px; width: "+Math.max(2,rt.right-rt.left)+"px;");et.display.lineSpace.appendChild(mt),mt.scrollIntoView(ht),et.display.lineSpace.removeChild(mt)}}}function pc(et,rt,lt,at){at==null&&(at=0);var ht;!et.options.lineWrapping&&rt==lt&&(rt=rt.ch?Oe(rt.line,rt.sticky=="before"?rt.ch-1:rt.ch,"after"):rt,lt=rt.sticky=="before"?Oe(rt.line,rt.ch+1,"before"):rt);for(var mt=0;mt<5;mt++){var kt=!1,Lt=yo(et,rt),Nt=!lt||lt==rt?Lt:yo(et,lt);ht={left:Math.min(Lt.left,Nt.left),top:Math.min(Lt.top,Nt.top)-at,right:Math.max(Lt.left,Nt.left),bottom:Math.max(Lt.bottom,Nt.bottom)+at};var jt=tp(et,ht),Ee=et.doc.scrollTop,Kt=et.doc.scrollLeft;if(jt.scrollTop!=null&&(Th(et,jt.scrollTop),Math.abs(et.doc.scrollTop-Ee)>1&&(kt=!0)),jt.scrollLeft!=null&&(ku(et,jt.scrollLeft),Math.abs(et.doc.scrollLeft-Kt)>1&&(kt=!0)),!kt)break}return ht}function Qc(et,rt){var lt=tp(et,rt);lt.scrollTop!=null&&Th(et,lt.scrollTop),lt.scrollLeft!=null&&ku(et,lt.scrollLeft)}function tp(et,rt){var lt=et.display,at=ca(et.display);rt.top<0&&(rt.top=0);var ht=et.curOp&&et.curOp.scrollTop!=null?et.curOp.scrollTop:lt.scroller.scrollTop,mt=cl(et),kt={};rt.bottom-rt.top>mt&&(rt.bottom=rt.top+mt);var Lt=et.doc.height+Ps(lt),Nt=rt.top<at,jt=rt.bottom>Lt-at;if(rt.top<ht)kt.scrollTop=Nt?0:rt.top;else if(rt.bottom>ht+mt){var Ee=Math.min(rt.top,(jt?Lt:rt.bottom)-mt);Ee!=ht&&(kt.scrollTop=Ee)}var Kt=et.options.fixedGutter?0:lt.gutters.offsetWidth,ri=et.curOp&&et.curOp.scrollLeft!=null?et.curOp.scrollLeft:lt.scroller.scrollLeft-Kt,Qe=ia(et)-lt.gutters.offsetWidth,Yi=rt.right-rt.left>Qe;return Yi&&(rt.right=rt.left+Qe),rt.left<10?kt.scrollLeft=0:rt.left<ri?kt.scrollLeft=Math.max(0,rt.left+Kt-(Yi?0:10)):rt.right>Qe+ri-3&&(kt.scrollLeft=rt.right+(Yi?0:10)-Qe),kt}function Zf(et,rt){rt!=null&&(iu(et),et.curOp.scrollTop=(et.curOp.scrollTop==null?et.doc.scrollTop:et.curOp.scrollTop)+rt)}function Cu(et){iu(et);var rt=et.getCursor();et.curOp.scrollToPos={from:rt,to:rt,margin:et.options.cursorScrollMargin}}function Nh(et,rt,lt){(rt!=null||lt!=null)&&iu(et),rt!=null&&(et.curOp.scrollLeft=rt),lt!=null&&(et.curOp.scrollTop=lt)}function to(et,rt){iu(et),et.curOp.scrollToPos=rt}function iu(et){var rt=et.curOp.scrollToPos;if(rt){et.curOp.scrollToPos=null;var lt=$r(et,rt.from),at=$r(et,rt.to);Kf(et,lt,at,rt.margin)}}function Kf(et,rt,lt,at){var ht=tp(et,{left:Math.min(rt.left,lt.left),top:Math.min(rt.top,lt.top)-at,right:Math.max(rt.right,lt.right),bottom:Math.max(rt.bottom,lt.bottom)+at});Nh(et,ht.scrollLeft,ht.scrollTop)}function Th(et,rt){Math.abs(et.doc.scrollTop-rt)<2||(pt||Uu(et,{top:rt}),ep(et,rt,!0),pt&&Uu(et),gc(et,100))}function ep(et,rt,lt){rt=Math.max(0,Math.min(et.display.scroller.scrollHeight-et.display.scroller.clientHeight,rt)),!(et.display.scroller.scrollTop==rt&&!lt)&&(et.doc.scrollTop=rt,et.display.scrollbars.setScrollTop(rt),et.display.scroller.scrollTop!=rt&&(et.display.scroller.scrollTop=rt))}function ku(et,rt,lt,at){rt=Math.max(0,Math.min(rt,et.display.scroller.scrollWidth-et.display.scroller.clientWidth)),!((lt?rt==et.doc.scrollLeft:Math.abs(et.doc.scrollLeft-rt)<2)&&!at)&&(et.doc.scrollLeft=rt,Uf(et),et.display.scroller.scrollLeft!=rt&&(et.display.scroller.scrollLeft=rt),et.display.scrollbars.setScrollLeft(rt))}function pl(et){var rt=et.display,lt=rt.gutters.offsetWidth,at=Math.round(et.doc.height+Ps(et.display));return{clientHeight:rt.scroller.clientHeight,viewHeight:rt.wrapper.clientHeight,scrollWidth:rt.scroller.scrollWidth,clientWidth:rt.scroller.clientWidth,viewWidth:rt.wrapper.clientWidth,barLeft:et.options.fixedGutter?lt:0,docHeight:at,scrollHeight:at+Ns(et)+rt.barHeight,nativeBarWidth:rt.nativeBarWidth,gutterWidth:lt}}var Wu=function(et,rt,lt){this.cm=lt;var at=this.vert=Ce("div",[Ce("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),ht=this.horiz=Ce("div",[Ce("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");at.tabIndex=ht.tabIndex=-1,et(at),et(ht),te(at,"scroll",function(){at.clientHeight&&rt(at.scrollTop,"vertical")}),te(ht,"scroll",function(){ht.clientWidth&&rt(ht.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Ut&&fe<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Wu.prototype.update=function(et){var rt=et.scrollWidth>et.clientWidth+1,lt=et.scrollHeight>et.clientHeight+1,at=et.nativeBarWidth;if(lt){this.vert.style.display="block",this.vert.style.bottom=rt?at+"px":"0";var ht=et.viewHeight-(rt?at:0);this.vert.firstChild.style.height=Math.max(0,et.scrollHeight-et.clientHeight+ht)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(rt){this.horiz.style.display="block",this.horiz.style.right=lt?at+"px":"0",this.horiz.style.left=et.barLeft+"px";var mt=et.viewWidth-et.barLeft-(lt?at:0);this.horiz.firstChild.style.width=Math.max(0,et.scrollWidth-et.clientWidth+mt)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&et.clientHeight>0&&(at==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:lt?at:0,bottom:rt?at:0}},Wu.prototype.setScrollLeft=function(et){this.horiz.scrollLeft!=et&&(this.horiz.scrollLeft=et),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Wu.prototype.setScrollTop=function(et){this.vert.scrollTop!=et&&(this.vert.scrollTop=et),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Wu.prototype.zeroWidthHack=function(){var et=Jt&&!zt?"12px":"18px";this.horiz.style.height=this.vert.style.width=et,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new bt,this.disableVert=new bt},Wu.prototype.enableZeroWidthBar=function(et,rt,lt){et.style.pointerEvents="auto";function at(){var ht=et.getBoundingClientRect(),mt=lt=="vert"?document.elementFromPoint(ht.right-1,(ht.top+ht.bottom)/2):document.elementFromPoint((ht.right+ht.left)/2,ht.bottom-1);mt!=et?et.style.pointerEvents="none":rt.set(1e3,at)}rt.set(1e3,at)},Wu.prototype.clear=function(){var et=this.horiz.parentNode;et.removeChild(this.horiz),et.removeChild(this.vert)};var Hl=function(){};Hl.prototype.update=function(){return{bottom:0,right:0}},Hl.prototype.setScrollLeft=function(){},Hl.prototype.setScrollTop=function(){},Hl.prototype.clear=function(){};function Zu(et,rt){rt||(rt=pl(et));var lt=et.display.barWidth,at=et.display.barHeight;Vf(et,rt);for(var ht=0;ht<4&<!=et.display.barWidth||at!=et.display.barHeight;ht++)lt!=et.display.barWidth&&et.options.lineWrapping&&hr(et),Vf(et,pl(et)),lt=et.display.barWidth,at=et.display.barHeight}function Vf(et,rt){var lt=et.display,at=lt.scrollbars.update(rt);lt.sizer.style.paddingRight=(lt.barWidth=at.right)+"px",lt.sizer.style.paddingBottom=(lt.barHeight=at.bottom)+"px",lt.heightForcer.style.borderBottom=at.bottom+"px solid transparent",at.right&&at.bottom?(lt.scrollbarFiller.style.display="block",lt.scrollbarFiller.style.height=at.bottom+"px",lt.scrollbarFiller.style.width=at.right+"px"):lt.scrollbarFiller.style.display="",at.bottom&&et.options.coverGutterNextToScrollbar&&et.options.fixedGutter?(lt.gutterFiller.style.display="block",lt.gutterFiller.style.height=at.bottom+"px",lt.gutterFiller.style.width=rt.gutterWidth+"px"):lt.gutterFiller.style.display=""}var ip={native:Wu,null:Hl};function np(et){et.display.scrollbars&&(et.display.scrollbars.clear(),et.display.scrollbars.addClass&&Xt(et.display.wrapper,et.display.scrollbars.addClass)),et.display.scrollbars=new ip[et.options.scrollbarStyle](function(rt){et.display.wrapper.insertBefore(rt,et.display.scrollbarFiller),te(rt,"mousedown",function(){et.state.focused&&setTimeout(function(){return et.display.input.focus()},0)}),rt.setAttribute("cm-not-content","true")},function(rt,lt){lt=="horizontal"?ku(et,rt):Th(et,rt)},et),et.display.scrollbars.addClass&&Ie(et.display.wrapper,et.display.scrollbars.addClass)}var Ig=0;function Ku(et){et.curOp={cm:et,viewChanged:!1,startHeight:et.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:++Ig},hl(et.curOp)}function Vu(et){var rt=et.curOp;rt&&ho(rt,function(lt){for(var at=0;at<lt.ops.length;at++)lt.ops[at].cm.curOp=null;Qm(lt)})}function Qm(et){for(var rt=et.ops,lt=0;lt<rt.length;lt++)$m(rt[lt]);for(var at=0;at<rt.length;at++)qm(rt[at]);for(var ht=0;ht<rt.length;ht++)Rg(rt[ht]);for(var mt=0;mt<rt.length;mt++)ts(rt[mt]);for(var kt=0;kt<rt.length;kt++)Gu(rt[kt])}function $m(et){var rt=et.cm,lt=rt.display;jg(rt),et.updateMaxLine&&Lr(rt),et.mustUpdate=et.viewChanged||et.forceUpdate||et.scrollTop!=null||et.scrollToPos&&(et.scrollToPos.from.line<lt.viewFrom||et.scrollToPos.to.line>=lt.viewTo)||lt.maxLineChanged&&rt.options.lineWrapping,et.update=et.mustUpdate&&new Lh(rt,et.mustUpdate&&{top:et.scrollTop,ensure:et.scrollToPos},et.forceUpdate)}function qm(et){et.updatedDisplay=et.mustUpdate&&Gf(et.cm,et.update)}function Rg(et){var rt=et.cm,lt=rt.display;et.updatedDisplay&&hr(rt),et.barMeasure=pl(rt),lt.maxLineChanged&&!rt.options.lineWrapping&&(et.adjustWidthTo=gs(rt,lt.maxLine,lt.maxLine.text.length).left+3,rt.display.sizerWidth=et.adjustWidthTo,et.barMeasure.scrollWidth=Math.max(lt.scroller.clientWidth,lt.sizer.offsetLeft+et.adjustWidthTo+Ns(rt)+rt.display.barWidth),et.maxScrollLeft=Math.max(0,lt.sizer.offsetLeft+et.adjustWidthTo-ia(rt))),(et.updatedDisplay||et.selectionChanged)&&(et.preparedSelection=lt.input.prepareSelection())}function ts(et){var rt=et.cm;et.adjustWidthTo!=null&&(rt.display.sizer.style.minWidth=et.adjustWidthTo+"px",et.maxScrollLeft<rt.doc.scrollLeft&&ku(rt,Math.min(rt.display.scroller.scrollLeft,et.maxScrollLeft),!0),rt.display.maxLineChanged=!1);var lt=et.focus&&et.focus==ye();et.preparedSelection&&rt.display.input.showSelection(et.preparedSelection,lt),(et.updatedDisplay||et.startHeight!=rt.doc.height)&&Zu(rt,et.barMeasure),et.updatedDisplay&&Xu(rt,et.barMeasure),et.selectionChanged&&xo(rt),rt.state.focused&&et.updateInput&&rt.display.input.reset(et.typing),lt&&Ao(et.cm)}function Gu(et){var rt=et.cm,lt=rt.display,at=rt.doc;if(et.updatedDisplay&&wo(rt,et.update),lt.wheelStartX!=null&&(et.scrollTop!=null||et.scrollLeft!=null||et.scrollToPos)&&(lt.wheelStartX=lt.wheelStartY=null),et.scrollTop!=null&&ep(rt,et.scrollTop,et.forceScroll),et.scrollLeft!=null&&ku(rt,et.scrollLeft,!0,!0),et.scrollToPos){var ht=pc(rt,Xi(at,et.scrollToPos.from),Xi(at,et.scrollToPos.to),et.scrollToPos.margin);Og(rt,ht)}var mt=et.maybeHiddenMarkers,kt=et.maybeUnhiddenMarkers;if(mt)for(var Lt=0;Lt<mt.length;++Lt)mt[Lt].lines.length||qe(mt[Lt],"hide");if(kt)for(var Nt=0;Nt<kt.length;++Nt)kt[Nt].lines.length&&qe(kt[Nt],"unhide");lt.wrapper.offsetHeight&&(at.scrollTop=rt.display.scroller.scrollTop),et.changeObjs&&qe(rt,"changes",rt,et.changeObjs),et.update&&et.update.finish()}function co(et,rt){if(et.curOp)return rt();Ku(et);try{return rt()}finally{Vu(et)}}function Ss(et,rt){return function(){if(et.curOp)return rt.apply(et,arguments);Ku(et);try{return rt.apply(et,arguments)}finally{Vu(et)}}}function Ts(et){return function(){if(this.curOp)return et.apply(this,arguments);Ku(this);try{return et.apply(this,arguments)}finally{Vu(this)}}}function Ls(et){return function(){var rt=this.cm;if(!rt||rt.curOp)return et.apply(this,arguments);Ku(rt);try{return et.apply(this,arguments)}finally{Vu(rt)}}}function gc(et,rt){et.doc.highlightFrontier<et.display.viewTo&&et.state.highlight.set(rt,gi(As,et))}function As(et){var rt=et.doc;if(!(rt.highlightFrontier>=et.display.viewTo)){var lt=+new Date+et.options.workTime,at=Kr(et,rt.highlightFrontier),ht=[];rt.iter(at.line,Math.min(rt.first+rt.size,et.display.viewTo+500),function(mt){if(at.line>=et.display.viewFrom){var kt=mt.styles,Lt=mt.text.length>et.options.maxHighlightLength?ur(rt.mode,at.state):null,Nt=rr(et,mt,at,!0);Lt&&(at.state=Lt),mt.styles=Nt.styles;var jt=mt.styleClasses,Ee=Nt.classes;Ee?mt.styleClasses=Ee:jt&&(mt.styleClasses=null);for(var Kt=!kt||kt.length!=mt.styles.length||jt!=Ee&&(!jt||!Ee||jt.bgClass!=Ee.bgClass||jt.textClass!=Ee.textClass),ri=0;!Kt&&ri<kt.length;++ri)Kt=kt[ri]!=mt.styles[ri];Kt&&ht.push(at.line),mt.stateAfter=at.save(),at.nextLine()}else mt.text.length<=et.options.maxHighlightLength&&ze(et,mt.text,at),mt.stateAfter=at.line%5==0?at.save():null,at.nextLine();if(+new Date>lt)return gc(et,et.options.workDelay),!0}),rt.highlightFrontier=at.line,rt.modeFrontier=Math.max(rt.modeFrontier,at.line),ht.length&&co(et,function(){for(var mt=0;mt<ht.length;mt++)_r(et,ht[mt],"text")})}}var Lh=function(et,rt,lt){var at=et.display;this.viewport=rt,this.visible=Ur(at,et.doc,rt),this.editorIsHidden=!at.wrapper.offsetWidth,this.wrapperHeight=at.wrapper.clientHeight,this.wrapperWidth=at.wrapper.clientWidth,this.oldDisplayWidth=ia(et),this.force=lt,this.dims=Su(et),this.events=[]};Lh.prototype.signal=function(et,rt){Si(et,rt)&&this.events.push(arguments)},Lh.prototype.finish=function(){for(var et=0;et<this.events.length;et++)qe.apply(null,this.events[et])};function jg(et){var rt=et.display;!rt.scrollbarsClipped&&rt.scroller.offsetWidth&&(rt.nativeBarWidth=rt.scroller.offsetWidth-rt.scroller.clientWidth,rt.heightForcer.style.height=Ns(et)+"px",rt.sizer.style.marginBottom=-rt.nativeBarWidth+"px",rt.sizer.style.borderRightWidth=Ns(et)+"px",rt.scrollbarsClipped=!0)}function zg(et){if(et.hasFocus())return null;var rt=ye();if(!rt||!Re(et.display.lineDiv,rt))return null;var lt={activeElt:rt};if(window.getSelection){var at=window.getSelection();at.anchorNode&&at.extend&&Re(et.display.lineDiv,at.anchorNode)&&(lt.anchorNode=at.anchorNode,lt.anchorOffset=at.anchorOffset,lt.focusNode=at.focusNode,lt.focusOffset=at.focusOffset)}return lt}function ba(et){if(!(!et||!et.activeElt||et.activeElt==ye())&&(et.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(et.activeElt.nodeName)&&et.anchorNode&&Re(document.body,et.anchorNode)&&Re(document.body,et.focusNode))){var rt=window.getSelection(),lt=document.createRange();lt.setEnd(et.anchorNode,et.anchorOffset),lt.collapse(!1),rt.removeAllRanges(),rt.addRange(lt),rt.extend(et.focusNode,et.focusOffset)}}function Gf(et,rt){var lt=et.display,at=et.doc;if(rt.editorIsHidden)return as(et),!1;if(!rt.force&&rt.visible.from>=lt.viewFrom&&rt.visible.to<=lt.viewTo&&(lt.updateLineNumbers==null||lt.updateLineNumbers>=lt.viewTo)&<.renderedView==lt.view&&Ra(et)==0)return!1;ds(et)&&(as(et),rt.dims=Su(et));var ht=at.first+at.size,mt=Math.max(rt.visible.from-et.options.viewportMargin,at.first),kt=Math.min(ht,rt.visible.to+et.options.viewportMargin);lt.viewFrom<mt&&mt-lt.viewFrom<20&&(mt=Math.max(at.first,lt.viewFrom)),lt.viewTo>kt&<.viewTo-kt<20&&(kt=Math.min(ht,lt.viewTo)),Me&&(mt=un(et.doc,mt),kt=Wi(et.doc,kt));var Lt=mt!=lt.viewFrom||kt!=lt.viewTo||lt.lastWrapHeight!=rt.wrapperHeight||lt.lastWrapWidth!=rt.wrapperWidth;Eo(et,mt,kt),lt.viewOffset=wr(mi(et.doc,lt.viewFrom)),et.display.mover.style.top=lt.viewOffset+"px";var Nt=Ra(et);if(!Lt&&Nt==0&&!rt.force&<.renderedView==lt.view&&(lt.updateLineNumbers==null||lt.updateLineNumbers>=lt.viewTo))return!1;var jt=zg(et);return Nt>4&&(lt.lineDiv.style.display="none"),rp(et,lt.updateLineNumbers,rt.dims),Nt>4&&(lt.lineDiv.style.display=""),lt.renderedView=lt.view,ba(jt),Le(lt.cursorDiv),Le(lt.selectionDiv),lt.gutters.style.height=lt.sizer.style.minHeight=0,Lt&&(lt.lastWrapHeight=rt.wrapperHeight,lt.lastWrapWidth=rt.wrapperWidth,gc(et,400)),lt.updateLineNumbers=null,!0}function wo(et,rt){for(var lt=rt.viewport,at=!0;;at=!1){if(!at||!et.options.lineWrapping||rt.oldDisplayWidth==ia(et)){if(lt&<.top!=null&&(lt={top:Math.min(et.doc.height+Ps(et.display)-cl(et),lt.top)}),rt.visible=Ur(et.display,et.doc,lt),rt.visible.from>=et.display.viewFrom&&rt.visible.to<=et.display.viewTo)break}else at&&(rt.visible=Ur(et.display,et.doc,lt));if(!Gf(et,rt))break;hr(et);var ht=pl(et);ws(et),Zu(et,ht),Xu(et,ht),rt.force=!1}rt.signal(et,"update",et),(et.display.viewFrom!=et.display.reportedViewFrom||et.display.viewTo!=et.display.reportedViewTo)&&(rt.signal(et,"viewportChange",et,et.display.viewFrom,et.display.viewTo),et.display.reportedViewFrom=et.display.viewFrom,et.display.reportedViewTo=et.display.viewTo)}function Uu(et,rt){var lt=new Lh(et,rt);if(Gf(et,lt)){hr(et),wo(et,lt);var at=pl(et);ws(et),Zu(et,at),Xu(et,at),lt.finish()}}function rp(et,rt,lt){var at=et.display,ht=et.options.lineNumbers,mt=at.lineDiv,kt=mt.firstChild;function Lt(Yi){var $i=Yi.nextSibling;return $t&&Jt&&et.display.currentWheelTarget==Yi?Yi.style.display="none":Yi.parentNode.removeChild(Yi),$i}for(var Nt=at.view,jt=at.viewFrom,Ee=0;Ee<Nt.length;Ee++){var Kt=Nt[Ee];if(!Kt.hidden)if(!Kt.node||Kt.node.parentNode!=mt){var ri=Nr(et,Kt,jt,lt);mt.insertBefore(ri,kt)}else{for(;kt!=Kt.node;)kt=Lt(kt);var Qe=ht&&rt!=null&&rt<=jt&&Kt.lineNumber;Kt.changes&&(ge(Kt.changes,"gutter")>-1&&(Qe=!1),Oa(et,Kt,jt,lt)),Qe&&(Le(Kt.lineNumber),Kt.lineNumber.appendChild(document.createTextNode(Di(et.options,jt)))),kt=Kt.node.nextSibling}jt+=Kt.size}for(;kt;)kt=Lt(kt)}function Yu(et){var rt=et.gutters.offsetWidth;et.sizer.style.marginLeft=rt+"px"}function Xu(et,rt){et.display.sizer.style.minHeight=rt.docHeight+"px",et.display.heightForcer.style.top=rt.docHeight+"px",et.display.gutters.style.height=rt.docHeight+et.display.barHeight+Ns(et)+"px"}function Uf(et){var rt=et.display,lt=rt.view;if(!(!rt.alignWidgets&&(!rt.gutters.firstChild||!et.options.fixedGutter))){for(var at=Jc(rt)-rt.scroller.scrollLeft+et.doc.scrollLeft,ht=rt.gutters.offsetWidth,mt=at+"px",kt=0;kt<lt.length;kt++)if(!lt[kt].hidden){et.options.fixedGutter&&(lt[kt].gutter&&(lt[kt].gutter.style.left=mt),lt[kt].gutterBackground&&(lt[kt].gutterBackground.style.left=mt));var Lt=lt[kt].alignable;if(Lt)for(var Nt=0;Nt<Lt.length;Nt++)Lt[Nt].style.left=mt}et.options.fixedGutter&&(rt.gutters.style.left=at+ht+"px")}}function ds(et){if(!et.options.lineNumbers)return!1;var rt=et.doc,lt=Di(et.options,rt.first+rt.size-1),at=et.display;if(lt.length!=at.lineNumChars){var ht=at.measure.appendChild(Ce("div",[Ce("div",lt)],"CodeMirror-linenumber CodeMirror-gutter-elt")),mt=ht.firstChild.offsetWidth,kt=ht.offsetWidth-mt;return at.lineGutter.style.width="",at.lineNumInnerWidth=Math.max(mt,at.lineGutter.offsetWidth-kt)+1,at.lineNumWidth=at.lineNumInnerWidth+kt,at.lineNumChars=at.lineNumInnerWidth?lt.length:-1,at.lineGutter.style.width=at.lineNumWidth+"px",Yu(et.display),!0}return!1}function Ds(et,rt){for(var lt=[],at=!1,ht=0;ht<et.length;ht++){var mt=et[ht],kt=null;if(typeof mt!="string"&&(kt=mt.style,mt=mt.className),mt=="CodeMirror-linenumbers")if(rt)at=!0;else continue;lt.push({className:mt,style:kt})}return rt&&!at&<.push({className:"CodeMirror-linenumbers",style:null}),lt}function Ah(et){var rt=et.gutters,lt=et.gutterSpecs;Le(rt),et.lineGutter=null;for(var at=0;at<lt.length;++at){var ht=lt[at],mt=ht.className,kt=ht.style,Lt=rt.appendChild(Ce("div",null,"CodeMirror-gutter "+mt));kt&&(Lt.style.cssText=kt),mt=="CodeMirror-linenumbers"&&(et.lineGutter=Lt,Lt.style.width=(et.lineNumWidth||1)+"px")}rt.style.display=lt.length?"":"none",Yu(et)}function qa(et){Ah(et.display),_o(et),Uf(et)}function Ju(et,rt,lt,at){var ht=this;this.input=lt,ht.scrollbarFiller=Ce("div",null,"CodeMirror-scrollbar-filler"),ht.scrollbarFiller.setAttribute("cm-not-content","true"),ht.gutterFiller=Ce("div",null,"CodeMirror-gutter-filler"),ht.gutterFiller.setAttribute("cm-not-content","true"),ht.lineDiv=Te("div",null,"CodeMirror-code"),ht.selectionDiv=Ce("div",null,null,"position: relative; z-index: 1"),ht.cursorDiv=Ce("div",null,"CodeMirror-cursors"),ht.measure=Ce("div",null,"CodeMirror-measure"),ht.lineMeasure=Ce("div",null,"CodeMirror-measure"),ht.lineSpace=Te("div",[ht.measure,ht.lineMeasure,ht.selectionDiv,ht.cursorDiv,ht.lineDiv],null,"position: relative; outline: none");var mt=Te("div",[ht.lineSpace],"CodeMirror-lines");ht.mover=Ce("div",[mt],null,"position: relative"),ht.sizer=Ce("div",[ht.mover],"CodeMirror-sizer"),ht.sizerWidth=null,ht.heightForcer=Ce("div",null,null,"position: absolute; height: "+Ge+"px; width: 1px;"),ht.gutters=Ce("div",null,"CodeMirror-gutters"),ht.lineGutter=null,ht.scroller=Ce("div",[ht.sizer,ht.heightForcer,ht.gutters],"CodeMirror-scroll"),ht.scroller.setAttribute("tabIndex","-1"),ht.wrapper=Ce("div",[ht.scrollbarFiller,ht.gutterFiller,ht.scroller],"CodeMirror"),Ut&&fe<8&&(ht.gutters.style.zIndex=-1,ht.scroller.style.paddingRight=0),!$t&&!(pt&&Qt)&&(ht.scroller.draggable=!0),et&&(et.appendChild?et.appendChild(ht.wrapper):et(ht.wrapper)),ht.viewFrom=ht.viewTo=rt.first,ht.reportedViewFrom=ht.reportedViewTo=rt.first,ht.view=[],ht.renderedView=null,ht.externalMeasured=null,ht.viewOffset=0,ht.lastWrapHeight=ht.lastWrapWidth=0,ht.updateLineNumbers=null,ht.nativeBarWidth=ht.barHeight=ht.barWidth=0,ht.scrollbarsClipped=!1,ht.lineNumWidth=ht.lineNumInnerWidth=ht.lineNumChars=null,ht.alignWidgets=!1,ht.cachedCharWidth=ht.cachedTextHeight=ht.cachedPaddingH=null,ht.maxLine=null,ht.maxLineLength=0,ht.maxLineChanged=!1,ht.wheelDX=ht.wheelDY=ht.wheelStartX=ht.wheelStartY=null,ht.shift=!1,ht.selForContextMenu=null,ht.activeTouch=null,ht.gutterSpecs=Ds(at.gutters,at.lineNumbers),Ah(ht),lt.init(ht)}var ja=0,ls=null;Ut?ls=-.53:pt?ls=15:re?ls=-.7:de&&(ls=-1/3);function Wl(et){var rt=et.wheelDeltaX,lt=et.wheelDeltaY;return rt==null&&et.detail&&et.axis==et.HORIZONTAL_AXIS&&(rt=et.detail),lt==null&&et.detail&&et.axis==et.VERTICAL_AXIS?lt=et.detail:lt==null&&(lt=et.wheelDelta),{x:rt,y:lt}}function tl(et){var rt=Wl(et);return rt.x*=ls,rt.y*=ls,rt}function Fs(et,rt){var lt=Wl(rt),at=lt.x,ht=lt.y,mt=et.display,kt=mt.scroller,Lt=kt.scrollWidth>kt.clientWidth,Nt=kt.scrollHeight>kt.clientHeight;if(at&&Lt||ht&&Nt){if(ht&&Jt&&$t){t:for(var jt=rt.target,Ee=mt.view;jt!=kt;jt=jt.parentNode)for(var Kt=0;Kt<Ee.length;Kt++)if(Ee[Kt].node==jt){et.display.currentWheelTarget=jt;break t}}if(at&&!pt&&!Dt&&ls!=null){ht&&Nt&&Th(et,Math.max(0,kt.scrollTop+ht*ls)),ku(et,Math.max(0,kt.scrollLeft+at*ls)),(!ht||ht&&Nt)&&Qi(rt),mt.wheelStartX=null;return}if(ht&&ls!=null){var ri=ht*ls,Qe=et.doc.scrollTop,Yi=Qe+mt.wrapper.clientHeight;ri<0?Qe=Math.max(0,Qe+ri-50):Yi=Math.min(et.doc.height,Yi+ri+50),Uu(et,{top:Qe,bottom:Yi})}ja<20&&(mt.wheelStartX==null?(mt.wheelStartX=kt.scrollLeft,mt.wheelStartY=kt.scrollTop,mt.wheelDX=at,mt.wheelDY=ht,setTimeout(function(){if(mt.wheelStartX!=null){var $i=kt.scrollLeft-mt.wheelStartX,dn=kt.scrollTop-mt.wheelStartY,Dn=dn&&mt.wheelDY&&dn/mt.wheelDY||$i&&mt.wheelDX&&$i/mt.wheelDX;mt.wheelStartX=mt.wheelStartY=null,Dn&&(ls=(ls*ja+Dn)/(ja+1),++ja)}},200)):(mt.wheelDX+=at,mt.wheelDY+=ht))}}var gl=function(et,rt){this.ranges=et,this.primIndex=rt};gl.prototype.primary=function(){return this.ranges[this.primIndex]},gl.prototype.equals=function(et){if(et==this)return!0;if(et.primIndex!=this.primIndex||et.ranges.length!=this.ranges.length)return!1;for(var rt=0;rt<this.ranges.length;rt++){var lt=this.ranges[rt],at=et.ranges[rt];if(!rn(lt.anchor,at.anchor)||!rn(lt.head,at.head))return!1}return!0},gl.prototype.deepCopy=function(){for(var et=[],rt=0;rt<this.ranges.length;rt++)et[rt]=new So(ln(this.ranges[rt].anchor),ln(this.ranges[rt].head));return new gl(et,this.primIndex)},gl.prototype.somethingSelected=function(){for(var et=0;et<this.ranges.length;et++)if(!this.ranges[et].empty())return!0;return!1},gl.prototype.contains=function(et,rt){rt||(rt=et);for(var lt=0;lt<this.ranges.length;lt++){var at=this.ranges[lt];if(Ti(rt,at.from())>=0&&Ti(et,at.to())<=0)return lt}return-1};var So=function(et,rt){this.anchor=et,this.head=rt};So.prototype.from=function(){return ii(this.anchor,this.head)},So.prototype.to=function(){return yn(this.anchor,this.head)},So.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Tl(et,rt,lt){var at=et&&et.options.selectionsMayTouch,ht=rt[lt];rt.sort(function(ri,Qe){return Ti(ri.from(),Qe.from())}),lt=ge(rt,ht);for(var mt=1;mt<rt.length;mt++){var kt=rt[mt],Lt=rt[mt-1],Nt=Ti(Lt.to(),kt.from());if(at&&!kt.empty()?Nt>0:Nt>=0){var jt=ii(Lt.from(),kt.from()),Ee=yn(Lt.to(),kt.to()),Kt=Lt.empty()?kt.from()==kt.head:Lt.from()==Lt.head;mt<=lt&&--lt,rt.splice(--mt,2,new So(Kt?Ee:jt,Kt?jt:Ee))}}return new gl(rt,lt)}function Mu(et,rt){return new gl([new So(et,rt||et)],0)}function Qu(et){return et.text?Oe(et.from.line+et.text.length-1,ee(et.text).length+(et.text.length==1?et.from.ch:0)):et.to}function Dh(et,rt){if(Ti(et,rt.from)<0)return et;if(Ti(et,rt.to)<=0)return Qu(rt);var lt=et.line+rt.text.length-(rt.to.line-rt.from.line)-1,at=et.ch;return et.line==rt.to.line&&(at+=Qu(rt).ch-rt.to.ch),Oe(lt,at)}function $c(et,rt){for(var lt=[],at=0;at<et.sel.ranges.length;at++){var ht=et.sel.ranges[at];lt.push(new So(Dh(ht.anchor,rt),Dh(ht.head,rt)))}return Tl(et.cm,lt,et.sel.primIndex)}function vc(et,rt,lt){return et.line==rt.line?Oe(lt.line,et.ch-rt.ch+lt.ch):Oe(lt.line+(et.line-rt.line),et.ch)}function qc(et,rt,lt){for(var at=[],ht=Oe(et.first,0),mt=ht,kt=0;kt<rt.length;kt++){var Lt=rt[kt],Nt=vc(Lt.from,ht,mt),jt=vc(Qu(Lt),ht,mt);if(ht=Lt.to,mt=jt,lt=="around"){var Ee=et.sel.ranges[kt],Kt=Ti(Ee.head,Ee.anchor)<0;at[kt]=new So(Kt?jt:Nt,Kt?Nt:jt)}else at[kt]=new So(Nt,Nt)}return new gl(at,et.sel.primIndex)}function Wr(et){et.doc.mode=hn(et.options,et.doc.modeOption),tf(et)}function tf(et){et.doc.iter(function(rt){rt.stateAfter&&(rt.stateAfter=null),rt.styles&&(rt.styles=null)}),et.doc.modeFrontier=et.doc.highlightFrontier=et.doc.first,gc(et,100),et.state.modeGen++,et.curOp&&_o(et)}function op(et,rt){return rt.from.ch==0&&rt.to.ch==0&&ee(rt.text)==""&&(!et.cm||et.cm.options.wholeLineUpdateBefore)}function Yf(et,rt,lt,at){function ht(tr){return lt?lt[tr]:null}function mt(tr,Wn,lr){oo(tr,Wn,lr,at),jn(tr,"change",tr,rt)}function kt(tr,Wn){for(var lr=[],Pr=tr;Pr<Wn;++Pr)lr.push(new Xr(jt[Pr],ht(Pr),at));return lr}var Lt=rt.from,Nt=rt.to,jt=rt.text,Ee=mi(et,Lt.line),Kt=mi(et,Nt.line),ri=ee(jt),Qe=ht(jt.length-1),Yi=Nt.line-Lt.line;if(rt.full)et.insert(0,kt(0,jt.length)),et.remove(jt.length,et.size-jt.length);else if(op(et,rt)){var $i=kt(0,jt.length-1);mt(Kt,Kt.text,Qe),Yi&&et.remove(Lt.line,Yi),$i.length&&et.insert(Lt.line,$i)}else if(Ee==Kt)if(jt.length==1)mt(Ee,Ee.text.slice(0,Lt.ch)+ri+Ee.text.slice(Nt.ch),Qe);else{var dn=kt(1,jt.length-1);dn.push(new Xr(ri+Ee.text.slice(Nt.ch),Qe,at)),mt(Ee,Ee.text.slice(0,Lt.ch)+jt[0],ht(0)),et.insert(Lt.line+1,dn)}else if(jt.length==1)mt(Ee,Ee.text.slice(0,Lt.ch)+jt[0]+Kt.text.slice(Nt.ch),ht(0)),et.remove(Lt.line+1,Yi);else{mt(Ee,Ee.text.slice(0,Lt.ch)+jt[0],ht(0)),mt(Kt,ri+Kt.text.slice(Nt.ch),Qe);var Dn=kt(1,jt.length-1);Yi>1&&et.remove(Lt.line+1,Yi-1),et.insert(Lt.line+1,Dn)}jn(et,"change",et,rt)}function Zl(et,rt,lt){function at(ht,mt,kt){if(ht.linked)for(var Lt=0;Lt<ht.linked.length;++Lt){var Nt=ht.linked[Lt];if(Nt.doc!=mt){var jt=kt&&Nt.sharedHist;lt&&!jt||(rt(Nt.doc,jt),at(Nt.doc,ht,jt))}}}at(et,null,!0)}function Xf(et,rt){if(rt.cm)throw new Error("This document is already in use.");et.doc=rt,rt.cm=et,pr(et),Wr(et),ef(et),et.options.lineWrapping||Lr(et),et.options.mode=rt.modeOption,_o(et)}function ef(et){(et.doc.direction=="rtl"?Ie:Xt)(et.display.lineDiv,"CodeMirror-rtl")}function t0(et){co(et,function(){ef(et),_o(et)})}function mc(et){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=et||1}function Jf(et,rt){var lt={from:ln(rt.from),to:Qu(rt),text:fn(et,rt.from,rt.to)};return $u(et,lt,rt.from.line,rt.to.line+1),Zl(et,function(at){return $u(at,lt,rt.from.line,rt.to.line+1)},!0),lt}function yc(et){for(;et.length;){var rt=ee(et);if(rt.ranges)et.pop();else break}}function nf(et,rt){if(rt)return yc(et.done),ee(et.done);if(et.done.length&&!ee(et.done).ranges)return ee(et.done);if(et.done.length>1&&!et.done[et.done.length-2].ranges)return et.done.pop(),ee(et.done)}function rf(et,rt,lt,at){var ht=et.history;ht.undone.length=0;var mt=+new Date,kt,Lt;if((ht.lastOp==at||ht.lastOrigin==rt.origin&&rt.origin&&(rt.origin.charAt(0)=="+"&&ht.lastModTime>mt-(et.cm?et.cm.options.historyEventDelay:500)||rt.origin.charAt(0)=="*"))&&(kt=nf(ht,ht.lastOp==at)))Lt=ee(kt.changes),Ti(rt.from,rt.to)==0&&Ti(rt.from,Lt.to)==0?Lt.to=Qu(rt):kt.changes.push(Jf(et,rt));else{var Nt=ee(ht.done);for((!Nt||!Nt.ranges)&&xc(et.sel,ht.done),kt={changes:[Jf(et,rt)],generation:ht.generation},ht.done.push(kt);ht.done.length>ht.undoDepth;)ht.done.shift(),ht.done[0].ranges||ht.done.shift()}ht.done.push(lt),ht.generation=++ht.maxGeneration,ht.lastModTime=ht.lastSelTime=mt,ht.lastOp=ht.lastSelOp=at,ht.lastOrigin=ht.lastSelOrigin=rt.origin,Lt||qe(et,"historyAdded")}function sp(et,rt,lt,at){var ht=rt.charAt(0);return ht=="*"||ht=="+"&<.ranges.length==at.ranges.length&<.somethingSelected()==at.somethingSelected()&&new Date-et.history.lastSelTime<=(et.cm?et.cm.options.historyEventDelay:500)}function of(et,rt,lt,at){var ht=et.history,mt=at&&at.origin;lt==ht.lastSelOp||mt&&ht.lastSelOrigin==mt&&(ht.lastModTime==ht.lastSelTime&&ht.lastOrigin==mt||sp(et,mt,ee(ht.done),rt))?ht.done[ht.done.length-1]=rt:xc(rt,ht.done),ht.lastSelTime=+new Date,ht.lastSelOrigin=mt,ht.lastSelOp=lt,at&&at.clearRedo!==!1&&yc(ht.undone)}function xc(et,rt){var lt=ee(rt);lt&<.ranges&<.equals(et)||rt.push(et)}function $u(et,rt,lt,at){var ht=rt["spans_"+et.id],mt=0;et.iter(Math.max(et.first,lt),Math.min(et.first+et.size,at),function(kt){kt.markedSpans&&((ht||(ht=rt["spans_"+et.id]={}))[mt]=kt.markedSpans),++mt})}function pa(et){if(!et)return null;for(var rt,lt=0;lt<et.length;++lt)et[lt].marker.explicitlyCleared?rt||(rt=et.slice(0,lt)):rt&&rt.push(et[lt]);return rt?rt.length?rt:null:et}function nu(et,rt){var lt=rt["spans_"+et.id];if(!lt)return null;for(var at=[],ht=0;ht<rt.text.length;++ht)at.push(pa(lt[ht]));return at}function Qf(et,rt){var lt=nu(et,rt),at=or(et,rt);if(!lt)return at;if(!at)return lt;for(var ht=0;ht<lt.length;++ht){var mt=lt[ht],kt=at[ht];if(mt&&kt)t:for(var Lt=0;Lt<kt.length;++Lt){for(var Nt=kt[Lt],jt=0;jt<mt.length;++jt)if(mt[jt].marker==Nt.marker)continue t;mt.push(Nt)}else kt&&(lt[ht]=kt)}return lt}function Eu(et,rt,lt){for(var at=[],ht=0;ht<et.length;++ht){var mt=et[ht];if(mt.ranges){at.push(lt?gl.prototype.deepCopy.call(mt):mt);continue}var kt=mt.changes,Lt=[];at.push({changes:Lt});for(var Nt=0;Nt<kt.length;++Nt){var jt=kt[Nt],Ee=void 0;if(Lt.push({from:jt.from,to:jt.to,text:jt.text}),rt)for(var Kt in jt)(Ee=Kt.match(/^spans_(\d+)$/))&&ge(rt,Number(Ee[1]))>-1&&(ee(Lt)[Kt]=jt[Kt],delete jt[Kt])}}return at}function $f(et,rt,lt,at){if(at){var ht=et.anchor;if(lt){var mt=Ti(rt,ht)<0;mt!=Ti(lt,ht)<0?(ht=rt,rt=lt):mt!=Ti(rt,lt)<0&&(rt=lt)}return new So(ht,rt)}else return new So(lt||rt,rt)}function qf(et,rt,lt,at,ht){ht==null&&(ht=et.cm&&(et.cm.display.shift||et.extend)),na(et,new gl([$f(et.sel.primary(),rt,lt,ht)],0),at)}function _g(et,rt,lt){for(var at=[],ht=et.cm&&(et.cm.display.shift||et.extend),mt=0;mt<et.sel.ranges.length;mt++)at[mt]=$f(et.sel.ranges[mt],rt[mt],null,ht);var kt=Tl(et.cm,at,et.sel.primIndex);na(et,kt,lt)}function qu(et,rt,lt,at){var ht=et.sel.ranges.slice(0);ht[rt]=lt,na(et,Tl(et.cm,ht,et.sel.primIndex),at)}function Fh(et,rt,lt,at){na(et,Mu(rt,lt),at)}function Hg(et,rt,lt){var at={ranges:rt.ranges,update:function(ht){this.ranges=[];for(var mt=0;mt<ht.length;mt++)this.ranges[mt]=new So(Xi(et,ht[mt].anchor),Xi(et,ht[mt].head))},origin:lt&<.origin};return qe(et,"beforeSelectionChange",et,at),et.cm&&qe(et.cm,"beforeSelectionChange",et.cm,at),at.ranges!=rt.ranges?Tl(et.cm,at.ranges,at.ranges.length-1):rt}function td(et,rt,lt){var at=et.history.done,ht=ee(at);ht&&ht.ranges?(at[at.length-1]=rt,Bh(et,rt,lt)):na(et,rt,lt)}function na(et,rt,lt){Bh(et,rt,lt),of(et,et.sel,et.cm?et.cm.curOp.id:NaN,lt)}function Bh(et,rt,lt){(Si(et,"beforeSelectionChange")||et.cm&&Si(et.cm,"beforeSelectionChange"))&&(rt=Hg(et,rt,lt));var at=lt&<.bias||(Ti(rt.primary().head,et.sel.primary().head)<0?-1:1);ap(et,af(et,rt,at,!0)),!(lt&<.scroll===!1)&&et.cm&&Cu(et.cm)}function ap(et,rt){rt.equals(et.sel)||(et.sel=rt,et.cm&&(et.cm.curOp.updateInput=1,et.cm.curOp.selectionChanged=!0,Zi(et.cm)),jn(et,"cursorActivity",et))}function sf(et){ap(et,af(et,et.sel,null,!1))}function af(et,rt,lt,at){for(var ht,mt=0;mt<rt.ranges.length;mt++){var kt=rt.ranges[mt],Lt=rt.ranges.length==et.sel.ranges.length&&et.sel.ranges[mt],Nt=lf(et,kt.anchor,Lt&&Lt.anchor,lt,at),jt=lf(et,kt.head,Lt&&Lt.head,lt,at);(ht||Nt!=kt.anchor||jt!=kt.head)&&(ht||(ht=rt.ranges.slice(0,mt)),ht[mt]=new So(Nt,jt))}return ht?Tl(et.cm,ht,rt.primIndex):rt}function bu(et,rt,lt,at,ht){var mt=mi(et,rt.line);if(mt.markedSpans)for(var kt=0;kt<mt.markedSpans.length;++kt){var Lt=mt.markedSpans[kt],Nt=Lt.marker,jt="selectLeft"in Nt?!Nt.selectLeft:Nt.inclusiveLeft,Ee="selectRight"in Nt?!Nt.selectRight:Nt.inclusiveRight;if((Lt.from==null||(jt?Lt.from<=rt.ch:Lt.from<rt.ch))&&(Lt.to==null||(Ee?Lt.to>=rt.ch:Lt.to>rt.ch))){if(ht&&(qe(Nt,"beforeCursorEnter"),Nt.explicitlyCleared))if(mt.markedSpans){--kt;continue}else break;if(!Nt.atomic)continue;if(lt){var Kt=Nt.find(at<0?1:-1),ri=void 0;if((at<0?Ee:jt)&&(Kt=lp(et,Kt,-at,Kt&&Kt.line==rt.line?mt:null)),Kt&&Kt.line==rt.line&&(ri=Ti(Kt,lt))&&(at<0?ri<0:ri>0))return bu(et,Kt,rt,at,ht)}var Qe=Nt.find(at<0?-1:1);return(at<0?jt:Ee)&&(Qe=lp(et,Qe,at,Qe.line==rt.line?mt:null)),Qe?bu(et,Qe,rt,at,ht):null}}return rt}function lf(et,rt,lt,at,ht){var mt=at||1,kt=bu(et,rt,lt,mt,ht)||!ht&&bu(et,rt,lt,mt,!0)||bu(et,rt,lt,-mt,ht)||!ht&&bu(et,rt,lt,-mt,!0);return kt||(et.cantEdit=!0,Oe(et.first,0))}function lp(et,rt,lt,at){return lt<0&&rt.ch==0?rt.line>et.first?Xi(et,Oe(rt.line-1)):null:lt>0&&rt.ch==(at||mi(et,rt.line)).text.length?rt.line<et.first+et.size-1?Oe(rt.line+1,0):null:new Oe(rt.line,rt.ch+lt)}function us(et){et.setSelection(Oe(et.firstLine(),0),Oe(et.lastLine()),oe)}function uf(et,rt,lt){var at={canceled:!1,from:rt.from,to:rt.to,text:rt.text,origin:rt.origin,cancel:function(){return at.canceled=!0}};return lt&&(at.update=function(ht,mt,kt,Lt){ht&&(at.from=Xi(et,ht)),mt&&(at.to=Xi(et,mt)),kt&&(at.text=kt),Lt!==void 0&&(at.origin=Lt)}),qe(et,"beforeChange",et,at),et.cm&&qe(et.cm,"beforeChange",et.cm,at),at.canceled?(et.cm&&(et.cm.curOp.updateInput=2),null):{from:at.from,to:at.to,text:at.text,origin:at.origin}}function th(et,rt,lt){if(et.cm){if(!et.cm.curOp)return Ss(et.cm,th)(et,rt,lt);if(et.cm.state.suppressEdits)return}if(!((Si(et,"beforeChange")||et.cm&&Si(et.cm,"beforeChange"))&&(rt=uf(et,rt,!0),!rt))){var at=Ei&&!lt&&Zn(et,rt.from,rt.to);if(at)for(var ht=at.length-1;ht>=0;--ht)Oh(et,{from:at[ht].from,to:at[ht].to,text:ht?[""]:rt.text,origin:rt.origin});else Oh(et,rt)}}function Oh(et,rt){if(!(rt.text.length==1&&rt.text[0]==""&&Ti(rt.from,rt.to)==0)){var lt=$c(et,rt);rf(et,rt,lt,et.cm?et.cm.curOp.id:NaN),wc(et,rt,lt,or(et,rt));var at=[];Zl(et,function(ht,mt){!mt&&ge(at,ht.history)==-1&&(hp(ht.history,rt),at.push(ht.history)),wc(ht,rt,null,or(ht,rt))})}}function hf(et,rt,lt){var at=et.cm&&et.cm.state.suppressEdits;if(!(at&&!lt)){for(var ht=et.history,mt,kt=et.sel,Lt=rt=="undo"?ht.done:ht.undone,Nt=rt=="undo"?ht.undone:ht.done,jt=0;jt<Lt.length&&(mt=Lt[jt],!(lt?mt.ranges&&!mt.equals(et.sel):!mt.ranges));jt++);if(jt!=Lt.length){for(ht.lastOrigin=ht.lastSelOrigin=null;;)if(mt=Lt.pop(),mt.ranges){if(xc(mt,Nt),lt&&!mt.equals(et.sel)){na(et,mt,{clearRedo:!1});return}kt=mt}else if(at){Lt.push(mt);return}else break;var Ee=[];xc(kt,Nt),Nt.push({changes:Ee,generation:ht.generation}),ht.generation=mt.generation||++ht.maxGeneration;for(var Kt=Si(et,"beforeChange")||et.cm&&Si(et.cm,"beforeChange"),ri=function($i){var dn=mt.changes[$i];if(dn.origin=rt,Kt&&!uf(et,dn,!1))return Lt.length=0,{};Ee.push(Jf(et,dn));var Dn=$i?$c(et,dn):ee(Lt);wc(et,dn,Dn,Qf(et,dn)),!$i&&et.cm&&et.cm.scrollIntoView({from:dn.from,to:Qu(dn)});var tr=[];Zl(et,function(Wn,lr){!lr&&ge(tr,Wn.history)==-1&&(hp(Wn.history,dn),tr.push(Wn.history)),wc(Wn,dn,null,Qf(Wn,dn))})},Qe=mt.changes.length-1;Qe>=0;--Qe){var Yi=ri(Qe);if(Yi)return Yi.v}}}}function up(et,rt){if(rt!=0&&(et.first+=rt,et.sel=new gl(ve(et.sel.ranges,function(ht){return new So(Oe(ht.anchor.line+rt,ht.anchor.ch),Oe(ht.head.line+rt,ht.head.ch))}),et.sel.primIndex),et.cm)){_o(et.cm,et.first,et.first-rt,rt);for(var lt=et.cm.display,at=lt.viewFrom;at<lt.viewTo;at++)_r(et.cm,at,"gutter")}}function wc(et,rt,lt,at){if(et.cm&&!et.cm.curOp)return Ss(et.cm,wc)(et,rt,lt,at);if(rt.to.line<et.first){up(et,rt.text.length-1-(rt.to.line-rt.from.line));return}if(!(rt.from.line>et.lastLine())){if(rt.from.line<et.first){var ht=rt.text.length-1-(et.first-rt.from.line);up(et,ht),rt={from:Oe(et.first,0),to:Oe(rt.to.line+ht,rt.to.ch),text:[ee(rt.text)],origin:rt.origin}}var mt=et.lastLine();rt.to.line>mt&&(rt={from:rt.from,to:Oe(mt,mi(et,mt).text.length),text:[rt.text[0]],origin:rt.origin}),rt.removed=fn(et,rt.from,rt.to),lt||(lt=$c(et,rt)),et.cm?Wg(et.cm,rt,at):Yf(et,rt,at),Bh(et,lt,oe),et.cantEdit&&lf(et,Oe(et.firstLine(),0))&&(et.cantEdit=!1)}}function Wg(et,rt,lt){var at=et.doc,ht=et.display,mt=rt.from,kt=rt.to,Lt=!1,Nt=mt.line;et.options.lineWrapping||(Nt=It(Gi(mi(at,mt.line))),at.iter(Nt,kt.line+1,function(Qe){if(Qe==ht.maxLine)return Lt=!0,!0})),at.sel.contains(rt.from,rt.to)>-1&&Zi(et),Yf(at,rt,lt,zo(et)),et.options.lineWrapping||(at.iter(Nt,mt.line+rt.text.length,function(Qe){var Yi=Tr(Qe);Yi>ht.maxLineLength&&(ht.maxLine=Qe,ht.maxLineLength=Yi,ht.maxLineChanged=!0,Lt=!1)}),Lt&&(et.curOp.updateMaxLine=!0)),pi(at,mt.line),gc(et,400);var jt=rt.text.length-(kt.line-mt.line)-1;rt.full?_o(et):mt.line==kt.line&&rt.text.length==1&&!op(et.doc,rt)?_r(et,mt.line,"text"):_o(et,mt.line,kt.line+1,jt);var Ee=Si(et,"changes"),Kt=Si(et,"change");if(Kt||Ee){var ri={from:mt,to:kt,text:rt.text,removed:rt.removed,origin:rt.origin};Kt&&jn(et,"change",et,ri),Ee&&(et.curOp.changeObjs||(et.curOp.changeObjs=[])).push(ri)}et.display.selForContextMenu=null}function Ih(et,rt,lt,at,ht){var mt;at||(at=lt),Ti(at,lt)<0&&(mt=[at,lt],lt=mt[0],at=mt[1]),typeof rt=="string"&&(rt=et.splitLines(rt)),th(et,{from:lt,to:at,text:rt,origin:ht})}function vl(et,rt,lt,at){lt<et.line?et.line+=at:rt<et.line&&(et.line=rt,et.ch=0)}function Zg(et,rt,lt,at){for(var ht=0;ht<et.length;++ht){var mt=et[ht],kt=!0;if(mt.ranges){mt.copied||(mt=et[ht]=mt.deepCopy(),mt.copied=!0);for(var Lt=0;Lt<mt.ranges.length;Lt++)vl(mt.ranges[Lt].anchor,rt,lt,at),vl(mt.ranges[Lt].head,rt,lt,at);continue}for(var Nt=0;Nt<mt.changes.length;++Nt){var jt=mt.changes[Nt];if(lt<jt.from.line)jt.from=Oe(jt.from.line+at,jt.from.ch),jt.to=Oe(jt.to.line+at,jt.to.ch);else if(rt<=jt.to.line){kt=!1;break}}kt||(et.splice(0,ht+1),ht=0)}}function hp(et,rt){var lt=rt.from.line,at=rt.to.line,ht=rt.text.length-(at-lt)-1;Zg(et.done,lt,at,ht),Zg(et.undone,lt,at,ht)}function Rh(et,rt,lt,at){var ht=rt,mt=rt;return typeof rt=="number"?mt=mi(et,Hi(et,rt)):ht=It(rt),ht==null?null:(at(mt,ht)&&et.cm&&_r(et.cm,ht,lt),mt)}function Sc(et){this.lines=et,this.parent=null;for(var rt=0,lt=0;lt<et.length;++lt)et[lt].parent=this,rt+=et[lt].height;this.height=rt}Sc.prototype={chunkSize:function(){return this.lines.length},removeInner:function(et,rt){for(var lt=et,at=et+rt;lt<at;++lt){var ht=this.lines[lt];this.height-=ht.height,so(ht),jn(ht,"delete")}this.lines.splice(et,rt)},collapse:function(et){et.push.apply(et,this.lines)},insertInner:function(et,rt,lt){this.height+=lt,this.lines=this.lines.slice(0,et).concat(rt).concat(this.lines.slice(et));for(var at=0;at<rt.length;++at)rt[at].parent=this},iterN:function(et,rt,lt){for(var at=et+rt;et<at;++et)if(lt(this.lines[et]))return!0}};function Yo(et){this.children=et;for(var rt=0,lt=0,at=0;at<et.length;++at){var ht=et[at];rt+=ht.chunkSize(),lt+=ht.height,ht.parent=this}this.size=rt,this.height=lt,this.parent=null}Yo.prototype={chunkSize:function(){return this.size},removeInner:function(et,rt){this.size-=rt;for(var lt=0;lt<this.children.length;++lt){var at=this.children[lt],ht=at.chunkSize();if(et<ht){var mt=Math.min(rt,ht-et),kt=at.height;if(at.removeInner(et,mt),this.height-=kt-at.height,ht==mt&&(this.children.splice(lt--,1),at.parent=null),(rt-=mt)==0)break;et=0}else et-=ht}if(this.size-rt<25&&(this.children.length>1||!(this.children[0]instanceof Sc))){var Lt=[];this.collapse(Lt),this.children=[new Sc(Lt)],this.children[0].parent=this}},collapse:function(et){for(var rt=0;rt<this.children.length;++rt)this.children[rt].collapse(et)},insertInner:function(et,rt,lt){this.size+=rt.length,this.height+=lt;for(var at=0;at<this.children.length;++at){var ht=this.children[at],mt=ht.chunkSize();if(et<=mt){if(ht.insertInner(et,rt,lt),ht.lines&&ht.lines.length>50){for(var kt=ht.lines.length%25+25,Lt=kt;Lt<ht.lines.length;){var Nt=new Sc(ht.lines.slice(Lt,Lt+=25));ht.height-=Nt.height,this.children.splice(++at,0,Nt),Nt.parent=this}ht.lines=ht.lines.slice(0,kt),this.maybeSpill()}break}et-=mt}},maybeSpill:function(){if(!(this.children.length<=10)){var et=this;do{var rt=et.children.splice(et.children.length-5,5),lt=new Yo(rt);if(et.parent){et.size-=lt.size,et.height-=lt.height;var ht=ge(et.parent.children,et);et.parent.children.splice(ht+1,0,lt)}else{var at=new Yo(et.children);at.parent=et,et.children=[at,lt],et=at}lt.parent=et.parent}while(et.children.length>10);et.parent.maybeSpill()}},iterN:function(et,rt,lt){for(var at=0;at<this.children.length;++at){var ht=this.children[at],mt=ht.chunkSize();if(et<mt){var kt=Math.min(rt,mt-et);if(ht.iterN(et,kt,lt))return!0;if((rt-=kt)==0)break;et=0}else et-=mt}}};var Pu=function(et,rt,lt){if(lt)for(var at in lt)lt.hasOwnProperty(at)&&(this[at]=lt[at]);this.doc=et,this.node=rt};Pu.prototype.clear=function(){var et=this.doc.cm,rt=this.line.widgets,lt=this.line,at=It(lt);if(!(at==null||!rt)){for(var ht=0;ht<rt.length;++ht)rt[ht]==this&&rt.splice(ht--,1);rt.length||(lt.widgets=null);var mt=os(this);Gn(lt,Math.max(0,lt.height-mt)),et&&(co(et,function(){Kg(et,lt,-mt),_r(et,at,"widget")}),jn(et,"lineWidgetCleared",et,this,at))}},Pu.prototype.changed=function(){var et=this,rt=this.height,lt=this.doc.cm,at=this.line;this.height=null;var ht=os(this)-rt;ht&&(li(this.doc,at)||Gn(at,at.height+ht),lt&&co(lt,function(){lt.curOp.forceUpdate=!0,Kg(lt,at,ht),jn(lt,"lineWidgetChanged",lt,et,It(at))}))},Oi(Pu);function Kg(et,rt,lt){wr(rt)<(et.curOp&&et.curOp.scrollTop||et.doc.scrollTop)&&Zf(et,lt)}function ed(et,rt,lt,at){var ht=new Pu(et,lt,at),mt=et.cm;return mt&&ht.noHScroll&&(mt.display.alignWidgets=!0),Rh(et,rt,"widget",function(kt){var Lt=kt.widgets||(kt.widgets=[]);if(ht.insertAt==null?Lt.push(ht):Lt.splice(Math.min(Lt.length-1,Math.max(0,ht.insertAt)),0,ht),ht.line=kt,mt&&!li(et,kt)){var Nt=wr(kt)<et.scrollTop;Gn(kt,kt.height+os(ht)),Nt&&Zf(mt,ht.height),mt.curOp.forceUpdate=!0}return!0}),mt&&jn(mt,"lineWidgetAdded",mt,ht,typeof rt=="number"?rt:It(rt)),ht}var Vg=0,le=function(et,rt){this.lines=[],this.type=rt,this.doc=et,this.id=++Vg};le.prototype.clear=function(){if(!this.explicitlyCleared){var et=this.doc.cm,rt=et&&!et.curOp;if(rt&&Ku(et),Si(this,"clear")){var lt=this.find();lt&&jn(this,"clear",lt.from,lt.to)}for(var at=null,ht=null,mt=0;mt<this.lines.length;++mt){var kt=this.lines[mt],Lt=pn(kt.markedSpans,this);et&&!this.collapsed?_r(et,It(kt),"text"):et&&(Lt.to!=null&&(ht=It(kt)),Lt.from!=null&&(at=It(kt))),kt.markedSpans=kn(kt.markedSpans,Lt),Lt.from==null&&this.collapsed&&!li(this.doc,kt)&&et&&Gn(kt,ca(et.display))}if(et&&this.collapsed&&!et.options.lineWrapping)for(var Nt=0;Nt<this.lines.length;++Nt){var jt=Gi(this.lines[Nt]),Ee=Tr(jt);Ee>et.display.maxLineLength&&(et.display.maxLine=jt,et.display.maxLineLength=Ee,et.display.maxLineChanged=!0)}at!=null&&et&&this.collapsed&&_o(et,at,ht+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,et&&sf(et.doc)),et&&jn(et,"markerCleared",et,this,at,ht),rt&&Vu(et),this.parent&&this.parent.clear()}},le.prototype.find=function(et,rt){et==null&&this.type=="bookmark"&&(et=1);for(var lt,at,ht=0;ht<this.lines.length;++ht){var mt=this.lines[ht],kt=pn(mt.markedSpans,this);if(kt.from!=null&&(lt=Oe(rt?mt:It(mt),kt.from),et==-1))return lt;if(kt.to!=null&&(at=Oe(rt?mt:It(mt),kt.to),et==1))return at}return lt&&{from:lt,to:at}},le.prototype.changed=function(){var et=this,rt=this.find(-1,!0),lt=this,at=this.doc.cm;!rt||!at||co(at,function(){var ht=rt.line,mt=It(rt.line),kt=Ja(at,mt);if(kt&&(dr(kt),at.curOp.selectionChanged=at.curOp.forceUpdate=!0),at.curOp.updateMaxLine=!0,!li(lt.doc,ht)&<.height!=null){var Lt=lt.height;lt.height=null;var Nt=os(lt)-Lt;Nt&&Gn(ht,ht.height+Nt)}jn(at,"markerChanged",at,et)})},le.prototype.attachLine=function(et){if(!this.lines.length&&this.doc.cm){var rt=this.doc.cm.curOp;(!rt.maybeHiddenMarkers||ge(rt.maybeHiddenMarkers,this)==-1)&&(rt.maybeUnhiddenMarkers||(rt.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(et)},le.prototype.detachLine=function(et){if(this.lines.splice(ge(this.lines,et),1),!this.lines.length&&this.doc.cm){var rt=this.doc.cm.curOp;(rt.maybeHiddenMarkers||(rt.maybeHiddenMarkers=[])).push(this)}},Oi(le);function jh(et,rt,lt,at,ht){if(at&&at.shared)return Gg(et,rt,lt,at,ht);if(et.cm&&!et.cm.curOp)return Ss(et.cm,jh)(et,rt,lt,at,ht);var mt=new le(et,ht),kt=Ti(rt,lt);if(at&&oi(at,mt,!1),kt>0||kt==0&&mt.clearWhenEmpty!==!1)return mt;if(mt.replacedWith&&(mt.collapsed=!0,mt.widgetNode=Te("span",[mt.replacedWith],"CodeMirror-widget"),at.handleMouseEvents||mt.widgetNode.setAttribute("cm-ignore-events","true"),at.insertLeft&&(mt.widgetNode.insertLeft=!0)),mt.collapsed){if(Yn(et,rt.line,rt,lt,mt)||rt.line!=lt.line&&Yn(et,lt.line,rt,lt,mt))throw new Error("Inserting collapsed marker partially overlapping an existing one");_e()}mt.addToHistory&&rf(et,{from:rt,to:lt,origin:"markText"},et.sel,NaN);var Lt=rt.line,Nt=et.cm,jt;if(et.iter(Lt,lt.line+1,function(Kt){Nt&&mt.collapsed&&!Nt.options.lineWrapping&&Gi(Kt)==Nt.display.maxLine&&(jt=!0),mt.collapsed&&Lt!=rt.line&&Gn(Kt,0),zn(Kt,new bi(mt,Lt==rt.line?rt.ch:null,Lt==lt.line?lt.ch:null)),++Lt}),mt.collapsed&&et.iter(rt.line,lt.line+1,function(Kt){li(et,Kt)&&Gn(Kt,0)}),mt.clearOnEnter&&te(mt,"beforeCursorEnter",function(){return mt.clear()}),mt.readOnly&&(cn(),(et.history.done.length||et.history.undone.length)&&et.clearHistory()),mt.collapsed&&(mt.id=++Vg,mt.atomic=!0),Nt){if(jt&&(Nt.curOp.updateMaxLine=!0),mt.collapsed)_o(Nt,rt.line,lt.line+1);else if(mt.className||mt.startStyle||mt.endStyle||mt.css||mt.attributes||mt.title)for(var Ee=rt.line;Ee<=lt.line;Ee++)_r(Nt,Ee,"text");mt.atomic&&sf(Nt.doc),jn(Nt,"markerAdded",Nt,mt)}return mt}var ru=function(et,rt){this.markers=et,this.primary=rt;for(var lt=0;lt<et.length;++lt)et[lt].parent=this};ru.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var et=0;et<this.markers.length;++et)this.markers[et].clear();jn(this,"clear")}},ru.prototype.find=function(et,rt){return this.primary.find(et,rt)},Oi(ru);function Gg(et,rt,lt,at,ht){at=oi(at),at.shared=!1;var mt=[jh(et,rt,lt,at,ht)],kt=mt[0],Lt=at.widgetNode;return Zl(et,function(Nt){Lt&&(at.widgetNode=Lt.cloneNode(!0)),mt.push(jh(Nt,Xi(Nt,rt),Xi(Nt,lt),at,ht));for(var jt=0;jt<Nt.linked.length;++jt)if(Nt.linked[jt].isParent)return;kt=ee(mt)}),new ru(mt,kt)}function cp(et){return et.findMarks(Oe(et.first,0),et.clipPos(Oe(et.lastLine())),function(rt){return rt.parent})}function Ug(et,rt){for(var lt=0;lt<rt.length;lt++){var at=rt[lt],ht=at.find(),mt=et.clipPos(ht.from),kt=et.clipPos(ht.to);if(Ti(mt,kt)){var Lt=jh(et,mt,kt,at.primary,at.primary.type);at.markers.push(Lt),Lt.parent=at}}}function fp(et){for(var rt=function(at){var ht=et[at],mt=[ht.primary.doc];Zl(ht.primary.doc,function(Nt){return mt.push(Nt)});for(var kt=0;kt<ht.markers.length;kt++){var Lt=ht.markers[kt];ge(mt,Lt.doc)==-1&&(Lt.parent=null,ht.markers.splice(kt--,1))}},lt=0;lt<et.length;lt++)rt(lt)}var e0=0,Us=function(et,rt,lt,at,ht){if(!(this instanceof Us))return new Us(et,rt,lt,at,ht);lt==null&&(lt=0),Yo.call(this,[new Sc([new Xr("",null)])]),this.first=lt,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=lt;var mt=Oe(lt,0);this.sel=Mu(mt),this.history=new mc(null),this.id=++e0,this.modeOption=rt,this.lineSep=at,this.direction=ht=="rtl"?"rtl":"ltr",this.extend=!1,typeof et=="string"&&(et=this.splitLines(et)),Yf(this,{from:mt,to:mt,text:et}),na(this,Mu(mt),oe)};Us.prototype=We(Yo.prototype,{constructor:Us,iter:function(et,rt,lt){lt?this.iterN(et-this.first,rt-et,lt):this.iterN(this.first,this.first+this.size,et)},insert:function(et,rt){for(var lt=0,at=0;at<rt.length;++at)lt+=rt[at].height;this.insertInner(et-this.first,rt,lt)},remove:function(et,rt){this.removeInner(et-this.first,rt)},getValue:function(et){var rt=On(this,this.first,this.first+this.size);return et===!1?rt:rt.join(et||this.lineSeparator())},setValue:Ls(function(et){var rt=Oe(this.first,0),lt=this.first+this.size-1;th(this,{from:rt,to:Oe(lt,mi(this,lt).text.length),text:this.splitLines(et),origin:"setValue",full:!0},!0),this.cm&&Nh(this.cm,0,0),na(this,Mu(rt),oe)}),replaceRange:function(et,rt,lt,at){rt=Xi(this,rt),lt=lt?Xi(this,lt):rt,Ih(this,et,rt,lt,at)},getRange:function(et,rt,lt){var at=fn(this,Xi(this,et),Xi(this,rt));return lt===!1?at:at.join(lt||this.lineSeparator())},getLine:function(et){var rt=this.getLineHandle(et);return rt&&rt.text},getLineHandle:function(et){if(xi(this,et))return mi(this,et)},getLineNumber:function(et){return It(et)},getLineHandleVisualStart:function(et){return typeof et=="number"&&(et=mi(this,et)),Gi(et)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(et){return Xi(this,et)},getCursor:function(et){var rt=this.sel.primary(),lt;return et==null||et=="head"?lt=rt.head:et=="anchor"?lt=rt.anchor:et=="end"||et=="to"||et===!1?lt=rt.to():lt=rt.from(),lt},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ls(function(et,rt,lt){Fh(this,Xi(this,typeof et=="number"?Oe(et,rt||0):et),null,lt)}),setSelection:Ls(function(et,rt,lt){Fh(this,Xi(this,et),Xi(this,rt||et),lt)}),extendSelection:Ls(function(et,rt,lt){qf(this,Xi(this,et),rt&&Xi(this,rt),lt)}),extendSelections:Ls(function(et,rt){_g(this,En(this,et),rt)}),extendSelectionsBy:Ls(function(et,rt){var lt=ve(this.sel.ranges,et);_g(this,En(this,lt),rt)}),setSelections:Ls(function(et,rt,lt){if(et.length){for(var at=[],ht=0;ht<et.length;ht++)at[ht]=new So(Xi(this,et[ht].anchor),Xi(this,et[ht].head));rt==null&&(rt=Math.min(et.length-1,this.sel.primIndex)),na(this,Tl(this.cm,at,rt),lt)}}),addSelection:Ls(function(et,rt,lt){var at=this.sel.ranges.slice(0);at.push(new So(Xi(this,et),Xi(this,rt||et))),na(this,Tl(this.cm,at,at.length-1),lt)}),getSelection:function(et){for(var rt=this.sel.ranges,lt,at=0;at<rt.length;at++){var ht=fn(this,rt[at].from(),rt[at].to());lt=lt?lt.concat(ht):ht}return et===!1?lt:lt.join(et||this.lineSeparator())},getSelections:function(et){for(var rt=[],lt=this.sel.ranges,at=0;at<lt.length;at++){var ht=fn(this,lt[at].from(),lt[at].to());et!==!1&&(ht=ht.join(et||this.lineSeparator())),rt[at]=ht}return rt},replaceSelection:function(et,rt,lt){for(var at=[],ht=0;ht<this.sel.ranges.length;ht++)at[ht]=et;this.replaceSelections(at,rt,lt||"+input")},replaceSelections:Ls(function(et,rt,lt){for(var at=[],ht=this.sel,mt=0;mt<ht.ranges.length;mt++){var kt=ht.ranges[mt];at[mt]={from:kt.from(),to:kt.to(),text:this.splitLines(et[mt]),origin:lt}}for(var Lt=rt&&rt!="end"&&qc(this,at,rt),Nt=at.length-1;Nt>=0;Nt--)th(this,at[Nt]);Lt?td(this,Lt):this.cm&&Cu(this.cm)}),undo:Ls(function(){hf(this,"undo")}),redo:Ls(function(){hf(this,"redo")}),undoSelection:Ls(function(){hf(this,"undo",!0)}),redoSelection:Ls(function(){hf(this,"redo",!0)}),setExtending:function(et){this.extend=et},getExtending:function(){return this.extend},historySize:function(){for(var et=this.history,rt=0,lt=0,at=0;at<et.done.length;at++)et.done[at].ranges||++rt;for(var ht=0;ht<et.undone.length;ht++)et.undone[ht].ranges||++lt;return{undo:rt,redo:lt}},clearHistory:function(){var et=this;this.history=new mc(this.history.maxGeneration),Zl(this,function(rt){return rt.history=et.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(et){return et&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(et){return this.history.generation==(et||this.cleanGeneration)},getHistory:function(){return{done:Eu(this.history.done),undone:Eu(this.history.undone)}},setHistory:function(et){var rt=this.history=new mc(this.history.maxGeneration);rt.done=Eu(et.done.slice(0),null,!0),rt.undone=Eu(et.undone.slice(0),null,!0)},setGutterMarker:Ls(function(et,rt,lt){return Rh(this,et,"gutter",function(at){var ht=at.gutterMarkers||(at.gutterMarkers={});return ht[rt]=lt,!lt&&Be(ht)&&(at.gutterMarkers=null),!0})}),clearGutter:Ls(function(et){var rt=this;this.iter(function(lt){lt.gutterMarkers&<.gutterMarkers[et]&&Rh(rt,lt,"gutter",function(){return lt.gutterMarkers[et]=null,Be(lt.gutterMarkers)&&(lt.gutterMarkers=null),!0})})}),lineInfo:function(et){var rt;if(typeof et=="number"){if(!xi(this,et)||(rt=et,et=mi(this,et),!et))return null}else if(rt=It(et),rt==null)return null;return{line:rt,handle:et,text:et.text,gutterMarkers:et.gutterMarkers,textClass:et.textClass,bgClass:et.bgClass,wrapClass:et.wrapClass,widgets:et.widgets}},addLineClass:Ls(function(et,rt,lt){return Rh(this,et,rt=="gutter"?"gutter":"class",function(at){var ht=rt=="text"?"textClass":rt=="background"?"bgClass":rt=="gutter"?"gutterClass":"wrapClass";if(!at[ht])at[ht]=lt;else{if(pe(lt).test(at[ht]))return!1;at[ht]+=" "+lt}return!0})}),removeLineClass:Ls(function(et,rt,lt){return Rh(this,et,rt=="gutter"?"gutter":"class",function(at){var ht=rt=="text"?"textClass":rt=="background"?"bgClass":rt=="gutter"?"gutterClass":"wrapClass",mt=at[ht];if(mt)if(lt==null)at[ht]=null;else{var kt=mt.match(pe(lt));if(!kt)return!1;var Lt=kt.index+kt[0].length;at[ht]=mt.slice(0,kt.index)+(!kt.index||Lt==mt.length?"":" ")+mt.slice(Lt)||null}else return!1;return!0})}),addLineWidget:Ls(function(et,rt,lt){return ed(this,et,rt,lt)}),removeLineWidget:function(et){et.clear()},markText:function(et,rt,lt){return jh(this,Xi(this,et),Xi(this,rt),lt,lt&<.type||"range")},setBookmark:function(et,rt){var lt={replacedWith:rt&&(rt.nodeType==null?rt.widget:rt),insertLeft:rt&&rt.insertLeft,clearWhenEmpty:!1,shared:rt&&rt.shared,handleMouseEvents:rt&&rt.handleMouseEvents};return et=Xi(this,et),jh(this,et,et,lt,"bookmark")},findMarksAt:function(et){et=Xi(this,et);var rt=[],lt=mi(this,et.line).markedSpans;if(lt)for(var at=0;at<lt.length;++at){var ht=lt[at];(ht.from==null||ht.from<=et.ch)&&(ht.to==null||ht.to>=et.ch)&&rt.push(ht.marker.parent||ht.marker)}return rt},findMarks:function(et,rt,lt){et=Xi(this,et),rt=Xi(this,rt);var at=[],ht=et.line;return this.iter(et.line,rt.line+1,function(mt){var kt=mt.markedSpans;if(kt)for(var Lt=0;Lt<kt.length;Lt++){var Nt=kt[Lt];!(Nt.to!=null&&ht==et.line&&et.ch>=Nt.to||Nt.from==null&&ht!=et.line||Nt.from!=null&&ht==rt.line&&Nt.from>=rt.ch)&&(!lt||lt(Nt.marker))&&at.push(Nt.marker.parent||Nt.marker)}++ht}),at},getAllMarks:function(){var et=[];return this.iter(function(rt){var lt=rt.markedSpans;if(lt)for(var at=0;at<lt.length;++at)lt[at].from!=null&&et.push(lt[at].marker)}),et},posFromIndex:function(et){var rt,lt=this.first,at=this.lineSeparator().length;return this.iter(function(ht){var mt=ht.text.length+at;if(mt>et)return rt=et,!0;et-=mt,++lt}),Xi(this,Oe(lt,rt))},indexFromPos:function(et){et=Xi(this,et);var rt=et.ch;if(et.line<this.first||et.ch<0)return 0;var lt=this.lineSeparator().length;return this.iter(this.first,et.line,function(at){rt+=at.text.length+lt}),rt},copy:function(et){var rt=new Us(On(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return rt.scrollTop=this.scrollTop,rt.scrollLeft=this.scrollLeft,rt.sel=this.sel,rt.extend=!1,et&&(rt.history.undoDepth=this.history.undoDepth,rt.setHistory(this.getHistory())),rt},linkedDoc:function(et){et||(et={});var rt=this.first,lt=this.first+this.size;et.from!=null&&et.from>rt&&(rt=et.from),et.to!=null&&et.to<lt&&(lt=et.to);var at=new Us(On(this,rt,lt),et.mode||this.modeOption,rt,this.lineSep,this.direction);return et.sharedHist&&(at.history=this.history),(this.linked||(this.linked=[])).push({doc:at,sharedHist:et.sharedHist}),at.linked=[{doc:this,isParent:!0,sharedHist:et.sharedHist}],Ug(at,cp(this)),at},unlinkDoc:function(et){if(et instanceof lo&&(et=et.doc),this.linked)for(var rt=0;rt<this.linked.length;++rt){var lt=this.linked[rt];if(lt.doc==et){this.linked.splice(rt,1),et.unlinkDoc(this),fp(cp(this));break}}if(et.history==this.history){var at=[et.id];Zl(et,function(ht){return at.push(ht.id)},!0),et.history=new mc(null),et.history.done=Eu(this.history.done,at),et.history.undone=Eu(this.history.undone,at)}},iterLinkedDocs:function(et){Zl(this,et)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(et){return this.lineSep?et.split(this.lineSep):yr(et)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Ls(function(et){et!="rtl"&&(et="ltr"),et!=this.direction&&(this.direction=et,this.iter(function(rt){return rt.order=null}),this.cm&&t0(this.cm))})}),Us.prototype.eachLine=Us.prototype.iter;var cf=0;function dp(et){var rt=this;if(Jg(rt),!(xe(rt,et)||$o(rt.display,et))){Qi(et),Ut&&(cf=+new Date);var lt=fa(rt,et,!0),at=et.dataTransfer.files;if(!(!lt||rt.isReadOnly()))if(at&&at.length&&window.FileReader&&window.File)for(var ht=at.length,mt=Array(ht),kt=0,Lt=function(){++kt==ht&&Ss(rt,function(){lt=Xi(rt.doc,lt);var Qe={from:lt,to:lt,text:rt.doc.splitLines(mt.filter(function(Yi){return Yi!=null}).join(rt.doc.lineSeparator())),origin:"paste"};th(rt.doc,Qe),td(rt.doc,Mu(Xi(rt.doc,lt),Xi(rt.doc,Qu(Qe))))})()},Nt=function(Qe,Yi){if(rt.options.allowDropFileTypes&&ge(rt.options.allowDropFileTypes,Qe.type)==-1){Lt();return}var $i=new FileReader;$i.onerror=function(){return Lt()},$i.onload=function(){var dn=$i.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(dn)){Lt();return}mt[Yi]=dn,Lt()},$i.readAsText(Qe)},jt=0;jt<at.length;jt++)Nt(at[jt],jt);else{if(rt.state.draggingText&&rt.doc.sel.contains(lt)>-1){rt.state.draggingText(et),setTimeout(function(){return rt.display.input.focus()},20);return}try{var Ee=et.dataTransfer.getData("Text");if(Ee){var Kt;if(rt.state.draggingText&&!rt.state.draggingText.copy&&(Kt=rt.listSelections()),Bh(rt.doc,Mu(lt,lt)),Kt)for(var ri=0;ri<Kt.length;++ri)Ih(rt.doc,"",Kt[ri].anchor,Kt[ri].head,"drag");rt.replaceSelection(Ee,"around","paste"),rt.display.input.focus()}}catch(Qe){}}}}function Yg(et,rt){if(Ut&&(!et.state.draggingText||+new Date-cf<100)){Mn(rt);return}if(!(xe(et,rt)||$o(et.display,rt))&&(rt.dataTransfer.setData("Text",et.getSelection()),rt.dataTransfer.effectAllowed="copyMove",rt.dataTransfer.setDragImage&&!de)){var lt=Ce("img",null,null,"position: fixed; left: 0; top: 0;");lt.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Dt&&(lt.width=lt.height=1,et.display.wrapper.appendChild(lt),lt._top=lt.offsetTop),rt.dataTransfer.setDragImage(lt,0,0),Dt&<.parentNode.removeChild(lt)}}function Xg(et,rt){var lt=fa(et,rt);if(lt){var at=document.createDocumentFragment();Jr(et,lt,at),et.display.dragCursor||(et.display.dragCursor=Ce("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),et.display.lineSpace.insertBefore(et.display.dragCursor,et.display.cursorDiv)),Wt(et.display.dragCursor,at)}}function Jg(et){et.display.dragCursor&&(et.display.lineSpace.removeChild(et.display.dragCursor),et.display.dragCursor=null)}function Qg(et){if(document.getElementsByClassName){for(var rt=document.getElementsByClassName("CodeMirror"),lt=[],at=0;at<rt.length;at++){var ht=rt[at].CodeMirror;ht&<.push(ht)}lt.length&<[0].operation(function(){for(var mt=0;mt<lt.length;mt++)et(lt[mt])})}}var pp=!1;function el(){pp||(Cc(),pp=!0)}function Cc(){var et;te(window,"resize",function(){et==null&&(et=setTimeout(function(){et=null,Qg(gp)},100))}),te(window,"blur",function(){return Qg(Ph)})}function gp(et){var rt=et.display;rt.cachedCharWidth=rt.cachedTextHeight=rt.cachedPaddingH=null,rt.scrollbarsClipped=!1,et.setSize()}for(var ou={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"},ff=0;ff<10;ff++)ou[ff+48]=ou[ff+96]=String(ff);for(var id=65;id<=90;id++)ou[id]=String.fromCharCode(id);for(var df=1;df<=12;df++)ou[df+111]=ou[df+63235]="F"+df;var za={};za.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"},za.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"},za.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"},za.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"]},za.default=Jt?za.macDefault:za.pcDefault;function vp(et){var rt=et.split(/-(?!$)/);et=rt[rt.length-1];for(var lt,at,ht,mt,kt=0;kt<rt.length-1;kt++){var Lt=rt[kt];if(/^(cmd|meta|m)$/i.test(Lt))mt=!0;else if(/^a(lt)?$/i.test(Lt))lt=!0;else if(/^(c|ctrl|control)$/i.test(Lt))at=!0;else if(/^s(hift)?$/i.test(Lt))ht=!0;else throw new Error("Unrecognized modifier name: "+Lt)}return lt&&(et="Alt-"+et),at&&(et="Ctrl-"+et),mt&&(et="Cmd-"+et),ht&&(et="Shift-"+et),et}function mp(et){var rt={};for(var lt in et)if(et.hasOwnProperty(lt)){var at=et[lt];if(/^(name|fallthrough|(de|at)tach)$/.test(lt))continue;if(at=="..."){delete et[lt];continue}for(var ht=ve(lt.split(" "),vp),mt=0;mt<ht.length;mt++){var kt=void 0,Lt=void 0;mt==ht.length-1?(Lt=ht.join(" "),kt=at):(Lt=ht.slice(0,mt+1).join(" "),kt="...");var Nt=rt[Lt];if(!Nt)rt[Lt]=kt;else if(Nt!=kt)throw new Error("Inconsistent bindings for "+Lt)}delete et[lt]}for(var jt in rt)et[jt]=rt[jt];return et}function ml(et,rt,lt,at){rt=zh(rt);var ht=rt.call?rt.call(et,at):rt[et];if(ht===!1)return"nothing";if(ht==="...")return"multi";if(ht!=null&<(ht))return"handled";if(rt.fallthrough){if(Object.prototype.toString.call(rt.fallthrough)!="[object Array]")return ml(et,rt.fallthrough,lt,at);for(var mt=0;mt<rt.fallthrough.length;mt++){var kt=ml(et,rt.fallthrough[mt],lt,at);if(kt)return kt}}}function kc(et){var rt=typeof et=="string"?et:ou[et.keyCode];return rt=="Ctrl"||rt=="Alt"||rt=="Shift"||rt=="Mod"}function yp(et,rt,lt){var at=et;return rt.altKey&&at!="Alt"&&(et="Alt-"+et),(Yt?rt.metaKey:rt.ctrlKey)&&at!="Ctrl"&&(et="Ctrl-"+et),(Yt?rt.ctrlKey:rt.metaKey)&&at!="Mod"&&(et="Cmd-"+et),!lt&&rt.shiftKey&&at!="Shift"&&(et="Shift-"+et),et}function $g(et,rt){if(Dt&&et.keyCode==34&&et.char)return!1;var lt=ou[et.keyCode];return lt==null||et.altGraphKey?!1:(et.keyCode==3&&et.code&&(lt=et.code),yp(lt,et,rt))}function zh(et){return typeof et=="string"?za[et]:et}function _a(et,rt){for(var lt=et.doc.sel.ranges,at=[],ht=0;ht<lt.length;ht++){for(var mt=rt(lt[ht]);at.length&&Ti(mt.from,ee(at).to)<=0;){var kt=at.pop();if(Ti(kt.from,mt.from)<0){mt.from=kt.from;break}}at.push(mt)}co(et,function(){for(var Lt=at.length-1;Lt>=0;Lt--)Ih(et.doc,"",at[Lt].from,at[Lt].to,"+delete");Cu(et)})}function xp(et,rt,lt){var at=Ri(et.text,rt+lt,lt);return at<0||at>et.text.length?null:at}function hs(et,rt,lt){var at=xp(et,rt.ch,lt);return at==null?null:new Oe(rt.line,at,lt<0?"after":"before")}function pf(et,rt,lt,at,ht){if(et){rt.doc.direction=="rtl"&&(ht=-ht);var mt=At(lt,rt.doc.direction);if(mt){var kt=ht<0?ee(mt):mt[0],Lt=ht<0==(kt.level==1),Nt=Lt?"after":"before",jt;if(kt.level>0||rt.doc.direction=="rtl"){var Ee=fl(rt,lt);jt=ht<0?lt.text.length-1:0;var Kt=Ca(rt,Ee,jt).top;jt=Pi(function(ri){return Ca(rt,Ee,ri).top==Kt},ht<0==(kt.level==1)?kt.from:kt.to-1,jt),Nt=="before"&&(jt=xp(lt,jt,1))}else jt=ht<0?kt.to:kt.from;return new Oe(at,jt,Nt)}}return new Oe(at,ht<0?lt.text.length:0,ht<0?"before":"after")}function nd(et,rt,lt,at){var ht=At(rt,et.doc.direction);if(!ht)return hs(rt,lt,at);lt.ch>=rt.text.length?(lt.ch=rt.text.length,lt.sticky="before"):lt.ch<=0&&(lt.ch=0,lt.sticky="after");var mt=ft(ht,lt.ch,lt.sticky),kt=ht[mt];if(et.doc.direction=="ltr"&&kt.level%2==0&&(at>0?kt.to>lt.ch:kt.from<lt.ch))return hs(rt,lt,at);var Lt=function(Dn,tr){return xp(rt,Dn instanceof Oe?Dn.ch:Dn,tr)},Nt,jt=function(Dn){return et.options.lineWrapping?(Nt=Nt||fl(et,rt),qo(et,rt,Nt,Dn)):{begin:0,end:rt.text.length}},Ee=jt(lt.sticky=="before"?Lt(lt,-1):lt.ch);if(et.doc.direction=="rtl"||kt.level==1){var Kt=kt.level==1==at<0,ri=Lt(lt,Kt?1:-1);if(ri!=null&&(Kt?ri<=kt.to&&ri<=Ee.end:ri>=kt.from&&ri>=Ee.begin)){var Qe=Kt?"before":"after";return new Oe(lt.line,ri,Qe)}}var Yi=function(Dn,tr,Wn){for(var lr=function(Ho,ks){return ks?new Oe(lt.line,Lt(Ho,1),"before"):new Oe(lt.line,Ho,"after")};Dn>=0&&Dn<ht.length;Dn+=tr){var Pr=ht[Dn],_n=tr>0==(Pr.level!=1),Zr=_n?Wn.begin:Lt(Wn.end,-1);if(Pr.from<=Zr&&Zr<Pr.to||(Zr=_n?Pr.from:Lt(Pr.to,-1),Wn.begin<=Zr&&Zr<Wn.end))return lr(Zr,_n)}},$i=Yi(mt+at,at,Ee);if($i)return $i;var dn=at>0?Ee.end:Lt(Ee.begin,-1);return dn!=null&&!(at>0&&dn==rt.text.length)&&($i=Yi(at>0?0:ht.length-1,at,jt(dn)),$i)?$i:null}var eh={selectAll:us,singleSelection:function(et){return et.setSelection(et.getCursor("anchor"),et.getCursor("head"),oe)},killLine:function(et){return _a(et,function(rt){if(rt.empty()){var lt=mi(et.doc,rt.head.line).text.length;return rt.head.ch==lt&&rt.head.line<et.lastLine()?{from:rt.head,to:Oe(rt.head.line+1,0)}:{from:rt.head,to:Oe(rt.head.line,lt)}}else return{from:rt.from(),to:rt.to()}})},deleteLine:function(et){return _a(et,function(rt){return{from:Oe(rt.from().line,0),to:Xi(et.doc,Oe(rt.to().line+1,0))}})},delLineLeft:function(et){return _a(et,function(rt){return{from:Oe(rt.from().line,0),to:rt.from()}})},delWrappedLineLeft:function(et){return _a(et,function(rt){var lt=et.charCoords(rt.head,"div").top+5,at=et.coordsChar({left:0,top:lt},"div");return{from:at,to:rt.from()}})},delWrappedLineRight:function(et){return _a(et,function(rt){var lt=et.charCoords(rt.head,"div").top+5,at=et.coordsChar({left:et.display.lineDiv.offsetWidth+100,top:lt},"div");return{from:rt.from(),to:at}})},undo:function(et){return et.undo()},redo:function(et){return et.redo()},undoSelection:function(et){return et.undoSelection()},redoSelection:function(et){return et.redoSelection()},goDocStart:function(et){return et.extendSelection(Oe(et.firstLine(),0))},goDocEnd:function(et){return et.extendSelection(Oe(et.lastLine()))},goLineStart:function(et){return et.extendSelectionsBy(function(rt){return Mc(et,rt.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(et){return et.extendSelectionsBy(function(rt){return wp(et,rt.head)},{origin:"+move",bias:1})},goLineEnd:function(et){return et.extendSelectionsBy(function(rt){return Ec(et,rt.head.line)},{origin:"+move",bias:-1})},goLineRight:function(et){return et.extendSelectionsBy(function(rt){var lt=et.cursorCoords(rt.head,"div").top+5;return et.coordsChar({left:et.display.lineDiv.offsetWidth+100,top:lt},"div")},Ze)},goLineLeft:function(et){return et.extendSelectionsBy(function(rt){var lt=et.cursorCoords(rt.head,"div").top+5;return et.coordsChar({left:0,top:lt},"div")},Ze)},goLineLeftSmart:function(et){return et.extendSelectionsBy(function(rt){var lt=et.cursorCoords(rt.head,"div").top+5,at=et.coordsChar({left:0,top:lt},"div");return at.ch<et.getLine(at.line).search(/\S/)?wp(et,rt.head):at},Ze)},goLineUp:function(et){return et.moveV(-1,"line")},goLineDown:function(et){return et.moveV(1,"line")},goPageUp:function(et){return et.moveV(-1,"page")},goPageDown:function(et){return et.moveV(1,"page")},goCharLeft:function(et){return et.moveH(-1,"char")},goCharRight:function(et){return et.moveH(1,"char")},goColumnLeft:function(et){return et.moveH(-1,"column")},goColumnRight:function(et){return et.moveH(1,"column")},goWordLeft:function(et){return et.moveH(-1,"word")},goGroupRight:function(et){return et.moveH(1,"group")},goGroupLeft:function(et){return et.moveH(-1,"group")},goWordRight:function(et){return et.moveH(1,"word")},delCharBefore:function(et){return et.deleteH(-1,"codepoint")},delCharAfter:function(et){return et.deleteH(1,"char")},delWordBefore:function(et){return et.deleteH(-1,"word")},delWordAfter:function(et){return et.deleteH(1,"word")},delGroupBefore:function(et){return et.deleteH(-1,"group")},delGroupAfter:function(et){return et.deleteH(1,"group")},indentAuto:function(et){return et.indentSelection("smart")},indentMore:function(et){return et.indentSelection("add")},indentLess:function(et){return et.indentSelection("subtract")},insertTab:function(et){return et.replaceSelection(" ")},insertSoftTab:function(et){for(var rt=[],lt=et.listSelections(),at=et.options.tabSize,ht=0;ht<lt.length;ht++){var mt=lt[ht].from(),kt=Bt(et.getLine(mt.line),mt.ch,at);rt.push(ie(at-kt%at))}et.replaceSelections(rt)},defaultTab:function(et){et.somethingSelected()?et.indentSelection("add"):et.execCommand("insertTab")},transposeChars:function(et){return co(et,function(){for(var rt=et.listSelections(),lt=[],at=0;at<rt.length;at++)if(rt[at].empty()){var ht=rt[at].head,mt=mi(et.doc,ht.line).text;if(mt){if(ht.ch==mt.length&&(ht=new Oe(ht.line,ht.ch-1)),ht.ch>0)ht=new Oe(ht.line,ht.ch+1),et.replaceRange(mt.charAt(ht.ch-1)+mt.charAt(ht.ch-2),Oe(ht.line,ht.ch-2),ht,"+transpose");else if(ht.line>et.doc.first){var kt=mi(et.doc,ht.line-1).text;kt&&(ht=new Oe(ht.line,1),et.replaceRange(mt.charAt(0)+et.doc.lineSeparator()+kt.charAt(kt.length-1),Oe(ht.line-1,kt.length-1),ht,"+transpose"))}}lt.push(new So(ht,ht))}et.setSelections(lt)})},newlineAndIndent:function(et){return co(et,function(){for(var rt=et.listSelections(),lt=rt.length-1;lt>=0;lt--)et.replaceRange(et.doc.lineSeparator(),rt[lt].anchor,rt[lt].head,"+input");rt=et.listSelections();for(var at=0;at<rt.length;at++)et.indentLine(rt[at].from().line,null,!0);Cu(et)})},openLine:function(et){return et.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(et){return et.toggleOverwrite()}};function Mc(et,rt){var lt=mi(et.doc,rt),at=Gi(lt);return at!=lt&&(rt=It(at)),pf(!0,et,at,rt,1)}function Ec(et,rt){var lt=mi(et.doc,rt),at=mn(lt);return at!=lt&&(rt=It(at)),pf(!0,et,lt,rt,-1)}function wp(et,rt){var lt=Mc(et,rt.line),at=mi(et.doc,lt.line),ht=At(at,et.doc.direction);if(!ht||ht[0].level==0){var mt=Math.max(lt.ch,at.text.search(/\S/)),kt=rt.line==lt.line&&rt.ch<=mt&&rt.ch;return Oe(lt.line,kt?0:mt,lt.sticky)}return lt}function bc(et,rt,lt){if(typeof rt=="string"&&(rt=eh[rt],!rt))return!1;et.display.input.ensurePolled();var at=et.display.shift,ht=!1;try{et.isReadOnly()&&(et.state.suppressEdits=!0),lt&&(et.display.shift=!1),ht=rt(et)!=Ye}finally{et.display.shift=at,et.state.suppressEdits=!1}return ht}function Sp(et,rt,lt){for(var at=0;at<et.state.keyMaps.length;at++){var ht=ml(rt,et.state.keyMaps[at],lt,et);if(ht)return ht}return et.options.extraKeys&&ml(rt,et.options.extraKeys,lt,et)||ml(rt,et.options.keyMap,lt,et)}var su=new bt;function _h(et,rt,lt,at){var ht=et.state.keySeq;if(ht){if(kc(rt))return"handled";if(/\'$/.test(rt)?et.state.keySeq=null:su.set(50,function(){et.state.keySeq==ht&&(et.state.keySeq=null,et.display.input.reset())}),rd(et,ht+" "+rt,lt,at))return!0}return rd(et,rt,lt,at)}function rd(et,rt,lt,at){var ht=Sp(et,rt,at);return ht=="multi"&&(et.state.keySeq=rt),ht=="handled"&&jn(et,"keyHandled",et,rt,lt),(ht=="handled"||ht=="multi")&&(Qi(lt),xo(et)),!!ht}function od(et,rt){var lt=$g(rt,!0);return lt?rt.shiftKey&&!et.state.keySeq?_h(et,"Shift-"+lt,rt,function(at){return bc(et,at,!0)})||_h(et,lt,rt,function(at){if(typeof at=="string"?/^go[A-Z]/.test(at):at.motion)return bc(et,at)}):_h(et,lt,rt,function(at){return bc(et,at)}):!1}function sd(et,rt,lt){return _h(et,"'"+lt+"'",rt,function(at){return bc(et,at,!0)})}var Hh=null;function Cp(et){var rt=this;if(!(et.target&&et.target!=rt.display.input.getField())&&(rt.curOp.focus=ye(),!xe(rt,et))){Ut&&fe<11&&et.keyCode==27&&(et.returnValue=!1);var lt=et.keyCode;rt.display.shift=lt==16||et.shiftKey;var at=od(rt,et);Dt&&(Hh=at?lt:null,!at&<==88&&!Mi&&(Jt?et.metaKey:et.ctrlKey)&&rt.replaceSelection("",null,"cut")),pt&&!Jt&&!at&<==46&&et.shiftKey&&!et.ctrlKey&&document.execCommand&&document.execCommand("cut"),lt==18&&!/\bCodeMirror-crosshair\b/.test(rt.display.lineDiv.className)&&kp(rt)}}function kp(et){var rt=et.display.lineDiv;Ie(rt,"CodeMirror-crosshair");function lt(at){(at.keyCode==18||!at.altKey)&&(Xt(rt,"CodeMirror-crosshair"),ui(document,"keyup",lt),ui(document,"mouseover",lt))}te(document,"keyup",lt),te(document,"mouseover",lt)}function Mp(et){et.keyCode==16&&(this.doc.sel.shift=!1),xe(this,et)}function Kl(et){var rt=this;if(!(et.target&&et.target!=rt.display.input.getField())&&!($o(rt.display,et)||xe(rt,et)||et.ctrlKey&&!et.altKey||Jt&&et.metaKey)){var lt=et.keyCode,at=et.charCode;if(Dt&<==Hh){Hh=null,Qi(et);return}if(!(Dt&&(!et.which||et.which<10)&&od(rt,et))){var ht=String.fromCharCode(at==null?lt:at);ht!="\b"&&(sd(rt,et,ht)||rt.display.input.onKeyPress(et))}}}var qg=400,Ep=function(et,rt,lt){this.time=et,this.pos=rt,this.button=lt};Ep.prototype.compare=function(et,rt,lt){return this.time+qg>et&&Ti(rt,this.pos)==0&<==this.button};var Pc,Wh;function bp(et,rt){var lt=+new Date;return Wh&&Wh.compare(lt,et,rt)?(Pc=Wh=null,"triple"):Pc&&Pc.compare(lt,et,rt)?(Wh=new Ep(lt,et,rt),Pc=null,"double"):(Pc=new Ep(lt,et,rt),Wh=null,"single")}function Vl(et){var rt=this,lt=rt.display;if(!(xe(rt,et)||lt.activeTouch&<.input.supportsTouch())){if(lt.input.ensurePolled(),lt.shift=et.shiftKey,$o(lt,et)){$t||(lt.scroller.draggable=!1,setTimeout(function(){return lt.scroller.draggable=!0},100));return}if(!ud(rt,et)){var at=fa(rt,et),ht=ir(et),mt=at?bp(at,ht):"single";window.focus(),ht==1&&rt.state.selectingText&&rt.state.selectingText(et),!(at&&Pp(rt,ht,at,mt,et))&&(ht==1?at?tv(rt,at,mt,et):er(et)==lt.scroller&&Qi(et):ht==2?(at&&qf(rt.doc,at),setTimeout(function(){return lt.input.focus()},20)):ht==3&&(Vt?rt.display.input.onContextMenu(et):Ko(rt)))}}}function Pp(et,rt,lt,at,ht){var mt="Click";return at=="double"?mt="Double"+mt:at=="triple"&&(mt="Triple"+mt),mt=(rt==1?"Left":rt==2?"Middle":"Right")+mt,_h(et,yp(mt,ht),ht,function(kt){if(typeof kt=="string"&&(kt=eh[kt]),!kt)return!1;var Lt=!1;try{et.isReadOnly()&&(et.state.suppressEdits=!0),Lt=kt(et,lt)!=Ye}finally{et.state.suppressEdits=!1}return Lt})}function ad(et,rt,lt){var at=et.getOption("configureMouse"),ht=at?at(et,rt,lt):{};if(ht.unit==null){var mt=Pe?lt.shiftKey&<.metaKey:lt.altKey;ht.unit=mt?"rectangle":rt=="single"?"char":rt=="double"?"word":"line"}return(ht.extend==null||et.doc.extend)&&(ht.extend=et.doc.extend||lt.shiftKey),ht.addNew==null&&(ht.addNew=Jt?lt.metaKey:lt.ctrlKey),ht.moveOnDrag==null&&(ht.moveOnDrag=!(Jt?lt.altKey:lt.ctrlKey)),ht}function tv(et,rt,lt,at){Ut?setTimeout(gi(Ao,et),0):et.curOp.focus=ye();var ht=ad(et,lt,at),mt=et.doc.sel,kt;et.options.dragDrop&&fr&&!et.isReadOnly()&<=="single"&&(kt=mt.contains(rt))>-1&&(Ti((kt=mt.ranges[kt]).from(),rt)<0||rt.xRel>0)&&(Ti(kt.to(),rt)>0||rt.xRel<0)?Np(et,at,rt,ht):i0(et,at,rt,ht)}function Np(et,rt,lt,at){var ht=et.display,mt=!1,kt=Ss(et,function(jt){$t&&(ht.scroller.draggable=!1),et.state.draggingText=!1,ui(ht.wrapper.ownerDocument,"mouseup",kt),ui(ht.wrapper.ownerDocument,"mousemove",Lt),ui(ht.scroller,"dragstart",Nt),ui(ht.scroller,"drop",kt),mt||(Qi(jt),at.addNew||qf(et.doc,lt,null,null,at.extend),$t&&!de||Ut&&fe==9?setTimeout(function(){ht.wrapper.ownerDocument.body.focus({preventScroll:!0}),ht.input.focus()},20):ht.input.focus())}),Lt=function(jt){mt=mt||Math.abs(rt.clientX-jt.clientX)+Math.abs(rt.clientY-jt.clientY)>=10},Nt=function(){return mt=!0};$t&&(ht.scroller.draggable=!0),et.state.draggingText=kt,kt.copy=!at.moveOnDrag,ht.scroller.dragDrop&&ht.scroller.dragDrop(),te(ht.wrapper.ownerDocument,"mouseup",kt),te(ht.wrapper.ownerDocument,"mousemove",Lt),te(ht.scroller,"dragstart",Nt),te(ht.scroller,"drop",kt),Ko(et),setTimeout(function(){return ht.input.focus()},20)}function Tp(et,rt,lt){if(lt=="char")return new So(rt,rt);if(lt=="word")return et.findWordAt(rt);if(lt=="line")return new So(Oe(rt.line,0),Xi(et.doc,Oe(rt.line+1,0)));var at=lt(et,rt);return new So(at.from,at.to)}function i0(et,rt,lt,at){var ht=et.display,mt=et.doc;Qi(rt);var kt,Lt,Nt=mt.sel,jt=Nt.ranges;if(at.addNew&&!at.extend?(Lt=mt.sel.contains(lt),Lt>-1?kt=jt[Lt]:kt=new So(lt,lt)):(kt=mt.sel.primary(),Lt=mt.sel.primIndex),at.unit=="rectangle")at.addNew||(kt=new So(lt,lt)),lt=fa(et,rt,!0,!0),Lt=-1;else{var Ee=Tp(et,lt,at.unit);at.extend?kt=$f(kt,Ee.anchor,Ee.head,at.extend):kt=Ee}at.addNew?Lt==-1?(Lt=jt.length,na(mt,Tl(et,jt.concat([kt]),Lt),{scroll:!1,origin:"*mouse"})):jt.length>1&&jt[Lt].empty()&&at.unit=="char"&&!at.extend?(na(mt,Tl(et,jt.slice(0,Lt).concat(jt.slice(Lt+1)),0),{scroll:!1,origin:"*mouse"}),Nt=mt.sel):qu(mt,Lt,kt,Ve):(Lt=0,na(mt,new gl([kt],0),Ve),Nt=mt.sel);var Kt=lt;function ri(Wn){if(Ti(Kt,Wn)!=0)if(Kt=Wn,at.unit=="rectangle"){for(var lr=[],Pr=et.options.tabSize,_n=Bt(mi(mt,lt.line).text,lt.ch,Pr),Zr=Bt(mi(mt,Wn.line).text,Wn.ch,Pr),Ho=Math.min(_n,Zr),ks=Math.max(_n,Zr),Xo=Math.min(lt.line,Wn.line),Na=Math.min(et.lastLine(),Math.max(lt.line,Wn.line));Xo<=Na;Xo++){var ra=mi(mt,Xo).text,ms=Ni(ra,Ho,Pr);Ho==ks?lr.push(new So(Oe(Xo,ms),Oe(Xo,ms))):ra.length>ms&&lr.push(new So(Oe(Xo,ms),Oe(Xo,Ni(ra,ks,Pr))))}lr.length||lr.push(new So(lt,lt)),na(mt,Tl(et,Nt.ranges.slice(0,Lt).concat(lr),Lt),{origin:"*mouse",scroll:!1}),et.scrollIntoView(Wn)}else{var Ha=kt,Ys=Tp(et,Wn,at.unit),ys=Ha.anchor,uo;Ti(Ys.anchor,ys)>0?(uo=Ys.head,ys=ii(Ha.from(),Ys.anchor)):(uo=Ys.anchor,ys=yn(Ha.to(),Ys.head));var es=Nt.ranges.slice(0);es[Lt]=ev(et,new So(Xi(mt,ys),uo)),na(mt,Tl(et,es,Lt),Ve)}}var Qe=ht.wrapper.getBoundingClientRect(),Yi=0;function $i(Wn){var lr=++Yi,Pr=fa(et,Wn,!0,at.unit=="rectangle");if(Pr)if(Ti(Pr,Kt)!=0){et.curOp.focus=ye(),ri(Pr);var _n=Ur(ht,mt);(Pr.line>=_n.to||Pr.line<_n.from)&&setTimeout(Ss(et,function(){Yi==lr&&$i(Wn)}),150)}else{var Zr=Wn.clientY<Qe.top?-20:Wn.clientY>Qe.bottom?20:0;Zr&&setTimeout(Ss(et,function(){Yi==lr&&(ht.scroller.scrollTop+=Zr,$i(Wn))}),50)}}function dn(Wn){et.state.selectingText=!1,Yi=1/0,Wn&&(Qi(Wn),ht.input.focus()),ui(ht.wrapper.ownerDocument,"mousemove",Dn),ui(ht.wrapper.ownerDocument,"mouseup",tr),mt.history.lastSelOrigin=null}var Dn=Ss(et,function(Wn){Wn.buttons===0||!ir(Wn)?dn(Wn):$i(Wn)}),tr=Ss(et,dn);et.state.selectingText=tr,te(ht.wrapper.ownerDocument,"mousemove",Dn),te(ht.wrapper.ownerDocument,"mouseup",tr)}function ev(et,rt){var lt=rt.anchor,at=rt.head,ht=mi(et.doc,lt.line);if(Ti(lt,at)==0&<.sticky==at.sticky)return rt;var mt=At(ht);if(!mt)return rt;var kt=ft(mt,lt.ch,lt.sticky),Lt=mt[kt];if(Lt.from!=lt.ch&&Lt.to!=lt.ch)return rt;var Nt=kt+(Lt.from==lt.ch==(Lt.level!=1)?0:1);if(Nt==0||Nt==mt.length)return rt;var jt;if(at.line!=lt.line)jt=(at.line-lt.line)*(et.doc.direction=="ltr"?1:-1)>0;else{var Ee=ft(mt,at.ch,at.sticky),Kt=Ee-kt||(at.ch-lt.ch)*(Lt.level==1?-1:1);Ee==Nt-1||Ee==Nt?jt=Kt<0:jt=Kt>0}var ri=mt[Nt+(jt?-1:0)],Qe=jt==(ri.level==1),Yi=Qe?ri.from:ri.to,$i=Qe?"after":"before";return lt.ch==Yi&<.sticky==$i?rt:new So(new Oe(lt.line,Yi,$i),at)}function ld(et,rt,lt,at){var ht,mt;if(rt.touches)ht=rt.touches[0].clientX,mt=rt.touches[0].clientY;else try{ht=rt.clientX,mt=rt.clientY}catch(ri){return!1}if(ht>=Math.floor(et.display.gutters.getBoundingClientRect().right))return!1;at&&Qi(rt);var kt=et.display,Lt=kt.lineDiv.getBoundingClientRect();if(mt>Lt.bottom||!Si(et,lt))return _i(rt);mt-=Lt.top-kt.viewOffset;for(var Nt=0;Nt<et.display.gutterSpecs.length;++Nt){var jt=kt.gutters.childNodes[Nt];if(jt&&jt.getBoundingClientRect().right>=ht){var Ee=se(et.doc,mt),Kt=et.display.gutterSpecs[Nt];return qe(et,lt,et,Ee,Kt.className,rt),_i(rt)}}}function ud(et,rt){return ld(et,rt,"gutterClick",!0)}function hd(et,rt){$o(et.display,rt)||iv(et,rt)||xe(et,rt,"contextmenu")||Vt||et.display.input.onContextMenu(rt)}function iv(et,rt){return Si(et,"gutterContextMenu")?ld(et,rt,"gutterContextMenu",!1):!1}function cd(et){et.display.wrapper.className=et.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+et.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Hr(et)}var ih={toString:function(){return"CodeMirror.Init"}},Lp={},gf={};function nv(et){var rt=et.optionHandlers;function lt(at,ht,mt,kt){et.defaults[at]=ht,mt&&(rt[at]=kt?function(Lt,Nt,jt){jt!=ih&&mt(Lt,Nt,jt)}:mt)}et.defineOption=lt,et.Init=ih,lt("value","",function(at,ht){return at.setValue(ht)},!0),lt("mode",null,function(at,ht){at.doc.modeOption=ht,Wr(at)},!0),lt("indentUnit",2,Wr,!0),lt("indentWithTabs",!1),lt("smartIndent",!0),lt("tabSize",4,function(at){tf(at),Hr(at),_o(at)},!0),lt("lineSeparator",null,function(at,ht){if(at.doc.lineSep=ht,!!ht){var mt=[],kt=at.doc.first;at.doc.iter(function(Nt){for(var jt=0;;){var Ee=Nt.text.indexOf(ht,jt);if(Ee==-1)break;jt=Ee+ht.length,mt.push(Oe(kt,Ee))}kt++});for(var Lt=mt.length-1;Lt>=0;Lt--)Ih(at.doc,ht,mt[Lt],Oe(mt[Lt].line,mt[Lt].ch+ht.length))}}),lt("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(at,ht,mt){at.state.specialChars=new RegExp(ht.source+(ht.test(" ")?"":"| "),"g"),mt!=ih&&at.refresh()}),lt("specialCharPlaceholder",Oo,function(at){return at.refresh()},!0),lt("electricChars",!0),lt("inputStyle",Qt?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),lt("spellcheck",!1,function(at,ht){return at.getInputField().spellcheck=ht},!0),lt("autocorrect",!1,function(at,ht){return at.getInputField().autocorrect=ht},!0),lt("autocapitalize",!1,function(at,ht){return at.getInputField().autocapitalize=ht},!0),lt("rtlMoveVisually",!je),lt("wholeLineUpdateBefore",!0),lt("theme","default",function(at){cd(at),qa(at)},!0),lt("keyMap","default",function(at,ht,mt){var kt=zh(ht),Lt=mt!=ih&&zh(mt);Lt&&Lt.detach&&Lt.detach(at,kt),kt.attach&&kt.attach(at,Lt||null)}),lt("extraKeys",null),lt("configureMouse",null),lt("lineWrapping",!1,rv,!0),lt("gutters",[],function(at,ht){at.display.gutterSpecs=Ds(ht,at.options.lineNumbers),qa(at)},!0),lt("fixedGutter",!0,function(at,ht){at.display.gutters.style.left=ht?Jc(at.display)+"px":"0",at.refresh()},!0),lt("coverGutterNextToScrollbar",!1,function(at){return Zu(at)},!0),lt("scrollbarStyle","native",function(at){np(at),Zu(at),at.display.scrollbars.setScrollTop(at.doc.scrollTop),at.display.scrollbars.setScrollLeft(at.doc.scrollLeft)},!0),lt("lineNumbers",!1,function(at,ht){at.display.gutterSpecs=Ds(at.options.gutters,ht),qa(at)},!0),lt("firstLineNumber",1,qa,!0),lt("lineNumberFormatter",function(at){return at},qa,!0),lt("showCursorWhenSelecting",!1,ws,!0),lt("resetSelectionOnContextMenu",!0),lt("lineWiseCopyCut",!0),lt("pasteLinesPerSelection",!0),lt("selectionsMayTouch",!1),lt("readOnly",!1,function(at,ht){ht=="nocursor"&&(Ph(at),at.display.input.blur()),at.display.input.readOnlyChanged(ht)}),lt("screenReaderLabel",null,function(at,ht){ht=ht===""?null:ht,at.display.input.screenReaderLabelChanged(ht)}),lt("disableInput",!1,function(at,ht){ht||at.display.input.reset()},!0),lt("dragDrop",!0,fd),lt("allowDropFileTypes",null),lt("cursorBlinkRate",530),lt("cursorScrollMargin",0),lt("cursorHeight",1,ws,!0),lt("singleCursorHeightPerLine",!0,ws,!0),lt("workTime",100),lt("workDelay",100),lt("flattenSpans",!0,tf,!0),lt("addModeClass",!1,tf,!0),lt("pollInterval",100),lt("undoDepth",200,function(at,ht){return at.doc.history.undoDepth=ht}),lt("historyEventDelay",1250),lt("viewportMargin",10,function(at){return at.refresh()},!0),lt("maxHighlightLength",1e4,tf,!0),lt("moveInputWithCursor",!0,function(at,ht){ht||at.display.input.resetPosition()}),lt("tabindex",null,function(at,ht){return at.display.input.getField().tabIndex=ht||""}),lt("autofocus",null),lt("direction","ltr",function(at,ht){return at.doc.setDirection(ht)},!0),lt("phrases",null)}function fd(et,rt,lt){var at=lt&<!=ih;if(!rt!=!at){var ht=et.display.dragFunctions,mt=rt?te:ui;mt(et.display.scroller,"dragstart",ht.start),mt(et.display.scroller,"dragenter",ht.enter),mt(et.display.scroller,"dragover",ht.over),mt(et.display.scroller,"dragleave",ht.leave),mt(et.display.scroller,"drop",ht.drop)}}function rv(et){et.options.lineWrapping?(Ie(et.display.wrapper,"CodeMirror-wrap"),et.display.sizer.style.minWidth="",et.display.sizerWidth=null):(Xt(et.display.wrapper,"CodeMirror-wrap"),Lr(et)),pr(et),_o(et),Hr(et),setTimeout(function(){return Zu(et)},100)}function lo(et,rt){var lt=this;if(!(this instanceof lo))return new lo(et,rt);this.options=rt=rt?oi(rt):{},oi(Lp,rt,!1);var at=rt.value;typeof at=="string"?at=new Us(at,rt.mode,null,rt.lineSeparator,rt.direction):rt.mode&&(at.modeOption=rt.mode),this.doc=at;var ht=new lo.inputStyles[rt.inputStyle](this),mt=this.display=new Ju(et,at,ht,rt);mt.wrapper.CodeMirror=this,cd(this),rt.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),np(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 bt,keySeq:null,specialChars:null},rt.autofocus&&!Qt&&mt.input.focus(),Ut&&fe<11&&setTimeout(function(){return lt.display.input.reset(!0)},20),Nc(this),el(),Ku(this),this.curOp.forceUpdate=!0,Xf(this,at),rt.autofocus&&!Qt||this.hasFocus()?setTimeout(function(){lt.hasFocus()&&!lt.state.focused&&qr(lt)},20):Ph(this);for(var kt in gf)gf.hasOwnProperty(kt)&&gf[kt](this,rt[kt],ih);ds(this),rt.finishInit&&rt.finishInit(this);for(var Lt=0;Lt<Zh.length;++Lt)Zh[Lt](this);Vu(this),$t&&rt.lineWrapping&&getComputedStyle(mt.lineDiv).textRendering=="optimizelegibility"&&(mt.lineDiv.style.textRendering="auto")}lo.defaults=Lp,lo.optionHandlers=gf;function Nc(et){var rt=et.display;te(rt.scroller,"mousedown",Ss(et,Vl)),Ut&&fe<11?te(rt.scroller,"dblclick",Ss(et,function(Nt){if(!xe(et,Nt)){var jt=fa(et,Nt);if(!(!jt||ud(et,Nt)||$o(et.display,Nt))){Qi(Nt);var Ee=et.findWordAt(jt);qf(et.doc,Ee.anchor,Ee.head)}}})):te(rt.scroller,"dblclick",function(Nt){return xe(et,Nt)||Qi(Nt)}),te(rt.scroller,"contextmenu",function(Nt){return hd(et,Nt)}),te(rt.input.getField(),"contextmenu",function(Nt){rt.scroller.contains(Nt.target)||hd(et,Nt)});var lt,at={end:0};function ht(){rt.activeTouch&&(lt=setTimeout(function(){return rt.activeTouch=null},1e3),at=rt.activeTouch,at.end=+new Date)}function mt(Nt){if(Nt.touches.length!=1)return!1;var jt=Nt.touches[0];return jt.radiusX<=1&&jt.radiusY<=1}function kt(Nt,jt){if(jt.left==null)return!0;var Ee=jt.left-Nt.left,Kt=jt.top-Nt.top;return Ee*Ee+Kt*Kt>20*20}te(rt.scroller,"touchstart",function(Nt){if(!xe(et,Nt)&&!mt(Nt)&&!ud(et,Nt)){rt.input.ensurePolled(),clearTimeout(lt);var jt=+new Date;rt.activeTouch={start:jt,moved:!1,prev:jt-at.end<=300?at:null},Nt.touches.length==1&&(rt.activeTouch.left=Nt.touches[0].pageX,rt.activeTouch.top=Nt.touches[0].pageY)}}),te(rt.scroller,"touchmove",function(){rt.activeTouch&&(rt.activeTouch.moved=!0)}),te(rt.scroller,"touchend",function(Nt){var jt=rt.activeTouch;if(jt&&!$o(rt,Nt)&&jt.left!=null&&!jt.moved&&new Date-jt.start<300){var Ee=et.coordsChar(rt.activeTouch,"page"),Kt;!jt.prev||kt(jt,jt.prev)?Kt=new So(Ee,Ee):!jt.prev.prev||kt(jt,jt.prev.prev)?Kt=et.findWordAt(Ee):Kt=new So(Oe(Ee.line,0),Xi(et.doc,Oe(Ee.line+1,0))),et.setSelection(Kt.anchor,Kt.head),et.focus(),Qi(Nt)}ht()}),te(rt.scroller,"touchcancel",ht),te(rt.scroller,"scroll",function(){rt.scroller.clientHeight&&(Th(et,rt.scroller.scrollTop),ku(et,rt.scroller.scrollLeft,!0),qe(et,"scroll",et))}),te(rt.scroller,"mousewheel",function(Nt){return Fs(et,Nt)}),te(rt.scroller,"DOMMouseScroll",function(Nt){return Fs(et,Nt)}),te(rt.wrapper,"scroll",function(){return rt.wrapper.scrollTop=rt.wrapper.scrollLeft=0}),rt.dragFunctions={enter:function(Nt){xe(et,Nt)||Mn(Nt)},over:function(Nt){xe(et,Nt)||(Xg(et,Nt),Mn(Nt))},start:function(Nt){return Yg(et,Nt)},drop:Ss(et,dp),leave:function(Nt){xe(et,Nt)||Jg(et)}};var Lt=rt.input.getField();te(Lt,"keyup",function(Nt){return Mp.call(et,Nt)}),te(Lt,"keydown",Ss(et,Cp)),te(Lt,"keypress",Ss(et,Kl)),te(Lt,"focus",function(Nt){return qr(et,Nt)}),te(Lt,"blur",function(Nt){return Ph(et,Nt)})}var Zh=[];lo.defineInitHook=function(et){return Zh.push(et)};function Cs(et,rt,lt,at){var ht=et.doc,mt;lt==null&&(lt="add"),lt=="smart"&&(ht.mode.indent?mt=Kr(et,rt).state:lt="prev");var kt=et.options.tabSize,Lt=mi(ht,rt),Nt=Bt(Lt.text,null,kt);Lt.stateAfter&&(Lt.stateAfter=null);var jt=Lt.text.match(/^\s*/)[0],Ee;if(!at&&!/\S/.test(Lt.text))Ee=0,lt="not";else if(lt=="smart"&&(Ee=ht.mode.indent(mt,Lt.text.slice(jt.length),Lt.text),Ee==Ye||Ee>150)){if(!at)return;lt="prev"}lt=="prev"?rt>ht.first?Ee=Bt(mi(ht,rt-1).text,null,kt):Ee=0:lt=="add"?Ee=Nt+et.options.indentUnit:lt=="subtract"?Ee=Nt-et.options.indentUnit:typeof lt=="number"&&(Ee=Nt+lt),Ee=Math.max(0,Ee);var Kt="",ri=0;if(et.options.indentWithTabs)for(var Qe=Math.floor(Ee/kt);Qe;--Qe)ri+=kt,Kt+=" ";if(ri<Ee&&(Kt+=ie(Ee-ri)),Kt!=jt)return Ih(ht,Kt,Oe(rt,0),Oe(rt,jt.length),"+input"),Lt.stateAfter=null,!0;for(var Yi=0;Yi<ht.sel.ranges.length;Yi++){var $i=ht.sel.ranges[Yi];if($i.head.line==rt&&$i.head.ch<jt.length){var dn=Oe(rt,jt.length);qu(ht,Yi,new So(dn,dn));break}}}var Pa=null;function Kh(et){Pa=et}function vf(et,rt,lt,at,ht){var mt=et.doc;et.display.shift=!1,at||(at=mt.sel);var kt=+new Date-200,Lt=ht=="paste"||et.state.pasteIncoming>kt,Nt=yr(rt),jt=null;if(Lt&&at.ranges.length>1)if(Pa&&Pa.text.join(`
|
|
`)==rt){if(at.ranges.length%Pa.text.length==0){jt=[];for(var Ee=0;Ee<Pa.text.length;Ee++)jt.push(mt.splitLines(Pa.text[Ee]))}}else Nt.length==at.ranges.length&&et.options.pasteLinesPerSelection&&(jt=ve(Nt,function(Dn){return[Dn]}));for(var Kt=et.curOp.updateInput,ri=at.ranges.length-1;ri>=0;ri--){var Qe=at.ranges[ri],Yi=Qe.from(),$i=Qe.to();Qe.empty()&&(lt&<>0?Yi=Oe(Yi.line,Yi.ch-lt):et.state.overwrite&&!Lt?$i=Oe($i.line,Math.min(mi(mt,$i.line).text.length,$i.ch+ee(Nt).length)):Lt&&Pa&&Pa.lineWise&&Pa.text.join(`
|
|
`)==Nt.join(`
|
|
`)&&(Yi=$i=Oe(Yi.line,0)));var dn={from:Yi,to:$i,text:jt?jt[ri%jt.length]:Nt,origin:ht||(Lt?"paste":et.state.cutIncoming>kt?"cut":"+input")};th(et.doc,dn),jn(et,"inputRead",et,dn)}rt&&!Lt&&Dp(et,rt),Cu(et),et.curOp.updateInput<2&&(et.curOp.updateInput=Kt),et.curOp.typing=!0,et.state.pasteIncoming=et.state.cutIncoming=-1}function Ap(et,rt){var lt=et.clipboardData&&et.clipboardData.getData("Text");if(lt)return et.preventDefault(),!rt.isReadOnly()&&!rt.options.disableInput&&co(rt,function(){return vf(rt,lt,0,null,"paste")}),!0}function Dp(et,rt){if(!(!et.options.electricChars||!et.options.smartIndent))for(var lt=et.doc.sel,at=lt.ranges.length-1;at>=0;at--){var ht=lt.ranges[at];if(!(ht.head.ch>100||at&<.ranges[at-1].head.line==ht.head.line)){var mt=et.getModeAt(ht.head),kt=!1;if(mt.electricChars){for(var Lt=0;Lt<mt.electricChars.length;Lt++)if(rt.indexOf(mt.electricChars.charAt(Lt))>-1){kt=Cs(et,ht.head.line,"smart");break}}else mt.electricInput&&mt.electricInput.test(mi(et.doc,ht.head.line).text.slice(0,ht.head.ch))&&(kt=Cs(et,ht.head.line,"smart"));kt&&jn(et,"electricInput",et,ht.head.line)}}}function Fp(et){for(var rt=[],lt=[],at=0;at<et.doc.sel.ranges.length;at++){var ht=et.doc.sel.ranges[at].head.line,mt={anchor:Oe(ht,0),head:Oe(ht+1,0)};lt.push(mt),rt.push(et.getRange(mt.anchor,mt.head))}return{text:rt,ranges:lt}}function Bp(et,rt,lt,at){et.setAttribute("autocorrect",lt?"":"off"),et.setAttribute("autocapitalize",at?"":"off"),et.setAttribute("spellcheck",!!rt)}function Op(){var et=Ce("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),rt=Ce("div",[et],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return $t?et.style.width="1000px":et.setAttribute("wrap","off"),ue&&(et.style.border="1px solid black"),Bp(et),rt}function nh(et){var rt=et.optionHandlers,lt=et.helpers={};et.prototype={constructor:et,focus:function(){window.focus(),this.display.input.focus()},setOption:function(at,ht){var mt=this.options,kt=mt[at];mt[at]==ht&&at!="mode"||(mt[at]=ht,rt.hasOwnProperty(at)&&Ss(this,rt[at])(this,ht,kt),qe(this,"optionChange",this,at))},getOption:function(at){return this.options[at]},getDoc:function(){return this.doc},addKeyMap:function(at,ht){this.state.keyMaps[ht?"push":"unshift"](zh(at))},removeKeyMap:function(at){for(var ht=this.state.keyMaps,mt=0;mt<ht.length;++mt)if(ht[mt]==at||ht[mt].name==at)return ht.splice(mt,1),!0},addOverlay:Ts(function(at,ht){var mt=at.token?at:et.getMode(this.options,at);if(mt.startState)throw new Error("Overlays may not be stateful.");ti(this.state.overlays,{mode:mt,modeSpec:at,opaque:ht&&ht.opaque,priority:ht&&ht.priority||0},function(kt){return kt.priority}),this.state.modeGen++,_o(this)}),removeOverlay:Ts(function(at){for(var ht=this.state.overlays,mt=0;mt<ht.length;++mt){var kt=ht[mt].modeSpec;if(kt==at||typeof at=="string"&&kt.name==at){ht.splice(mt,1),this.state.modeGen++,_o(this);return}}}),indentLine:Ts(function(at,ht,mt){typeof ht!="string"&&typeof ht!="number"&&(ht==null?ht=this.options.smartIndent?"smart":"prev":ht=ht?"add":"subtract"),xi(this.doc,at)&&Cs(this,at,ht,mt)}),indentSelection:Ts(function(at){for(var ht=this.doc.sel.ranges,mt=-1,kt=0;kt<ht.length;kt++){var Lt=ht[kt];if(Lt.empty())Lt.head.line>mt&&(Cs(this,Lt.head.line,at,!0),mt=Lt.head.line,kt==this.doc.sel.primIndex&&Cu(this));else{var Nt=Lt.from(),jt=Lt.to(),Ee=Math.max(mt,Nt.line);mt=Math.min(this.lastLine(),jt.line-(jt.ch?0:1))+1;for(var Kt=Ee;Kt<mt;++Kt)Cs(this,Kt,at);var ri=this.doc.sel.ranges;Nt.ch==0&&ht.length==ri.length&&ri[kt].from().ch>0&&qu(this.doc,kt,new So(Nt,ri[kt].to()),oe)}}}),getTokenAt:function(at,ht){return Ke(this,at,ht)},getLineTokens:function(at,ht){return Ke(this,Oe(at),ht,!0)},getTokenTypeAt:function(at){at=Xi(this.doc,at);var ht=Sr(this,mi(this.doc,at.line)),mt=0,kt=(ht.length-1)/2,Lt=at.ch,Nt;if(Lt==0)Nt=ht[2];else for(;;){var jt=mt+kt>>1;if((jt?ht[jt*2-1]:0)>=Lt)kt=jt;else if(ht[jt*2+1]<Lt)mt=jt+1;else{Nt=ht[jt*2+2];break}}var Ee=Nt?Nt.indexOf("overlay "):-1;return Ee<0?Nt:Ee==0?null:Nt.slice(0,Ee-1)},getModeAt:function(at){var ht=this.doc.mode;return ht.innerMode?et.innerMode(ht,this.getTokenAt(at).state).mode:ht},getHelper:function(at,ht){return this.getHelpers(at,ht)[0]},getHelpers:function(at,ht){var mt=[];if(!lt.hasOwnProperty(ht))return mt;var kt=lt[ht],Lt=this.getModeAt(at);if(typeof Lt[ht]=="string")kt[Lt[ht]]&&mt.push(kt[Lt[ht]]);else if(Lt[ht])for(var Nt=0;Nt<Lt[ht].length;Nt++){var jt=kt[Lt[ht][Nt]];jt&&mt.push(jt)}else Lt.helperType&&kt[Lt.helperType]?mt.push(kt[Lt.helperType]):kt[Lt.name]&&mt.push(kt[Lt.name]);for(var Ee=0;Ee<kt._global.length;Ee++){var Kt=kt._global[Ee];Kt.pred(Lt,this)&&ge(mt,Kt.val)==-1&&mt.push(Kt.val)}return mt},getStateAfter:function(at,ht){var mt=this.doc;return at=Hi(mt,at==null?mt.first+mt.size-1:at),Kr(this,at+1,ht).state},cursorCoords:function(at,ht){var mt,kt=this.doc.sel.primary();return at==null?mt=kt.head:typeof at=="object"?mt=Xi(this.doc,at):mt=at?kt.from():kt.to(),yo(this,mt,ht||"page")},charCoords:function(at,ht){return ka(this,Xi(this.doc,at),ht||"page")},coordsChar:function(at,ht){return at=Qa(this,at,ht||"page"),fs(this,at.left,at.top)},lineAtHeight:function(at,ht){return at=Qa(this,{top:at,left:0},ht||"page").top,se(this.doc,at+this.display.viewOffset)},heightAtLine:function(at,ht,mt){var kt=!1,Lt;if(typeof at=="number"){var Nt=this.doc.first+this.doc.size-1;at<this.doc.first?at=this.doc.first:at>Nt&&(at=Nt,kt=!0),Lt=mi(this.doc,at)}else Lt=at;return Uo(this,Lt,{top:0,left:0},ht||"page",mt||kt).top+(kt?this.doc.height-wr(Lt):0)},defaultTextHeight:function(){return ca(this.display)},defaultCharWidth:function(){return Nl(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(at,ht,mt,kt,Lt){var Nt=this.display;at=yo(this,Xi(this.doc,at));var jt=at.bottom,Ee=at.left;if(ht.style.position="absolute",ht.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(ht),Nt.sizer.appendChild(ht),kt=="over")jt=at.top;else if(kt=="above"||kt=="near"){var Kt=Math.max(Nt.wrapper.clientHeight,this.doc.height),ri=Math.max(Nt.sizer.clientWidth,Nt.lineSpace.clientWidth);(kt=="above"||at.bottom+ht.offsetHeight>Kt)&&at.top>ht.offsetHeight?jt=at.top-ht.offsetHeight:at.bottom+ht.offsetHeight<=Kt&&(jt=at.bottom),Ee+ht.offsetWidth>ri&&(Ee=ri-ht.offsetWidth)}ht.style.top=jt+"px",ht.style.left=ht.style.right="",Lt=="right"?(Ee=Nt.sizer.clientWidth-ht.offsetWidth,ht.style.right="0px"):(Lt=="left"?Ee=0:Lt=="middle"&&(Ee=(Nt.sizer.clientWidth-ht.offsetWidth)/2),ht.style.left=Ee+"px"),mt&&Qc(this,{left:Ee,top:jt,right:Ee+ht.offsetWidth,bottom:jt+ht.offsetHeight})},triggerOnKeyDown:Ts(Cp),triggerOnKeyPress:Ts(Kl),triggerOnKeyUp:Mp,triggerOnMouseDown:Ts(Vl),execCommand:function(at){if(eh.hasOwnProperty(at))return eh[at].call(null,this)},triggerElectric:Ts(function(at){Dp(this,at)}),findPosH:function(at,ht,mt,kt){var Lt=1;ht<0&&(Lt=-1,ht=-ht);for(var Nt=Xi(this.doc,at),jt=0;jt<ht&&(Nt=mf(this.doc,Nt,Lt,mt,kt),!Nt.hitSide);++jt);return Nt},moveH:Ts(function(at,ht){var mt=this;this.extendSelectionsBy(function(kt){return mt.display.shift||mt.doc.extend||kt.empty()?mf(mt.doc,kt.head,at,ht,mt.options.rtlMoveVisually):at<0?kt.from():kt.to()},Ze)}),deleteH:Ts(function(at,ht){var mt=this.doc.sel,kt=this.doc;mt.somethingSelected()?kt.replaceSelection("",null,"+delete"):_a(this,function(Lt){var Nt=mf(kt,Lt.head,at,ht,!1);return at<0?{from:Nt,to:Lt.head}:{from:Lt.head,to:Nt}})}),findPosV:function(at,ht,mt,kt){var Lt=1,Nt=kt;ht<0&&(Lt=-1,ht=-ht);for(var jt=Xi(this.doc,at),Ee=0;Ee<ht;++Ee){var Kt=yo(this,jt,"div");if(Nt==null?Nt=Kt.left:Kt.left=Nt,jt=rh(this,Kt,Lt,mt),jt.hitSide)break}return jt},moveV:Ts(function(at,ht){var mt=this,kt=this.doc,Lt=[],Nt=!this.display.shift&&!kt.extend&&kt.sel.somethingSelected();if(kt.extendSelectionsBy(function(Ee){if(Nt)return at<0?Ee.from():Ee.to();var Kt=yo(mt,Ee.head,"div");Ee.goalColumn!=null&&(Kt.left=Ee.goalColumn),Lt.push(Kt.left);var ri=rh(mt,Kt,at,ht);return ht=="page"&&Ee==kt.sel.primary()&&Zf(mt,ka(mt,ri,"div").top-Kt.top),ri},Ze),Lt.length)for(var jt=0;jt<kt.sel.ranges.length;jt++)kt.sel.ranges[jt].goalColumn=Lt[jt]}),findWordAt:function(at){var ht=this.doc,mt=mi(ht,at.line).text,kt=at.ch,Lt=at.ch;if(mt){var Nt=this.getHelper(at,"wordChars");(at.sticky=="before"||Lt==mt.length)&&kt?--kt:++Lt;for(var jt=mt.charAt(kt),Ee=ei(jt,Nt)?function(Kt){return ei(Kt,Nt)}:/\s/.test(jt)?function(Kt){return/\s/.test(Kt)}:function(Kt){return!/\s/.test(Kt)&&!ei(Kt)};kt>0&&Ee(mt.charAt(kt-1));)--kt;for(;Lt<mt.length&&Ee(mt.charAt(Lt));)++Lt}return new So(Oe(at.line,kt),Oe(at.line,Lt))},toggleOverwrite:function(at){at!=null&&at==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Ie(this.display.cursorDiv,"CodeMirror-overwrite"):Xt(this.display.cursorDiv,"CodeMirror-overwrite"),qe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==ye()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ts(function(at,ht){Nh(this,at,ht)}),getScrollInfo:function(){var at=this.display.scroller;return{left:at.scrollLeft,top:at.scrollTop,height:at.scrollHeight-Ns(this)-this.display.barHeight,width:at.scrollWidth-Ns(this)-this.display.barWidth,clientHeight:cl(this),clientWidth:ia(this)}},scrollIntoView:Ts(function(at,ht){at==null?(at={from:this.doc.sel.primary().head,to:null},ht==null&&(ht=this.options.cursorScrollMargin)):typeof at=="number"?at={from:Oe(at,0),to:null}:at.from==null&&(at={from:at,to:null}),at.to||(at.to=at.from),at.margin=ht||0,at.from.line!=null?to(this,at):Kf(this,at.from,at.to,at.margin)}),setSize:Ts(function(at,ht){var mt=this,kt=function(Nt){return typeof Nt=="number"||/^\d+$/.test(String(Nt))?Nt+"px":Nt};at!=null&&(this.display.wrapper.style.width=kt(at)),ht!=null&&(this.display.wrapper.style.height=kt(ht)),this.options.lineWrapping&&xr(this);var Lt=this.display.viewFrom;this.doc.iter(Lt,this.display.viewTo,function(Nt){if(Nt.widgets){for(var jt=0;jt<Nt.widgets.length;jt++)if(Nt.widgets[jt].noHScroll){_r(mt,Lt,"widget");break}}++Lt}),this.curOp.forceUpdate=!0,qe(this,"refresh",this)}),operation:function(at){return co(this,at)},startOperation:function(){return Ku(this)},endOperation:function(){return Vu(this)},refresh:Ts(function(){var at=this.display.cachedTextHeight;_o(this),this.curOp.forceUpdate=!0,Hr(this),Nh(this,this.doc.scrollLeft,this.doc.scrollTop),Yu(this.display),(at==null||Math.abs(at-ca(this.display))>.5||this.options.lineWrapping)&&pr(this),qe(this,"refresh",this)}),swapDoc:Ts(function(at){var ht=this.doc;return ht.cm=null,this.state.selectingText&&this.state.selectingText(),Xf(this,at),Hr(this),this.display.input.reset(),Nh(this,at.scrollLeft,at.scrollTop),this.curOp.forceScroll=!0,jn(this,"swapDoc",this,ht),ht}),phrase:function(at){var ht=this.options.phrases;return ht&&Object.prototype.hasOwnProperty.call(ht,at)?ht[at]:at},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}},Oi(et),et.registerHelper=function(at,ht,mt){lt.hasOwnProperty(at)||(lt[at]=et[at]={_global:[]}),lt[at][ht]=mt},et.registerGlobalHelper=function(at,ht,mt,kt){et.registerHelper(at,ht,kt),lt[at]._global.push({pred:mt,val:kt})}}function mf(et,rt,lt,at,ht){var mt=rt,kt=lt,Lt=mi(et,rt.line),Nt=ht&&et.direction=="rtl"?-lt:lt;function jt(){var tr=rt.line+Nt;return tr<et.first||tr>=et.first+et.size?!1:(rt=new Oe(tr,rt.ch,rt.sticky),Lt=mi(et,tr))}function Ee(tr){var Wn;if(at=="codepoint"){var lr=Lt.text.charCodeAt(rt.ch+(at>0?0:-1));isNaN(lr)?Wn=null:Wn=new Oe(rt.line,Math.max(0,Math.min(Lt.text.length,rt.ch+lt*(lr>=55296&&lr<56320?2:1))),-lt)}else ht?Wn=nd(et.cm,Lt,rt,lt):Wn=hs(Lt,rt,lt);if(Wn==null)if(!tr&&jt())rt=pf(ht,et.cm,Lt,rt.line,Nt);else return!1;else rt=Wn;return!0}if(at=="char"||at=="codepoint")Ee();else if(at=="column")Ee(!0);else if(at=="word"||at=="group")for(var Kt=null,ri=at=="group",Qe=et.cm&&et.cm.getHelper(rt,"wordChars"),Yi=!0;!(lt<0&&!Ee(!Yi));Yi=!1){var $i=Lt.text.charAt(rt.ch)||`
|
|
`,dn=ei($i,Qe)?"w":ri&&$i==`
|
|
`?"n":!ri||/\s/.test($i)?null:"p";if(ri&&!Yi&&!dn&&(dn="s"),Kt&&Kt!=dn){lt<0&&(lt=1,Ee(),rt.sticky="after");break}if(dn&&(Kt=dn),lt>0&&!Ee(!Yi))break}var Dn=lf(et,rt,mt,kt,!0);return rn(mt,Dn)&&(Dn.hitSide=!0),Dn}function rh(et,rt,lt,at){var ht=et.doc,mt=rt.left,kt;if(at=="page"){var Lt=Math.min(et.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Nt=Math.max(Lt-.5*ca(et.display),3);kt=(lt>0?rt.bottom:rt.top)+lt*Nt}else at=="line"&&(kt=lt>0?rt.bottom+3:rt.top-3);for(var jt;jt=fs(et,mt,kt),!!jt.outside;){if(lt<0?kt<=0:kt>=ht.height){jt.hitSide=!0;break}kt+=lt*5}return jt}var Po=function(et){this.cm=et,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new bt,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Po.prototype.init=function(et){var rt=this,lt=this,at=lt.cm,ht=lt.div=et.lineDiv;Bp(ht,at.options.spellcheck,at.options.autocorrect,at.options.autocapitalize);function mt(Lt){for(var Nt=Lt.target;Nt;Nt=Nt.parentNode){if(Nt==ht)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Nt.className))break}return!1}te(ht,"paste",function(Lt){!mt(Lt)||xe(at,Lt)||Ap(Lt,at)||fe<=11&&setTimeout(Ss(at,function(){return rt.updateFromDOM()}),20)}),te(ht,"compositionstart",function(Lt){rt.composing={data:Lt.data,done:!1}}),te(ht,"compositionupdate",function(Lt){rt.composing||(rt.composing={data:Lt.data,done:!1})}),te(ht,"compositionend",function(Lt){rt.composing&&(Lt.data!=rt.composing.data&&rt.readFromDOMSoon(),rt.composing.done=!0)}),te(ht,"touchstart",function(){return lt.forceCompositionEnd()}),te(ht,"input",function(){rt.composing||rt.readFromDOMSoon()});function kt(Lt){if(!(!mt(Lt)||xe(at,Lt))){if(at.somethingSelected())Kh({lineWise:!1,text:at.getSelections()}),Lt.type=="cut"&&at.replaceSelection("",null,"cut");else if(at.options.lineWiseCopyCut){var Nt=Fp(at);Kh({lineWise:!0,text:Nt.text}),Lt.type=="cut"&&at.operation(function(){at.setSelections(Nt.ranges,0,oe),at.replaceSelection("",null,"cut")})}else return;if(Lt.clipboardData){Lt.clipboardData.clearData();var jt=Pa.text.join(`
|
|
`);if(Lt.clipboardData.setData("Text",jt),Lt.clipboardData.getData("Text")==jt){Lt.preventDefault();return}}var Ee=Op(),Kt=Ee.firstChild;at.display.lineSpace.insertBefore(Ee,at.display.lineSpace.firstChild),Kt.value=Pa.text.join(`
|
|
`);var ri=document.activeElement;yi(Kt),setTimeout(function(){at.display.lineSpace.removeChild(Ee),ri.focus(),ri==ht&<.showPrimarySelection()},50)}}te(ht,"copy",kt),te(ht,"cut",kt)},Po.prototype.screenReaderLabelChanged=function(et){et?this.div.setAttribute("aria-label",et):this.div.removeAttribute("aria-label")},Po.prototype.prepareSelection=function(){var et=Hu(this.cm,!1);return et.focus=document.activeElement==this.div,et},Po.prototype.showSelection=function(et,rt){!et||!this.cm.display.view.length||((et.focus||rt)&&this.showPrimarySelection(),this.showMultipleSelections(et))},Po.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Po.prototype.showPrimarySelection=function(){var et=this.getSelection(),rt=this.cm,lt=rt.doc.sel.primary(),at=lt.from(),ht=lt.to();if(rt.display.viewTo==rt.display.viewFrom||at.line>=rt.display.viewTo||ht.line<rt.display.viewFrom){et.removeAllRanges();return}var mt=yf(rt,et.anchorNode,et.anchorOffset),kt=yf(rt,et.focusNode,et.focusOffset);if(!(mt&&!mt.bad&&kt&&!kt.bad&&Ti(ii(mt,kt),at)==0&&Ti(yn(mt,kt),ht)==0)){var Lt=rt.display.view,Nt=at.line>=rt.display.viewFrom&&dd(rt,at)||{node:Lt[0].measure.map[2],offset:0},jt=ht.line<rt.display.viewTo&&dd(rt,ht);if(!jt){var Ee=Lt[Lt.length-1].measure,Kt=Ee.maps?Ee.maps[Ee.maps.length-1]:Ee.map;jt={node:Kt[Kt.length-1],offset:Kt[Kt.length-2]-Kt[Kt.length-3]}}if(!Nt||!jt){et.removeAllRanges();return}var ri=et.rangeCount&&et.getRangeAt(0),Qe;try{Qe=ne(Nt.node,Nt.offset,jt.offset,jt.node)}catch(Yi){}Qe&&(!pt&&rt.state.focused?(et.collapse(Nt.node,Nt.offset),Qe.collapsed||(et.removeAllRanges(),et.addRange(Qe))):(et.removeAllRanges(),et.addRange(Qe)),ri&&et.anchorNode==null?et.addRange(ri):pt&&this.startGracePeriod()),this.rememberSelection()}},Po.prototype.startGracePeriod=function(){var et=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){et.gracePeriod=!1,et.selectionChanged()&&et.cm.operation(function(){return et.cm.curOp.selectionChanged=!0})},20)},Po.prototype.showMultipleSelections=function(et){Wt(this.cm.display.cursorDiv,et.cursors),Wt(this.cm.display.selectionDiv,et.selection)},Po.prototype.rememberSelection=function(){var et=this.getSelection();this.lastAnchorNode=et.anchorNode,this.lastAnchorOffset=et.anchorOffset,this.lastFocusNode=et.focusNode,this.lastFocusOffset=et.focusOffset},Po.prototype.selectionInEditor=function(){var et=this.getSelection();if(!et.rangeCount)return!1;var rt=et.getRangeAt(0).commonAncestorContainer;return Re(this.div,rt)},Po.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Po.prototype.blur=function(){this.div.blur()},Po.prototype.getField=function(){return this.div},Po.prototype.supportsTouch=function(){return!0},Po.prototype.receivedFocus=function(){var et=this;this.selectionInEditor()?this.pollSelection():co(this.cm,function(){return et.cm.curOp.selectionChanged=!0});function rt(){et.cm.state.focused&&(et.pollSelection(),et.polling.set(et.cm.options.pollInterval,rt))}this.polling.set(this.cm.options.pollInterval,rt)},Po.prototype.selectionChanged=function(){var et=this.getSelection();return et.anchorNode!=this.lastAnchorNode||et.anchorOffset!=this.lastAnchorOffset||et.focusNode!=this.lastFocusNode||et.focusOffset!=this.lastFocusOffset},Po.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var et=this.getSelection(),rt=this.cm;if(qt&&re&&this.cm.display.gutterSpecs.length&&Ip(et.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var lt=yf(rt,et.anchorNode,et.anchorOffset),at=yf(rt,et.focusNode,et.focusOffset);lt&&at&&co(rt,function(){na(rt.doc,Mu(lt,at),oe),(lt.bad||at.bad)&&(rt.curOp.selectionChanged=!0)})}}},Po.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var et=this.cm,rt=et.display,lt=et.doc.sel.primary(),at=lt.from(),ht=lt.to();if(at.ch==0&&at.line>et.firstLine()&&(at=Oe(at.line-1,mi(et.doc,at.line-1).length)),ht.ch==mi(et.doc,ht.line).text.length&&ht.line<et.lastLine()&&(ht=Oe(ht.line+1,0)),at.line<rt.viewFrom||ht.line>rt.viewTo-1)return!1;var mt,kt,Lt;at.line==rt.viewFrom||(mt=$a(et,at.line))==0?(kt=It(rt.view[0].line),Lt=rt.view[0].node):(kt=It(rt.view[mt].line),Lt=rt.view[mt-1].node.nextSibling);var Nt=$a(et,ht.line),jt,Ee;if(Nt==rt.view.length-1?(jt=rt.viewTo-1,Ee=rt.lineDiv.lastChild):(jt=It(rt.view[Nt+1].line)-1,Ee=rt.view[Nt+1].node.previousSibling),!Lt)return!1;for(var Kt=et.doc.splitLines(Lc(et,Lt,Ee,kt,jt)),ri=fn(et.doc,Oe(kt,0),Oe(jt,mi(et.doc,jt).text.length));Kt.length>1&&ri.length>1;)if(ee(Kt)==ee(ri))Kt.pop(),ri.pop(),jt--;else if(Kt[0]==ri[0])Kt.shift(),ri.shift(),kt++;else break;for(var Qe=0,Yi=0,$i=Kt[0],dn=ri[0],Dn=Math.min($i.length,dn.length);Qe<Dn&&$i.charCodeAt(Qe)==dn.charCodeAt(Qe);)++Qe;for(var tr=ee(Kt),Wn=ee(ri),lr=Math.min(tr.length-(Kt.length==1?Qe:0),Wn.length-(ri.length==1?Qe:0));Yi<lr&&tr.charCodeAt(tr.length-Yi-1)==Wn.charCodeAt(Wn.length-Yi-1);)++Yi;if(Kt.length==1&&ri.length==1&&kt==at.line)for(;Qe&&Qe>at.ch&&tr.charCodeAt(tr.length-Yi-1)==Wn.charCodeAt(Wn.length-Yi-1);)Qe--,Yi++;Kt[Kt.length-1]=tr.slice(0,tr.length-Yi).replace(/^\u200b+/,""),Kt[0]=Kt[0].slice(Qe).replace(/\u200b+$/,"");var Pr=Oe(kt,Qe),_n=Oe(jt,ri.length?ee(ri).length-Yi:0);if(Kt.length>1||Kt[0]||Ti(Pr,_n))return Ih(et.doc,Kt,Pr,_n,"+input"),!0},Po.prototype.ensurePolled=function(){this.forceCompositionEnd()},Po.prototype.reset=function(){this.forceCompositionEnd()},Po.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Po.prototype.readFromDOMSoon=function(){var et=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(et.readDOMTimeout=null,et.composing)if(et.composing.done)et.composing=null;else return;et.updateFromDOM()},80))},Po.prototype.updateFromDOM=function(){var et=this;(this.cm.isReadOnly()||!this.pollContent())&&co(this.cm,function(){return _o(et.cm)})},Po.prototype.setUneditable=function(et){et.contentEditable="false"},Po.prototype.onKeyPress=function(et){et.charCode==0||this.composing||(et.preventDefault(),this.cm.isReadOnly()||Ss(this.cm,vf)(this.cm,String.fromCharCode(et.charCode==null?et.keyCode:et.charCode),0))},Po.prototype.readOnlyChanged=function(et){this.div.contentEditable=String(et!="nocursor")},Po.prototype.onContextMenu=function(){},Po.prototype.resetPosition=function(){},Po.prototype.needsContentAttribute=!0;function dd(et,rt){var lt=Ja(et,rt.line);if(!lt||lt.hidden)return null;var at=mi(et.doc,rt.line),ht=_l(lt,at,rt.line),mt=At(at,et.doc.direction),kt="left";if(mt){var Lt=ft(mt,rt.ch);kt=Lt%2?"right":"left"}var Nt=tu(ht.map,rt.ch,kt);return Nt.offset=Nt.collapse=="right"?Nt.end:Nt.start,Nt}function Ip(et){for(var rt=et;rt;rt=rt.parentNode)if(/CodeMirror-gutter-wrapper/.test(rt.className))return!0;return!1}function Tc(et,rt){return rt&&(et.bad=!0),et}function Lc(et,rt,lt,at,ht){var mt="",kt=!1,Lt=et.doc.lineSeparator(),Nt=!1;function jt(Qe){return function(Yi){return Yi.id==Qe}}function Ee(){kt&&(mt+=Lt,Nt&&(mt+=Lt),kt=Nt=!1)}function Kt(Qe){Qe&&(Ee(),mt+=Qe)}function ri(Qe){if(Qe.nodeType==1){var Yi=Qe.getAttribute("cm-text");if(Yi){Kt(Yi);return}var $i=Qe.getAttribute("cm-marker"),dn;if($i){var Dn=et.findMarks(Oe(at,0),Oe(ht+1,0),jt(+$i));Dn.length&&(dn=Dn[0].find(0))&&Kt(fn(et.doc,dn.from,dn.to).join(Lt));return}if(Qe.getAttribute("contenteditable")=="false")return;var tr=/^(pre|div|p|li|table|br)$/i.test(Qe.nodeName);if(!/^br$/i.test(Qe.nodeName)&&Qe.textContent.length==0)return;tr&&Ee();for(var Wn=0;Wn<Qe.childNodes.length;Wn++)ri(Qe.childNodes[Wn]);/^(pre|p)$/i.test(Qe.nodeName)&&(Nt=!0),tr&&(kt=!0)}else Qe.nodeType==3&&Kt(Qe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;ri(rt),rt!=lt;)rt=rt.nextSibling,Nt=!1;return mt}function yf(et,rt,lt){var at;if(rt==et.display.lineDiv){if(at=et.display.lineDiv.childNodes[lt],!at)return Tc(et.clipPos(Oe(et.display.viewTo-1)),!0);rt=null,lt=0}else for(at=rt;;at=at.parentNode){if(!at||at==et.display.lineDiv)return null;if(at.parentNode&&at.parentNode==et.display.lineDiv)break}for(var ht=0;ht<et.display.view.length;ht++){var mt=et.display.view[ht];if(mt.node==at)return ov(mt,rt,lt)}}function ov(et,rt,lt){var at=et.text.firstChild,ht=!1;if(!rt||!Re(at,rt))return Tc(Oe(It(et.line),0),!0);if(rt==at&&(ht=!0,rt=at.childNodes[lt],lt=0,!rt)){var mt=et.rest?ee(et.rest):et.line;return Tc(Oe(It(mt),mt.text.length),ht)}var kt=rt.nodeType==3?rt:null,Lt=rt;for(!kt&&rt.childNodes.length==1&&rt.firstChild.nodeType==3&&(kt=rt.firstChild,lt&&(lt=kt.nodeValue.length));Lt.parentNode!=at;)Lt=Lt.parentNode;var Nt=et.measure,jt=Nt.maps;function Ee(dn,Dn,tr){for(var Wn=-1;Wn<(jt?jt.length:0);Wn++)for(var lr=Wn<0?Nt.map:jt[Wn],Pr=0;Pr<lr.length;Pr+=3){var _n=lr[Pr+2];if(_n==dn||_n==Dn){var Zr=It(Wn<0?et.line:et.rest[Wn]),Ho=lr[Pr]+tr;return(tr<0||_n!=dn)&&(Ho=lr[Pr+(tr?1:0)]),Oe(Zr,Ho)}}}var Kt=Ee(kt,Lt,lt);if(Kt)return Tc(Kt,ht);for(var ri=Lt.nextSibling,Qe=kt?kt.nodeValue.length-lt:0;ri;ri=ri.nextSibling){if(Kt=Ee(ri,ri.firstChild,0),Kt)return Tc(Oe(Kt.line,Kt.ch-Qe),ht);Qe+=ri.textContent.length}for(var Yi=Lt.previousSibling,$i=lt;Yi;Yi=Yi.previousSibling){if(Kt=Ee(Yi,Yi.firstChild,-1),Kt)return Tc(Oe(Kt.line,Kt.ch+$i),ht);$i+=Yi.textContent.length}}var vs=function(et){this.cm=et,this.prevInput="",this.pollingFast=!1,this.polling=new bt,this.hasSelection=!1,this.composing=null};vs.prototype.init=function(et){var rt=this,lt=this,at=this.cm;this.createField(et);var ht=this.textarea;et.wrapper.insertBefore(this.wrapper,et.wrapper.firstChild),ue&&(ht.style.width="0px"),te(ht,"input",function(){Ut&&fe>=9&&rt.hasSelection&&(rt.hasSelection=null),lt.poll()}),te(ht,"paste",function(kt){xe(at,kt)||Ap(kt,at)||(at.state.pasteIncoming=+new Date,lt.fastPoll())});function mt(kt){if(!xe(at,kt)){if(at.somethingSelected())Kh({lineWise:!1,text:at.getSelections()});else if(at.options.lineWiseCopyCut){var Lt=Fp(at);Kh({lineWise:!0,text:Lt.text}),kt.type=="cut"?at.setSelections(Lt.ranges,null,oe):(lt.prevInput="",ht.value=Lt.text.join(`
|
|
`),yi(ht))}else return;kt.type=="cut"&&(at.state.cutIncoming=+new Date)}}te(ht,"cut",mt),te(ht,"copy",mt),te(et.scroller,"paste",function(kt){if(!($o(et,kt)||xe(at,kt))){if(!ht.dispatchEvent){at.state.pasteIncoming=+new Date,lt.focus();return}var Lt=new Event("paste");Lt.clipboardData=kt.clipboardData,ht.dispatchEvent(Lt)}}),te(et.lineSpace,"selectstart",function(kt){$o(et,kt)||Qi(kt)}),te(ht,"compositionstart",function(){var kt=at.getCursor("from");lt.composing&<.composing.range.clear(),lt.composing={start:kt,range:at.markText(kt,at.getCursor("to"),{className:"CodeMirror-composing"})}}),te(ht,"compositionend",function(){lt.composing&&(lt.poll(),lt.composing.range.clear(),lt.composing=null)})},vs.prototype.createField=function(et){this.wrapper=Op(),this.textarea=this.wrapper.firstChild},vs.prototype.screenReaderLabelChanged=function(et){et?this.textarea.setAttribute("aria-label",et):this.textarea.removeAttribute("aria-label")},vs.prototype.prepareSelection=function(){var et=this.cm,rt=et.display,lt=et.doc,at=Hu(et);if(et.options.moveInputWithCursor){var ht=yo(et,lt.sel.primary().head,"div"),mt=rt.wrapper.getBoundingClientRect(),kt=rt.lineDiv.getBoundingClientRect();at.teTop=Math.max(0,Math.min(rt.wrapper.clientHeight-10,ht.top+kt.top-mt.top)),at.teLeft=Math.max(0,Math.min(rt.wrapper.clientWidth-10,ht.left+kt.left-mt.left))}return at},vs.prototype.showSelection=function(et){var rt=this.cm,lt=rt.display;Wt(lt.cursorDiv,et.cursors),Wt(lt.selectionDiv,et.selection),et.teTop!=null&&(this.wrapper.style.top=et.teTop+"px",this.wrapper.style.left=et.teLeft+"px")},vs.prototype.reset=function(et){if(!(this.contextMenuPending||this.composing)){var rt=this.cm;if(rt.somethingSelected()){this.prevInput="";var lt=rt.getSelection();this.textarea.value=lt,rt.state.focused&&yi(this.textarea),Ut&&fe>=9&&(this.hasSelection=lt)}else et||(this.prevInput=this.textarea.value="",Ut&&fe>=9&&(this.hasSelection=null))}},vs.prototype.getField=function(){return this.textarea},vs.prototype.supportsTouch=function(){return!1},vs.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Qt||ye()!=this.textarea))try{this.textarea.focus()}catch(et){}},vs.prototype.blur=function(){this.textarea.blur()},vs.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},vs.prototype.receivedFocus=function(){this.slowPoll()},vs.prototype.slowPoll=function(){var et=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){et.poll(),et.cm.state.focused&&et.slowPoll()})},vs.prototype.fastPoll=function(){var et=!1,rt=this;rt.pollingFast=!0;function lt(){var at=rt.poll();!at&&!et?(et=!0,rt.polling.set(60,lt)):(rt.pollingFast=!1,rt.slowPoll())}rt.polling.set(20,lt)},vs.prototype.poll=function(){var et=this,rt=this.cm,lt=this.textarea,at=this.prevInput;if(this.contextMenuPending||!rt.state.focused||yt(lt)&&!at&&!this.composing||rt.isReadOnly()||rt.options.disableInput||rt.state.keySeq)return!1;var ht=lt.value;if(ht==at&&!rt.somethingSelected())return!1;if(Ut&&fe>=9&&this.hasSelection===ht||Jt&&/[\uf700-\uf7ff]/.test(ht))return rt.display.input.reset(),!1;if(rt.doc.sel==rt.display.selForContextMenu){var mt=ht.charCodeAt(0);if(mt==8203&&!at&&(at="\u200B"),mt==8666)return this.reset(),this.cm.execCommand("undo")}for(var kt=0,Lt=Math.min(at.length,ht.length);kt<Lt&&at.charCodeAt(kt)==ht.charCodeAt(kt);)++kt;return co(rt,function(){vf(rt,ht.slice(kt),at.length-kt,null,et.composing?"*compose":null),ht.length>1e3||ht.indexOf(`
|
|
`)>-1?lt.value=et.prevInput="":et.prevInput=ht,et.composing&&(et.composing.range.clear(),et.composing.range=rt.markText(et.composing.start,rt.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},vs.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},vs.prototype.onKeyPress=function(){Ut&&fe>=9&&(this.hasSelection=null),this.fastPoll()},vs.prototype.onContextMenu=function(et){var rt=this,lt=rt.cm,at=lt.display,ht=rt.textarea;rt.contextMenuPending&&rt.contextMenuPending();var mt=fa(lt,et),kt=at.scroller.scrollTop;if(!mt||Dt)return;var Lt=lt.options.resetSelectionOnContextMenu;Lt&<.doc.sel.contains(mt)==-1&&Ss(lt,na)(lt.doc,Mu(mt),oe);var Nt=ht.style.cssText,jt=rt.wrapper.style.cssText,Ee=rt.wrapper.offsetParent.getBoundingClientRect();rt.wrapper.style.cssText="position: static",ht.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(et.clientY-Ee.top-5)+"px; left: "+(et.clientX-Ee.left-5)+`px;
|
|
z-index: 1000; background: `+(Ut?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Kt;$t&&(Kt=window.scrollY),at.input.focus(),$t&&window.scrollTo(null,Kt),at.input.reset(),lt.somethingSelected()||(ht.value=rt.prevInput=" "),rt.contextMenuPending=Qe,at.selForContextMenu=lt.doc.sel,clearTimeout(at.detectingSelectAll);function ri(){if(ht.selectionStart!=null){var $i=lt.somethingSelected(),dn="\u200B"+($i?ht.value:"");ht.value="\u21DA",ht.value=dn,rt.prevInput=$i?"":"\u200B",ht.selectionStart=1,ht.selectionEnd=dn.length,at.selForContextMenu=lt.doc.sel}}function Qe(){if(rt.contextMenuPending==Qe&&(rt.contextMenuPending=!1,rt.wrapper.style.cssText=jt,ht.style.cssText=Nt,Ut&&fe<9&&at.scrollbars.setScrollTop(at.scroller.scrollTop=kt),ht.selectionStart!=null)){(!Ut||Ut&&fe<9)&&ri();var $i=0,dn=function(){at.selForContextMenu==lt.doc.sel&&ht.selectionStart==0&&ht.selectionEnd>0&&rt.prevInput=="\u200B"?Ss(lt,us)(lt):$i++<10?at.detectingSelectAll=setTimeout(dn,500):(at.selForContextMenu=null,at.input.reset())};at.detectingSelectAll=setTimeout(dn,200)}}if(Ut&&fe>=9&&ri(),Vt){Mn(et);var Yi=function(){ui(window,"mouseup",Yi),setTimeout(Qe,20)};te(window,"mouseup",Yi)}else setTimeout(Qe,50)},vs.prototype.readOnlyChanged=function(et){et||this.reset(),this.textarea.disabled=et=="nocursor",this.textarea.readOnly=!!et},vs.prototype.setUneditable=function(){},vs.prototype.needsContentAttribute=!1;function sv(et,rt){if(rt=rt?oi(rt):{},rt.value=et.value,!rt.tabindex&&et.tabIndex&&(rt.tabindex=et.tabIndex),!rt.placeholder&&et.placeholder&&(rt.placeholder=et.placeholder),rt.autofocus==null){var lt=ye();rt.autofocus=lt==et||et.getAttribute("autofocus")!=null&<==document.body}function at(){et.value=Lt.getValue()}var ht;if(et.form&&(te(et.form,"submit",at),!rt.leaveSubmitMethodAlone)){var mt=et.form;ht=mt.submit;try{var kt=mt.submit=function(){at(),mt.submit=ht,mt.submit(),mt.submit=kt}}catch(Nt){}}rt.finishInit=function(Nt){Nt.save=at,Nt.getTextArea=function(){return et},Nt.toTextArea=function(){Nt.toTextArea=isNaN,at(),et.parentNode.removeChild(Nt.getWrapperElement()),et.style.display="",et.form&&(ui(et.form,"submit",at),!rt.leaveSubmitMethodAlone&&typeof et.form.submit=="function"&&(et.form.submit=ht))}},et.style.display="none";var Lt=lo(function(Nt){return et.parentNode.insertBefore(Nt,et.nextSibling)},rt);return Lt}function Ac(et){et.off=ui,et.on=te,et.wheelEventPixels=tl,et.Doc=Us,et.splitLines=yr,et.countColumn=Bt,et.findColumn=Ni,et.isWordChar=we,et.Pass=Ye,et.signal=qe,et.Line=Xr,et.changeEnd=Qu,et.scrollbarModel=ip,et.Pos=Oe,et.cmpPos=Ti,et.modes=an,et.mimeModes=vi,et.resolveMode=en,et.getMode=hn,et.modeExtensions=Vi,et.extendMode=zi,et.copyState=ur,et.startState=$n,et.innerMode=Vn,et.commands=eh,et.keyMap=za,et.keyName=$g,et.isModifierKey=kc,et.lookupKey=ml,et.normalizeKeyMap=mp,et.StringStream=Xe,et.SharedTextMarker=ru,et.TextMarker=le,et.LineWidget=Pu,et.e_preventDefault=Qi,et.e_stopPropagation=Cn,et.e_stop=Mn,et.addClass=Ie,et.contains=Re,et.rmClass=Xt,et.keyNames=ou}nv(lo),nh(lo);var Nu="iter insert remove copy getEditor constructor".split(" ");for(var xf in Us.prototype)Us.prototype.hasOwnProperty(xf)&&ge(Nu,xf)<0&&(lo.prototype[xf]=function(et){return function(){return et.apply(this.doc,arguments)}}(Us.prototype[xf]));return Oi(Us),lo.inputStyles={textarea:vs,contenteditable:Po},lo.defineMode=function(et){!lo.defaults.mode&&et!="null"&&(lo.defaults.mode=et),di.apply(this,arguments)},lo.defineMIME=xn,lo.defineMode("null",function(){return{token:function(et){return et.skipToEnd()}}}),lo.defineMIME("text/plain","null"),lo.defineExtension=function(et,rt){lo.prototype[et]=rt},lo.defineDocExtension=function(et,rt){Us.prototype[et]=rt},lo.fromTextArea=sv,Ac(lo),lo.version="5.58.2",lo})},25419:function(Li,ai,Mt){(function(pt){pt(Mt(89780),Mt(15525),Mt(98101))})(function(pt){"use strict";pt.defineMode("markdown",function(_t,ce){var me=pt.getMode(_t,"text/html"),Ut=me.name=="null";function fe(Bt){if(pt.findModeByName){var bt=pt.findModeByName(Bt);bt&&(Bt=bt.mime||bt.mimes[0])}var ge=pt.getMode(_t,Bt);return ge.name=="null"?null:ge}ce.highlightFormatting===void 0&&(ce.highlightFormatting=!1),ce.maxBlockquoteDepth===void 0&&(ce.maxBlockquoteDepth=0),ce.taskLists===void 0&&(ce.taskLists=!1),ce.strikethrough===void 0&&(ce.strikethrough=!1),ce.emoji===void 0&&(ce.emoji=!1),ce.fencedCodeBlockHighlighting===void 0&&(ce.fencedCodeBlockHighlighting=!0),ce.fencedCodeBlockDefaultMode===void 0&&(ce.fencedCodeBlockDefaultMode="text/plain"),ce.xml===void 0&&(ce.xml=!0),ce.tokenTypeOverrides===void 0&&(ce.tokenTypeOverrides={});var $t={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 Ae in $t)$t.hasOwnProperty(Ae)&&ce.tokenTypeOverrides[Ae]&&($t[Ae]=ce.tokenTypeOverrides[Ae]);var re=/^([*\-_])(?:\s*\1){2,}\s*$/,Dt=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,de=/^\[(x| )\](?=\s)/i,zt=ce.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,Ne=/^ {0,3}(?:\={1,}|-{2,})\s*$/,ue=/^[^#!\[\]*_\\<>` "'(~:]+/,qt=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,Qt=/^\s*\[[^\]]+?\]:.*$/,Jt=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,Pe=" ";function je(Bt,bt,ge){return bt.f=bt.inline=ge,ge(Bt,bt)}function De(Bt,bt,ge){return bt.f=bt.block=ge,ge(Bt,bt)}function Yt(Bt){return!Bt||!/\S/.test(Bt.string)}function Vt(Bt){if(Bt.linkTitle=!1,Bt.linkHref=!1,Bt.linkText=!1,Bt.em=!1,Bt.strong=!1,Bt.strikethrough=!1,Bt.quote=0,Bt.indentedCode=!1,Bt.f==Xt){var bt=Ut;if(!bt){var ge=pt.innerMode(me,Bt.htmlState);bt=ge.mode.name=="xml"&&ge.state.tagStart===null&&!ge.state.context&&ge.state.tokenize.isInText}bt&&(Bt.f=Te,Bt.block=pe,Bt.htmlState=null)}return Bt.trailingSpace=0,Bt.trailingSpaceNewLine=!1,Bt.prevLine=Bt.thisLine,Bt.thisLine={stream:null},null}function pe(Bt,bt){var ge=Bt.column()===bt.indentation,Ge=Yt(bt.prevLine.stream),Ye=bt.indentedCode,oe=bt.prevLine.hr,Ve=bt.list!==!1,Ze=(bt.listStack[bt.listStack.length-1]||0)+3;bt.indentedCode=!1;var Ni=bt.indentation;if(bt.indentationDiff===null&&(bt.indentationDiff=bt.indentation,Ve)){for(bt.list=null;Ni<bt.listStack[bt.listStack.length-1];)bt.listStack.pop(),bt.listStack.length?bt.indentation=bt.listStack[bt.listStack.length-1]:bt.list=!1;bt.list!==!1&&(bt.indentationDiff=Ni-bt.listStack[bt.listStack.length-1])}var Se=!Ge&&!oe&&!bt.prevLine.header&&(!Ve||!Ye)&&!bt.prevLine.fencedCodeEnd,ie=(bt.list===!1||oe||Ge)&&bt.indentation<=Ze&&Bt.match(re),ee=null;if(bt.indentationDiff>=4&&(Ye||bt.prevLine.fencedCodeEnd||bt.prevLine.header||Ge))return Bt.skipToEnd(),bt.indentedCode=!0,$t.code;if(Bt.eatSpace())return null;if(ge&&bt.indentation<=Ze&&(ee=Bt.match(zt))&&ee[1].length<=6)return bt.quote=0,bt.header=ee[1].length,bt.thisLine.header=!0,ce.highlightFormatting&&(bt.formatting="header"),bt.f=bt.inline,Wt(bt);if(bt.indentation<=Ze&&Bt.eat(">"))return bt.quote=ge?1:bt.quote+1,ce.highlightFormatting&&(bt.formatting="quote"),Bt.eatSpace(),Wt(bt);if(!ie&&!bt.setext&&ge&&bt.indentation<=Ze&&(ee=Bt.match(Dt))){var ve=ee[1]?"ol":"ul";return bt.indentation=Ni+Bt.current().length,bt.list=!0,bt.quote=0,bt.listStack.push(bt.indentation),bt.em=!1,bt.strong=!1,bt.code=!1,bt.strikethrough=!1,ce.taskLists&&Bt.match(de,!1)&&(bt.taskList=!0),bt.f=bt.inline,ce.highlightFormatting&&(bt.formatting=["list","list-"+ve]),Wt(bt)}else{if(ge&&bt.indentation<=Ze&&(ee=Bt.match(qt,!0)))return bt.quote=0,bt.fencedEndRE=new RegExp(ee[1]+"+ *$"),bt.localMode=ce.fencedCodeBlockHighlighting&&fe(ee[2]||ce.fencedCodeBlockDefaultMode),bt.localMode&&(bt.localState=pt.startState(bt.localMode)),bt.f=bt.block=Le,ce.highlightFormatting&&(bt.formatting="code-block"),bt.code=-1,Wt(bt);if(bt.setext||(!Se||!Ve)&&!bt.quote&&bt.list===!1&&!bt.code&&!ie&&!Qt.test(Bt.string)&&(ee=Bt.lookAhead(1))&&(ee=ee.match(Ne)))return bt.setext?(bt.header=bt.setext,bt.setext=0,Bt.skipToEnd(),ce.highlightFormatting&&(bt.formatting="header")):(bt.header=ee[0].charAt(0)=="="?1:2,bt.setext=bt.header),bt.thisLine.header=!0,bt.f=bt.inline,Wt(bt);if(ie)return Bt.skipToEnd(),bt.hr=!0,bt.thisLine.hr=!0,$t.hr;if(Bt.peek()==="[")return je(Bt,bt,Ai)}return je(Bt,bt,bt.inline)}function Xt(Bt,bt){var ge=me.token(Bt,bt.htmlState);if(!Ut){var Ge=pt.innerMode(me,bt.htmlState);(Ge.mode.name=="xml"&&Ge.state.tagStart===null&&!Ge.state.context&&Ge.state.tokenize.isInText||bt.md_inside&&Bt.current().indexOf(">")>-1)&&(bt.f=Te,bt.block=pe,bt.htmlState=null)}return ge}function Le(Bt,bt){var ge=bt.listStack[bt.listStack.length-1]||0,Ge=bt.indentation<ge,Ye=ge+3;if(bt.fencedEndRE&&bt.indentation<=Ye&&(Ge||Bt.match(bt.fencedEndRE))){ce.highlightFormatting&&(bt.formatting="code-block");var oe;return Ge||(oe=Wt(bt)),bt.localMode=bt.localState=null,bt.block=pe,bt.f=Te,bt.fencedEndRE=null,bt.code=0,bt.thisLine.fencedCodeEnd=!0,Ge?De(Bt,bt,bt.block):oe}else return bt.localMode?bt.localMode.token(Bt,bt.localState):(Bt.skipToEnd(),$t.code)}function Wt(Bt){var bt=[];if(Bt.formatting){bt.push($t.formatting),typeof Bt.formatting=="string"&&(Bt.formatting=[Bt.formatting]);for(var ge=0;ge<Bt.formatting.length;ge++)bt.push($t.formatting+"-"+Bt.formatting[ge]),Bt.formatting[ge]==="header"&&bt.push($t.formatting+"-"+Bt.formatting[ge]+"-"+Bt.header),Bt.formatting[ge]==="quote"&&(!ce.maxBlockquoteDepth||ce.maxBlockquoteDepth>=Bt.quote?bt.push($t.formatting+"-"+Bt.formatting[ge]+"-"+Bt.quote):bt.push("error"))}if(Bt.taskOpen)return bt.push("meta"),bt.length?bt.join(" "):null;if(Bt.taskClosed)return bt.push("property"),bt.length?bt.join(" "):null;if(Bt.linkHref?bt.push($t.linkHref,"url"):(Bt.strong&&bt.push($t.strong),Bt.em&&bt.push($t.em),Bt.strikethrough&&bt.push($t.strikethrough),Bt.emoji&&bt.push($t.emoji),Bt.linkText&&bt.push($t.linkText),Bt.code&&bt.push($t.code),Bt.image&&bt.push($t.image),Bt.imageAltText&&bt.push($t.imageAltText,"link"),Bt.imageMarker&&bt.push($t.imageMarker)),Bt.header&&bt.push($t.header,$t.header+"-"+Bt.header),Bt.quote&&(bt.push($t.quote),!ce.maxBlockquoteDepth||ce.maxBlockquoteDepth>=Bt.quote?bt.push($t.quote+"-"+Bt.quote):bt.push($t.quote+"-"+ce.maxBlockquoteDepth)),Bt.list!==!1){var Ge=(Bt.listStack.length-1)%3;Ge?Ge===1?bt.push($t.list2):bt.push($t.list3):bt.push($t.list1)}return Bt.trailingSpaceNewLine?bt.push("trailing-space-new-line"):Bt.trailingSpace&&bt.push("trailing-space-"+(Bt.trailingSpace%2?"a":"b")),bt.length?bt.join(" "):null}function Ce(Bt,bt){if(Bt.match(ue,!0))return Wt(bt)}function Te(Bt,bt){var ge=bt.text(Bt,bt);if(typeof ge!="undefined")return ge;if(bt.list)return bt.list=null,Wt(bt);if(bt.taskList){var Ge=Bt.match(de,!0)[1]===" ";return Ge?bt.taskOpen=!0:bt.taskClosed=!0,ce.highlightFormatting&&(bt.formatting="task"),bt.taskList=!1,Wt(bt)}if(bt.taskOpen=!1,bt.taskClosed=!1,bt.header&&Bt.match(/^#+$/,!0))return ce.highlightFormatting&&(bt.formatting="header"),Wt(bt);var Ye=Bt.next();if(bt.linkTitle){bt.linkTitle=!1;var oe=Ye;Ye==="("&&(oe=")"),oe=(oe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ve="^\\s*(?:[^"+oe+"\\\\]+|\\\\\\\\|\\\\.)"+oe;if(Bt.match(new RegExp(Ve),!0))return $t.linkHref}if(Ye==="`"){var Ze=bt.formatting;ce.highlightFormatting&&(bt.formatting="code"),Bt.eatWhile("`");var Ni=Bt.current().length;if(bt.code==0&&(!bt.quote||Ni==1))return bt.code=Ni,Wt(bt);if(Ni==bt.code){var Se=Wt(bt);return bt.code=0,Se}else return bt.formatting=Ze,Wt(bt)}else if(bt.code)return Wt(bt);if(Ye==="\\"&&(Bt.next(),ce.highlightFormatting)){var ie=Wt(bt),ee=$t.formatting+"-escape";return ie?ie+" "+ee:ee}if(Ye==="!"&&Bt.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return bt.imageMarker=!0,bt.image=!0,ce.highlightFormatting&&(bt.formatting="image"),Wt(bt);if(Ye==="["&&bt.imageMarker&&Bt.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return bt.imageMarker=!1,bt.imageAltText=!0,ce.highlightFormatting&&(bt.formatting="image"),Wt(bt);if(Ye==="]"&&bt.imageAltText){ce.highlightFormatting&&(bt.formatting="image");var ie=Wt(bt);return bt.imageAltText=!1,bt.image=!1,bt.inline=bt.f=Re,ie}if(Ye==="["&&!bt.image)return bt.linkText&&Bt.match(/^.*?\]/)||(bt.linkText=!0,ce.highlightFormatting&&(bt.formatting="link")),Wt(bt);if(Ye==="]"&&bt.linkText){ce.highlightFormatting&&(bt.formatting="link");var ie=Wt(bt);return bt.linkText=!1,bt.inline=bt.f=Bt.match(/\(.*?\)| ?\[.*?\]/,!1)?Re:Te,ie}if(Ye==="<"&&Bt.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){bt.f=bt.inline=ne,ce.highlightFormatting&&(bt.formatting="link");var ie=Wt(bt);return ie?ie+=" ":ie="",ie+$t.linkInline}if(Ye==="<"&&Bt.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){bt.f=bt.inline=ne,ce.highlightFormatting&&(bt.formatting="link");var ie=Wt(bt);return ie?ie+=" ":ie="",ie+$t.linkEmail}if(ce.xml&&Ye==="<"&&Bt.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ve=Bt.string.indexOf(">",Bt.pos);if(ve!=-1){var ti=Bt.string.substring(Bt.start,ve);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ti)&&(bt.md_inside=!0)}return Bt.backUp(1),bt.htmlState=pt.startState(me),De(Bt,bt,Xt)}if(ce.xml&&Ye==="<"&&Bt.match(/^\/\w*?>/))return bt.md_inside=!1,"tag";if(Ye==="*"||Ye==="_"){for(var he=1,We=Bt.pos==1?" ":Bt.string.charAt(Bt.pos-2);he<3&&Bt.eat(Ye);)he++;var He=Bt.peek()||" ",we=!/\s/.test(He)&&(!Jt.test(He)||/\s/.test(We)||Jt.test(We)),ei=!/\s/.test(We)&&(!Jt.test(We)||/\s/.test(He)||Jt.test(He)),Be=null,Zt=null;if(he%2&&(!bt.em&&we&&(Ye==="*"||!ei||Jt.test(We))?Be=!0:bt.em==Ye&&ei&&(Ye==="*"||!we||Jt.test(He))&&(Be=!1)),he>1&&(!bt.strong&&we&&(Ye==="*"||!ei||Jt.test(We))?Zt=!0:bt.strong==Ye&&ei&&(Ye==="*"||!we||Jt.test(He))&&(Zt=!1)),Zt!=null||Be!=null){ce.highlightFormatting&&(bt.formatting=Be==null?"strong":Zt==null?"em":"strong em"),Be===!0&&(bt.em=Ye),Zt===!0&&(bt.strong=Ye);var Se=Wt(bt);return Be===!1&&(bt.em=!1),Zt===!1&&(bt.strong=!1),Se}}else if(Ye===" "&&(Bt.eat("*")||Bt.eat("_"))){if(Bt.peek()===" ")return Wt(bt);Bt.backUp(1)}if(ce.strikethrough){if(Ye==="~"&&Bt.eatWhile(Ye)){if(bt.strikethrough){ce.highlightFormatting&&(bt.formatting="strikethrough");var Se=Wt(bt);return bt.strikethrough=!1,Se}else if(Bt.match(/^[^\s]/,!1))return bt.strikethrough=!0,ce.highlightFormatting&&(bt.formatting="strikethrough"),Wt(bt)}else if(Ye===" "&&Bt.match(/^~~/,!0)){if(Bt.peek()===" ")return Wt(bt);Bt.backUp(2)}}if(ce.emoji&&Ye===":"&&Bt.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){bt.emoji=!0,ce.highlightFormatting&&(bt.formatting="emoji");var Je=Wt(bt);return bt.emoji=!1,Je}return Ye===" "&&(Bt.match(/^ +$/,!1)?bt.trailingSpace++:bt.trailingSpace&&(bt.trailingSpaceNewLine=!0)),Wt(bt)}function ne(Bt,bt){var ge=Bt.next();if(ge===">"){bt.f=bt.inline=Te,ce.highlightFormatting&&(bt.formatting="link");var Ge=Wt(bt);return Ge?Ge+=" ":Ge="",Ge+$t.linkInline}return Bt.match(/^[^>]+/,!0),$t.linkInline}function Re(Bt,bt){if(Bt.eatSpace())return null;var ge=Bt.next();return ge==="("||ge==="["?(bt.f=bt.inline=Ie(ge==="("?")":"]"),ce.highlightFormatting&&(bt.formatting="link-string"),bt.linkHref=!0,Wt(bt)):"error"}var ye={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function Ie(Bt){return function(bt,ge){var Ge=bt.next();if(Ge===Bt){ge.f=ge.inline=Te,ce.highlightFormatting&&(ge.formatting="link-string");var Ye=Wt(ge);return ge.linkHref=!1,Ye}return bt.match(ye[Bt]),ge.linkHref=!0,Wt(ge)}}function Ai(Bt,bt){return Bt.match(/^([^\]\\]|\\.)*\]:/,!1)?(bt.f=yi,Bt.next(),ce.highlightFormatting&&(bt.formatting="link"),bt.linkText=!0,Wt(bt)):je(Bt,bt,Te)}function yi(Bt,bt){if(Bt.match(/^\]:/,!0)){bt.f=bt.inline=gi,ce.highlightFormatting&&(bt.formatting="link");var ge=Wt(bt);return bt.linkText=!1,ge}return Bt.match(/^([^\]\\]|\\.)+/,!0),$t.linkText}function gi(Bt,bt){return Bt.eatSpace()?null:(Bt.match(/^[^\s]+/,!0),Bt.peek()===void 0?bt.linkTitle=!0:Bt.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),bt.f=bt.inline=Te,$t.linkHref+" url")}var oi={startState:function(){return{f:pe,prevLine:{stream:null},thisLine:{stream:null},block:pe,htmlState:null,indentation:0,inline:Te,text:Ce,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(Bt){return{f:Bt.f,prevLine:Bt.prevLine,thisLine:Bt.thisLine,block:Bt.block,htmlState:Bt.htmlState&&pt.copyState(me,Bt.htmlState),indentation:Bt.indentation,localMode:Bt.localMode,localState:Bt.localMode?pt.copyState(Bt.localMode,Bt.localState):null,inline:Bt.inline,text:Bt.text,formatting:!1,linkText:Bt.linkText,linkTitle:Bt.linkTitle,linkHref:Bt.linkHref,code:Bt.code,em:Bt.em,strong:Bt.strong,strikethrough:Bt.strikethrough,emoji:Bt.emoji,header:Bt.header,setext:Bt.setext,hr:Bt.hr,taskList:Bt.taskList,list:Bt.list,listStack:Bt.listStack.slice(0),quote:Bt.quote,indentedCode:Bt.indentedCode,trailingSpace:Bt.trailingSpace,trailingSpaceNewLine:Bt.trailingSpaceNewLine,md_inside:Bt.md_inside,fencedEndRE:Bt.fencedEndRE}},token:function(Bt,bt){if(bt.formatting=!1,Bt!=bt.thisLine.stream){if(bt.header=0,bt.hr=!1,Bt.match(/^\s*$/,!0))return Vt(bt),null;if(bt.prevLine=bt.thisLine,bt.thisLine={stream:Bt},bt.taskList=!1,bt.trailingSpace=0,bt.trailingSpaceNewLine=!1,!bt.localState&&(bt.f=bt.block,bt.f!=Xt)){var ge=Bt.match(/^\s*/,!0)[0].replace(/\t/g,Pe).length;if(bt.indentation=ge,bt.indentationDiff=null,ge>0)return null}}return bt.f(Bt,bt)},innerMode:function(Bt){return Bt.block==Xt?{state:Bt.htmlState,mode:me}:Bt.localState?{state:Bt.localState,mode:Bt.localMode}:{state:Bt,mode:oi}},indent:function(Bt,bt,ge){return Bt.block==Xt&&me.indent?me.indent(Bt.htmlState,bt,ge):Bt.localState&&Bt.localMode.indent?Bt.localMode.indent(Bt.localState,bt,ge):pt.Pass},blankLine:Vt,getType:Wt,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return oi},"xml"),pt.defineMIME("text/markdown","markdown"),pt.defineMIME("text/x-markdown","markdown")})},98101:function(Li,ai,Mt){(function(pt){pt(Mt(89780))})(function(pt){"use strict";pt.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<pt.modeInfo.length;_t++){var ce=pt.modeInfo[_t];ce.mimes&&(ce.mime=ce.mimes[0])}pt.findModeByMIME=function(me){me=me.toLowerCase();for(var Ut=0;Ut<pt.modeInfo.length;Ut++){var fe=pt.modeInfo[Ut];if(fe.mime==me)return fe;if(fe.mimes){for(var $t=0;$t<fe.mimes.length;$t++)if(fe.mimes[$t]==me)return fe}}if(/\+xml$/.test(me))return pt.findModeByMIME("application/xml");if(/\+json$/.test(me))return pt.findModeByMIME("application/json")},pt.findModeByExtension=function(me){me=me.toLowerCase();for(var Ut=0;Ut<pt.modeInfo.length;Ut++){var fe=pt.modeInfo[Ut];if(fe.ext){for(var $t=0;$t<fe.ext.length;$t++)if(fe.ext[$t]==me)return fe}}},pt.findModeByFileName=function(me){for(var Ut=0;Ut<pt.modeInfo.length;Ut++){var fe=pt.modeInfo[Ut];if(fe.file&&fe.file.test(me))return fe}var $t=me.lastIndexOf("."),Ae=$t>-1&&me.substring($t+1,me.length);if(Ae)return pt.findModeByExtension(Ae)},pt.findModeByName=function(me){me=me.toLowerCase();for(var Ut=0;Ut<pt.modeInfo.length;Ut++){var fe=pt.modeInfo[Ut];if(fe.name.toLowerCase()==me)return fe;if(fe.alias){for(var $t=0;$t<fe.alias.length;$t++)if(fe.alias[$t].toLowerCase()==me)return fe}}}})},67549:function(Li,ai,Mt){(function(pt){pt(Mt(89780))})(function(pt){"use strict";pt.defineMode("stex",function(_t,ce){"use strict";function me(ue,qt){ue.cmdState.push(qt)}function Ut(ue){return ue.cmdState.length>0?ue.cmdState[ue.cmdState.length-1]:null}function fe(ue){var qt=ue.cmdState.pop();qt&&qt.closeBracket()}function $t(ue){for(var qt=ue.cmdState,Qt=qt.length-1;Qt>=0;Qt--){var Jt=qt[Qt];if(Jt.name!="DEFAULT")return Jt}return{styleIdentifier:function(){return null}}}function Ae(ue,qt,Qt){return function(){this.name=ue,this.bracketNo=0,this.style=qt,this.styles=Qt,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var re={};re.importmodule=Ae("importmodule","tag",["string","builtin"]),re.documentclass=Ae("documentclass","tag",["","atom"]),re.usepackage=Ae("usepackage","tag",["atom"]),re.begin=Ae("begin","tag",["atom"]),re.end=Ae("end","tag",["atom"]),re.label=Ae("label","tag",["atom"]),re.ref=Ae("ref","tag",["atom"]),re.eqref=Ae("eqref","tag",["atom"]),re.cite=Ae("cite","tag",["atom"]),re.bibitem=Ae("bibitem","tag",["atom"]),re.Bibitem=Ae("Bibitem","tag",["atom"]),re.RBibitem=Ae("RBibitem","tag",["atom"]),re.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function Dt(ue,qt){ue.f=qt}function de(ue,qt){var Qt;if(ue.match(/^\\[a-zA-Z@]+/)){var Jt=ue.current().slice(1);return Qt=re.hasOwnProperty(Jt)?re[Jt]:re.DEFAULT,Qt=new Qt,me(qt,Qt),Dt(qt,Ne),Qt.style}if(ue.match(/^\\[$&%#{}_]/)||ue.match(/^\\[,;!\/\\]/))return"tag";if(ue.match("\\["))return Dt(qt,function(je,De){return zt(je,De,"\\]")}),"keyword";if(ue.match("\\("))return Dt(qt,function(je,De){return zt(je,De,"\\)")}),"keyword";if(ue.match("$$"))return Dt(qt,function(je,De){return zt(je,De,"$$")}),"keyword";if(ue.match("$"))return Dt(qt,function(je,De){return zt(je,De,"$")}),"keyword";var Pe=ue.next();if(Pe=="%")return ue.skipToEnd(),"comment";if(Pe=="}"||Pe=="]"){if(Qt=Ut(qt),Qt)Qt.closeBracket(Pe),Dt(qt,Ne);else return"error";return"bracket"}else return Pe=="{"||Pe=="["?(Qt=re.DEFAULT,Qt=new Qt,me(qt,Qt),"bracket"):/\d/.test(Pe)?(ue.eatWhile(/[\w.%]/),"atom"):(ue.eatWhile(/[\w\-_]/),Qt=$t(qt),Qt.name=="begin"&&(Qt.argument=ue.current()),Qt.styleIdentifier())}function zt(ue,qt,Qt){if(ue.eatSpace())return null;if(Qt&&ue.match(Qt))return Dt(qt,de),"keyword";if(ue.match(/^\\[a-zA-Z@]+/))return"tag";if(ue.match(/^[a-zA-Z]+/))return"variable-2";if(ue.match(/^\\[$&%#{}_]/)||ue.match(/^\\[,;!\/]/)||ue.match(/^[\^_&]/))return"tag";if(ue.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(ue.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var Jt=ue.next();return Jt=="{"||Jt=="}"||Jt=="["||Jt=="]"||Jt=="("||Jt==")"?"bracket":Jt=="%"?(ue.skipToEnd(),"comment"):"error"}function Ne(ue,qt){var Qt=ue.peek(),Jt;return Qt=="{"||Qt=="["?(Jt=Ut(qt),Jt.openBracket(Qt),ue.eat(Qt),Dt(qt,de),"bracket"):/[ \t\r]/.test(Qt)?(ue.eat(Qt),null):(Dt(qt,de),fe(qt),de(ue,qt))}return{startState:function(){var ue=ce.inMathMode?function(qt,Qt){return zt(qt,Qt)}:de;return{cmdState:[],f:ue}},copyState:function(ue){return{cmdState:ue.cmdState.slice(),f:ue.f}},token:function(ue,qt){return qt.f(ue,qt)},blankLine:function(ue){ue.f=de,ue.cmdState.length=0},lineComment:"%"}}),pt.defineMIME("text/x-stex","stex"),pt.defineMIME("text/x-latex","stex")})},15525:function(Li,ai,Mt){(function(pt){pt(Mt(89780))})(function(pt){"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},ce={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};pt.defineMode("xml",function(me,Ut){var fe=me.indentUnit,$t={},Ae=Ut.htmlMode?_t:ce;for(var re in Ae)$t[re]=Ae[re];for(var re in Ut)$t[re]=Ut[re];var Dt,de;function zt(ne,Re){function ye(yi){return Re.tokenize=yi,yi(ne,Re)}var Ie=ne.next();if(Ie=="<")return ne.eat("!")?ne.eat("[")?ne.match("CDATA[")?ye(qt("atom","]]>")):null:ne.match("--")?ye(qt("comment","-->")):ne.match("DOCTYPE",!0,!0)?(ne.eatWhile(/[\w\._\-]/),ye(Qt(1))):null:ne.eat("?")?(ne.eatWhile(/[\w\._\-]/),Re.tokenize=qt("meta","?>"),"meta"):(Dt=ne.eat("/")?"closeTag":"openTag",Re.tokenize=Ne,"tag bracket");if(Ie=="&"){var Ai;return ne.eat("#")?ne.eat("x")?Ai=ne.eatWhile(/[a-fA-F\d]/)&&ne.eat(";"):Ai=ne.eatWhile(/[\d]/)&&ne.eat(";"):Ai=ne.eatWhile(/[\w\.\-:]/)&&ne.eat(";"),Ai?"atom":"error"}else return ne.eatWhile(/[^&<]/),null}zt.isInText=!0;function Ne(ne,Re){var ye=ne.next();if(ye==">"||ye=="/"&&ne.eat(">"))return Re.tokenize=zt,Dt=ye==">"?"endTag":"selfcloseTag","tag bracket";if(ye=="=")return Dt="equals",null;if(ye=="<"){Re.tokenize=zt,Re.state=De,Re.tagName=Re.tagStart=null;var Ie=Re.tokenize(ne,Re);return Ie?Ie+" tag error":"tag error"}else return/[\'\"]/.test(ye)?(Re.tokenize=ue(ye),Re.stringStartCol=ne.column(),Re.tokenize(ne,Re)):(ne.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function ue(ne){var Re=function(ye,Ie){for(;!ye.eol();)if(ye.next()==ne){Ie.tokenize=Ne;break}return"string"};return Re.isInAttribute=!0,Re}function qt(ne,Re){return function(ye,Ie){for(;!ye.eol();){if(ye.match(Re)){Ie.tokenize=zt;break}ye.next()}return ne}}function Qt(ne){return function(Re,ye){for(var Ie;(Ie=Re.next())!=null;){if(Ie=="<")return ye.tokenize=Qt(ne+1),ye.tokenize(Re,ye);if(Ie==">")if(ne==1){ye.tokenize=zt;break}else return ye.tokenize=Qt(ne-1),ye.tokenize(Re,ye)}return"meta"}}function Jt(ne,Re,ye){this.prev=ne.context,this.tagName=Re,this.indent=ne.indented,this.startOfLine=ye,($t.doNotIndent.hasOwnProperty(Re)||ne.context&&ne.context.noIndent)&&(this.noIndent=!0)}function Pe(ne){ne.context&&(ne.context=ne.context.prev)}function je(ne,Re){for(var ye;;){if(!ne.context||(ye=ne.context.tagName,!$t.contextGrabbers.hasOwnProperty(ye)||!$t.contextGrabbers[ye].hasOwnProperty(Re)))return;Pe(ne)}}function De(ne,Re,ye){return ne=="openTag"?(ye.tagStart=Re.column(),Yt):ne=="closeTag"?Vt:De}function Yt(ne,Re,ye){return ne=="word"?(ye.tagName=Re.current(),de="tag",Le):$t.allowMissingTagName&&ne=="endTag"?(de="tag bracket",Le(ne,Re,ye)):(de="error",Yt)}function Vt(ne,Re,ye){if(ne=="word"){var Ie=Re.current();return ye.context&&ye.context.tagName!=Ie&&$t.implicitlyClosed.hasOwnProperty(ye.context.tagName)&&Pe(ye),ye.context&&ye.context.tagName==Ie||$t.matchClosing===!1?(de="tag",pe):(de="tag error",Xt)}else return $t.allowMissingTagName&&ne=="endTag"?(de="tag bracket",pe(ne,Re,ye)):(de="error",Xt)}function pe(ne,Re,ye){return ne!="endTag"?(de="error",pe):(Pe(ye),De)}function Xt(ne,Re,ye){return de="error",pe(ne,Re,ye)}function Le(ne,Re,ye){if(ne=="word")return de="attribute",Wt;if(ne=="endTag"||ne=="selfcloseTag"){var Ie=ye.tagName,Ai=ye.tagStart;return ye.tagName=ye.tagStart=null,ne=="selfcloseTag"||$t.autoSelfClosers.hasOwnProperty(Ie)?je(ye,Ie):(je(ye,Ie),ye.context=new Jt(ye,Ie,Ai==ye.indented)),De}return de="error",Le}function Wt(ne,Re,ye){return ne=="equals"?Ce:($t.allowMissing||(de="error"),Le(ne,Re,ye))}function Ce(ne,Re,ye){return ne=="string"?Te:ne=="word"&&$t.allowUnquoted?(de="string",Le):(de="error",Le(ne,Re,ye))}function Te(ne,Re,ye){return ne=="string"?Te:Le(ne,Re,ye)}return{startState:function(ne){var Re={tokenize:zt,state:De,indented:ne||0,tagName:null,tagStart:null,context:null};return ne!=null&&(Re.baseIndent=ne),Re},token:function(ne,Re){if(!Re.tagName&&ne.sol()&&(Re.indented=ne.indentation()),ne.eatSpace())return null;Dt=null;var ye=Re.tokenize(ne,Re);return(ye||Dt)&&ye!="comment"&&(de=null,Re.state=Re.state(Dt||ye,ne,Re),de&&(ye=de=="error"?ye+" error":de)),ye},indent:function(ne,Re,ye){var Ie=ne.context;if(ne.tokenize.isInAttribute)return ne.tagStart==ne.indented?ne.stringStartCol+1:ne.indented+fe;if(Ie&&Ie.noIndent)return pt.Pass;if(ne.tokenize!=Ne&&ne.tokenize!=zt)return ye?ye.match(/^(\s*)/)[0].length:0;if(ne.tagName)return $t.multilineTagIndentPastTag!==!1?ne.tagStart+ne.tagName.length+2:ne.tagStart+fe*($t.multilineTagIndentFactor||1);if($t.alignCDATA&&/<!\[CDATA\[/.test(Re))return 0;var Ai=Re&&/^<(\/)?([\w_:\.-]*)/.exec(Re);if(Ai&&Ai[1])for(;Ie;)if(Ie.tagName==Ai[2]){Ie=Ie.prev;break}else if($t.implicitlyClosed.hasOwnProperty(Ie.tagName))Ie=Ie.prev;else break;else if(Ai)for(;Ie;){var yi=$t.contextGrabbers[Ie.tagName];if(yi&&yi.hasOwnProperty(Ai[2]))Ie=Ie.prev;else break}for(;Ie&&Ie.prev&&!Ie.startOfLine;)Ie=Ie.prev;return Ie?Ie.indent+fe:ne.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:$t.htmlMode?"html":"xml",helperType:$t.htmlMode?"html":"xml",skipAttribute:function(ne){ne.state==Ce&&(ne.state=Le)},xmlCurrentTag:function(ne){return ne.tagName?{name:ne.tagName,close:ne.type=="closeTag"}:null},xmlCurrentContext:function(ne){for(var Re=[],ye=ne.context;ye;ye=ye.prev)ye.tagName&&Re.push(ye.tagName);return Re.reverse()}}}),pt.defineMIME("text/xml","xml"),pt.defineMIME("application/xml","xml"),pt.mimeModes.hasOwnProperty("text/html")||pt.defineMIME("text/html",{name:"xml",htmlMode:!0})})},12378:function(Li,ai,Mt){"use strict";Mt.d(ai,{$u:function(){return re},BD:function(){return he},E9:function(){return Ae},FF:function(){return ar},FJ:function(){return De},Hn:function(){return je},KX:function(){return Vt},NB:function(){return Ct},S0:function(){return ee},UL:function(){return Dt},Vk:function(){return Pe},al:function(){return Be},bn:function(){return ei},bx:function(){return We},g2:function(){return ti},h1:function(){return Ce},hD:function(){return Oi},l4:function(){return fe},rU:function(){return gt},s_:function(){return He},z6:function(){return zt}}),Li=Mt.hmd(Li),function(){var yt;function Mi(a){var y=0;return function(){return y<a.length?{done:!1,value:a[y++]}:{done:!0}}}function on(a){var y=typeof Symbol!="undefined"&&Symbol.iterator&&a[Symbol.iterator];return y?y.call(a):{next:Mi(a)}}function Ui(a){for(var y,x=[];!(y=a.next()).done;)x.push(y.value);return x}var an=typeof Object.create=="function"?Object.create:function(a){function y(){}return y.prototype=a,new y},vi;if(typeof Object.setPrototypeOf=="function")vi=Object.setPrototypeOf;else{var di;t:{var xn={a:!0},en={};try{en.__proto__=xn,di=en.a;break t}catch(a){}di=!1}vi=di?function(a,y){if(a.__proto__=y,a.__proto__!==y)throw new TypeError(a+" is not extensible");return a}:null}var hn=vi;function Vi(a,y){if(a.prototype=an(y.prototype),a.prototype.constructor=a,hn)hn(a,y);else for(var x in y)if(x!="prototype")if(Object.defineProperties){var E=Object.getOwnPropertyDescriptor(y,x);E&&Object.defineProperty(a,x,E)}else a[x]=y[x];a.QA=y.prototype}var zi=typeof Mt.g!="undefined"&&Mt.g!=null?Mt.g:self,ur=typeof Object.assign=="function"?Object.assign:function(a,y){for(var x=1;x<arguments.length;x++){var E=arguments[x];if(E)for(var b in E)Object.prototype.hasOwnProperty.call(E,b)&&(a[b]=E[b])}return a},Vn=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,y,x){a!=Array.prototype&&a!=Object.prototype&&(a[y]=x.value)};function $n(a,y){if(y){var x=zi;a=a.split(".");for(var E=0;E<a.length-1;E++){var b=a[E];b in x||(x[b]={}),x=x[b]}a=a[a.length-1],E=x[a],y=y(E),y!=E&&y!=null&&Vn(x,a,{writable:!0,value:y})}}$n("Object.assign",function(a){return a||ur}),$n("Array.prototype.fill",function(a){return a||function(y,x,E){var b=this.length||0;for(0>x&&(x=Math.max(0,b+x)),(E==null||E>b)&&(E=b),E=Number(E),0>E&&(E=Math.max(0,b+E)),x=Number(x||0);x<E;x++)this[x]=y;return this}});var Xe=typeof globalThis=="object"&&globalThis||typeof Mt.g=="object"&&Mt.g.global===Mt.g&&Mt.g||typeof self=="object"&&self.self===self&&self||{};Xe.requestAnimationFrame===void 0&&(Xe.setImmediate===void 0?Xe.requestAnimationFrame=function(a){Xe.setTimeout(a,0)}:Xe.requestAnimationFrame=Xe.setImmediate);function mi(){}function fn(a,y){var x=-1;return function(){var E=this,b=arguments;x!==-1&&Xe.clearTimeout(x),x=On(function(){x=-1,a.apply(E,b)},y)}}function On(a,y){return Xe.setTimeout(a,y)}function Gn(a){return Xe.document.createElement(a)}function It(a){throw Error(a)}function se(a,y){a="The object is frozen, so its properties cannot be set: "+a.toString(),y!==void 0&&(a+=" to value: "+y),It(a)}function xi(a,y,x,E){x=x===null?"*":typeof x=="string"?x:typeof x=="function"&&typeof x.className=="string"?x.className:"",E!==void 0&&(x+="."+E),It(x+" is not in the range "+y+": "+a)}function Di(a){Xe.console&&Xe.console.log(a)}function Oe(a){return typeof a=="object"&&a!==null}function Ti(a){return Array.isArray(a)||Xe.NodeList&&a instanceof Xe.NodeList||Xe.HTMLCollection&&a instanceof Xe.HTMLCollection}function rn(a){return Array.prototype.slice.call(a)}function ln(a,y,x){Array.isArray(a)?y>=a.length?a.push(x):a.splice(y,0,x):It("Cannot insert an object into an HTMLCollection or NodeList: "+x+" at "+y)}function yn(a,y){Array.isArray(a)?y>=a.length?a.pop():a.splice(y,1):It("Cannot remove an object from an HTMLCollection or NodeList at "+y)}function ii(){var a=Kr.pop();return a===void 0?[]:a}function Hi(a){a.length=0,Kr.push(a)}function Xi(a){if(typeof a=="function"){if(a.className)return a.className;if(a.name)return a.name;var y=a.toString();if(y=y.substring(9,y.indexOf("(")).trim(),y!=="")return a._className=y}else if(Oe(a)&&a.constructor)return Xi(a.constructor);return typeof a}function ki(a){var y=a;return Oe(a)&&(a.text?y=a.text:a.name?y=a.name:a.key!==void 0?y=a.key:a.id!==void 0?y=a.id:a.constructor===Object&&(a.Text?y=a.Text:a.Name?y=a.Name:a.Key!==void 0?y=a.Key:a.Id!==void 0?y=a.Id:a.ID!==void 0&&(y=a.ID))),y===void 0?"undefined":y===null?"null":y.toString()}function En(a,y){if(a.hasOwnProperty(y))return!0;for(a=Object.getPrototypeOf(a);a&&a!==Function;){if(a.hasOwnProperty(y))return!0;var x=a.CA;if(x&&x[y])return!0;a=Object.getPrototypeOf(a)}return!1}function Fn(a,y,x){Object.defineProperty(Ur.prototype,a,{get:y,set:x})}function qi(a){for(var y=[],x=0;256>x;x++)y["0123456789abcdef".charAt(x>>4)+"0123456789abcdef".charAt(x&15)]=String.fromCharCode(x);a.length%2&&(a="0"+a),x=[];for(var E=0,b=0;b<a.length;b+=2)x[E++]=y[a.substr(b,2)];for(a=x.join(""),a=a===""?"0":a,y=[],x=0;256>x;x++)y[x]=x;for(x=E=0;256>x;x++)E=(E+y[x]+119)%256,b=y[x],y[x]=y[E],y[E]=b;E=x=0;for(var z="",tt=0;tt<a.length;tt++)x=(x+1)%256,E=(E+y[x])%256,b=y[x],y[x]=y[E],y[E]=b,z+=String.fromCharCode(a.charCodeAt(tt)^y[(y[x]+y[E])%256]);return z.indexOf("GoJS 2.1 evaluation")>-1||z.indexOf("\xA9 1998-2021 Northwoods Software")>-1||z.indexOf("Not for distribution or production use")>-1||z.indexOf("gojs.net")>-1?"":z}var rr=Xe.navigator!==void 0&&0<Xe.navigator.userAgent.indexOf("Trident/7"),Sr=Xe.navigator!==void 0&&Xe.navigator.platform!==void 0&&Xe.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i)!==null,Kr=[];Object.freeze([]),mi.className="Util",mi.Dx="32ab5ff3b26f42dc0ed90f21472913b5",mi.adym="gojs.net",mi.vfo="28e645fdb266",mi.className="Util";function ze(a,y,x){bi(this),this.j=a,this.xa=y,this.o=x}ze.prototype.toString=function(){return"EnumValue."+this.xa};function gn(a,y){return y==null||y===""?null:a[y]}zi.Object.defineProperties(ze.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.xa}},value:{get:function(){return this.o}}}),ze.className="EnumValue";function nr(){this.ew=[]}nr.prototype.toString=function(){return this.ew.join("")},nr.prototype.add=function(a){a!==""&&this.ew.push(a)},nr.className="StringBuilder";function Sn(){}Sn.className="PropertyCollection";var Ke={EA:!1,JA:!1,GA:!1,IA:!1,NA:!1,LA:!1,nx:!1,FA:null,trace:function(a){Xe.console&&Xe.console.log(a)},HA:function(a,y,x,E){a.strokeStyle="red",a.fillStyle="red",a.font="8px sans-serif",a.beginPath(),a.moveTo(-10,0),a.lineTo(10,0),a.moveTo(0,-10),a.lineTo(0,10),a.stroke(),a.setTransform(1,0,0,1,0,0),a.scale(x,x),a.transform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy),a.lineWidth=2,a.beginPath(),a.moveTo(E.left,E.top+20),a.lineTo(E.left,E.top),a.lineTo(E.left+20,E.top),a.moveTo(E.right,E.bottom-20),a.lineTo(E.right,E.bottom),a.lineTo(E.right-20,E.bottom),a.stroke(),a.fillText("DB: "+Math.round(E.x)+", "+Math.round(E.y)+", "+Math.round(E.width)+", "+Math.round(E.height),E.left,E.top-5)},DA:function(a){var y={},x;for(x in a){if(y.x=x,y.x!=="licenseKey"){var E=a[y.x];if(E.prototype!==void 0){y.Zl=Object.getOwnPropertyNames(E.prototype);for(var b={Tj:0};b.Tj<y.Zl.length;b={Tj:b.Tj},b.Tj++){var z=Object.getOwnPropertyDescriptor(E.prototype,y.Zl[b.Tj]);z.get!==void 0&&z.set===void 0&&Object.defineProperty(E.prototype,y.Zl[b.Tj],{set:function(tt,it){return function(){throw Error("Property "+tt.Zl[it.Tj]+" of "+tt.x+" is read-only.")}}(y,b)})}}}y={Zl:y.Zl,x:y.x}}}};function Fe(){}Fe.prototype.reset=function(){},Fe.prototype.next=function(){return!1},Fe.prototype.Ad=function(){return!1},Fe.prototype.first=function(){return null},Fe.prototype.any=function(){return!1},Fe.prototype.all=function(){return!0},Fe.prototype.each=function(){return this},Fe.prototype.map=function(){return this},Fe.prototype.filter=function(){return this},Fe.prototype.de=function(){},Fe.prototype.toString=function(){return"EmptyIterator"},zi.Object.defineProperties(Fe.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}}),Fe.prototype.first=Fe.prototype.first,Fe.prototype.hasNext=Fe.prototype.Ad,Fe.prototype.next=Fe.prototype.next,Fe.prototype.reset=Fe.prototype.reset;var ke=null;Fe.className="EmptyIterator",ke=new Fe;function $e(a){this.key=-1,this.value=a}$e.prototype.reset=function(){this.key=-1},$e.prototype.next=function(){return this.key===-1?(this.key=0,!0):!1},$e.prototype.Ad=function(){return this.next()},$e.prototype.first=function(){return this.key=0,this.value},$e.prototype.any=function(a){return this.key=-1,a(this.value)},$e.prototype.all=function(a){return this.key=-1,a(this.value)},$e.prototype.each=function(a){return this.key=-1,a(this.value),this},$e.prototype.map=function(a){return new $e(a(this.value))},$e.prototype.filter=function(a){return a(this.value)?new $e(this.value):ke},$e.prototype.de=function(){this.value=null},$e.prototype.toString=function(){return"SingletonIterator("+this.value+")"},zi.Object.defineProperties($e.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}}),$e.prototype.first=$e.prototype.first,$e.prototype.hasNext=$e.prototype.Ad,$e.prototype.next=$e.prototype.next,$e.prototype.reset=$e.prototype.reset,$e.className="SingletonIterator";function pi(a){this.Bb=a,this.qf=null,a.Sa=null,this.qa=a.Ja,this.Za=-1}pi.prototype.reset=function(){var a=this.Bb;a.Sa=null,this.qa=a.Ja,this.Za=-1},pi.prototype.next=function(){var a=this.Bb;if(a.Ja!==this.qa&&0>this.key)return!1;a=a.s;var y=a.length,x=++this.Za,E=this.qf;if(E!==null)for(;x<y;){var b=a[x];if(E(b))return this.key=this.Za=x,this.value=b,!0;x++}else{if(x<y)return this.key=x,this.value=a[x],!0;this.de()}return!1},pi.prototype.Ad=function(){return this.next()},pi.prototype.first=function(){var a=this.Bb;this.qa=a.Ja,this.Za=0,a=a.s;var y=a.length,x=this.qf;if(x!==null){for(var E=0;E<y;){var b=a[E];if(x(b))return this.key=this.Za=E,this.value=b;E++}return null}return 0<y?(a=a[0],this.key=0,this.value=a):null},pi.prototype.any=function(a){var y=this.Bb;y.Sa=null,this.Za=-1,y=y.s;for(var x=y.length,E=this.qf,b=0;b<x;b++){var z=y[b];if((E===null||E(z))&&a(z))return!0}return!1},pi.prototype.all=function(a){var y=this.Bb;y.Sa=null,this.Za=-1,y=y.s;for(var x=y.length,E=this.qf,b=0;b<x;b++){var z=y[b];if((E===null||E(z))&&!a(z))return!1}return!0},pi.prototype.each=function(a){var y=this.Bb;y.Sa=null,this.Za=-1,y=y.s;for(var x=y.length,E=this.qf,b=0;b<x;b++){var z=y[b];(E===null||E(z))&&a(z)}return this},pi.prototype.map=function(a){var y=this.Bb;y.Sa=null,this.Za=-1;var x=[];y=y.s;for(var E=y.length,b=this.qf,z=0;z<E;z++){var tt=y[z];(b===null||b(tt))&&x.push(a(tt))}return a=new Me,a.s=x,a.xb(),a.iterator},pi.prototype.filter=function(a){var y=this.Bb;y.Sa=null,this.Za=-1;var x=[];y=y.s;for(var E=y.length,b=this.qf,z=0;z<E;z++){var tt=y[z];(b===null||b(tt))&&a(tt)&&x.push(tt)}return a=new Me,a.s=x,a.xb(),a.iterator},pi.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.qf=null,this.Bb.Sa=this},pi.prototype.toString=function(){return"ListIterator@"+this.Za+"/"+this.Bb.count},zi.Object.defineProperties(pi.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.qf},set:function(a){this.qf=a}},count:{get:function(){var a=this.qf;if(a!==null){for(var y=0,x=this.Bb.s,E=x.length,b=0;b<E;b++)a(x[b])&&y++;return y}return this.Bb.s.length}}}),pi.prototype.first=pi.prototype.first,pi.prototype.hasNext=pi.prototype.Ad,pi.prototype.next=pi.prototype.next,pi.prototype.reset=pi.prototype.reset,pi.className="ListIterator";function Ei(a){this.Bb=a,a.Hg=null,this.qa=a.Ja,this.Za=a.s.length}Ei.prototype.reset=function(){var a=this.Bb;a.Hg=null,this.qa=a.Ja,this.Za=a.s.length},Ei.prototype.next=function(){var a=this.Bb;if(a.Ja!==this.qa&&0>this.key)return!1;var y=--this.Za;return 0<=y?(this.key=y,this.value=a.s[y],!0):(this.de(),!1)},Ei.prototype.Ad=function(){return this.next()},Ei.prototype.first=function(){var a=this.Bb;this.qa=a.Ja;var y=a.s;return this.Za=a=y.length-1,0<=a?(y=y[a],this.key=a,this.value=y):null},Ei.prototype.any=function(a){var y=this.Bb;y.Hg=null,y=y.s;var x=y.length;for(this.Za=x,--x;0<=x;x--)if(a(y[x]))return!0;return!1},Ei.prototype.all=function(a){var y=this.Bb;y.Hg=null,y=y.s;var x=y.length;for(this.Za=x,--x;0<=x;x--)if(!a(y[x]))return!1;return!0},Ei.prototype.each=function(a){var y=this.Bb;y.Hg=null,y=y.s;var x=y.length;for(this.Za=x,--x;0<=x;x--)a(y[x]);return this},Ei.prototype.map=function(a){var y=this.Bb;y.Hg=null;var x=[];y=y.s;var E=y.length;for(this.Za=E,--E;0<=E;E--)x.push(a(y[E]));return a=new Me,a.s=x,a.xb(),a.iterator},Ei.prototype.filter=function(a){var y=this.Bb;y.Hg=null;var x=[];y=y.s;var E=y.length;for(this.Za=E,--E;0<=E;E--){var b=y[E];a(b)&&x.push(b)}return a=new Me,a.s=x,a.xb(),a.iterator},Ei.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.Bb.Hg=this},Ei.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"},zi.Object.defineProperties(Ei.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}}),Ei.prototype.first=Ei.prototype.first,Ei.prototype.hasNext=Ei.prototype.Ad,Ei.prototype.next=Ei.prototype.next,Ei.prototype.reset=Ei.prototype.reset,Ei.className="ListIteratorBackwards";function Me(a){bi(this),this._isFrozen=!1,this.s=[],this.Ja=0,this.Hg=this.Sa=null,typeof a=="string"&&It("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}yt=Me.prototype,yt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},yt.freeze=function(){return this._isFrozen=!0,this},yt.ka=function(){return this._isFrozen=!1,this},yt.toString=function(){return"List()#"+kn(this)},yt.add=function(a){return a===null?this:(this._isFrozen&&se(this,a),this.s.push(a),this.xb(),this)},yt.push=function(a){this.add(a)},yt.addAll=function(a){if(a===null)return this;this._isFrozen&&se(this);var y=this.s;if(Ti(a))for(var x=a.length,E=0;E<x;E++)y.push(a[E]);else for(a=a.iterator;a.next();)y.push(a.value);return this.xb(),this},yt.clear=function(){this._isFrozen&&se(this),this.s.length=0,this.xb()},yt.contains=function(a){return a===null?!1:this.s.indexOf(a)!==-1},yt.has=function(a){return this.contains(a)},yt.indexOf=function(a){return a===null?-1:this.s.indexOf(a)},yt.M=function(a){var y=this.s;return(0>a||a>=y.length)&&xi(a,"0 <= i < length",Me,"elt:i"),y[a]},yt.get=function(a){return this.M(a)},yt.cd=function(a,y){var x=this.s;(0>a||a>=x.length)&&xi(a,"0 <= i < length",Me,"setElt:i"),this._isFrozen&&se(this,a),x[a]=y},yt.set=function(a,y){this.cd(a,y)},yt.first=function(){var a=this.s;return a.length===0?null:a[0]},yt.jc=function(){var a=this.s,y=a.length;return 0<y?a[y-1]:null},yt.pop=function(){this._isFrozen&&se(this);var a=this.s;return 0<a.length?a.pop():null},Me.prototype.any=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)if(a(y[E]))return!0;return!1},Me.prototype.all=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)if(!a(y[E]))return!1;return!0},Me.prototype.each=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)a(y[E]);return this},Me.prototype.map=function(a){for(var y=new Me,x=[],E=this.s,b=E.length,z=0;z<b;z++)x.push(a(E[z]));return y.s=x,y.xb(),y},Me.prototype.filter=function(a){for(var y=new Me,x=[],E=this.s,b=E.length,z=0;z<b;z++){var tt=E[z];a(tt)&&x.push(tt)}return y.s=x,y.xb(),y},yt=Me.prototype,yt.Gb=function(a,y){0>a&&xi(a,">= 0",Me,"insertAt:i"),this._isFrozen&&se(this,a);var x=this.s;a>=x.length?x.push(y):x.splice(a,0,y),this.xb()},yt.remove=function(a){if(a===null)return!1;this._isFrozen&&se(this,a);var y=this.s;return a=y.indexOf(a),a===-1?!1:(a===y.length-1?y.pop():y.splice(a,1),this.xb(),!0)},yt.delete=function(a){return this.remove(a)},yt.mb=function(a){var y=this.s;(0>a||a>=y.length)&&xi(a,"0 <= i < length",Me,"removeAt:i"),this._isFrozen&&se(this,a),a===y.length-1?y.pop():y.splice(a,1),this.xb()},yt.removeRange=function(a,y){var x=this.s,E=x.length;if(0>a)a=0;else if(a>=E)return this;if(0>y)return this;if(y>=E&&(y=E-1),a>y)return this;this._isFrozen&&se(this);for(var b=a,z=y+1;z<E;)x[b++]=x[z++];return x.length=E-(y-a+1),this.xb(),this},Me.prototype.copy=function(){var a=new Me,y=this.s;return 0<y.length&&(a.s=Array.prototype.slice.call(y)),a},yt=Me.prototype,yt.Fa=function(){for(var a=this.s,y=this.count,x=Array(y),E=0;E<y;E++)x[E]=a[E];return x},yt.Iv=function(){for(var a=new _e,y=this.s,x=this.count,E=0;E<x;E++)a.add(y[E]);return a},yt.sort=function(a){return this._isFrozen&&se(this),this.s.sort(a),this.xb(),this},yt.zi=function(a,y,x){var E=this.s,b=E.length;y===void 0&&(y=0),x===void 0&&(x=b),this._isFrozen&&se(this);var z=x-y;if(1>=z)return this;if((0>y||y>=b-1)&&xi(y,"0 <= from < length",Me,"sortRange:from"),z===2)return x=E[y],b=E[y+1],0<a(x,b)&&(E[y]=b,E[y+1]=x,this.xb()),this;if(y===0)if(x>=b)E.sort(a);else for(y=E.slice(0,x),y.sort(a),a=0;a<x;a++)E[a]=y[a];else if(x>=b)for(x=E.slice(y),x.sort(a),a=y;a<b;a++)E[a]=x[a-y];else for(b=E.slice(y,x),b.sort(a),a=y;a<x;a++)E[a]=b[a-y];return this.xb(),this},yt.reverse=function(){return this._isFrozen&&se(this),this.s.reverse(),this.xb(),this},zi.Object.defineProperties(Me.prototype,{_dataArray:{get:function(){return this.s}},count:{get:function(){return this.s.length}},size:{get:function(){return this.s.length}},length:{get:function(){return this.s.length}},iterator:{get:function(){if(0>=this.s.length)return ke;var a=this.Sa;return a!==null?(a.reset(),a):new pi(this)}},iteratorBackwards:{get:function(){if(0>=this.s.length)return ke;var a=this.Hg;return a!==null?(a.reset(),a):new Ei(this)}}}),Me.prototype.reverse=Me.prototype.reverse,Me.prototype.sortRange=Me.prototype.zi,Me.prototype.sort=Me.prototype.sort,Me.prototype.toSet=Me.prototype.Iv,Me.prototype.toArray=Me.prototype.Fa,Me.prototype.removeRange=Me.prototype.removeRange,Me.prototype.removeAt=Me.prototype.mb,Me.prototype.delete=Me.prototype.delete,Me.prototype.remove=Me.prototype.remove,Me.prototype.insertAt=Me.prototype.Gb,Me.prototype.pop=Me.prototype.pop,Me.prototype.last=Me.prototype.jc,Me.prototype.first=Me.prototype.first,Me.prototype.set=Me.prototype.set,Me.prototype.setElt=Me.prototype.cd,Me.prototype.get=Me.prototype.get,Me.prototype.elt=Me.prototype.M,Me.prototype.indexOf=Me.prototype.indexOf,Me.prototype.has=Me.prototype.has,Me.prototype.contains=Me.prototype.contains,Me.prototype.clear=Me.prototype.clear,Me.prototype.addAll=Me.prototype.addAll,Me.prototype.push=Me.prototype.push,Me.prototype.add=Me.prototype.add,Me.prototype.thaw=Me.prototype.ka,Me.prototype.freeze=Me.prototype.freeze,Me.className="List";function cn(a){this.eg=a,a.Sa=null,this.qa=a.Ja,this.sa=null}cn.prototype.reset=function(){var a=this.eg;a.Sa=null,this.qa=a.Ja,this.sa=null},cn.prototype.next=function(){var a=this.eg;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.value=y.value,this.key=y.key,!0):(this.de(),!1)},cn.prototype.Ad=function(){return this.next()},cn.prototype.first=function(){var a=this.eg;if(this.qa=a.Ja,a=a.ea,a!==null){this.sa=a;var y=a.value;return this.key=a.key,this.value=y}return null},cn.prototype.any=function(a){var y=this.eg;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},cn.prototype.all=function(a){var y=this.eg;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},cn.prototype.each=function(a){var y=this.eg;for(this.sa=y.Sa=null,y=y.ea;y!==null;)a(y.value),y=y.va;return this},cn.prototype.map=function(a){var y=this.eg;y.Sa=null;var x=new Me;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},cn.prototype.filter=function(a){var y=this.eg;y.Sa=null;var x=new Me;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},cn.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.eg.Sa=this},cn.prototype.toString=function(){return this.sa!==null?"SetIterator@"+this.sa.value:"SetIterator"},zi.Object.defineProperties(cn.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Sb}}}),cn.prototype.first=cn.prototype.first,cn.prototype.hasNext=cn.prototype.Ad,cn.prototype.next=cn.prototype.next,cn.prototype.reset=cn.prototype.reset,cn.className="SetIterator";function _e(a){bi(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof a=="string"&&It("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}yt=_e.prototype,yt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},yt.freeze=function(){return this._isFrozen=!0,this},yt.ka=function(){return this._isFrozen=!1,this},yt.toString=function(){return"Set()#"+kn(this)},yt.add=function(a){if(a===null)return this;this._isFrozen&&se(this,a);var y=a;return Oe(a)&&(y=pn(a)),this.Tb[y]===void 0&&(this.Sb++,a=new Fr(a,a),this.Tb[y]=a,y=this.kf,y===null?this.ea=a:(a.ll=y,y.va=a),this.kf=a,this.xb()),this},yt.addAll=function(a){if(a===null)return this;if(this._isFrozen&&se(this),Ti(a))for(var y=a.length,x=0;x<y;x++)this.add(a[x]);else for(a=a.iterator;a.next();)this.add(a.value);return this},yt.contains=function(a){if(a===null)return!1;var y=a;return Oe(a)&&(y=kn(a),y===void 0)?!1:this.Tb[y]!==void 0},yt.has=function(a){return this.contains(a)},yt.Sy=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0},yt.Ty=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1},yt.first=function(){var a=this.ea;return a===null?null:a.value},_e.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},_e.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},_e.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y.value),y=y.va;return this},_e.prototype.map=function(a){for(var y=new _e,x=this.ea;x!==null;)y.add(a(x.value)),x=x.va;return y},_e.prototype.filter=function(a){for(var y=new _e,x=this.ea;x!==null;){var E=x.value;a(E)&&y.add(E),x=x.va}return y},yt=_e.prototype,yt.remove=function(a){if(a===null)return!1;this._isFrozen&&se(this,a);var y=a;if(Oe(a)&&(y=kn(a),y===void 0)||(a=this.Tb[y],a===void 0))return!1;var x=a.va,E=a.ll;return x!==null&&(x.ll=E),E!==null&&(E.va=x),this.ea===a&&(this.ea=x),this.kf===a&&(this.kf=E),delete this.Tb[y],this.Sb--,this.xb(),!0},yt.delete=function(a){return this.remove(a)},yt.hp=function(a){if(a===null)return this;if(this._isFrozen&&se(this),Ti(a))for(var y=a.length,x=0;x<y;x++)this.remove(a[x]);else for(a=a.iterator;a.next();)this.remove(a.value);return this},yt.pA=function(a){if(a===null||this.count===0)return this;this._isFrozen&&se(this);var y=new _e;y.addAll(a),a=[];for(var x=this.iterator;x.next();){var E=x.value;y.contains(E)||a.push(E)}return this.hp(a),this},yt.clear=function(){this._isFrozen&&se(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.kf=this.ea=null,this.xb()},_e.prototype.copy=function(){var a=new _e,y=this.Tb,x;for(x in y)a.add(y[x].value);return a},_e.prototype.Fa=function(){var a=Array(this.Sb),y=this.Tb,x=0,E;for(E in y)a[x]=y[E].value,x++;return a},_e.prototype.Hv=function(){var a=new Me,y=this.Tb,x;for(x in y)a.add(y[x].value);return a};function bi(a){a.__gohashid=zn++}function pn(a){var y=a.__gohashid;return y===void 0&&(y=zn++,a.__gohashid=y),y}function kn(a){return a.__gohashid}zi.Object.defineProperties(_e.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.Sb)return ke;var a=this.Sa;return a!==null?(a.reset(),a):new cn(this)}}}),_e.prototype.toList=_e.prototype.Hv,_e.prototype.toArray=_e.prototype.Fa,_e.prototype.clear=_e.prototype.clear,_e.prototype.retainAll=_e.prototype.pA,_e.prototype.removeAll=_e.prototype.hp,_e.prototype.delete=_e.prototype.delete,_e.prototype.remove=_e.prototype.remove,_e.prototype.first=_e.prototype.first,_e.prototype.containsAny=_e.prototype.Ty,_e.prototype.containsAll=_e.prototype.Sy,_e.prototype.has=_e.prototype.has,_e.prototype.contains=_e.prototype.contains,_e.prototype.addAll=_e.prototype.addAll,_e.prototype.add=_e.prototype.add,_e.prototype.thaw=_e.prototype.ka,_e.prototype.freeze=_e.prototype.freeze;var zn=1;_e.className="Set",_e.uniqueHash=bi,_e.hashIdUnique=pn,_e.hashId=kn;function Bn(a){this.ma=a,this.qa=a.Ja,this.sa=null}Bn.prototype.reset=function(){this.qa=this.ma.Ja,this.sa=null},Bn.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.value=this.key=a=y.key,!0):(this.de(),!1)},Bn.prototype.Ad=function(){return this.next()},Bn.prototype.first=function(){var a=this.ma;return this.qa=a.Ja,a=a.ea,a!==null?(this.sa=a,this.value=this.key=a=a.key):null},Bn.prototype.any=function(a){var y=this.ma;for(this.sa=null,y=y.ea;y!==null;){if(a(y.key))return!0;y=y.va}return!1},Bn.prototype.all=function(a){var y=this.ma;for(this.sa=null,y=y.ea;y!==null;){if(!a(y.key))return!1;y=y.va}return!0},Bn.prototype.each=function(a){var y=this.ma;for(this.sa=null,y=y.ea;y!==null;)a(y.key),y=y.va;return this},Bn.prototype.map=function(a){var y=this.ma;this.sa=null;var x=new Me;for(y=y.ea;y!==null;)x.add(a(y.key)),y=y.va;return x.iterator},Bn.prototype.filter=function(a){var y=this.ma;this.sa=null;var x=new Me;for(y=y.ea;y!==null;){var E=y.key;a(E)&&x.add(E),y=y.va}return x.iterator},Bn.prototype.de=function(){this.value=this.key=null,this.qa=-1},Bn.prototype.toString=function(){return this.sa!==null?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"},zi.Object.defineProperties(Bn.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Bn.prototype.first=Bn.prototype.first,Bn.prototype.hasNext=Bn.prototype.Ad,Bn.prototype.next=Bn.prototype.next,Bn.prototype.reset=Bn.prototype.reset,Bn.className="MapKeySetIterator";function Tn(a){_e.call(this),bi(this),this._isFrozen=!0,this.ma=a}Vi(Tn,_e),yt=Tn.prototype,yt.freeze=function(){return this},yt.ka=function(){return this},yt.toString=function(){return"MapKeySet("+this.ma.toString()+")"},yt.add=function(){It("This Set is read-only: "+this.toString())},yt.contains=function(a){return this.ma.contains(a)},yt.has=function(a){return this.contains(a)},yt.remove=function(){It("This Set is read-only: "+this.toString())},yt.delete=function(a){return this.remove(a)},yt.clear=function(){It("This Set is read-only: "+this.toString())},yt.first=function(){var a=this.ma.ea;return a!==null?a.key:null},Tn.prototype.any=function(a){for(var y=this.ma.ea;y!==null;){if(a(y.key))return!0;y=y.va}return!1},Tn.prototype.all=function(a){for(var y=this.ma.ea;y!==null;){if(!a(y.key))return!1;y=y.va}return!0},Tn.prototype.each=function(a){for(var y=this.ma.ea;y!==null;)a(y.key),y=y.va;return this},Tn.prototype.map=function(a){for(var y=new _e,x=this.ma.ea;x!==null;)y.add(a(x.key)),x=x.va;return y},Tn.prototype.filter=function(a){for(var y=new _e,x=this.ma.ea;x!==null;){var E=x.key;a(E)&&y.add(E),x=x.va}return y},Tn.prototype.copy=function(){return new Tn(this.ma)},Tn.prototype.Iv=function(){var a=new _e,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},Tn.prototype.Fa=function(){var a=this.ma.Tb,y=Array(this.ma.Sb),x=0,E;for(E in a)y[x]=a[E].key,x++;return y},Tn.prototype.Hv=function(){var a=new Me,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},zi.Object.defineProperties(Tn.prototype,{count:{get:function(){return this.ma.Sb}},size:{get:function(){return this.ma.Sb}},iterator:{get:function(){return 0>=this.ma.Sb?ke:new Bn(this.ma)}}}),Tn.prototype.toList=Tn.prototype.Hv,Tn.prototype.toArray=Tn.prototype.Fa,Tn.prototype.toSet=Tn.prototype.Iv,Tn.prototype.first=Tn.prototype.first,Tn.prototype.clear=Tn.prototype.clear,Tn.prototype.delete=Tn.prototype.delete,Tn.prototype.remove=Tn.prototype.remove,Tn.prototype.has=Tn.prototype.has,Tn.prototype.contains=Tn.prototype.contains,Tn.prototype.add=Tn.prototype.add,Tn.prototype.thaw=Tn.prototype.ka,Tn.prototype.freeze=Tn.prototype.freeze,Tn.className="MapKeySet";function or(a){this.ma=a,a.jf=null,this.qa=a.Ja,this.sa=null}or.prototype.reset=function(){var a=this.ma;a.jf=null,this.qa=a.Ja,this.sa=null},or.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.value=y.value,this.key=y.key,!0):(this.de(),!1)},or.prototype.Ad=function(){return this.next()},or.prototype.first=function(){var a=this.ma;if(this.qa=a.Ja,a=a.ea,a!==null){this.sa=a;var y=a.value;return this.key=a.key,this.value=y}return null},or.prototype.any=function(a){var y=this.ma;for(this.sa=y.jf=null,y=y.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},or.prototype.all=function(a){var y=this.ma;for(this.sa=y.jf=null,y=y.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},or.prototype.each=function(a){var y=this.ma;for(this.sa=y.jf=null,y=y.ea;y!==null;)a(y.value),y=y.va;return this},or.prototype.map=function(a){var y=this.ma;this.sa=y.jf=null;var x=new Me;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},or.prototype.filter=function(a){var y=this.ma;this.sa=y.jf=null;var x=new Me;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},or.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.jf=this},or.prototype.toString=function(){return this.sa!==null?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"},zi.Object.defineProperties(or.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),or.prototype.first=or.prototype.first,or.prototype.hasNext=or.prototype.Ad,or.prototype.next=or.prototype.next,or.prototype.reset=or.prototype.reset,or.className="MapValueSetIterator";function Fr(a,y){this.key=a,this.value=y,this.ll=this.va=null}Fr.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"},Fr.className="KeyValuePair";function Zn(a){this.ma=a,a.Sa=null,this.qa=a.Ja,this.sa=null}Zn.prototype.reset=function(){var a=this.ma;a.Sa=null,this.qa=a.Ja,this.sa=null},Zn.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.key=y.key,this.value=y.value,!0):(this.de(),!1)},Zn.prototype.Ad=function(){return this.next()},Zn.prototype.first=function(){var a=this.ma;return this.qa=a.Ja,a=a.ea,a!==null?(this.sa=a,this.key=a.key,this.value=a.value,a):null},Zn.prototype.any=function(a){var y=this.ma;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(a(y))return!0;y=y.va}return!1},Zn.prototype.all=function(a){var y=this.ma;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(!a(y))return!1;y=y.va}return!0},Zn.prototype.each=function(a){var y=this.ma;for(this.sa=y.Sa=null,y=y.ea;y!==null;)a(y),y=y.va;return this},Zn.prototype.map=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new Me;for(y=y.ea;y!==null;)x.add(a(y)),y=y.va;return x.iterator},Zn.prototype.filter=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new Me;for(y=y.ea;y!==null;)a(y)&&x.add(y),y=y.va;return x.iterator},Zn.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.Sa=this},Zn.prototype.toString=function(){return this.sa!==null?"MapIterator@"+this.sa:"MapIterator"},zi.Object.defineProperties(Zn.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Zn.prototype.first=Zn.prototype.first,Zn.prototype.hasNext=Zn.prototype.Ad,Zn.prototype.next=Zn.prototype.next,Zn.prototype.reset=Zn.prototype.reset,Zn.className="MapIterator";function ji(a){bi(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.jf=this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof a=="string"&&It("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}yt=ji.prototype,yt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},yt.freeze=function(){return this._isFrozen=!0,this},yt.ka=function(){return this._isFrozen=!1,this},yt.toString=function(){return"Map()#"+kn(this)},yt.add=function(a,y){this._isFrozen&&se(this,a);var x=a;Oe(a)&&(x=pn(a));var E=this.Tb[x];return E===void 0?(this.Sb++,a=new Fr(a,y),this.Tb[x]=a,x=this.kf,x===null?this.ea=a:(a.ll=x,x.va=a),this.kf=a,this.xb()):E.value=y,this},yt.set=function(a,y){return this.add(a,y)},yt.addAll=function(a){if(a===null)return this;if(Ti(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];this.add(E.key,E.value)}else if(a instanceof ji)for(a=a.iterator;a.next();)this.add(a.key,a.value);else for(a=a.iterator;a.next();)y=a.value,this.add(y.key,y.value);return this},yt.first=function(){return this.ea},ji.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y))return!0;y=y.va}return!1},ji.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y))return!1;y=y.va}return!0},ji.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y),y=y.va;return this},ji.prototype.map=function(a){for(var y=new ji,x=this.ea;x!==null;)y.add(x.key,a(x)),x=x.va;return y},ji.prototype.filter=function(a){for(var y=new ji,x=this.ea;x!==null;)a(x)&&y.add(x.key,x.value),x=x.va;return y},yt=ji.prototype,yt.contains=function(a){var y=a;return Oe(a)&&(y=kn(a),y===void 0)?!1:this.Tb[y]!==void 0},yt.has=function(a){return this.contains(a)},yt.I=function(a){var y=a;return Oe(a)&&(y=kn(a),y===void 0)?null:(a=this.Tb[y],a===void 0?null:a.value)},yt.get=function(a){return this.I(a)},yt.remove=function(a){if(a===null)return!1;this._isFrozen&&se(this,a);var y=a;if(Oe(a)&&(y=kn(a),y===void 0)||(a=this.Tb[y],a===void 0))return!1;var x=a.va,E=a.ll;return x!==null&&(x.ll=E),E!==null&&(E.va=x),this.ea===a&&(this.ea=x),this.kf===a&&(this.kf=E),delete this.Tb[y],this.Sb--,this.xb(),!0},yt.delete=function(a){return this.remove(a)},yt.clear=function(){this._isFrozen&&se(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.jf!==null&&this.jf.reset(),this.kf=this.ea=null,this.xb()},ji.prototype.copy=function(){var a=new ji,y=this.Tb,x;for(x in y){var E=y[x];a.add(E.key,E.value)}return a},ji.prototype.Fa=function(){var a=this.Tb,y=Array(this.Sb),x=0,E;for(E in a){var b=a[E];y[x]=new Fr(b.key,b.value),x++}return y},ji.prototype.Lf=function(){return new Tn(this)},zi.Object.defineProperties(ji.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.count)return ke;var a=this.Sa;return a!==null?(a.reset(),a):new Zn(this)}},iteratorKeys:{get:function(){return 0>=this.count?ke:new Bn(this)}},iteratorValues:{get:function(){if(0>=this.count)return ke;var a=this.jf;return a!==null?(a.reset(),a):new or(this)}}}),ji.prototype.toKeySet=ji.prototype.Lf,ji.prototype.toArray=ji.prototype.Fa,ji.prototype.clear=ji.prototype.clear,ji.prototype.delete=ji.prototype.delete,ji.prototype.remove=ji.prototype.remove,ji.prototype.get=ji.prototype.get,ji.prototype.getValue=ji.prototype.I,ji.prototype.has=ji.prototype.has,ji.prototype.contains=ji.prototype.contains,ji.prototype.first=ji.prototype.first,ji.prototype.addAll=ji.prototype.addAll,ji.prototype.set=ji.prototype.set,ji.prototype.add=ji.prototype.add,ji.prototype.thaw=ji.prototype.ka,ji.prototype.freeze=ji.prototype.freeze,ji.className="Map";function Pt(a,y){a===void 0?this.y=this.x=0:typeof a=="number"&&typeof y=="number"?(this.x=a,this.y=y):It("Invalid arguments to Point constructor: "+a+", "+y),this._isFrozen=!1}var gr,Un,Ar,Dr,Cr;Pt.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this},Pt.prototype.h=function(a,y){return this.x=a,this.y=y,this},Pt.prototype.sg=function(a,y){return this.x=a,this.y=y,this},Pt.prototype.set=function(a){return this.x=a.x,this.y=a.y,this},Pt.prototype.copy=function(){var a=new Pt;return a.x=this.x,a.y=this.y,a},yt=Pt.prototype,yt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},yt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},yt.freeze=function(){return this._isFrozen=!0,this},yt.ka=function(){return Object.isFrozen(this)&&It("cannot thaw constant: "+this),this._isFrozen=!1,this};function sn(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;return(E=a[y++])&&(b=parseFloat(E)),new Pt(x,b)}return new Pt}function vn(a){return a.x.toString()+" "+a.y.toString()}yt.toString=function(){return"Point("+this.x+","+this.y+")"},yt.D=function(a){return a instanceof Pt?this.x===a.x&&this.y===a.y:!1},yt.hi=function(a,y){return this.x===a&&this.y===y},yt.Xa=function(a){return Gt.B(this.x,a.x)&&Gt.B(this.y,a.y)},yt.add=function(a){return this.x+=a.x,this.y+=a.y,this},yt.re=function(a){return this.x-=a.x,this.y-=a.y,this},yt.offset=function(a,y){return this.x+=a,this.y+=y,this},Pt.prototype.rotate=function(a){if(a===0)return this;var y=this.x,x=this.y;if(y===0&&x===0)return this;if(360<=a?a-=360:0>a&&(a+=360),a===90){a=0;var E=1}else a===180?(a=-1,E=0):a===270?(a=0,E=-1):(E=a*Math.PI/180,a=Math.cos(E),E=Math.sin(E));return this.x=a*y-E*x,this.y=E*y+a*x,this},yt=Pt.prototype,yt.scale=function(a,y){return this.x*=a,this.y*=y,this},yt.Bf=function(a){var y=a.x-this.x;return a=a.y-this.y,y*y+a*a},yt.zd=function(a,y){return a-=this.x,y-=this.y,a*a+y*y},yt.normalize=function(){var a=this.x,y=this.y,x=Math.sqrt(a*a+y*y);return 0<x&&(this.x=a/x,this.y=y/x),this},yt.ab=function(a){return Yn(a.x-this.x,a.y-this.y)},yt.direction=function(a,y){return Yn(a-this.x,y-this.y)};function Yn(a,y){if(a===0)return 0<y?90:0>y?270:0;if(y===0)return 0<a?0:180;if(isNaN(a)||isNaN(y))return 0;var x=180*Math.atan(Math.abs(y/a))/Math.PI;return 0>a?x=0>y?x+180:180-x:0>y&&(x=360-x),x}yt.Ry=function(a,y){return Gt.Fl(a.x,a.y,y.x,y.y,this.x,this.y)},yt.fA=function(a,y,x,E){return Gt.qh(a,y,x,E,this.x,this.y,this),this},yt.gA=function(a,y){return Gt.qh(a.x,a.y,y.x,y.y,this.x,this.y,this),this},yt.uA=function(a,y,x,E){return Gt.No(this.x,this.y,a,y,x,E,this),this},yt.vA=function(a,y){return Gt.No(this.x,this.y,a.x,a.y,y.width,y.height,this),this},yt.xi=function(a,y){return this.x=a.x+y.x*a.width+y.offsetX,this.y=a.y+y.y*a.height+y.offsetY,this},yt.yi=function(a,y,x,E,b){return this.x=a+b.x*x+b.offsetX,this.y=y+b.y*E+b.offsetY,this},yt.transform=function(a){return a.Ga(this),this};function Gi(a,y){return y.Cd(a),a}function mn(a,y,x,E,b,z){var tt=b-x,it=z-E,nt=tt*tt+it*it;x-=a,E-=y;var ot=-x*tt-E*it;return 0>=ot||ot>=nt?(tt=b-a,it=z-y,Math.min(x*x+E*E,tt*tt+it*it)):(a=tt*E-it*x,a*a/nt)}function Kn(a,y,x,E){return a=x-a,y=E-y,a*a+y*y}function un(a,y,x,E){return a=x-a,y=E-y,a===0?0<y?90:0>y?270:0:y===0?0<a?0:180:isNaN(a)||isNaN(y)?0:(E=180*Math.atan(Math.abs(y/a))/Math.PI,0>a?E=0>y?E+180:180-E:0>y&&(E=360-E),E)}yt.w=function(){return isFinite(this.x)&&isFinite(this.y)},Pt.alloc=function(){var a=Wi.pop();return a===void 0?new Pt:a},Pt.allocAt=function(a,y){var x=Wi.pop();return x===void 0?new Pt(a,y):(x.x=a,x.y=y,x)},Pt.free=function(a){Wi.push(a)},Pt.prototype.isReal=Pt.prototype.w,Pt.prototype.setSpot=Pt.prototype.yi,Pt.prototype.setRectSpot=Pt.prototype.xi,Pt.prototype.snapToGridPoint=Pt.prototype.vA,Pt.prototype.snapToGrid=Pt.prototype.uA,Pt.prototype.projectOntoLineSegmentPoint=Pt.prototype.gA,Pt.prototype.projectOntoLineSegment=Pt.prototype.fA,Pt.intersectingLineSegments=function(a,y,x,E,b,z,tt,it){return Gt.Rl(a,y,x,E,b,z,tt,it)},Pt.prototype.compareWithLineSegmentPoint=Pt.prototype.Ry,Pt.compareWithLineSegment=function(a,y,x,E,b,z){return Gt.Fl(a,y,x,E,b,z)},Pt.prototype.direction=Pt.prototype.direction,Pt.prototype.directionPoint=Pt.prototype.ab,Pt.prototype.normalize=Pt.prototype.normalize,Pt.prototype.distanceSquared=Pt.prototype.zd,Pt.prototype.distanceSquaredPoint=Pt.prototype.Bf,Pt.prototype.scale=Pt.prototype.scale,Pt.prototype.rotate=Pt.prototype.rotate,Pt.prototype.offset=Pt.prototype.offset,Pt.prototype.subtract=Pt.prototype.re,Pt.prototype.add=Pt.prototype.add,Pt.prototype.equalsApprox=Pt.prototype.Xa,Pt.prototype.equalTo=Pt.prototype.hi,Pt.prototype.equals=Pt.prototype.D,Pt.prototype.set=Pt.prototype.set,Pt.prototype.setTo=Pt.prototype.sg;var Wi=[];Pt.className="Point",Pt.parse=sn,Pt.stringify=vn,Pt.distanceLineSegmentSquared=mn,Pt.distanceSquared=Kn,Pt.direction=un,Pt.Origin=gr=new Pt(0,0).ja(),Pt.InfiniteTopLeft=Un=new Pt(-1/0,-1/0).ja(),Pt.InfiniteBottomRight=Ar=new Pt(1/0,1/0).ja(),Pt.SixPoint=Dr=new Pt(6,6).ja(),Pt.NoPoint=Cr=new Pt(NaN,NaN).ja(),Pt.parse=sn,Pt.stringify=vn,Pt.distanceLineSegmentSquared=mn,Pt.distanceSquared=Kn,Pt.direction=un;function li(a,y){a===void 0?this.height=this.width=0:typeof a=="number"&&(0<=a||isNaN(a))&&typeof y=="number"&&(0<=y||isNaN(y))?(this.width=a,this.height=y):It("Invalid arguments to Size constructor: "+a+", "+y),this._isFrozen=!1}var Pn,wr,Tr,Lr,Xr,oo,so;li.prototype.assign=function(a){return this.width=a.width,this.height=a.height,this},li.prototype.h=function(a,y){return this.width=a,this.height=y,this},li.prototype.sg=function(a,y){return this.width=a,this.height=y,this},li.prototype.set=function(a){return this.width=a.width,this.height=a.height,this},li.prototype.copy=function(){var a=new li;return a.width=this.width,a.height=this.height,a},yt=li.prototype,yt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},yt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},yt.freeze=function(){return this._isFrozen=!0,this},yt.ka=function(){return Object.isFrozen(this)&&It("cannot thaw constant: "+this),this._isFrozen=!1,this};function bo(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;return(E=a[y++])&&(b=parseFloat(E)),new li(x,b)}return new li}function io(a){return a.width.toString()+" "+a.height.toString()}yt.toString=function(){return"Size("+this.width+","+this.height+")"},yt.D=function(a){return a instanceof li?this.width===a.width&&this.height===a.height:!1},yt.hi=function(a,y){return this.width===a&&this.height===y},yt.Xa=function(a){return Gt.B(this.width,a.width)&&Gt.B(this.height,a.height)},yt.Bc=function(a,y){return a=this.width+a,this.width=0<=a?a:0,y=this.height+y,this.height=0<=y?y:0,this},yt.w=function(){return isFinite(this.width)&&isFinite(this.height)},li.alloc=function(){var a=go.pop();return a===void 0?new li:a},li.free=function(a){go.push(a)},li.prototype.isReal=li.prototype.w,li.prototype.inflate=li.prototype.Bc,li.prototype.equalsApprox=li.prototype.Xa,li.prototype.equalTo=li.prototype.hi,li.prototype.equals=li.prototype.D,li.prototype.set=li.prototype.set,li.prototype.setTo=li.prototype.sg;var go=[];li.className="Size",li.parse=bo,li.stringify=io,li.ZeroSize=Pn=new li(0,0).ja(),li.OneSize=wr=new li(1,1).ja(),li.SixSize=Tr=new li(6,6).ja(),li.EightSize=Lr=new li(8,8).ja(),li.TenSize=Xr=new li(10,10).ja(),li.InfiniteSize=oo=new li(1/0,1/0).ja(),li.NoSize=so=new li(NaN,NaN).ja(),li.parse=bo,li.stringify=io;function be(a,y,x,E){a===void 0?this.height=this.width=this.y=this.x=0:typeof a=="number"&&typeof y=="number"&&typeof x=="number"&&(0<=x||isNaN(x))&&typeof E=="number"&&(0<=E||isNaN(E))?(this.x=a,this.y=y,this.width=x,this.height=E):a instanceof Pt?(x=a.x,a=a.y,y instanceof Pt?(E=y.x,y=y.y,this.x=Math.min(x,E),this.y=Math.min(a,y),this.width=Math.abs(x-E),this.height=Math.abs(a-y)):y instanceof li?(this.x=x,this.y=a,this.width=y.width,this.height=y.height):It("Incorrect second argument supplied to Rect constructor "+y)):It("Invalid arguments to Rect constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}yt=be.prototype,yt.assign=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},yt.h=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this};function Oo(a,y,x){a.width=y,a.height=x}yt.sg=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this},yt.set=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},yt.dd=function(a){return this.x=a.x,this.y=a.y,this},yt.tA=function(a){return this.width=a.width,this.height=a.height,this},be.prototype.copy=function(){var a=new be;return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},yt=be.prototype,yt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},yt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},yt.freeze=function(){return this._isFrozen=!0,this},yt.ka=function(){return Object.isFrozen(this)&&It("cannot thaw constant: "+this),this._isFrozen=!1,this};function rs(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;(E=a[y++])&&(b=parseFloat(E));for(var z=0;a[y]==="";)y++;(E=a[y++])&&(z=parseFloat(E));for(var tt=0;a[y]==="";)y++;return(E=a[y++])&&(tt=parseFloat(E)),new be(x,b,z,tt)}return new be}function po(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}yt.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"},yt.D=function(a){return a instanceof be?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1},yt.hi=function(a,y,x,E){return this.x===a&&this.y===y&&this.width===x&&this.height===E},yt.Xa=function(a){return Gt.B(this.x,a.x)&&Gt.B(this.y,a.y)&&Gt.B(this.width,a.width)&&Gt.B(this.height,a.height)};function Qr(a,y){return Gt.$(a.x,y.x)&&Gt.$(a.y,y.y)&&Gt.$(a.width,y.width)&&Gt.$(a.height,y.height)}yt.ca=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y},yt.Re=function(a){return this.x<=a.x&&a.x+a.width<=this.x+this.width&&this.y<=a.y&&a.y+a.height<=this.y+this.height},yt.contains=function(a,y,x,E){return x===void 0&&(x=0),E===void 0&&(E=0),this.x<=a&&a+x<=this.x+this.width&&this.y<=y&&y+E<=this.y+this.height},yt.offset=function(a,y){return this.x+=a,this.y+=y,this},yt.Bc=function(a,y){return ps(this,y,a,y,a)},yt.Co=function(a){return ps(this,a.top,a.right,a.bottom,a.left)},yt.Fv=function(a){return ps(this,-a.top,-a.right,-a.bottom,-a.left)},yt.Hz=function(a,y,x,E){return ps(this,a,y,x,E)};function ps(a,y,x,E,b){var z=a.width;return x+b<=-z?(a.x+=z/2,a.width=0):(a.x-=b,a.width+=x+b),x=a.height,y+E<=-x?(a.y+=x/2,a.height=0):(a.y-=y,a.height+=y+E),a}yt.Ex=function(a){return ao(this,a.x,a.y,a.width,a.height)},yt.Uu=function(a,y,x,E){return ao(this,a,y,x,E)};function ao(a,y,x,E,b){var z=Math.max(a.x,y),tt=Math.max(a.y,x);return y=Math.min(a.x+a.width,y+E),x=Math.min(a.y+a.height,x+b),a.x=z,a.y=tt,a.width=Math.max(0,y-z),a.height=Math.max(0,x-tt),a}yt.Yc=function(a){return this.Vu(a.x,a.y,a.width,a.height)},yt.Vu=function(a,y,x,E){var b=this.width,z=this.x;return b!==1/0&&x!==1/0&&(b+=z,x+=a,isNaN(x)||isNaN(b)||z>x||a>b)?!1:(a=this.height,x=this.y,!(a!==1/0&&E!==1/0&&(a+=x,E+=y,isNaN(E)||isNaN(a)||x>E||y>a)))};function Pl(a,y){var x=a.width,E=a.x,b=y.x-10;return E>y.width+10+10+b||b>x+E?!1:(x=a.height,a=a.y,E=y.y-10,!(a>y.height+10+10+E||E>x+a))}yt.Ye=function(a){return jr(this,a.x,a.y,0,0)},yt.ed=function(a){return jr(this,a.x,a.y,a.width,a.height)},yt.Kv=function(a,y,x,E){return x===void 0&&(x=0),E===void 0&&(E=0),jr(this,a,y,x,E)};function jr(a,y,x,E,b){var z=Math.min(a.x,y),tt=Math.min(a.y,x);return y=Math.max(a.x+a.width,y+E),x=Math.max(a.y+a.height,x+b),a.x=z,a.y=tt,a.width=y-z,a.height=x-tt,a}yt.yi=function(a,y,x){return this.x=a-x.offsetX-x.x*this.width,this.y=y-x.offsetY-x.y*this.height,this};function Io(a,y,x,E,b,z,tt,it){return tt===void 0&&(tt=0),it===void 0&&(it=0),a<=b&&b+tt<=a+x&&y<=z&&z+it<=y+E}function hl(a,y,x,E,b,z,tt,it){return a>tt+b||b>x+a?!1:!(y>it+z||z>E+y)}yt.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},yt.Mz=function(){return this.width===0&&this.height===0},be.alloc=function(){var a=ta.pop();return a===void 0?new be:a},be.allocAt=function(a,y,x,E){var b=ta.pop();return b===void 0?new be(a,y,x,E):b.h(a,y,x,E)},be.free=function(a){ta.push(a)},zi.Object.defineProperties(be.prototype,{left:{get:function(){return this.x},set:function(a){this.x=a}},top:{get:function(){return this.y},set:function(a){this.y=a}},right:{get:function(){return this.x+this.width},set:function(a){this.x+=a-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(a){this.y+=a-(this.y+this.height)}},position:{get:function(){return new Pt(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}},size:{get:function(){return new li(this.width,this.height)},set:function(a){this.width=a.width,this.height=a.height}},center:{get:function(){return new Pt(this.x+this.width/2,this.y+this.height/2)},set:function(a){this.x=a.x-this.width/2,this.y=a.y-this.height/2}},centerX:{get:function(){return this.x+this.width/2},set:function(a){this.x=a-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(a){this.y=a-this.height/2}}}),be.prototype.isEmpty=be.prototype.Mz,be.prototype.isReal=be.prototype.w,be.intersectsLineSegment=function(a,y,x,E,b,z,tt,it){return Gt.Fx(a,y,x,E,b,z,tt,it)},be.prototype.setSpot=be.prototype.yi,be.prototype.union=be.prototype.Kv,be.prototype.unionRect=be.prototype.ed,be.prototype.unionPoint=be.prototype.Ye,be.prototype.intersects=be.prototype.Vu,be.prototype.intersectsRect=be.prototype.Yc,be.prototype.intersect=be.prototype.Uu,be.prototype.intersectRect=be.prototype.Ex,be.prototype.grow=be.prototype.Hz,be.prototype.subtractMargin=be.prototype.Fv,be.prototype.addMargin=be.prototype.Co,be.prototype.inflate=be.prototype.Bc,be.prototype.offset=be.prototype.offset,be.prototype.contains=be.prototype.contains,be.prototype.containsRect=be.prototype.Re,be.prototype.containsPoint=be.prototype.ca,be.prototype.equalsApprox=be.prototype.Xa,be.prototype.equalTo=be.prototype.hi,be.prototype.equals=be.prototype.D,be.prototype.setSize=be.prototype.tA,be.prototype.setPoint=be.prototype.dd,be.prototype.set=be.prototype.set,be.prototype.setTo=be.prototype.sg;var Bo=null,ho=null,ta=[];be.className="Rect",be.parse=rs,be.stringify=po,be.contains=Io,be.intersects=hl,be.ZeroRect=Bo=new be(0,0,0,0).ja(),be.NoRect=ho=new be(NaN,NaN,NaN,NaN).ja(),be.parse=rs,be.stringify=po,be.contains=Io,be.intersects=hl;function jn(a,y,x,E){a===void 0?this.left=this.bottom=this.right=this.top=0:y===void 0?this.left=this.bottom=this.right=this.top=a:x===void 0?(this.top=a,this.right=y,this.bottom=a,this.left=y):E!==void 0?(this.top=a,this.right=y,this.bottom=x,this.left=E):It("Invalid arguments to Margin constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}jn.prototype.assign=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},jn.prototype.sg=function(a,y,x,E){return this.top=a,this.right=y,this.bottom=x,this.left=E,this},jn.prototype.set=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},jn.prototype.copy=function(){var a=new jn;return a.top=this.top,a.right=this.right,a.bottom=this.bottom,a.left=this.left,a},yt=jn.prototype,yt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},yt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},yt.freeze=function(){return this._isFrozen=!0,this},yt.ka=function(){return Object.isFrozen(this)&&It("cannot thaw constant: "+this),this._isFrozen=!1,this};function Ba(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=NaN;a[y]==="";)y++;var E=a[y++];if(E&&(x=parseFloat(E)),isNaN(x))return new jn;for(var b=NaN;a[y]==="";)y++;if((E=a[y++])&&(b=parseFloat(E)),isNaN(b))return new jn(x);for(var z=NaN;a[y]==="";)y++;if((E=a[y++])&&(z=parseFloat(E)),isNaN(z))return new jn(x,b);for(var tt=NaN;a[y]==="";)y++;return(E=a[y++])&&(tt=parseFloat(E)),isNaN(tt)?new jn(x,b):new jn(x,b,z,tt)}return new jn}function Oa(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}yt.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"},yt.D=function(a){return a instanceof jn?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1},yt.hi=function(a,y,x,E){return this.top===a&&this.right===y&&this.bottom===x&&this.left===E},yt.Xa=function(a){return Gt.B(this.top,a.top)&&Gt.B(this.right,a.right)&&Gt.B(this.bottom,a.bottom)&&Gt.B(this.left,a.left)},yt.w=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)},jn.alloc=function(){var a=Gs.pop();return a===void 0?new jn:a},jn.free=function(a){Gs.push(a)},jn.prototype.isReal=jn.prototype.w,jn.prototype.equalsApprox=jn.prototype.Xa,jn.prototype.equalTo=jn.prototype.hi,jn.prototype.equals=jn.prototype.D,jn.prototype.set=jn.prototype.set,jn.prototype.setTo=jn.prototype.sg;var Vs=null,Qo=null,Gs=[];jn.className="Margin",jn.parse=Ba,jn.stringify=Oa,jn.ZeroMargin=Vs=new jn(0,0,0,0).ja(),jn.TwoMargin=Qo=new jn(2,2,2,2).ja(),jn.parse=Ba,jn.stringify=Oa;function nn(a,y,x,E){a===void 0?this.offsetY=this.offsetX=this.y=this.x=0:(y===void 0&&(y=0),x===void 0&&(x=0),E===void 0&&(E=0),this.x=a,this.y=y,this.offsetX=x,this.offsetY=E),this._isFrozen=!1}var Jn,qn,mr,Nr,no,Hn,ea,os,$o,vo,Ps,ha,Ns,ia,cl,Ia,_l,bh,gs,Ja,fl,Ca,ql,tu,Bi,Fi,In,dr,xr,Hr,ro,Ro,jo,Uo,Qa,ka;nn.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},nn.prototype.sg=function(a,y,x,E){return this.x=a,this.y=y,this.offsetX=x,this.offsetY=E,this},nn.prototype.set=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},nn.prototype.copy=function(){var a=new nn;return a.x=this.x,a.y=this.y,a.offsetX=this.offsetX,a.offsetY=this.offsetY,a},yt=nn.prototype,yt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},yt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},yt.freeze=function(){return this._isFrozen=!0,this},yt.ka=function(){return Object.isFrozen(this)&&It("cannot thaw constant: "+this),this._isFrozen=!1,this};function yo(a,y){return a.x=NaN,a.y=NaN,a.offsetX=y,a}function $r(a){if(typeof a=="string"){if(a=a.trim(),a==="None")return Jn;if(a==="TopLeft")return qn;if(a==="Top"||a==="TopCenter"||a==="MiddleTop")return mr;if(a==="TopRight")return Nr;if(a==="Left"||a==="LeftCenter"||a==="MiddleLeft")return no;if(a==="Center")return Hn;if(a==="Right"||a==="RightCenter"||a==="MiddleRight")return ea;if(a==="BottomLeft")return os;if(a==="Bottom"||a==="BottomCenter"||a==="MiddleBottom")return $o;if(a==="BottomRight")return vo;if(a==="TopSide")return Ps;if(a==="LeftSide")return ha;if(a==="RightSide")return Ns;if(a==="BottomSide")return ia;if(a==="TopBottomSides")return cl;if(a==="LeftRightSides")return Ia;if(a==="TopLeftSides")return _l;if(a==="TopRightSides")return bh;if(a==="BottomLeftSides")return gs;if(a==="BottomRightSides")return Ja;if(a==="NotTopSide")return fl;if(a==="NotLeftSide")return Ca;if(a==="NotRightSide")return ql;if(a==="NotBottomSide")return tu;if(a==="AllSides")return Bi;if(a==="Default")return Fi;a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E!==void 0&&0<E.length&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;E=a[y++],E!==void 0&&0<E.length&&(b=parseFloat(E));for(var z=0;a[y]==="";)y++;E=a[y++],E!==void 0&&0<E.length&&(z=parseFloat(E));for(var tt=0;a[y]==="";)y++;return E=a[y++],E!==void 0&&0<E.length&&(tt=parseFloat(E)),new nn(x,b,z,tt)}return new nn}function zr(a){return a.sb()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString()}yt.toString=function(){return this.sb()?this.offsetX===0&&this.offsetY===0?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.D(Jn)?"None":this.D(qn)?"TopLeft":this.D(mr)?"Top":this.D(Nr)?"TopRight":this.D(no)?"Left":this.D(Hn)?"Center":this.D(ea)?"Right":this.D(os)?"BottomLeft":this.D($o)?"Bottom":this.D(vo)?"BottomRight":this.D(Ps)?"TopSide":this.D(ha)?"LeftSide":this.D(Ns)?"RightSide":this.D(ia)?"BottomSide":this.D(cl)?"TopBottomSides":this.D(Ia)?"LeftRightSides":this.D(_l)?"TopLeftSides":this.D(bh)?"TopRightSides":this.D(gs)?"BottomLeftSides":this.D(Ja)?"BottomRightSides":this.D(fl)?"NotTopSide":this.D(Ca)?"NotLeftSide":this.D(ql)?"NotRightSide":this.D(tu)?"NotBottomSide":this.D(Bi)?"AllSides":this.D(Fi)?"Default":"None"},yt.D=function(a){return a instanceof nn?(this.x===a.x||isNaN(this.x)&&isNaN(a.x))&&(this.y===a.y||isNaN(this.y)&&isNaN(a.y))&&this.offsetX===a.offsetX&&this.offsetY===a.offsetY:!1},yt.gv=function(){return new nn(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)},yt.Hf=function(a){if(!this.$c())return!1;if(!a.$c())if(a.D(In))a=ha;else if(a.D(dr))a=Ns;else if(a.D(xr))a=Ps;else if(a.D(Hr))a=ia;else return!1;return a=a.offsetY,(this.offsetY&a)===a},yt.sb=function(){return!isNaN(this.x)&&!isNaN(this.y)},yt.Mc=function(){return isNaN(this.x)||isNaN(this.y)},yt.$c=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===1&&this.offsetY!==0},yt.ys=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===0&&this.offsetY===0},yt.Xb=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===-1&&this.offsetY===0},nn.alloc=function(){var a=fs.pop();return a===void 0?new nn:a},nn.free=function(a){fs.push(a)},nn.prototype.isDefault=nn.prototype.Xb,nn.prototype.isNone=nn.prototype.ys,nn.prototype.isSide=nn.prototype.$c,nn.prototype.isNoSpot=nn.prototype.Mc,nn.prototype.isSpot=nn.prototype.sb,nn.prototype.includesSide=nn.prototype.Hf,nn.prototype.opposite=nn.prototype.gv,nn.prototype.equals=nn.prototype.D,nn.prototype.set=nn.prototype.set,nn.prototype.setTo=nn.prototype.sg;var fs=[];nn.className="Spot",nn.parse=$r,nn.stringify=zr,nn.None=Jn=yo(new nn(0,0,0,0),0).ja(),nn.Default=Fi=yo(new nn(0,0,-1,0),-1).ja(),nn.TopLeft=qn=new nn(0,0,0,0).ja(),nn.TopCenter=mr=new nn(.5,0,0,0).ja(),nn.TopRight=Nr=new nn(1,0,0,0).ja(),nn.LeftCenter=no=new nn(0,.5,0,0).ja(),nn.Center=Hn=new nn(.5,.5,0,0).ja(),nn.RightCenter=ea=new nn(1,.5,0,0).ja(),nn.BottomLeft=os=new nn(0,1,0,0).ja(),nn.BottomCenter=$o=new nn(.5,1,0,0).ja(),nn.BottomRight=vo=new nn(1,1,0,0).ja(),nn.MiddleTop=ro=mr,nn.MiddleLeft=Ro=no,nn.MiddleRight=jo=ea,nn.MiddleBottom=Uo=$o,nn.Top=xr=mr,nn.Left=In=no,nn.Right=dr=ea,nn.Bottom=Hr=$o,nn.TopSide=Ps=yo(new nn(0,0,1,1),1).ja(),nn.LeftSide=ha=yo(new nn(0,0,1,2),1).ja(),nn.RightSide=Ns=yo(new nn(0,0,1,4),1).ja(),nn.BottomSide=ia=yo(new nn(0,0,1,8),1).ja(),nn.TopBottomSides=cl=yo(new nn(0,0,1,9),1).ja(),nn.LeftRightSides=Ia=yo(new nn(0,0,1,6),1).ja(),nn.TopLeftSides=_l=yo(new nn(0,0,1,3),1).ja(),nn.TopRightSides=bh=yo(new nn(0,0,1,5),1).ja(),nn.BottomLeftSides=gs=yo(new nn(0,0,1,10),1).ja(),nn.BottomRightSides=Ja=yo(new nn(0,0,1,12),1).ja(),nn.NotTopSide=fl=yo(new nn(0,0,1,14),1).ja(),nn.NotLeftSide=Ca=yo(new nn(0,0,1,13),1).ja(),nn.NotRightSide=ql=yo(new nn(0,0,1,11),1).ja(),nn.NotBottomSide=tu=yo(new nn(0,0,1,7),1).ja(),nn.AllSides=Bi=yo(new nn(0,0,1,15),1).ja(),Qa=new nn(.156,.156).ja(),ka=new nn(.844,.844).ja(),nn.parse=$r,nn.stringify=zr;function bn(){this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0}bn.prototype.set=function(a){return this.m11=a.m11,this.m12=a.m12,this.m21=a.m21,this.m22=a.m22,this.dx=a.dx,this.dy=a.dy,this},bn.prototype.setTransform=function(a,y,x,E,b,z){return this.m11=a,this.m12=y,this.m21=x,this.m22=E,this.dx=b,this.dy=z,this},bn.prototype.copy=function(){var a=new bn;return a.m11=this.m11,a.m12=this.m12,a.m21=this.m21,a.m22=this.m22,a.dx=this.dx,a.dy=this.dy,a},bn.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"},bn.prototype.D=function(a){return this.m11===a.m11&&this.m12===a.m12&&this.m21===a.m21&&this.m22===a.m22&&this.dx===a.dx&&this.dy===a.dy},bn.prototype.ws=function(){return this.dx===0&&this.dy===0&&this.m11===1&&this.m12===0&&this.m21===0&&this.m22===1},bn.prototype.reset=function(){return this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0,this},bn.prototype.multiply=function(a){var y=this.m11*a.m11+this.m21*a.m12,x=this.m12*a.m11+this.m22*a.m12,E=this.m11*a.m21+this.m21*a.m22,b=this.m12*a.m21+this.m22*a.m22;return this.dx=this.m11*a.dx+this.m21*a.dy+this.dx,this.dy=this.m12*a.dx+this.m22*a.dy+this.dy,this.m11=y,this.m12=x,this.m21=E,this.m22=b,this},bn.prototype.bv=function(a){var y=1/(a.m11*a.m22-a.m12*a.m21),x=a.m22*y,E=-a.m12*y,b=-a.m21*y,z=a.m11*y,tt=y*(a.m21*a.dy-a.m22*a.dx);return a=y*(a.m12*a.dx-a.m11*a.dy),y=this.m11*x+this.m21*E,x=this.m12*x+this.m22*E,E=this.m11*b+this.m21*z,b=this.m12*b+this.m22*z,this.dx=this.m11*tt+this.m21*a+this.dx,this.dy=this.m12*tt+this.m22*a+this.dy,this.m11=y,this.m12=x,this.m21=E,this.m22=b,this},bn.prototype.Vj=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),y=-this.m12*a,x=-this.m21*a,E=this.m11*a,b=a*(this.m21*this.dy-this.m22*this.dx),z=a*(this.m12*this.dx-this.m11*this.dy);return this.m11=this.m22*a,this.m12=y,this.m21=x,this.m22=E,this.dx=b,this.dy=z,this},bn.prototype.rotate=function(a,y,x){if(360<=a?a-=360:0>a&&(a+=360),a===0)return this;if(this.translate(y,x),a===90){a=0;var E=1}else a===180?(a=-1,E=0):a===270?(a=0,E=-1):(E=a*Math.PI/180,a=Math.cos(E),E=Math.sin(E));var b=this.m12*a+this.m22*E,z=this.m11*-E+this.m21*a,tt=this.m12*-E+this.m22*a;return this.m11=this.m11*a+this.m21*E,this.m12=b,this.m21=z,this.m22=tt,this.translate(-y,-x),this},yt=bn.prototype,yt.translate=function(a,y){return this.dx+=this.m11*a+this.m21*y,this.dy+=this.m12*a+this.m22*y,this},yt.scale=function(a,y){return y===void 0&&(y=a),this.m11*=a,this.m12*=a,this.m21*=y,this.m22*=y,this},yt.Ga=function(a){var y=a.x,x=a.y;return a.h(y*this.m11+x*this.m21+this.dx,y*this.m12+x*this.m22+this.dy)},yt.Cd=function(a){var y=1/(this.m11*this.m22-this.m12*this.m21),x=a.x,E=a.y;return a.h(x*this.m22*y+E*-this.m21*y+y*(this.m21*this.dy-this.m22*this.dx),x*-this.m12*y+E*this.m11*y+y*(this.m12*this.dx-this.m11*this.dy))},yt.Eu=function(a){var y=1/(this.m11*this.m22-this.m12*this.m21),x=1.25*a.x,E=1.2*a.y;return a.h(x*this.m22*y+E*-this.m21*y+y*(this.m21*this.dy-this.m22*this.dx),x*-this.m12*y+E*this.m11*y+y*(this.m12*this.dx-this.m11*this.dy))},yt.pp=function(a){var y=a.x,x=a.y,E=y+a.width,b=x+a.height,z=this.m11,tt=this.m12,it=this.m21,nt=this.m22,ot=this.dx,st=this.dy,ut=y*z+x*it+ot,ct=y*tt+x*nt+st,dt=E*z+x*it+ot,vt=E*tt+x*nt+st;return x=y*z+b*it+ot,y=y*tt+b*nt+st,z=E*z+b*it+ot,E=E*tt+b*nt+st,b=Math.min(ut,dt),ut=Math.max(ut,dt),dt=Math.min(ct,vt),ct=Math.max(ct,vt),b=Math.min(b,x),ut=Math.max(ut,x),dt=Math.min(dt,y),ct=Math.max(ct,y),b=Math.min(b,z),ut=Math.max(ut,z),dt=Math.min(dt,E),ct=Math.max(ct,E),a.h(b,dt,ut-b,ct-dt),a},bn.alloc=function(){var a=qo.pop();return a===void 0?new bn:a},bn.free=function(a){qo.push(a)},bn.prototype.transformRect=bn.prototype.pp,bn.prototype.transformPoint=bn.prototype.Ga,bn.prototype.scale=bn.prototype.scale,bn.prototype.translate=bn.prototype.translate,bn.prototype.rotate=bn.prototype.rotate,bn.prototype.invert=bn.prototype.Vj,bn.prototype.multiplyInverted=bn.prototype.bv,bn.prototype.multiply=bn.prototype.multiply,bn.prototype.reset=bn.prototype.reset,bn.prototype.isIdentity=bn.prototype.ws,bn.prototype.equals=bn.prototype.D,bn.prototype.setTransform=bn.prototype.setTransform,bn.prototype.set=bn.prototype.set;var qo=[];bn.className="Transform",bn.xF="54a702f3e53909c447824c6706603faf4c";var Gt={AA:"7da71ca0ad381e90",wg:(Math.sqrt(2)-1)/3*4,Uv:null,sqrt:function(a){if(0>=a)return 0;var y=Gt.Uv;if(y===null){y=[];for(var x=0;2e3>=x;x++)y[x]=Math.sqrt(x);Gt.Uv=y}return 1>a?(x=1/a,2e3>=x?1/y[x|0]:Math.sqrt(a)):2e3>=a?y[a|0]:Math.sqrt(a)},B:function(a,y){return a-=y,.5>a&&-.5<a},$:function(a,y){return a-=y,5e-8>a&&-5e-8<a},Yb:function(a,y,x,E,b,z,tt){if(0>=b&&(b=1e-6),a<x)var it=a,nt=x;else it=x,nt=a;if(y<E)var ot=y,st=E;else ot=E,st=y;if(a===x)return ot<=tt&&tt<=st&&a-b<=z&&z<=a+b;if(y===E)return it<=z&&z<=nt&&y-b<=tt&&tt<=y+b;if(nt+=b,it-=b,it<=z&&z<=nt&&(st+=b,ot-=b,ot<=tt&&tt<=st))if(nt-it>st-ot)if(a-x>b||x-a>b){if(z=(E-y)/(x-a)*(z-a)+y,z-b<=tt&&tt<=z+b)return!0}else return!0;else if(y-E>b||E-y>b){if(tt=(x-a)/(E-y)*(tt-y)+a,tt-b<=z&&z<=tt+b)return!0}else return!0;return!1},cs:function(a,y,x,E,b,z,tt,it,nt,ot,st,ut){if(Gt.Yb(a,y,tt,it,ut,x,E)&&Gt.Yb(a,y,tt,it,ut,b,z))return Gt.Yb(a,y,tt,it,ut,ot,st);var ct=(a+x)/2,dt=(y+E)/2,vt=(x+b)/2,xt=(E+z)/2;b=(b+tt)/2,z=(z+it)/2,E=(ct+vt)/2,x=(dt+xt)/2,vt=(vt+b)/2,xt=(xt+z)/2;var Tt=(E+vt)/2,Et=(x+xt)/2;return Gt.cs(a,y,ct,dt,E,x,Tt,Et,nt,ot,st,ut)||Gt.cs(Tt,Et,vt,xt,b,z,tt,it,nt,ot,st,ut)},ax:function(a,y,x,E,b,z,tt,it,nt){var ot=(x+b)/2,st=(E+z)/2;return nt.h((((a+x)/2+ot)/2+(ot+(b+tt)/2)/2)/2,(((y+E)/2+st)/2+(st+(z+it)/2)/2)/2),nt},My:function(a,y,x,E,b,z,tt,it){var nt=(x+b)/2,ot=(E+z)/2;return un(((a+x)/2+nt)/2,((y+E)/2+ot)/2,(nt+(b+tt)/2)/2,(ot+(z+it)/2)/2)},Dl:function(a,y,x,E,b,z,tt,it,nt,ot){if(Gt.Yb(a,y,tt,it,nt,x,E)&&Gt.Yb(a,y,tt,it,nt,b,z))jr(ot,a,y,0,0),jr(ot,tt,it,0,0);else{var st=(a+x)/2,ut=(y+E)/2,ct=(x+b)/2,dt=(E+z)/2;b=(b+tt)/2,z=(z+it)/2,E=(st+ct)/2,x=(ut+dt)/2,ct=(ct+b)/2,dt=(dt+z)/2;var vt=(E+ct)/2,xt=(x+dt)/2;Gt.Dl(a,y,st,ut,E,x,vt,xt,nt,ot),Gt.Dl(vt,xt,ct,dt,b,z,tt,it,nt,ot)}return ot},Qe:function(a,y,x,E,b,z,tt,it,nt,ot){if(Gt.Yb(a,y,tt,it,nt,x,E)&&Gt.Yb(a,y,tt,it,nt,b,z))ot.length===0&&(ot.push(a),ot.push(y)),ot.push(tt),ot.push(it);else{var st=(a+x)/2,ut=(y+E)/2,ct=(x+b)/2,dt=(E+z)/2;b=(b+tt)/2,z=(z+it)/2,E=(st+ct)/2,x=(ut+dt)/2,ct=(ct+b)/2,dt=(dt+z)/2;var vt=(E+ct)/2,xt=(x+dt)/2;Gt.Qe(a,y,st,ut,E,x,vt,xt,nt,ot),Gt.Qe(vt,xt,ct,dt,b,z,tt,it,nt,ot)}return ot},jv:function(a,y,x,E,b,z,tt,it,nt,ot){if(Gt.Yb(a,y,b,z,ot,x,E))return Gt.Yb(a,y,b,z,ot,it,nt);var st=(a+x)/2,ut=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var ct=(st+x)/2,dt=(ut+E)/2;return Gt.jv(a,y,st,ut,ct,dt,tt,it,nt,ot)||Gt.jv(ct,dt,x,E,b,z,tt,it,nt,ot)},OA:function(a,y,x,E,b,z,tt){return tt.h(((a+x)/2+(x+b)/2)/2,((y+E)/2+(E+z)/2)/2),tt},iv:function(a,y,x,E,b,z,tt,it){if(Gt.Yb(a,y,b,z,tt,x,E))jr(it,a,y,0,0),jr(it,b,z,0,0);else{var nt=(a+x)/2,ot=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var st=(nt+x)/2,ut=(ot+E)/2;Gt.iv(a,y,nt,ot,st,ut,tt,it),Gt.iv(st,ut,x,E,b,z,tt,it)}return it},ep:function(a,y,x,E,b,z,tt,it){if(Gt.Yb(a,y,b,z,tt,x,E))it.length===0&&(it.push(a),it.push(y)),it.push(b),it.push(z);else{var nt=(a+x)/2,ot=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var st=(nt+x)/2,ut=(ot+E)/2;Gt.ep(a,y,nt,ot,st,ut,tt,it),Gt.ep(st,ut,x,E,b,z,tt,it)}return it},Eo:function(a,y,x,E,b,z,tt,it,nt,ot,st,ut,ct,dt){if(Gt.Yb(a,y,tt,it,ct,x,E)&&Gt.Yb(a,y,tt,it,ct,b,z))return!Gt.Rl(a,y,tt,it,nt,ot,st,ut)||(ct=(a-tt)*(ot-ut)-(y-it)*(nt-st),ct===0)?!1:(dt.h(((a*it-y*tt)*(nt-st)-(a-tt)*(nt*ut-ot*st))/ct,((a*it-y*tt)*(ot-ut)-(y-it)*(nt*ut-ot*st))/ct),!0);var vt=(a+x)/2,xt=(y+E)/2,Tt=(x+b)/2,Et=(E+z)/2;b=(b+tt)/2,z=(z+it)/2,E=(vt+Tt)/2,x=(xt+Et)/2,Tt=(Tt+b)/2,Et=(Et+z)/2;var Ft=(E+Tt)/2,Ot=(x+Et)/2,Rt=1/0,Ht=!1,ae=0,wi=0;return Gt.Eo(a,y,vt,xt,E,x,Ft,Ot,nt,ot,st,ut,ct,dt)&&(a=(dt.x-nt)*(dt.x-nt)+(dt.y-ot)*(dt.y-ot),a<Rt&&(Rt=a,Ht=!0,ae=dt.x,wi=dt.y)),Gt.Eo(Ft,Ot,Tt,Et,b,z,tt,it,nt,ot,st,ut,ct,dt)&&(dt.x-nt)*(dt.x-nt)+(dt.y-ot)*(dt.y-ot)<Rt&&(Ht=!0,ae=dt.x,wi=dt.y),Ht&&(dt.x=ae,dt.y=wi),Ht},Fo:function(a,y,x,E,b,z,tt,it,nt,ot,st,ut,ct){var dt=0;if(Gt.Yb(a,y,tt,it,ct,x,E)&&Gt.Yb(a,y,tt,it,ct,b,z)){if(ct=(a-tt)*(ot-ut)-(y-it)*(nt-st),ct===0)return dt;var vt=((a*it-y*tt)*(nt-st)-(a-tt)*(nt*ut-ot*st))/ct,xt=((a*it-y*tt)*(ot-ut)-(y-it)*(nt*ut-ot*st))/ct;if(vt>=st)return dt;if((nt>st?nt-st:st-nt)<(ot>ut?ot-ut:ut-ot)){if(y<it?(nt=y,a=it):(nt=it,a=y),xt<nt||xt>a)return dt}else if(a<tt?(nt=a,a=tt):nt=tt,vt<nt||vt>a)return dt;0<ct?dt++:0>ct&&dt--}else{vt=(a+x)/2,xt=(y+E)/2;var Tt=(x+b)/2,Et=(E+z)/2;b=(b+tt)/2,z=(z+it)/2,E=(vt+Tt)/2,x=(xt+Et)/2,Tt=(Tt+b)/2,Et=(Et+z)/2;var Ft=(E+Tt)/2,Ot=(x+Et)/2;dt+=Gt.Fo(a,y,vt,xt,E,x,Ft,Ot,nt,ot,st,ut,ct),dt+=Gt.Fo(Ft,Ot,Tt,Et,b,z,tt,it,nt,ot,st,ut,ct)}return dt},qh:function(a,y,x,E,b,z,tt){return Gt.$(a,x)?(y<E?(x=y,y=E):x=E,z<x?(tt.h(a,x),!1):z>y?(tt.h(a,y),!1):(tt.h(a,z),!0)):Gt.$(y,E)?(a<x?(E=a,a=x):E=x,b<E?(tt.h(E,y),!1):b>a?(tt.h(a,y),!1):(tt.h(b,y),!0)):(b=((a-b)*(a-x)+(y-z)*(y-E))/((x-a)*(x-a)+(E-y)*(E-y)),-5e-6>b?(tt.h(a,y),!1):1.000005<b?(tt.h(x,E),!1):(tt.h(a+b*(x-a),y+b*(E-y)),!0))},Ve:function(a,y,x,E,b,z,tt,it,nt){return Gt.B(a,x)&&Gt.B(y,E)?(nt.h(a,y),!1):Gt.$(b,tt)?Gt.$(a,x)?(Gt.qh(a,y,x,E,b,z,nt),!1):Gt.qh(a,y,x,E,b,(E-y)/(x-a)*(b-a)+y,nt):(it=(it-z)/(tt-b),Gt.$(a,x)?(x=it*(a-b)+z,y<E?(b=y,y=E):b=E,x<b?(nt.h(a,b),!1):x>y?(nt.h(a,y),!1):(nt.h(a,x),!0)):(tt=(E-y)/(x-a),Gt.$(it,tt)?(Gt.qh(a,y,x,E,b,z,nt),!1):(b=(tt*a-it*b+z-y)/(tt-it),Gt.$(tt,0)?(a<x?(E=a,a=x):E=x,b<E?(nt.h(E,y),!1):b>a?(nt.h(a,y),!1):(nt.h(b,y),!0)):Gt.qh(a,y,x,E,b,tt*(b-a)+y,nt))))},MA:function(a,y,x,E,b){return Gt.Ve(x.x,x.y,E.x,E.y,a.x,a.y,y.x,y.y,b)},KA:function(a,y,x,E,b,z,tt,it,nt,ot){function st(Tt,Et){var Ft=(Tt-a)*(Tt-a)+(Et-y)*(Et-y);Ft<ut&&(ut=Ft,nt.h(Tt,Et))}var ut=1/0;st(nt.x,nt.y);var ct=0,dt=0,vt=0,xt=0;if(b<tt?(ct=b,dt=tt):(ct=tt,dt=b),z<it?(vt=b,xt=tt):(vt=tt,xt=b),ct=(dt-ct)/2+ot,ot=(xt-vt)/2+ot,b=(b+tt)/2,z=(z+it)/2,ct===0||ot===0)return nt;if(.5>(x>a?x-a:a-x)){if(ct=1-(x-b)*(x-b)/(ct*ct),0>ct)return nt;ct=Math.sqrt(ct),E=-ot*ct+z,st(x,ot*ct+z),st(x,E)}else{if(x=(E-y)/(x-a),E=1/(ct*ct)+x*x/(ot*ot),it=2*x*(y-x*a)/(ot*ot)-2*x*z/(ot*ot)-2*b/(ct*ct),ct=it*it-4*E*(2*x*a*z/(ot*ot)-2*y*z/(ot*ot)+z*z/(ot*ot)+b*b/(ct*ct)-1+(y-x*a)*(y-x*a)/(ot*ot)),0>ct)return nt;ct=Math.sqrt(ct),ot=(-it+ct)/(2*E),st(ot,x*ot-x*a+y),ct=(-it-ct)/(2*E),st(ct,x*ct-x*a+y)}return nt},Ff:function(a,y,x,E,b,z,tt,it,nt){var ot=1e21,st=a,ut=y;if(Gt.Ve(a,y,a,E,b,z,tt,it,nt)){var ct=(nt.x-b)*(nt.x-b)+(nt.y-z)*(nt.y-z);ct<ot&&(ot=ct,st=nt.x,ut=nt.y)}return Gt.Ve(x,y,x,E,b,z,tt,it,nt)&&(ct=(nt.x-b)*(nt.x-b)+(nt.y-z)*(nt.y-z),ct<ot&&(ot=ct,st=nt.x,ut=nt.y)),Gt.Ve(a,y,x,y,b,z,tt,it,nt)&&(y=(nt.x-b)*(nt.x-b)+(nt.y-z)*(nt.y-z),y<ot&&(ot=y,st=nt.x,ut=nt.y)),Gt.Ve(a,E,x,E,b,z,tt,it,nt)&&(a=(nt.x-b)*(nt.x-b)+(nt.y-z)*(nt.y-z),a<ot&&(ot=a,st=nt.x,ut=nt.y)),nt.h(st,ut),1e21>ot},us:function(a,y,x){return Gt.Fx(a.x,a.y,a.width,a.height,y.x,y.y,x.x,x.y)},Fx:function(a,y,x,E,b,z,tt,it){var nt=a+x,ot=y+E;return b===tt?(z<it?(tt=z,z=it):tt=it,a<=b&&b<=nt&&tt<=ot&&z>=y):z===it?(b<tt?(it=b,b=tt):it=tt,y<=z&&z<=ot&&it<=nt&&b>=a):!!(Io(a,y,x,E,b,z)||Io(a,y,x,E,tt,it)||Gt.Rl(a,y,nt,y,b,z,tt,it)||Gt.Rl(nt,y,nt,ot,b,z,tt,it)||Gt.Rl(nt,ot,a,ot,b,z,tt,it)||Gt.Rl(a,ot,a,y,b,z,tt,it))},Rl:function(a,y,x,E,b,z,tt,it){return a===x&&y===E&&b===tt&&z===it?a===b&&y===z:0>=Gt.Fl(a,y,x,E,b,z)*Gt.Fl(a,y,x,E,tt,it)&&0>=Gt.Fl(b,z,tt,it,a,y)*Gt.Fl(b,z,tt,it,x,E)},Fl:function(a,y,x,E,b,z){return x-=a,E-=y,a=b-a,y=z-y,z=a*E-y*x,z===0&&(z=a*x+y*E,0<z&&(z=(a-x)*x+(y-E)*E,0>z&&(z=0))),z},bp:function(a){return 0>a&&(a+=360),360<=a&&(a-=360),a},jx:function(a,y,x,E,b,z){var tt=Math.PI;z||(E*=tt/180,b*=tt/180);var it=E>b?-1:1;z=[];var nt=tt/2,ot=E;if(E=Math.min(2*tt,Math.abs(b-E)),1e-5>E)return nt=ot+it*Math.min(E,nt),it=a+x*Math.cos(ot),ot=y+x*Math.sin(ot),a+=x*Math.cos(nt),y+=x*Math.sin(nt),x=(it+a)/2,nt=(ot+y)/2,z.push([it,ot,x,nt,x,nt,a,y]),z;for(;1e-5<E;)b=ot+it*Math.min(E,nt),z.push(Gt.Vy(x,ot,b,a,y)),E-=Math.abs(b-ot),ot=b;return z},Vy:function(a,y,x,E,b){var z=(x-y)/2,tt=a*Math.cos(z),it=a*Math.sin(z),nt=-it,ot=tt*tt+nt*nt,st=ot+tt*tt+nt*it;return ot=4/3*(Math.sqrt(2*ot*st)-st)/(tt*it-nt*tt),it=tt-ot*nt,tt=nt+ot*tt,nt=-tt,ot=z+y,z=Math.cos(ot),ot=Math.sin(ot),[E+a*Math.cos(y),b+a*Math.sin(y),E+it*z-tt*ot,b+it*ot+tt*z,E+it*z-nt*ot,b+it*ot+nt*z,E+a*Math.cos(x),b+a*Math.sin(x)]},No:function(a,y,x,E,b,z,tt){x=Math.floor((a-x)/b)*b+x,E=Math.floor((y-E)/z)*z+E;var it=x;return x+b-a<b/2&&(it=x+b),a=E,E+z-y<z/2&&(a=E+z),tt.h(it,a),tt},vx:function(a,y){var x=Math.max(a,y);a=Math.min(a,y);var E;do y=x%a,x=E=a,a=y;while(0<y);return E},$y:function(a,y,x,E){var b=0>x,z=0>E;if(a<y)var tt=1,it=0;else tt=0,it=1;var nt=tt===0?a:y,ot=tt===0?x:E;return(tt===0?b:z)&&(ot=-ot),tt=it,x=tt===0?x:E,(tt===0?b:z)&&(x=-x),Gt.az(nt,tt===0?a:y,ot,x,0,0)},az:function(a,y,x,E,b,z){if(0<E)if(0<x){b=a*a,z=y*y,a*=x;var tt=y*E,it=-z+tt,nt=-z+Math.sqrt(a*a+tt*tt);y=it;for(var ot=0;9999999999>ot&&(y=.5*(it+nt),!(y===it||y===nt));++ot){var st=a/(y+b),ut=tt/(y+z);if(st=st*st+ut*ut-1,0<st)it=y;else if(0>st)nt=y;else break}x=b*x/(y+b)-x,E=z*E/(y+z)-E,x=Math.sqrt(x*x+E*E)}else x=Math.abs(E-y);else E=a*a-y*y,z=a*x,z<E?(E=z/E,z=y*Math.sqrt(Math.abs(1-E*E)),x=a*E-x,x=Math.sqrt(x*x+z*z)):x=Math.abs(x-a);return x},Ze:new Sn,um:new Sn,Mf:new Sn,Nf:0,vm:100};Gt.za=Gt.AA;function ci(a){bi(this),this.l=2,a===void 0&&(a=ci.o),this.na=a,this.Ec=this.Dc=this.pd=this.od=0,a===ci.o?this.ee=new Me:(ci.V===null&&(ci.V=new Me().freeze()),this.ee=ci.V),this.aq=this.ee.Ja,this.Ip=new be().freeze(),this.ym=this.tk=null,this.zm=NaN,this.fg=qn,this.gg=vo,this.Rk=this.Sk=NaN,this.Uf=ri}ci.prototype.copy=function(){var a=new ci;if(a.l=this.l&-2,a.na=this.na,a.od=this.od,a.pd=this.pd,a.Dc=this.Dc,a.Ec=this.Ec,this.na===ci.o){for(var y=this.ee.s,x=a.ee,E=0;E<y.length;E++)x.add(y[E].copy());a.ee=x}else a.ee=this.ee;return a.aq=this.aq,a.Ip.assign(this.Ip),a.tk=this.tk,a.ym=this.ym,a.zm=this.zm,a.fg=this.fg.J(),a.gg=this.gg.J(),a.Sk=this.Sk,a.Rk=this.Rk,a.Uf=this.Uf,a},ci.prototype.ja=function(){return this.freeze(),Object.freeze(this),this},ci.prototype.freeze=function(){if(this._isFrozen=!0,this.type!==ci.o)return this;var a=this.figures;a.freeze(),a=a.s;for(var y=a.length,x=0;x<y;x++)a[x].freeze();return this},ci.prototype.ka=function(){if(Object.isFrozen(this)&&It("cannot thaw constant: "+this),this._isFrozen=!1,this.type!==ci.o)return this;var a=this.figures;a.ka(),a=a.s;for(var y=a.length,x=0;x<y;x++)a[x].ka();return this},ci.prototype.Xa=function(a){if(!(a instanceof ci))return!1;if(this.type!==a.type)return this.type===ci.j&&a.type===ci.o?dl(this,a):a.type===ci.j&&this.type===ci.o?dl(a,this):!1;if(this.type===ci.o){var y=this.figures.s;a=a.figures.s;var x=y.length;if(x!==a.length)return!1;for(var E=0;E<x;E++)if(!y[E].Xa(a[E]))return!1;return!0}return Gt.B(this.startX,a.startX)&&Gt.B(this.startY,a.startY)&&Gt.B(this.endX,a.endX)&&Gt.B(this.endY,a.endY)};function dl(a,y){return a.type!==ci.j||y.type!==ci.o?!1:!!(y.figures.count===1&&(y=y.figures.M(0),y.segments.count===1&&Gt.B(a.startX,y.startX)&&Gt.B(a.startY,y.startY)&&(y=y.segments.M(0),y.type===_r&&Gt.B(a.endX,y.endX)&&Gt.B(a.endY,y.endY))))}ci.ia=function(a){return a.toString()},ci.prototype.qb=function(a){a.classType===ci&&(this.type=a)},ci.prototype.toString=function(a){switch(a===void 0&&(a=-1),this.type){case ci.j:return 0>a?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a)+"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);case ci.u:var y=new be(this.startX,this.startY,0,0);return y.Kv(this.endX,this.endY,0,0),0>a?"M"+y.x.toString()+" "+y.y.toString()+"H"+y.right.toString()+"V"+y.bottom.toString()+"H"+y.left.toString()+"z":"M"+y.x.toFixed(a)+" "+y.y.toFixed(a)+"H"+y.right.toFixed(a)+"V"+y.bottom.toFixed(a)+"H"+y.left.toFixed(a)+"z";case ci.F:if(y=new be(this.startX,this.startY,0,0),y.Kv(this.endX,this.endY,0,0),0>a)return a=y.left.toString()+" "+(y.y+y.height/2).toString(),"M"+a+"A"+(y.width/2).toString()+" "+(y.height/2).toString()+" 0 0 1 "+(y.right.toString()+" "+(y.y+y.height/2).toString())+"A"+(y.width/2).toString()+" "+(y.height/2).toString()+" 0 0 1 "+a;var x=y.left.toFixed(a)+" "+(y.y+y.height/2).toFixed(a);return"M"+x+"A"+(y.width/2).toFixed(a)+" "+(y.height/2).toFixed(a)+" 0 0 1 "+(y.right.toFixed(a)+" "+(y.y+y.height/2).toFixed(a))+"A"+(y.width/2).toFixed(a)+" "+(y.height/2).toFixed(a)+" 0 0 1 "+x;case ci.o:y="",x=this.figures.s;for(var E=x.length,b=0;b<E;b++){var z=x[b];0<b&&(y+=" x "),z.isFilled&&(y+="F "),y+=z.toString(a)}return y;default:return this.type.toString()}},ci.nb=function(a){a=a.split(/[Xx]/);for(var y=a.length,x="",E=0;E<y;E++){var b=a[E];x=b.match(/[Ff]/)!==null?E===0?x+b:x+("X"+(b[0]===" "?"":" ")+b):x+((E===0?"":"X ")+"F"+(b[0]===" "?"":" ")+b)}return x},ci.parse=function(a,y){function x(){return xt>=Rt-1?!0:ot[xt+1].match(Ht)!==null}function E(){return xt++,ot[xt]}function b(Ln){var wn=parseFloat(E()),vr=parseFloat(E());Tt===Tt.toLowerCase()&&(wn=Ot.x+wn,vr=Ot.y+vr),Ln.h(wn,vr)}function z(){return b(Ot),Ot}function tt(){return b(Ft),Ft}function it(){var Ln=Et.toLowerCase();return Ln!=="c"&&Ln!=="s"&&Ln!=="q"&&Ln!=="t"?Ot:new Pt(2*Ot.x-Ft.x,2*Ot.y-Ft.y)}y===void 0&&(y=!1);var nt=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm;a=a.replace(/,/gm," "),a=a.replace(nt,"$1 $2"),a=a.replace(nt,"$1 $2"),a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^s])/gm,"$1 $2"),a=a.replace(/([^s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2"),a=a.replace(/([0-9])([+\-])/gm,"$1 $2"),a=a.replace(/[\s\r\t\n]+/gm," "),a=a.replace(/^\s+|\s+$/g,"");var ot=a.split(" ");for(a=0;a<ot.length;a++){var st=ot[a];if(st.match(/(\.[0-9]*)(\.)/gm)!==null){nt=ii();for(var ut="",ct=!1,dt=0;dt<st.length;dt++){var vt=st[dt];vt!=="."||ct?vt==="."?(nt.push(ut),ut="."):ut+=vt:(ct=!0,ut+=vt)}for(nt.push(ut),ot.splice(a,1),st=0;st<nt.length;st++)ot.splice(a+st,0,nt[st]);a+=nt.length-1,Hi(nt)}}var xt=-1,Tt="",Et="";nt=new Pt(0,0);var Ft=new Pt(0,0),Ot=new Pt(0,0),Rt=ot.length;a=Dx(null),ct=ut=st=!1,dt=!0,vt=null;for(var Ht=/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/;!(xt>=Rt-1);)if(Et=Tt,Tt=E(),Tt!=="")switch(Tt.toUpperCase()){case"X":dt=!0,ut=st=!1;break;case"M":for(vt=z(),a.mc===null||dt===!0?(Pd(a,vt.x,vt.y,st,!ut,ct),dt=!1):a.moveTo(vt.x,vt.y),nt.assign(Ot);!x();)vt=z(),a.lineTo(vt.x,vt.y);break;case"L":for(;!x();)vt=z(),a.lineTo(vt.x,vt.y);break;case"H":for(;!x();)Ot=new Pt((Tt===Tt.toLowerCase()?Ot.x:0)+parseFloat(E()),Ot.y),a.lineTo(Ot.x,Ot.y);break;case"V":for(;!x();)Ot=new Pt(Ot.x,(Tt===Tt.toLowerCase()?Ot.y:0)+parseFloat(E())),a.lineTo(Ot.x,Ot.y);break;case"C":for(;!x();){vt=new Pt,b(vt);var ae=tt(),wi=z();lh(a,vt.x,vt.y,ae.x,ae.y,wi.x,wi.y)}break;case"S":for(;!x();)vt=it(),ae=tt(),wi=z(),lh(a,vt.x,vt.y,ae.x,ae.y,wi.x,wi.y);break;case"Q":for(;!x();)vt=tt(),ae=z(),Iv(a,vt.x,vt.y,ae.x,ae.y);break;case"T":for(;!x();)Ft=vt=it(),ae=z(),Iv(a,vt.x,vt.y,ae.x,ae.y);break;case"B":for(;!x();){vt=parseFloat(E()),ae=parseFloat(E()),wi=parseFloat(E());var Ki=parseFloat(E()),Ii=parseFloat(E()),hi=Ii,Ue=!1;x()||(hi=parseFloat(E()),x()||(Ue=parseFloat(E())!==0)),Tt===Tt.toLowerCase()&&(wi+=Ot.x,Ki+=Ot.y),a.arcTo(vt,ae,wi,Ki,Ii,hi,Ue)}break;case"A":for(;!x();)vt=Math.abs(parseFloat(E())),ae=Math.abs(parseFloat(E())),wi=parseFloat(E()),Ii=Ki=!1,Ue=hi=0,hi=E(),hi.length===1?(Ki=!!parseFloat(hi),Ii=!!parseFloat(E()),hi=parseFloat(E())):hi.length===2?(Ki=!!parseFloat(hi[0]),Ii=!!parseFloat(hi[1]),hi=parseFloat(E())):(Ki=!!parseFloat(hi[0]),Ii=!!parseFloat(hi[1]),hi=parseFloat(hi.slice(2))),Ue=parseFloat(E()),Tt===Tt.toLowerCase()&&(hi=Ot.x+hi,Ue=Ot.y+Ue),Ot.h(hi,Ue),Nw(a,vt,ae,wi,Ki,Ii,hi,Ue);break;case"Z":Pw(a),Ot.assign(nt);break;case"F":for(vt="",ae=1;ot[xt+ae];)if(ot[xt+ae]==="0")ct=!0,ae++;else if(ot[xt+ae].match(/[Uu]/)!==null)ae++;else if(ot[xt+ae].match(Ht)===null)ae++;else{vt=ot[xt+ae];break}vt.match(/[Mm]/)?st=!0:0<a.mc.segments.length&&(a.mc.isFilled=!0);break;case"U":for(vt="",ae=1;ot[xt+ae];)if(ot[xt+ae].match(/[Ff]/)!==null)ae++;else if(ot[xt+ae].match(Ht)===null)ae++;else{vt=ot[xt+ae];break}vt.match(/[Mm]/)?ut=!0:a.mc.isShadowed=!1}if(nt=a.os,Rv=a,y)for(y=nt.figures.iterator;y.next();)y.value.isFilled=!0;return nt},ci.Ha=function(a,y){for(var x=a.length,E=Pt.alloc(),b=0;b<x;b++){var z=a[b];E.x=z[0],E.y=z[1],y.Ga(E),z[0]=E.x,z[1]=E.y,E.x=z[2],E.y=z[3],y.Ga(E),z[2]=E.x,z[3]=E.y,E.x=z[4],E.y=z[5],y.Ga(E),z[4]=E.x,z[5]=E.y,E.x=z[6],E.y=z[7],y.Ga(E),z[6]=E.x,z[7]=E.y}Pt.free(E)},ci.prototype.Zu=function(){if(this._isInvalidBounds)return!0;if(this.type===ci.o){if(this.aq!==this.figures.Ja)return!0;for(var a=this.figures.s,y=a.length,x=0;x<y;x++)if(a[x].Zu())return!0}return!1},ci.prototype.computeBounds=function(){if(this._isInvalidBounds=!1,this.ym=this.tk=null,this.zm=NaN,this.type===ci.o){this.aq=this.figures.Ja;for(var a=this.figures.s,y=a.length,x=0;x<y;x++){var E=a[x];E._isInvalidBounds=!1;var b=E.segments;E.sr=b.Ja,E=b.s,b=E.length;for(var z=0;z<b;z++){var tt=E[z];tt._isInvalidBounds=!1,tt.ae=null}}}a=this.Ip,a.ka(),isNaN(this.Sk)||isNaN(this.Rk)?a.h(0,0,0,0):a.h(0,0,this.Sk,this.Rk),eu(this,a,!1),jr(a,0,0,0,0),a.freeze()},ci.prototype.ix=function(){var a=new be;return eu(this,a,!0),a};function eu(a,y,x){switch(a.type){case ci.j:case ci.u:case ci.F:x?y.h(a.od,a.pd,0,0):jr(y,a.od,a.pd,0,0),jr(y,a.Dc,a.Ec,0,0);break;case ci.o:var E=a.figures;a=E.s,E=E.length;for(var b=0;b<E;b++){var z=a[b];x&&b===0?y.h(z.startX,z.startY,0,0):jr(y,z.startX,z.startY,0,0);for(var tt=z.segments.s,it=tt.length,nt=z.startX,ot=z.startY,st=0;st<it;st++){var ut=tt[st];switch(ut.type){case _r:case _o:nt=ut.endX,ot=ut.endY,jr(y,nt,ot,0,0);break;case as:Gt.Dl(nt,ot,ut.point1X,ut.point1Y,ut.point2X,ut.point2Y,ut.endX,ut.endY,.5,y),nt=ut.endX,ot=ut.endY;break;case Ea:Gt.iv(nt,ot,ut.point1X,ut.point1Y,ut.endX,ut.endY,.5,y),nt=ut.endX,ot=ut.endY;break;case Eo:case Ra:var ct=ut.type===Eo?fa(ut,z):$a(ut,z,nt,ot),dt=ct.length;if(dt===0){nt=ut.type===Eo?ut.centerX:ut.endX,ot=ut.type===Eo?ut.centerY:ut.endY,jr(y,nt,ot,0,0);break}ut=null;for(var vt=0;vt<dt;vt++)ut=ct[vt],Gt.Dl(ut[0],ut[1],ut[2],ut[3],ut[4],ut[5],ut[6],ut[7],.5,y);ut!==null&&(nt=ut[6],ot=ut[7]);break;default:It("Unknown Segment type: "+ut.type)}}}break;default:It("Unknown Geometry type: "+a.type)}}ci.prototype.normalize=function(){this._isFrozen&&se(this);var a=this.ix();return this.offset(-a.x,-a.y),new Pt(-a.x,-a.y)},ci.prototype.offset=function(a,y){return this._isFrozen&&se(this),this.transform(1,0,0,1,a,y),this},ci.prototype.scale=function(a,y){return this._isFrozen&&se(this),this.transform(a,0,0,y,0,0),this},ci.prototype.rotate=function(a,y,x){this._isFrozen&&se(this),y===void 0&&(y=0),x===void 0&&(x=0);var E=bn.alloc();return E.reset(),E.rotate(a,y,x),this.transform(E.m11,E.m12,E.m21,E.m22,E.dx,E.dy),bn.free(E),this},yt=ci.prototype,yt.transform=function(a,y,x,E,b,z){switch(this.type){case ci.j:case ci.u:case ci.F:var tt=this.od,it=this.pd;this.od=tt*a+it*x+b,this.pd=tt*y+it*E+z,tt=this.Dc,it=this.Ec,this.Dc=tt*a+it*x+b,this.Ec=tt*y+it*E+z;break;case ci.o:for(var nt=this.figures.s,ot=nt.length,st=0;st<ot;st++){var ut=nt[st];tt=ut.startX,it=ut.startY,ut.startX=tt*a+it*x+b,ut.startY=tt*y+it*E+z,ut=ut.segments.s;for(var ct=ut.length,dt=0;dt<ct;dt++){var vt=ut[dt];switch(vt.type){case _r:case _o:tt=vt.endX,it=vt.endY,vt.endX=tt*a+it*x+b,vt.endY=tt*y+it*E+z;break;case as:tt=vt.point1X,it=vt.point1Y,vt.point1X=tt*a+it*x+b,vt.point1Y=tt*y+it*E+z,tt=vt.point2X,it=vt.point2Y,vt.point2X=tt*a+it*x+b,vt.point2Y=tt*y+it*E+z,tt=vt.endX,it=vt.endY,vt.endX=tt*a+it*x+b,vt.endY=tt*y+it*E+z;break;case Ea:tt=vt.point1X,it=vt.point1Y,vt.point1X=tt*a+it*x+b,vt.point1Y=tt*y+it*E+z,tt=vt.endX,it=vt.endY,vt.endX=tt*a+it*x+b,vt.endY=tt*y+it*E+z;break;case Eo:tt=vt.centerX,it=vt.centerY,vt.centerX=tt*a+it*x+b,vt.centerY=tt*y+it*E+z,y!==0&&(tt=180*Math.atan2(y,a)/Math.PI,0>tt&&(tt+=360),vt.startAngle+=tt),0>a&&(vt.startAngle=180-vt.startAngle,vt.sweepAngle=-vt.sweepAngle),0>E&&(vt.startAngle=-vt.startAngle,vt.sweepAngle=-vt.sweepAngle),vt.radiusX*=Math.sqrt(a*a+x*x),vt.radiusY!==void 0&&(vt.radiusY*=Math.sqrt(y*y+E*E));break;case Ra:if(tt=vt.endX,it=vt.endY,vt.endX=tt*a+it*x+b,vt.endY=tt*y+it*E+z,vt.radiusX===0||vt.radiusY===0)break;y!==0&&(tt=180*Math.atan2(y,a)/Math.PI,0>tt&&(tt+=360),vt.xAxisRotation+=tt),0>a&&(vt.xAxisRotation=180-vt.xAxisRotation,vt.isClockwiseArc=!vt.isClockwiseArc),0>E&&(vt.xAxisRotation=-vt.xAxisRotation,vt.isClockwiseArc=!vt.isClockwiseArc),vt.radiusX*=Math.sqrt(a*a+x*x),vt.radiusY*=Math.sqrt(y*y+E*E);break;default:It("Unknown Segment type: "+vt.type)}}}}return this._isInvalidBounds=!0,this},yt.ca=function(a,y){y===void 0&&(y=0);var x=this.od,E=this.pd,b=this.Dc,z=this.Ec;switch(this.type){case ci.j:return Gt.Yb(x,E,b,z,y,a.x,a.y);case ci.u:var tt=be.allocAt(Math.min(x,b)-y,Math.min(E,z)-y,Math.abs(b-x)+2*y,Math.abs(z-E)+2*y);return a=tt.ca(a),be.free(tt),a;case ci.F:tt=Math.min(x,b)-y;var it=Math.min(E,z)-y;return x=(Math.abs(b-x)+2*y)/2,y=(Math.abs(z-E)+2*y)/2,0>=x||0>=y?!1:(tt=a.x-(tt+x),it=a.y-(it+y),1>=tt*tt/(x*x)+it*it/(y*y));case ci.o:return Ma(this,a,y,!0,!1);default:return!1}};function Ma(a,y,x,E,b){var z=y.x;y=y.y;for(var tt=a.bounds.x-20,it=0,nt,ot,st,ut,ct=a.figures.s,dt=ct.length,vt=0;vt<dt;vt++){var xt=ct[vt],Tt=!xt.isEvenOdd;if(xt.isFilled){if(E&&xt.ca(z,y,x))return!0;var Et=xt.segments;nt=xt.startX,ot=xt.startY;for(var Ft=nt,Ot=ot,Rt=Et.s,Ht=0;Ht<=Et.length;Ht++){var ae=void 0;if(Ht!==Et.length){ae=Rt[Ht];var wi=ae.type;a=ae.endX,ut=ae.endY}else wi=_r,a=Ft,ut=Ot;switch(wi){case _o:if(Ft=ca(z,y,tt,y,nt,ot,Ft,Ot),isNaN(Ft))return!0;it+=Ft,Ft=a,Ot=ut;break;case _r:if(nt=ca(z,y,tt,y,nt,ot,a,ut),isNaN(nt))return!0;it+=nt;break;case as:st=Gt.Fo(nt,ot,ae.point1X,ae.point1Y,ae.point2X,ae.point2Y,a,ut,tt,y,z,y,.5),it+=st;break;case Ea:st=Gt.Fo(nt,ot,(nt+2*ae.point1X)/3,(ot+2*ae.point1Y)/3,(2*ae.point1X+a)/3,(2*ae.point1Y+ut)/3,a,ut,tt,y,z,y,.5),it+=st;break;case Eo:case Ra:wi=ae.type===Eo?fa(ae,xt):$a(ae,xt,nt,ot);var Ki=wi.length;if(Ki===0){if(nt=ca(z,y,tt,y,nt,ot,ae.type===Eo?ae.centerX:ae.endX,ae.type===Eo?ae.centerY:ae.endY),isNaN(nt))return!0;it+=nt;break}ae=null;for(var Ii=0;Ii<Ki;Ii++){if(ae=wi[Ii],Ii===0){if(st=ca(z,y,tt,y,nt,ot,ae[0],ae[1]),isNaN(st))return!0;it+=st}st=Gt.Fo(ae[0],ae[1],ae[2],ae[3],ae[4],ae[5],ae[6],ae[7],tt,y,z,y,.5),it+=st}ae!==null&&(a=ae[6],ut=ae[7]);break;default:It("Unknown Segment type: "+ae.type)}nt=a,ot=ut}if(Tt){if(it!==0)return!0}else if(it%2!==0)return!0;it=0}else if(xt.ca(z,y,b?x:x+2))return!0}return!1}function ca(a,y,x,E,b,z,tt,it){if(Gt.Yb(b,z,tt,it,.05,a,y))return NaN;var nt=(a-x)*(z-it);if(nt===0)return 0;var ot=((a*E-y*x)*(b-tt)-(a-x)*(b*it-z*tt))/nt;if(y=(a*E-y*x)*(z-it)/nt,ot>=a)return 0;if((b>tt?b-tt:tt-b)<(z>it?z-it:it-z)){if(z<it){if(y<z||y>it)return 0}else if(y<it||y>z)return 0}else if(b<tt){if(ot<b||ot>tt)return 0}else if(ot<tt||ot>b)return 0;return 0<nt?1:-1}function Nl(a,y,x,E){a=a.figures.s;for(var b=a.length,z=0;z<b;z++)if(a[z].ca(y,x,E))return!0;return!1}yt.Pu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=new Pt),this.type===ci.j)return y.h(this.startX+a*(this.endX-this.startX),this.startY+a*(this.endY-this.startY)),y;for(var x=this.flattenedSegments,E=this.flattenedLengths,b=x.length,z=this.flattenedTotalLength*a,tt=0,it=0;it<b;it++){var nt=E[it],ot=nt.length;for(a=0;a<ot;a++){var st=nt[a];if(tt+st>=z)return E=z-tt,E=st===0?0:E/st,x=x[it],it=x[2*a],b=x[2*a+1],y.h(it+(x[2*a+2]-it)*E,b+(x[2*a+3]-b)*E),y;tt+=st}}return y},yt.wx=function(a){if(0>a?a=0:1<a&&(a=1),this.type===ci.j)return 180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI;for(var y=this.flattenedSegments,x=this.flattenedLengths,E=y.length,b=this.flattenedTotalLength*a,z=0,tt=0;tt<E;tt++){var it=x[tt],nt=it.length;for(a=0;a<nt;a++){var ot=it[a];if(z+ot>=b)return b=y[tt],y=b[2*a],x=b[2*a+1],E=b[2*a+2],a=b[2*a+3],1>Math.abs(E-y)&&1>Math.abs(a-x)?0:1>Math.abs(E-y)?0<=a-x?90:270:1>Math.abs(a-x)?0<=E-y?0:180:180*Math.atan2(a-x,E-y)/Math.PI;z+=ot}}return NaN},yt.Qu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=[]),y.length=3,this.type===ci.j)return y[0]=this.startX+a*(this.endX-this.startX),y[1]=this.startY+a*(this.endY-this.startY),y[2]=180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI,y;for(var x=this.flattenedSegments,E=this.flattenedLengths,b=x.length,z=this.flattenedTotalLength*a,tt=0,it=0;it<b;it++){var nt=E[it],ot=nt.length;for(a=0;a<ot;a++){var st=nt[a];if(tt+st>=z)return E=z-tt,E=st===0?0:E/st,st=x[it],x=st[2*a],it=st[2*a+1],b=st[2*a+2],a=st[2*a+3],y[0]=x+(b-x)*E,y[1]=it+(a-it)*E,y[2]=1>Math.abs(b-x)&&1>Math.abs(a-it)?0:1>Math.abs(b-x)?0<=a-it?90:270:1>Math.abs(a-it)?0<=b-x?0:180:180*Math.atan2(a-it,b-x)/Math.PI,y;tt+=st}}return y},yt.xx=function(a){if(this.type===ci.j){var y=this.startX,x=this.startY,E=this.endX,b=this.endY;if(y!==E||x!==b){var z=a.x;if(a=a.y,y===E){if(x<b){var tt=x;E=b}else tt=b,E=x;return a<=tt?tt===x?0:1:a>=E?E===x?0:1:Math.abs(a-x)/(E-tt)}if(x===b)return y<E?tt=y:(tt=E,E=y),z<=tt?tt===y?0:1:z>=E?E===y?0:1:Math.abs(z-y)/(E-tt);tt=(E-y)*(E-y)+(b-x)*(b-x);var it=Pt.alloc();return Gt.qh(y,x,E,b,z,a,it),a=it.x,z=it.y,Pt.free(it),Math.sqrt(((a-y)*(a-y)+(z-x)*(z-x))/tt)}}else if(this.type===ci.u){tt=this.startX,it=this.startY;var nt=this.endX;if(b=this.endY,tt!==nt||it!==b){y=nt-tt,x=b-it,z=2*y+2*x,E=a.x,a=a.y,E=Math.min(Math.max(E,tt),nt),a=Math.min(Math.max(a,it),b),tt=Math.abs(E-tt),nt=Math.abs(E-nt),it=Math.abs(a-it),b=Math.abs(a-b);var ot=Math.min(tt,nt,it,b);if(ot===it)return E/z;if(ot===nt)return(y+a)/z;if(ot===b)return(2*y+x-E)/z;if(ot===tt)return(2*y+2*x-a)/z}}else{y=this.flattenedSegments,x=this.flattenedLengths,z=this.flattenedTotalLength,E=Pt.alloc(),b=1/0,it=tt=0,nt=y.length;for(var st=ot=0,ut=0;ut<nt;ut++)for(var ct=y[ut],dt=x[ut],vt=ct.length,xt=0;xt<vt;xt+=2){var Tt=ct[xt],Et=ct[xt+1];if(xt!==0){Gt.qh(ot,st,Tt,Et,a.x,a.y,E);var Ft=(E.x-a.x)*(E.x-a.x)+(E.y-a.y)*(E.y-a.y);Ft<b&&(b=Ft,tt=it,tt+=Math.sqrt((E.x-ot)*(E.x-ot)+(E.y-st)*(E.y-st))),it+=dt[(xt-2)/2]}ot=Tt,st=Et}return Pt.free(E),a=tt/z,0>a?0:1<a?1:a}return 0};function Su(a){if(a.tk===null){var y=a.tk=[],x=a.ym=[],E=[],b=[];if(a.type===ci.j)E.push(a.startX),E.push(a.startY),E.push(a.endX),E.push(a.endY),y.push(E),b.push(Math.sqrt((a.startX-a.endX)*(a.startX-a.endX)+(a.startY-a.endY)*(a.startY-a.endY))),x.push(b);else if(a.type===ci.u)E.push(a.startX),E.push(a.startY),E.push(a.endX),E.push(a.startY),E.push(a.endX),E.push(a.endY),E.push(a.startX),E.push(a.endY),E.push(a.startX),E.push(a.startY),y.push(E),b.push(Math.abs(a.startX-a.endX)),b.push(Math.abs(a.startY-a.endY)),b.push(Math.abs(a.startX-a.endX)),b.push(Math.abs(a.startY-a.endY)),x.push(b);else if(a.type===ci.F){var z=new zo;z.startX=a.endX,z.startY=(a.startY+a.endY)/2;var tt=new pr(Eo);if(tt.startAngle=0,tt.sweepAngle=360,tt.centerX=(a.startX+a.endX)/2,tt.centerY=(a.startY+a.endY)/2,tt.radiusX=Math.abs(a.startX-a.endX)/2,tt.radiusY=Math.abs(a.startY-a.endY)/2,z.add(tt),a=fa(tt,z),b=a.length,b===0)E.push(tt.centerX),E.push(tt.centerY);else{tt=z.startX,z=z.startY;for(var it=0;it<b;it++){var nt=a[it];Gt.Qe(tt,z,nt[2],nt[3],nt[4],nt[5],nt[6],nt[7],.5,E),tt=nt[6],z=nt[7]}}y.push(E),x.push(Jc(E))}else for(a=a.figures.iterator;a.next();){b=a.value,E=[],E.push(b.startX),E.push(b.startY),tt=b.startX,z=b.startY,it=tt,nt=z;for(var ot=b.segments.s,st=ot.length,ut=0;ut<st;ut++){var ct=ot[ut];switch(ct.type){case _o:4<=E.length&&(y.push(E),x.push(Jc(E))),E=[],E.push(ct.endX),E.push(ct.endY),tt=ct.endX,z=ct.endY,it=tt,nt=z;break;case _r:E.push(ct.endX),E.push(ct.endY),tt=ct.endX,z=ct.endY;break;case as:Gt.Qe(tt,z,ct.point1X,ct.point1Y,ct.point2X,ct.point2Y,ct.endX,ct.endY,.5,E),tt=ct.endX,z=ct.endY;break;case Ea:Gt.ep(tt,z,ct.point1X,ct.point1Y,ct.endX,ct.endY,.5,E),tt=ct.endX,z=ct.endY;break;case Eo:var dt=fa(ct,b),vt=dt.length;if(vt===0){E.push(ct.centerX),E.push(ct.centerY),tt=ct.centerX,z=ct.centerY;break}for(var xt=0;xt<vt;xt++){var Tt=dt[xt];Gt.Qe(tt,z,Tt[2],Tt[3],Tt[4],Tt[5],Tt[6],Tt[7],.5,E),tt=Tt[6],z=Tt[7]}break;case Ra:if(dt=$a(ct,b,tt,z),vt=dt.length,xt=ct.endX,Tt=ct.endY,vt===0){E.push(xt),E.push(Tt),tt=xt,z=Tt;break}for(xt=0;xt<vt;xt++)Tt=dt[xt],Gt.Qe(tt,z,Tt[2],Tt[3],Tt[4],Tt[5],Tt[6],Tt[7],.5,E),tt=Tt[6],z=Tt[7];break;default:It("Segment not of valid type: "+ct.type)}ct.isClosed&&(E.push(it),E.push(nt))}4<=E.length&&(y.push(E),x.push(Jc(E)))}}}function Jc(a){for(var y=[],x=0,E=0,b=a.length,z=0;z<b;z+=2){var tt=a[z],it=a[z+1];z!==0&&y.push(Math.sqrt(Kn(x,E,tt,it))),x=tt,E=it}return y}yt.add=function(a){return this.ee.add(a),this},yt.pm=function(a,y,x,E,b,z,tt,it){return this._isFrozen&&se(this),this.fg=new nn(a,y,b,z).freeze(),this.gg=new nn(x,E,tt,it).freeze(),this},zi.Object.defineProperties(ci.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(a){this.l=a?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(a){this.l=a?this.l|2:this.l&-3}},flattenedSegments:{get:function(){return Su(this),this.tk}},flattenedLengths:{get:function(){return Su(this),this.ym}},flattenedTotalLength:{get:function(){var a=this.zm;if(isNaN(a)){if(this.type===ci.j){a=Math.abs(this.endX-this.startX);var y=Math.abs(this.endY-this.startY);a=Math.sqrt(a*a+y*y)}else if(this.type===ci.u)a=2*Math.abs(this.endX-this.startX)+2*Math.abs(this.endY-this.startY);else{y=this.flattenedLengths;for(var x=y.length,E=a=0;E<x;E++)for(var b=y[E],z=b.length,tt=0;tt<z;tt++)a+=b[tt]}this.zm=a}return a}},type:{get:function(){return this.na},set:function(a){this.na!==a&&(this._isFrozen&&se(this,a),this.na=a,a===ci.o?this.ee=new Me:(ci.V===null&&(ci.V=new Me().freeze()),this.ee=ci.V),this._isInvalidBounds=!0)}},startX:{get:function(){return this.od},set:function(a){this.od!==a&&(this._isFrozen&&se(this,a),this.od=a,this._isInvalidBounds=!0)}},startY:{get:function(){return this.pd},set:function(a){this.pd!==a&&(this._isFrozen&&se(this,a),this.pd=a,this._isInvalidBounds=!0)}},endX:{get:function(){return this.Dc},set:function(a){this.Dc!==a&&(this._isFrozen&&se(this,a),this.Dc=a,this._isInvalidBounds=!0)}},endY:{get:function(){return this.Ec},set:function(a){this.Ec!==a&&(this._isFrozen&&se(this,a),this.Ec=a,this._isInvalidBounds=!0)}},figures:{get:function(){return this.ee},set:function(a){this.ee!==a&&(this._isFrozen&&se(this,a),this.ee=a,this._isInvalidBounds=!0)}},spot1:{get:function(){return this.fg},set:function(a){this._isFrozen&&se(this,a),this.fg=a.J()}},spot2:{get:function(){return this.gg},set:function(a){this._isFrozen&&se(this,a),this.gg=a.J()}},defaultStretch:{get:function(){return this.Uf},set:function(a){this._isFrozen&&se(this,a),this.Uf=a}},bounds:{get:function(){return this.Zu()&&this.computeBounds(),this.Ip}}}),ci.prototype.setSpots=ci.prototype.pm,ci.prototype.add=ci.prototype.add,ci.prototype.getFractionForPoint=ci.prototype.xx,ci.prototype.getPointAndAngleAlongPath=ci.prototype.Qu,ci.prototype.getAngleAlongPath=ci.prototype.wx,ci.prototype.getPointAlongPath=ci.prototype.Pu,ci.prototype.containsPoint=ci.prototype.ca,ci.prototype.transform=ci.prototype.transform,ci.prototype.rotate=ci.prototype.rotate,ci.prototype.scale=ci.prototype.scale,ci.prototype.offset=ci.prototype.offset,ci.prototype.normalize=ci.prototype.normalize,ci.prototype.computeBoundsWithoutOrigin=ci.prototype.ix,ci.prototype.equalsApprox=ci.prototype.Xa,ci.className="Geometry",ci.j=new ze(ci,"Line",0),ci.u=new ze(ci,"Rectangle",1),ci.F=new ze(ci,"Ellipse",2),ci.o=new ze(ci,"Path",3),ci.V=null,ci.hb="UuBbMmZzLlHhVvCcSsQqTtAaFfXx",ci.className="Geometry",ci.stringify=ci.ia,ci.fillPath=ci.nb,ci.parse=ci.parse,ci.Line=ci.j,ci.Rectangle=ci.u,ci.Ellipse=ci.F,ci.Path=ci.o;function zo(a,y,x,E,b){bi(this),x===void 0&&(x=!0),E===void 0&&(E=!0),b===void 0&&(b=!1),this.l=2|(x?4:0)|(E?8:0)|(b?16:0),a!==void 0?this.od=a:this.od=0,y!==void 0?this.pd=y:this.pd=0,this.pl=new Me,this.sr=this.pl.Ja,this.fw=null}zo.prototype.copy=function(){var a=new zo;a.l=this.l&-2,a.od=this.od,a.pd=this.pd;for(var y=this.pl.s,x=y.length,E=a.pl,b=0;b<x;b++){var z=y[b].copy();E.add(z)}return a.sr=this.sr,a.fw=this.fw,a},yt=zo.prototype,yt.Xa=function(a){if(!(a instanceof zo&&Gt.B(this.startX,a.startX)&&Gt.B(this.startY,a.startY)))return!1;var y=this.segments.s;a=a.segments.s;var x=y.length;if(x!==a.length)return!1;for(var E=0;E<x;E++)if(!y[E].Xa(a[E]))return!1;return!0},yt.toString=function(a){a===void 0&&(a=-1);for(var y=0>a?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a),x=this.segments.s,E=x.length,b=0;b<E;b++)y+=" "+x[b].toString(a);return y},yt.freeze=function(){this._isFrozen=!0;var a=this.segments;a.freeze();var y=a.s;a=a.length;for(var x=0;x<a;x++)y[x].freeze();return this},yt.ka=function(){this._isFrozen=!1;var a=this.segments;a.ka(),a=a.s;for(var y=a.length,x=0;x<y;x++)a[x].ka();return this},yt.Zu=function(){if(this._isInvalidBounds)return!0;var a=this.segments;if(this.sr!==a.Ja)return!0;a=a.s;for(var y=a.length,x=0;x<y;x++)if(a[x]._isInvalidBounds)return!0;return!1},yt.add=function(a){return this.pl.add(a),this},yt.ca=function(a,y,x){for(var E=this.startX,b=this.startY,z=E,tt=b,it=this.segments.s,nt=it.length,ot=0;ot<nt;ot++){var st=it[ot];switch(st.type){case _o:z=st.endX,tt=st.endY,E=st.endX,b=st.endY;break;case _r:if(Gt.Yb(E,b,st.endX,st.endY,x,a,y))return!0;E=st.endX,b=st.endY;break;case as:if(Gt.cs(E,b,st.point1X,st.point1Y,st.point2X,st.point2Y,st.endX,st.endY,.5,a,y,x))return!0;E=st.endX,b=st.endY;break;case Ea:if(Gt.jv(E,b,st.point1X,st.point1Y,st.endX,st.endY,.5,a,y,x))return!0;E=st.endX,b=st.endY;break;case Eo:case Ra:var ut=st.type===Eo?fa(st,this):$a(st,this,E,b),ct=ut.length,dt=st.type===Eo?st.centerX:st.endX,vt=st.type===Eo?st.centerY:st.endY;if(ct===0){if(Gt.Yb(E,b,dt,vt,x,a,y))return!0;E=dt,b=vt;break}for(dt=null,vt=0;vt<ct;vt++)if(dt=ut[vt],vt===0&&Gt.Yb(E,b,dt[0],dt[1],x,a,y)||Gt.cs(dt[0],dt[1],dt[2],dt[3],dt[4],dt[5],dt[6],dt[7],.5,a,y,x))return!0;dt!==null&&(E=dt[6],b=dt[7]);break;default:It("Unknown Segment type: "+st.type)}if(st.isClosed&&(E!==z||b!==tt)&&Gt.Yb(E,b,z,tt,x,a,y))return!0}return!1},zi.Object.defineProperties(zo.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(a){this.l=a?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(a){this.l=a?this.l|2:this.l&-3}},isFilled:{get:function(){return(this.l&4)!==0},set:function(a){this._isFrozen&&se(this,a),this.l=a?this.l|4:this.l&-5}},isShadowed:{get:function(){return(this.l&8)!==0},set:function(a){this._isFrozen&&se(this,a),this.l=a?this.l|8:this.l&-9}},isEvenOdd:{get:function(){return(this.l&16)!==0},set:function(a){this._isFrozen&&se(this,a),this.l=a?this.l|16:this.l&-17}},startX:{get:function(){return this.od},set:function(a){this._isFrozen&&se(this,a),this.od=a,this._isInvalidBounds=!0}},startY:{get:function(){return this.pd},set:function(a){this._isFrozen&&se(this,a),this.pd=a,this._isInvalidBounds=!0}},segments:{get:function(){return this.pl},set:function(a){this._isFrozen&&se(this,a),this.pl=a,this._isInvalidBounds=!0}}}),zo.prototype.add=zo.prototype.add,zo.prototype.equalsApprox=zo.prototype.Xa,zo.className="PathFigure";function pr(a,y,x,E,b,z,tt,it){bi(this),a===void 0&&(a=_r),this.na=a,this.l=2,y!==void 0?this.Dc=y:this.Dc=0,x!==void 0?this.Ec=x:this.Ec=0,E===void 0&&(E=0),b===void 0&&(b=0),z===void 0&&(z=0),tt===void 0&&(tt=0),a===Ra?(a=z%360,0>a&&(a+=360),this.Ne=a,this.Vh=0,this.Wh=Math.max(E,0),this.Pg=Math.max(b,0),typeof tt=="boolean"?tt&&(this.isLargeArc=!0):typeof tt=="number"&&tt&&(this.isLargeArc=!0),it&&(this.isClockwiseArc=!0)):(this.Ne=E,this.Vh=b,a===Eo&&(z=Math.max(z,0)),this.Wh=z,typeof tt=="number"?(a===Eo&&(tt=Math.max(tt,0)),this.Pg=tt):this.Pg=0),this.ae=null}pr.prototype.copy=function(){var a=new pr;return a.na=this.na,a.l=this.l&-2,a.Dc=this.Dc,a.Ec=this.Ec,a.Ne=this.Ne,a.Vh=this.Vh,a.Wh=this.Wh,a.Pg=this.Pg,a},yt=pr.prototype,yt.Xa=function(a){if(!(a instanceof pr)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case _o:case _r:return Gt.B(this.endX,a.endX)&&Gt.B(this.endY,a.endY);case as:return Gt.B(this.endX,a.endX)&&Gt.B(this.endY,a.endY)&&Gt.B(this.point1X,a.point1X)&&Gt.B(this.point1Y,a.point1Y)&&Gt.B(this.point2X,a.point2X)&&Gt.B(this.point2Y,a.point2Y);case Ea:return Gt.B(this.endX,a.endX)&&Gt.B(this.endY,a.endY)&&Gt.B(this.point1X,a.point1X)&&Gt.B(this.point1Y,a.point1Y);case Eo:return Gt.B(this.startAngle,a.startAngle)&&Gt.B(this.sweepAngle,a.sweepAngle)&&Gt.B(this.centerX,a.centerX)&&Gt.B(this.centerY,a.centerY)&&Gt.B(this.radiusX,a.radiusX)&&Gt.B(this.radiusY,a.radiusY);case Ra:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&Gt.B(this.xAxisRotation,a.xAxisRotation)&&Gt.B(this.endX,a.endX)&&Gt.B(this.endY,a.endY)&&Gt.B(this.radiusX,a.radiusX)&&Gt.B(this.radiusY,a.radiusY);default:return!1}},yt.qb=function(a){a.classType===pr&&(this.type=a)},yt.toString=function(a){switch(a===void 0&&(a=-1),this.type){case _o:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case _r:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case as:a=0>a?"C"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.point2X.toString()+" "+this.point2Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"C"+this.point1X.toFixed(a)+" "+this.point1Y.toFixed(a)+" "+this.point2X.toFixed(a)+" "+this.point2Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Ea:a=0>a?"Q"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"Q"+this.point1X.toFixed(a)+" "+this.point1Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Eo:a=0>a?"B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+" "+this.radiusX.toString()+" "+this.radiusY.toString():"B"+this.startAngle.toFixed(a)+" "+this.sweepAngle.toFixed(a)+" "+this.centerX.toFixed(a)+" "+this.centerY.toFixed(a)+" "+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a);break;case Ra:a=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xAxisRotation.toString()+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toString()+" "+this.endY.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.xAxisRotation.toFixed(a)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;default:a=this.type.toString()}return a+(this.isClosed?"z":"")},yt.freeze=function(){return this._isFrozen=!0,this},yt.ka=function(){return this._isFrozen=!1,this},yt.close=function(){return this.isClosed=!0,this};function fa(a,y){if(a.ae!==null&&y._isInvalidBounds===!1)return a.ae;var x=a.radiusX,E=a.radiusY;if(E===void 0&&(E=x),x===0||E===0)return a.ae=[],a.ae;y=a.Ne;var b=a.Vh,z=Gt.jx(0,0,x<E?x:E,a.startAngle,a.startAngle+a.sweepAngle,!1);if(x!==E){var tt=bn.alloc();tt.reset(),x<E?tt.scale(1,E/x):tt.scale(x/E,1),ci.Ha(z,tt),bn.free(tt)}for(x=z.length,E=0;E<x;E++)tt=z[E],tt[0]+=y,tt[1]+=b,tt[2]+=y,tt[3]+=b,tt[4]+=y,tt[5]+=b,tt[6]+=y,tt[7]+=b;return a.ae=z,a.ae}function $a(a,y,x,E){function b(xt,Tt,Et,Ft){return(xt*Ft<Tt*Et?-1:1)*Math.acos((xt*Et+Tt*Ft)/(Math.sqrt(xt*xt+Tt*Tt)*Math.sqrt(Et*Et+Ft*Ft)))}if(a.ae!==null&&y._isInvalidBounds===!1)return a.ae;if(a.radiusX===0||a.radiusY===0)return a.ae=[],a.ae;y=a.Wh;var z=a.Pg;y===0&&(y=1e-4),z===0&&(z=1e-4);var tt=Math.PI/180*a.Ne,it=a.isLargeArc,nt=a.isClockwiseArc,ot=a.Dc,st=a.Ec,ut=Math.cos(tt),ct=Math.sin(tt),dt=ut*(x-ot)/2+ct*(E-st)/2;tt=-ct*(x-ot)/2+ut*(E-st)/2;var vt=dt*dt/(y*y)+tt*tt/(z*z);return 1<vt&&(y*=Math.sqrt(vt),z*=Math.sqrt(vt)),vt=(it===nt?-1:1)*Math.sqrt((y*y*z*z-y*y*tt*tt-z*z*dt*dt)/(y*y*tt*tt+z*z*dt*dt)),isNaN(vt)&&(vt=0),it=vt*y*tt/z,vt=vt*-z*dt/y,isNaN(it)&&(it=0),isNaN(vt)&&(vt=0),x=(x+ot)/2+ut*it-ct*vt,E=(E+st)/2+ct*it+ut*vt,st=b(1,0,(dt-it)/y,(tt-vt)/z),ut=(dt-it)/y,ot=(tt-vt)/z,dt=(-dt-it)/y,it=(-tt-vt)/z,tt=b(ut,ot,dt,it),dt=(ut*dt+ot*it)/(Math.sqrt(ut*ut+ot*ot)*Math.sqrt(dt*dt+it*it)),-1>=dt?tt=Math.PI:1<=dt&&(tt=0),!nt&&0<tt&&(tt-=2*Math.PI),nt&&0>tt&&(tt+=2*Math.PI),nt=y>z?1:y/z,dt=y>z?z/y:1,y=Gt.jx(0,0,y>z?y:z,st,st+tt,!0),z=bn.alloc(),z.reset(),z.translate(x,E),z.rotate(a.Ne,0,0),z.scale(nt,dt),ci.Ha(y,z),bn.free(z),a.ae=y,a.ae}zi.Object.defineProperties(pr.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(a){this.l=a?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(a){this.l=a?this.l|2:this.l&-3}},isClosed:{get:function(){return(this.l&8)!==0},set:function(a){this.isClosed!==a&&(this.l=a?this.l|8:this.l&-9,this._isInvalidBounds=!0)}},type:{get:function(){return this.na},set:function(a){this._isFrozen&&se(this,a),this.na=a,this._isInvalidBounds=!0}},endX:{get:function(){return this.Dc},set:function(a){this._isFrozen&&se(this,a),this.Dc=a,this._isInvalidBounds=!0}},endY:{get:function(){return this.Ec},set:function(a){this._isFrozen&&se(this,a),this.Ec=a,this._isInvalidBounds=!0}},point1X:{get:function(){return this.Ne},set:function(a){this._isFrozen&&se(this,a),this.Ne=a,this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Vh},set:function(a){this._isFrozen&&se(this,a),this.Vh=a,this._isInvalidBounds=!0}},point2X:{get:function(){return this.Wh},set:function(a){this._isFrozen&&se(this,a),this.Wh=a,this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Pg},set:function(a){this._isFrozen&&se(this,a),this.Pg=a,this._isInvalidBounds=!0}},centerX:{get:function(){return this.Ne},set:function(a){this._isFrozen&&se(this,a),this.Ne=a,this._isInvalidBounds=!0}},centerY:{get:function(){return this.Vh},set:function(a){this._isFrozen&&se(this,a),this.Vh=a,this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Wh},set:function(a){0>a&&xi(a,">= zero",pr,"radiusX"),this._isFrozen&&se(this,a),this.Wh=a,this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Pg},set:function(a){0>a&&xi(a,">= zero",pr,"radiusY"),this._isFrozen&&se(this,a),this.Pg=a,this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Dc},set:function(a){this._isFrozen&&se(this,a),a%=360,0>a&&(a+=360),this.Dc=a,this._isInvalidBounds=!0}},sweepAngle:{get:function(){return this.Ec},set:function(a){this._isFrozen&&se(this,a),360<a&&(a=360),-360>a&&(a=-360),this.Ec=a,this._isInvalidBounds=!0}},isClockwiseArc:{get:function(){return(this.l&4)!==0},set:function(a){this._isFrozen&&se(this,a),this.l=a?this.l|4:this.l&-5,this._isInvalidBounds=!0}},isLargeArc:{get:function(){return(this.l&16)!==0},set:function(a){this._isFrozen&&se(this,a),this.l=a?this.l|16:this.l&-17,this._isInvalidBounds=!0}},xAxisRotation:{get:function(){return this.Ne},set:function(a){this._isFrozen&&se(this,a),a%=360,0>a&&(a+=360),this.Ne=a,this._isInvalidBounds=!0}}}),pr.prototype.equalsApprox=pr.prototype.Xa;var _o=new ze(pr,"Move",0),_r=new ze(pr,"Line",1),as=new ze(pr,"Bezier",2),Ea=new ze(pr,"QuadraticBezier",3),Eo=new ze(pr,"Arc",4),Ra=new ze(pr,"SvgArc",4);pr.className="PathSegment",pr.Move=_o,pr.Line=_r,pr.Bezier=as,pr.QuadraticBezier=Ea,pr.Arc=Eo,pr.SvgArc=Ra;function ws(){this.H=null,this.xu=new Pt(0,0).freeze(),this.mt=new Pt(0,0).freeze(),this.Bp=this.Rq=0,this.Cp=1,this.xq="",this.Wr=this.Tp=!1,this.Rp=this.Ep=0,this.xg=this.nq=this.tq=!1,this.Zp=null,this.Rr=0,this.xd=this.Nr=null}ws.prototype.copy=function(){var a=new ws;return this.clone(a)},ws.prototype.clone=function(a){return a.H=this.H,a.xu.assign(this.viewPoint),a.mt.assign(this.documentPoint),a.Rq=this.Rq,a.Bp=this.Bp,a.Cp=this.Cp,a.xq=this.xq,a.Tp=this.Tp,a.Wr=this.Wr,a.Ep=this.Ep,a.Rp=this.Rp,a.tq=this.tq,a.nq=this.nq,a.xg=this.xg,a.Zp=this.Zp,a.Rr=this.Rr,a.Nr=this.Nr,a.xd=this.xd,a},ws.prototype.toString=function(){var a="^";return this.modifiers!==0&&(a+="M:"+this.modifiers),this.button!==0&&(a+="B:"+this.button),this.key!==""&&(a+="K:"+this.key),this.clickCount!==0&&(a+="C:"+this.clickCount),this.delta!==0&&(a+="D:"+this.delta),this.handled&&(a+="h"),this.bubbles&&(a+="b"),this.documentPoint!==null&&(a+="@"+this.documentPoint.toString()),a},ws.prototype.So=function(a,y){var x=this.diagram;return x===null||yp(x,a,y),y},ws.prototype.Bz=function(a,y){var x=this.diagram;return x===null||(yp(x,a,y),y.assign(x.Ps(y))),y},zi.Object.defineProperties(ws.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},viewPoint:{get:function(){return this.xu},set:function(a){this.xu.assign(a)}},documentPoint:{get:function(){return this.mt},set:function(a){this.mt.assign(a)}},modifiers:{get:function(){return this.Rq},set:function(a){this.Rq=a}},button:{get:function(){return this.Bp},set:function(a){if(this.Bp=a,this.event===null)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}}},buttons:{get:function(){return this.Cp},set:function(a){this.Cp=a}},key:{get:function(){return this.xq},set:function(a){this.xq=a}},down:{get:function(){return this.Tp},set:function(a){this.Tp=a}},up:{get:function(){return this.Wr},set:function(a){this.Wr=a}},clickCount:{get:function(){return this.Ep},set:function(a){this.Ep=a}},delta:{get:function(){return this.Rp},set:function(a){this.Rp=a}},isMultiTouch:{get:function(){return this.tq},set:function(a){this.tq=a}},handled:{get:function(){return this.nq},set:function(a){this.nq=a}},bubbles:{get:function(){return this.xg},set:function(a){this.xg=a}},event:{get:function(){return this.Zp},set:function(a){this.Zp=a}},isTouchEvent:{get:function(){var a=this.event;return a===null?!1:a.pointerType==="touch"||a.pointerType==="pen"}},timestamp:{get:function(){return this.Rr},set:function(a){this.Rr=a}},targetDiagram:{get:function(){return this.Nr},set:function(a){this.Nr=a}},targetObject:{get:function(){return this.xd},set:function(a){this.xd=a}},control:{get:function(){return(this.modifiers&1)!==0},set:function(a){this.modifiers=a?this.modifiers|1:this.modifiers&-2}},shift:{get:function(){return(this.modifiers&4)!==0},set:function(a){this.modifiers=a?this.modifiers|4:this.modifiers&-5}},alt:{get:function(){return(this.modifiers&2)!==0},set:function(a){this.modifiers=a?this.modifiers|2:this.modifiers&-3}},meta:{get:function(){return(this.modifiers&8)!==0},set:function(a){this.modifiers=a?this.modifiers|8:this.modifiers&-9}},left:{get:function(){var a=this.event;return a===null||a.type!=="mousedown"&&a.type!=="mouseup"&&a.type!=="pointerdown"&&a.type!=="pointerup"?(this.buttons&1)!==0:this.button===0},set:function(a){this.buttons=a?this.buttons|1:this.buttons&-2}},right:{get:function(){var a=this.event;return a===null||a.type!=="mousedown"&&a.type!=="mouseup"&&a.type!=="pointerdown"&&a.type!=="pointerup"?(this.buttons&2)!==0:this.button===2},set:function(a){this.buttons=a?this.buttons|2:this.buttons&-3}},middle:{get:function(){var a=this.event;return a===null||a.type!=="mousedown"&&a.type!=="mouseup"&&a.type!=="pointerdown"&&a.type!=="pointerup"?(this.buttons&4)!==0:this.button===1},set:function(a){this.buttons=a?this.buttons|4:this.buttons&-5}}}),ws.prototype.getMultiTouchDocumentPoint=ws.prototype.Bz,ws.prototype.getMultiTouchViewPoint=ws.prototype.So,ws.className="InputEvent";function Hu(){this.H=null,this.xa="",this.ar=this.Lr=null}Hu.prototype.copy=function(){var a=new Hu;return a.H=this.H,a.xa=this.xa,a.Lr=this.Lr,a.ar=this.ar,a},Hu.prototype.toString=function(){var a="*"+this.name;return this.subject!==null&&(a+=":"+this.subject.toString()),this.parameter!==null&&(a+="("+this.parameter.toString()+")"),a},zi.Object.defineProperties(Hu.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},name:{get:function(){return this.xa},set:function(a){this.xa=a}},subject:{get:function(){return this.Lr},set:function(a){this.Lr=a}},parameter:{get:function(){return this.ar},set:function(a){this.ar=a}}}),Hu.className="DiagramEvent";function Jr(){this.Fm=Yr,this.rf=this.Qq="",this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}Jr.prototype.clear=function(){this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null},Jr.prototype.copy=function(){var a=new Jr;a.Fm=this.Fm,a.Qq=this.Qq,a.rf=this.rf,a.cc=this.cc,a.H=this.H,a.Qn=this.Qn;var y=this.Sn;return a.Sn=Oe(y)&&typeof y.J=="function"?y.J():y,y=this.Rn,a.Rn=Oe(y)&&typeof y.J=="function"?y.J():y,y=this.Mn,a.Mn=Oe(y)&&typeof y.J=="function"?y.J():y,y=this.Ln,a.Ln=Oe(y)&&typeof y.J=="function"?y.J():y,a},Jr.prototype.qb=function(a){a.classType===Jr&&(this.change=a)},Jr.prototype.toString=function(){var a="";return a=this.change===da?a+"* ":this.change===Yr?a+(this.model!==null?"!m":"!d"):a+((this.model!==null?"!m":"!d")+this.change),this.propertyName&&typeof this.propertyName=="string"&&(a+=" "+this.propertyName),this.modelChange&&this.modelChange!==this.propertyName&&(a+=" "+this.modelChange),a+=": ",this.change===da?this.oldValue!==null&&(a+=" "+this.oldValue):(this.object!==null&&(a+=ki(this.object)),this.oldValue!==null&&(a+=" old: "+ki(this.oldValue)),this.oldParam!==null&&(a+=" "+this.oldParam),this.newValue!==null&&(a+=" new: "+ki(this.newValue)),this.newParam!==null&&(a+=" "+this.newParam)),a},Jr.prototype.I=function(a){return a?this.oldValue:this.newValue},Jr.prototype.Dz=function(a){return a?this.oldParam:this.newParam},Jr.prototype.canUndo=function(){return this.model!==null||this.diagram!==null},Jr.prototype.undo=function(){this.canUndo()&&(this.model!==null?this.model.changeState(this,!0):this.diagram!==null&&this.diagram.changeState(this,!0))},Jr.prototype.canRedo=function(){return this.model!==null||this.diagram!==null},Jr.prototype.redo=function(){this.canRedo()&&(this.model!==null?this.model.changeState(this,!1):this.diagram!==null&&this.diagram.changeState(this,!1))},zi.Object.defineProperties(Jr.prototype,{model:{get:function(){return this.cc},set:function(a){this.cc=a}},diagram:{get:function(){return this.H},set:function(a){this.H=a}},change:{get:function(){return this.Fm},set:function(a){this.Fm=a}},modelChange:{get:function(){return this.Qq},set:function(a){this.Qq=a}},propertyName:{get:function(){return this.rf},set:function(a){this.rf=a}},isTransactionFinished:{get:function(){return this.Fm===da&&(this.rf==="CommittedTransaction"||this.rf==="FinishedUndo"||this.rf==="FinishedRedo")}},object:{get:function(){return this.Qn},set:function(a){this.Qn=a}},oldValue:{get:function(){return this.Sn},set:function(a){this.Sn=a}},oldParam:{get:function(){return this.Rn},set:function(a){this.Rn=a}},newValue:{get:function(){return this.Mn},set:function(a){this.Mn=a}},newParam:{get:function(){return this.Ln},set:function(a){this.Ln=a}}}),Jr.prototype.redo=Jr.prototype.redo,Jr.prototype.canRedo=Jr.prototype.canRedo,Jr.prototype.undo=Jr.prototype.undo,Jr.prototype.canUndo=Jr.prototype.canUndo,Jr.prototype.getParam=Jr.prototype.Dz,Jr.prototype.getValue=Jr.prototype.I,Jr.prototype.clear=Jr.prototype.clear;var da=new ze(Jr,"Transaction",-1),Yr=new ze(Jr,"Property",0),xo=new ze(Jr,"Insert",1),Ao=new ze(Jr,"Remove",2);Jr.className="ChangedEvent",Jr.Transaction=da,Jr.Property=Yr,Jr.Insert=xo,Jr.Remove=Ao;function Ko(){this.o=new Me().freeze(),this.xa="",this.j=!1}Ko.prototype.toString=function(a){var y="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(a!==void 0&&0<a){a=this.changes.count;for(var x=0;x<a;x++){var E=this.changes.M(x);E!==null&&(y+=`
|
|
`+E.toString())}}return y},Ko.prototype.clear=function(){var a=this.changes;a.ka();for(var y=a.count-1;0<=y;y--){var x=a.M(y);x!==null&&x.clear()}a.clear(),a.freeze()},Ko.prototype.canUndo=function(){return this.isComplete},Ko.prototype.undo=function(){if(this.canUndo())for(var a=this.changes.count-1;0<=a;a--){var y=this.changes.M(a);y!==null&&y.undo()}},Ko.prototype.canRedo=function(){return this.isComplete},Ko.prototype.redo=function(){if(this.canRedo())for(var a=this.changes.count,y=0;y<a;y++){var x=this.changes.M(y);x!==null&&x.redo()}},Ko.prototype.ak=function(){if(this.isComplete){var a=this.changes;a.ka();for(var y=new ji,x=0;x<a.count;x++){var E=a.M(x);if(E!==null&&E.change===Yr&&E.object){var b=y.get(E.object);b||(b=new ji,y.set(E.object,b));var z=b.get(E.propertyName);z===null?b.set(E.propertyName,-1):(0<z&&a.cd(z,null),b.set(E.propertyName,x))}}for(x=y=0;x<a.count;x++)E=a.M(x),E!==null&&(x>y&&a.cd(y,E),y++);for(;a.length>y;)a.pop();a.freeze()}},zi.Object.defineProperties(Ko.prototype,{changes:{get:function(){return this.o}},name:{get:function(){return this.xa},set:function(a){this.xa=a}},isComplete:{get:function(){return this.j},set:function(a){this.j=a}}}),Ko.prototype.optimize=Ko.prototype.ak,Ko.prototype.redo=Ko.prototype.redo,Ko.prototype.canRedo=Ko.prototype.canRedo,Ko.prototype.undo=Ko.prototype.undo,Ko.prototype.canUndo=Ko.prototype.canUndo,Ko.prototype.clear=Ko.prototype.clear,Ko.className="Transaction";function qr(){this.Pt=new _e,this.Jd=!1,this.u=new Me().freeze(),this.Ce=-1,this.o=999,this.Fe=!1,this.Np=null,this.bi=0,this.j=!1,this.Ie=new Me().freeze(),this.hl=new Me,this.tt=!0,this.Dt=this.rq=this.Gt=this.Ft=!1}qr.prototype.toString=function(a){var y="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;y+="[";for(var x=this.nestedTransactionNames.count,E=0;E<x;E++)0<E&&(y+=" "),y+=this.nestedTransactionNames.M(E);if(y+="]",a!==void 0&&0<a)for(x=this.history.count,E=0;E<x;E++)y+=`
|
|
`+this.history.M(E).toString(a-1);return y},qr.prototype.clear=function(){var a=this.history;a.ka();for(var y=a.count-1;0<=y;y--){var x=a.M(y);x!==null&&x.clear()}a.clear(),this.Ce=-1,a.freeze(),this.Fe=!1,this.Np=null,this.bi=0,this.Ie.ka(),this.Ie.clear(),this.Ie.freeze(),this.hl.clear(),this.Dt=this.rq=this.Gt=this.Ft=!1},qr.prototype.copyProperties=function(a){this.isEnabled=a.isEnabled,this.maxHistoryLength=a.maxHistoryLength,this.checksTransactionLevel=a.checksTransactionLevel},yt=qr.prototype,yt.Xw=function(a){this.Pt.add(a)},yt.Rx=function(a){this.Pt.remove(a)},yt.Ea=function(a){if(a===void 0&&(a=""),a===null&&(a=""),this.isUndoingRedoing)return!1;this.tt===!0&&(this.tt=!1,this.bi++,this.isInternalTransaction||this.Ob("StartingFirstTransaction",a,this.currentTransaction),0<this.bi&&this.bi--),this.isEnabled&&(this.Ie.ka(),this.Ie.add(a),this.Ie.freeze(),this.currentTransaction===null?this.hl.add(0):this.hl.add(this.currentTransaction.changes.count)),this.bi++;var y=this.transactionLevel===1;return y&&(this.isInternalTransaction||this.Ob("StartedTransaction",a,this.currentTransaction)),y},yt.eb=function(a){return a===void 0&&(a=""),Ph(this,!0,a)},yt.Kf=function(){return Ph(this,!1,"")};function Ph(a,y,x){if(a.isUndoingRedoing)return!1;a.checksTransactionLevel&&1>a.transactionLevel&&Di("Ending transaction without having started a transaction: "+x);var E=a.transactionLevel===1,b=a.currentTransaction;E&&y&&(a.isInternalTransaction||a.Ob("CommittingTransaction",x,b));var z=0;if(0<a.transactionLevel&&(a.bi--,a.isEnabled)){var tt=a.Ie.count;0<tt&&(x===""&&(x=a.Ie.M(0)),a.Ie.ka(),a.Ie.mb(tt-1),a.Ie.freeze()),tt=a.hl.count,0<tt&&(z=a.hl.M(tt-1),a.hl.mb(tt-1))}if(E){if(y)a.rq=!1,b===null&&x!==""&&(b=a.currentTransaction),a.isEnabled&&b!==null&&(b.isComplete||(b.isComplete=!0,b.name=x),a.lx(),y=a.history,y.ka(),E=a.maxHistoryLength,0<=E&&(E===0?y.clear():y.count>=E&&(z=y.M(0),z!==null&&z.clear(),y.mb(0),a.Ce--)),E===0||y.count!==0&&y.get(y.count-1)===b||(y.add(b),a.Ce++),y.freeze()),a.isInternalTransaction||a.Ob("CommittedTransaction",x,b);else{a.Fe=!0;try{a.isEnabled&&b!==null&&(b.isComplete=!0,b.undo())}finally{a.isInternalTransaction||a.Ob("RolledBackTransaction",x,b),a.Fe=!1}b!==null&&b.clear()}return a.Np=null,a.isPendingClear&&a.clear(),a.isPendingClear=!1,a.isPendingUnmodified=!1,!0}if(a.isEnabled&&!y&&b!==null){for(a=z,x=b.changes,b=x.count-1;b>=a;b--)y=x.M(b),y!==null&&y.undo(),x.ka(),x.mb(b);x.freeze()}return!1}yt.lx=function(){if(!this.isUndoingRedoing&&this.canRedo()){var a=this.history;a.ka();for(var y=a.count-1;y>this.historyIndex;y--){var x=a.M(y);x!==null&&x.clear(),a.mb(y),this.rq=!0}a.freeze()}},qr.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToUndo;return!!(a!==null&&a.canUndo())},qr.prototype.undo=function(){if(this.canUndo()){var a=this.transactionToUndo;try{this.Fe=!0,this.Ob("StartingUndo","Undo",a),this.Ce--,a.undo()}catch(y){Di("undo error: "+y.toString())}finally{this.Ob("FinishedUndo","Undo",a),this.Fe=!1}}},qr.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToRedo;return!!(a!==null&&a.canRedo())},qr.prototype.redo=function(){if(this.canRedo()){var a=this.transactionToRedo;try{this.Fe=!0,this.Ob("StartingRedo","Redo",a),this.Ce++,a.redo()}catch(y){Di("redo error: "+y.toString())}finally{this.Ob("FinishedRedo","Redo",a),this.Fe=!1}}},qr.prototype.Ob=function(a,y,x){x===void 0&&(x=null);var E=new Jr;for(E.change=da,E.propertyName=a,E.object=x,E.oldValue=y,a=this.models;a.next();)y=a.value,E.model=y,y.ds(E)},qr.prototype.Tu=function(a){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(a)){var y=this.currentTransaction;y===null&&(this.Np=y=new Ko);var x=a.copy();y=y.changes,y.ka(),y.add(x),y.freeze(),this.checksTransactionLevel&&0>=this.transactionLevel&&!this.tt&&(a=a.diagram,a!==null&&a.pi===!1||Di("Change not within a transaction: "+x.toString()))}},qr.prototype.skipsEvent=function(a){if(a===null||0>a.change.value)return!0;if(a=a.object,a===null)return!1;if(a.layer!==void 0){if(a=a.layer,a!==null&&a.isTemporary)return!0}else if(a.isTemporary)return!0;return!1},zi.Object.defineProperties(qr.prototype,{models:{get:function(){return this.Pt.iterator}},isEnabled:{get:function(){return this.Jd},set:function(a){this.Jd=a}},transactionToUndo:{get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.M(this.historyIndex):null}},transactionToRedo:{get:function(){return this.historyIndex<this.history.count-1?this.history.M(this.historyIndex+1):null}},isUndoingRedoing:{get:function(){return this.Fe}},history:{get:function(){return this.u}},maxHistoryLength:{get:function(){return this.o},set:function(a){this.o=a}},historyIndex:{get:function(){return this.Ce}},currentTransaction:{get:function(){return this.Np}},transactionLevel:{get:function(){return this.bi}},isInTransaction:{get:function(){return 0<this.bi}},checksTransactionLevel:{get:function(){return this.j},set:function(a){this.j=a}},nestedTransactionNames:{get:function(){return this.Ie}},isPendingClear:{get:function(){return this.Ft},set:function(a){this.Ft=a}},isPendingUnmodified:{get:function(){return this.Gt},set:function(a){this.Gt=a}},isInternalTransaction:{get:function(){return this.Dt},set:function(a){this.Dt=a}},isJustDiscarded:{get:function(){return this.rq}}}),qr.prototype.handleChanged=qr.prototype.Tu,qr.prototype.redo=qr.prototype.redo,qr.prototype.undo=qr.prototype.undo,qr.prototype.canUndo=qr.prototype.canUndo,qr.prototype.discardHistoryAfterIndex=qr.prototype.lx,qr.prototype.rollbackTransaction=qr.prototype.Kf,qr.prototype.commitTransaction=qr.prototype.eb,qr.prototype.startTransaction=qr.prototype.Ea,qr.prototype.removeModel=qr.prototype.Rx,qr.prototype.addModel=qr.prototype.Xw,qr.prototype.clear=qr.prototype.clear,qr.className="UndoManager";function hr(){bi(this),this.H=ru,this.xa="",this.Jd=!0,this.nb=!1,this.wm=null,this.yy=new ws,this.Zr=-1}hr.prototype.toString=function(){return this.name!==""?this.name+" Tool":Xi(this.constructor)},hr.prototype.updateAdornments=function(){},hr.prototype.canStart=function(){return this.isEnabled},hr.prototype.doStart=function(){},hr.prototype.doActivate=function(){this.isActive=!0},hr.prototype.doDeactivate=function(){this.isActive=!1},hr.prototype.doStop=function(){},hr.prototype.doCancel=function(){this.transactionResult=null,this.stopTool()},hr.prototype.stopTool=function(){var a=this.diagram;a.currentTool===this&&(a.currentTool=null,a.currentCursor="")},hr.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()},hr.prototype.doMouseMove=function(){},hr.prototype.doMouseUp=function(){this.stopTool()},hr.prototype.doMouseWheel=function(){},hr.prototype.canStartMultiTouch=function(){return!0},hr.prototype.standardPinchZoomStart=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,Pt.allocAt(NaN,NaN)),E=y.So(1,Pt.allocAt(NaN,NaN));if(x.w()&&E.w()&&(this.doCancel(),a.Ql("hasGestureZoom"))){a.Bw=a.scale;var b=E.x-x.x,z=E.y-x.y;a.Jw=Math.sqrt(b*b+z*z),y.bubbles=!1}Pt.free(x),Pt.free(E)},hr.prototype.standardPinchZoomMove=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,Pt.allocAt(NaN,NaN)),E=y.So(1,Pt.allocAt(NaN,NaN));if(x.w()&&E.w()&&(this.doCancel(),a.Ql("hasGestureZoom"))){var b=E.x-x.x,z=E.y-x.y;z=Math.sqrt(b*b+z*z)/a.Jw,b=new Pt((Math.min(E.x,x.x)+Math.max(E.x,x.x))/2,(Math.min(E.y,x.y)+Math.max(E.y,x.y))/2),z*=a.Bw;var tt=a.commandHandler;if(z!==a.scale&&tt.canResetZoom(z)){var it=a.zoomPoint;a.zoomPoint=b,tt.resetZoom(z),a.zoomPoint=it}y.bubbles=!1}Pt.free(x),Pt.free(E)},hr.prototype.doKeyDown=function(){this.diagram.lastInput.key==="Esc"&&this.doCancel()},hr.prototype.doKeyUp=function(){},hr.prototype.Ea=function(a){return a===void 0&&(a=this.name),this.transactionResult=null,this.diagram.Ea(a)},hr.prototype.stopTransaction=function(){var a=this.diagram;return this.transactionResult===null?a.Kf():a.eb(this.transactionResult)},hr.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.lastInput,x=a.Ol(y.documentPoint,!1);if(x!==null){if(Sr?y.meta:y.control){for(a.R("ChangingSelection",a.selection),y=x;y!==null&&!y.canSelect();)y=y.containingGroup;y!==null&&(y.isSelected=!y.isSelected),a.R("ChangedSelection",a.selection)}else if(y.shift){if(!x.isSelected){for(a.R("ChangingSelection",a.selection),y=x;y!==null&&!y.canSelect();)y=y.containingGroup;y!==null&&(y.isSelected=!0),a.R("ChangedSelection",a.selection)}}else if(!x.isSelected){for(y=x;y!==null&&!y.canSelect();)y=y.containingGroup;y!==null&&a.select(y)}}else!y.left||(Sr?y.meta:y.control)||y.shift||a.clearSelection()}},hr.prototype.standardMouseClick=function(a,y){a===void 0&&(a=null),y===void 0&&(y=function(b){return!b.layer.isTemporary});var x=this.diagram,E=x.lastInput;return a=x.ic(E.documentPoint,a,y),E.targetObject=a,Bg(a,E,x),E.handled};function Bg(a,y,x){if(y.handled=!1,a===null||a.If()){var E=0;y.left?E=y.clickCount===1?1:y.clickCount===2?2:1:y.right&&y.clickCount===1&&(E=3);var b="ObjectSingleClicked";if(a!==null){switch(E){case 1:b="ObjectSingleClicked";break;case 2:b="ObjectDoubleClicked";break;case 3:b="ObjectContextClicked"}E!==0&&x.R(b,a)}else{switch(E){case 1:b="BackgroundSingleClicked";break;case 2:b="BackgroundDoubleClicked";break;case 3:b="BackgroundContextClicked"}E!==0&&x.R(b)}if(a!==null)for(;a!==null;){switch(x=null,E){case 1:x=a.click;break;case 2:x=a.doubleClick?a.doubleClick:a.click;break;case 3:x=a.contextClick}if(x!==null&&(x(y,a),y.handled))break;a=a.panel}else{switch(a=null,E){case 1:a=x.click;break;case 2:a=x.doubleClick?x.doubleClick:x.click;break;case 3:a=x.contextClick}a!==null&&a(y)}}}hr.prototype.standardMouseOver=function(){var a=this.diagram,y=a.lastInput;if(a.animationManager.zb!==!0){var x=a.skipsUndoManager;a.skipsUndoManager=!0;var E=a.viewportBounds.ca(y.documentPoint)?a.ic(y.documentPoint,null,null):null;!y.event||y.event.type!=="pointercancel"&&y.event.type!=="pointerout"||(E=null),y.targetObject=E;var b=!1;if(E!==a.Ck){var z=a.Ck,tt=z;for(a.Ck=E,this.doCurrentObjectChanged(z,E),y.handled=!1;z!==null;){var it=z.mouseLeave;if(it!==null&&(E===z||E!==null&&E.rg(z)||(it(y,z,E),b=!0,y.handled)))break;z=z.panel}for(z=tt,y.handled=!1;E!==null&&(tt=E.mouseEnter,!(tt!==null&&(z===E||z!==null&&z.rg(E)||(tt(y,E,z),b=!0,y.handled))));)E=E.panel;E=a.Ck}if(E!==null){for(z=E,tt="";z!==null&&(tt=z.cursor,tt==="");)z=z.panel;for(a.currentCursor=tt,y.handled=!1,z=E;z!==null&&(E=z.mouseOver,!(E!==null&&(E(y,z),b=!0,y.handled)));)z=z.panel}else this.doUpdateCursor(null),E=a.mouseOver,E!==null&&(E(y),b=!0);b&&a.$b(),a.skipsUndoManager=x}},hr.prototype.doUpdateCursor=function(){var a=this.diagram;a&&(a.currentCursor="")},hr.prototype.doCurrentObjectChanged=function(){},hr.prototype.standardMouseWheel=function(){var a=this.diagram,y=a.lastInput,x=y.delta;if(x!==0&&a.documentBounds.w()){var E=a.commandHandler,b=a.toolManager.mouseWheelBehavior;if(E!==null&&(b===Qc&&!y.shift||b===pc&&y.control))(0<x?E.canIncreaseZoom():E.canDecreaseZoom())&&(b=a.zoomPoint,a.zoomPoint=y.viewPoint,0<x?E.increaseZoom():E.decreaseZoom(),a.zoomPoint=b),y.bubbles=!1;else if(b===Qc&&y.shift||b===pc&&!y.control){E=a.position.copy();var z=y.event;b=z.deltaMode;var tt=z.deltaX;z=z.deltaY;var it="pixel";if(tt===0&&z===0||y.shift)!y.shift&&a.allowVerticalScroll?(x=3*x*a.scrollVerticalLineChange,a.scroll(it,0<x?"up":"down",Math.abs(x))):y.shift&&a.allowHorizontalScroll&&(x=3*x*a.scrollHorizontalLineChange,a.scroll(it,0<x?"left":"right",Math.abs(x)));else{switch(b){case 0:it="pixel";break;case 1:it="line";break;case 2:it="page"}tt!==0&&a.allowHorizontalScroll&&(tt*=a.scrollHorizontalLineChange/16,a.scroll(it,0<tt?"right":"left",Math.abs(tt))),z!==0&&a.allowVerticalScroll&&(z*=a.scrollVerticalLineChange/16,a.scroll(it,0<z?"down":"up",Math.abs(z)))}this.doWheelChange(a,E,y)}}},hr.prototype.doWheelChange=function(a,y,x){a.position.D(y)&&x.event.wheelDeltaX===0||(x.bubbles=!1)},hr.prototype.standardWaitAfter=function(a,y){y===void 0&&(y=this.diagram.lastInput),this.cancelWaitAfter();var x=this,E=y.clone(this.yy);this.Zr=On(function(){x.doWaitAfter(E)},a)},hr.prototype.cancelWaitAfter=function(){this.Zr!==-1&&Xe.clearTimeout(this.Zr),this.Zr=-1},hr.prototype.doWaitAfter=function(){},hr.prototype.findToolHandleAt=function(a,y){return a=this.diagram.ic(a,function(x){for(;x!==null&&!(x.panel instanceof cr);)x=x.panel;return x}),a===null?null:a.part.category===y?a:null},hr.prototype.isBeyondDragSize=function(a,y){var x=this.diagram;a===void 0&&(a=x.firstInput.viewPoint),y===void 0&&(y=x.lastInput.viewPoint);var E=x.toolManager.dragSize,b=E.width;return E=E.height,x.firstInput.isTouchEvent&&(b+=6,E+=6),Math.abs(y.x-a.x)>b||Math.abs(y.y-a.y)>E},zi.Object.defineProperties(hr.prototype,{diagram:{get:function(){return this.H},set:function(a){a instanceof le&&(this.H=a)}},name:{get:function(){return this.xa},set:function(a){this.xa=a}},isEnabled:{get:function(){return this.Jd},set:function(a){this.Jd=a}},isActive:{get:function(){return this.nb},set:function(a){this.nb=a}},transactionResult:{get:function(){return this.wm},set:function(a){this.wm=a}}}),hr.prototype.startTransaction=hr.prototype.Ea,hr.className="Tool";function Ur(){hr.call(this),this.name="ToolManager",this.hb=new Me,this.ob=new Me,this.Hb=new Me,this.F=this.V=850,this.o=new li(2,2).ja(),this.Ha=5e3,this.ia=pc,this.u=Zf,this.Mp=this.j=null,this.zj=-1}Vi(Ur,hr),Ur.prototype.initializeStandardTools=function(){},Ur.prototype.updateAdornments=function(a){var y=this.currentToolTip;if(y instanceof cr&&this.Mp===a){var x=y.adornedObject;(a!==null?x.part===a:x===null)?this.showToolTip(y,x):this.hideToolTip()}},Ur.prototype.doMouseDown=function(){var a=this.diagram,y=a.lastInput;if(y.isTouchEvent&&this.gestureBehavior===Cu&&(y.bubbles=!1),y.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===Nh){y.bubbles=!0;return}if(this.gestureBehavior===Cu)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}for(var x=this.mouseDownTools.length,E=0;E<x;E++){var b=this.mouseDownTools.M(E);if(b.diagram=this.diagram,b.canStart()){a.doFocus(),a.currentTool=b,a.currentTool===b&&(b.isActive||b.doActivate(),b.doMouseDown());return}}a.lastInput.button===1&&(this.mouseWheelBehavior===pc?this.mouseWheelBehavior=Qc:this.mouseWheelBehavior===Qc&&(this.mouseWheelBehavior=pc)),this.doActivate(),this.standardWaitAfter(this.holdDelay,y)},Ur.prototype.doMouseMove=function(){var a=this.diagram,y=a.lastInput;if(y.isMultiTouch){if(this.gestureBehavior===Nh){y.bubbles=!0;return}if(this.gestureBehavior===Cu)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomMove();return}}if(this.isActive)for(var x=this.mouseMoveTools.length,E=0;E<x;E++){var b=this.mouseMoveTools.M(E);if(b.diagram=this.diagram,b.canStart()){a.doFocus(),a.currentTool=b,a.currentTool===b&&(b.isActive||b.doActivate(),b.doMouseMove());return}}Og(this,a),a=y.event,a===null||a.type!=="pointermove"&&a.cancelable||(y.bubbles=!0)};function Og(a,y){a.standardMouseOver(),a.isBeyondDragSize()&&a.standardWaitAfter(a.isActive?a.holdDelay:a.hoverDelay,y.lastInput)}Ur.prototype.doCurrentObjectChanged=function(a,y){a=this.currentToolTip,a===null||y!==null&&a instanceof cr&&(y===a||y.rg(a))||this.hideToolTip()},Ur.prototype.doWaitAfter=function(a){var y=this.diagram;y.ta!==null&&(this.doMouseHover(),this.isActive||this.doToolTip(),a.isTouchEvent&&!y.lastInput.handled&&(a=a.copy(),a.button=2,a.buttons=2,y.lastInput=a,y.qu=!0,y.doMouseUp()))},Ur.prototype.doMouseHover=function(){var a=this.diagram,y=a.lastInput;y.targetObject===null&&(y.targetObject=a.ic(y.documentPoint,null,null));var x=y.targetObject;if(x!==null)for(y.handled=!1;x!==null&&(a=this.isActive?x.mouseHold:x.mouseHover,!(a!==null&&(a(y,x),y.handled)));)x=x.panel;else x=this.isActive?a.mouseHold:a.mouseHover,x!==null&&x(y)},Ur.prototype.doToolTip=function(){var a=this.diagram,y=a.lastInput;if(y.targetObject===null&&(y.targetObject=a.ic(y.documentPoint,null,null)),y=y.targetObject,y!==null){if(a=this.currentToolTip,!(a instanceof cr)||y!==a&&!y.rg(a)){for(;y!==null;){if(a=y.toolTip,a!==null){this.showToolTip(a,y);return}y=y.panel}this.hideToolTip()}}else y=a.toolTip,y!==null?this.showToolTip(y,null):this.hideToolTip()},Ur.prototype.showToolTip=function(a,y){var x=this.diagram;if(a!==this.currentToolTip&&this.hideToolTip(),a instanceof cr){a.layerName="Tool",a.selectable=!1,a.scale=1/x.scale,a.category="ToolTip",a.placeholder!==null&&(a.placeholder.scale=x.scale);var E=a.diagram;E!==null&&E!==x&&E.remove(a),x.add(a),y!==null?a.adornedObject=y:a.data=x.model,a.Va(),this.positionToolTip(a,y)}else a instanceof Wl&&a!==this.currentToolTip&&a.show(y,x,this);if(this.currentToolTip=a,this.zj!==-1&&(Xe.clearTimeout(this.zj),this.zj=-1),a=this.toolTipDuration,0<a&&a!==1/0){var b=this;this.zj=On(function(){b.hideToolTip()},a)}},Ur.prototype.positionToolTip=function(a){if(a.placeholder===null){var y=this.diagram,x=y.lastInput.documentPoint.copy(),E=a.measuredBounds,b=y.viewportBounds;y.lastInput.isTouchEvent&&(x.x-=E.width),x.x+E.width>b.right&&(x.x-=E.width+5/y.scale),x.x<b.x&&(x.x=b.x),x.y=x.y+20/y.scale+E.height>b.bottom?x.y-(E.height+5/y.scale):x.y+20/y.scale,x.y<b.y&&(x.y=b.y),a.position=x}},Ur.prototype.hideToolTip=function(){this.zj!==-1&&(Xe.clearTimeout(this.zj),this.zj=-1);var a=this.diagram,y=this.currentToolTip;y!==null&&(y instanceof cr?(a.remove(y),this.Mp!==null&&this.Mp.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Wl&&y.hide!==null&&y.hide(a,this),this.currentToolTip=null)},Ur.prototype.doMouseUp=function(){this.cancelWaitAfter();var a=this.diagram;if(this.isActive)for(var y=this.mouseUpTools.length,x=0;x<y;x++){var E=this.mouseUpTools.M(x);if(E.diagram=this.diagram,E.canStart()){a.doFocus(),a.currentTool=E,a.currentTool===E&&(E.isActive||E.doActivate(),E.doMouseUp());return}}a.doFocus(),this.doDeactivate()},Ur.prototype.doMouseWheel=function(){this.standardMouseWheel()},Ur.prototype.doKeyDown=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyDown()},Ur.prototype.doKeyUp=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyUp()},Ur.prototype.findTool=function(a){for(var y=this.mouseDownTools.length,x=0;x<y;x++){var E=this.mouseDownTools.M(x);if(E.name===a)return E}for(y=this.mouseMoveTools.length,x=0;x<y;x++)if(E=this.mouseMoveTools.M(x),E.name===a)return E;for(y=this.mouseUpTools.length,x=0;x<y;x++)if(E=this.mouseUpTools.M(x),E.name===a)return E;return null},Ur.prototype.replaceTool=function(a,y){y!==null&&(y.diagram=this.diagram);for(var x=this.mouseDownTools.length,E=0;E<x;E++){var b=this.mouseDownTools.M(E);if(b.name===a)return y!==null?this.mouseDownTools.cd(E,y):this.mouseDownTools.mb(E),b}for(x=this.mouseMoveTools.length,E=0;E<x;E++)if(b=this.mouseMoveTools.M(E),b.name===a)return y!==null?this.mouseMoveTools.cd(E,y):this.mouseMoveTools.mb(E),b;for(x=this.mouseUpTools.length,E=0;E<x;E++)if(b=this.mouseUpTools.M(E),b.name===a)return y!==null?this.mouseUpTools.cd(E,y):this.mouseUpTools.mb(E),b;return null},Ur.prototype.gb=function(a,y,x){y!==null&&(y.name=a,y.diagram=this.diagram),this.findTool(a)?this.replaceTool(a,y):y!==null&&x.add(y)},zi.Object.defineProperties(Ur.prototype,{mouseWheelBehavior:{get:function(){return this.ia},set:function(a){this.ia=a}},gestureBehavior:{get:function(){return this.u},set:function(a){this.u=a}},currentToolTip:{get:function(){return this.j},set:function(a){this.j=a,this.Mp=a!==null&&a instanceof cr?a.adornedPart:null}},mouseDownTools:{get:function(){return this.hb}},mouseMoveTools:{get:function(){return this.ob}},mouseUpTools:{get:function(){return this.Hb}},hoverDelay:{get:function(){return this.V},set:function(a){this.V=a}},holdDelay:{get:function(){return this.F},set:function(a){this.F=a}},dragSize:{get:function(){return this.o},set:function(a){this.o=a.J()}},toolTipDuration:{get:function(){return this.Ha},set:function(a){this.Ha=a}}}),Ur.prototype.replaceStandardTool=Ur.prototype.gb;var pc=new ze(Ur,"WheelScroll",0),Qc=new ze(Ur,"WheelZoom",1),tp=new ze(Ur,"WheelNone",2),Zf=new ze(Ur,"GestureZoom",3),Cu=new ze(Ur,"GestureCancel",4),Nh=new ze(Ur,"GestureNone",5);Ur.className="ToolManager",Ur.WheelScroll=pc,Ur.WheelZoom=Qc,Ur.WheelNone=tp,Ur.GestureZoom=Zf,Ur.GestureCancel=Cu,Ur.GestureNone=Nh;function to(){hr.call(this),this.name="Dragging",this.u=this.Sw=this.ob=!0,this.o=this.Ha=this.V=this.Oe=null,this.Ym=this.Hb=!1,this.tl=new Pt(NaN,NaN),this.Fr=new Pt,this.hb=!0,this.Ik=100,this.Cg=[],this.te=new _e().freeze(),this.ia=new rt,this.Bn=null,this.F="copy",this.Oc="",this.Pc="no-drop"}var iu;Vi(to,hr),to.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly&&!a.allowDragOut||!a.allowMove&&!a.allowCopy&&!a.allowDragOut||!a.allowSelect)return!1;var y=a.lastInput;return!y.left||a.currentTool!==this&&(!this.isBeyondDragSize()||y.isTouchEvent&&y.timestamp-a.firstInput.timestamp<this.Ik)?!1:this.findDraggablePart()!==null},to.prototype.findDraggablePart=function(){var a=this.diagram;if(a=a.Ol(a.firstInput.documentPoint,!1),a===null)return null;for(;a!==null&&!a.canSelect();)a=a.containingGroup;return a!==null&&(a.canMove()||a.canCopy())?a:null},to.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.Ol(a.firstInput.documentPoint,!1);if(y!==null){for(;y!==null&&!y.canSelect();)y=y.containingGroup;this.currentPart=y,this.currentPart===null||this.currentPart.isSelected||(a.R("ChangingSelection",a.selection),y=a.lastInput,(Sr?y.meta:y.control)||y.shift||a.clearSelection(!0),this.currentPart.isSelected=!0,a.R("ChangedSelection",a.selection))}}},to.prototype.doActivate=function(){var a=this.diagram;this.Bn=null,this.currentPart===null&&this.standardMouseSelect();var y=this.currentPart;y!==null&&(y.canMove()||y.canCopy())&&(a.Fu(!0),ts=null,this.isActive=!0,this.tl.set(a.position),Kf(this,a.selection),this.Cg.length=0,a.animationManager.Cc(),this.draggedParts=this.computeEffectiveCollection(a.selection,this.dragOptions),this.Sw=this.diagram.layout.isRealtime,this.diagram.layout.isRealtime=!1,a.Ns=!0,a.Gf("temporaryPixelRatio")===!0&&30<a.$w&&Us(a),sd(a,this.draggedParts),this.Ea("Drag"),this.startPoint=a.firstInput.documentPoint,a.isMouseCaptured=!0,a.allowDragOut&&(this.isDragOutStarted=!0,this.Ym=!1,ts=this,Gu=this.diagram,this.doSimulatedDragOut()))};function Kf(a,y){if(a.dragsLink){var x=a.diagram;x.allowRelink&&(x.model.Wj()&&y.count===1&&y.first()instanceof fi?(a.draggedLink=y.first(),a.draggedLink.canRelinkFrom()&&a.draggedLink.canRelinkTo()&&a.draggedLink.Ej(),a.Oe=x.toolManager.findTool("Relinking"),a.Oe===null&&(a.Oe=new ba,a.Oe.diagram=x),a.Oe.originalLink=a.draggedLink):(a.draggedLink=null,a.Oe=null))}}to.prototype.computeEffectiveCollection=function(a,y){return this.diagram.commandHandler.computeEffectiveCollection(a,y)},to.prototype.Pd=function(a){return a===void 0?new Nu(gr):this.isGridSnapEnabled?new Nu(new Pt(Math.round(1e3*a.x)/1e3,Math.round(1e3*a.y)/1e3)):new Nu(a.copy())},to.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;if(this.diagram.layout.isRealtime=this.Sw,a.Fu(!1),a.ug(),Th(this),Hh(a,this.draggedParts),this.draggedParts=this.currentPart=this.Bn=null,this.Ym=this.isDragOutStarted=!1,0<iu.count){for(var y=iu,x=y.length,E=0;E<x;E++){var b=y.M(E);Wu(b),pl(b),Th(b),b.diagram.ug()}y.clear()}Wu(this),this.tl.h(NaN,NaN),Gu!==null&&(Gu.currentCursor=""),ts=Gu=null,pl(this),a.isMouseCaptured=!1,a.currentCursor="",a.Ns=!1,this.stopTransaction(),cf(a,!0)},to.prototype.stopTransaction=function(){var a=this.diagram,y=hr.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y};function Th(a){var y=a.diagram,x=y.skipsUndoManager;y.skipsUndoManager=!0,ip(a,y.lastInput,null),y.skipsUndoManager=x,a.Cg.length=0}function ep(){var a=ts;pl(a),Zu(a);var y=a.diagram;a.tl.w()&&(y.position=a.tl),y.ug()}to.prototype.doCancel=function(){pl(this),Zu(this);var a=this.diagram;this.tl.w()&&(a.position=this.tl),this.stopTool()},to.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput;this.isActive&&(y.key==="Esc"?this.doCancel():y.key!==a.previousInput.key&&this.doMouseMove())},to.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()};function ku(a,y){if(a.copiedParts===null){var x=a.diagram;if((!y||!x.isReadOnly&&!x.isModelReadOnly)&&a.draggedParts!==null){var E=x.undoManager;for(E.isEnabled&&E.isInTransaction?E.currentTransaction!==null&&0<E.currentTransaction.changes.count&&(x.undoManager.Kf(),x.Ea("Drag")):Zu(a),x.skipsUndoManager=!y,x.partManager.addsToTemporaryLayer=!y,a.startPoint=x.firstInput.documentPoint,y=a.copiesEffectiveCollection?a.draggedParts.Lf():x.selection,y=x.Kj(y,x,!0),x=new ji,E=a.draggedParts.iterator;E.next();){var b=E.key;if(b.Zc()&&b.canCopy()){var z=y.I(b);z!==null&&(z.location=b.location,z.Va(),x.add(z,a.Pd(z.location)))}}for(y=y.iterator;y.next();)E=y.value,E instanceof fi&&E.canCopy()&&x.add(E,a.Pd());a.copiedParts=x,Kf(a,x.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,ch(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}function pl(a){var y=a.diagram;if(a.copiedParts!==null){if(y.Is(a.copiedParts.Lf(),!1),a.copiedParts=null,a.draggedParts!==null)for(var x=a.draggedParts.iterator;x.next();)x.key instanceof fi&&(x.value.point=new Pt(0,0));a.doUpdateCursor(null)}y.skipsUndoManager=!1,y.partManager.addsToTemporaryLayer=!1,a.startPoint=y.firstInput.documentPoint}function Wu(a){if(a.draggedLink!==null){if(a.dragsLink&&a.Oe!==null){var y=a.Oe;y.diagram.remove(y.temporaryFromNode),y.diagram.remove(y.temporaryToNode),a.Oe.originalLink=null}a.draggedLink=null,a.Oe=null}}function Hl(a,y,x){var E=a.diagram,b=a.startPoint,z=Pt.alloc();z.assign(E.lastInput.documentPoint),a.moveParts(y,z.re(b),x),Pt.free(z),E.Gf("temporaryPixelRatio")===!0&&E.Yh===null&&30<E.$w&&(Us(E),E.hk())}to.prototype.moveParts=function(a,y,x){x===void 0&&(x=!1);var E=this.diagram;E!==null&&_h(E,a,y,this.dragOptions,x)};function Zu(a){if(a.draggedParts!==null){for(var y=a.diagram,x=a.draggedParts.iterator;x.next();){var E=x.key;E.Zc()&&(E.location=x.value.point)}for(x=a.draggedParts.iterator;x.next();)if(E=x.key,E instanceof fi&&E.suspendsRouting){var b=x.value.point;a.draggedParts.add(E,a.Pd()),ch(E,-b.x,-b.y)}y.bd()}}function Vf(a,y){var x=a.diagram;a.dragsLink&&(a.draggedLink!==null&&(a.draggedLink.fromNode=null,a.draggedLink.toNode=null),Ku(a,!1));var E=a.findDragOverObject(y),b=x.lastInput;b.targetObject=E,a.doUpdateCursor(E);var z=x.skipsUndoManager,tt=!1;try{if(x.skipsUndoManager=!0,tt=ip(a,b,E),!a.isActive&&ts===null)return;var it=E!==null?E.part:null;if(it===null||x.handlesDragDropForTopLevelParts&&it.isTopLevel&&!(it instanceof An)){var nt=x.mouseDragOver;nt!==null&&(nt(b),tt=!0)}if(!a.isActive&&ts===null||(a.doDragOver(y,E),!a.isActive&&ts===null))return}finally{x.skipsUndoManager=z,tt&&x.bd()}a.Bn=E,x.isReadOnly||!x.allowMove&&!x.allowCopy||!x.allowHorizontalScroll&&!x.allowVerticalScroll||x.gs(b.viewPoint)}to.prototype.findDragOverObject=function(a){var y=this;return ou(this.diagram,a,null,function(x){return x===null?x=!0:(x=x.part,x=!!(x===null||x instanceof cr||x.layer.isTemporary||y.draggedParts&&y.draggedParts.contains(x)||y.copiedParts&&y.copiedParts.contains(x))),!x})},to.prototype.doUpdateCursor=function(a){var y=this.diagram;(a===null||this.Bn!==a)&&(!this.diagram.currentTool.isActive||this.mayCopy()?y.currentCursor=this.copyCursor:this.mayMove()?y.currentCursor=this.moveCursor:this.mayDragOut()&&(y.currentCursor=this.nodropCursor))};function ip(a,y,x){var E=!1,b=a.Cg.length,z=0<b?a.Cg[0]:null;if(x===z)return!1;y.handled=!1;for(var tt=0;tt<b;tt++){var it=a.Cg[tt],nt=it.mouseDragLeave;if(nt!==null&&(nt(y,it,x),E=!0,y.handled))break}if(a.Cg.length=0,!a.isActive&&ts===null||x===null)return E;for(y.handled=!1,b=x;b!==null;)a.Cg.push(b),b=np(b);for(b=a.Cg.length,x=0;x<b&&(tt=a.Cg[x],it=tt.mouseDragEnter,it===null||(it(y,tt,z),E=!0,!y.handled));x++);return E}function np(a){var y=a.panel;return y!==null?y:a instanceof tn&&!(a instanceof An)&&(a=a.containingGroup,a!==null&&a.handlesDragDropForMembers)?a:null}function Ig(a,y,x){var E=a.Oe;if(E===null)return null;var b=a.diagram.og(y,E.portGravity,function(ot){return E.findValidLinkablePort(ot,x)});a=Pt.alloc();var z=1/0,tt=null;for(b=b.iterator;b.next();){var it=b.value;if(it.part!==null){var nt=it.ga(Hn,a);nt=y.Bf(nt),nt<z&&(tt=it,z=nt)}}return Pt.free(a),tt}function Ku(a,y){var x=a.draggedLink;if(x!==null&&!(2>x.pointsCount)){var E=a.diagram;if(!E.isReadOnly){var b=a.Oe;if(b!==null){var z=null,tt=null;x.fromNode===null&&(z=Ig(a,x.i(0),!1),z!==null&&(tt=z.part));var it=null,nt=null;x.toNode===null&&(it=Ig(a,x.i(x.pointsCount-1),!0),it!==null&&(nt=it.part)),b.isValidLink(tt,z,nt,it)?y?(x.defaultFromPoint=x.i(0),x.defaultToPoint=x.i(x.pointsCount-1),x.suspendsRouting=!1,x.fromNode=tt,z!==null&&(x.fromPortId=z.portId),x.toNode=nt,it!==null&&(x.toPortId=it.portId),x.fromPort!==E.Mx&&E.R("LinkRelinked",x,E.Mx),x.toPort!==E.Nx&&E.R("LinkRelinked",x,E.Nx)):Gf(b,tt,z,nt,it):Gf(b,null,null,null,null)}}}}to.prototype.doDragOver=function(){};function Vu(a,y){var x=a.diagram;a.dragsLink&&Ku(a,!0),Th(a);var E=a.findDragOverObject(y),b=x.lastInput;if(b.targetObject=E,E!==null){b.handled=!1;for(var z=E;z!==null;){var tt=z.mouseDrop;if(tt!==null&&(tt(b,z),b.handled))break;Qm(a,b,z),z=np(z)}}else z=x.mouseDrop,z!==null&&z(b);if(a.isActive||ts!==null){for(b=(a.copiedParts||a.draggedParts).iterator;b.next();)z=b.key,z instanceof Ci&&z.linksConnected.each(function(it){it.suspendsRouting=!1});if(a.doDropOnto(y,E),a.isActive||ts!==null){for(a=be.alloc(),y=x.selection.iterator;y.next();)E=y.value,E instanceof Ci&&$m(x,E,a);be.free(a)}}}function Qm(a,y,x){a=a.diagram,x=x.part,!a.handlesDragDropForTopLevelParts||!x.isTopLevel||x instanceof An||(x=a.mouseDrop,x!==null&&x(y))}function $m(a,y,x){var E=!1;if(x=y.getAvoidableRect(x),a.viewportBounds.Re(x)&&(E=!0),a=a.Nu(x,function(b){return b.part},function(b){return b instanceof fi},!0,function(b){return b instanceof fi},E),a.count!==0)for(a=a.iterator;a.next();)x=a.value,!x.Td(y)&&x.isAvoiding&&x.bb()}to.prototype.doDropOnto=function(){},to.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram,y=a.lastInput;this.simulatedMouseMove(y.event,y.documentPoint,y.targetDiagram)||this.currentPart===null||this.draggedParts===null||(this.mayCopy()?(ku(this,!1),sd(a,this.copiedParts),Hl(this,this.copiedParts,!1),Hh(a,this.copiedParts)):this.mayMove()?(pl(this),Hl(this,this.draggedParts,!0)):this.mayDragOut()?(ku(this,!1),Hl(this,this.copiedParts,!1)):pl(this),Vf(this,a.lastInput.documentPoint))}},to.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,y=a.lastInput;if(!this.simulatedMouseUp(y.event,y.documentPoint,y.targetDiagram)){y=!1;var x=this.mayCopy();if(x&&this.copiedParts!==null?(pl(this),ku(this,!0),sd(a,this.copiedParts),Hl(this,this.copiedParts,!1),Hh(a,this.copiedParts),this.copiedParts!==null&&(a.R("ChangingSelection",a.selection),a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(b){b.isSelected=!0}))):(y=!0,pl(this),this.mayMove()&&(Hl(this,this.draggedParts,!0),Vf(this,a.lastInput.documentPoint))),this.Ym=!0,Vu(this,a.lastInput.documentPoint),this.isActive){var E=x?this.copiedParts.Lf():this.draggedParts.Lf();this.copiedParts=null,y&&qm(this),a.Ya(),Hh(a,this.draggedParts),this.transactionResult=x?"Copy":"Move",a.R(x?"SelectionCopied":"SelectionMoved",E)}this.stopTool(),x&&a.R("ChangedSelection",a.selection)}}},to.prototype.simulatedMouseMove=function(a,y,x){if(ts===null)return!1;var E=ts.diagram;x instanceof le||(x=null);var b=Gu;return x!==b&&(b!==null&&b!==E&&(b.ug(),ts.isDragOutStarted=!1,b=b.toolManager.findTool("Dragging"),b!==null&&b.doSimulatedDragLeave()),Gu=x,x!==null&&x!==E&&(ep(),b=x.toolManager.findTool("Dragging"),b!==null&&(iu.contains(b)||iu.add(b),b.doSimulatedDragEnter())),this.doUpdateCursor(null)),x===null||x===E||!x.allowDrop||x.isReadOnly||!x.allowInsert?!1:(E=x.toolManager.findTool("Dragging"),E!==null&&(a!==null&&(a.targetTouches!==void 0&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&&(a=a.changedTouches[0])),y=x.getMouse(a)),x.lastInput.documentPoint=y,x.lastInput.viewPoint=x.op(y),x.lastInput.down=!1,x.lastInput.up=!1,E.doSimulatedDragOver()),!0)},to.prototype.simulatedMouseUp=function(a,y,x){if(ts===null)return!1;var E=Gu,b=ts.diagram;if(x===null)return ts.doCancel(),!0;if(x!==E){var z=E.toolManager.findTool("Dragging");if(E!==null&&E!==b&&z!==null)return E.ug(),ts.isDragOutStarted=!1,z.doSimulatedDragLeave(),!1;Gu=x,E=x.toolManager.findTool("Dragging"),E!==null&&(ep(),iu.contains(E)||iu.add(E),E.doSimulatedDragEnter())}return x!==this.diagram?(a!==null?(a.targetTouches!==void 0&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&&(a=a.changedTouches[0])),y=x.getMouse(a)):y===null&&(y=new Pt),x.lastInput.documentPoint=y,x.lastInput.viewPoint=x.op(y),x.lastInput.down=!1,x.lastInput.up=!0,a=x.toolManager.findTool("Dragging"),a!==null&&a.doSimulatedDrop(),a=ts,a!==null&&(x=a.mayCopy(),a.transactionResult=x?"Copy":"Move",a.stopTool()),!0):!1};function qm(a){if(a.draggedParts!==null)for(var y=a.draggedParts.iterator;y.next();){var x=y.key;x instanceof Ci&&(x=x.containingGroup,x===null||x.placeholder===null||a.draggedParts.contains(x)||x.placeholder.v())}}to.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowCopy||(Sr?!a.lastInput.alt:!a.lastInput.control))return!1;for(a=a.selection.iterator;a.next();)if(a.value.canCopy())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canCopy())},to.prototype.mayDragOut=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(!a.allowDragOut||!a.allowCopy||a.allowMove)return!1;for(a=a.selection.iterator;a.next();)if(a.value.canCopy())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canCopy())},to.prototype.mayMove=function(){var a=this.diagram;if(a.isReadOnly||!a.allowMove)return!1;for(a=a.selection.iterator;a.next();)if(a.value.canMove())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canMove())},to.prototype.computeBorder=function(a,y,x){return this.Ym||this.draggedParts===null||this.draggedParts.contains(a)?null:x.assign(y)},to.prototype.Az=function(){return ts},to.prototype.mayDragIn=function(){var a=this.diagram;if(!a.allowDrop||a.isReadOnly||a.isModelReadOnly||!a.allowInsert)return!1;var y=ts;return!(y===null||y.diagram.model.dataFormat!==a.model.dataFormat)},to.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.diagram;a.animationManager.Cc(),_a(a),a.animationManager.Cc(),a=ts,a!==null&&(a.diagram.Ns=!1),this.doUpdateCursor(null)}},to.prototype.doSimulatedDragLeave=function(){var a=ts;a!==null&&a.doSimulatedDragOut(),this.doCancel()},to.prototype.doSimulatedDragOver=function(){var a=this.diagram;a.animationManager.Dm=!0;var y=ts;if(y!==null&&y.draggedParts!==null){if(!this.mayDragIn())return;Rg(this,y.draggedParts.Lf(),!1,a.firstInput),Hl(this,this.copiedParts,!1),Vf(this,a.lastInput.documentPoint)}a.animationManager.Dm=!1},to.prototype.doSimulatedDrop=function(){var a=this.diagram,y=ts;if(y!==null){var x=y.diagram;if(y.Ym=!0,pl(this),!this.mayDragIn())return;a.animationManager.Dm=!0,a.R("ChangingSelection",a.selection),this.Ea("Drop"),Rg(this,y.draggedParts.Lf(),!0,a.lastInput),Hl(this,this.copiedParts,!1);var E=new _e;this.copiedParts!==null&&(a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(b){b.isSelected=!0,E.add(b)})),Vu(this,a.lastInput.documentPoint),a.Ya(),this.copiedParts!==null&&(this.transactionResult="ExternalCopy"),this.copiedParts=null,a.doFocus(),a.R("ExternalObjectsDropped",E,x),this.stopTransaction(),a.R("ChangedSelection",a.selection)}a.animationManager.Dm=!1};function Rg(a,y,x,E){if(a.copiedParts===null){var b=a.diagram;if(!b.isReadOnly&&!b.isModelReadOnly){b.skipsUndoManager=!x,b.partManager.addsToTemporaryLayer=!x,a.startPoint=E.documentPoint,x=b.Kj(y,b,!0);var z=be.alloc();b=E=1/0;for(var tt=-1/0,it=-1/0,nt=y.iterator;nt.next();){var ot=nt.value;if(ot.isVisible()){var st=ot.location;ot=st.x,st=st.y,isNaN(ot)||isNaN(st)||(ot<E&&(E=ot),st<b&&(b=st),ot>tt&&(tt=ot),st>it&&(it=st))}}for(E===1/0?z.h(0,0,0,0):z.h(E,b,tt-E,it-b),E=z.x+z.width/2,b=z.y+z.height/2,be.free(z),z=a.Fr,tt=new ji,it=Pt.alloc(),nt=y.iterator;nt.next();)ot=nt.value,ot instanceof fi&&ot.canCopy()&&(st=x.I(ot),st!==null&&(st.points=ot.points,ch(st,z.x-E,z.y-b),st.suspendsRouting=!0,tt.add(st,a.Pd())));for(y=y.iterator;y.next();)ot=y.value,ot.Zc()&&ot.canCopy()&&(nt=x.I(ot),nt!==null&&(ot=ot.location,it.h(z.x-(E-ot.x),z.y-(b-ot.y)),nt.location=it,nt.Va(),tt.add(nt,a.Pd(it))));Pt.free(it),a.copiedParts=tt,Kf(a,tt.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,ch(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}to.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.Ns=!1,this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor,this.Bn=null},to.prototype.computeMove=function(a,y,x,E){return x=this.diagram,x!==null?x.computeMove(a,y,this.dragOptions,E):new Pt},zi.Object.defineProperties(to.prototype,{isCopyEnabled:{get:function(){return this.ob},set:function(a){this.ob=a}},copiesEffectiveCollection:{get:function(){return this.u},set:function(a){this.u=a}},dragOptions:{get:function(){return this.ia},set:function(a){this.ia=a}},isGridSnapEnabled:{get:function(){return this.dragOptions.isGridSnapEnabled},set:function(a){this.dragOptions.isGridSnapEnabled=a}},isComplexRoutingRealtime:{get:function(){return this.hb},set:function(a){this.hb=a}},isGridSnapRealtime:{get:function(){return this.dragOptions.isGridSnapRealtime},set:function(a){this.dragOptions.isGridSnapRealtime=a}},gridSnapCellSize:{get:function(){return this.dragOptions.gridSnapCellSize},set:function(a){this.dragOptions.gridSnapCellSize.D(a)||(a=a.J(),this.dragOptions.gridSnapCellSize=a)}},gridSnapCellSpot:{get:function(){return this.dragOptions.gridSnapCellSpot},set:function(a){this.dragOptions.gridSnapCellSpot.D(a)||(a=a.J(),this.dragOptions.gridSnapCellSpot=a)}},gridSnapOrigin:{get:function(){return this.dragOptions.gridSnapOrigin},set:function(a){this.dragOptions.gridSnapOrigin.D(a)||(a=a.J(),this.dragOptions.gridSnapOrigin=a)}},dragsLink:{get:function(){return this.dragOptions.dragsLink},set:function(a){this.dragOptions.dragsLink=a}},dragsTree:{get:function(){return this.dragOptions.dragsTree},set:function(a){this.dragOptions.dragsTree=a}},copyCursor:{get:function(){return this.F},set:function(a){this.F=a}},moveCursor:{get:function(){return this.Oc},set:function(a){this.Oc=a}},nodropCursor:{get:function(){return this.Pc},set:function(a){this.Pc=a}},currentPart:{get:function(){return this.V},set:function(a){this.V=a}},copiedParts:{get:function(){return this.o},set:function(a){this.o=a}},draggedParts:{get:function(){return this.Ha},set:function(a){this.Ha=a}},draggingParts:{get:function(){return this.copiedParts!==null?this.copiedParts.Lf():this.draggedParts!==null?this.draggedParts.Lf():this.te}},draggedLink:{get:function(){return this.diagram.draggedLink},set:function(a){this.diagram.draggedLink=a}},isDragOutStarted:{get:function(){return this.Hb},set:function(a){this.Hb=a}},startPoint:{get:function(){return this.Fr},set:function(a){this.Fr.D(a)||this.Fr.assign(a)}},delay:{get:function(){return this.Ik},set:function(a){this.Ik=a}}}),to.prototype.getDraggingSource=to.prototype.Az;var ts=null,Gu=null;to.className="DraggingTool",iu=new Me,Fn("draggingTool",function(){return this.findTool("Dragging")},function(a){this.gb("Dragging",a,this.mouseMoveTools)}),Ur.prototype.doCancel=function(){ts!==null&&ts.doCancel(),hr.prototype.doCancel.call(this)};function co(){hr.call(this),this.te=100,this.Ha=!1,this.u="pointer";var a=new fi,y=new Rn;y.isPanelMain=!0,y.stroke="blue",a.add(y),y=new Rn,y.toArrow="Standard",y.fill="blue",y.stroke="blue",a.add(y),a.layerName="Tool",this.Ci=a,a=new Ci,y=new Rn,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=wr,a.add(y),a.selectable=!1,a.layerName="Tool",this.Bi=a,this.j=y,a=new Ci,y=new Rn,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=wr,a.add(y),a.selectable=!1,a.layerName="Tool",this.Di=a,this.o=y,this.Pc=this.Oc=this.ob=this.hb=this.Hb=null,this.ia=!0,this.hy=new ji,this.Of=this.gj=this.Pf=null}Vi(co,hr),co.prototype.doStop=function(){this.diagram.ug(),this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null,this.validPortsCache.clear(),this.targetPort=null},co.prototype.copyPortProperties=function(a,y,x,E,b){if(a!==null&&y!==null&&x!==null&&E!==null){var z=y.Df(),tt=li.alloc();tt.width=y.naturalBounds.width*z,tt.height=y.naturalBounds.height*z,E.desiredSize=tt,li.free(tt),b?(E.toSpot=y.toSpot,E.toEndSegmentLength=y.toEndSegmentLength):(E.fromSpot=y.fromSpot,E.fromEndSegmentLength=y.fromEndSegmentLength),x.locationSpot=Hn,z=Pt.alloc(),x.location=y.ga(Hn,z),Pt.free(z),E.angle=y.li(),this.portTargeted!==null&&this.portTargeted(a,y,x,E,b)}},co.prototype.setNoTargetPortProperties=function(a,y,x){y!==null&&(y.desiredSize=wr,y.fromSpot=Jn,y.toSpot=Jn),a!==null&&(a.location=this.diagram.lastInput.documentPoint),this.portTargeted!==null&&this.portTargeted(null,null,a,y,x)},co.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()},co.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null&&this.targetPort.part instanceof Ci){var y=this.targetPort.part;this.isForwards?this.copyPortProperties(y,this.targetPort,this.temporaryToNode,this.temporaryToPort,!0):this.copyPortProperties(y,this.targetPort,this.temporaryFromNode,this.temporaryFromPort,!1)}else this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort,!0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1);(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}},co.prototype.findValidLinkablePort=function(a,y){if(a===null)return null;var x=a.part;if(!(x instanceof Ci))return null;for(;a!==null;){var E=y?a.toLinkable:a.fromLinkable;if(E===!0&&(a.portId!==null||a instanceof Ci)&&(y?this.isValidTo(x,a):this.isValidFrom(x,a)))return a;if(E===!1)break;a=a.panel}return null},co.prototype.findTargetPort=function(a){var y=this.diagram,x=y.lastInput.documentPoint,E=this.portGravity;0>=E&&(E=.1);var b=this,z=y.og(x,E,function(ut){return b.findValidLinkablePort(ut,a)},null,!0);for(E=1/0,y=null,z=z.iterator;z.next();){var tt=z.value,it=tt.part;if(it instanceof Ci){var nt=tt.ga(Hn,Pt.alloc()),ot=x.x-nt.x,st=x.y-nt.y;Pt.free(nt),nt=ot*ot+st*st,nt<E&&(ot=this.validPortsCache.I(tt),ot!==null?ot&&(y=tt,E=nt):a&&this.isValidLink(this.originalFromNode,this.originalFromPort,it,tt)||!a&&this.isValidLink(it,tt,this.originalToNode,this.originalToPort)?(this.validPortsCache.add(tt,!0),y=tt,E=nt):this.validPortsCache.add(tt,!1))}}return y!==null&&(x=y.part,x instanceof Ci&&(x.layer===null||x.layer.allowLink))?y:null},co.prototype.isValidFrom=function(a,y){if(a===null||y===null)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(a.layer!==null&&!a.layer.allowLink||y.fromLinkable!==!0))return!1;var x=y.fromMaxLinks;if(1/0>x){if(this.originalLink!==null&&a===this.originalFromNode&&y===this.originalFromPort)return!0;if(y=y.portId,y===null&&(y=""),a.Mo(y).count>=x)return!1}return!0},co.prototype.isValidTo=function(a,y){if(a===null||y===null)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(a.layer!==null&&!a.layer.allowLink||y.toLinkable!==!0))return!1;var x=y.toMaxLinks;if(1/0>x){if(this.originalLink!==null&&a===this.originalToNode&&y===this.originalToPort)return!0;if(y=y.portId,y===null&&(y=""),a.Sd(y).count>=x)return!1}return!0},co.prototype.isInSameNode=function(a,y){return a===null||y===null?!1:a===y?!0:(a=a.part,y=y.part,a!==null&&a===y)},co.prototype.isLinked=function(a,y){if(a===null||y===null)return!1;var x=a.part;if(!(x instanceof Ci))return!1;a=a.portId,a===null&&(a="");var E=y.part;if(!(E instanceof Ci))return!1;for(y=y.portId,y===null&&(y=""),y=E.Sd(y);y.next();)if(E=y.value,E.fromNode===x&&E.fromPortId===a)return!0;return!1},co.prototype.isValidLink=function(a,y,x,E){if(!this.isValidFrom(a,y)||!this.isValidTo(x,E)||!(y===null||E===null||(y.fromLinkableSelfNode&&E.toLinkableSelfNode||!this.isInSameNode(y,E))&&(y.fromLinkableDuplicates&&E.toLinkableDuplicates||!this.isLinked(y,E)))||this.originalLink!==null&&(a!==null&&this.isLabelDependentOnLink(a,this.originalLink)||x!==null&&this.isLabelDependentOnLink(x,this.originalLink))||a!==null&&x!==null&&(a.data===null&&x.data!==null||a.data!==null&&x.data===null)||!this.isValidCycle(a,x,this.originalLink))return!1;if(a!==null){var b=a.linkValidation;if(b!==null&&!b(a,y,x,E,this.originalLink))return!1}return x!==null&&(b=x.linkValidation,b!==null&&!b(a,y,x,E,this.originalLink))?!1:(b=this.linkValidation,b!==null?b(a,y,x,E,this.originalLink):!0)},co.prototype.isLabelDependentOnLink=function(a,y){if(a===null)return!1;var x=a.labeledLink;if(x===null)return!1;if(x===y)return!0;var E=new _e;return E.add(a),Ss(this,x,y,E)};function Ss(a,y,x,E){if(y===x)return!0;var b=y.fromNode;return b!==null&&b.isLinkLabel&&(E.add(b),Ss(a,b.labeledLink,x,E))?!0:(y=y.toNode,!!(y!==null&&y.isLinkLabel&&(E.add(y),Ss(a,y.labeledLink,x,E))))}co.prototype.isValidCycle=function(a,y,x){if(x===void 0&&(x=null),a===null||y===null)return this.isUnconnectedLinkValid;var E=this.diagram.validCycle;if(E!==vf){if(E===Bp){if(E=x||this.temporaryLink,E!==null&&!E.isTreeLink)return!0;for(E=y.linksConnected;E.next();){var b=E.value;if(b!==x&&b.isTreeLink&&b.toNode===y)return!1}return!Ts(this,a,y,x,!0)}if(E===Op){if(E=x||this.temporaryLink,E!==null&&!E.isTreeLink)return!0;for(E=a.linksConnected;E.next();)if(b=E.value,b!==x&&b.isTreeLink&&b.fromNode===a)return!1;return!Ts(this,a,y,x,!0)}if(E===Ap)return a===y?a=!0:(E=new _e,E.add(y),a=Ls(this,E,a,y,x)),!a;if(E===Dp)return!Ts(this,a,y,x,!1);if(E===Fp)return a===y?a=!0:(E=new _e,E.add(y),a=gc(this,E,a,y,x)),!a}return!0};function Ts(a,y,x,E,b){if(y===x)return!0;if(y===null||x===null)return!1;for(var z=y.linksConnected;z.next();){var tt=z.value;if(tt!==E&&(!b||tt.isTreeLink)&&tt.toNode===y&&(tt=tt.fromNode,tt!==y&&Ts(a,tt,x,E,b)))return!0}return!1}function Ls(a,y,x,E,b){if(x===E)return!0;if(x===null||E===null||y.contains(x))return!1;y.add(x);for(var z=x.linksConnected;z.next();){var tt=z.value;if(tt!==b&&tt.toNode===x&&(tt=tt.fromNode,tt!==x&&Ls(a,y,tt,E,b)))return!0}return!1}function gc(a,y,x,E,b){if(x===E)return!0;if(x===null||E===null||y.contains(x))return!1;y.add(x);for(var z=x.linksConnected;z.next();){var tt=z.value;if(tt!==b){var it=tt.fromNode;if(tt=tt.toNode,it=it===x?tt:it,it!==x&&gc(a,y,it,E,b))return!0}}return!1}zi.Object.defineProperties(co.prototype,{portGravity:{get:function(){return this.te},set:function(a){0<=a&&(this.te=a)}},isUnconnectedLinkValid:{get:function(){return this.Ha},set:function(a){this.Ha=a}},linkingCursor:{get:function(){return this.u},set:function(a){this.u=a}},temporaryLink:{get:function(){return this.Ci},set:function(a){this.Ci=a}},temporaryFromNode:{get:function(){return this.Bi},set:function(a){(this.Bi=a)&&(this.j=a.port)}},temporaryFromPort:{get:function(){return this.j},set:function(a){if(this.j!==null){var y=this.j.panel;if(y!==null){var x=y.O.indexOf(this.j);y.mb(x),y.Gb(x,a)}}this.j=a}},temporaryToNode:{get:function(){return this.Di},set:function(a){(this.Di=a)&&(this.o=a.port)}},temporaryToPort:{get:function(){return this.o},set:function(a){if(this.o!==null){var y=this.o.panel;if(y!==null){var x=y.O.indexOf(this.o);y.mb(x),y.Gb(x,a)}}this.o=a}},originalLink:{get:function(){return this.Hb},set:function(a){this.Hb=a}},originalFromNode:{get:function(){return this.hb},set:function(a){this.hb=a}},originalFromPort:{get:function(){return this.ob},set:function(a){this.ob=a}},originalToNode:{get:function(){return this.Oc},set:function(a){this.Oc=a}},originalToPort:{get:function(){return this.Pc},set:function(a){this.Pc=a}},isForwards:{get:function(){return this.ia},set:function(a){this.ia=a}},validPortsCache:{get:function(){return this.hy}},targetPort:{get:function(){return this.Pf},set:function(a){this.Pf=a}},linkValidation:{get:function(){return this.gj},set:function(a){this.gj=a}},portTargeted:{get:function(){return this.Of},set:function(a){this.Of=a}}}),co.className="LinkingBaseTool";function As(){co.call(this),this.name="Linking",this.V={},this.F=null,this.K=Lh,this.Xd=null}Vi(As,co),As.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowLink||!a.model.xs()||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize()?!1:this.findLinkablePort()!==null},As.prototype.findLinkablePort=function(){var a=this.diagram,y=this.startObject;if(y===null&&(y=a.ic(a.firstInput.documentPoint,null,null)),y===null||(a=y.part,!(a instanceof Ci)))return null;var x=this.direction;if(x===Lh||x===jg){var E=this.findValidLinkablePort(y,!1);if(E!==null||this.startObject===a&&(E=a.port,this.findValidLinkablePort(E,!1)))return this.isForwards=!0,E}return(x===Lh||x===zg)&&(y=this.findValidLinkablePort(y,!0),y!==null||this.startObject===a&&(y=a.port,this.findValidLinkablePort(y,!0)))?(this.isForwards=!1,y):null},As.prototype.doActivate=function(){var a=this.diagram,y=this.findLinkablePort();y===null?this.stopTool():(this.Ea(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.isForwards?(this.temporaryToNode!==null&&(this.temporaryToNode.location=a.lastInput.documentPoint),this.originalFromPort=y,y=this.originalFromPort.part,y instanceof Ci&&(this.originalFromNode=y),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1)):(this.temporaryFromNode!==null&&(this.temporaryFromNode.location=a.lastInput.documentPoint),this.originalToPort=y,y=this.originalToPort.part,y instanceof Ci&&(this.originalToNode=y),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),a.add(this.temporaryFromNode),this.temporaryFromNode&&this.temporaryFromNode.Va(),a.add(this.temporaryToNode),this.temporaryToNode&&this.temporaryToNode.Va(),this.temporaryLink!==null&&(this.temporaryFromNode!==null&&(this.temporaryLink.fromNode=this.temporaryFromNode),this.temporaryToNode!==null&&(this.temporaryLink.toNode=this.temporaryToNode),this.temporaryLink.isTreeLink=this.isNewTreeLink(),this.temporaryLink.bb(),a.add(this.temporaryLink)),this.isActive=!0)},As.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink),a.remove(this.temporaryFromNode),a.remove(this.temporaryToNode),a.isMouseCaptured=!1,a.currentCursor="",this.stopTransaction()},As.prototype.doStop=function(){co.prototype.doStop.call(this),this.startObject=null},As.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,y=this.transactionResult=null,x=null,E=null,b=null,z=null;try{var tt=this.targetPort=this.findTargetPort(this.isForwards);if(tt!==null){var it=tt.part;it instanceof Ci&&(this.isForwards?(this.originalFromNode!==null&&(y=this.originalFromNode,x=this.originalFromPort),E=it,b=tt):(y=it,x=tt,this.originalToNode!==null&&(E=this.originalToNode,b=this.originalToPort)))}else this.isForwards?this.originalFromNode!==null&&this.isUnconnectedLinkValid&&(y=this.originalFromNode,x=this.originalFromPort):this.originalToNode!==null&&this.isUnconnectedLinkValid&&(E=this.originalToNode,b=this.originalToPort);y!==null||E!==null?(z=this.insertLink(y,x,E,b),z!==null?(tt===null&&(this.isForwards?z.defaultToPoint=a.lastInput.documentPoint:z.defaultFromPoint=a.lastInput.documentPoint),a.allowSelect&&(a.R("ChangingSelection",a.selection),a.clearSelection(!0),z.isSelected=!0),this.transactionResult=this.name,a.R("LinkDrawn",z)):this.doNoLink(y,x,E,b)):this.isForwards?this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),z&&a.allowSelect&&a.R("ChangedSelection",a.selection)}}},As.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(a===null)return!0;if(a instanceof fi)return a.isTreeLink;var y=this.diagram;return y===null?!0:(a=y.partManager.getLinkCategoryForData(a),y=y.partManager.findLinkTemplateForCategory(a),y!==null?y.isTreeLink:!0)},As.prototype.insertLink=function(a,y,x,E){return this.diagram.partManager.insertLink(a,y,x,E)},As.prototype.doNoLink=function(){},zi.Object.defineProperties(As.prototype,{archetypeLinkData:{get:function(){return this.V},set:function(a){this.V=a}},archetypeLabelNodeData:{get:function(){return this.F},set:function(a){this.F=a}},direction:{get:function(){return this.K},set:function(a){this.K=a}},startObject:{get:function(){return this.Xd},set:function(a){this.Xd=a}}});var Lh=new ze(As,"Either",0),jg=new ze(As,"ForwardsOnly",0),zg=new ze(As,"BackwardsOnly",0);As.className="LinkingTool",As.Either=Lh,As.ForwardsOnly=jg,As.BackwardsOnly=zg;function ba(){co.call(this),this.name="Relinking";var a=new Rn;a.figure="Diamond",a.desiredSize=Lr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=0,this.V=a,a=new Rn,a.figure="Diamond",a.desiredSize=Lr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=-1,this.Xd=a,this.F=null,this.Ew=new be}Vi(ba,co),ba.prototype.updateAdornments=function(a){if(a!==null&&a instanceof fi){var y="RelinkFrom",x=null;if(a.isSelected&&!this.diagram.isReadOnly){var E=a.selectionObject;E!==null&&a.canRelinkFrom()&&a.actualBounds.w()&&a.isVisible()&&E.actualBounds.w()&&E.Ed()&&(x=a.Pj(y),x===null&&(x=this.makeAdornment(E,!1),a.bh(y,x)))}x===null&&a.Jf(y),y="RelinkTo",x=null,a.isSelected&&!this.diagram.isReadOnly&&(E=a.selectionObject,E!==null&&a.canRelinkTo()&&a.actualBounds.w()&&a.isVisible()&&E.actualBounds.w()&&E.Ed()&&(x=a.Pj(y),x===null?(x=this.makeAdornment(E,!0),a.bh(y,x)):x.v())),x===null&&a.Jf(y)}},ba.prototype.makeAdornment=function(a,y){var x=new cr;return x.type=si.Link,y=y?this.toHandleArchetype:this.fromHandleArchetype,y!==null&&x.add(y.copy()),x.adornedObject=a,x},ba.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowRelink||!a.model.xs()||!a.lastInput.left)return!1;var y=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom");return y===null&&(y=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo")),y!==null},ba.prototype.doActivate=function(){var a=this.diagram;if(this.originalLink===null){var y=this.handle;if(y===null&&(y=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom"),y===null&&(y=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo"))),y===null)return;var x=y.part;if(!(x instanceof cr&&x.adornedPart instanceof fi))return;this.handle=y,this.isForwards=x===null||x.category==="RelinkTo",this.originalLink=x.adornedPart}this.Ea(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.originalFromPort=this.originalLink.fromPort,this.originalFromNode=this.originalLink.fromNode,this.originalToPort=this.originalLink.toPort,this.originalToNode=this.originalLink.toNode,this.Ew.set(this.originalLink.actualBounds),this.originalLink!==null&&0<this.originalLink.pointsCount&&(this.originalLink.fromNode===null&&(this.temporaryFromPort!==null&&(this.temporaryFromPort.desiredSize=Pn),this.temporaryFromNode!==null&&(this.temporaryFromNode.location=this.originalLink.i(0))),this.originalLink.toNode===null&&(this.temporaryToPort!==null&&(this.temporaryToPort.desiredSize=Pn),this.temporaryToNode!==null&&(this.temporaryToNode.location=this.originalLink.i(this.originalLink.pointsCount-1)))),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0),a.add(this.temporaryFromNode),a.add(this.temporaryToNode),this.temporaryLink!==null&&(this.temporaryFromNode!==null&&(this.temporaryLink.fromNode=this.temporaryFromNode),this.temporaryToNode!==null&&(this.temporaryLink.toNode=this.temporaryToNode),this.copyLinkProperties(this.originalLink,this.temporaryLink),this.temporaryLink.bb(),a.add(this.temporaryLink)),this.isActive=!0},ba.prototype.copyLinkProperties=function(a,y){if(a!==null&&y!==null){y.adjusting=a.adjusting,y.corner=a.corner;var x=a.curve;(x===Ld||x===fh)&&(x=js),y.curve=x,y.curviness=a.curviness,y.isTreeLink=a.isTreeLink,y.points=a.points,y.routing=a.routing,y.smoothness=a.smoothness,y.fromSpot=a.fromSpot,y.fromEndSegmentLength=a.fromEndSegmentLength,y.fromShortLength=a.fromShortLength,y.toSpot=a.toSpot,y.toEndSegmentLength=a.toEndSegmentLength,y.toShortLength=a.toShortLength}},ba.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink),a.remove(this.temporaryFromNode),a.remove(this.temporaryToNode),a.isMouseCaptured=!1,a.currentCursor="",this.stopTransaction()},ba.prototype.doStop=function(){co.prototype.doStop.call(this),this.handle=null},ba.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram;this.transactionResult=null;var y=this.originalFromNode,x=this.originalFromPort,E=this.originalToNode,b=this.originalToPort,z=this.originalLink;try{if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null){var tt=this.targetPort.part;tt instanceof Ci&&(this.isForwards?(E=tt,b=this.targetPort):(y=tt,x=this.targetPort))}else this.isUnconnectedLinkValid?this.isForwards?b=E=null:x=y=null:z=null;z!==null?(this.reconnectLink(z,this.isForwards?E:y,this.isForwards?b:x,this.isForwards),this.targetPort===null&&(this.isForwards?z.defaultToPoint=a.lastInput.documentPoint:z.defaultFromPoint=a.lastInput.documentPoint,z.bb()),this.transactionResult=this.name,a.R("LinkRelinked",z,this.isForwards?this.originalToPort:this.originalFromPort)):this.doNoRelink(this.originalLink,this.isForwards),this.originalLink.Xo(this.Ew)}finally{this.stopTool()}}},ba.prototype.reconnectLink=function(a,y,x,E){return x=x!==null&&x.portId!==null?x.portId:"",E?(a.toNode=y,a.toPortId=x):(a.fromNode=y,a.fromPortId=x),!0},ba.prototype.doNoRelink=function(){};function Gf(a,y,x,E,b){y!==null?(a.copyPortProperties(y,x,a.temporaryFromNode,a.temporaryFromPort,!1),a.diagram.add(a.temporaryFromNode)):a.diagram.remove(a.temporaryFromNode),E!==null?(a.copyPortProperties(E,b,a.temporaryToNode,a.temporaryToPort,!0),a.diagram.add(a.temporaryToNode)):a.diagram.remove(a.temporaryToNode)}zi.Object.defineProperties(ba.prototype,{fromHandleArchetype:{get:function(){return this.V},set:function(a){this.V=a}},toHandleArchetype:{get:function(){return this.Xd},set:function(a){this.Xd=a}},handle:{get:function(){return this.F},set:function(a){if(a!==null&&!(a.part instanceof cr))throw Error("new handle is not in an Adornment: "+a);this.F=a}}}),ba.className="RelinkingTool",Fn("linkingTool",function(){return this.findTool("Linking")},function(a){this.gb("Linking",a,this.mouseMoveTools)}),Fn("relinkingTool",function(){return this.findTool("Relinking")},function(a){this.gb("Relinking",a,this.mouseDownTools)});function wo(){hr.call(this),this.name="LinkReshaping";var a=new Rn;a.figure="Rectangle",a.desiredSize=Tr,a.fill="lightblue",a.stroke="dodgerblue",this.o=a,a=new Rn,a.figure="Diamond",a.desiredSize=Lr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor="move",this.u=a,this.F=3,this.Ts=this.j=null,this.Fw=new Pt,this.Yq=new Me}Vi(wo,hr),wo.prototype.Ru=function(a){return a&&a.reshapingBehavior.value!==0?a.reshapingBehavior:rp},wo.prototype.om=function(a,y){a.reshapingBehavior=y},wo.prototype.updateAdornments=function(a){if(a!==null&&a instanceof fi){var y=null;if(a.isSelected&&!this.diagram.isReadOnly){var x=a.path;x!==null&&a.canReshape()&&a.actualBounds.w()&&a.isVisible()&&x.actualBounds.w()&&x.Ed()&&(y=a.Pj(this.name),y===null||y.Aw!==a.pointsCount||y.Uw!==a.resegmentable)&&(y=this.makeAdornment(x),y!==null&&(y.Aw=a.pointsCount,y.Uw=a.resegmentable,a.bh(this.name,y)))}y===null&&a.Jf(this.name)}},wo.prototype.makeAdornment=function(a){var y=a.part,x=y.pointsCount,E=y.isOrthogonal,b=null;if(y.points!==null&&1<x){b=new cr,b.type=si.Link,x=y.firstPickIndex;var z=y.lastPickIndex,tt=E?1:0;if(y.resegmentable&&y.computeCurve()!==Aa)for(var it=x+tt;it<z-tt;it++){var nt=this.makeResegmentHandle(a,it);nt!==null&&(nt.segmentIndex=it,nt.segmentFraction=.5,nt.fromMaxLinks=999,b.add(nt))}for(tt=x+1;tt<z;tt++)if(it=this.makeHandle(a,tt),it!==null){if(it.segmentIndex=tt,tt!==x)if(tt===x+1&&E){nt=y.i(x);var ot=y.i(x+1);Gt.B(nt.x,ot.x)&&Gt.B(nt.y,ot.y)&&(ot=y.i(x-1)),Gt.B(nt.x,ot.x)?(this.om(it,Xu),it.cursor="n-resize"):Gt.B(nt.y,ot.y)&&(this.om(it,Yu),it.cursor="w-resize")}else tt===z-1&&E?(nt=y.i(z-1),ot=y.i(z),Gt.B(nt.x,ot.x)&&Gt.B(nt.y,ot.y)&&(nt=y.i(z+1)),Gt.B(nt.x,ot.x)?(this.om(it,Xu),it.cursor="n-resize"):Gt.B(nt.y,ot.y)&&(this.om(it,Yu),it.cursor="w-resize")):tt!==z&&(this.om(it,Uf),it.cursor="move");b.add(it)}b.adornedObject=a}return b},wo.prototype.makeHandle=function(){var a=this.handleArchetype;return a===null?null:a.copy()},wo.prototype.makeResegmentHandle=function(){var a=this.midHandleArchetype;return a===null?null:a.copy()},wo.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowReshape&&a.lastInput.left?this.findToolHandleAt(a.firstInput.documentPoint,this.name)!==null:!1},wo.prototype.doActivate=function(){var a=this.diagram;if(this.handle===null&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name)),this.handle!==null){var y=this.handle.part.adornedPart;if(y instanceof fi){if(this.Ts=y,a.isMouseCaptured=!0,this.Ea(this.name),y.resegmentable&&this.handle.fromMaxLinks===999){var x=y.points.copy(),E=this.getResegmentingPoint();if(x.Gb(this.handle.segmentIndex+1,E),y.isOrthogonal&&x.Gb(this.handle.segmentIndex+1,E),y.points=x,y.Wb(),y.updateAdornments(),this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name),this.handle===null){this.doDeactivate();return}}this.Fw=y.i(this.handle.segmentIndex),this.Yq=y.points.copy(),this.isActive=!0}}},wo.prototype.doDeactivate=function(){this.stopTransaction(),this.Ts=this.handle=null,this.isActive=this.diagram.isMouseCaptured=!1},wo.prototype.stopTransaction=function(){var a=this.diagram,y=hr.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},wo.prototype.doCancel=function(){var a=this.adornedLink;a!==null&&(a.points=this.Yq),this.stopTool()},wo.prototype.getResegmentingPoint=function(){return this.handle.ga(Hn)},wo.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeReshape(a.lastInput.documentPoint),this.reshape(a))},wo.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var y=this.computeReshape(a.lastInput.documentPoint);if(this.reshape(y),y=this.adornedLink,y!==null&&y.resegmentable){var x=this.handle.segmentIndex,E=y.i(x-1),b=y.i(x),z=y.i(x+1);if(y.isOrthogonal){if(x>y.firstPickIndex+1&&x<y.lastPickIndex-1){var tt=y.i(x-2);if(Math.abs(E.x-b.x)<this.resegmentingDistance&&Math.abs(E.y-b.y)<this.resegmentingDistance&&(Uu(this,tt,E,b,z,!0)||Uu(this,tt,E,b,z,!1))){var it=y.points.copy();Uu(this,tt,E,b,z,!0)?(it.cd(x-2,new Pt(tt.x,(z.y+tt.y)/2)),it.cd(x+1,new Pt(z.x,(z.y+tt.y)/2))):(it.cd(x-2,new Pt((z.x+tt.x)/2,tt.y)),it.cd(x+1,new Pt((z.x+tt.x)/2,z.y))),it.mb(x),it.mb(x-1),y.points=it,y.Wb()}else tt=y.i(x+2),Math.abs(b.x-z.x)<this.resegmentingDistance&&Math.abs(b.y-z.y)<this.resegmentingDistance&&(Uu(this,E,b,z,tt,!0)||Uu(this,E,b,z,tt,!1))&&(it=y.points.copy(),Uu(this,E,b,z,tt,!0)?(it.cd(x-1,new Pt(E.x,(E.y+tt.y)/2)),it.cd(x+2,new Pt(tt.x,(E.y+tt.y)/2))):(it.cd(x-1,new Pt((E.x+tt.x)/2,E.y)),it.cd(x+2,new Pt((E.x+tt.x)/2,tt.y))),it.mb(x+1),it.mb(x),y.points=it,y.Wb())}}else tt=Pt.alloc(),Gt.qh(E.x,E.y,z.x,z.y,b.x,b.y,tt)&&tt.Bf(b)<this.resegmentingDistance*this.resegmentingDistance&&(E=y.points.copy(),E.mb(x),y.points=E,y.Wb()),Pt.free(tt)}a.Ya(),this.transactionResult=this.name,a.R("LinkReshaped",this.adornedLink,this.Yq)}this.stopTool()};function Uu(a,y,x,E,b,z){return z?Math.abs(y.y-x.y)<a.resegmentingDistance&&Math.abs(x.y-E.y)<a.resegmentingDistance&&Math.abs(E.y-b.y)<a.resegmentingDistance:Math.abs(y.x-x.x)<a.resegmentingDistance&&Math.abs(x.x-E.x)<a.resegmentingDistance&&Math.abs(E.x-b.x)<a.resegmentingDistance}wo.prototype.reshape=function(a){var y=this.adornedLink;y.uh();var x=this.handle.segmentIndex,E=this.Ru(this.handle);if(y.isOrthogonal)if(x===y.firstPickIndex+1)x=y.firstPickIndex+1,E===Xu?(y.L(x,y.i(x-1).x,a.y),y.L(x+1,y.i(x+2).x,a.y)):E===Yu&&(y.L(x,a.x,y.i(x-1).y),y.L(x+1,a.x,y.i(x+2).y));else if(x===y.lastPickIndex-1)x=y.lastPickIndex-1,E===Xu?(y.L(x-1,y.i(x-2).x,a.y),y.L(x,y.i(x+1).x,a.y)):E===Yu&&(y.L(x-1,a.x,y.i(x-2).y),y.L(x,a.x,y.i(x+1).y));else{E=x;var b=y.i(E),z=y.i(E-1),tt=y.i(E+1);Gt.B(z.x,b.x)&&Gt.B(b.y,tt.y)?(Gt.B(z.x,y.i(E-2).x)&&!Gt.B(z.y,y.i(E-2).y)?(y.m(E,a.x,z.y),x++,E++):y.L(E-1,a.x,z.y),Gt.B(tt.y,y.i(E+2).y)&&!Gt.B(tt.x,y.i(E+2).x)?y.m(E+1,tt.x,a.y):y.L(E+1,tt.x,a.y)):Gt.B(z.y,b.y)&&Gt.B(b.x,tt.x)?(Gt.B(z.y,y.i(E-2).y)&&!Gt.B(z.x,y.i(E-2).x)?(y.m(E,z.x,a.y),x++,E++):y.L(E-1,z.x,a.y),Gt.B(tt.x,y.i(E+2).x)&&!Gt.B(tt.y,y.i(E+2).y)?y.m(E+1,a.x,tt.y):y.L(E+1,a.x,tt.y)):Gt.B(z.x,b.x)&&Gt.B(b.x,tt.x)?(Gt.B(z.x,y.i(E-2).x)&&!Gt.B(z.y,y.i(E-2).y)?(y.m(E,a.x,z.y),x++,E++):y.L(E-1,a.x,z.y),Gt.B(tt.x,y.i(E+2).x)&&!Gt.B(tt.y,y.i(E+2).y)?y.m(E+1,a.x,tt.y):y.L(E+1,a.x,tt.y)):Gt.B(z.y,b.y)&&Gt.B(b.y,tt.y)&&(Gt.B(z.y,y.i(E-2).y)&&!Gt.B(z.x,y.i(E-2).x)?(y.m(E,z.x,a.y),x++,E++):y.L(E-1,z.x,a.y),Gt.B(tt.y,y.i(E+2).y)&&!Gt.B(tt.x,y.i(E+2).x)?y.m(E+1,tt.x,a.y):y.L(E+1,tt.x,a.y)),y.L(x,a.x,a.y)}else y.L(x,a.x,a.y),E=y.fromNode,b=y.fromPort,E!==null&&(z=E.findVisibleNode(),z!==null&&z!==E&&(E=z,b=E.port)),x===1&&y.computeSpot(!0,b).Mc()&&(z=b.ga(Hn,Pt.alloc()),E=y.getLinkPointFromPoint(E,b,z,a,!0,Pt.alloc()),y.L(0,E.x,E.y),Pt.free(z),Pt.free(E)),E=y.toNode,b=y.toPort,E!==null&&(z=E.findVisibleNode(),z!==null&&z!==E&&(E=z,b=E.port)),x===y.pointsCount-2&&y.computeSpot(!1,b).Mc()&&(x=b.ga(Hn,Pt.alloc()),a=y.getLinkPointFromPoint(E,b,x,a,!1,Pt.alloc()),y.L(y.pointsCount-1,a.x,a.y),Pt.free(x),Pt.free(a));y.zf()},wo.prototype.computeReshape=function(a){var y=this.adornedLink,x=this.handle.segmentIndex;switch(this.Ru(this.handle)){case Uf:return a;case Xu:return new Pt(y.i(x).x,a.y);case Yu:return new Pt(a.x,y.i(x).y);default:case rp:return y.i(x)}},zi.Object.defineProperties(wo.prototype,{handleArchetype:{get:function(){return this.o},set:function(a){this.o=a}},midHandleArchetype:{get:function(){return this.u},set:function(a){this.u=a}},handle:{get:function(){return this.j},set:function(a){if(a!==null&&!(a.part instanceof cr))throw Error("new handle is not in an Adornment: "+a);this.j=a}},adornedLink:{get:function(){return this.Ts}},resegmentingDistance:{get:function(){return this.F},set:function(a){this.F=a}},originalPoint:{get:function(){return this.Fw}},originalPoints:{get:function(){return this.Yq}}}),wo.prototype.setReshapingBehavior=wo.prototype.om,wo.prototype.getReshapingBehavior=wo.prototype.Ru;var rp=new ze(wo,"None",0),Yu=new ze(wo,"Horizontal",1),Xu=new ze(wo,"Vertical",2),Uf=new ze(wo,"All",3);wo.className="LinkReshapingTool",wo.None=rp,wo.Horizontal=Yu,wo.Vertical=Xu,wo.All=Uf,Fn("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(a){this.gb("LinkReshaping",a,this.mouseDownTools)});function ds(){hr.call(this),this.name="Resizing",this.o=new li(1,1).freeze(),this.j=new li(9999,9999).freeze(),this.yg=new li(NaN,NaN).freeze(),this.V=!1,this.ia=!0,this.ue=null;var a=new Rn;a.alignmentFocus=Hn,a.figure="Rectangle",a.desiredSize=Tr,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.F=a,this.u=null,this.Xq=new Pt,this.Dw=new li,this.Tn=new Pt,this.rt=new li(0,0),this.qt=new li(1/0,1/0),this.pt=new li(1,1)}Vi(ds,hr),ds.prototype.updateAdornments=function(a){if(!(a===null||a instanceof fi)){if(a.isSelected&&!this.diagram.isReadOnly){var y=a.resizeObject,x=a.Pj(this.name);if(y!==null&&a.canResize()&&a.actualBounds.w()&&a.isVisible()&&y.actualBounds.w()&&y.Ed()&&((x===null||x.adornedObject!==y)&&(x=this.makeAdornment(y)),x!==null)){y=y.li(),Uh(a)&&this.updateResizeHandles(x,y),a.bh(this.name,x);return}}a.Jf(this.name)}},ds.prototype.makeAdornment=function(a){var y=a.part.resizeAdornmentTemplate;if(y===null){y=new cr,y.type=si.Spot,y.locationSpot=Hn;var x=new Rs;x.isPanelMain=!0,y.add(x),y.add(this.makeHandle(a,qn)),y.add(this.makeHandle(a,Nr)),y.add(this.makeHandle(a,vo)),y.add(this.makeHandle(a,os)),y.add(this.makeHandle(a,ro)),y.add(this.makeHandle(a,jo)),y.add(this.makeHandle(a,Uo)),y.add(this.makeHandle(a,Ro))}else if(rl(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},ds.prototype.makeHandle=function(a,y){return a=this.handleArchetype,a===null?null:(a=a.copy(),a.alignment=y,a)},ds.prototype.updateResizeHandles=function(a,y){if(a!==null){if(!a.alignment.Xb()&&(a.cursor==="pointer"||0<a.cursor.indexOf("resize")))t:{var x=a.alignment;if(x.Mc()&&(x=Hn),0>=x.x)y=0>=x.y?y+225:1<=x.y?y+135:y+180;else if(1<=x.x)0>=x.y?y+=315:1<=x.y&&(y+=45);else if(0>=x.y)y+=270;else if(1<=x.y)y+=90;else break t;0>y?y+=360:360<=y&&(y-=360),a.cursor=22.5>y?"e-resize":67.5>y?"se-resize":112.5>y?"s-resize":157.5>y?"sw-resize":202.5>y?"w-resize":247.5>y?"nw-resize":292.5>y?"n-resize":337.5>y?"ne-resize":"e-resize"}else if(a instanceof si)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,y)}},ds.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowResize&&a.lastInput.left?this.findToolHandleAt(a.firstInput.documentPoint,this.name)!==null:!1},ds.prototype.doActivate=function(){var a=this.diagram;this.handle===null&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name)),this.handle!==null&&(this.adornedObject=this.handle.part.adornedObject,this.adornedObject!==null&&(a.isMouseCaptured=!0,a.animationManager.Cc(),this.Ea(this.name),this.Xq.set(this.adornedObject.ga(this.handle.alignment.gv())),this.Tn.set(this.adornedObject.part.location),this.Dw.set(this.adornedObject.desiredSize),this.pt=this.computeCellSize(),this.rt=this.computeMinSize(),this.qt=this.computeMaxSize(),this.isActive=!0))},ds.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.isActive=a.isMouseCaptured=!1},ds.prototype.stopTransaction=function(){var a=this.diagram,y=hr.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},ds.prototype.doCancel=function(){this.adornedObject!==null&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()},ds.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var y=this.rt,x=this.qt,E=this.pt,b=this.adornedObject.qs(a.lastInput.documentPoint,Pt.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),a.bd(),Pt.free(b)}},ds.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var y=this.rt,x=this.qt,E=this.pt,b=this.adornedObject.qs(a.lastInput.documentPoint,Pt.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),Pt.free(b),a.Ya(),this.transactionResult=this.name,a.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()},ds.prototype.resize=function(a){var y=this.diagram,x=this.adornedObject;if(x!==null){if(x.desiredSize=a.size,a=x.part,a.Va(),x=x.ga(this.handle.alignment.gv()),a instanceof An){var E=new Me;if(E.add(a),!this.dragsMembers&&a.placeholder===null){var b=new rt;b.dragsMembers=!1}y.moveParts(E,this.oppositePoint.copy().re(x),!0,b)}else a.location=a.location.copy().re(x).add(this.oppositePoint);y.bd()}},ds.prototype.computeResize=function(a,y,x,E,b,z){y.Mc()&&(y=Hn);var tt=this.adornedObject.naturalBounds,it=tt.x,nt=tt.y,ot=tt.x+tt.width,st=tt.y+tt.height,ut=1;if(!z){ut=tt.width;var ct=tt.height;0>=ut&&(ut=1),0>=ct&&(ct=1),ut=ct/ut}return ct=Pt.alloc(),Gt.No(a.x,a.y,it,nt,b.width,b.height,ct),a=tt.copy(),0>=y.x?0>=y.y?(a.x=Math.max(ct.x,ot-E.width),a.x=Math.min(a.x,ot-x.width),a.width=Math.max(ot-a.x,x.width),a.y=Math.max(ct.y,st-E.height),a.y=Math.min(a.y,st-x.height),a.height=Math.max(st-a.y,x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ut*a.width,E.height),x.height),a.width=a.height/ut):(a.width=Math.max(Math.min(a.height/ut,E.width),x.width),a.height=ut*a.width),a.x=ot-a.width,a.y=st-a.height)):1<=y.y?(a.x=Math.max(ct.x,ot-E.width),a.x=Math.min(a.x,ot-x.width),a.width=Math.max(ot-a.x,x.width),a.height=Math.max(Math.min(ct.y-nt,E.height),x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ut*a.width,E.height),x.height),a.width=a.height/ut):(a.width=Math.max(Math.min(a.height/ut,E.width),x.width),a.height=ut*a.width),a.x=ot-a.width)):(a.x=Math.max(ct.x,ot-E.width),a.x=Math.min(a.x,ot-x.width),a.width=ot-a.x,z||(a.height=Math.max(Math.min(ut*a.width,E.height),x.height),a.width=a.height/ut,a.y=nt+.5*(st-nt-a.height))):1<=y.x?0>=y.y?(a.width=Math.max(Math.min(ct.x-it,E.width),x.width),a.y=Math.max(ct.y,st-E.height),a.y=Math.min(a.y,st-x.height),a.height=Math.max(st-a.y,x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ut*a.width,E.height),x.height),a.width=a.height/ut):(a.width=Math.max(Math.min(a.height/ut,E.width),x.width),a.height=ut*a.width),a.y=st-a.height)):1<=y.y?(a.width=Math.max(Math.min(ct.x-it,E.width),x.width),a.height=Math.max(Math.min(ct.y-nt,E.height),x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ut*a.width,E.height),x.height),a.width=a.height/ut):(a.width=Math.max(Math.min(a.height/ut,E.width),x.width),a.height=ut*a.width))):(a.width=Math.max(Math.min(ct.x-it,E.width),x.width),z||(a.height=Math.max(Math.min(ut*a.width,E.height),x.height),a.width=a.height/ut,a.y=nt+.5*(st-nt-a.height))):0>=y.y?(a.y=Math.max(ct.y,st-E.height),a.y=Math.min(a.y,st-x.height),a.height=st-a.y,z||(a.width=Math.max(Math.min(a.height/ut,E.width),x.width),a.height=ut*a.width,a.x=it+.5*(ot-it-a.width))):1<=y.y&&(a.height=Math.max(Math.min(ct.y-nt,E.height),x.height),z||(a.width=Math.max(Math.min(a.height/ut,E.width),x.width),a.height=ut*a.width,a.x=it+.5*(ot-it-a.width))),Pt.free(ct),a},ds.prototype.computeReshape=function(){var a=Qe;return this.adornedObject instanceof Rn&&(a=E0(this.adornedObject)),!(a===Yi||this.diagram.lastInput.shift)},ds.prototype.computeMinSize=function(){var a=this.adornedObject.minSize.copy(),y=this.minSize;return!isNaN(y.width)&&y.width>a.width&&(a.width=y.width),!isNaN(y.height)&&y.height>a.height&&(a.height=y.height),a},ds.prototype.computeMaxSize=function(){var a=this.adornedObject.maxSize.copy(),y=this.maxSize;return!isNaN(y.width)&&y.width<a.width&&(a.width=y.width),!isNaN(y.height)&&y.height<a.height&&(a.height=y.height),a},ds.prototype.computeCellSize=function(){var a=new li(NaN,NaN),y=this.adornedObject.part;return y!==null&&(y=y.resizeCellSize,!isNaN(y.width)&&0<y.width&&(a.width=y.width),!isNaN(y.height)&&0<y.height&&(a.height=y.height)),y=this.cellSize,isNaN(a.width)&&!isNaN(y.width)&&0<y.width&&(a.width=y.width),isNaN(a.height)&&!isNaN(y.height)&&0<y.height&&(a.height=y.height),y=this.diagram,(isNaN(a.width)||isNaN(a.height))&&y&&(y=y.grid,y!==null&&y.visible&&this.isGridSnapEnabled&&(y=y.gridCellSize,isNaN(a.width)&&!isNaN(y.width)&&0<y.width&&(a.width=y.width),isNaN(a.height)&&!isNaN(y.height)&&0<y.height&&(a.height=y.height))),(isNaN(a.width)||a.width===0||a.width===1/0)&&(a.width=1),(isNaN(a.height)||a.height===0||a.height===1/0)&&(a.height=1),a},zi.Object.defineProperties(ds.prototype,{handleArchetype:{get:function(){return this.F},set:function(a){this.F=a}},handle:{get:function(){return this.u},set:function(a){if(a!==null&&!(a.part instanceof cr))throw Error("new handle is not in an Adornment: "+a);this.u=a}},adornedObject:{get:function(){return this.ue},set:function(a){if(a!==null&&a.part instanceof cr)throw Error("new handle must not be in an Adornment: "+a);this.ue=a}},minSize:{get:function(){return this.o},set:function(a){if(!this.o.D(a)){var y=a.width;isNaN(y)&&(y=0),a=a.height,isNaN(a)&&(a=0),this.o.h(y,a)}}},maxSize:{get:function(){return this.j},set:function(a){if(!this.j.D(a)){var y=a.width;isNaN(y)&&(y=1/0),a=a.height,isNaN(a)&&(a=1/0),this.j.h(y,a)}}},cellSize:{get:function(){return this.yg},set:function(a){this.yg.D(a)||this.yg.assign(a)}},isGridSnapEnabled:{get:function(){return this.V},set:function(a){this.V=a}},dragsMembers:{get:function(){return this.ia},set:function(a){this.ia=a}},oppositePoint:{get:function(){return this.Xq},set:function(a){this.Xq.D(a)||this.Xq.assign(a)}},originalDesiredSize:{get:function(){return this.Dw}},originalLocation:{get:function(){return this.Tn}}}),ds.className="ResizingTool",Fn("resizingTool",function(){return this.findTool("Resizing")},function(a){this.gb("Resizing",a,this.mouseDownTools)});function Ds(){hr.call(this),this.name="Rotating",this.ia=45,this.V=2,this.Tn=new Pt,this.ue=null;var a=new Rn;a.figure="Ellipse",a.desiredSize=Lr,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.o=a,this.j=null,this.Cw=0,this.kr=new Pt(NaN,NaN),this.u=0,this.F=50}Vi(Ds,hr),Ds.prototype.updateAdornments=function(a){if(a!==null){if(a.ph()){var y=a.rotateObject;if(y===a||y===a.path||y.isPanelMain)return}if(a.isSelected&&!this.diagram.isReadOnly&&(y=a.rotateObject,y!==null&&a.canRotate()&&a.actualBounds.w()&&a.isVisible()&&y.actualBounds.w()&&y.Ed())){var x=a.Pj(this.name);if((x===null||x.adornedObject!==y)&&(x=this.makeAdornment(y)),x!==null){x.angle=y.li(),x.placeholder===null&&(x.location=this.computeAdornmentLocation(y)),a.bh(this.name,x);return}}a.Jf(this.name)}},Ds.prototype.makeAdornment=function(a){var y=a.part.rotateAdornmentTemplate;if(y===null){y=new cr,y.type=si.Position,y.locationSpot=Hn;var x=this.handleArchetype;x!==null&&y.add(x.copy())}else if(rl(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},Ds.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowRotate&&a.lastInput.left?this.findToolHandleAt(a.firstInput.documentPoint,this.name)!==null:!1},Ds.prototype.doActivate=function(){var a=this.diagram;if(this.adornedObject===null){if(this.handle===null&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name)),this.handle===null)return;this.adornedObject=this.handle.part.adornedObject}this.adornedObject!==null&&(a.isMouseCaptured=!0,a.delaysLayout=!0,this.Ea(this.name),this.Cw=this.adornedObject.angle,this.kr=this.computeRotationPoint(this.adornedObject),this.Tn=this.adornedObject.part.location.copy(),this.isActive=!0)},Ds.prototype.computeRotationPoint=function(a){var y=a.part,x=y.locationObject;return y.rotationSpot.sb()?a.ga(y.rotationSpot):a===y||a===x?x.ga(y.locationSpot):a.ga(Hn)},Ds.prototype.computeAdornmentLocation=function(a){var y=this.rotationPoint;y.w()||(y=this.computeRotationPoint(a)),y=a.qs(y);var x=this.handleAngle;0>x?x+=360:360<=x&&(x-=360),x=Math.round(45*Math.round(x/45));var E=this.handleDistance;return x===0?y.x=a.naturalBounds.width+E:x===45?(y.x=a.naturalBounds.width+E,y.y=a.naturalBounds.height+E):x===90?y.y=a.naturalBounds.height+E:x===135?(y.x=-E,y.y=a.naturalBounds.height+E):x===180?y.x=-E:x===225?(y.x=-E,y.y=-E):x===270?y.y=-E:x===315&&(y.x=a.naturalBounds.width+E,y.y=-E),a.ga(y)},Ds.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.kr=new Pt(NaN,NaN),this.isActive=a.isMouseCaptured=!1},Ds.prototype.stopTransaction=function(){var a=this.diagram,y=hr.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Ds.prototype.doCancel=function(){this.diagram.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()},Ds.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))},Ds.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){a.delaysLayout=!1;var y=this.computeRotate(a.lastInput.documentPoint);this.rotate(y),a.Ya(),this.transactionResult=this.name,a.R("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()},Ds.prototype.rotate=function(a){var y=this.adornedObject;if(y!==null){y.angle=a,y=y.part,y.Va();var x=y.locationObject,E=y.rotateObject;(x===E||x.rg(E))&&(x=this.Tn.copy(),y.location=x.re(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint)),this.diagram.bd()}},Ds.prototype.computeRotate=function(a){a=this.rotationPoint.ab(a)-this.handleAngle;var y=this.adornedObject.panel;y!==null&&(a-=y.li()),360<=a?a-=360:0>a&&(a+=360),y=Math.min(Math.abs(this.snapAngleMultiple),180);var x=Math.min(Math.abs(this.snapAngleEpsilon),y/2);return!this.diagram.lastInput.shift&&0<y&&0<x&&(a%y<x?a=Math.floor(a/y)*y:a%y>y-x&&(a=(Math.floor(a/y)+1)*y)),360<=a?a-=360:0>a&&(a+=360),a},zi.Object.defineProperties(Ds.prototype,{handleArchetype:{get:function(){return this.o},set:function(a){this.o=a}},handle:{get:function(){return this.j},set:function(a){if(a!==null&&!(a.part instanceof cr))throw Error("new handle is not in an Adornment: "+a);this.j=a}},adornedObject:{get:function(){return this.ue},set:function(a){if(a!==null&&a.part instanceof cr)throw Error("new handle must not be in an Adornment: "+a);this.ue=a}},snapAngleMultiple:{get:function(){return this.ia},set:function(a){this.ia=a}},snapAngleEpsilon:{get:function(){return this.V},set:function(a){this.V=a}},originalAngle:{get:function(){return this.Cw}},rotationPoint:{get:function(){return this.kr},set:function(a){this.kr=a.copy()}},handleAngle:{get:function(){return this.u},set:function(a){this.u=a}},handleDistance:{get:function(){return this.F},set:function(a){this.F=a}}}),Ds.className="RotatingTool",Fn("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.gb("Rotating",a,this.mouseDownTools)});function Ah(){hr.call(this),this.name="ClickSelecting"}Vi(Ah,hr),Ah.prototype.canStart=function(){return!(!this.isEnabled||this.isBeyondDragSize())},Ah.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()},Ah.className="ClickSelectingTool";function qa(){hr.call(this),this.name="Action",this.pk=null}Vi(qa,hr),qa.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram,y=a.lastInput,x=a.ic(y.documentPoint,function(E){for(;E.panel!==null&&!E.isActionable;)E=E.panel;return E});return x!==null&&x.isActionable?(this.pk=x,a.Ck=a.ic(y.documentPoint,null,null),!0):!1},qa.prototype.doMouseDown=function(){if(this.isActive){var a=this.diagram.lastInput,y=this.pk;y!==null&&(a.targetObject=y,y.actionDown!==null&&y.actionDown(a,y))}else this.canStart()&&this.doActivate()},qa.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram.lastInput,y=this.pk;y!==null&&(a.targetObject=y,y.actionMove!==null&&y.actionMove(a,y))}},qa.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram.lastInput,y=this.pk;if(y===null)return;a.targetObject=y,y.actionUp!==null&&y.actionUp(a,y),this.standardMouseClick(function(x){for(;x.panel!==null&&(!x.isActionable||x!==y);)x=x.panel;return x},function(x){return x===y})}this.stopTool()},qa.prototype.doCancel=function(){var a=this.diagram.lastInput,y=this.pk;y!==null&&(a.targetObject=y,y.actionCancel!==null&&y.actionCancel(a,y),this.stopTool())},qa.prototype.doStop=function(){this.pk=null},qa.className="ActionTool";function Ju(){hr.call(this),this.name="ClickCreating",this.Ri=null,this.o=!0,this.j=!1,this.mw=new Pt(0,0)}Vi(Ju,hr),Ju.prototype.canStart=function(){if(!this.isEnabled||this.archetypeNodeData===null)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.lastInput.left||this.isBeyondDragSize())return!1;if(this.isDoubleClick){if(a.lastInput.clickCount===1&&(this.mw=a.lastInput.viewPoint.copy()),a.lastInput.clickCount!==2||this.isBeyondDragSize(this.mw))return!1}else if(a.lastInput.clickCount!==1)return!1;return!(a.currentTool!==this&&a.Ol(a.lastInput.documentPoint,!0)!==null)},Ju.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint),this.stopTool()},Ju.prototype.insertPart=function(a){var y=this.diagram,x=this.archetypeNodeData;if(x===null)return null;var E=null;try{if(y.R("ChangingSelection",y.selection),this.Ea(this.name),x instanceof tn)x.Zc()&&(rl(x),E=x.copy(),E!==null&&y.add(E));else if(x!==null){var b=y.model.copyNodeData(x);Oe(b)&&(y.model.xf(b),E=y.Lc(b))}if(E!==null){var z=Pt.allocAt(a.x,a.y);this.isGridSnapEnabled&&od(this.diagram,E,a,z),E.location=z,y.allowSelect&&(y.clearSelection(!0),E.isSelected=!0),Pt.free(z)}y.Ya(),this.transactionResult=this.name,y.R("PartCreated",E)}finally{this.stopTransaction(),y.R("ChangedSelection",y.selection)}return E},zi.Object.defineProperties(Ju.prototype,{archetypeNodeData:{get:function(){return this.Ri},set:function(a){this.Ri=a}},isDoubleClick:{get:function(){return this.o},set:function(a){this.o=a}},isGridSnapEnabled:{get:function(){return this.j},set:function(a){this.j=a}}}),Ju.className="ClickCreatingTool";function ja(){hr.call(this),this.name="DragSelecting",this.Ik=175,this.o=!1;var a=new tn;a.layerName="Tool",a.selectable=!1;var y=new Rn;y.name="SHAPE",y.figure="Rectangle",y.fill=null,y.stroke="magenta",a.add(y),this.j=a}Vi(ja,hr),ja.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(!a.allowSelect)return!1;var y=a.lastInput;return!(!y.left||a.currentTool!==this&&(!this.isBeyondDragSize()||y.timestamp-a.firstInput.timestamp<this.delay||a.Ol(y.documentPoint,!0)!==null))},ja.prototype.doActivate=function(){var a=this.diagram;this.isActive=!0,a.isMouseCaptured=!0,a.skipsUndoManager=!0,a.add(this.box),this.doMouseMove()},ja.prototype.doDeactivate=function(){var a=this.diagram;a.ug(),a.remove(this.box),a.skipsUndoManager=!1,this.isActive=a.isMouseCaptured=!1},ja.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive&&this.box!==null){var y=this.computeBoxBounds(),x=this.box.fb("SHAPE");x===null&&(x=this.box.Pb());var E=li.alloc().h(y.width,y.height);x.desiredSize=E,this.box.mm(y.x,y.y,!1),li.free(E),(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}},ja.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram;a.remove(this.box);try{a.currentCursor="wait",a.R("ChangingSelection",a.selection),this.selectInRect(this.computeBoxBounds()),a.R("ChangedSelection",a.selection)}finally{a.currentCursor=""}}this.stopTool()},ja.prototype.computeBoxBounds=function(){var a=this.diagram;return new be(a.firstInput.documentPoint,a.lastInput.documentPoint)},ja.prototype.selectInRect=function(a){var y=this.diagram,x=y.lastInput;if(a=y.ux(a,this.isPartialInclusion),Sr?x.meta:x.control)if(x.shift)for(a=a.iterator;a.next();)y=a.value,y.isSelected&&(y.isSelected=!1);else for(a=a.iterator;a.next();)y=a.value,y.isSelected=!y.isSelected;else if(x.shift)for(a=a.iterator;a.next();)y=a.value,y.isSelected||(y.isSelected=!0);else{for(x=new Me,y=y.selection.iterator;y.next();){var E=y.value;a.contains(E)||x.add(E)}for(y=x.iterator;y.next();)y.value.isSelected=!1;for(a=a.iterator;a.next();)y=a.value,y.isSelected||(y.isSelected=!0)}},zi.Object.defineProperties(ja.prototype,{delay:{get:function(){return this.Ik},set:function(a){this.Ik=a}},isPartialInclusion:{get:function(){return this.o},set:function(a){this.o=a}},box:{get:function(){return this.j},set:function(a){this.j=a}}}),ja.className="DragSelectingTool";function ls(){hr.call(this),this.name="Panning",this.Xt=new Pt,this.xy=new Pt,this.xg=!1;var a=this;this.Kw=function(){var y=a.diagram;y!==null&&y.removeEventListener(Xe.document,"scroll",a.Kw,!1),a.stopTool()}}Vi(ls,hr),ls.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!(!a.allowHorizontalScroll&&!a.allowVerticalScroll||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize())},ls.prototype.doActivate=function(){var a=this.diagram;this.xg?(a.lastInput.bubbles=!0,a.addEventListener(Xe.document,"scroll",this.Kw,!1)):(a.currentCursor="move",a.isMouseCaptured=!0,this.Xt.assign(a.position)),this.isActive=!0},ls.prototype.doDeactivate=function(){var a=this.diagram;a.currentCursor="",this.isActive=a.isMouseCaptured=!1},ls.prototype.doCancel=function(){var a=this.diagram;a.position=this.Xt,a.isMouseCaptured=!1,this.stopTool()},ls.prototype.doMouseMove=function(){this.move()},ls.prototype.doMouseUp=function(){this.move(),this.stopTool()},ls.prototype.move=function(){var a=this.diagram;if(this.isActive&&a)if(this.xg)a.lastInput.bubbles=!0;else{var y=a.position,x=a.firstInput.documentPoint,E=a.lastInput.documentPoint,b=y.x+x.x-E.x;x=y.y+x.y-E.y,a.allowHorizontalScroll||(b=y.x),a.allowVerticalScroll||(x=y.y),a.position=this.xy.h(b,x)}},zi.Object.defineProperties(ls.prototype,{bubbles:{get:function(){return this.xg},set:function(a){this.xg=a}},originalPosition:{get:function(){return this.Xt}}}),ls.className="PanningTool",Fn("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(a){this.gb("ClickCreating",a,this.mouseUpTools)}),Fn("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(a){this.gb("ClickSelecting",a,this.mouseUpTools)}),Fn("panningTool",function(){return this.findTool("Panning")},function(a){this.gb("Panning",a,this.mouseMoveTools)}),Fn("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(a){this.gb("DragSelecting",a,this.mouseMoveTools)}),Fn("actionTool",function(){return this.findTool("Action")},function(a){this.gb("Action",a,this.mouseDownTools)});function Wl(){this.F=this.u=this.j=this.o=null}zi.Object.defineProperties(Wl.prototype,{mainElement:{get:function(){return this.u},set:function(a){this.u=a}},show:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a)}},hide:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a)}},valueFunction:{get:function(){return this.F},set:function(a){this.F=a}}}),Wl.className="HTMLInfo";function tl(a,y,x){this.text=a,this.hx=y,this.visible=x}tl.className="ContextMenuButtonInfo";function Fs(){hr.call(this),this.name="ContextMenu",this.o=this.ht=this.j=null,this.yw=new Pt,this.jt=null,this.Et=!1;var a=this;this.tu=function(){a.stopTool()}}Vi(Fs,hr);function gl(a){var y=new Wl;y.show=function(b,z,tt){tt.showDefaultContextMenu()},y.hide=function(b,z){z.hideDefaultContextMenu()},Dh=y,a.tu=function(){a.stopTool()},y=Gn("div");var x=Gn("div");y.style.cssText="top: 0px;z-index:10002;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px",x.style.cssText="z-index:10001;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;";var E=Gn("style");Xe.document.getElementsByTagName("head")[0].appendChild(E),E.sheet.insertRule(".goCXul { list-style: none; }",0),E.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0),E.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0),E=a.diagram,E!==null&&(E.addEventListener(y,"contextmenu",So,!1),E.addEventListener(y,"selectstart",So,!1),E.addEventListener(x,"contextmenu",So,!1)),y.className="goCXforeground",x.className="goCXbackground",Xe.document.body&&(Xe.document.body.appendChild(y),Xe.document.body.appendChild(x)),qc=y,vc=x,$c=!0}function So(a){return a.preventDefault(),!1}Fs.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return this.isBeyondDragSize()||!a.lastInput.right||1<a.lastInput.clickCount?!1:!!(a.lastInput.isTouchEvent&&this.defaultTouchContextMenu!==null||this.findObjectWithContextMenu()!==null)},Fs.prototype.doStart=function(){this.yw.set(this.diagram.firstInput.documentPoint)},Fs.prototype.doStop=function(){this.hideContextMenu(),this.currentObject=null},Fs.prototype.findObjectWithContextMenu=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.lastInput,E=null;if(a instanceof le||(a instanceof Kt?E=a:E=y.ic(x.documentPoint,null,function(b){return!b.layer.isTemporary})),E!==null){for(a=E;a!==null;){if(a.contextMenu!==null)return a;a=a.panel}if(y.lastInput.isTouchEvent&&this.defaultTouchContextMenu)return E.part}else if(y.contextMenu!==null)return y;return null},Fs.prototype.doActivate=function(){},Fs.prototype.doMouseDown=function(){if(hr.prototype.doMouseDown.call(this),this.isActive&&this.currentContextMenu instanceof cr){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doMouseDown(),a.doDeactivate())}this.diagram.toolManager.mouseDownTools.contains(this)&&Tl(this)},Fs.prototype.doMouseUp=function(){if(this.isActive&&this.currentContextMenu instanceof cr){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doCancel(),a.doDeactivate())}Tl(this)};function Tl(a){var y=a.diagram;if(a.isActive){var x=a.currentContextMenu;if(x!==null){var E=null;x instanceof Wl||(E=y.ic(y.lastInput.documentPoint,null,null),E!==null&&E.rg(x)&&a.standardMouseClick(null,null)),a.maybeStopTool(E)}}else a.canStart()&&(Mu(a,!0),a.isActive||a.stopTool())}Fs.prototype.maybeStopTool=function(){this.stopTool(),this.canStart()&&(this.diagram.currentTool=this,this.doMouseUp())};function Mu(a,y,x){if(x===void 0&&(x=null),!a.Et&&(a.Et=!0,y&&a.standardMouseSelect(),y=a.standardMouseClick(),a.Et=!1,!y)){if(a.isActive=!0,y=Dh,x===null&&(x=a.findObjectWithContextMenu()),x!==null){var E=x.contextMenu;E!==null?(a.currentObject=x instanceof Kt?x:null,a.showContextMenu(E,a.currentObject)):y!==null&&a.showContextMenu(y,a.currentObject)}else y!==null&&a.showContextMenu(y,null);a.currentContextMenu instanceof cr&&!a.currentContextMenu.visible&&a.stopTool()}}Fs.prototype.doMouseMove=function(){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()},Fs.prototype.showContextMenu=function(a,y){var x=this.diagram;if(a!==this.currentContextMenu&&this.hideContextMenu(),a instanceof cr){a.layerName="Tool",a.selectable=!1,a.scale=1/x.scale,a.category=this.name,a.placeholder!==null&&(a.placeholder.scale=x.scale);var E=a.diagram;E!==null&&E!==x&&E.remove(a),x.add(a),y!==null?a.adornedObject=y:a.data=x.model,a.Va(),this.positionContextMenu(a,y)}else a instanceof Wl&&a.show(y,x,this);this.currentContextMenu=a},Fs.prototype.positionContextMenu=function(a){if(a.placeholder===null){var y=this.diagram,x=y.lastInput.documentPoint.copy(),E=a.measuredBounds,b=y.viewportBounds;y.lastInput.isTouchEvent&&(x.x-=E.width),x.x+E.width>b.right&&(x.x-=E.width+5/y.scale),x.x<b.x&&(x.x=b.x),x.y+E.height>b.bottom&&(x.y-=E.height+5/y.scale),x.y<b.y&&(x.y=b.y),a.position=x}},Fs.prototype.hideContextMenu=function(){var a=this.diagram,y=this.currentContextMenu;y!==null&&(y instanceof cr?(a.remove(y),this.ht!==null&&this.ht.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Wl&&(y.hide!==null?y.hide(a,this):y.mainElement!==null&&(y.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())};function Qu(a){var y=new Me;return y.add(new tl("Copy",function(x){x.commandHandler.copySelection()},function(x){return x.commandHandler.canCopySelection()})),y.add(new tl("Cut",function(x){x.commandHandler.cutSelection()},function(x){return x.commandHandler.canCutSelection()})),y.add(new tl("Delete",function(x){x.commandHandler.deleteSelection()},function(x){return x.commandHandler.canDeleteSelection()})),y.add(new tl("Paste",function(x){x.commandHandler.pasteSelection(a.mouseDownPoint)},function(x){return x.commandHandler.canPasteSelection(a.mouseDownPoint)})),y.add(new tl("Select All",function(x){x.commandHandler.selectAll()},function(x){return x.commandHandler.canSelectAll()})),y.add(new tl("Undo",function(x){x.commandHandler.undo()},function(x){return x.commandHandler.canUndo()})),y.add(new tl("Redo",function(x){x.commandHandler.redo()},function(x){return x.commandHandler.canRedo()})),y.add(new tl("Scroll To Part",function(x){x.commandHandler.scrollToPart()},function(x){return x.commandHandler.canScrollToPart()})),y.add(new tl("Zoom To Fit",function(x){x.commandHandler.zoomToFit()},function(x){return x.commandHandler.canZoomToFit()})),y.add(new tl("Reset Zoom",function(x){x.commandHandler.resetZoom()},function(x){return x.commandHandler.canResetZoom()})),y.add(new tl("Group Selection",function(x){x.commandHandler.groupSelection()},function(x){return x.commandHandler.canGroupSelection()})),y.add(new tl("Ungroup Selection",function(x){x.commandHandler.ungroupSelection()},function(x){return x.commandHandler.canUngroupSelection()})),y.add(new tl("Edit Text",function(x){x.commandHandler.editTextBlock()},function(x){return x.commandHandler.canEditTextBlock()})),y}Fs.prototype.showDefaultContextMenu=function(){var a=this.diagram;this.jt===null&&(this.jt=Qu(this)),qc.innerHTML="",vc.addEventListener("pointerdown",this.tu,!1);var y=this,x=Gn("ul");x.className="goCXul",qc.appendChild(x),x.innerHTML="";for(var E=this.jt.iterator;E.next();){var b=E.value,z=b.visible;if(typeof b.hx=="function"&&(typeof z!="function"||z(a))){z=Gn("li"),z.className="goCXli";var tt=Gn("a");tt.className="goCXa",tt.href="#",tt.ky=b.hx,tt.addEventListener("pointerdown",function(it){return this.ky(a),y.stopTool(),it.preventDefault(),!1},!1),tt.textContent=b.text,z.appendChild(tt),x.appendChild(z)}}qc.style.display="block",vc.style.display="block"},Fs.prototype.hideDefaultContextMenu=function(){if(this.currentContextMenu!==null&&this.currentContextMenu===Dh){qc.style.display="none",vc.style.display="none";var a=this.diagram;a!==null&&a.removeEventListener(vc,"pointerdown",this.tu,!1),this.currentContextMenu=null}},zi.Object.defineProperties(Fs.prototype,{currentContextMenu:{get:function(){return this.j},set:function(a){this.j=a,this.ht=a instanceof cr?a.adornedPart:null}},defaultTouchContextMenu:{get:function(){return $c===!1&&Dh===null&&lo&&gl(this),Dh},set:function(a){a===null&&($c=!0),Dh=a}},currentObject:{get:function(){return this.o},set:function(a){this.o=a}},mouseDownPoint:{get:function(){return this.yw}}});var Dh=null,$c=!1,vc=null,qc=null;Fs.className="ContextMenuTool",Fn("contextMenuTool",function(){return this.findTool("ContextMenu")},function(a){this.gb("ContextMenu",a,this.mouseUpTools)});function Wr(){hr.call(this),this.name="TextEditing",this.Zh=new Or,this.ia=null,this.V=mc,this.vj=null,this.qa=yc,this.u=1,this.F=!0,this.o=null,this.j=new Wl,this.kt=null,tf(this,this.j)}Vi(Wr,hr);function tf(a,y){if(lo){var x=Gn("textarea");a.kt=x,x.addEventListener("input",function(){if(a.textBlock!==null){var E=a.Lx(this.value);this.style.width=20+E.measuredBounds.width*this.wA+"px",this.rows=E.lineCount}},!1),x.addEventListener("keydown",function(E){if(!E.isComposing&&a.textBlock!==null){var b=E.key;b==="Enter"?(a.textBlock.isMultiline===!1&&E.preventDefault(),a.acceptText(ef)):b==="Tab"?(a.acceptText(Xf),E.preventDefault()):b==="Escape"&&(a.doCancel(),a.diagram!==null&&a.diagram.doFocus())}},!1),x.addEventListener("focus",function(){if(a.currentTextEditor!==null&&a.state!==yc){var E=a.kt;a.qa===nf&&(a.qa=rf),typeof E.select=="function"&&a.selectsTextOnActivate&&(E.select(),E.setSelectionRange(0,9999))}},!1),x.addEventListener("blur",function(){if(a.currentTextEditor!==null&&a.state!==yc){var E=a.kt;typeof E.focus=="function"&&E.focus(),typeof E.select=="function"&&a.selectsTextOnActivate&&(E.select(),E.setSelectionRange(0,9999))}},!1),y.valueFunction=function(){return x.value},y.mainElement=x,y.show=function(E,b,z){if(E instanceof Or&&z instanceof Wr)if(z.state===of)x.style.border="3px solid red",x.focus();else{var tt=E.ga(Hn),it=b.position,nt=b.scale,ot=E.Df()*nt;ot<z.minimumEditorScale&&(ot=z.minimumEditorScale);var st=E.naturalBounds.width*ot+6,ut=E.naturalBounds.height*ot+2,ct=(tt.x-it.x)*nt;tt=(tt.y-it.y)*nt,it=E.verticalAlignment,nt=(E.lineHeight+E.spacingAbove+E.spacingBelow)*E.lineCount*ot,ut=it.y*ut-it.y*nt+it.offsetY-(.5*ut-.5*nt)-nt/2,x.value=E.text,b.div.style.font=E.font,x.style.position="absolute",x.style.zIndex="100",x.style.font="inherit",x.style.fontSize=100*ot+"%",x.style.lineHeight="normal",x.style.width=st+"px",x.style.left=(ct-st/2|0)-1+"px",x.style.top=(tt+ut|0)-1+"px",x.style.textAlign=E.textAlign,x.style.margin="0",x.style.padding="1px",x.style.border="0",x.style.outline="none",x.style.whiteSpace="pre-wrap",x.style.overflow="hidden",x.rows=E.lineCount,x.wA=ot,x.className="goTXarea",b.div.appendChild(x),x.focus(),z.selectsTextOnActivate&&(x.select(),x.setSelectionRange(0,9999))}},y.hide=function(E){E.div.removeChild(x)}}}Wr.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a===null||a.isReadOnly||$u&&$u!==this&&($u.acceptText(Zl),$u&&$u!==this)||!a.lastInput.left||this.isBeyondDragSize())return!1;var y=a.ic(a.lastInput.documentPoint);return y!==null&&y instanceof Or&&y.editable&&y.part.canEdit()?(y=y.part,!(y===null||this.starting===mc&&!y.isSelected||this.starting===Jf&&2>a.lastInput.clickCount)):!1},Wr.prototype.doStart=function(){$u=this,this.textBlock!==null&&this.doActivate()},Wr.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(a!==null){var y=this.textBlock;if(y===null&&(y=a.ic(a.lastInput.documentPoint)),y!==null&&y instanceof Or&&(this.textBlock=y,y.part!==null)){a.animationManager.Cc(),this.isActive=!0,this.qa=nf;var x=this.defaultTextEditor;y.textEditor!==null&&(x=y.textEditor),this.Zh=this.textBlock.copy();var E=new be(this.textBlock.ga(qn),this.textBlock.ga(vo));a.tv(E),x.show(y,a,this),this.currentTextEditor=x}}}},Wr.prototype.doCancel=function(){this.stopTool()},Wr.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()},Wr.prototype.doMouseDown=function(){this.isActive&&this.acceptText(Zl)},Wr.prototype.acceptText=function(a){switch(a){case Zl:this.qa===xc?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():(this.qa===nf||this.qa===of||this.qa===rf)&&(this.qa=sp,op(this));break;case Yf:case ef:case Xf:(ef!==a||this.textBlock.isMultiline!==!0)&&(this.qa===nf||this.qa===of||this.qa===rf)&&(this.qa=sp,op(this))}};function op(a){var y=a.textBlock,x=a.diagram,E=a.currentTextEditor;if(y!==null&&E!==null){var b=y.text,z="";E.valueFunction!==null&&(z=E.valueFunction()),a.isValidText(y,b,z)?(a.Ea(a.name),a.qa=xc,a.transactionResult=a.name,y.text=z,a.doSuccess(b,z),x!==null&&x.R("TextEdited",y,b),a.stopTransaction(),a.stopTool(),x!==null&&x.doFocus()):(a.qa=of,a.doError(b,z))}}Wr.prototype.doError=function(a,y){var x=this.textBlock;x.errorFunction!==null&&x.errorFunction(this,a,y),(a=this.currentTextEditor)&&a.show(x,this.diagram,this)},Wr.prototype.doSuccess=function(a,y){var x=this.textBlock;x.textEdited!==null&&x.textEdited(x,a,y)},Wr.prototype.doDeactivate=function(){var a=this.diagram;a!==null&&(this.qa=yc,this.currentTextEditor!==null&&this.currentTextEditor.hide(a,this),this.textBlock=null,this.isActive=!1)},Wr.prototype.doStop=function(){$u=null},Wr.prototype.isValidText=function(a,y,x){var E=this.textValidation;return E!==null&&!E(a,y,x)?!1:(E=a.textValidation,!!(E===null||E(a,y,x)))},Wr.prototype.Lx=function(a){var y=this.Zh;return y.text=a,y.measure(this.textBlock.Ih,1/0),y},zi.Object.defineProperties(Wr.prototype,{textBlock:{get:function(){return this.ia},set:function(a){this.ia=a}},currentTextEditor:{get:function(){return this.o},set:function(a){this.o=a}},defaultTextEditor:{get:function(){return this.j},set:function(a){this.j=a}},starting:{get:function(){return this.V},set:function(a){this.V=a}},textValidation:{get:function(){return this.vj},set:function(a){this.vj=a}},minimumEditorScale:{get:function(){return this.u},set:function(a){this.u=a}},selectsTextOnActivate:{get:function(){return this.F},set:function(a){this.F=a}},state:{get:function(){return this.qa},set:function(a){this.qa!==a&&(this.qa=a)}}}),Wr.prototype.measureTemporaryTextBlock=Wr.prototype.Lx;var Yf=new ze(Wr,"LostFocus",0),Zl=new ze(Wr,"MouseDown",1),Xf=new ze(Wr,"Tab",2),ef=new ze(Wr,"Enter",3),t0=new ze(Wr,"SingleClick",0),mc=new ze(Wr,"SingleClickSelected",1),Jf=new ze(Wr,"DoubleClick",2),yc=new ze(Wr,"StateNone",0),nf=new ze(Wr,"StateActive",1),rf=new ze(Wr,"StateEditing",2),sp=new ze(Wr,"StateValidating",3),of=new ze(Wr,"StateInvalid",4),xc=new ze(Wr,"StateValidated",5),$u=null;Wr.className="TextEditingTool",Wr.LostFocus=Yf,Wr.MouseDown=Zl,Wr.Tab=Xf,Wr.Enter=ef,Wr.SingleClick=t0,Wr.SingleClickSelected=mc,Wr.DoubleClick=Jf,Wr.StateNone=yc,Wr.StateActive=nf,Wr.StateEditing=rf,Wr.StateValidating=sp,Wr.StateInvalid=of,Wr.StateValidated=xc,Fn("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.gb("TextEditing",a,this.mouseUpTools)});function pa(a){af||(ap(),af=!0),this.H=ru,this.Ok=this.zb=this.vq=this.bc=!1,this.Qw=!0,this.Pk=bu,this.Dm=!1,this.Gh=this.Jd=!0,this.Dg=600,this.cw=this.Ow=!1,this.Zd=new _e,this.ce=new us,this.ce.Yd=this,this.Ei=new _e,this.pu=new _e,this.Sr=new _e,this.pr=new _e,a&&Object.assign(this,a)}pa.prototype.Xe=function(a){this.H=a},pa.prototype.canStart=function(){return!0};function nu(a,y){a.Jd&&a.canStart(y)&&(a.Zd.add(y),a.defaultAnimation.isAnimating&&a.Cc(),hs(a.H),a.zb=!0)}function Qf(a){if(a.Jd&&a.zb){var y=a.ce,x=a.H,E=a.Zd.contains("Model");E&&(a.Ok=!0,a.Pk===bu?(y.isViewportUnconstrained=!0,y.vc.clear(),y.add(x,"position",x.position.copy().offset(0,-200),x.position),y.add(x,"opacity",0,1)):a.Pk===lp&&y.vc.clear(),a.Qw=!!(a.Pk===lf&&x.du.D(x.pa)),x.R("InitialAnimationStarting",a)),E&&!a.Gh||y.vc.count===0?(a.Zd.clear(),a.zb=!1,y.vc.clear(),uf(y,x),a.Ok=!1,x.N()):(a.Zd.clear(),x.kg=!1,E=y.vc.get(x),x.autoScale!==Cs&&E!==null&&(delete E.start.scale,delete E.end.scale),Xe.requestAnimationFrame(function(){a.zb===!1||y.bc||(x.Gf("temporaryPixelRatio")&&Us(x),dp(x),a.zb=!1,y.start(),y.bc&&(qu(a),x.Ya(),up(y,0),_a(x,!0),Fh(a),x.R("AnimationStarting",a)))}))}}function Eu(a){return a.Zd.contains("Trigger")&&a.Zd.count===1}function $f(a,y,x,E){a.isTicking||Eu(a)||y instanceof fi&&(y.fromNode!==null||y.toNode!==null)||a.ce.add(y,"position",x,E,!1)}yt=pa.prototype,yt.fv=function(a){return this.ce.fv(a)},yt.Xu=function(a){return this.ce.Xu(a)};function qf(a,y){function x(){if(0<b.Sr.count&&(E.addAll(b.Sr),b.Sr.clear(),b.bc=!0),b.bc!==!1&&E.count!==0){b.pu.addAll(E);for(var z=b.pu.iterator;z.next();){var tt=z.value;if(tt.bc!==!1){t:if(0<tt.yl.count)var it=!0;else{for(it=tt.vc.iterator;it.next();){var nt=it.key;if(nt instanceof Kt&&nt.diagram!==null||nt instanceof le){it=!0;break t}}it=!1}it?hf(tt,!1):tt.Xk=!0}}b.pu.clear(),b.bc!==!1&&(qu(b),_a(b.H),Fh(b)),Xe.requestAnimationFrame(x)}}var E=a.Ei,b=a;a.bc?a.Sr.add(y):(a.bc=!0,E.add(y),Xe.requestAnimationFrame(function(){x()}))}function _g(a){for(a=a.Ei.iterator;a.next();)a.value.Xk=!1}function qu(a){if(!a.vq){var y=a.H;a.Ow=y.skipsUndoManager,a.cw=y.skipsModelSourceBindings,y.skipsUndoManager=!0,y.skipsModelSourceBindings=!0,a.vq=!0}}function Fh(a){var y=a.H;y.skipsUndoManager=a.Ow,y.skipsModelSourceBindings=a.cw,a.vq=!1}yt.Cc=function(a){var y=this.ce;if(this.zb===!0&&(this.Ok=this.zb=!1,this.Zd.clear(),0<y.vc.count&&this.H.$b()),this.bc){if(y.Ml(!0),y.vc.clear(),uf(y,null),a===!0)for(a=this.Ei.Fa(),y=0;y<a.length;y++)a[y].Ml(!0)}else y.vc.clear(),uf(y,this.H)},yt.Ml=function(a){a===this.defaultAnimation&&this.defaultAnimation.vc.clear(),this.Ei.remove(a),this.Ei.count===0&&(this.bc=!1,this.H.$b()),a===this.defaultAnimation&&(this.defaultAnimation.vc.clear(),this.H.R("AnimationFinished",this))},yt.Cj=function(a,y){this.zb&&(this.Zd.contains("Expand Tree")||this.Zd.contains("Expand SubGraph"))&&(this.ce.Cj(a,y),na(this,a))},yt.Aj=function(a,y){this.zb&&(this.Zd.contains("Collapse Tree")||this.Zd.contains("Collapse SubGraph"))&&(this.ce.Aj(a,y),th(this.ce,y,"position",y.position,y.position),na(this,a))};function Hg(a,y,x){!a.zb||y.D(x)||Eu(a)||(a.H.pi||(y=x.copy()),th(a.ce,a.H,"position",y,x))}function td(a,y,x){y.fd&&(y.Tg=x,a.pr.add(y))}function na(a,y){for(y=y.findLinksConnected();y.next();){var x=y.value;x.fd&&(x.Tg=x.points.copy(),a.pr.add(x))}}function Bh(a,y,x,E,b){a===null&&(a=[0,0,0,0]),y===null&&(y=[0,0,0,0]);var z=a[0],tt=a[1],it=a[2];a=a[3];var nt=y[0],ot=y[1],st=y[2];return y=y[3],it===0||it===100?(z=nt,tt=ot):(st===0||st===100)&&(nt=z,ot=tt),180<Math.abs(nt-z)&&(nt>z?z+=360:nt+=360),z=b(x,z,nt-z,E)%360,tt=b(x,tt,ot-tt,E),it=b(x,it,st-it,E),x=b(x,a,y-a,E),"hsla("+z+", "+tt+"%, "+it+"%, "+x+")"}function ap(){function a(x,E,b,z,tt,it){x.position=new Pt(z(tt,E.x,b.x-E.x,it),z(tt,E.y,b.y-E.y,it))}var y=new ji;y.add("position:diagram",a),y.add("position",a),y.add("position:part",function(x,E,b,z,tt,it){tt<it?x.mm(z(tt,E.x,b.x-E.x,it),z(tt,E.y,b.y-E.y,it),!1):x.position=new Pt(z(tt,E.x,b.x-E.x,it),z(tt,E.y,b.y-E.y,it))}),y.add("location",function(x,E,b,z,tt,it){tt<it?x.mm(z(tt,E.x,b.x-E.x,it),z(tt,E.y,b.y-E.y,it),!0):x.location=new Pt(z(tt,E.x,b.x-E.x,it),z(tt,E.y,b.y-E.y,it))}),y.add("position:placeholder",function(x,E,b,z,tt,it){tt<it?x.mm(z(tt,E.x,b.x-E.x,it),z(tt,E.y,b.y-E.y,it),!1):x.position=new Pt(z(tt,E.x,b.x-E.x,it),z(tt,E.y,b.y-E.y,it))}),y.add("position:nodeCollapse",function(x,E,b,z,tt,it){var nt=x.actualBounds,ot=b.actualBounds;b=ot.x+ot.width/2-nt.width/2,nt=ot.y+ot.height/2-nt.height/2,tt<it?x.mm(z(tt,E.x,b-E.x,it),z(tt,E.y,nt-E.y,it),!1):x.position=new Pt(z(tt,E.x,b-E.x,it),z(tt,E.y,nt-E.y,it))}),y.add("desiredSize",function(x,E,b,z,tt,it){x.desiredSize=new be(z(tt,E.width,b.width-E.width,it),z(tt,E.height,b.height-E.height,it))}),y.add("width",function(x,E,b,z,tt,it){x.width=z(tt,E,b-E,it)}),y.add("height",function(x,E,b,z,tt,it){x.height=z(tt,E,b-E,it)}),y.add("fill",function(x,E,b,z,tt,it){x.fill=Bh(E,b,tt,it,z)}),y.add("stroke",function(x,E,b,z,tt,it){x.stroke=Bh(E,b,tt,it,z)}),y.add("strokeWidth",function(x,E,b,z,tt,it){x.strokeWidth=z(tt,E,b-E,it)}),y.add("strokeDashOffset",function(x,E,b,z,tt,it){x.strokeDashOffset=z(tt,E,b-E,it)}),y.add("background",function(x,E,b,z,tt,it){x.background=Bh(E,b,tt,it,z)}),y.add("areaBackground",function(x,E,b,z,tt,it){x.areaBackground=Bh(E,b,tt,it,z)}),y.add("opacity",function(x,E,b,z,tt,it){x.opacity=z(tt,E,b-E,it)}),y.add("scale",function(x,E,b,z,tt,it){x.scale=z(tt,E,b-E,it)}),y.add("angle",function(x,E,b,z,tt,it){x.angle=z(tt,E,b-E,it)}),sf=y}zi.Object.defineProperties(pa.prototype,{animationReasons:{get:function(){return this.Zd}},isEnabled:{get:function(){return this.Jd},set:function(a){(this.Jd=a)&&this.Ei.each(function(y){y.isAnimating||y.runCount!==1/0||y.start()})}},duration:{get:function(){return this.Dg},set:function(a){1>a&&xi(a,">= 1",pa,"duration"),this.Dg=a}},isAnimating:{get:function(){return this.bc}},isTicking:{get:function(){return this.vq}},isInitial:{get:function(){return this.Gh},set:function(a){this.Gh=a}},defaultAnimation:{get:function(){return this.ce}},activeAnimations:{get:function(){return this.Ei}},initialAnimationStyle:{get:function(){return this.Pk},set:function(a){this.Pk=a}}}),pa.prototype.stopAnimation=pa.prototype.Cc;var sf=null,af=!1,bu=new ze(pa,"Default",1),lf=new ze(pa,"AnimateLocations",2),lp=new ze(pa,"None",3);pa.className="AnimationManager",pa.defineAnimationEffect=function(a,y){af||(ap(),af=!0),sf.add(a,y)},pa.Default=bu,pa.AnimateLocations=lf,pa.None=lp;function us(a){this.vu=this.Nw=this.Yd=this.H=null,this.Xk=this.bc=this.j=!1,this.cn=this.Qd=0,this.Lp=this.ot=wc,this.Wk=this.ho=!1,this.cu=1,this.au=0,this.Gd=this.Dg=NaN,this.gw=0,this.dn=null,this.o=gr,this.vc=new ji,this.Tt=new ji,this.yl=new _e,this.Ut=new _e,this.dw=nh,a&&Object.assign(this,a)}us.prototype.suspend=function(){this.Xk=!0},us.prototype.advanceTo=function(a,y){y&&(this.Xk=!1),this.ho&&a>=this.Gd&&(this.Wk=!0,a-=this.Gd),this.gw=a,hf(this,!0),qu(this.Yd),_a(this.H),Fh(this.Yd),this.H.redraw()};function uf(a,y){if(a.Tt.clear(),a.Wk=!1,a.au=0,a.Gd=NaN,0<a.yl.count&&a.yl.clear(),0<a.Ut.count&&a.Ut.clear(),y!==null)for(a=y.links;a.next();)a.value.Tg=null}yt=us.prototype,yt.start=function(){if(this.vc.count===0||this.bc)return this;for(var a=this.H,y=this.vc.iterator;y.next();){var x=y.key;a===null&&(x instanceof le?a=x:x instanceof Kt&&(a=x.diagram))}if(a!==null)this.H=a,this.Yd=a.animationManager;else return this;return y=this.Yd,y.isEnabled===!1?this:(this.Gd=isNaN(this.Dg)?y.duration:this.Dg,this.Lp=this.ot,y.Ok&&y.Pk===bu&&this===y.defaultAnimation&&(this.Lp=Wg,this.Gd=isNaN(this.Dg)?y.duration===600?900:y.duration:this.Dg),this.dw=a.scrollMode,this.isViewportUnconstrained&&(a.sj=mf),qu(y),this.yl.each(function(E){E.data=null,a.add(E)}),Fh(y),this.bc=!0,this.Qd=+new Date,this.cn=this.Qd+this.Gd,qf(y,this),this)},yt.Iy=function(a,y){return a.Zc()?(this.yl.add(a),this.H=y,this):this},yt.add=function(a,y,x,E,b){if(y==="position"&&x.Xa(E))return this;if(this.H===null&&(a instanceof le?this.H=a:a instanceof Kt&&a.diagram!==null&&(this.H=a.diagram)),a instanceof tn){if(!a.isAnimated)return this;y==="position"&&(y="position:part")}return th(this,a,y,x,E,b),this};function th(a,y,x,E,b,z){var tt=a.vc;if(y instanceof le&&x==="position"&&(x="position:diagram"),(x==="fill"||x==="stroke"||x==="background"||x==="areaBackground")&&(Lu(E),a0(),E=[La.j,La.u,La.o,La.F],Lu(b),a0(),b=[La.j,La.u,La.o,La.F]),tt.contains(y)){var it=tt.I(y),nt=it.start,ot=it.end;nt[x]===void 0&&(nt[x]=Oh(E)),ot[x]=Oh(b)}else nt={},ot={},nt[x]=Oh(E),ot[x]=Oh(b),it=nt.position,y instanceof Kt&&it instanceof Pt&&!it.w()&&y.diagram.animationManager.Zd.contains("Expand SubGraph")&&it.assign(ot.position),it=new Ih(nt,ot,z),tt.add(y,it);tt=nt[x],tt instanceof Pt&&!tt.w()&&tt.assign(a.o),z&&x.indexOf("position:")===0&&y instanceof tn?it.Ku.location=Oh(y.location):z&&(it.Ku[x]=Oh(E))}function Oh(a){return a instanceof Pt||a instanceof li?a.copy():a}yt.fv=function(a){return this.bc?(a=this.vc.I(a),a!==null&&a.nv):!1},yt.Xu=function(a){return this.bc?(a=this.vc.I(a),a!==null&&(a.start.position||a.start.location)):!1};function hf(a,y){if(!a.Xk||y){var x=a.Yd;if(a.bc!==!1){var E=+new Date,b=E>a.cn?a.Gd:E-a.Qd;y&&(b=a.gw,b<a.Gd?(a.Qd=+new Date-b,a.cn=a.Qd+a.Gd):b=a.Gd),qu(x),up(a,b),_a(a.H,!0),Fh(x),E>a.cn&&(a.ho&&!a.Wk?(a.Qd=+new Date,a.cn=a.Qd+a.Gd,a.Wk=!0):a.Ml(!1))}}}function up(a,y){for(var x=a.Gd,E=a.vc.iterator,b=a.Wk;E.next();){var z=E.key;if(!(z instanceof Kt&&z.diagram===null)){var tt=E.value,it=b?tt.end:tt.start;tt=b?tt.start:tt.end;var nt=sf,ot;for(ot in tt)ot==="position"&&(tt["position:placeholder"]||tt["position:nodeCollapse"])||nt.get(ot)===null||nt.get(ot)(z,it[ot],tt[ot],a.Lp,y,x,a)}}}yt.stop=function(){return this.bc?(this.Ml(!0),this):this},yt.Ml=function(a){if(this.vu!==null&&this.vu.jo.remove(this.Nw),this.bc){var y=this.H,x=this.Yd;this.Xk=this.bc=x.Ok=!1,qu(x);for(var E=this.vc,b=this.yl.iterator;b.next();)y.remove(b.value);for(b=this.Ut.iterator;b.next();)b.value.v();b=this.ho,E=E.iterator;for(var z=sf;E.next();){var tt=E.key,it=E.value,nt=b?it.end:it.start,ot=b?it.start:it.end,st=it.Ku,ut;for(ut in ot)if(z.get(ut)!==null){var ct=ut;!it.Hu||ct!=="position:nodeCollapse"&&ct!=="position:placeholder"||(ct="position"),z.get(ct)(tt,nt[ut],st[ut]!==void 0?st[ut]:it.Hu?nt[ut]:ot[ut],this.Lp,this.Gd,this.Gd,this)}it.Hu&&st.location!==void 0&&tt instanceof tn&&(tt.location=st.location),it.nv&&tt instanceof tn&&tt.Zb(!1)}if(y.As.clear(),cf(y,!1),y.Ya(),y.N(),_a(y,!0),x.defaultAnimation===this){for(ut=x.pr.iterator;ut.next();)b=ut.value,b.Tg!==null&&(b.points=b.Tg,b.Tg=null);x.pr.clear()}_a(y,!0),this.isViewportUnconstrained&&(y.scrollMode=this.dw),Fh(x),this.au++,!a&&this.cu>this.au?(this.Wk=!1,this.start()):(this.dn&&this.dn(this),uf(this,null),x.Ml(this),y.$b())}},yt.Cj=function(a,y){var x=y.actualBounds,E=null;if(y instanceof An&&(E=y.placeholder),E!==null?(x=E.ga(qn),E=E.padding,x.x+=E.left,x.y+=E.top,this.add(a,"position",x,a.position,!1)):this.add(a,"position",new Pt(x.x+x.width/2,x.y+x.height/2),a.position,!1),this.add(a,"scale",.01,a.scale,!1),a instanceof An)for(a=a.memberParts;a.next();)E=a.value,E instanceof Ci&&this.Cj(E,y)},yt.Aj=function(a,y){if(a.isVisible()){var x=null;if(y instanceof An&&(x=y.placeholder),x!==null){var E=x.ga(qn);x=x.padding,E.x+=x.left,E.y+=x.top,this.add(a,"position:placeholder",a.position,E,!0)}else this.add(a,"position:nodeCollapse",a.position,y,!0);if(this.add(a,"scale",a.scale,.01,!0),E=this.vc,E.contains(a)&&(E.I(a).nv=!0),a instanceof An)for(a=a.memberParts;a.next();)E=a.value,E instanceof Ci&&this.Aj(E,y)}},yt.Ez=function(a){var y=this.Tt.get(a);return y===null&&(y={},this.Tt.add(a,y)),y},zi.Object.defineProperties(us.prototype,{duration:{get:function(){return this.Dg},set:function(a){1>a&&xi(a,">= 1",us,"duration"),this.Dg=a}},reversible:{get:function(){return this.ho},set:function(a){this.ho=a}},runCount:{get:function(){return this.cu},set:function(a){0<a?this.cu=a:It("Animation.runCount value must be a positive integer.")}},finished:{get:function(){return this.dn},set:function(a){this.dn!==a&&(this.dn=a)}},easing:{get:function(){return this.ot},set:function(a){this.ot=a}},isViewportUnconstrained:{get:function(){return this.j},set:function(a){this.j=a}},isAnimating:{get:function(){return this.bc}}}),us.prototype.getTemporaryState=us.prototype.Ez,us.prototype.stop=us.prototype.stop,us.prototype.add=us.prototype.add,us.prototype.addTemporaryPart=us.prototype.Iy;function wc(a,y,x,E){return a/=E/2,1>a?x/2*a*a+y:-x/2*(--a*(a-2)-1)+y}function Wg(a,y,x,E){return a===E?y+x:x*(-Math.pow(2,-10*a/E)+1)+y}us.className="Animation",us.EaseLinear=function(a,y,x,E){return x*a/E+y},us.EaseInOutQuad=wc,us.EaseInQuad=function(a,y,x,E){return x*(a/=E)*a+y},us.EaseOutQuad=function(a,y,x,E){return-x*(a/=E)*(a-2)+y},us.EaseInExpo=function(a,y,x,E){return a===0?y:x*Math.pow(2,10*(a/E-1))+y},us.EaseOutExpo=Wg;function Ih(a,y,x){this.start=a,this.end=y,this.Ku={},this.Hu=x,this.nv=!1}Ih.className="AnimationState";function vl(a,y,x){this.xd=null,this.rf=a,this.so=x||hp,this.uk=null,y!==void 0&&(this.uk=y,x===void 0&&(this.so=Rh))}vl.prototype.copy=function(){var a=new vl(this.rf);a.so=this.so;var y=this.uk;if(y!==null){var x={};y.duration!==void 0&&(x.duration=y.duration),y.finished!==void 0&&(x.finished=y.finished),y.easing!==void 0&&(x.easing=y.easing),a.uk=x}return a};function Zg(a,y){a=a.uk,a!==null&&(a.duration&&(y.duration=a.duration),a.finished&&(y.finished=a.finished),a.easing&&(y.easing=a.easing))}zi.Object.defineProperties(vl.prototype,{propertyName:{get:function(){return this.rf},set:function(a){this.rf=a}},animationSettings:{get:function(){return this.uk},set:function(a){this.uk=a}},startCondition:{get:function(){return this.so},set:function(a){this.so=a}}});var hp=new ze(vl,"Default",1),Rh=new ze(vl,"Immediate",2),Sc=new ze(vl,"Bundled",3);vl.className="AnimationTrigger",vl.Default=hp,vl.Immediate=Rh,vl.Bundled=Sc;function Yo(a){bi(this),this.H=null,this.Pa=new Me,this.xa="",this.pb=1,this.o=!1,this.j=this.Uh=this.u=this.Oi=this.Ni=this.Mi=this.Li=this.Ji=this.Ki=this.Ii=this.Qi=this.Hi=this.Pi=this.Gi=this.Fi=!0,this.Zq=[],a&&Object.assign(this,a)}yt=Yo.prototype,yt.clear=function(){for(var a=this.Pa,y=0;y<a.length;y++){var x=a.s[y];x.Ig=null,ys(x)}a.clear(),this.Zq.length=0},yt.Xe=function(a){this.H=a},yt.toString=function(a){a===void 0&&(a=0);var y='Layer "'+this.name+'"';if(0>=a)return y;for(var x=0,E=0,b=0,z=0,tt=0,it=this.Pa.iterator;it.next();){var nt=it.value;nt instanceof An?b++:nt instanceof Ci?E++:nt instanceof fi?z++:nt instanceof cr?tt++:x++}if(it="",0<x&&(it+=x+" Parts "),0<E&&(it+=E+" Nodes "),0<b&&(it+=b+" Groups "),0<z&&(it+=z+" Links "),0<tt&&(it+=tt+" Adornments "),1<a)for(a=this.Pa.iterator;a.next();)x=a.value,it+=`
|
|
`+x.toString(),E=x.data,E!==null&&kn(E)&&(it+=" #"+kn(E)),x instanceof Ci?it+=" "+ki(E):x instanceof fi&&(it+=" "+ki(x.fromNode)+" "+ki(x.toNode));return y+" "+this.Pa.count+": "+it},yt.ic=function(a,y,x){if(y===void 0&&(y=null),x===void 0&&(x=null),this.Uh===!1)return null;var E=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(E=!0);for(var b=Pt.alloc(),z=this.Pa.s,tt=z.length;tt--;){var it=z[tt];if((E!==!0||Uh(it)!==!1)&&it.isVisible()&&(b.assign(a),Gi(b,it.oe),it=it.ic(b,y,x),it!==null&&(y!==null&&(it=y(it)),it!==null&&(x===null||x(it)))))return Pt.free(b),it}return Pt.free(b),null},yt.ji=function(a,y,x,E){if(y===void 0&&(y=null),x===void 0&&(x=null),E instanceof Me||E instanceof _e||(E=new _e),this.Uh===!1)return E;var b=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(b=!0);for(var z=Pt.alloc(),tt=this.Pa.s,it=tt.length;it--;){var nt=tt[it];if((b!==!0||Uh(nt)!==!1)&&nt.isVisible()){z.assign(a),Gi(z,nt.oe);var ot=nt;nt.ji(z,y,x,E)&&(y!==null&&(ot=y(ot)),ot===null||x!==null&&!x(ot)||E.add(ot))}}return Pt.free(z),E},yt.Cf=function(a,y,x,E,b){if(y===void 0&&(y=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof Me||b instanceof _e||(b=new _e),this.Uh===!1)return b;var z=!1;this.diagram!==null&&this.diagram.viewportBounds.Re(a)&&(z=!0);for(var tt=this.Pa.s,it=tt.length;it--;){var nt=tt[it];if((z!==!0||Uh(nt)!==!1)&&nt.isVisible()){var ot=nt;nt.Cf(a,y,x,E,b)&&(y!==null&&(ot=y(ot)),ot===null||x!==null&&!x(ot)||b.add(ot))}}return b},yt.Nu=function(a,y,x,E,b,z,tt){if(this.Uh===!1)return b;for(var it=this.Pa.s,nt=it.length;nt--;){var ot=it[nt];if((tt!==!0||Uh(ot)!==!1)&&z(ot)&&ot.isVisible()){var st=ot;ot.Cf(a,y,x,E,b)&&(y!==null&&(st=y(st)),st===null||x!==null&&!x(st)||b.add(st))}}return b},yt.og=function(a,y,x,E,b,z){if(x===void 0&&(x=null),E===void 0&&(E=null),b===void 0&&(b=!0),b!==!1&&b!==!0&&((b instanceof Me||b instanceof _e)&&(z=b),b=!0),z instanceof Me||z instanceof _e||(z=new _e),this.Uh===!1)return z;var tt=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(tt=!0);for(var it=Pt.alloc(),nt=Pt.alloc(),ot=this.Pa.s,st=ot.length;st--;){var ut=ot[st];if((tt!==!0||Uh(ut)!==!1)&&ut.isVisible()){it.assign(a),Gi(it,ut.oe),nt.h(a.x+y,a.y),Gi(nt,ut.oe);var ct=ut;ut.og(it,nt,x,E,b,z)&&(x!==null&&(ct=x(ct)),ct===null||E!==null&&!E(ct)||z.add(ct))}}return Pt.free(it),Pt.free(nt),z},yt.Fd=function(a,y){if(this.visible){var x=this.Pa.s,E=x.length;if(E!==0){a=ii();for(var b=ii(),z=0;z<E;z++){var tt=x[z];if(tt.vw=z,tt instanceof fi){if(tt.fd===!1)continue}else if(tt instanceof cr&&tt.adornedPart!==null)continue;var it=tt.actualBounds;tt.isVisible()&&Pl(it,y)?(tt.Fd(!0),a.push(tt)):(tt.Fd(!1),tt.adornments!==null&&0<tt.adornments.count&&b.push(tt))}for(y=0;y<a.length;y++)for(x=a[y],I0(x),x=x.adornments;x.next();)E=x.value,E.measure(1/0,1/0),E.arrange(),E.Fd(!0);for(y=0;y<b.length;y++)I0(b[y]);Hi(a),Hi(b)}}};function Pu(a,y){var x=1;return a.pb!==1&&(x=y.globalAlpha,y.globalAlpha=x*a.pb),x}yt.gc=function(a,y,x){if(this.visible&&this.pb!==0&&(x===void 0&&(x=!0),x||!this.isTemporary)){x=this.Pa.s;var E=x.length;if(E!==0){if(a.isTemporary)for(var b=0;b<E;b++)x[b].Gj();b=Pu(this,a);var z=this.Zq;z.length=0;for(var tt=y.scale,it=be.alloc(),nt=0;nt<E;nt++)this.Oj(a,x[nt],y,z,tt,it,!0);if(be.free(it),a.isTemporary)for(y=0;y<E;y++)x[y].Gj();a.globalAlpha=b}}};function Kg(a,y,x,E,b){if(a.visible&&a.pb!==0&&(b||!a.isTemporary)){b=a.Pa.s;var z=b.length;if(z!==0){var tt=Pu(a,y),it=a.Zq;it.length=0;for(var nt=x.scale,ot=be.alloc(),st=0;st<z;st++){var ut=b[st];E.contains(ut)&&a.Oj(y,ut,x,it,nt,ot,!1)}be.free(ot),y.globalAlpha=tt}}}yt.Oj=function(a,y,x,E,b,z,tt){if(tt&&!Uh(y))a.Hs(y);else{if(E!==null&&y instanceof fi&&(y.isOrthogonal&&E.push(y),y.fd===!1)){a.Hs(y);return}for(tt=!1,E=y.containingGroup;E!==null;)tt?E.tb!==null&&z.Ex(E.tb):E.tb!==null&&(tt=!0,z.assign(E.tb)),E=E.containingGroup;var it=y.actualBounds;if(E=!1,tt&&y.isVisible()){if(!z.Yc(it)){a.Hs(y);return}E=!z.Re(it)}E&&(a.save(),a instanceof ga?a.bk=z.copy():(a.beginPath(),a.rect(z.x,z.y,z.width,z.height),a.clip())),it.width*b>x.Oq||it.height*b>x.Oq?y.gc(a,x):(b=y.actualBounds,z=y.naturalBounds,b.width===0||b.height===0||isNaN(b.x)||isNaN(b.y)||!y.isVisible()||(x=y.transform,y.areaBackground!==null&&(uo(y,a,y.areaBackground,!0,!0,z,b),a.fillRect(b.x,b.y,b.width,b.height)),y.areaBackground===null&&y.background===null&&(uo(y,a,"rgba(0,0,0,0.3)",!0,!1,z,b),a.fillRect(b.x,b.y,b.width,b.height)),y.background!==null&&(a.transform(x.m11,x.m12,x.m21,x.m22,x.dx,x.dy),uo(y,a,y.background,!0,!1,z,b),a.fillRect(0,0,z.width/2,z.height/2),x.ws()||(y=1/(x.m11*x.m22-x.m12*x.m21),a.transform(x.m22*y,-x.m12*y,-x.m21*y,x.m11*y,y*(x.m21*x.dy-x.m22*x.dx),y*(x.m12*x.dx-x.m11*x.dy)))))),E&&(a.restore(),a.Vc(!0))}},yt.g=function(a,y,x,E,b){var z=this.diagram;z!==null&&z.cb(Yr,a,this,y,x,E,b)},yt.oi=function(a,y,x){var E=this.Pa;if(y.Ig=this,this===null&&ys(y),a>=E.count)a=E.count;else if(E.M(a)===y)return-1;return E.Gb(a,y),y.Vo(x),E=this.diagram,E!==null&&(x?E.N():E.oi(y)),ed(this,a,y),a},yt.pc=function(a,y,x){if(!x&&y.layer!==this&&y.layer!==null)return y.layer.pc(a,y,x);var E=this.Pa;if(0>a||a>=E.length){if(a=E.indexOf(y),0>a)return-1}else if(E.M(a)!==y&&(a=E.indexOf(y),0>a))return-1;return y.Wo(x),E.mb(a),E=this.diagram,E!==null&&(x?E.N():E.pc(y)),y.Ig=null,ys(y),a};function ed(a,y,x){if(y=Vg(a,y,x),x instanceof An&&x!==null&&isNaN(x.zOrder)){if(x.memberParts.count!==0){for(var E=-1,b=a.Pa.s,z=b.length,tt=0;tt<z;tt++){var it=b[tt];if(it===x&&(y=tt,0<=E)||0>E&&it.containingGroup===x&&(E=tt,0<=y))break}!(0>E)&&E<y&&(b=a.Pa,b.mb(y),b.Gb(E,x))}y=x.containingGroup,y!==null&&ed(a,-1,y)}x.svg!==null&&x.svg.remove()}function Vg(a,y,x){var E=x.zOrder;if(isNaN(E))return y;a=a.Pa;var b=a.count;if(1>=b)return y;if(0>y&&(y=a.indexOf(x)),0>y)return-1;for(var z=y-1,tt=NaN;0<=z&&(tt=a.M(z).zOrder,!!isNaN(tt));)z--;for(var it=y+1,nt=NaN;it<b&&(nt=a.M(it).zOrder,!!isNaN(nt));)it++;if(!isNaN(tt)&&tt>E)for(;;){if(z===-1||tt<=E){if(z++,z===y)break;return a.mb(y),a.Gb(z,x),z}for(tt=NaN;0<=--z&&(tt=a.M(z).zOrder,isNaN(tt)););}else if(!isNaN(nt)&&nt<E)for(;;){if(it===b||nt>=E){if(it--,it===y)break;return a.mb(y),a.Gb(it,x),it}for(nt=NaN;++it<b&&(nt=a.M(it).zOrder,isNaN(nt)););}return y}zi.Object.defineProperties(Yo.prototype,{parts:{get:function(){return this.Pa.iterator}},partsBackwards:{get:function(){return this.Pa.iteratorBackwards}},diagram:{get:function(){return this.H}},name:{get:function(){return this.xa},set:function(a){var y=this.xa;if(y!==a){var x=this.diagram;if(x!==null)for(y===""&&It("Cannot rename default Layer to: "+a),x=x.layers;x.next();)x.value.name===a&&It("Layer.name is already present in this diagram: "+a);for(this.xa=a,this.g("name",y,a),a=this.Pa.iterator;a.next();)a.value.layerName=this.xa}}},opacity:{get:function(){return this.pb},set:function(a){var y=this.pb;y!==a&&((0>a||1<a)&&xi(a,"0 <= value <= 1",Yo,"opacity"),this.pb=a,this.g("opacity",y,a),a=this.diagram,a!==null&&a.N())}},isTemporary:{get:function(){return this.o},set:function(a){var y=this.o;y!==a&&((this.o=a)&&(this.isInDocumentBounds=!1),this.g("isTemporary",y,a))}},visible:{get:function(){return this.u},set:function(a){var y=this.u;if(y!==a){for(this.u=a,this.g("visible",y,a),y=this.Pa.iterator;y.next();)y.value.Zb(a);a=this.diagram,a!==null&&a.N()}}},pickable:{get:function(){return this.Uh},set:function(a){var y=this.Uh;y!==a&&(this.Uh=a,this.g("pickable",y,a))}},isInDocumentBounds:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a,this.diagram!==null&&this.diagram.Ya())}},allowCopy:{get:function(){return this.Fi},set:function(a){var y=this.Fi;y!==a&&(this.Fi=a,this.g("allowCopy",y,a))}},allowDelete:{get:function(){return this.Gi},set:function(a){var y=this.Gi;y!==a&&(this.Gi=a,this.g("allowDelete",y,a))}},allowTextEdit:{get:function(){return this.Pi},set:function(a){var y=this.Pi;y!==a&&(this.Pi=a,this.g("allowTextEdit",y,a))}},allowGroup:{get:function(){return this.Hi},set:function(a){var y=this.Hi;y!==a&&(this.Hi=a,this.g("allowGroup",y,a))}},allowUngroup:{get:function(){return this.Qi},set:function(a){var y=this.Qi;y!==a&&(this.Qi=a,this.g("allowUngroup",y,a))}},allowLink:{get:function(){return this.Ii},set:function(a){var y=this.Ii;y!==a&&(this.Ii=a,this.g("allowLink",y,a))}},allowRelink:{get:function(){return this.Ki},set:function(a){var y=this.Ki;y!==a&&(this.Ki=a,this.g("allowRelink",y,a))}},allowMove:{get:function(){return this.Ji},set:function(a){var y=this.Ji;y!==a&&(this.Ji=a,this.g("allowMove",y,a))}},allowReshape:{get:function(){return this.Li},set:function(a){var y=this.Li;y!==a&&(this.Li=a,this.g("allowReshape",y,a))}},allowResize:{get:function(){return this.Mi},set:function(a){var y=this.Mi;y!==a&&(this.Mi=a,this.g("allowResize",y,a))}},allowRotate:{get:function(){return this.Ni},set:function(a){var y=this.Ni;y!==a&&(this.Ni=a,this.g("allowRotate",y,a))}},allowSelect:{get:function(){return this.Oi},set:function(a){var y=this.Oi;y!==a&&(this.Oi=a,this.g("allowSelect",y,a))}}}),Yo.prototype.findObjectsNear=Yo.prototype.og,Yo.prototype.findObjectsIn=Yo.prototype.Cf,Yo.prototype.findObjectsAt=Yo.prototype.ji,Yo.prototype.findObjectAt=Yo.prototype.ic,Yo.className="Layer";function le(a,y){if(ov||(vs(),ov=!0),bi(this),ru=this,this.vb=!0,this.Ka=null,this.ya=this.Aa=0,this.ta=null,lo){var x=this,E=function(){x.removeEventListener(Xe.document,"DOMContentLoaded",E,!1),x.setRTL()};Xe.document.body!==null?this.setRTL():x.addEventListener(Xe.document,"DOMContentLoaded",E,!1)}this.ol=null,fd.add("Model",Mr);var b=this;return this.Hb=function(z){var tt=b.partManager;if(z.model===tt.diagram.model&&tt.diagram.aa){tt.diagram.aa=!1;try{var it=z.change;z.modelChange===""&&it===Yr&&tt.updateDataBindings(z.object,z.propertyName)}finally{tt.diagram.aa=!0}}},this.Oc=function(z){b.partManager.doModelChanged(z)},this.hu=this.ku=null,Gg(this),this.model=cy(),this.Wg=!0,Yg(this),this.layout=new Gr,this.Wg=!1,this.ck=this.ek=this.fk=this.dk=this.ui=this.aA=this.$j=this.Ov=null,this.hk=function(){},this.preventDefault=null,this.rn=!1,this.Yf=new sv,a!==void 0&&(typeof a=="string"||Xe.Element&&a instanceof Element?fp(this,a):y=a),this.vb=!1,y&&this.nm(y),this}var jh,ru;function Gg(a){a.Yd=new pa,a.Yd.Xe(a),a.Db=17,a.Gw=!1,a.tn=!1,a.bu="default",a.Wa=new Me,a.pj=new ji,a.nl="default",a.Tx(),a.Sx(),a.pb=1,a.pa=new Pt(NaN,NaN).freeze(),a.du=new Pt(NaN,NaN),a.Ca=1,a.Pp=1,a.zt=new Pt(NaN,NaN).freeze(),a.At=NaN,a.Ot=1e-4,a.Mt=100,a.Ab=new bn,a.zu=new Pt(NaN,NaN).freeze(),a.ut=new be(NaN,NaN,NaN,NaN).freeze(),a.rj=new jn(0,0,0,0).freeze(),a.sj=nh,a.nu=!1,a.Zt=null,a.fu=null,a.yh=Cs,a.zk=Fi,a.Fg=Cs,a.pq=Fi,a.yt=qn,a.Bt=qn,a.Fc=!0,a.pn=!1,a.De=new _e,a.Eh=new ji,a.Xm=!0,a.vp=250,a.vk=-1,a.xp=new jn(16,16,16,16).freeze(),a.kg=!1,a.Jk=!1,a.fn=!0,a.bq=new ws,a.bq.diagram=a,a.Qg=new ws,a.Qg.diagram=a,a.cj=new ws,a.cj.diagram=a,a.zg=null,a.pf=null,a.qu=!1,i0(a),a.ai=new _e,a.Ht=!0,a.uu=rh,a.pw=!1,a.wu=vf,a.it="auto",a.Op="auto",a.zh=null,a.Fh=null,a.Bh=null,a.Qh=null,a.Oh=null,a.Nh=null,a.Qt=null,a.Lh=null,a.xt=!1,a.Mh=null,a.Ph=null,a.$h=null,a.Ch=null,a.Rt=!1,a.Yt={},a.oj=[null,null],a.Wg=!1,a.Iw=!1,a.ou=!1,a.lt=!1,a.rw=!0,a.ld=!1,a.$i=!1,a.Tw=!0,a.Ce=-2,a.Og=new ji,a.Xn=new Me,a.Gg=!1,a.Jd=!0,a.Us=!0,a.Fi=!0,a.Gi=!0,a.Vs=!1,a.Ws=!0,a.Pi=!0,a.Hi=!0,a.Qi=!0,a.Ys=!0,a.Ii=!0,a.Ki=!0,a.Ji=!0,a.Li=!0,a.Mi=!0,a.Ni=!0,a.Oi=!0,a.Zs=!0,a.at=!0,a.qw=!1,a.Vk=!1,a.mn=!0,a.nn=!0,a.Xs=!0,a.$s=!0,a.iu=16,a.mu=16,a.qr=!1,a.gu=!1,a.lu=0,a.ju=0,a.yb=new jn(5).freeze(),a.Hw=new _e().freeze(),a.Nt=999999999,a.nw=new _e().freeze(),a.Zi=!0,a.Ee=!0,a.vd=!0,a.Be=!1,a.gf=!1,a.xh=!0,a.hf=!1,a.sy=new _e,a.ow=new _e,a.Xh=null,a.aw=new li(8,8),a.bw=999,a.Bw=1,a.Jw=0,a.fc={scale:1,position:new Pt,bounds:new be,Py:new li,bA:new li,Oz:!1},a.fc.canvasSize=a.fc.Py,a.fc.newCanvasSize=a.fc.bA,a.fc.isScroll=!1,a.Rw=new be(NaN,NaN,NaN,NaN).freeze(),a.wo=new li(NaN,NaN).freeze(),a.Sp=new be(NaN,NaN,NaN,NaN).freeze(),a.It=!1,a.Lg=new ji;var y=new Ci,x=new Or;x.bind(new Co("text","",ki)),y.add(x),a.ny=y,a.Lg.add("",y),y=new Ci,x=new Or,x.stroke="brown",x.bind(new Co("text","",ki)),y.add(x),a.Lg.add("Comment",y),y=new Ci,y.selectable=!1,y.avoidable=!1,x=new Rn,x.figure="Ellipse",x.fill="black",x.stroke=null,x.desiredSize=new li(3,3).ja(),y.add(x),a.Lg.add("LinkLabel",y),a.Yi=new ji,y=new An,y.selectionObjectName="GROUPPANEL",y.type=si.Vertical,x=new Or,x.font="bold 12pt sans-serif",x.bind(new Co("text","",ki)),y.add(x),x=new si(si.Auto),x.name="GROUPPANEL";var E=new Rn;E.figure="Rectangle",E.fill="rgba(128,128,128,0.2)",E.stroke="black",x.add(E),E=new Rs,E.padding=new jn(5,5,5,5).ja(),x.add(E),y.add(x),a.ly=y,a.Yi.add("",y),a.Kh=new ji,y=new fi,x=new Rn,x.isPanelMain=!0,y.add(x),x=new Rn,x.toArrow="Standard",x.fill="black",x.stroke=null,x.strokeWidth=0,y.add(x),a.my=y,a.Kh.add("",y),y=new fi,x=new Rn,x.isPanelMain=!0,x.stroke="brown",y.add(x),a.Kh.add("Comment",y),y=new cr,y.type=si.Auto,x=new Rn,x.fill=null,x.stroke="dodgerblue",x.strokeWidth=3,y.add(x),x=new Rs,x.margin=new jn(1.5,1.5,1.5,1.5).ja(),y.add(x),a.St=y,a.wt=y,y=new cr,y.type=si.Link,x=new Rn,x.isPanelMain=!0,x.fill=null,x.stroke="dodgerblue",x.strokeWidth=3,y.add(x),a.Kt=y,a.fe=null,a.mq=!1,a.Ck=null,a.partManager=new Mr,a.toolManager=new Ur,a.toolManager.initializeStandardTools(),a.defaultTool=a.toolManager,a.currentTool=a.defaultTool,a.nt=null,a.Wm=new rt,a.Vt=null,a.Wt=null,a.Mr=!1,a.commandHandler=Ug(),a.eq=null,a.fq=Cr,a.Pw=!1,a.Mb=1,a.Yh=null,a.Oq=1,a.Sq=0,a.zw=[0,0,0,0,0],a.Tq=0,a.yq=1,a.tw=0,a.uw=new Pt,a.zy=500,a.wp=new Pt,a.wq=!1}le.prototype.clear=function(){this.animationManager.Cc(),this.model.clear(),Nc=null,Zh="",cp(this,!1),this.Xn.clear(),Ed(),this.Og.clear(),this.Xh=null,this.Ya(),this.Va(),this.N()};function cp(a,y){a.animationManager.Cc(!0),a.Hw=new _e().freeze(),a.nw=new _e().freeze();var x=a.skipsUndoManager,E=a.cc!==null&&a.cc!==void 0;E&&(a.skipsUndoManager=!0);var b=null;a.fe!==null&&(b=a.fe.part,b!==null&&a.remove(b));var z=[],tt=a.Wa.length;if(y){for(y=0;y<tt;y++)for(var it=a.Wa.s[y].parts;it.next();){var nt=it.value;nt!==b&&nt.data===null&&z.push(nt)}for(y=0;y<z.length;y++)a.remove(z[y])}for(y=0;y<tt;y++)a.Wa.s[y].clear();return a.partManager.clear(),a.De.clear(),a.Eh.clear(),a.ai.clear(),a.Ck=null,a.Xn.clear(),Ed(),a.Og.clear(),Kr=[],b!==null&&(a.add(b),a.partManager.parts.remove(b)),E&&(a.skipsUndoManager=x),z}function Ug(){return null}le.prototype.reset=function(){this.clear(),this.vb=!0,Gg(this),Vl(this),this.Wg=!0,Yg(this),this.layout=new Gr,this.Wg=!1,this.model=cy(),this.model.undoManager=new qr,this.vb=this.rn=!1,this.N()},le.prototype.setRTL=function(a){a=a===void 0?this.div:a,a===null&&(a=Xe.document.body);var y=Gn("div");y.dir="rtl",y.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;",y.textContent="A",a.appendChild(y);var x="reverse";0<y.scrollLeft?x="default":(y.scrollLeft=1,y.scrollLeft===0&&(x="negative")),a.removeChild(y),this.bu=x},le.prototype.setScrollWidth=function(a){a=a===void 0?this.div:a,a===null&&(a=Xe.document.body);var y=0;if(lo){var x=rv;y=jh,x===null&&(x=rv=Gn("p"),x.style.width="100%",x.style.height="200px",x.style.boxSizing="content-box",y=jh=Gn("div"),y.style.position="absolute",y.style.visibility="hidden",y.style.width="200px",y.style.height="150px",y.style.boxSizing="content-box",y.appendChild(x)),y.style.overflow="hidden",a.appendChild(y);var E=x.offsetWidth;y.style.overflow="scroll",x=x.offsetWidth,E===x&&(x=y.clientWidth),a.removeChild(y),y=E-x,y!==0||Sr||(y=11)}this.Db=y,this.Gw=!0},le.prototype.qb=function(a){a.classType===le&&(this.autoScale=a)},le.prototype.toString=function(a){a===void 0&&(a=0);var y="";if(this.div&&this.div.id&&(y=this.div.id),y='Diagram "'+y+'"',0>=a)return y;for(var x=this.Wa.iterator;x.next();)y+=`
|
|
`+x.value.toString(a-1);return y};function fp(a,y){if(lo){if(y!=null||It("Diagram setup requires an argument DIV."),a.Ka!==null&&It("Diagram has already completed setup."),typeof y=="string"?a.Ka=Xe.document.getElementById(y):y instanceof HTMLDivElement?a.Ka=y:It("No DIV or DIV id supplied: "+y),a.Ka===null&&It("Invalid DIV id; could not get element with id: "+y),a.Ka.H!==void 0&&It("Invalid div id; div already has a Diagram associated with it."),!a.ol&&Xe.ResizeObserver){var x=fn(function(){a.$b()},250);a.ol=new Xe.ResizeObserver(function(){x()}),a.ol.observe(a.Ka)}Xe.getComputedStyle(a.Ka,null).position==="static"&&(a.Ka.style.position="relative"),y=5;var E="rgba(2"+y+"5, 255, 255, 0)";y--,a.Ka.style["-webkit-tap-highlight-color"]=E,a.Ka.innerHTML="",a.Ka.H=a,a.Ka.goDiagram=a,a.Ka.go=Xe.go;var b=new nl(a);if(b.style!==void 0&&(b.style.position="absolute",b.style.top="0px",b.style.left="0px",Xe.getComputedStyle(a.Ka,null).getPropertyValue("direction")==="rtl"&&(a.tn=!0),b.style.zIndex="2",b.style.userSelect="none",b.style.MozUserSelect="none",b.style.touchAction="none",b.style.letterSpacing="normal !important",b.style.wordSpacing="normal !important"),a.ta=b,a.ib=b.context,E=a.ib,a.Mb=a.computePixelRatio(),a.viewSize.w()||(a.Aa=a.Ka.clientWidth||1,a.ya=a.Ka.clientHeight||1),wp(a,a.Aa,a.ya),a.Ka.insertBefore(b.Oa,a.Ka.firstChild),b=new nl(null),b.width=1,b.height=1,a.jw=b,a.oy=b.context,lo){b=Gn("div");var z=Gn("div");b.style.position="absolute",b.style.overflow="auto",b.style.width=a.Aa+"px",b.style.height=a.ya+"px",b.style.zIndex="1",z.style.position="absolute",z.style.width="1px",z.style.height="1px",a.Ka.appendChild(b),b.appendChild(z),b.onscroll=Jg,b.addEventListener("pointerdown",Qg),b.H=a,b.uy=!0,b.vy=!0,a.ku=b,a.hu=z}a.hk=fn(function(){a.Yh=null,a.N()},300),a.Ov=fn(function(){dp(a)},250),a.preventDefault=function(tt){return tt.preventDefault(),!1},a.$j=function(tt){if(a.isEnabled){var it=za(a,tt,!0);it.bubbles=!0;var nt=0,ot=0;it.delta=0,tt.deltaX!==void 0?(tt.deltaX!==0&&(nt=0<tt.deltaX?1:-1),tt.deltaY!==0&&(ot=0<tt.deltaY?1:-1),it.delta=Math.abs(tt.deltaX)>Math.abs(tt.deltaY)?-nt:-ot):tt.wheelDeltaX!==void 0?(tt.wheelDeltaX!==0&&(nt=0<tt.wheelDeltaX?-1:1),tt.wheelDeltaY!==0&&(ot=0<tt.wheelDeltaY?-1:1),it.delta=Math.abs(tt.wheelDeltaX)>Math.abs(tt.wheelDeltaY)?-nt:-ot):tt.wheelDelta!==void 0&&tt.wheelDelta!==0&&(it.delta=0<tt.wheelDelta?1:-1),a.doMouseWheel(),ml(it,tt)}},a.aA=function(tt){a.isEnabled&&(a.Vk=!1,za(a,tt,!0),tt=a.currentTool,tt.cancelWaitAfter(),tt.standardMouseOver())},a.ui=function(tt){if(a.isEnabled){a.Vk=!0;var it=a.Yt;it[tt.pointerId]===void 0&&(it[tt.pointerId]=tt),it=a.oj;var nt=!1;if(it[0]===null||it[0].pointerId!==tt.pointerId&&it[0].pointerType===tt.pointerType)if(it[1]!==null&&it[1].pointerId===tt.pointerId)it[1]=tt,nt=!0;else if(it[0]===null)it[0]=tt;else if(it[1]===null)it[1]=tt,nt=!0;else{tt.preventDefault();return}else it[0]=tt;(it=tt.pointerType==="touch"||tt.pointerType==="pen")&&(a.qu=!1,a.wq=!0);var ot=nt;nt=mp(a,tt,!0,!1,!0,ot),kc(a,tt,nt),nt.targetDiagram=vp(tt,tt.target),nt.targetObject=null,ot||nt.clone(a.bq),ot=a.uw,it=it?25:10,tt.timeStamp-a.tw<a.zy&&!(Math.abs(ot.x-tt.screenX)>it||Math.abs(ot.y-tt.screenY)>it)?a.yq++:a.yq=1,nt.clickCount=a.yq,a.tw=tt.timeStamp,a.uw.sg(tt.screenX,tt.screenY),a.doMouseDown(),tt.button===1?tt.preventDefault():ml(nt,tt)}},a.dk=function(tt){if(a.isEnabled){a.Vk=!0;var it=a.oj;if(it[0]===null||it[0].pointerId!==tt.pointerId&&it[0].pointerType===tt.pointerType){if(it[1]!==null&&it[1].pointerId===tt.pointerId){it[1]=tt;return}if(it[0]===null)it[0]=tt;else return}else it[0]=tt;if(it[0].pointerId===tt.pointerId){it=mp(a,tt,!1,!1,!1,it[1]!==null);var nt=Xe.document.elementFromPoint(tt.clientX,tt.clientY)||null;nt!==null&&nt.shadowRoot!==void 0&&nt.shadowRoot!==null&&(nt=nt.shadowRoot.elementFromPoint(tt.clientX,tt.clientY));var ot=a,st=tt;nt&&nt.H&&(st=tt,ot=nt.H),it.targetDiagram=ot,kc(a,st,it),it.targetObject=null,a.doMouseMove(),ml(it,tt)}}},a.fk=function(tt){if(a.isEnabled){a.Vk=!0;var it=tt.pointerType==="touch"||tt.pointerType==="pen",nt=a.Yt;if(it&&a.qu)delete nt[tt.pointerId],tt.preventDefault();else if(nt=a.oj,nt[0]===null||nt[0].pointerId!==tt.pointerId&&nt[0].pointerType===tt.pointerType)nt[1]!==null&&nt[1].pointerId===tt.pointerId&&(nt[1]=null);else{nt[0]=null,nt=mp(a,tt,!1,!0,!0,!1);var ot=Xe.document.elementFromPoint(tt.clientX,tt.clientY)||null;ot!==null&&ot.shadowRoot!==void 0&&ot.shadowRoot!==null&&(ot=ot.shadowRoot.elementFromPoint(tt.clientX,tt.clientY)),ot!==null&&ot.H instanceof le&&ot.H!==a&&kc(ot.H,tt,nt),ot===null&&(ot=tt.target),kc(a,tt,nt),nt.clickCount=a.yq,nt.targetDiagram=vp(tt,ot),nt.targetObject=null,a.doMouseUp(),ml(nt,tt),it&&(a.wq=!1)}}},a.ek=function(tt){if(a.isEnabled){a.Vk=!1;var it=a.Yt;it[tt.pointerId]&&delete it[tt.pointerId],it=a.oj,it[0]!==null&&it[0].pointerId===tt.pointerId&&(it[0]=null),it[1]!==null&&it[1].pointerId===tt.pointerId&&(it[1]=null),tt.pointerType!=="touch"&&tt.pointerType!=="pen"&&(tt=a.currentTool,tt.cancelWaitAfter(),tt.standardMouseOver())}},a.ck=function(tt){var it=a.oj;it[0]!==null&&it[0].pointerId===tt.pointerId?(it[0]=null,a.wq=!1):it[1]!==null&&it[1].pointerId===tt.pointerId&&(it[1]=null)},a.Vp=E.Z["d"+xf[1]+xf[2]+"wI"+Lc.slice(1,5)]["b"+jw.slice(1,y)](E.Z,yf,y,y),E.Vc(!0),e0(a),a.nl==="svg"&&(y=a.pj.get("svg"),a.Ka.appendChild(y.Oa),a.ib=y.context)}}le.prototype.addEventListener=function(a,y,x,E){a.addEventListener(y,x,{capture:E,passive:!1})},le.prototype.removeEventListener=function(a,y,x,E){a.removeEventListener(y,x,{capture:E})};function e0(a){var y=a.ta.Oa;y instanceof HTMLCanvasElement||(y=a.div),a.addEventListener(y,"pointerdown",a.ui,!1),a.addEventListener(y,"pointermove",a.dk,!1),a.addEventListener(y,"pointerup",a.fk,!1),a.addEventListener(y,"pointerout",a.ek,!1),a.addEventListener(y,"pointercancel",a.ck,!1),a.addEventListener(y,"pointerenter",a.bz,!1),a.addEventListener(y,"pointerleave",a.cz,!1),a.addEventListener(y,"wheel",a.$j,!1),a.addEventListener(y,"keydown",a.Qz,!1),a.addEventListener(y,"keyup",a.Rz,!1),a.addEventListener(y,"blur",a.Ny,!1),a.addEventListener(y,"focus",a.Oy,!1),a.addEventListener(y,"selectstart",function(x){return x.preventDefault(),!1},!1),a.addEventListener(y,"contextmenu",function(x){return x.preventDefault(),!1},!1),a.addEventListener(Xe,"resize",a.Ov,!1)}function Us(a){30<a.Sq&&(a.Yh=1)}function cf(a,y){a.Yh!==null&&(a.Yh=null,y&&a.hk(),Ke&&Ke.nx||(a.Sq=0,a.zw=[0,0,0,0,0],a.Tq=0))}le.prototype.computePixelRatio=function(){return this.Yh!==null?this.Yh:Xe.devicePixelRatio||1},le.prototype.doMouseMove=function(){this.currentTool.doMouseMove()},le.prototype.doMouseDown=function(){this.currentTool.doMouseDown()},le.prototype.doMouseUp=function(){this.currentTool.doMouseUp()},le.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()},le.prototype.doKeyDown=function(){this.currentTool.doKeyDown()},le.prototype.doKeyUp=function(){this.currentTool.doKeyUp()},le.prototype.doFocus=function(){this.focus()},le.prototype.focus=function(){if(this.ta)if(this.scrollsPageOnFocus)this.ta.focus();else{var a=Xe.scrollX||Xe.pageXOffset,y=Xe.scrollY||Xe.pageYOffset;this.ta.focus(),Xe.scrollTo(a,y)}},le.prototype.Oy=function(){this.H.R("GainedFocus")},le.prototype.Ny=function(){this.H.R("LostFocus")};function dp(a){if(a.ta!==null){var y=a.Ka;if(y!==null&&y.clientWidth!==0&&y.clientHeight!==0){a.Gw||a.setScrollWidth();var x=a.gf?a.Db:0,E=a.Be?a.Db:0,b=a.Mb;a.Mb=a.computePixelRatio(),a.Mb!==b&&(a.pn=!0,a.$b()),(y.clientWidth!==a.Aa+x||y.clientHeight!==a.ya+E)&&(a.Ee=!0,a.Fc=!0,y=a.layout,y!==null&&y.isViewportSized&&a.autoScale===Cs&&(a.Jk=!0,y.C()),a.ld||a.$b())}}}function Yg(a){var y=new Yo;y.name="Background",a.Al(y),y=new Yo,y.name="",a.Al(y),y=new Yo,y.name="Foreground",a.Al(y),y=new Yo,y.name="Adornment",y.isTemporary=!0,y.isInDocumentBounds=!1,a.Al(y),y=new Yo,y.name="Tool",y.isTemporary=!0,y.isInDocumentBounds=!0,a.Al(y),y=new Yo,y.name="Grid",y.allowSelect=!1,y.pickable=!1,y.isTemporary=!0,y.isInDocumentBounds=!1,a.Ww(y,a.Qj("Background"))}function Xg(a){var y=new si(si.Grid);y.name="GRID";var x=new Rn;return x.figure="LineH",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new Rn,x.figure="LineH",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new Rn,x.figure="LineH",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new Rn,x.figure="LineV",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new Rn,x.figure="LineV",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new Rn,x.figure="LineV",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new tn,x.add(y),x.layerName="Grid",x.zOrder=0,x.isInDocumentBounds=!1,x.isAnimated=!1,x.pickable=!1,x.locationObjectName="GRID",a.add(x),a.partManager.parts.remove(x),y.visible=!1,y}function Jg(){this.H.gu?this.H.gu=!1:this.H.isEnabled?this.H.kx(this):bc(this.H)}function Qg(a){this.H.isEnabled?(this.H.lu=a.target.scrollTop,this.H.ju=a.target.scrollLeft):bc(this.H)}le.prototype.kx=function(a){if(this.ta!==null){var y=this.ku,x=this.hu;this.qr=!0;var E=this.documentBounds,b=this.viewportBounds,z=this.rj,tt=E.x-z.left,it=E.y-z.top,nt=E.width+z.left+z.right,ot=E.height+z.top+z.bottom,st=E.right+z.right;z=E.bottom+z.bottom;var ut=b.x;E=b.y;var ct=b.width,dt=b.height,vt=b.right,xt=b.bottom;b=this.scale;var Tt=a.scrollLeft;if(this.tn)switch(this.bu){case"negative":Tt=Tt+a.scrollWidth-a.clientWidth;break;case"reverse":Tt=a.scrollWidth-Tt-a.clientWidth}var Et=Tt;ct<nt||dt<ot?(Tt=Pt.allocAt(this.position.x,this.position.y),this.allowHorizontalScroll&&this.ju!==Et&&(Tt.x=Et/b+tt,this.ju=Et),this.allowVerticalScroll&&this.lu!==a.scrollTop&&(Tt.y=a.scrollTop/b+it,this.lu=a.scrollTop),this.position=Tt,Pt.free(Tt),this.Ee=this.qr=!1):(Tt=Pt.alloc(),a.uy&&this.allowHorizontalScroll&&(tt<ut&&(this.position=Tt.h(Et+tt,this.position.y)),st>vt&&(this.position=Tt.h(-(y.scrollWidth-this.Aa)+Et-this.Aa/b+st,this.position.y))),a.vy&&this.allowVerticalScroll&&(it<E&&(this.position=Tt.h(this.position.x,a.scrollTop+it)),z>xt&&(this.position=Tt.h(this.position.x,-(y.scrollHeight-this.ya)+a.scrollTop-this.ya/b+z))),Pt.free(Tt),this.vd=!0,this.Ee=this.qr=!1,E=this.documentBounds,b=this.viewportBounds,st=E.right,vt=b.right,z=E.bottom,xt=b.bottom,tt=E.x,ut=b.x,it=E.y,E=b.y,ct>=nt&&tt>=ut&&st<=vt&&(x.style.width="1px"),dt>=ot&&it>=E&&z<=xt&&(x.style.height="1px"))}},le.prototype.computeBounds=function(a){return a===void 0&&(a=new be),hs(this),pp(this,a)};function pp(a,y){if(a.fixedBounds.w())return y.assign(a.fixedBounds),y.Co(a.yb),y;for(var x=!0,E=a.Wa.s,b=E.length,z=0;z<b;z++){var tt=E[z];if(tt.visible&&tt.isInDocumentBounds){tt=tt.Pa.s;for(var it=tt.length,nt=0;nt<it;nt++){var ot=tt[nt];ot.isInDocumentBounds&&ot.isVisible()&&(ot=ot.actualBounds,ot.w()&&(x?(x=!1,y.assign(ot)):y.ed(ot)))}}}return x&&y.h(0,0,0,0),y.Co(a.yb),y}le.prototype.computePartsBounds=function(a,y){y===void 0&&(y=!1);var x=null;if(Ti(a))for(var E=0;E<a.length;E++){var b=a[E];!y&&b instanceof fi||(b.Va(),x===null?x=b.actualBounds.copy():x.ed(b.actualBounds))}else for(a=a.iterator;a.next();)E=a.value,!y&&E instanceof fi||(E.Va(),x===null?x=E.actualBounds.copy():x.ed(E.actualBounds));return x===null?new be(NaN,NaN,0,0):x};function el(a,y){if((y||a.hf)&&!a.vb&&a.ta!==null&&a.documentBounds.w()){if(a.vb=!0,y){var x=a.initialPosition;if(x.w()){a.vb=!1,a.position=x;return}x=Pt.alloc(),x.xi(a.documentBounds,a.initialDocumentSpot);var E=a.viewportBounds;E=be.allocAt(0,0,E.width,E.height);var b=Pt.alloc();b.xi(E,a.initialViewportSpot),b.h(x.x-b.x,x.y-b.y),a.position=b,be.free(E),Pt.free(b),Pt.free(x)}x=a.yh,y&&a.Fg!==Cs&&(x=a.Fg);var z=x!==Cs?Cc(a,x):a.scale;x=a.pa.x,E=a.pa.y,b=a.Aa/z;var tt=a.ya/z,it=a.zk,nt=a.pq;y&&!it.sb()&&(nt.sb()||nt.Xb())&&(it=nt.Xb()?Hn:nt),gp(a,a.documentBounds,b,tt,it,y),y=a.scale,a.scale=z,a.vb=!1,z=a.viewportBounds,Gt.B(z.x,x)&&Gt.B(z.y,E)&&Gt.B(z.width,b)&&Gt.B(z.height,tt)||a.onViewportBoundsChanged(new be(x,E,b,tt),z,y,!1)}}function Cc(a,y){var x=a.Pp;if(a.ta===null)return x;a.Va();var E=a.documentBounds;if(!E.w())return x;var b=E.width;E=E.height;var z=a.Aa+(a.gf?a.Db:0),tt=a.ya+(a.Be?a.Db:0),it=z/b,nt=tt/E;return y===Pa?(y=Math.min(nt,it),y>x&&(y=x),y<a.minScale&&(y=a.minScale),y>a.maxScale&&(y=a.maxScale),y):y===Kh?(y=nt>it?(tt-a.Db)/E:(z-a.Db)/b,y>x&&(y=x),y<a.minScale&&(y=a.minScale),y>a.maxScale&&(y=a.maxScale),y):a.scale}le.prototype.zoomToFit=function(){var a=this.sj;this.sj=nh,this.scale=Cc(this,Pa),a!==nh&&(el(this,!1),gp(this,this.documentBounds,this.Aa/this.Ca,this.ya/this.Ca,this.zk,!1)),this.sj=a},yt=le.prototype,yt.BA=function(a,y){y===void 0&&(y=Pa);var x=a.width,E=a.height;if(!(x===0||E===0||isNaN(x)&&isNaN(E))){var b=1;if(y===Pa||y===Kh)if(isNaN(x))b=this.viewportBounds.height*this.scale/E;else if(isNaN(E))b=this.viewportBounds.width*this.scale/x;else{b=this.Aa;var z=this.ya;b=y===Kh?z/E>b/x?(z-(this.Be?this.Db:0))/E:(b-(this.gf?this.Db:0))/x:Math.min(z/E,b/x)}this.scale=b,this.position=new Pt(a.x,a.y)}},yt.Jy=function(a,y){this.Va();var x=this.documentBounds,E=this.viewportBounds;this.position=new Pt(x.x+(a.x*x.width+a.offsetX)-(y.x*E.width-y.offsetX),x.y+(a.y*x.height+a.offsetY)-(y.y*E.height-y.offsetY))},yt.zz=function(a){if(a instanceof Kt){this.eq=a;var y=Pt.alloc();this.fq=this.op(a.ga(qn,y)),Pt.free(y)}else this.eq=null,this.fq=Cr};function gp(a,y,x,E,b,z){var tt=Pt.allocAt(a.pa.x,a.pa.y),it=tt.x,nt=tt.y;if(a.eq!==null){var ot=Pt.alloc();ot=a.eq.ga(qn,ot),it=ot.x-a.fq.x/a.scale,nt=ot.y-a.fq.y/a.scale,b=Jn,Pt.free(ot)}(z||a.scrollMode===nh)&&(b.sb()&&(x>y.width&&(it=y.x+(b.x*y.width+b.offsetX)-(b.x*x-b.offsetX)),E>y.height&&(nt=y.y+(b.y*y.height+b.offsetY)-(b.y*E-b.offsetY))),b=a.rj,z=x-y.width,x<y.width+b.left+b.right?(it=Math.min(it+x/2,y.right+Math.max(z,b.right)-x/2),it=Math.max(it,y.left-Math.max(z,b.left)+x/2),it-=x/2):it>y.left?it=y.left:it<y.right-x&&(it=y.right-x),x=E-y.height,E<y.height+b.top+b.bottom?(nt=Math.min(nt+E/2,y.bottom+Math.max(x,b.bottom)-E/2),nt=Math.max(nt,y.top-Math.max(x,b.top)+E/2),nt-=E/2):nt>y.top?nt=y.top:nt<y.bottom-E&&(nt=y.bottom-E)),tt.x=isFinite(it)?it:-a.yb.left,tt.y=isFinite(nt)?nt:-a.yb.top,a.positionComputation!==null&&(y=a.positionComputation(a,tt),tt.x=y.x,tt.y=y.y),Hg(a.Yd,a.pa,tt),a.pa.h(tt.x,tt.y),Vl(a),Pt.free(tt)}yt.Ol=function(a,y){if(y===void 0&&(y=!0),y){if(a=ou(this,a,function(x){return x.part},function(x){return x.canSelect()}),a instanceof tn)return a}else if(a=ou(this,a,function(x){return x.part}),a instanceof tn)return a;return null},yt.ic=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null),hs(this);for(var E=this.Wa.iteratorBackwards;E.next();){var b=E.value;if(b.visible&&(b=b.ic(a,y,x),b!==null))return b}return null};function ou(a,y,x,E){for(x===void 0&&(x=null),E===void 0&&(E=null),hs(a),a=a.Wa.iteratorBackwards;a.next();){var b=a.value;if(b.visible&&!b.isTemporary&&(b=b.ic(y,x,E),b!==null))return b}return null}yt.lz=function(a,y,x){return y===void 0&&(y=!0),ff(this,a,function(E){return E.part},y?function(E){return E instanceof tn&&E.canSelect()}:null,x)};function ff(a,y,x,E,b){for(x===void 0&&(x=null),E===void 0&&(E=null),b instanceof Me||b instanceof _e||(b=new _e),hs(a),a=a.Wa.iteratorBackwards;a.next();){var z=a.value;z.visible&&!z.isTemporary&&z.ji(y,x,E,b)}return b}yt.ji=function(a,y,x,E){y===void 0&&(y=null),x===void 0&&(x=null),E instanceof Me||E instanceof _e||(E=new _e),hs(this);for(var b=this.Wa.iteratorBackwards;b.next();){var z=b.value;z.visible&&z.ji(a,y,x,E)}return E},yt.ux=function(a,y,x,E){return y===void 0&&(y=!1),x===void 0&&(x=!0),id(this,a,function(b){return b instanceof tn&&(!x||b.canSelect())},y,E)},yt.Cf=function(a,y,x,E,b){y===void 0&&(y=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof Me||b instanceof _e||(b=new _e),hs(this);for(var z=this.Wa.iteratorBackwards;z.next();){var tt=z.value;tt.visible&&tt.Cf(a,y,x,E,b)}return b},yt.Nu=function(a,y,x,E,b,z){var tt=new _e;hs(this);for(var it=this.Wa.iteratorBackwards;it.next();){var nt=it.value;nt.visible&&nt.Nu(a,y,x,E,tt,b,z)}return tt};function id(a,y,x,E,b){var z=null;for(z===void 0&&(z=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof Me||b instanceof _e||(b=new _e),hs(a),a=a.Wa.iteratorBackwards;a.next();){var tt=a.value;tt.visible&&!tt.isTemporary&&tt.Cf(y,z,x,E,b)}return b}yt.mz=function(a,y,x,E,b){return x===void 0&&(x=!0),E===void 0&&(E=!0),df(this,a,y,function(z){return z instanceof tn&&(!E||z.canSelect())},x,b)},yt.og=function(a,y,x,E,b,z){x===void 0&&(x=null),E===void 0&&(E=null),b===void 0&&(b=!0),b!==!1&&b!==!0&&((b instanceof Me||b instanceof _e)&&(z=b),b=!0),z instanceof Me||z instanceof _e||(z=new _e),hs(this);for(var tt=this.Wa.iteratorBackwards;tt.next();){var it=tt.value;it.visible&&it.og(a,y,x,E,b,z)}return z};function df(a,y,x,E,b,z){var tt=null;for(tt===void 0&&(tt=null),E===void 0&&(E=null),b===void 0&&(b=!0),b!==!1&&b!==!0&&((b instanceof Me||b instanceof _e)&&(z=b),b=!0),z instanceof Me||z instanceof _e||(z=new _e),hs(a),a=a.Wa.iteratorBackwards;a.next();){var it=a.value;it.visible&&!it.isTemporary&&it.og(y,x,tt,E,b,z)}return z}le.prototype.acceptEvent=function(a){return za(this,a,a instanceof MouseEvent)};function za(a,y,x){var E=a.Qg;return a.Qg=a.cj,a.cj=E,E.diagram=a,E.event=y,x?kc(a,y,E):(E.viewPoint=a.Qg.viewPoint,E.documentPoint=a.Qg.documentPoint),a=0,y.ctrlKey&&(a+=1),y.altKey&&(a+=2),y.shiftKey&&(a+=4),y.metaKey&&(a+=8),E.modifiers=a,E.button=y.button,y.buttons!==void 0&&(E.buttons=y.buttons),Sr&&y.button===0&&y.ctrlKey&&(E.button=2),E.down=!1,E.up=!1,E.clickCount=1,E.delta=0,E.handled=!1,E.bubbles=!1,E.timestamp=y.timeStamp,E.isMultiTouch=!1,E.targetDiagram=vp(y,y.target),E.targetObject=null,E}function vp(a,y){return y===null?null:(y=y.H)?y:((y=a.path)||typeof a.composedPath!="function"||(y=a.composedPath()),y&&y[0]&&y[0].H?y[0].H:null)}function mp(a,y,x,E,b,z){var tt=a.Qg;return a.Qg=a.cj,a.cj=tt,tt.diagram=a,tt.clickCount=1,a=tt.delta=0,y.ctrlKey&&(a+=1),y.altKey&&(a+=2),y.shiftKey&&(a+=4),y.metaKey&&(a+=8),tt.modifiers=a,tt.event=y,tt.timestamp=y.timeStamp,tt.button=y.button,tt.buttons=y.buttons,Sr&&y.button===0&&y.ctrlKey&&(tt.button=2),tt.down=x,tt.up=E,tt.handled=!1,tt.bubbles=b,tt.isMultiTouch=z,tt}function ml(a,y){return a.bubbles?!0:(y.stopPropagation!==void 0&&y.stopPropagation(),y.cancelable!==!1&&y.preventDefault(),y.cancelBubble=!0,!1)}le.prototype.Qz=function(a){var y=this.H;if(!this.H.isEnabled)return!1;var x=za(y,a,!1);switch(x.key=String.fromCharCode(a.which),x.down=!0,a.which){case 8:x.key="Backspace";break;case 33:x.key="PageUp";break;case 34:x.key="PageDown";break;case 35:x.key="End";break;case 36:x.key="Home";break;case 37:x.key="Left";break;case 38:x.key="Up";break;case 39:x.key="Right";break;case 40:x.key="Down";break;case 45:x.key="Insert";break;case 46:x.key="Del";break;case 48:x.key="0";break;case 187:case 61:case 107:x.key="Add";break;case 189:case 173:case 109:x.key="Subtract";break;case 27:x.key="Esc"}return y.doKeyDown(),ml(x,a)},le.prototype.Rz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=za(y,a,!1);switch(x.key=String.fromCharCode(a.which),x.up=!0,a.which){case 8:x.key="Backspace";break;case 33:x.key="PageUp";break;case 34:x.key="PageDown";break;case 35:x.key="End";break;case 36:x.key="Home";break;case 37:x.key="Left";break;case 38:x.key="Up";break;case 39:x.key="Right";break;case 40:x.key="Down";break;case 45:x.key="Insert";break;case 46:x.key="Del"}return y.doKeyUp(),ml(x,a)},le.prototype.bz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=za(y,a,!0);return y.mouseEnter!==null&&y.mouseEnter(x),y.currentTool.standardMouseOver(),ml(x,a)},le.prototype.cz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=za(y,a,!0);return y.mouseLeave!==null&&y.mouseLeave(x),ml(x,a)},le.prototype.getMouse=function(a){var y=this.ta;if(y===null)return new Pt(0,0);var x=y.getBoundingClientRect();return y=a.clientX-this.Aa/x.width*x.left,a=a.clientY-this.ya/x.height*x.top,this.Ab!==null?Gi(new Pt(y,a),this.Ab):new Pt(y,a)};function kc(a,y,x){var E=a.ta,b=a.Aa,z=a.ya,tt=0,it=0;E!==null&&(E=E.getBoundingClientRect(),tt=y.clientX-b/E.width*E.left,it=y.clientY-z/E.height*E.top),x.viewPoint.h(tt,it),a.Ab!==null?(y=Pt.allocAt(tt,it),a.Ab.Cd(y),x.documentPoint.assign(y),Pt.free(y)):x.documentPoint.h(tt,it)}function yp(a,y,x){if(a.oj[0]!==null){y=a.oj[y];var E=a.ta;E!==null&&(E=E.getBoundingClientRect(),x.h(y.clientX-a.Aa/E.width*E.left,y.clientY-a.ya/E.height*E.top))}}le.prototype.Ya=function(){this.Zi||(this.Zi=!0,this.$b(!1))};function $g(a){a.ld||hs(a),a.Va()}le.prototype.redraw=function(){this.vb||this.ld||(this.N(),this.bd())},yt=le.prototype,yt.Pz=function(){return this.kg},yt.Xy=function(a){a===void 0&&(a=null);var y=this.animationManager,x=y.isEnabled;y.Cc(),y.isEnabled=!1,_a(this),this.hf=!1,this.du=new Pt(NaN,NaN),y.isEnabled=x,this.ld=!0;var E=this;a!==null&&On(function(){E.ld=!1,nu(y,"Model"),a(E)},1)},yt.$b=function(a){if(a===void 0&&(a=!1),this.kg!==!0&&!(this.vb||a===!1&&this.ld)){this.kg=!0;var y=this;Xe.requestAnimationFrame(function(){y.kg&&y.bd()})}},yt.bd=function(){(!this.fn||this.kg)&&(this.fn&&(this.fn=!1),_a(this))};function zh(a,y,x){!a.Ee||a.vb||a.animationManager.defaultAnimation.isAnimating||bc(a)||(y&&hs(a),x&&el(a,!1))}function _a(a,y){if(!a.ld&&(a.kg=!1,a.Ka!==null||a.wo.w())){a.ld=!0;var x=a.animationManager,E=a.Xn;if(!x.isAnimating&&E.length!==0){for(var b=E.s,z=b.length,tt=0;tt<z;tt++){var it=b[tt];No(it,!1),it.v()}E.clear()}E=a.ow,0<E.count&&(E.each(function(nt){nt.Nv()}),E.clear()),b=E=!1,x.defaultAnimation.isAnimating&&(b=!0,E=a.skipsUndoManager,a.skipsUndoManager=!0),x.zb||dp(a),zh(a,!1,!0),a.fe!==null&&(a.fe.visible&&!a.mq&&(Kl(a),a.mq=!0),!a.fe.visible&&a.mq&&(a.mq=!1)),hs(a),z=!1,(!a.hf||a.xh)&&(a.hf?Np(a,!a.Jk):(a.Ea("Initial Layout"),x.isEnabled===!1&&x.Cc(),Np(a,!1)),z=!0),a.Jk=!1,hs(a),a.ou||$g(a),zh(a,!0,!1),tt=!1,z?(x=be.alloc(),x.assign(a.viewportBounds),a.hf||(tt=a.hf=!0,a.skipsUndoManager||(a.undoManager.isPendingClear=!0),a.undoManager.isPendingUnmodified=!0,xp(a)),a.R("LayoutCompleted"),zh(a,!0,!1),be.free(x)):x.Ok&&x.Qw&&(a.Fg!==Cs?a.scale=Cc(a,a.Fg):a.yh!==Cs?a.scale=Cc(a,a.yh):(x=a.initialScale,isFinite(x)&&0<x&&(a.scale=x)),el(a,!0)),z&&tt&&a.eb("Initial Layout"),hs(a),y||a.gc(a.ib),b&&(a.skipsUndoManager=E),a.ld=!1}}function xp(a){if(a.Fg!==Cs)a.scale=Cc(a,a.Fg);else if(a.yh!==Cs)a.scale=Cc(a,a.yh);else{var y=a.initialScale;isFinite(y)&&0<y&&(a.scale=y)}el(a,!0),y=a.Wa.s,a.Fd(y,y.length,a,a.viewportBounds),a.R("InitialLayoutCompleted"),a.du.assign(a.pa),Kl(a)}function hs(a){if(a.De.count!==0&&(a.ld||!a.animationManager.isTicking)){for(var y=0;23>y;y++){var x=a.De.iterator;if(x===null||a.De.count===0)break;a.De=new _e,a.Nv(x,a.De)}a.nodes.each(function(E){E instanceof An&&E.U&65536&&(E.U=E.U^65536)})}}yt.Nv=function(a,y){for(a.reset();a.next();){var x=a.value;!x.Zc()||x instanceof An||(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))}for(a.reset();a.next();)x=a.value,x instanceof An&&x.isVisible()&&pf(this,x);for(a.reset();a.next();)x=a.value,x instanceof fi&&x.isVisible()&&(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x));for(a.reset();a.next();)x=a.value,x instanceof cr&&x.isVisible()&&(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))};function pf(a,y){for(var x=ii(),E=ii(),b=y.memberParts;b.next();){var z=b.value;z.isVisible()&&(z instanceof An?(Ta(z)||Os(z)||Gh(z))&&pf(a,z):z instanceof fi?z.fromNode===y||z.toNode===y?E.push(z):x.push(z):(z.measure(1/0,1/0),z.arrange()))}for(a=x.length,b=0;b<a;b++)z=x[b],z.measure(1/0,1/0),z.arrange();for(Hi(x),y.measure(1/0,1/0),y.arrange(),a=E.length,y=0;y<a;y++)x=E[y],x.measure(1/0,1/0),x.arrange();Hi(E)}yt.Fd=function(a,y,x,E){if(this.vd||this.animationManager.isAnimating)for(var b=0;b<y;b++)a[b].Fd(x,E)},yt.gc=function(a){if(this.Ka!==null){if(this.ta===null&&It("No canvas specified"),this.nl==="svg"){if(this.Ka!==null){var y=this.animationManager;if(!y.zb&&(!y.isAnimating||y.isTicking)){Ec(this);var x=this.Aa,E=this.ya;if(a.Gv.resize(x,E,x,E),x=this.Wa.s,E=x.length,this.Fd(x,E,this,this.viewportBounds),this.Fc||y.isAnimating){y=this.pa;var b=this.Ca,z=Math.round(y.x*b)/b,tt=Math.round(y.y*b)/b,it=this.Ab;for(it.reset(),b!==1&&it.scale(b),y.x===0&&y.y===0||it.translate(-z,-tt),a.ti=null,Jy(a,it.m11,it.m12,it.m21,it.m22,it.dx,it.dy),this.pb!==1&&(a.globalAlpha=this.pb),eh(this,a),y=this.Mb,this.ta.context.setTransform(y,0,0,y,0,0),this.ta.context.clearRect(0,0,this.Aa,this.ya),y=0;y<E;y++)x[y].gc(a,this);a=!1,this.Yf?Ac(this.Yf,this)&&(a=this.Vp()):a=!0,a&&(bn.prototype.Cd=bn.prototype.Eu),this.Fc=this.vd=!1}}}}else t:if(z=this.animationManager,!z.zb&&(!z.isAnimating||z.isTicking)&&(x=new Date,Ec(this),this.Ka.style.opacity!=="0")){if(E=a!==this.ib,y=this.Wa.s,b=y.length,this.Fd(y,b,this,this.viewportBounds),E)a.Vc(!0),this.vd=!0;else if(!this.Fc&&!z.isAnimating)break t;z=this.Ab,z.reset(),tt=this.Mb,it=this.pa;var nt=this.Ca,ot=Math.round(it.x*nt)/nt,st=Math.round(it.y*nt)/nt;for(nt!==1&&z.scale(nt),it.x===0&&it.y===0||z.translate(-ot,-st),a.setTransform(tt,0,0,tt,0,0),a.clearRect(0,0,this.Aa,this.ya),this.pb!==1&&(a.globalAlpha=this.pb),eh(this,a),it=0;it<b;it++)a.setTransform(tt,0,0,tt,0,0),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),a.yc(),y[it].gc(a,this);if(y=!1,this.Yf?Ac(this.Yf,this)&&(y=this.Vp()):y=!0,y&&(bn.prototype.Cd=bn.prototype.Eu),E?(this.ib.Vc(!0),this.vd=!0):this.Fc=this.vd=!1,y=+new Date-+x,E=Ke&&Ke.nx,x=this.zw,E||this.Yh===null){for(x[this.Tq]=y,this.Tq=(this.Tq+1)%x.length,b=y=0;b<x.length;b++)y+=x[b];this.Sq=y/x.length}if(this.pb!==1&&(a.globalAlpha=1),E)for(a.setTransform(1,0,0,1,0,0),E=0;E<x.length;E++)a.fillText(x[E].toString(),20,150+ +(20*E))}}};function nd(a,y,x,E,b,z,tt,it,nt,ot){if(a.Ka!==null){a.ta===null&&It("No canvas specified"),tt===void 0&&(tt=null),it===void 0&&(it=null),nt===void 0&&(nt=!1),ot===void 0&&(ot=!1),Ec(a),a.ib.Vc(!0),a.vd=!0,a.$i=!0;var st=a.Ca;a.Ca=b;var ut=a.Wa.s,ct=ut.length;try{var dt=new be(z.x,z.y,E.width/b,E.height/b),vt=dt.copy();vt.Co(x),Kl(a,vt),hs(a),a.Fd(ut,ct,a,dt),y.setTransform(1,0,0,1,0,0),y.clearRect(0,0,E.width,E.height),it!==null&&it!==""&&(y.fillStyle=it,y.ox(0,0,E.width,E.height));var xt=a.Mb;y.scale(xt,xt);var Tt=bn.alloc();Tt.reset(),Tt.translate(x.left,x.top),Tt.scale(b),z.x===0&&z.y===0||Tt.translate(-z.x,-z.y),y.setTransform(Tt.m11,Tt.m12,Tt.m21,Tt.m22,Tt.dx,Tt.dy),y.yc(),y instanceof ga&&Jy(y,Tt.m11,Tt.m12,Tt.m21,Tt.m22,Tt.dx,Tt.dy),bn.free(Tt),eh(a,y),y.globalAlpha=a.pb;var Et=a.Qj("Grid");if(tt){var Ft=new _e,Ot=tt.iterator;for(Ot.reset();Ot.next();){var Rt=Ot.value;Rt instanceof tn&&(ot||Rt.layer!==Et)&&(Rt.Gj(),Ft.add(Rt))}for(ot=0;ot<ct;ot++)Kg(ut[ot],y,a,Ft,nt);Ft.each(function(ae){return ae.Gj()})}else for(Ft=0;Ft<ct;Ft++){var Ht=ut[Ft];Ht===Et?ot&&Ht.gc(y,a,!0):Ht.gc(y,a,nt)}a.$i=!1,a.Yf&&Ac(a.Yf,a)&&a.Vp()}finally{a.Ca=st,a.ib.Vc(!0),a.vd=!0,a.Fd(ut,ct,a,a.viewportBounds),Kl(a),a.ib instanceof ga&&(a.ib.Nj.PA(),a.redraw())}}}yt.Gf=function(a){return this.Rg[a]},yt.Xx=function(a,y){a==="minDrawingLength"&&(this.Oq=y),this.Rg[a]=y,this.redraw()},yt.Tx=function(){this.Rg=new Sn,this.Rg.drawShadows=!0,this.Rg.textGreeking=!0,this.Rg.viewportOptimizations=!(Sr||rr),this.Rg.temporaryPixelRatio=!0,this.Rg.pictureRatioOptimization=!0,this.Oq=this.Rg.minDrawingLength=1};function eh(a,y){a=a.Rg,a!==null&&(a.imageSmoothingEnabled!==void 0&&y.Wx(!!a.imageSmoothingEnabled),a=a.defaultFont,a!=null&&(y.font=a))}yt.Ql=function(a){return this.on[a]},yt.sA=function(a,y){this.on[a]=y},yt.Sx=function(){this.on=new Sn,this.on.extraTouchArea=10,this.on.extraTouchThreshold=10,this.on.hasGestureZoom=!0},yt.set=function(a){return Object.assign(this,a),this},yt.Du=function(a){return this.nm(a)},yt.nm=function(a){return Mc(this,a),this};function Mc(a,y){var x=a instanceof si,E=a instanceof le,b;for(b in y){b===""&&It("Setting properties requires non-empty property names");var z=a,tt=b;if(x||E){var it=b.indexOf(".");if(0<it){var nt=b.substring(0,it);x?z=a.fb(nt):(z=a[nt],z==null&&(z=a.toolManager[nt])),Oe(z)?tt=b.substr(it+1):It("Unable to find object named: "+nt+" in "+a.toString()+" when trying to set property: "+b)}}if(tt[0]!=="_"&&!En(z,tt))if(E&&tt==="ModelChanged"){a.Yw(y[tt]);continue}else if(E&&tt==="Changed"){a.Pe(y[tt]);continue}else if(E&&En(a.toolManager,tt))z=a.toolManager;else if(E&&ev(a,tt)){a.Bj(tt,y[tt]);continue}else if(a instanceof Ji&&tt==="Changed"){a.Pe(y[tt]);continue}else It('Trying to set undefined property "'+tt+'" on object: '+z.toString());z[tt]=y[b],tt[0]==="_"&&z instanceof Kt&&z.Vw(tt)}}yt.bx=function(){if(this.Eh.count!==0&&!(1<this.undoManager.transactionLevel)){for(;0<this.Eh.count;){var a=this.Eh;for(this.Eh=new ji,a=a.iterator;a.next();){var y=a.key;y.Xo(a.value),y.qc()}}this.N()}},yt.N=function(a){if(a===void 0)this.Fc=!0,this.$b();else{var y=this.viewportBounds;a.w()&&y.Yc(a)&&(this.Fc=!0,this.$b())}this.R("InvalidateDraw")},le.prototype.invalidateViewport=function(a,y){if(this.Fc!==!0)if(this.Fc=!0,this.nl==="svg")this.bd();else{var x=this.Gf("temporaryPixelRatio")===!0;if(this.Gf("viewportOptimizations")===!0&&this.scrollMode!==mf&&this.rj.hi(0,0,0,0)&&y.width===a.width&&y.height===a.height){var E=this.scale,b=Math.max(a.y,y.y),z=Math.min(a.y+a.height,y.y+y.height);if(0<Math.max(0,Math.min(a.x+a.width,y.x+y.width)-Math.max(a.x,y.x))*E&&0<Math.max(0,z-b)*E){if(!(this.ld||(this.kg=!1,this.Ka===null||(this.ld=!0,this.documentBounds.w()||(E=be.alloc(),Pp(this,this.computeBounds(E)),be.free(E)),E=this.ta,E===null||E instanceof Gl)))){var tt=this.Mb;b=this.Aa*tt;var it=this.ya*tt,nt=this.scale*tt;z=Math.round(Math.round(y.x*nt)-Math.round(a.x*nt)),y=Math.round(Math.round(y.y*nt)-Math.round(a.y*nt)),nt=this.jw,a=this.oy,nt.width!==b&&(nt.width=b),nt.height!==it&&(nt.height=it),a.clearRect(0,0,b,it),nt=190*tt;var ot=70*tt,st=Math.max(z,0),ut=Math.max(y,0),ct=Math.floor(b-st),dt=Math.floor(it-ut);a.drawImage(E.Oa,st,ut,ct,dt,0,0,ct,dt),Ac(this.Yf,this)&&a.clearRect(0,0,nt,ot),E=ii(),a=ii(),dt=Math.abs(z),ct=Math.abs(y);var vt=st===0?0:b-dt;st=Pt.allocAt(vt,0),dt=Pt.allocAt(dt+vt,it),a.push(new be(Math.min(st.x,dt.x),Math.min(st.y,dt.y),Math.abs(st.x-dt.x),Math.abs(st.y-dt.y)));var xt=this.Ab;if(xt.reset(),xt.scale(tt,tt),this.Ca!==1&&xt.scale(this.Ca),tt=this.pa,(tt.x!==0||tt.y!==0)&&isFinite(tt.x)&&isFinite(tt.y)&&xt.translate(-tt.x,-tt.y),Gi(st,xt),Gi(dt,xt),E.push(new be(Math.min(st.x,dt.x),Math.min(st.y,dt.y),Math.abs(st.x-dt.x),Math.abs(st.y-dt.y))),vt=ut===0?0:it-ct,st.h(0,vt),dt.h(b,ct+vt),a.push(new be(Math.min(st.x,dt.x),Math.min(st.y,dt.y),Math.abs(st.x-dt.x),Math.abs(st.y-dt.y))),Gi(st,xt),Gi(dt,xt),E.push(new be(Math.min(st.x,dt.x),Math.min(st.y,dt.y),Math.abs(st.x-dt.x),Math.abs(st.y-dt.y))),Ac(this.Yf,this)&&(b=0<z?0:-z,it=0<y?0:-y,st.h(b,it),dt.h(nt+b,ot+it),a.push(new be(Math.min(st.x,dt.x),Math.min(st.y,dt.y),Math.abs(st.x-dt.x),Math.abs(st.y-dt.y))),Gi(st,xt),Gi(dt,xt),E.push(new be(Math.min(st.x,dt.x),Math.min(st.y,dt.y),Math.abs(st.x-dt.x),Math.abs(st.y-dt.y)))),Pt.free(st),Pt.free(dt),zh(this,!1,!0),this.Ka===null&&It("No div specified"),this.ta===null&&It("No canvas specified"),!this.animationManager.zb&&(b=this.ib,this.Fc)){for(Ec(this),it=this.Mb,b.setTransform(1,0,0,1,0,0),b.clearRect(0,0,this.Aa*it,this.ya*it),b.drawImage(this.jw.Oa,0<z?0:Math.round(-z),0<y?0:Math.round(-y)),z=this.pa,tt=this.Ca,nt=Math.round(z.x*tt)/tt,ot=Math.round(z.y*tt)/tt,y=this.Ab,y.reset(),tt!==1&&y.scale(tt),z.x===0&&z.y===0||y.translate(-nt,-ot),b.save(),b.beginPath(),z=a.length,tt=0;tt<z;tt++)nt=a[tt],nt.width!==0&&nt.height!==0&&b.rect(Math.floor(nt.x),Math.floor(nt.y),Math.ceil(nt.width),Math.ceil(nt.height));for(b.clip(),b.setTransform(it,0,0,it,0,0),b.transform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy),b.yc(),y=this.Wa.s,z=y.length,this.Fd(y,z,this,this.viewportBounds),eh(this,b),b.globalAlpha=this.pb,it=0;it<z;it++)if(tt=y[it],nt=E,tt.visible&&tt.pb!==0){ot=Pu(tt,b),ut=tt.Zq,ut.length=0,st=this.scale,ct=be.alloc(),dt=tt.Pa.s,xt=dt.length,vt=nt.length;for(var Tt=0;Tt<xt;Tt++){var Et=dt[Tt],Ft=jc(Et,Et.actualBounds);t:{for(var Ot=2/st,Rt=4/st,Ht=0;Ht<vt;Ht++){var ae=nt[Ht];if(ae.width!==0&&ae.height!==0&&Ft.Vu(ae.x-Ot,ae.y-Ot,ae.width+Rt,ae.height+Rt)){Ft=!0;break t}}Ft=!1}Ft&&tt.Oj(b,Et,this,ut,st,ct,!0)}be.free(ct),b.globalAlpha=ot}b.restore(),b.Vc(!0),this.Yf&&Ac(this.Yf,this)&&this.Vp(),this.Fc=this.vd=!1,this.hk()}Hi(E),Hi(a),this.ld=!1}}else this.bd();x&&(Us(this),this.bd(),cf(this,!0))}else x?(Us(this),this.bd(),cf(this,!0)):this.bd()}};function Ec(a){a.pn!==!1&&(a.pn=!1,wp(a,a.Aa,a.ya))}function wp(a,y,x){Vl(a);var E=a.Mb;a.ta.resize(y*E,x*E,y,x)&&(a.Fc=!0,a.ib.Vc(!0))}function bc(a){var y=a.ta;if(y===null||a.wo.w())return!0;var x=a.Aa,E=a.ya,b=a.Ka,z=!1,tt=a.gf?a.Db:0,it=a.Be?a.Db:0,nt=b.clientWidth||x+tt,ot=b.clientHeight||E+it,st=a.viewportBounds;b=st.x;var ut=st.y,ct=st.width,dt=st.height;if((nt!==x+tt||ot!==E+it)&&(a.gf=!1,a.Be=!1,it=tt=0,a.Aa=nt,a.ya=ot,z=a.pn=!0,Vl(a)),!a.hf||!a.viewportBounds.w())return!0;var vt=a.ku,xt=a.hu;if(a.Ee=!1,!(z||a.gf||a.Be||a.mn||a.nn))return!0;var Tt=a.documentBounds,Et=0,Ft=0,Ot=0,Rt=0,Ht=st.width,ae=st.height,wi=a.rj;a.contentAlignment.sb()?(Tt.width>Ht&&(Et=wi.left,Ft=wi.right),Tt.height>ae&&(Ot=wi.top,Rt=wi.bottom)):(Et=wi.left,Ft=wi.right,Ot=wi.top,Rt=wi.bottom);var Ki=Tt.width+Et+Ft,Ii=Tt.height+Ot+Rt;wi=a.scale;var hi=Ki>nt/wi,Ue=Ii>ot/wi;if(!(z||a.gf||a.Be||hi||Ue))return!0;Et=Tt.x-Et,nt=st.x,Ft=Tt.right+Ft,ot=st.right+tt,Ot=Tt.y-Ot;var Ln=st.y;Tt=Tt.bottom+Rt,st=st.bottom+it;var wn="1px";if(Rt="1px",a.scrollMode===nh&&(hi||Ue)&&(hi&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(hi=1,Et+1<nt&&(hi=Math.max((nt-Et)*wi+a.Aa,hi)),Ft>ot+1&&(hi=Math.max((Ft-ot)*wi+a.Aa,hi)),Ht+tt+1<Ki&&(hi=Math.max((Ki-Ht)*wi+a.Aa,hi)),wn=hi.toString()+"px"),Ue&&a.hasVerticalScrollbar&&a.allowVerticalScroll&&(hi=1,Ot+1<Ln&&(hi=Math.max((Ln-Ot)*wi+a.ya,hi)),Tt>st+1&&(hi=Math.max((Tt-st)*wi+a.ya,hi)),ae+it+1<Ii&&(hi=Math.max((Ii-ae)*wi+a.ya,hi)),Rt=hi.toString()+"px")),hi=wn!=="1px",Ue=Rt!=="1px",hi&&Ue||!hi&&!Ue||(Ue&&(ot-=a.Db),hi&&(st-=a.Db),Ki<Ht+tt||!a.hasHorizontalScrollbar||!a.allowHorizontalScroll||(tt=1,Et+1<nt&&(tt=Math.max((nt-Et)*wi+a.Aa,tt)),Ft>ot+1&&(tt=Math.max((Ft-ot)*wi+a.Aa,tt)),Ht+1<Ki&&(tt=Math.max((Ki-Ht)*wi+a.Aa,tt)),wn=tt.toString()+"px"),hi=wn!=="1px",tt=a.ya,hi!==a.Be&&(tt=hi?a.ya-a.Db:a.ya+a.Db),Ii<ae+it||!a.hasVerticalScrollbar||!a.allowVerticalScroll||(it=1,Ot+1<Ln&&(it=Math.max((Ln-Ot)*wi+tt,it)),Tt>st+1&&(it=Math.max((Tt-st)*wi+tt,it)),ae+1<Ii&&(it=Math.max((Ii-ae)*wi+tt,it)),Rt=it.toString()+"px"),Ue=Rt!=="1px"),a.qr&&hi===a.Be&&Ue===a.gf)return x===a.Aa&&E===a.ya||a.bd(),!1;if(hi!==a.Be&&(wn==="1px"?a.ya=a.ya+a.Db:a.ya=Math.max(a.ya-a.Db,1),z=!0),a.Be=hi,xt.style.width=wn,Ue!==a.gf&&(Rt==="1px"?a.Aa=a.Aa+a.Db:a.Aa=Math.max(a.Aa-a.Db,1),z=!0,a.tn&&(it=Pt.alloc(),Ue?(y.style.left=a.Db+"px",a.position=it.h(a.pa.x+a.Db/a.scale,a.pa.y)):(y.style.left="0px",a.position=it.h(a.pa.x-a.Db/a.scale,a.pa.y)),Pt.free(it))),z&&Vl(a),a.gf=Ue,xt.style.height=Rt,a.gu=!0,z&&(a.pn=!0),y=vt.scrollLeft,a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(Ht+1<Ki?y=(a.position.x-Et)*wi:Et+1<nt?y=vt.scrollWidth-vt.clientWidth:Ft>ot+1&&(y=a.position.x*wi)),a.tn)switch(a.bu){case"negative":y=-(vt.scrollWidth-y-vt.clientWidth);break;case"reverse":y=vt.scrollWidth-y-vt.clientWidth}return vt.scrollLeft=y,a.hasVerticalScrollbar&&a.allowVerticalScroll&&(ae+1<Ii?vt.scrollTop=(a.position.y-Ot)*wi:Ot+1<Ln?vt.scrollTop=vt.scrollHeight-vt.clientHeight:Tt>st+1&&(vt.scrollTop=a.position.y*wi)),nt=a.Aa,ot=a.ya,vt.style.width=nt+(a.gf?a.Db:0)+"px",vt.style.height=ot+(a.Be?a.Db:0)+"px",x!==nt||E!==ot||a.animationManager.zb?(x=be.allocAt(b,ut,ct,dt),a.onViewportBoundsChanged(x,a.viewportBounds,wi,z),be.free(x),!1):!0}yt=le.prototype,yt.add=function(a){var y=a.diagram;if(y!==this&&(y!==null&&It("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+y.toString()),y=this.Qj(a.layerName),y===null&&(y=this.Qj("")),y===null&&It('Cannot add a Part when unable find a Layer named "'+a.layerName+'" and there is no default Layer'),a.layer!==y)){var x=y.oi(99999999,a,a.diagram===this);0<=x&&this.cb(xo,"parts",y,null,a,null,x),y.isTemporary||this.Ya(),a.C(1),x=a.layerChanged,x!==null&&x(a,null,y)}},yt.oi=function(a){this.partManager.oi(a);var y=this;Oc(a,function(x){Pc(y,x)}),(a instanceof cr||a instanceof An&&a.placeholder!==null)&&a.v(),a.data!==null&&Oc(a,function(x){ly(y.partManager,x)}),Os(a)!==!0&&Gh(a)!==!0||this.De.add(a),zx(a,!0,this),Hx(a)?(a.actualBounds.w()&&this.N(jc(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(jc(a,a.actualBounds)),this.$b()},yt.pc=function(a){a.Ej(),this.partManager.pc(a);var y=this;a.data!==null&&Oc(a,function(x){uy(y.partManager,x,y)}),this.De.remove(a),Hx(a)?(a.actualBounds.w()&&this.N(jc(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(jc(a,a.actualBounds)),this.$b()},yt.remove=function(a){Sp(this,a,!0)};function Sp(a,y,x){var E=y.layer;E!==null&&E.diagram===a&&(y.isSelected=!1,y.isHighlighted=!1,y.C(2),x&&y.Lj(),x=E.pc(-1,y,!1),0<=x&&a.cb(Ao,"parts",E,y,null,x,null),a=y.layerChanged,a!==null&&a(y,E,null))}yt.Is=function(a,y){if(y===void 0&&(y=!1),Ti(a))for(var x=a.length,E=0;E<x;E++){var b=a[E];y&&!b.canDelete()||this.remove(b)}else for(x=new _e,x.addAll(a),a=x.iterator;a.next();)x=a.value,y&&!x.canDelete()||this.remove(x)},yt.Kj=function(a,y,x){return x===void 0&&(x=!1),this.partManager.Kj(a,y,x)},le.prototype.moveParts=function(a,y,x,E){if(x===void 0&&(x=!1),E===void 0&&(E=rd(this)),this.toolManager!==null){var b=new ji;if(a!==null)if(Ti(a))for(var z=0;z<a.length;z++)su(this,b,a[z],x,E);else for(a=a.iterator;a.next();)su(this,b,a.value,x,E);else{for(a=this.parts;a.next();)su(this,b,a.value,x,E);for(a=this.nodes;a.next();)su(this,b,a.value,x,E);for(a=this.links;a.next();)su(this,b,a.value,x,E)}_h(this,b,y,E,x)}};function su(a,y,x,E,b,z){if(!y.contains(x)&&(z===void 0&&(z=!1),!E||z||x.canMove()||x.canCopy()))if(b===void 0&&(b=rd(a)),x instanceof Ci){if(y.add(x,a.Pd(b,x,x.location)),x instanceof An&&(x.placeholder!==null||b.dragsMembers))for(z=x.memberParts;z.next();)su(a,y,z.value,E,b,b.groupsAlwaysMove);for(z=x.linksConnected;z.next();){var tt=z.value;if(!y.contains(tt)){var it=tt.fromNode,nt=tt.toNode;it!==null&&y.contains(it)&&nt!==null&&y.contains(nt)&&su(a,y,tt,E,b)}}if(b.dragsTree)for(x=x.Ou();x.next();)su(a,y,x.value,E,b)}else if(x instanceof fi)for(y.add(x,a.Pd(b,x)),x=x.labelNodes;x.next();)su(a,y,x.value,E,b);else x instanceof cr||y.add(x,a.Pd(b,x,x.location))}function _h(a,y,x,E,b){if(y!==null&&y.count!==0){var z=Pt.alloc(),tt=Pt.alloc();tt.assign(x),isNaN(tt.x)&&(tt.x=0),isNaN(tt.y)&&(tt.y=0),(x=a.Mr)||sd(a,y);for(var it=ii(),nt=ii(),ot=y.iterator,st=Pt.alloc();ot.next();){var ut=ot.key,ct=ot.value;if(ut.Zc()){var dt=Cp(a,ut,y);dt!==null?it.push(new et(ut,ct,dt)):(!b||ut.canMove())&&(dt=ct.point,z.assign(dt),a.computeMove(ut,z.add(tt),E,st),ut.location=st,ct.shifted===void 0&&(ct.shifted=new Pt),ct.shifted.assign(st.re(dt)))}else ot.key instanceof fi&&nt.push(ot.sa)}for(Pt.free(st),b=it.length,ot=0;ot<b;ot++)ut=it[ot],z.assign(ut.info.point),ut.Su.shifted===void 0&&(ut.Su.shifted=new Pt),ut.node.location=z.add(ut.Su.shifted);for(b=Pt.alloc(),ot=Pt.alloc(),ut=nt.length,ct=0;ct<ut;ct++){var vt=nt[ct];if(dt=vt.key,dt instanceof fi)if(dt.suspendsRouting){dt.Tg=null,st=dt.fromNode;var xt=dt.toNode;if(a.draggedLink!==null&&E.dragsLink)if(xt=vt.value.point,dt.dragComputation===null)y.add(dt,a.Pd(E,dt,tt)),ch(dt,tt.x-xt.x,tt.y-xt.y);else{vt=Pt.allocAt(0,0),(st=dt.i(0))&&st.w()&&vt.assign(st);var Tt=st=Pt.alloc().assign(vt).add(tt);E.isGridSnapEnabled&&(E.isGridSnapRealtime||a.lastInput.up)&&(Tt=Pt.alloc(),od(a,dt,st,Tt,E)),st.assign(dt.dragComputation(dt,st,Tt)).re(vt),y.add(dt,a.Pd(E,dt,st)),ch(dt,st.x-xt.x,st.y-xt.y),Pt.free(vt),Pt.free(st),Tt!==st&&Pt.free(Tt)}else st!==null&&(b.assign(st.location),Tt=y.I(st),Tt!==null&&b.re(Tt.point)),xt!==null&&(ot.assign(xt.location),Tt=y.I(xt),Tt!==null&&ot.re(Tt.point)),st!==null&&xt!==null?b.Xa(ot)?(st=vt.value.point,xt=z,xt.assign(b),xt.re(st),y.add(dt,a.Pd(E,dt,b)),ch(dt,xt.x,xt.y)):(dt.suspendsRouting=!1,dt.bb()):(vt=vt.value.point,st=st!==null?b:xt!==null?ot:tt,y.add(dt,a.Pd(E,dt,st)),ch(dt,st.x-vt.x,st.y-vt.y))}else(dt.fromNode===null||dt.toNode===null)&&(st=vt.value.point,y.add(dt,a.Pd(E,dt,tt)),ch(dt,tt.x-st.x,tt.y-st.y))}Pt.free(z),Pt.free(tt),Pt.free(b),Pt.free(ot),Hi(it),Hi(nt),x||(hs(a),Hh(a,y))}}le.prototype.computeMove=function(a,y,x,E){if(E===void 0&&(E=new Pt),E.assign(y),a===null)return E;var b=y,z=x.isGridSnapEnabled;z&&(x.isGridSnapRealtime||this.lastInput.up)&&(b=Pt.alloc(),od(this,a,y,b,x)),x=a.dragComputation!==null?a.dragComputation(a,y,b):b;var tt=a.minLocation,it=tt.x;isNaN(it)&&(it=z?Math.round(1e3*a.location.x)/1e3:a.location.x),tt=tt.y,isNaN(tt)&&(tt=z?Math.round(1e3*a.location.y)/1e3:a.location.y);var nt=a.maxLocation,ot=nt.x;return isNaN(ot)&&(ot=z?Math.round(1e3*a.location.x)/1e3:a.location.x),nt=nt.y,isNaN(nt)&&(nt=z?Math.round(1e3*a.location.y)/1e3:a.location.y),E.h(Math.max(it,Math.min(x.x,ot)),Math.max(tt,Math.min(x.y,nt))),b!==y&&Pt.free(b),E};function rd(a){var y=a.toolManager.findTool("Dragging");return y!==null?y.dragOptions:a.Wm}function od(a,y,x,E,b){if(b===void 0&&(b=rd(a)),E.assign(x),y!==null){var z=a.grid;y=b.gridSnapCellSize,a=y.width,y=y.height;var tt=b.gridSnapOrigin,it=tt.x;if(tt=tt.y,b=b.gridSnapCellSpot,z!==null){var nt=z.gridCellSize;isNaN(a)&&(a=nt.width),isNaN(y)&&(y=nt.height),z=z.gridOrigin,isNaN(it)&&(it=z.x),isNaN(tt)&&(tt=z.y)}z=Pt.allocAt(0,0),z.yi(0,0,a,y,b),Gt.No(x.x,x.y,it+z.x,tt+z.y,a,y,E),Pt.free(z)}}function sd(a,y){if(y!==null)for(a.Mr=!0,a=y.iterator;a.next();)y=a.key,y instanceof fi&&(y.suspendsRouting=!0)}function Hh(a,y){if(y!==null){for(y=y.iterator;y.next();){var x=y.key;x instanceof fi&&(x.suspendsRouting=!1,Y0(x)&&x.bb())}a.Mr=!1}}function Cp(a,y,x){return y=y.containingGroup,y!==null&&(a=Cp(a,y,x),a!==null||(a=x.I(y),a!==null))?a:null}yt=le.prototype,yt.Pd=function(a,y,x){if(x===void 0)return new Nu(gr);var E=a.isGridSnapEnabled;return a.groupsSnapMembers||y.containingGroup===null||(E=!1),E?new Nu(new Pt(Math.round(1e3*x.x)/1e3,Math.round(1e3*x.y)/1e3)):new Nu(x.copy())};function kp(a,y,x){if(y.diagram!==null&&y.diagram!==a&&It("Cannot share a Layer with another Diagram: "+y+" of "+y.diagram),x===null?y.diagram!==null&&It("Cannot add an existing Layer to this Diagram again: "+y):(x.diagram!==a&&It("Existing Layer must be in this Diagram: "+x+" not in "+x.diagram),y===x&&It("Cannot move a Layer before or after itself: "+y)),y.diagram!==a){y=y.name,a=a.Wa,x=a.count;for(var E=0;E<x;E++)a.M(E).name===y&&It("Cannot add Layer with the name '"+y+"'; a Layer with the same name is already present in this Diagram.")}}yt.Al=function(a){kp(this,a,null),a.Xe(this);var y=this.Wa,x=y.count-1;if(!a.isTemporary)for(;0<=x&&y.M(x).isTemporary;)x--;return y.Gb(x+1,a),this.cc!==null&&this.cb(xo,"layers",this,null,a,null,x+1),this.N(),this.Ya(),this},yt.Ww=function(a,y){kp(this,a,y),a.Xe(this);var x=this.Wa,E=x.indexOf(a);0<=E&&(x.remove(a),this.cc!==null&&this.cb(Ao,"layers",this,a,null,E,null));var b=x.count,z;for(z=0;z<b;z++)if(x.M(z)===y){x.Gb(z,a);break}return this.cc!==null&&this.cb(xo,"layers",this,null,a,null,z),this.N(),0>E&&this.Ya(),this},yt.Cy=function(a,y){kp(this,a,y),a.Xe(this);var x=this.Wa,E=x.indexOf(a);0<=E&&(x.remove(a),this.cc!==null&&this.cb(Ao,"layers",this,a,null,E,null));var b=x.count,z;for(z=0;z<b;z++)if(x.M(z)===y){x.Gb(z+1,a);break}return this.cc!==null&&this.cb(xo,"layers",this,null,a,null,z+1),this.N(),0>E&&this.Ya(),this},yt.kA=function(a){if(a.diagram!==this&&It("Cannot remove a Layer from another Diagram: "+a+" of "+a.diagram),a.name!==""){var y=this.Wa,x=y.indexOf(a);if(y.remove(a)){for(y=a.Pa.copy().iterator;y.next();){var E=y.value,b=E.layerName;b!==a.name?E.layerName=b:E.layerName=""}this.cc!==null&&this.cb(Ao,"layers",this,a,null,x,null),this.N(),this.Ya()}}},yt.Qj=function(a){for(var y=this.layers;y.next();){var x=y.value;if(x.name===a)return x}return null},yt.Yw=function(a){return this.pf===null&&(this.pf=new Me),this.pf.add(a),this.model.Pe(a),this},yt.mA=function(a){this.pf!==null&&(this.pf.remove(a),this.pf.count===0&&(this.pf=null)),this.model.ik(a)},yt.Pe=function(a){return this.zg===null&&(this.zg=new Me),this.zg.add(a),this},yt.ik=function(a){this.zg!==null&&(this.zg.remove(a),this.zg.count===0&&(this.zg=null))},yt.ds=function(a){if(this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Tu(a),a.change!==da&&(this.isModified=!0),this.zg!==null)for(var y=this.zg,x=y.length,E=0;E<x;E++)y.M(E)(a)},yt.cb=function(a,y,x,E,b,z,tt){z===void 0&&(z=null),tt===void 0&&(tt=null);var it=new Jr;it.diagram=this,it.change=a,it.propertyName=y,it.object=x,it.oldValue=E,it.oldParam=z,it.newValue=b,it.newParam=tt,this.ds(it)},yt.g=function(a,y,x,E,b){this.cb(Yr,a,this,y,x,E,b)},le.prototype.changeState=function(a,y){if(a!==null&&a.diagram===this){var x=this.skipsModelSourceBindings;try{this.skipsModelSourceBindings=!0;var E=a.change;if(E===Yr){var b=a.object;if(Vr(b,a.propertyName,a.I(y)),b instanceof Kt){var z=b.part;z!==null&&z.Wb()}this.isModified=!0}else if(E===xo){var tt=a.object,it=a.newParam,nt=a.newValue;if(tt instanceof si)if(typeof it=="number"&&nt instanceof Kt){y?tt.pc(it):tt.Gb(it,nt);var ot=tt.part;ot!==null&&ot.Wb()}else typeof it=="number"&&nt instanceof To&&(nt.isRow?fx(tt,it,y?void 0:nt):dx(tt,it,y?void 0:nt));else if(tt instanceof Yo){var st=a.oldParam===!0;typeof it=="number"&&nt instanceof tn&&(y?(nt.isSelected=!1,nt.isHighlighted=!1,nt.Wb(),tt.pc(st?it:-1,nt,st)):tt.oi(it,nt,st))}else tt instanceof le?typeof it=="number"&&nt instanceof Yo&&(y?this.Wa.mb(it):(nt.Xe(this),this.Wa.Gb(it,nt))):It("unknown ChangedEvent.Insert object: "+a.toString());this.isModified=!0}else if(E===Ao){var ut=a.object,ct=a.oldParam,dt=a.oldValue;if(ut instanceof si)typeof ct=="number"&&dt instanceof Kt?y?ut.Gb(ct,dt):ut.pc(ct):typeof ct=="number"&&dt instanceof To&&(dt.isRow?fx(ut,ct,y?dt:void 0):dx(ut,ct,y?dt:void 0));else if(ut instanceof Yo){var vt=a.newParam===!0;typeof ct=="number"&&dt instanceof tn&&(y?0>ut.Pa.indexOf(dt)&&ut.oi(ct,dt,vt):(dt.isSelected=!1,dt.isHighlighted=!1,dt.Wb(),ut.pc(vt?ct:-1,dt,vt)))}else ut instanceof le?typeof ct=="number"&&dt instanceof Yo&&(y?(dt.Xe(this),this.Wa.Gb(ct,dt)):this.Wa.mb(ct)):It("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else E!==da&&It("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings=x}}},le.prototype.Ea=function(a){return this.undoManager.Ea(a)},le.prototype.eb=function(a){return this.undoManager.eb(a)},le.prototype.Kf=function(){return this.undoManager.Kf()},le.prototype.commit=function(a,y){y===void 0&&(y="");var x=this.skipsUndoManager;y===null&&(this.skipsUndoManager=!0,y=""),this.undoManager.Ea(y);var E=!1;try{a(this),E=!0}finally{E?this.undoManager.eb(y):this.undoManager.Kf(),this.skipsUndoManager=x}},le.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)},le.prototype.rp=function(){this.partManager.rp()};function Mp(a,y,x){var E=a.animationManager;if(a.vb||a.ld)a.Ca=x,Vl(a),a.N(),a.Ee=!0,E.zb&&(Eu(E)||E.ce.add(E.H,"scale",y,a.Ca));else if(a.ta===null)a.Ca=x,Vl(a);else{a.vb=!0;var b=a.viewportBounds.copy(),z=a.Aa,tt=a.ya,it=a.zoomPoint.x,nt=a.zoomPoint.y,ot=a.contentAlignment;isNaN(it)&&(ot.$c()?ot.Hf(ha)?it=0:ot.Hf(Ns)&&(it=z-1):it=ot.sb()?ot.x*(z-1):z/2),isNaN(nt)&&(ot.$c()?ot.Hf(Ps)?nt=0:ot.Hf(ia)&&(nt=tt-1):nt=ot.sb()?ot.y*(tt-1):tt/2),a.scaleComputation===null||a.animationManager.defaultAnimation.isAnimating||(x=a.scaleComputation(a,x)),x<a.minScale&&(x=a.minScale),x>a.maxScale&&(x=a.maxScale),z=Pt.allocAt(a.pa.x+it/y-it/x,a.pa.y+nt/y-nt/x),a.position=z,Pt.free(z),a.Ca=x,Vl(a),a.vb=!1,a.onViewportBoundsChanged(b,a.viewportBounds,y,!1),el(a,!1),E.zb&&(Eu(E)||E.ce.add(E.H,"scale",y,a.Ca))}}le.prototype.onViewportBoundsChanged=function(a,y,x,E){if(!a.D(y)){E===void 0&&(E=!1),E||(this.Ee=!0),this.vd=!0;var b=this.layout;b===null||!b.isViewportSized||this.autoScale!==Cs||a.width===y.width&&a.height===y.height||b.C(),b=this.currentTool,this.Vk===!0&&b instanceof Ur&&(this.lastInput.documentPoint=this.Ps(this.lastInput.viewPoint),Og(b,this)),this.vb||this.invalidateViewport(a,y),Kl(this),this.fc.scale=x,this.fc.position.x=a.x,this.fc.position.y=a.y,this.fc.bounds.assign(a),this.fc.canvasSize.width=Math.round(a.width*x),this.fc.canvasSize.height=Math.round(a.height*x),this.fc.newCanvasSize.width=this.Aa,this.fc.newCanvasSize.height=this.ya,this.fc.isScroll=E,this.R("ViewportBoundsChanged",this.fc,a),this.isVirtualized&&this.links.each(function(z){z.isAvoiding&&z.actualBounds.Yc(y)&&z.bb()})}};function Kl(a,y){var x=a.fe;if(x!==null&&x.visible){for(var E=li.alloc(),b=1,z=1,tt=x.O.s,it=tt.length,nt=0;nt<it;nt++){var ot=tt[nt],st=Math.abs(ot.interval);2>st||(v0(ot.figure)?z=z*st/Gt.vx(z,st):b=b*st/Gt.vx(b,st))}if(tt=x.gridCellSize,E.h(z*tt.width,b*tt.height),y!==void 0)b=y.width,z=y.height,a=y.x,tt=y.y;else{if(y=be.alloc(),a=a.viewportBounds,y.h(a.x,a.y,a.width,a.height),!y.w()){be.free(y);return}b=y.width,z=y.height,a=y.x,tt=y.y,be.free(y)}x.width=b+2*E.width,x.height=z+2*E.height,y=Pt.alloc(),Gt.No(a,tt,0,0,E.width,E.height,y),y.offset(-E.width,-E.height),li.free(E),x.part.location=y,Pt.free(y)}}le.prototype.clearSelection=function(a){a===void 0&&(a=!1);var y=this.selection;if(y.count!==0){a||this.R("ChangingSelection",y);for(var x=y.Fa(),E=x.length,b=0;b<E;b++)x[b].isSelected=!1;y.ka(),y.clear(),y.freeze(),a||this.R("ChangedSelection",y)}},le.prototype.select=function(a){a!==null&&a.diagram===this&&(!a.isSelected||1<this.selection.count)&&(this.R("ChangingSelection",this.selection),this.clearSelection(!0),a.isSelected=!0,this.R("ChangedSelection",this.selection))},le.prototype.rA=function(a){if(this.R("ChangingSelection",this.selection),this.clearSelection(!0),Ti(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];E instanceof tn||It("Diagram.selectCollection given something that is not a Part: "+E),E.isSelected=!0}else for(a=a.iterator;a.next();)y=a.value,y instanceof tn||It("Diagram.selectCollection given something that is not a Part: "+y),y.isSelected=!0;this.R("ChangedSelection",this.selection)},le.prototype.clearHighlighteds=function(){var a=this.highlighteds;if(0<a.count){for(var y=a.Fa(),x=y.length,E=0;E<x;E++)y[E].isHighlighted=!1;a.ka(),a.clear(),a.freeze()}},yt=le.prototype,yt.Iz=function(a){a!==null&&a.diagram===this&&(!a.isHighlighted||1<this.highlighteds.count)&&(this.clearHighlighteds(),a.isHighlighted=!0)},yt.Jz=function(a){a=new _e().addAll(a);for(var y=this.highlighteds.copy().hp(a).iterator;y.next();)y.value.isHighlighted=!1;for(a=a.iterator;a.next();)y=a.value,y instanceof tn||It("Diagram.highlightCollection given something that is not a Part: "+y),y.isHighlighted=!0},yt.scroll=function(a,y,x){x===void 0&&(x=1);var E=y==="up"||y==="down",b=0,z=Pt.alloc();if(a==="pixel")b=x;else if(a==="line")b=x*(E?this.scrollVerticalLineChange:this.scrollHorizontalLineChange);else if(a==="page")a=E?this.viewportBounds.height:this.viewportBounds.width,a*=this.scale,a!==0&&(b=x*Math.max(a-(E?this.scrollVerticalLineChange:this.scrollHorizontalLineChange),0));else{if(a==="document"){b=this.documentBounds,x=this.viewportBounds,y==="up"?this.position=z.h(x.x,b.y):y==="left"?this.position=z.h(b.x,x.y):y==="down"?this.position=z.h(x.x,b.bottom-x.height):y==="right"&&(this.position=z.h(b.right-x.width,x.y)),Pt.free(z);return}It("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: "+a)}b/=this.scale,x=this.position,y==="up"?this.position=z.h(x.x,x.y-b):y==="down"?this.position=z.h(x.x,x.y+b):y==="left"?this.position=z.h(x.x-b,x.y):y==="right"?this.position=z.h(x.x+b,x.y):It("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+y),Pt.free(z)},yt.tv=function(a){var y=this.viewportBounds;y.Re(a)||(a=a.center,a.x-=y.width/2,a.y-=y.height/2,this.position=a)},yt.es=function(a){var y=this.viewportBounds;a=a.center,a.x-=y.width/2,a.y-=y.height/2,this.position=a},yt.op=function(a){var y=this.Ab;y.reset(),this.Ca!==1&&y.scale(this.Ca);var x=this.pa;return(x.x!==0||x.y!==0)&&isFinite(x.x)&&isFinite(x.y)&&y.translate(-x.x,-x.y),a.copy().transform(this.Ab)},yt.zA=function(a){var y=this.Ab,x=a.x,E=a.y,b=x+a.width,z=E+a.height,tt=y.m11,it=y.m12,nt=y.m21,ot=y.m22,st=y.dx,ut=y.dy,ct=x*tt+E*nt+st;y=x*it+E*ot+ut;var dt=b*tt+E*nt+st;return a=b*it+E*ot+ut,E=x*tt+z*nt+st,x=x*it+z*ot+ut,tt=b*tt+z*nt+st,b=b*it+z*ot+ut,z=Math.min(ct,dt),ct=Math.max(ct,dt),dt=Math.min(y,a),y=Math.max(y,a),z=Math.min(z,E),ct=Math.max(ct,E),dt=Math.min(dt,x),y=Math.max(y,x),z=Math.min(z,tt),ct=Math.max(ct,tt),dt=Math.min(dt,b),y=Math.max(y,b),new be(z,dt,ct-z,y-dt)},yt.Ps=function(a){var y=this.Ab;y.reset(),this.Ca!==1&&y.scale(this.Ca);var x=this.pa;return(x.x!==0||x.y!==0)&&isFinite(x.x)&&isFinite(x.y)&&y.translate(-x.x,-x.y),Gi(a.copy(),this.Ab)};function qg(a){var y=a.isModified;a.Tw!==y&&(a.Tw=y,a.R("Modified"))}function Ep(a){return a=fd.get(a),a!==null?new a:new Mr}le.prototype.doModelChanged=function(a){var y=this;if(a.model===this.model){var x=a.change,E=a.propertyName;if(x===da&&E[0]==="S")if(E==="StartingFirstTransaction"){var b=this;a=this.toolManager,a.mouseDownTools.each(function(nt){return nt.diagram=b}),a.mouseMoveTools.each(function(nt){return nt.diagram=b}),a.mouseUpTools.each(function(nt){return nt.diagram=b}),this.ld||this.hf||(this.Jk=!0,this.fn&&(this.kg=!0))}else E==="StartingUndo"||E==="StartingRedo"?(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&&a.Cc(),this.R("ChangingSelection",this.selection)):E==="StartedTransaction"&&(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&&a.Cc());else if(this.aa){this.aa=!1;try{if(a.modelChange===""&&x===da){(E==="FinishedUndo"||E==="FinishedRedo")&&(this.R("ChangedSelection",this.selection),hs(this));var z=this.animationManager;E==="RolledBackTransaction"&&z.Cc(),this.bx(),this.Jk=!0,this.bd(),this.undoManager.transactionLevel!==0&&this.undoManager.transactionLevel!==1||Qf(z),E==="CommittedTransaction"&&this.undoManager.isJustDiscarded&&(this.Ce=Math.min(this.Ce,this.undoManager.historyIndex-1)),E!=="CommittedTransaction"&&E!=="RolledBackTransaction"||!this.undoManager.isPendingUnmodified||setTimeout(function(){y.isModified=!1},1);var tt=a.isTransactionFinished;if(tt&&(qg(this),this.As.clear(),_g(this.animationManager)),!this.Rt&&tt&&this.lastInput.targetDiagram){this.Rt=!0;var it=this;On(function(){it.currentTool.standardMouseOver(),it.Rt=!1},10)}}}finally{this.aa=!0}}}};function Pc(a,y){y=y.O.s;for(var x=y.length,E=0;E<x;E++)Wh(a,y[E])}function Wh(a,y){if(y instanceof Qs){var x=y.element;if(x!==null&&x instanceof HTMLImageElement){x.Bg instanceof _e&&x.Bg.add(a);var E=y.Eg;if(E!==null&&E.sq===!0&&y.diagram!==null&&y.diagram.Xn.add(y),x.hn)if(x=x.getAttribute("src")||"",E=a.Og.I(x),E===null)E=[],E.push(y),a.Og.add(x,E);else{for(a=0;a<E.length;a++)if(E[a]===y)return;E.push(y)}}}}function bp(a,y){if(y instanceof Qs){var x=y.element;if(x!==null&&x instanceof HTMLImageElement&&x.hn){var E=x.getAttribute("src")||"",b=a.Og.I(E);if(b!==null){for(var z=0;z<b.length;z++)if(b[z]===y){b.splice(z,1),b.length===0&&(a.Og.remove(E),x.Fq&&x.removeEventListener("load",x.Fq),x.Yp&&x.removeEventListener("error",x.Yp),delete x.Fq,delete x.Yp,x.Bg instanceof _e&&x.Bg.remove(a),Ed(E));break}}}}}le.prototype.Wd=function(){this.partManager.Wd()},le.prototype.Aj=function(a,y){this.Yd.Aj(a,y)},le.prototype.Cj=function(a,y){this.Yd.Cj(a,y)},le.prototype.findPartForKey=function(a){return this.partManager.findPartForKey(a)},le.prototype.Vb=function(a){return this.partManager.Vb(a)},le.prototype.findLinkForKey=function(a){return this.partManager.findLinkForKey(a)},yt=le.prototype,yt.Lc=function(a){return this.partManager.Lc(a)},yt.ii=function(a){return this.partManager.ii(a)},yt.Kc=function(a){return this.partManager.Kc(a)},yt.ms=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];return this.partManager.ms.apply(this.partManager,y instanceof Array?y:Ui(on(y)))},yt.ls=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];return this.partManager.ls.apply(this.partManager,y instanceof Array?y:Ui(on(y)))};function Vl(a){var y=a.pa,x=a.Ca;a.Rw.h(y.x,y.y,Math.max(a.Aa,0)/x,Math.max(a.ya,0)/x),a.vd=!0}function Pp(a,y){a.Zi=!1;var x=a.Sp;x.D(y)||(x=x.copy(),a.Sp.assign(y),el(a,!1),a.R("DocumentBoundsChanged",void 0,x),a.Ee=!0,a.N())}yt.Va=function(){if(this.Zi){var a=be.alloc();Pp(this,this.computeBounds(a)),be.free(a)}},yt.rz=function(){for(var a=new _e,y=this.nodes;y.next();){var x=y.value;x.isTopLevel&&a.add(x)}for(y=this.links;y.next();)x=y.value,x.isTopLevel&&a.add(x);return a.iterator},yt.qz=function(){return this.ai.iterator},yt.Uz=function(a){hs(this),a&&ad(this,!0),this.ld?Np(this,!1):(this.Jk=!0,_a(this))};function ad(a,y){for(var x=a.ai.iterator;x.next();)tv(a,x.value,y);a.layout&&(y?a.layout.isValidLayout=!1:a.layout.C())}function tv(a,y,x){if(y!==null){for(var E=y.gl.iterator;E.next();)tv(a,E.value,x);y.layout!==null&&(x?y.layout.isValidLayout=!1:y.layout.C())}}function Np(a,y){if(a.xh&&!a.lt){var x=a.aa;a.aa=!0;var E=a.undoManager.transactionLevel,b=a.layout,z=a.animationManager;try{E===0&&(a.undoManager.isInternalTransaction=!0,a.Ea("Layout")),1>=E&&!z.defaultAnimation.isAnimating&&!z.zb&&(y||nu(z,"Layout")),a.xh=!1;for(var tt=a.ai.iterator;tt.next();)Tp(a,tt.value,y,E);b.isValidLayout||(!y||b.isRealtime||b.isRealtime===null||E===0?(b.doLayout(a),hs(a),b.isValidLayout=!0):a.xh=!0)}finally{y=a.undoManager.isInternalTransaction,E===0&&(a.eb("Layout"),a.undoManager.isInternalTransaction=!1),!y||E!==0&&E!==1||Qf(z),a.aa=x}}}function Tp(a,y,x,E){if(y!==null){for(var b=y.gl.iterator;b.next();)Tp(a,b.value,x,E);b=y.layout,b===null||b.isValidLayout||(!x||b.isRealtime||E===0?(y.rh=!y.location.w(),b.doLayout(y),y.C(32),pf(a,y),b.isValidLayout=!0):a.xh=!0)}}yt.yz=function(){for(var a=new Me,y=this.nodes;y.next();){var x=y.value;x.isTopLevel&&x.kh()===null&&a.add(x)}return a.iterator};function i0(a){function y(b){var z=b.toLowerCase(),tt=new Me;x.add(b,tt),x.add(z,tt),E.add(b,b),E.add(z,b)}var x=new ji,E=new ji;y("InitialAnimationStarting"),y("AnimationStarting"),y("AnimationFinished"),y("BackgroundSingleClicked"),y("BackgroundDoubleClicked"),y("BackgroundContextClicked"),y("ClipboardChanged"),y("ClipboardPasted"),y("DocumentBoundsChanged"),y("ExternalObjectsDropped"),y("GainedFocus"),y("InitialLayoutCompleted"),y("LayoutCompleted"),y("LinkDrawn"),y("LinkRelinked"),y("LinkReshaped"),y("LostFocus"),y("Modified"),y("ObjectSingleClicked"),y("ObjectDoubleClicked"),y("ObjectContextClicked"),y("PartCreated"),y("PartResized"),y("PartRotated"),y("SelectionMoved"),y("SelectionCopied"),y("SelectionDeleting"),y("SelectionDeleted"),y("SelectionGrouped"),y("SelectionUngrouped"),y("ChangingSelection"),y("ChangedSelection"),y("SubGraphCollapsed"),y("SubGraphExpanded"),y("TextEdited"),y("TreeCollapsed"),y("TreeExpanded"),y("ViewportBoundsChanged"),y("InvalidateDraw"),a.iw=x,a.hw=E}function ev(a,y){var x=a.hw.I(y);return x!==null?x:a.hw.I(y.toLowerCase())}function ld(a,y){var x=a.iw.I(y);if(x!==null||(x=a.iw.I(y.toLowerCase()),x!==null))return x;It("Unknown DiagramEvent name: "+y)}yt.Bj=function(a,y){return a=ld(this,a),a!==null&&a.add(y),this},yt.am=function(a,y){a=ld(this,a),a!==null&&a.remove(y)},yt.R=function(a,y,x){var E=ld(this,a),b=new Hu;if(b.diagram=this,a=ev(this,a),a!==null&&(b.name=a),y!==void 0&&(b.subject=y),x!==void 0&&(b.parameter=x),y=E.length,y===1)E.M(0)(b);else if(y!==0)for(E=E.Fa(),x=0;x<y;x++)(0,E[x])(b)};function ud(a){if(a.animationManager.isTicking)return!1;var y=a.currentTool;return y===a.toolManager.findTool("Dragging")?!a.Mr||y.isComplexRoutingRealtime:!0}yt.Yj=function(a,y){return hd(this,!1,null,y||null).Yj(a.x,a.y,a.width,a.height)},le.prototype.computeOccupiedArea=function(a){return this.isVirtualized?this.viewportBounds.copy():this.Zi?pp(this,a):a.assign(this.documentBounds)};function hd(a,y,x,E){var b=a.Xh;if(b===null&&(a.Xh=b=new rg(a.avoidanceCellSize)),b.vs||b.group!==x||b.Yx!==E){if(b.Hx=Math.max(b.Os+1,Math.floor(a.avoidanceLimit/a.avoidanceCellSize.width)),b.Ix=Math.max(b.Os+1,Math.floor(a.avoidanceLimit/a.avoidanceCellSize.height)),x!==null&&(x=iv(a,x)),x===null){y=be.alloc(),a.computeOccupiedArea(y),y.Bc(100,100),b.initialize(y);for(var z=a.nodes;z.next();){var tt=z.value,it=tt.layer;it!==null&&it.visible&&!it.isTemporary&&cd(a,tt,E,y)}be.free(y)}else{for(0<x.memberParts.count&&(y=a.computePartsBounds(x.memberParts,!1),y.Bc(20,20),b.initialize(y)),y=be.alloc(),z=x.memberParts;z.next();)tt=z.value,tt instanceof Ci&&cd(a,tt,E,y);be.free(y)}b.group=x,b.Yx=E,b.vs=!1}else y&&s1(b);return b}function iv(a,y){return y.avoidable&&!y.isLinkLabel?y:y.containingGroup!==null?iv(a,y.containingGroup):null}function cd(a,y,x,E){if(y!==x&&y.isVisible()){if(y.avoidable&&!y.isLinkLabel){y=y.getAvoidableRect(E),a=a.Xh;var b=y.x,z=y.y;if(Ad(a,b,z))for(x=(z-a.Od)/a.sc|0,E=Math.min((b+y.width-a.Nd)/a.rc|0,a.di),y=Math.min((z+y.height-a.Od)/a.sc|0,a.ei),b=(b-a.Nd)/a.rc|0;b<=E;b++)if(z=a.ac[b],z.fill)z.fill(dh,x,y+1);else for(var tt=x;tt<=y;tt++)z[tt]=dh}else if(y instanceof An)for(y=y.memberParts;y.next();)b=y.value,b instanceof Ci&&cd(a,b,x,E)}}function ih(a,y){a.Xh===null||a.Xh.vs||y!==void 0&&(!y.avoidable||y.isLinkLabel)||(a.Xh.vs=!0)}le.prototype.gs=function(a){this.wp.assign(a),this.computeAutoScrollPosition(this.wp).Xa(this.position)?this.ug():Lp(this)};function Lp(a){a.vk===-1&&(a.vk=On(function(){if(a.vk!==-1&&(a.ug(),a.lastInput.event!==null)){var y=a.computeAutoScrollPosition(a.wp);y.Xa(a.position)||(a.position=y,a.lastInput.documentPoint=a.Ps(a.wp),a.doMouseMove(),a.Zi=!0,y=be.alloc(),a.computeBounds(y),y.ed(a.documentBounds),Pp(a,y),be.free(y),a.Fc=!0,a.bd(),Lp(a))}},a.vp))}le.prototype.ug=function(){this.vk!==-1&&(Xe.clearTimeout(this.vk),this.vk=-1)},le.prototype.computeAutoScrollPosition=function(a){var y=this.position,x=this.xp;if(0>=x.top&&0>=x.left&&0>=x.right&&0>=x.bottom)return y;var E=this.viewportBounds,b=this.scale;E=be.allocAt(0,0,E.width*b,E.height*b);var z=Pt.allocAt(0,0);if(a.x>=E.x&&a.x<E.x+x.left&&this.allowHorizontalScroll){var tt=Math.max(this.scrollHorizontalLineChange,1);tt|=0,z.x-=tt,a.x<E.x+x.left/2&&(z.x-=tt),a.x<E.x+x.left/4&&(z.x-=4*tt)}else a.x<=E.x+E.width&&a.x>E.x+E.width-x.right&&this.allowHorizontalScroll&&(tt=Math.max(this.scrollHorizontalLineChange,1),tt|=0,z.x+=tt,a.x>E.x+E.width-x.right/2&&(z.x+=tt),a.x>E.x+E.width-x.right/4&&(z.x+=4*tt));return a.y>=E.y&&a.y<E.y+x.top&&this.allowVerticalScroll?(tt=Math.max(this.scrollVerticalLineChange,1),tt|=0,z.y-=tt,a.y<E.y+x.top/2&&(z.y-=tt),a.y<E.y+x.top/4&&(z.y-=4*tt)):a.y<=E.y+E.height&&a.y>E.y+E.height-x.bottom&&this.allowVerticalScroll&&(tt=Math.max(this.scrollVerticalLineChange,1),tt|=0,z.y+=tt,a.y>E.y+E.height-x.bottom/2&&(z.y+=tt),a.y>E.y+E.height-x.bottom/4&&(z.y+=4*tt)),z.Xa(gr)||(y=new Pt(y.x+z.x/b,y.y+z.y/b)),be.free(E),Pt.free(z),y},yt=le.prototype,yt.Cs=function(){return null},yt.av=function(){return null},yt.bs=function(a,y){this.pj.add(a,y)},yt.Fu=function(a){(this.Pw=a)||this.nodes.each(function(y){y instanceof An&&(y.$p=null)})};function gf(a,y,x){function E(){var st=+new Date;for(z=!0,tt.reset();tt.next();)if(!tt.value[0].al){z=!1;break}z||st-ot>nt?y(x,b,it):Xe.requestAnimationFrame(E)}for(var b=x.callback,z=!0,tt=a.Og.iterator;tt.next();)if(!tt.value[0].al){z=!1;break}if(typeof b!="function"||z)return y(x,b,a);var it=a,nt=x.callbackTimeout||300,ot=+new Date;return Xe.requestAnimationFrame(function(){E()}),null}yt.Wz=function(a){return lo?(a===void 0&&(a={}),a.returnType="Image",this.Jx(a)):null},yt.Jx=function(a){return a===void 0&&(a={}),gf(this,this.Xz,a)},yt.Xz=function(a,y,x){var E=nv(x,a,"canvas",null);if(E===null)return null;x=E.Z.canvas;var b=null;if(x!==null)switch(b=a.returnType,b===void 0?b="string":b=b.toLowerCase(),b){case Lc+"data":b=E.getImageData(0,0,x.width,x.height);break;case Lc:E=(a.document||document).createElement("img"),E.src=x.toDataURL(a.type,a.details),b=E;break;case"blob":return typeof y!="function"&&It('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.'),typeof x.toBlob=="function"?(x.toBlob(y,a.type,a.details),"toBlob"):(y(null),null);default:b=x.toDataURL(a.type,a.details)}return typeof y=="function"?(y(b),null):b};function nv(a,y,x,E){if(a.animationManager.Cc(),a.bd(),a.ta===null)return null;typeof y!="object"&&It("properties argument must be an Object.");var b=y.size||null,z=y.scale||null;y.scale!==void 0&&isNaN(y.scale)&&(z="NaN");var tt=y.maxSize;y.maxSize===void 0&&(tt=x==="SVG"?new li(1/0,1/0):new li(2e3,2e3));var it=y.position||null,nt=y.parts||null,ot=y.padding===void 0?1:y.padding,st=y.background||null,ut=y.omitTemporary;ut===void 0&&(ut=!0);var ct=y.document||document,dt=y.elementFinished||null,vt=y.showTemporary;vt===void 0&&(vt=!ut),y=y.showGrid,y===void 0&&(y=vt),b!==null&&isNaN(b.width)&&isNaN(b.height)&&(b=null),typeof ot=="number"?ot=new jn(ot):ot instanceof jn||It("MakeImage padding must be a Margin or a number."),ot.left=Math.max(ot.left,0),ot.right=Math.max(ot.right,0),ot.top=Math.max(ot.top,0),ot.bottom=Math.max(ot.bottom,0),a.ib.Vc(!0),ut=new nl(null,ct,void 0,!0);var xt=ut.context;if(!(b||z||nt||it))return ut.width=a.Aa+Math.ceil(ot.left+ot.right),ut.height=a.ya+Math.ceil(ot.top+ot.bottom),x==="SVG"?E===null?null:(E.resize(ut.width,ut.height,ut.width,ut.height),E.ownerDocument=ct,E.hs=dt,nd(a,E.context,ot,new li(ut.width,ut.height),a.Ca,a.pa,nt,st,vt,y),E.context):(a.Xm=!1,nd(a,xt,ot,new li(ut.width,ut.height),a.Ca,a.pa,nt,st,vt,y),a.Xm=!0,ut.context);var Tt=a.Pp,Et=a.documentBounds.copy();if(Et.Fv(a.yb),vt)for(var Ft=a.Wa.s,Ot=Ft.length,Rt=0;Rt<Ot;Rt++){var Ht=Ft[Rt];if(Ht.visible&&Ht.isTemporary){Ht=Ht.Pa.s;for(var ae=Ht.length,wi=0;wi<ae;wi++){var Ki=Ht[wi];Ki.isInDocumentBounds&&Ki.isVisible()&&(Ki=Ki.actualBounds,Ki.w()&&Et.ed(Ki))}}}if(Ft=new Pt(Et.x,Et.y),nt!==null){for(Ot=new be(0,0,0,0),Rt=!0,Ht=nt.iterator,Ht.reset();Ht.next();)ae=Ht.value,ae instanceof tn&&(wi=ae.layer,wi!==null&&!wi.visible||wi!==null&&!vt&&wi.isTemporary||!ae.isVisible()||(ae=ae.actualBounds,ae.w()&&(Rt?(Rt=!1,Ot.assign(ae)):Ot.ed(ae))));Et.width=Ot.width,Et.height=Ot.height,Ft.x=Ot.x,Ft.y=Ot.y}return it!==null&&it.w()&&(Ft=it,z||(z=Tt)),Ot=it=0,ot!==null&&(it=ot.left+ot.right,Ot=ot.top+ot.bottom),Rt=Ht=0,b!==null&&(Ht=b.width,Rt=b.height,isFinite(Ht)&&(Ht=Math.max(0,Ht-it)),isFinite(Rt)&&(Rt=Math.max(0,Rt-Ot))),b!==null&&z!==null?(z==="NaN"&&(z=Tt),b.w()?(b=Ht,Et=Rt):isNaN(Rt)?(b=Ht,Et=Et.height*z):(b=Et.width*z,Et=Rt)):b!==null?b.w()?(z=Math.min(Ht/Et.width,Rt/Et.height),b=Ht,Et=Rt):isNaN(Rt)?(z=Ht/Et.width,b=Ht,Et=Et.height*z):(z=Rt/Et.height,b=Et.width*z,Et=Rt):z!==null?z==="NaN"&&tt.w()?(z=Math.min((tt.width-it)/Et.width,(tt.height-Ot)/Et.height),z>Tt?(z=Tt,b=Et.width,Et=Et.height):(b=tt.width,Et=tt.height)):(b=Et.width*z,Et=Et.height*z):(z=Tt,b=Et.width,Et=Et.height),ot!==null?(b+=it,Et+=Ot):ot=new jn(0),tt!==null&&(Tt=tt.width,tt=tt.height,isNaN(Tt)&&(Tt=2e3),isNaN(tt)&&(tt=2e3),isFinite(Tt)&&(b=Math.min(b,Tt)),isFinite(tt)&&(Et=Math.min(Et,tt))),ut.width=Math.ceil(b),ut.height=Math.ceil(Et),x==="SVG"?E===null?null:(E.resize(ut.width,ut.height,ut.width,ut.height),E.ownerDocument=ct,E.hs=dt,nd(a,E.context,ot,new li(Math.ceil(b),Math.ceil(Et)),z,Ft,nt,st,vt,y),E.context):(a.Xm=!1,nd(a,xt,ot,new li(Math.ceil(b),Math.ceil(Et)),z,Ft,nt,st,vt,y),a.Xm=!0,ut.context)}zi.Object.defineProperties(le.prototype,{renderer:{get:function(){return this.nl},set:function(a){this instanceof ht||(a===""&&(a="default"),a=a.toLowerCase(),a!==this.nl&&(this.nl=a,a==="default"||a==="canvas"?(a=this.pj.get("svg"),a!==null&&a.Oa.remove(),this.ta&&(this.ib=this.ta.context)):a==="svg"?(this.pj.contains("svg")?a=this.pj.get("svg"):(a=new Gl(this,Xe.document),this.bs("svg",a)),this.div!==null&&this.div.appendChild(a.Oa),this.ib=a.context,this.ta&&(this.ta.context.setTransform(this.Mb,0,0,this.Mb,0,0),this.ta.context.clearRect(0,0,this.Aa,this.ya))):a!=="debug"||this.pj.contains("SVG")||(a=new Gl(this,Xe.document),this.bs("SVG",a),a.Oa.style.backgroundColor="whitesmoke",this.div!==null&&this.div.after(a.Oa)),this.hk()))}},div:{get:function(){return this.Ka},set:function(a){if(this.Ka!==a){var y=this.Ka;y!==null?(y.H=void 0,y.goDiagram=void 0,y.go=void 0,y.innerHTML="",this.ta!==null&&(y=this.ta.Oa,this.removeEventListener(y,"pointermove",this.dk,!1),this.removeEventListener(y,"pointerdown",this.ui,!1),this.removeEventListener(y,"pointerup",this.fk,!1),this.removeEventListener(y,"pointerout",this.ek,!1),this.removeEventListener(y,"pointercancel",this.ck,!1),this.ta.mx()),this.ol&&(this.ol.disconnect(),this.ol=null),y=this.toolManager,y!==null&&(y.mouseDownTools.each(function(x){x.cancelWaitAfter()}),y.mouseMoveTools.each(function(x){x.cancelWaitAfter()}),y.mouseUpTools.each(function(x){x.cancelWaitAfter()})),y.cancelWaitAfter(),this.currentTool.doCancel(),this.ta=null,this.removeEventListener(Xe,"resize",this.Ov,!1),this.removeEventListener(Xe,"wheel",this.$j,!0),ru===this&&(ru=null)):this.ui===null&&(this.hf=!1),this.Ka=null,a!==null&&((y=a.H)&&(y.div=null),fp(this,a),this.hk())}}},$w:{get:function(){return this.Sq}},pi:{get:function(){return this.hf}},draggedLink:{get:function(){return this.nt},set:function(a){this.nt!==a&&(this.nt=a,a!==null&&(this.Vt=a.fromPort,this.Wt=a.toPort))}},Mx:{get:function(){return this.Vt},set:function(a){this.Vt=a}},Nx:{get:function(){return this.Wt},set:function(a){this.Wt=a}},animationManager:{get:function(){return this.Yd}},undoManager:{get:function(){return this.cc.undoManager}},skipsUndoManager:{get:function(){return this.Wg},set:function(a){this.Wg=a,this.cc.skipsUndoManager=a}},delaysLayout:{get:function(){return this.lt},set:function(a){this.lt=a}},opacity:{get:function(){return this.pb},set:function(a){var y=this.pb;y!==a&&((0>a||1<a)&&xi(a,"0 <= value <= 1",le,"opacity"),this.pb=a,this.g("opacity",y,a),this.N())}},validCycle:{get:function(){return this.wu},set:function(a){var y=this.wu;y!==a&&(this.wu=a,this.g("validCycle",y,a))}},layers:{get:function(){return this.Wa.iterator}},isModelReadOnly:{get:function(){var a=this.cc;return a===null?!1:a.isReadOnly},set:function(a){var y=this.cc;y!==null&&(y.isReadOnly=a)}},isReadOnly:{get:function(){return this.Gg},set:function(a){var y=this.Gg;y!==a&&(this.Gg=a,this.g("isReadOnly",y,a))}},isEnabled:{get:function(){return this.Jd},set:function(a){var y=this.Jd;y!==a&&(this.Jd=a,this.g("isEnabled",y,a))}},allowClipboard:{get:function(){return this.Us},set:function(a){var y=this.Us;y!==a&&(this.Us=a,this.g("allowClipboard",y,a))}},allowCopy:{get:function(){return this.Fi},set:function(a){var y=this.Fi;y!==a&&(this.Fi=a,this.g("allowCopy",y,a))}},allowDelete:{get:function(){return this.Gi},set:function(a){var y=this.Gi;y!==a&&(this.Gi=a,this.g("allowDelete",y,a))}},allowDragOut:{get:function(){return this.Vs},set:function(a){var y=this.Vs;y!==a&&(this.Vs=a,this.g("allowDragOut",y,a))}},allowDrop:{get:function(){return this.Ws},set:function(a){var y=this.Ws;y!==a&&(this.Ws=a,this.g("allowDrop",y,a))}},allowTextEdit:{get:function(){return this.Pi},set:function(a){var y=this.Pi;y!==a&&(this.Pi=a,this.g("allowTextEdit",y,a))}},allowGroup:{get:function(){return this.Hi},set:function(a){var y=this.Hi;y!==a&&(this.Hi=a,this.g("allowGroup",y,a))}},allowUngroup:{get:function(){return this.Qi},set:function(a){var y=this.Qi;y!==a&&(this.Qi=a,this.g("allowUngroup",y,a))}},allowInsert:{get:function(){return this.Ys},set:function(a){var y=this.Ys;y!==a&&(this.Ys=a,this.g("allowInsert",y,a))}},allowLink:{get:function(){return this.Ii},set:function(a){var y=this.Ii;y!==a&&(this.Ii=a,this.g("allowLink",y,a))}},allowRelink:{get:function(){return this.Ki},set:function(a){var y=this.Ki;y!==a&&(this.Ki=a,this.g("allowRelink",y,a))}},allowMove:{get:function(){return this.Ji},set:function(a){var y=this.Ji;y!==a&&(this.Ji=a,this.g("allowMove",y,a))}},allowReshape:{get:function(){return this.Li},set:function(a){var y=this.Li;y!==a&&(this.Li=a,this.g("allowReshape",y,a))}},allowResize:{get:function(){return this.Mi},set:function(a){var y=this.Mi;y!==a&&(this.Mi=a,this.g("allowResize",y,a))}},allowRotate:{get:function(){return this.Ni},set:function(a){var y=this.Ni;y!==a&&(this.Ni=a,this.g("allowRotate",y,a))}},allowSelect:{get:function(){return this.Oi},set:function(a){var y=this.Oi;y!==a&&(this.Oi=a,this.g("allowSelect",y,a))}},allowUndo:{get:function(){return this.Zs},set:function(a){var y=this.Zs;y!==a&&(this.Zs=a,this.g("allowUndo",y,a))}},allowZoom:{get:function(){return this.at},set:function(a){var y=this.at;y!==a&&(this.at=a,this.g("allowZoom",y,a))}},hasVerticalScrollbar:{get:function(){return this.nn},set:function(a){var y=this.nn;y!==a&&(this.nn=a,this.Ee=!0,this.N(),this.g("hasVerticalScrollbar",y,a),el(this,!1))}},hasHorizontalScrollbar:{get:function(){return this.mn},set:function(a){var y=this.mn;y!==a&&(this.mn=a,this.Ee=!0,this.N(),this.g("hasHorizontalScrollbar",y,a),el(this,!1))}},allowHorizontalScroll:{get:function(){return this.Xs},set:function(a){var y=this.Xs;y!==a&&(this.Xs=a,this.g("allowHorizontalScroll",y,a),el(this,!1))}},allowVerticalScroll:{get:function(){return this.$s},set:function(a){var y=this.$s;y!==a&&(this.$s=a,this.g("allowVerticalScroll",y,a),el(this,!1))}},scrollHorizontalLineChange:{get:function(){return this.iu},set:function(a){var y=this.iu;y!==a&&(0>a&&xi(a,">= 0",le,"scrollHorizontalLineChange"),this.iu=a,this.g("scrollHorizontalLineChange",y,a))}},scrollVerticalLineChange:{get:function(){return this.mu},set:function(a){var y=this.mu;y!==a&&(0>a&&xi(a,">= 0",le,"scrollVerticalLineChange"),this.mu=a,this.g("scrollVerticalLineChange",y,a))}},lastInput:{get:function(){return this.cj},set:function(a){this.cj=a}},previousInput:{get:function(){return this.Qg},set:function(a){this.Qg=a}},firstInput:{get:function(){return this.bq},set:function(a){this.bq=a}},currentCursor:{get:function(){return this.it},set:function(a){if(a===""&&(a=this.Op),this.it!==a){var y=this.ta,x=this.Ka;if(y!==null&&x!==null){this.it=a;var E=y.style.cursor;y.style.cursor=a,x.style.cursor=a,y.style.cursor===E&&(y.style.cursor="-webkit-"+a,x.style.cursor="-webkit-"+a,y.style.cursor===E&&(y.style.cursor="-moz-"+a,x.style.cursor="-moz-"+a,y.style.cursor===E&&(y.style.cursor=a,x.style.cursor=a)))}}}},defaultCursor:{get:function(){return this.Op},set:function(a){a===""&&(a="auto");var y=this.Op;y!==a&&(this.Op=a,this.g("defaultCursor",y,a))}},click:{get:function(){return this.zh},set:function(a){var y=this.zh;y!==a&&(this.zh=a,this.g("click",y,a))}},doubleClick:{get:function(){return this.Fh},set:function(a){var y=this.Fh;y!==a&&(this.Fh=a,this.g("doubleClick",y,a))}},contextClick:{get:function(){return this.Bh},set:function(a){var y=this.Bh;y!==a&&(this.Bh=a,this.g("contextClick",y,a))}},mouseOver:{get:function(){return this.Qh},set:function(a){var y=this.Qh;y!==a&&(this.Qh=a,this.g("mouseOver",y,a))}},mouseHover:{get:function(){return this.Oh},set:function(a){var y=this.Oh;y!==a&&(this.Oh=a,this.g("mouseHover",y,a))}},mouseHold:{get:function(){return this.Nh},set:function(a){var y=this.Nh;y!==a&&(this.Nh=a,this.g("mouseHold",y,a))}},mouseDragOver:{get:function(){return this.Qt},set:function(a){var y=this.Qt;y!==a&&(this.Qt=a,this.g("mouseDragOver",y,a))}},mouseDrop:{get:function(){return this.Lh},set:function(a){var y=this.Lh;y!==a&&(this.Lh=a,this.g("mouseDrop",y,a))}},handlesDragDropForTopLevelParts:{get:function(){return this.xt},set:function(a){var y=this.xt;y!==a&&(this.xt=a,this.g("handlesDragDropForTopLevelParts",y,a))}},mouseEnter:{get:function(){return this.Mh},set:function(a){var y=this.Mh;y!==a&&(this.Mh=a,this.g("mouseEnter",y,a))}},mouseLeave:{get:function(){return this.Ph},set:function(a){var y=this.Ph;y!==a&&(this.Ph=a,this.g("mouseLeave",y,a))}},toolTip:{get:function(){return this.$h},set:function(a){var y=this.$h;y!==a&&(this.$h=a,this.g("toolTip",y,a))}},contextMenu:{get:function(){return this.Ch},set:function(a){var y=this.Ch;y!==a&&(this.Ch=a,this.g("contextMenu",y,a))}},commandHandler:{get:function(){return this.nb},set:function(a){this.nb!==a&&(this.nb=a,a.Xe(this))}},toolManager:{get:function(){return this.te},set:function(a){this.te!==a&&(this.te=a,a.diagram=this)}},defaultTool:{get:function(){return this.ob},set:function(a){var y=this.ob;y!==a&&(this.ob=a,a.diagram=this,this.currentTool===y&&(this.currentTool=a))}},currentTool:{get:function(){return this.hb},set:function(a){var y=this.hb;y&&(y.isActive&&y.doDeactivate(),y.cancelWaitAfter(),y.doStop()),a===null&&(a=this.defaultTool),a!==null&&(this.hb=a,a.diagram=this,a.doStart())}},selection:{get:function(){return this.Hw}},maxSelectionCount:{get:function(){return this.Nt},set:function(a){var y=this.Nt;if(y!==a)if(0<=a&&!isNaN(a)){if(this.Nt=a,this.g("maxSelectionCount",y,a),!this.undoManager.isUndoingRedoing&&(a=this.selection.count-a,0<a)){this.R("ChangingSelection",this.selection),y=this.selection.Fa();for(var x=0;x<a;x++)y[x].isSelected=!1;this.R("ChangedSelection",this.selection)}}else xi(a,">= 0",le,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{get:function(){return this.St},set:function(a){var y=this.St;y!==a&&(this.St=a,this.g("nodeSelectionAdornmentTemplate",y,a))}},groupSelectionAdornmentTemplate:{get:function(){return this.wt},set:function(a){var y=this.wt;y!==a&&(this.wt=a,this.g("groupSelectionAdornmentTemplate",y,a))}},linkSelectionAdornmentTemplate:{get:function(){return this.Kt},set:function(a){var y=this.Kt;y!==a&&(this.Kt=a,this.g("linkSelectionAdornmentTemplate",y,a))}},highlighteds:{get:function(){return this.nw}},isModified:{get:function(){var a=this.undoManager;return a.isEnabled?a.currentTransaction!==null?!0:this.rn&&this.Ce!==a.historyIndex:this.rn},set:function(a){if(this.rn!==a){this.rn=a;var y=this.undoManager;!a&&y.isEnabled&&(this.Ce=y.historyIndex),a||qg(this)}}},model:{get:function(){return this.cc},set:function(a){var y=this.cc;if(y!==a){this.currentTool.doCancel(),y&&y.undoManager!==a.undoManager&&y.undoManager.isInTransaction&&It("Do not replace a Diagram.model while a transaction is in progress."),this.animationManager.Cc(!0);var x=cp(this,!0);this.hf=!1,this.fn=!0,this.Ce=-2,this.kg=!1;var E=this.vb;this.vb=!0,nu(this.animationManager,"Model"),y&&(this.pf!==null&&this.pf.each(function(z){return y.ik(z)}),y.ik(this.Oc)),this.cc=a,this.partManager=Ep(this.cc.type);for(var b=0;b<x.length;b++)this.add(x[b]);a.Pe(this.Hb),this.partManager.addAllModeledParts(),a.ik(this.Hb),a.Pe(this.Oc),this.pf!==null&&this.pf.each(function(z){return a.Pe(z)}),this.vb=E,this.Ya(),this.vb||this.N(),y&&a.undoManager.copyProperties(y.undoManager)}}},aa:{get:function(){return this.rw},set:function(a){this.rw=a}},As:{get:function(){return this.sy}},skipsModelSourceBindings:{get:function(){return this.Iw},set:function(a){this.Iw=a}},Ns:{get:function(){return this.ou},set:function(a){this.ou=a}},nodeTemplate:{get:function(){return this.Lg.I("")},set:function(a){var y=this.Lg.I("");y!==a&&(this.Lg.add("",a),this.g("nodeTemplate",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},nodeTemplateMap:{get:function(){return this.Lg},set:function(a){var y=this.Lg;y!==a&&(this.Lg=a,this.g("nodeTemplateMap",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},groupTemplate:{get:function(){return this.Yi.I("")},set:function(a){var y=this.Yi.I("");y!==a&&(this.Yi.add("",a),this.g("groupTemplate",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},groupTemplateMap:{get:function(){return this.Yi},set:function(a){var y=this.Yi;y!==a&&(this.Yi=a,this.g("groupTemplateMap",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},linkTemplate:{get:function(){return this.Kh.I("")},set:function(a){var y=this.Kh.I("");y!==a&&(this.Kh.add("",a),this.g("linkTemplate",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},linkTemplateMap:{get:function(){return this.Kh},set:function(a){var y=this.Kh;y!==a&&(this.Kh=a,this.g("linkTemplateMap",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},isMouseCaptured:{get:function(){return this.qw},set:function(a){var y=this.ta;y!==null&&(y=y.Oa,y instanceof SVGElement||(a?(this.lastInput.bubbles=!1,this.removeEventListener(y,"pointermove",this.dk,!1),this.removeEventListener(y,"pointerdown",this.ui,!1),this.removeEventListener(y,"pointerup",this.fk,!1),this.removeEventListener(y,"pointerout",this.ek,!1),this.removeEventListener(y,"pointercancel",this.ck,!1),this.addEventListener(Xe,"pointermove",this.dk,!0),this.addEventListener(Xe,"pointerdown",this.ui,!0),this.addEventListener(Xe,"pointerup",this.fk,!0),this.addEventListener(Xe,"pointerout",this.ek,!0),this.addEventListener(Xe,"pointercancel",this.ck,!0),this.removeEventListener(y,"wheel",this.$j,!1),this.addEventListener(Xe,"wheel",this.$j,!0),this.addEventListener(Xe,"selectstart",this.preventDefault,!1)):(this.removeEventListener(Xe,"pointermove",this.dk,!0),this.removeEventListener(Xe,"pointerdown",this.ui,!0),this.removeEventListener(Xe,"pointerup",this.fk,!0),this.removeEventListener(Xe,"pointerout",this.ek,!0),this.removeEventListener(Xe,"pointercancel",this.ck,!0),this.addEventListener(y,"pointermove",this.dk,!1),this.addEventListener(y,"pointerdown",this.ui,!1),this.addEventListener(y,"pointerup",this.fk,!1),this.addEventListener(y,"pointerout",this.ek,!1),this.addEventListener(y,"pointercancel",this.ck,!1),this.removeEventListener(Xe,"wheel",this.$j,!0),this.removeEventListener(Xe,"selectstart",this.preventDefault,!1),this.addEventListener(y,"wheel",this.$j,!1)),this.qw=a))}},position:{get:function(){return this.pa},set:function(a){var y=Pt.alloc().assign(this.pa);if(!y.D(a)){var x=this.viewportBounds.copy();this.pa.assign(a),Hg(this.animationManager,y,this.pa),this.vb||this.ta===null&&!this.wo.w()?Vl(this):(this.vb=!0,a=this.scale,gp(this,this.Sp,this.Aa/a,this.ya/a,this.zk,!1),this.vb=!1),this.vb||this.onViewportBoundsChanged(x,this.viewportBounds,this.Ca,!1)}Pt.free(y)}},initialPosition:{get:function(){return this.zt},set:function(a){this.zt.D(a)||(this.zt=a.J())}},initialScale:{get:function(){return this.At},set:function(a){this.At!==a&&(this.At=a)}},grid:{get:function(){return this.fe===null&&(this.fe=Xg(this)),this.fe},set:function(a){var y=this.fe;if(y!==a){y===null&&(y=this.fe=Xg(this)),a.type!==si.Grid&&It("Diagram.grid must be a Panel of type Panel.Grid");var x=y.panel;x!==null&&x.remove(y),this.fe=a,a.name="GRID",x!==null&&x.add(a),Kl(this),this.N(),this.g("grid",y,a)}}},viewportBounds:{get:function(){return this.Rw}},viewSize:{get:function(){return this.wo},set:function(a){var y=this.viewSize;y.D(a)||(this.wo=a=a.J(),this.ya=this.Aa=0,a.w()?(this.Aa=a.width,this.ya=a.height):this.Ka!==null&&(this.Aa=this.Ka.clientWidth||1,this.ya=this.Ka.clientHeight||1),Vl(this),this.Ya(),this.g("viewSize",y,a),this.redraw())}},fixedBounds:{get:function(){return this.ut},set:function(a){var y=this.ut;y.D(a)||(a.width!==-1/0&&a.height!==1/0&&a.height!==-1/0||It("fixedBounds width/height must not be Infinity"),this.ut=a=a.J(),this.Ya(),this.g("fixedBounds",y,a))}},scrollMargin:{get:function(){return this.rj},set:function(a){typeof a=="number"&&(a=new jn(a));var y=this.rj;y.D(a)||(this.rj=a=a.J(),this.g("scrollMargin",y,a),this.hk())}},scrollMode:{get:function(){return this.sj},set:function(a){var y=this.sj;y!==a&&(this.sj=a,a===nh&&el(this,!1),this.g("scrollMode",y,a),this.Ee=!0,this.N())}},scrollsPageOnFocus:{get:function(){return this.nu},set:function(a){var y=this.nu;y!==a&&(this.nu=a,this.g("scrollsPageOnFocus",y,a))}},positionComputation:{get:function(){return this.Zt},set:function(a){var y=this.Zt;y!==a&&(this.Zt=a,el(this,!1),this.g("positionComputation",y,a))}},scaleComputation:{get:function(){return this.fu},set:function(a){var y=this.fu;y!==a&&(this.fu=a,Mp(this,this.scale,this.scale),this.g("scaleComputation",y,a))}},documentBounds:{get:function(){return this.Sp}},isVirtualized:{get:function(){return this.It},set:function(a){var y=this.It;y!==a&&(this.It=a,this.g("isVirtualized",y,a))}},scale:{get:function(){return this.Ca},set:function(a){var y=this.Ca;y!==a&&Mp(this,y,a)}},defaultScale:{get:function(){return this.Pp},set:function(a){this.Pp=a}},autoScale:{get:function(){return this.yh},set:function(a){var y=this.yh;y!==a&&(this.yh=a,this.g("autoScale",y,a),a!==Cs&&el(this,!1))}},initialAutoScale:{get:function(){return this.Fg},set:function(a){var y=this.Fg;y!==a&&(this.Fg=a,this.g("initialAutoScale",y,a))}},initialViewportSpot:{get:function(){return this.Bt},set:function(a){var y=this.Bt;y!==a&&(a.sb()||It("initialViewportSpot must be a specific Spot: "+a),this.Bt=a,this.g("initialViewportSpot",y,a))}},initialDocumentSpot:{get:function(){return this.yt},set:function(a){var y=this.yt;y!==a&&(a.sb()||It("initialViewportSpot must be a specific Spot: "+a),this.yt=a,this.g("initialDocumentSpot",y,a))}},minScale:{get:function(){return this.Ot},set:function(a){var y=this.Ot;y!==a&&(0<a?(this.Ot=a,this.g("minScale",y,a),a>this.scale&&(this.scale=a)):xi(a,"> 0",le,"minScale"))}},maxScale:{get:function(){return this.Mt},set:function(a){var y=this.Mt;y!==a&&(0<a?(this.Mt=a,this.g("maxScale",y,a),a<this.scale&&(this.scale=a)):xi(a,"> 0",le,"maxScale"))}},zoomPoint:{get:function(){return this.zu},set:function(a){this.zu.D(a)||(this.zu=a=a.J())}},contentAlignment:{get:function(){return this.zk},set:function(a){var y=this.zk;y.D(a)||(this.zk=a=a.J(),this.g("contentAlignment",y,a),el(this,!1))}},initialContentAlignment:{get:function(){return this.pq},set:function(a){var y=this.pq;y.D(a)||(this.pq=a=a.J(),this.g("initialContentAlignment",y,a))}},padding:{get:function(){return this.yb},set:function(a){typeof a=="number"&&(a=new jn(a));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.Ya(),this.g("padding",y,a))}},partManager:{get:function(){return this.Pc},set:function(a){var y=this.Pc;y!==a&&(a.diagram!==null&&It("Cannot share PartManagers between Diagrams: "+a.toString()),y&&y.Xe(null),this.Pc=a,a.Xe(this))}},nodes:{get:function(){return this.partManager.nodes.iterator}},links:{get:function(){return this.partManager.links.iterator}},parts:{get:function(){return this.partManager.parts.iterator}},layout:{get:function(){return this.Sc},set:function(a){var y=this.Sc;y!==a&&(this.Sc=a,a.diagram=this,a.group=null,this.xh=!0,this.g("layout",y,a),this.$b())}},isTreePathToChildren:{get:function(){return this.Ht},set:function(a){var y=this.Ht;if(y!==a&&(this.Ht=a,this.g("isTreePathToChildren",y,a),!this.undoManager.isUndoingRedoing))for(a=this.nodes;a.next();)Yp(a.value)}},treeCollapsePolicy:{get:function(){return this.uu},set:function(a){var y=this.uu;y!==a&&(a!==rh&&a!==Po&&a!==dd&&It("Unknown Diagram.treeCollapsePolicy: "+a),this.uu=a,this.g("treeCollapsePolicy",y,a))}},Ue:{get:function(){return this.pw},set:function(a){this.pw=a}},avoidanceCellSize:{get:function(){return this.aw},set:function(a){this.Xh=null,this.aw=new li(Math.max(1,a.width),Math.max(1,a.height))}},avoidanceLimit:{get:function(){return this.bw},set:function(a){this.bw=Math.max(1,a)}},autoScrollInterval:{get:function(){return this.vp},set:function(a){var y=this.vp;y!==a&&(this.vp=a,this.g("autoScrollInterval",y,a))}},autoScrollRegion:{get:function(){return this.xp},set:function(a){typeof a=="number"&&(a=new jn(a));var y=this.xp;y.D(a)||(this.xp=a=a.J(),this.Ya(),this.g("autoScrollRegion",y,a))}}}),zi.Object.defineProperties(le,{licenseKey:{get:function(){return Ip.jc()},set:function(a){Ip.add(a.replace(/\s/g,""))}},version:{get:function(){return Tc}}}),le.prototype.makeImageData=le.prototype.Jx,le.prototype.makeImage=le.prototype.Wz,le.prototype.cacheGroupExternalLinks=le.prototype.Fu,le.prototype.addRenderer=le.prototype.bs,le.prototype.makeSVG=le.prototype.av,le.prototype.makeSvg=le.prototype.Cs,le.prototype.stopAutoScroll=le.prototype.ug,le.prototype.doAutoScroll=le.prototype.gs,le.prototype.isUnoccupied=le.prototype.Yj,le.prototype.raiseDiagramEvent=le.prototype.R,le.prototype.removeDiagramListener=le.prototype.am,le.prototype.addDiagramListener=le.prototype.Bj,le.prototype.findTreeRoots=le.prototype.yz,le.prototype.layoutDiagram=le.prototype.Uz,le.prototype.findTopLevelGroups=le.prototype.qz,le.prototype.findTopLevelNodesAndLinks=le.prototype.rz,le.prototype.ensureBounds=le.prototype.Va,le.prototype.findLinksByExample=le.prototype.ls,le.prototype.findNodesByExample=le.prototype.ms,le.prototype.findLinkForData=le.prototype.Kc,le.prototype.findNodeForData=le.prototype.ii,le.prototype.findPartForData=le.prototype.Lc,le.prototype.findLinkForKey=le.prototype.findLinkForKey,le.prototype.findNodeForKey=le.prototype.Vb,le.prototype.findPartForKey=le.prototype.findPartForKey,le.prototype.rebuildParts=le.prototype.Wd,le.prototype.transformViewToDoc=le.prototype.Ps,le.prototype.transformRectDocToView=le.prototype.zA,le.prototype.transformDocToView=le.prototype.op,le.prototype.centerRect=le.prototype.es,le.prototype.scrollToRect=le.prototype.tv,le.prototype.scroll=le.prototype.scroll,le.prototype.highlightCollection=le.prototype.Jz,le.prototype.highlight=le.prototype.Iz,le.prototype.selectCollection=le.prototype.rA,le.prototype.select=le.prototype.select,le.prototype.updateAllRelationshipsFromData=le.prototype.rp,le.prototype.updateAllTargetBindings=le.prototype.updateAllTargetBindings,le.prototype.commit=le.prototype.commit,le.prototype.rollbackTransaction=le.prototype.Kf,le.prototype.commitTransaction=le.prototype.eb,le.prototype.startTransaction=le.prototype.Ea,le.prototype.raiseChanged=le.prototype.g,le.prototype.raiseChangedEvent=le.prototype.cb,le.prototype.removeChangedListener=le.prototype.ik,le.prototype.addChangedListener=le.prototype.Pe,le.prototype.removeModelChangedListener=le.prototype.mA,le.prototype.addModelChangedListener=le.prototype.Yw,le.prototype.findLayer=le.prototype.Qj,le.prototype.removeLayer=le.prototype.kA,le.prototype.addLayerAfter=le.prototype.Cy,le.prototype.addLayerBefore=le.prototype.Ww,le.prototype.addLayer=le.prototype.Al,le.prototype.moveParts=le.prototype.moveParts,le.prototype.copyParts=le.prototype.Kj,le.prototype.removeParts=le.prototype.Is,le.prototype.remove=le.prototype.remove,le.prototype.add=le.prototype.add,le.prototype.clearDelayedGeometries=le.prototype.bx,le.prototype.setProperties=le.prototype.nm,le.prototype.attach=le.prototype.Du,le.prototype.set=le.prototype.set,le.prototype.resetInputOptions=le.prototype.Sx,le.prototype.setInputOption=le.prototype.sA,le.prototype.getInputOption=le.prototype.Ql,le.prototype.resetRenderingHints=le.prototype.Tx,le.prototype.setRenderingHint=le.prototype.Xx,le.prototype.getRenderingHint=le.prototype.Gf,le.prototype.maybeUpdate=le.prototype.bd,le.prototype.requestUpdate=le.prototype.$b,le.prototype.delayInitialization=le.prototype.Xy,le.prototype.isUpdateRequested=le.prototype.Pz,le.prototype.invalidateDocumentBounds=le.prototype.Ya,le.prototype.findObjectsNear=le.prototype.og,le.prototype.findPartsNear=le.prototype.mz,le.prototype.findObjectsIn=le.prototype.Cf,le.prototype.findPartsIn=le.prototype.ux,le.prototype.findObjectsAt=le.prototype.ji,le.prototype.findPartsAt=le.prototype.lz,le.prototype.findObjectAt=le.prototype.ic,le.prototype.findPartAt=le.prototype.Ol,le.prototype.focusObject=le.prototype.zz,le.prototype.alignDocument=le.prototype.Jy,le.prototype.zoomToRect=le.prototype.BA,le.prototype.zoomToFit=le.prototype.zoomToFit,le.prototype.diagramScroll=le.prototype.kx,le.prototype.focus=le.prototype.focus;var fd=new ji,rv=null,lo=Xe.document!==void 0,Nc=null,Zh="",Cs=new ze(le,"None",0),Pa=new ze(le,"Uniform",1),Kh=new ze(le,"UniformToFill",2),vf=new ze(le,"CycleAll",10),Ap=new ze(le,"CycleNotDirected",11),Dp=new ze(le,"CycleNotDirectedFast",12),Fp=new ze(le,"CycleNotUndirected",13),Bp=new ze(le,"CycleDestinationTree",14),Op=new ze(le,"CycleSourceTree",15),nh=new ze(le,"DocumentScroll",1),mf=new ze(le,"InfiniteScroll",2),rh=new ze(le,"TreeParentCollapsed",21),Po=new ze(le,"AllParentsCollapsed",22),dd=new ze(le,"AnyParentsCollapsed",23),Ip=new Me,Tc="2.3.10",Lc="image",yf=null,ov=!1;function vs(){if(lo){var a=Xe.document.createElement("canvas"),y=a.getContext("2d"),x=qi("7ca11abfd022028846");y[x]=qi("398c3597c01238");for(var E=["5da73c80a36455d7038e4972187c3cae51fd22",mi.Dx+"4ae6247590da4bb21c324ba3a84e385776",bn.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",Gt.za],b=1;5>b;b++)y[qi("7ca11abfd7330390")](qi(E[b-1]),10,15*b);for(y[x]=qi("39f046ebb36e4b"),x=1;5>x;x++)y[qi("7ca11abfd7330390")](qi(E[x-1]),10,15*x);(E.length!==4||E[0][0]!=="5"||E[3][0]!=="7")&&(bn.prototype.Cd=bn.prototype.Eu),yf=a}}le.className="Diagram",le.fromDiv=function(a){var y=a;return typeof a=="string"&&(y=Xe.document.getElementById(a)),y instanceof HTMLDivElement&&y.H instanceof le?y.H:null},le.inherit=function(a,y){function x(){}if(Object.getPrototypeOf(a).prototype)throw Error(`Used go.Diagram.inherit defining already defined class
|
|
`+a);x.prototype=y.prototype,a.prototype=new x,a.prototype.constructor=a},le.useDOM=function(a){lo=a?Xe.document!==void 0:!1},le.isUsingDOM=function(){return lo},le.None=Cs,le.Uniform=Pa,le.UniformToFill=Kh,le.CycleAll=vf,le.CycleNotDirected=Ap,le.CycleNotDirectedFast=Dp,le.CycleNotUndirected=Fp,le.CycleDestinationTree=Bp,le.CycleSourceTree=Op,le.DocumentScroll=nh,le.InfiniteScroll=mf,le.TreeParentCollapsed=rh,le.AllParentsCollapsed=Po,le.AnyParentsCollapsed=dd;function sv(){this.wy=null,this.j="zz@orderNum",this._tk==="63ad05bbe23a1786468a4c741b6d2"?this.Rc=this.j=!0:this.Rc=null}function Ac(a,y){if(y.ib.setTransform(y.Mb,0,0,y.Mb,0,0),y.ib.yc(),a.Rc===null)t:{y="f";var x=Xe[qi("76a715b2f73f148a")][qi("72ba13b5")]||"";if(a.Rc=!0,lo){var E=le[qi("76a115b6ed251eaf4692")];if(E)for(var b=Ip.iterator;b.next()&&(E=b.value,E=qi(E).split(qi("39e9")),!(6>E.length));){var z=qi(E[1]).split(".");if(E[4]!=="7da71ca0")break;var tt=qi(mi[qi("6cae19")]).split(".");if(z[0]>tt[0]||z[0]===tt[0]&&z[1]>=tt[1]){var it=Xe[qi("74a900bae4370f8b51")][qi("6fbb13a1c2311e8a57")].toLowerCase();if(tt=it[qi("73a612b6fb191d")](qi("3aad1ab6e022098b4dc4")),z=qi(E[2]),-1<tt&&(it=it[qi("73a612b6fb191d")](z.toLowerCase()+"/"),a.Rc=!(-1<it&&it<tt),!a.Rc))break;for(tt=x[qi("76ad18b4f73e")],it=x[qi("73a612b6fb191d")](qi("35e7"))+2;it<tt;it++)y+=x[it];if(tt=y[qi("73a612b6fb191d")](z),0>tt&&z!==qi("7da71ca0ad381e90")&&(tt=y[qi("73a612b6fb191d")](qi("76a715b2ef3e149757"))),0>tt&&(tt=y[qi("73a612b6fb191d")](qi("76a715b2ef3e149757"))),0>tt&&(tt=y[qi("73a612b6fb191d")](qi("2bfa41fdb3784bca12"))),0>tt&&(tt=x[qi("73a612b6fb191d")](qi("7baa19a6f76c1988428554"))),a.Rc=!(0<=tt&&tt<y[qi("73a612b6fb191d")](qi("35"))||y[qi("73a612b6fb191d")](qi("35"))===-1),!a.Rc||x[qi("73a612b6fb191d")](qi("7fb002b6ed25128b4da25b2e"))&&(a.Rc=!(-1<x[qi("73a612b6fb191d")](z)),!a.Rc)||(tt=Xe[qi("76a715b2f73f148a")][qi("69ad17a1e03e")],it=tt[qi("73a612b6fb191d")](qi("7fb002b6ed25128b4da25b2e")),-1<it&&(a.Rc=!(tt[qi("73a612b6fb191d")](z)>it),!a.Rc)))break;if(z[0]==="#"){tt=Xe.document.createElement("div");for(var nt=E[0].replace(/[A-Za-z]/g,"");4>nt.length;)nt+="9";if(it=nt,nt=nt.substr(nt.length-4),E="",E+=["gsh","gsf"][parseInt(nt.substr(0,1),10)%2],E+=["Header","Background","Display","Feedback"][parseInt(nt.substr(0,1),10)%4],tt[qi("79a417a0f0181a8946")]=E,Xe.document[qi("78a712aa")]){Xe.document[qi("78a712aa")][qi("7bb806b6ed32388c4a875b")](tt),nt=Xe.getComputedStyle(tt).getPropertyValue(qi("78a704b7e62456904c9b12701b6532a8"));var ot=Xe.getComputedStyle(tt).getPropertyValue(qi("75b817b0ea2202"));if(Xe.document[qi("78a712aa")][qi("68ad1bbcf533388c4a875b")](tt),nt){if(tt=Xe[qi("77a902b0eb1b1e804a8a")],ot==="0."+parseInt(it,10)%100||nt.indexOf(parseInt(z[1]+z[2],16))!==-1&&nt.indexOf(parseInt(z[3]+z[4],16))!==-1){a.Rc=!1;break}else if(tt&&tt(qi("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(E="."+E,z=0;z<document.styleSheets.length;z++){tt=document.styleSheets[z].rules||document.styleSheets[z].cssRules;for(var st in tt)if(E===tt[st].selectorText){a.Rc=!1;break t}}}}else a.Rc=null,a.Rc=!1}}}else{for(st=x[qi("76ad18b4f73e")],b=x[qi("73a612b6fb191d")](qi("35e7"))+2;b<st;b++)y+=x[b];x=y[qi("73a612b6fb191d")](qi("7da71ca0ad381e90")),a.Rc=!(0<=x&&x<y[qi("73a612b6fb191d")](qi("35")))}}}return 0<a.Rc&&a!==a.wy}sv.className="DiagramHelper";function Nu(a){this.j=a===void 0?new Pt:a,this.o=new Pt}zi.Object.defineProperties(Nu.prototype,{point:{get:function(){return this.j},set:function(a){this.j=a}},shifted:{get:function(){return this.o},set:function(a){this.o=a}}});var xf="DraggingInfo";Nu.className="DraggingInfo";function et(a,y,x){this.node=a,this.info=y,this.Su=x}et.className="DraggingNodeInfoPair";function rt(){this.reset()}rt.prototype.reset=function(){this.isGridSnapEnabled=!1,this.isGridSnapRealtime=!0,this.gridSnapCellSize=new li(NaN,NaN).freeze(),this.gridSnapCellSpot=qn,this.gridSnapOrigin=new Pt(NaN,NaN).freeze(),this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1,this.dragsMembers=this.groupsAlwaysMove=!0},rt.className="DraggingOptions";function lt(a,y){if(typeof a=="string"||Xe.Element&&a instanceof Element)var x=le.call(this,a)||this;else x=le.call(this)||this,y=a;return at(x),y&&x.nm(y),x}Vi(lt,le);function at(a){a.allowDragOut=!0,a.allowMove=!1,a.isReadOnly=!0,a.contentAlignment=mr,a.layout=new is}lt.prototype.reset=function(){le.prototype.reset.call(this),at(this)},lt.className="Palette";function ht(a,y){if(typeof a=="string"||Xe.Element&&a instanceof Element)var x=le.call(this,a)||this;else x=le.call(this)||this,y=a;var E=x;x.animationManager.isEnabled=!1,x.vb=!0,x.V=null,x.mn=!1,x.nn=!1,x.F=!0,x.u=!0,x.ia=0,x.o=!1,x.ql=null,x.Xx("drawShadows",!1),a=new tn;var b=new Rn;return b.stroke="magenta",b.strokeWidth=2,b.fill="transparent",b.name="BOXSHAPE",a.selectable=!0,a.selectionAdorned=!1,a.selectionObjectName="BOXSHAPE",a.locationObjectName="BOXSHAPE",a.resizeObjectName="BOXSHAPE",a.cursor="move",a.add(b),x.j=a,x.allowCopy=!1,x.allowDelete=!1,x.allowSelect=!0,x.autoScrollRegion=new jn(0,0,0,0),x.pa.h(0,0),x.toolManager.gb("Dragging",new Lt,x.toolManager.mouseMoveTools),x.click=function(){var z=E.observed;if(z!==null){var tt=z.viewportBounds,it=E.lastInput.documentPoint;z.position=new Pt(it.x-tt.width/2,it.y-tt.height/2)}},x.Pf=function(){E.Ya(),kt(E)},x.Xd=function(){E.observed!==null&&(E.Ya(),E.N())},x.Ha=function(){1>E.updateDelay?E.N():E.o||(E.o=!0,setTimeout(function(){return E.redraw()},E.updateDelay))},x.Of=function(){E.observed!==null&&kt(E)},x.autoScale=Pa,x.vb=!1,y&&Object.assign(x,y),x}Vi(ht,le),ht.prototype.computePixelRatio=function(){return 1},ht.prototype.redraw=function(){if(this.o&&1<=this.updateDelay){this.o=!1;var a=this.ta,y=this.ib;if(a!==null&&y!==null){if(Ec(this),this.ql===null){var x=new nl(null);x.width=a.width,x.height=a.height,this.ql=x}try{this.ta=this.ql,this.ib=this.ta.context,this.ib.Vc(!0),this.ib.setTransform(1,0,0,1,0,0),this.ib.clearRect(0,0,this.ta.width,this.ta.height),mt(this)}finally{this.ta=a,this.ib=y}}}le.prototype.redraw.call(this)},ht.prototype.gc=function(){if(this.Ka===null&&It("No div specified"),this.ta===null&&It("No canvas specified"),!(this.ta instanceof Gl)&&(I0(this.box),this.Fc)){var a=this.observed;if(a!==null&&!a.animationManager.defaultAnimation.isAnimating&&a.pi){Ec(this);var y=this.ta;a=this.ib,a.Vc(!0),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,y.width,y.height),1>this.updateDelay?mt(this):this.ql!==null&&(a.drawImage(this.ql.Oa,0,0),y=this.Ab,y.reset(),this.scale!==1&&y.scale(this.scale),this.position.x===0&&this.position.y===0||y.translate(-this.position.x,-this.position.y),a.scale(this.Mb,this.Mb),a.transform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy),a.yc()),y=this.Wa.s;for(var x=y.length,E=0;E<x;E++)y[E].gc(a,this);this.Fc=this.vd=!1}}};function mt(a){var y=a.observed;if(y!==null){var x=a.drawsTemporaryLayers,E=a.drawsGrid&&x,b=y.grid;E&&b!==null&&b.visible&&!isNaN(b.width)&&!isNaN(b.height)&&(b=be.alloc().assign(a.viewportBounds).ed(y.viewportBounds),Kl(y,b),be.free(b),hs(y));var z=a.Ab;z.reset(),a.scale!==1&&z.scale(a.scale),a.position.x===0&&a.position.y===0||z.translate(-a.position.x,-a.position.y),b=a.ib,b.scale(a.Mb,a.Mb),b.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),b.yc(),y=y.Wa.s,z=y.length;for(var tt=0;tt<z;tt++){var it=y[tt],nt=a;if(it.visible&&it.opacity!==0){var ot=it.diagram.grid.part;if(!x&&it.isTemporary)E&&ot.layer===it&&(it=Pu(it,b),ot.gc(b,nt),b.globalAlpha=it);else{for(var st=Pu(it,b),ut=nt.scale,ct=be.alloc(),dt=it.Pa.s,vt=dt.length,xt=0;xt<vt;xt++){var Tt=dt[xt];(E||Tt!==ot)&&it.Oj(b,Tt,nt,null,ut,ct,!1)}be.free(ct),b.globalAlpha=st}}}}}function kt(a){var y=a.box;if(y!==null){var x=a.observed;if(x!==null){a.Fc=!0,x=x.viewportBounds;var E=y.selectionObject,b=li.alloc();b.h(x.width,x.height),E.desiredSize=b,li.free(b),a=2/a.scale,E instanceof Rn&&(E.strokeWidth=a),y.location=new Pt(x.x-a/2,x.y-a/2),y.isSelected=!0}}}ht.prototype.computeBounds=function(){var a=this.observed;if(a===null)return Bo;var y=a.documentBounds.copy();return y.ed(a.viewportBounds),y},ht.prototype.invalidateViewport=function(){this.Fc!==!0&&(this.Fc=!0,this.$b())},ht.prototype.onViewportBoundsChanged=function(a,y,x,E){this.vb||(this.vd=!0,this.N(),this.Ee=!0,this.Ya(),kt(this),this.fc.scale=x,this.fc.position.x=a.x,this.fc.position.y=a.y,this.fc.bounds.assign(a),this.fc.Oz=E,this.R("ViewportBoundsChanged",this.fc,a))},zi.Object.defineProperties(ht.prototype,{observed:{get:function(){return this.V},set:function(a){var y=this.V;if(a instanceof ht&&It("Overview.observed Diagram may not be an Overview itself: "+a),y!==a){if(y!==null&&(this.remove(this.box),y.am("ViewportBoundsChanged",this.Pf),y.am("DocumentBoundsChanged",this.Xd),y.am("InvalidateDraw",this.Ha),y.am("AnimationFinished",this.Of)),this.V=a,a!==null&&(a.Bj("ViewportBoundsChanged",this.Pf),a.Bj("DocumentBoundsChanged",this.Xd),a.Bj("InvalidateDraw",this.Ha),a.Bj("AnimationFinished",this.Of),this.add(this.box)),this.Ya(),a===null){this.ql=null;var x=this.ta,E=this.ib;x&&E&&(E.setTransform(1,0,0,1,0,0),E.clearRect(0,0,x.width,x.height))}else this.Ha(null),kt(this),this.N();this.g("observed",y,a)}}},box:{get:function(){return this.j},set:function(a){var y=this.j;y!==a&&(this.j=a,this.remove(y),this.add(this.j),kt(this),this.g("box",y,a))}},drawsTemporaryLayers:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a,this.redraw())}},drawsGrid:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a,this.redraw())}},updateDelay:{get:function(){return this.ia},set:function(a){0>a&&(a=0),this.ia!==a&&(this.ia=a)}}}),ht.className="Overview";function Lt(){to.call(this),this.j=null}Vi(Lt,to),Lt.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a===null||!a.allowMove||!a.allowSelect)return!1;var y=a.observed;if(y===null)return!1;var x=a.lastInput;return!x.left||a.currentTool!==this&&(!this.isBeyondDragSize()||x.isTouchEvent&&x.timestamp-a.firstInput.timestamp<this.delay)?!1:(this.findDraggablePart()===null&&(x=y.viewportBounds,this.j=new Pt(x.width/2,x.height/2),a=a.firstInput.documentPoint,y.position=new Pt(a.x-this.j.x,a.y-this.j.y)),!0)},Lt.prototype.doActivate=function(){this.j=null,to.prototype.doActivate.call(this)},Lt.prototype.doUpdateCursor=function(){var a=this.diagram,y=a.box;y!==null&&y.cursor&&(a.currentCursor=y.cursor)},Lt.prototype.moveParts=function(){var a=this.diagram,y=a.observed;if(y!==null){var x=a.box;if(x!==null){if(this.j===null){var E=a.firstInput.documentPoint;x=x.location,this.j=new Pt(E.x-x.x,E.y-x.y)}a=a.lastInput.documentPoint,y.position=new Pt(a.x-this.j.x,a.y-this.j.y)}}},Lt.className="OverviewDraggingTool";function Nt(){bi(this),this.H=ru,this.Ha=this.u=this.o=!0,this.F=this.V=this.nb=this.ia=!1,this.ij=this.j=null,this.Hb=1.05,this.Jt=NaN,this.sw=null,this.Au=NaN,this.yu=Bo,this.hb=!0,this.cg=null,this.ob=200}Nt.prototype.toString=function(){return"CommandHandler"},Nt.prototype.Xe=function(a){this.H=a},Nt.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput,x=Sr?y.meta:y.control,E=y.shift,b=y.alt,z=y.key;!x||z!=="C"&&z!=="Insert"?x&&z==="X"||E&&z==="Del"?this.canCutSelection()&&this.cutSelection():x&&z==="V"||E&&z==="Insert"?this.canPasteSelection()&&this.pasteSelection():x&&z==="Y"||b&&E&&z==="Backspace"?this.canRedo()&&this.redo():x&&z==="Z"||b&&z==="Backspace"?this.canUndo()&&this.undo():z==="Del"||z==="Backspace"?this.canDeleteSelection()&&this.deleteSelection():x&&z==="A"?this.canSelectAll()&&this.selectAll():z==="Esc"?this.canStopCommand()&&this.stopCommand():z==="Up"?a.allowVerticalScroll&&(x?a.scroll("pixel","up"):a.scroll("line","up")):z==="Down"?a.allowVerticalScroll&&(x?a.scroll("pixel","down"):a.scroll("line","down")):z==="Left"?a.allowHorizontalScroll&&(x?a.scroll("pixel","left"):a.scroll("line","left")):z==="Right"?a.allowHorizontalScroll&&(x?a.scroll("pixel","right"):a.scroll("line","right")):z==="PageUp"?E&&a.allowHorizontalScroll?a.scroll("page","left"):a.allowVerticalScroll&&a.scroll("page","up"):z==="PageDown"?E&&a.allowHorizontalScroll?a.scroll("page","right"):a.allowVerticalScroll&&a.scroll("page","down"):z==="Home"?x&&a.allowVerticalScroll?a.scroll("document","up"):!x&&a.allowHorizontalScroll&&a.scroll("document","left"):z==="End"?x&&a.allowVerticalScroll?a.scroll("document","down"):!x&&a.allowHorizontalScroll&&a.scroll("document","right"):z===" "?this.canScrollToPart()&&this.scrollToPart():z==="Subtract"?this.canDecreaseZoom()&&this.decreaseZoom():z==="Add"?this.canIncreaseZoom()&&this.increaseZoom():x&&z==="0"?this.canResetZoom()&&this.resetZoom():E&&z==="Z"?this.canZoomToFit()&&this.zoomToFit():x&&!E&&z==="G"?this.canGroupSelection()&&this.groupSelection():x&&E&&z==="G"?this.canUngroupSelection()&&this.ungroupSelection():z==="F2"||y.event&&y.event.key==="F2"?this.canEditTextBlock()&&this.editTextBlock():z==="ContextMenu"||y.event&&y.event.key==="ContextMenu"?this.canShowContextMenu()&&this.showContextMenu():y.bubbles=!0:this.canCopySelection()&&this.copySelection()},Nt.prototype.doKeyUp=function(){this.diagram.lastInput.bubbles=!0},Nt.prototype.stopCommand=function(){var a=this.diagram,y=a.currentTool;y instanceof Ur&&a.allowSelect&&a.clearSelection(),y!==null&&y.doCancel()},Nt.prototype.canStopCommand=function(){return!0},Nt.prototype.selectAll=function(){var a=this.diagram;a.N();try{a.currentCursor="wait",a.R("ChangingSelection",a.selection);for(var y=a.parts;y.next();)y.value.isSelected=!0;for(var x=a.nodes;x.next();)x.value.isSelected=!0;for(var E=a.links;E.next();)E.value.isSelected=!0}finally{a.R("ChangedSelection",a.selection),a.currentCursor=""}},Nt.prototype.canSelectAll=function(){return this.diagram.allowSelect},Nt.prototype.deleteSelection=function(){var a=this.diagram;try{a.currentCursor="wait",a.R("ChangingSelection",a.selection),a.Ea("Delete"),a.R("SelectionDeleting",a.selection);for(var y=new _e,x=a.selection.iterator;x.next();)Yh(y,x.value,!0,this.deletesTree?1/0:0,this.deletesConnectedLinks?null:!1,function(E){return E.canDelete()});a.Is(y,!0),a.R("SelectionDeleted",y)}finally{a.eb("Delete"),a.R("ChangedSelection",a.selection),a.currentCursor=""}},Nt.prototype.canDeleteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowDelete||a.selection.count===0)},Nt.prototype.copySelection=function(){var a=this.diagram,y=new _e;for(a=a.selection.iterator;a.next();)Yh(y,a.value,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,function(x){return x.canCopy()});this.copyToClipboard(y)},Nt.prototype.canCopySelection=function(){var a=this.diagram;return!!(a.allowCopy&&a.allowClipboard&&a.selection.count!==0)},Nt.prototype.cutSelection=function(){this.copySelection(),this.deleteSelection()},Nt.prototype.canCutSelection=function(){var a=this.diagram;return!!(!a.isReadOnly&&!a.isModelReadOnly&&a.allowCopy&&a.allowDelete&&a.allowClipboard&&a.selection.count!==0)},Nt.prototype.copyToClipboard=function(a){var y=this.diagram,x=null;if(a===null)Nc=null,Zh="";else{x=y.model;var E=!1,b=!1,z=null;try{x.Tl()&&(E=x.Jj,x.Jj=this.copiesParentKey),x.Wj()&&(b=x.Ij,x.Ij=this.copiesGroupKey),z=y.Kj(a,null,!0)}finally{x.Tl()&&(x.Jj=E),x.Wj()&&(x.Ij=b),x=new Me,x.addAll(z),Nc=x,Zh=y.model.dataFormat}}y.R("ClipboardChanged",x)},Nt.prototype.pasteFromClipboard=function(){var a=new _e,y=Nc;if(y===null)return a;var x=this.diagram;if(Zh!==x.model.dataFormat)return a;var E=x.model,b=!1,z=!1,tt=null;try{E.Tl()&&(b=E.Jj,E.Jj=this.copiesParentKey),E.Wj()&&(z=E.Ij,E.Ij=this.copiesGroupKey),tt=x.Kj(y,x,!1)}finally{for(E.Tl()&&(E.Jj=b),E.Wj()&&(E.Ij=z),y=tt.iterator;y.next();)x=y.value,E=y.key,x.location.w()||(E.location.w()?x.location=E.location:!x.position.w()&&E.position.w()&&(x.position=E.position)),a.add(x)}return a},Nt.prototype.pasteSelection=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.currentCursor="wait",y.R("ChangingSelection",y.selection),y.Ea("Paste");var x=this.pasteFromClipboard();0<x.count&&y.clearSelection(!0);for(var E=x.iterator;E.next();)E.value.isSelected=!0;if(a!==null){var b=y.computePartsBounds(y.selection);if(b.w()){var z=this.computeEffectiveCollection(y.selection,y.Wm);_h(y,z,new Pt(a.x-b.centerX,a.y-b.centerY),y.Wm,!1)}}y.R("ClipboardPasted",x)}finally{y.eb("Paste"),y.R("ChangedSelection",y.selection),y.currentCursor=""}},Nt.prototype.canPasteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowClipboard||Nc===null||Nc.count===0||Zh!==a.model.dataFormat)},Nt.prototype.undo=function(){this.diagram.undoManager.undo()},Nt.prototype.canUndo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canUndo()},Nt.prototype.redo=function(){this.diagram.undoManager.redo()},Nt.prototype.canRedo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canRedo()},Nt.prototype.decreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;y.autoScale===Cs&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Nt.prototype.canDecreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;return y.autoScale!==Cs?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Nt.prototype.increaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;y.autoScale===Cs&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Nt.prototype.canIncreaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;return y.autoScale!==Cs?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Nt.prototype.resetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;a<y.minScale||a>y.maxScale||(y.scale=a)},Nt.prototype.canResetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;return a<y.minScale||a>y.maxScale?!1:y.allowZoom},Nt.prototype.zoomToFit=function(){var a=this.diagram,y=a.animationManager;y.Cc(),a.redraw();var x=a.position,E=a.scale;nu(y,"Zoom To Fit"),this.isZoomToFitRestoreEnabled&&E===this.Au&&!isNaN(this.Jt)&&a.documentBounds.D(this.yu)?(a.scale=this.Jt,a.position=this.sw,this.Au=NaN,this.yu=Bo):(this.Jt=E,this.sw=x.copy(),a.zoomToFit(),this.Au=a.scale,this.yu=a.documentBounds.copy()),Qf(y)},Nt.prototype.canZoomToFit=function(){return this.diagram.allowZoom},Nt.prototype.scrollToPart=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.Va(),a===null){try{this.cg!==null&&(this.cg.next()?a=this.cg.value:this.cg=null)}catch(nt){this.cg=null}a===null&&(0<y.highlighteds.count?this.cg=y.highlighteds.iterator:0<y.selection.count&&(this.cg=y.selection.iterator),this.cg!==null&&this.cg.next()&&(a=this.cg.value))}if(a!==null){var x=y.animationManager;nu(x,"Scroll To Part");var E=this.scrollToPartPause;if(0<E){var b=jt(this,a,[a]);if(b.length===1)y.Ea(),y.es(a.actualBounds),y.eb("Scroll To Part");else{var z=function(){y.Ea();for(var nt=b.pop();0<b.length&&nt instanceof Ci&&nt.isTreeExpanded&&(!(nt instanceof An)||nt.isSubGraphExpanded);)nt=b.pop();0<b.length?(nt instanceof tn&&y.tv(nt.actualBounds),nt instanceof Ci&&!nt.isTreeExpanded&&(nt.isTreeExpanded=!0),nt instanceof An&&!nt.isSubGraphExpanded&&(nt.isSubGraphExpanded=!0)):(nt instanceof tn&&y.es(nt.actualBounds),y.am("LayoutCompleted",tt)),y.eb("Scroll To Part")},tt=function(){On(z,(x.isEnabled?x.duration:0)+E)};y.Bj("LayoutCompleted",tt),z()}}else{var it=y.position.copy();y.es(a.actualBounds),it.Xa(y.position)&&x.Cc()}}};function jt(a,y,x){if(y.isVisible())return x;if(y instanceof cr)jt(a,y.adornedPart,x);else if(y instanceof fi){var E=y.fromNode;E!==null&&jt(a,E,x),y=y.toNode,y!==null&&jt(a,y,x)}else y instanceof Ci&&(E=y.labeledLink,E!==null&&jt(a,E,x),E=y.pg(),E!==null&&(E.isTreeExpanded||E.wasTreeExpanded||x.push(E),jt(a,E,x))),y=y.containingGroup,y!==null&&(y.isSubGraphExpanded||y.wasSubGraphExpanded||x.push(y),jt(a,y,x));return x}Nt.prototype.canScrollToPart=function(a){return a===void 0&&(a=null),a!==null&&!(a instanceof tn)?!1:(a=this.diagram,a.selection.count===0&&a.highlighteds.count===0?!1:a.allowHorizontalScroll&&a.allowVerticalScroll)},Nt.prototype.collapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse Tree"),nu(y.animationManager,"Collapse Tree");var x=new Me;if(a!==null&&a.isTreeExpanded)a.collapseTree(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof Ci&&b.isTreeExpanded&&(b.collapseTree(),x.add(b))}y.R("TreeCollapsed",x)}finally{y.eb("Collapse Tree")}},Nt.prototype.canCollapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof Ci&&a.isTreeExpanded))return!1;if(0<a.Qo().count)return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof Ci&&y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Nt.prototype.expandTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand Tree"),nu(y.animationManager,"Expand Tree");var x=new Me;if(a!==null&&!a.isTreeExpanded)a.expandTree(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof Ci&&!b.isTreeExpanded&&(b.expandTree(),x.add(b))}y.R("TreeExpanded",x)}finally{y.eb("Expand Tree")}},Nt.prototype.canExpandTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof Ci)||a.isTreeExpanded)return!1;if(0<a.Qo().count)return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof Ci&&!y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Nt.prototype.groupSelection=function(){var a=this.diagram,y=a.model;if(y.Xj()){var x=this.archetypeGroupData;if(x!==null){var E=null;try{a.currentCursor="wait",a.R("ChangingSelection",a.selection),a.Ea("Group");for(var b=new Me,z=a.selection.iterator;z.next();){var tt=z.value;tt.Zc()&&tt.canGroup()&&b.add(tt)}for(var it=new Me,nt=b.iterator;nt.next();){var ot=nt.value;z=!1;for(var st=b.iterator;st.next();)if(ot.Td(st.value)){z=!0;break}z||it.add(ot)}if(0<it.count){var ut=it.first().containingGroup;if(ut!==null)for(;ut!==null;){b=!1;for(var ct=it.iterator;ct.next();)if(!ct.value.Td(ut)){b=!0;break}if(b)ut=ut.containingGroup;else break}if(x instanceof An)rl(x),E=x.copy(),E!==null&&a.add(E);else if(y.Yu(x)){var dt=y.copyNodeData(x);Oe(dt)&&(y.xf(dt),E=a.ii(dt))}if(E!==null){ut!==null&&this.isValidMember(ut,E)&&(E.containingGroup=ut);for(var vt=it.iterator;vt.next();){var xt=vt.value;this.isValidMember(E,xt)&&(xt.containingGroup=E)}a.clearSelection(!0),E.isSelected=!0}}a.R("SelectionGrouped",E)}finally{a.eb("Group"),a.R("ChangedSelection",a.selection),a.currentCursor=""}}}},Nt.prototype.canGroupSelection=function(){var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowGroup||!a.model.Xj()||this.archetypeGroupData===null)return!1;for(a=a.selection.iterator;a.next();){var y=a.value;if(y.Zc()&&y.canGroup())return!0}return!1};function Ee(a){var y=ii();for(a=a.iterator;a.next();){var x=a.value;x instanceof fi||y.push(x)}a=new _e,x=y.length;for(var E=0;E<x;E++){for(var b=y[E],z=!0,tt=0;tt<x;tt++)if(b.Td(y[tt])){z=!1;break}z&&a.add(b)}return Hi(y),a}Nt.prototype.isValidMember=function(a,y){if(y===null||a===y||y instanceof fi)return!1;if(a!==null){if(a===y||a.Td(y))return!1;var x=a.memberValidation;if(x!==null&&!x(a,y)||a.data===null&&y.data!==null||a.data!==null&&y.data===null)return!1}return x=this.memberValidation,x!==null?x(a,y):!0},Nt.prototype.ungroupSelection=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.model;if(x.Xj())try{y.currentCursor="wait",y.R("ChangingSelection",y.selection),y.Ea("Ungroup");var E=new Me;if(a!==null)E.add(a);else for(var b=y.selection.iterator;b.next();){var z=b.value;z instanceof An&&z.canUngroup()&&E.add(z)}var tt=new Me;if(0<E.count){y.clearSelection(!0);for(var it=E.iterator;it.next();){var nt=it.value;nt.expandSubGraph();var ot=nt.containingGroup,st=ot!==null&&ot.data!==null?x.wa(ot.data):void 0;tt.addAll(nt.memberParts);for(var ut=tt.iterator;ut.next();){var ct=ut.value;if(ct.isSelected=!0,!(ct instanceof fi)){var dt=ct.data;dt!==null?x.mp(dt,st):ct.containingGroup=ot}}y.remove(nt)}}y.R("SelectionUngrouped",E,tt)}finally{y.eb("Ungroup"),y.R("ChangedSelection",y.selection),y.currentCursor=""}},Nt.prototype.canUngroupSelection=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly||y.isModelReadOnly||!y.allowDelete||!y.allowUngroup||!y.model.Xj())return!1;if(a!==null){if(!(a instanceof An))return!1;if(a.canUngroup())return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof An&&y.canUngroup())return!0;return!1},Nt.prototype.addTopLevelParts=function(a,y){var x=!0;for(a=Ee(a).iterator;a.next();){var E=a.value;E.containingGroup!==null&&(!y||this.isValidMember(null,E)?E.containingGroup=null:x=!1)}return x},Nt.prototype.collapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse SubGraph"),nu(y.animationManager,"Collapse SubGraph");var x=new Me;if(a!==null&&a.isSubGraphExpanded)a.collapseSubGraph(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof An&&b.isSubGraphExpanded&&(b.collapseSubGraph(),x.add(b))}y.R("SubGraphCollapsed",x)}finally{y.eb("Collapse SubGraph")}},Nt.prototype.canCollapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return!!(a instanceof An&&a.isSubGraphExpanded);for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof An&&y.isSubGraphExpanded)return!0;return!1},Nt.prototype.expandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand SubGraph"),nu(y.animationManager,"Expand SubGraph");var x=new Me;if(a!==null&&!a.isSubGraphExpanded)a.expandSubGraph(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof An&&!b.isSubGraphExpanded&&(b.expandSubGraph(),x.add(b))}y.R("SubGraphExpanded",x)}finally{y.eb("Expand SubGraph")}},Nt.prototype.canExpandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return a instanceof An&&!a.isSubGraphExpanded;for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof An&&!y.isSubGraphExpanded)return!0;return!1},Nt.prototype.editTextBlock=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.toolManager.findTool("TextEditing");if(x!==null){if(a===null){a=null;for(var E=y.selection.iterator;E.next();){var b=E.value;if(b.canEdit()){a=b;break}}if(a===null)return;a=a.Nl(function(z){return z instanceof Or&&z.editable})}a!==null&&(y.currentTool=null,x.textBlock=a,y.currentTool=x)}},Nt.prototype.canEditTextBlock=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly||y.isModelReadOnly||!y.allowTextEdit||y.toolManager.findTool("TextEditing")===null)return!1;if(a!==null){if(!(a instanceof Or))return!1;if(a=a.part,a!==null&&a.canEdit())return!0}else for(y=y.selection.iterator;y.next();)if(a=y.value,a.canEdit()&&(a=a.Nl(function(x){return x instanceof Or&&x.editable}),a!==null))return!0;return!1},Nt.prototype.showContextMenu=function(a){var y=this.diagram,x=y.toolManager.findTool("ContextMenu");if(x!==null&&(a===void 0&&(a=0<y.selection.count?y.selection.first():y),a=x.findObjectWithContextMenu(a),a!==null)){var E=y.lastInput,b=null;a instanceof Kt?b=a.ga(Hn):y.viewportBounds.ca(E.documentPoint)||(b=y.viewportBounds,b=new Pt(b.x+b.width/2,b.y+b.height/2)),b!==null&&(E.viewPoint=y.op(b),E.documentPoint=b,E.left=!1,E.right=!0,E.up=!0),y.currentTool=x,Mu(x,!1,a)}},Nt.prototype.canShowContextMenu=function(a){var y=this.diagram,x=y.toolManager.findTool("ContextMenu");return x===null?!1:(a===void 0&&(a=0<y.selection.count?y.selection.first():y),x.findObjectWithContextMenu(a)!==null)},Nt.prototype.computeEffectiveCollection=function(a,y){var x=this.diagram,E=x.toolManager.findTool("Dragging"),b=x.currentTool===E;if(y===void 0&&(y=b?E.dragOptions:x.Wm),E=new ji,a===null)return E;for(var z=a.iterator;z.next();)su(x,E,z.value,b,y);if(x.draggedLink!==null&&y.dragsLink)return E;for(z=a.iterator;z.next();)a=z.value,a instanceof fi&&(y=a.fromNode,y===null||E.contains(y)?(y=a.toNode,y===null||E.contains(y)||E.remove(a)):E.remove(a));return E},zi.Object.defineProperties(Nt.prototype,{diagram:{get:function(){return this.H}},copiesClipboardData:{get:function(){return this.o},set:function(a){this.o=a}},copiesConnectedLinks:{get:function(){return this.u},set:function(a){this.u=a}},deletesConnectedLinks:{get:function(){return this.Ha},set:function(a){this.Ha=a}},copiesTree:{get:function(){return this.ia},set:function(a){this.ia=a}},deletesTree:{get:function(){return this.nb},set:function(a){this.nb=a}},copiesParentKey:{get:function(){return this.V},set:function(a){this.V=a}},copiesGroupKey:{get:function(){return this.F},set:function(a){this.F=a}},archetypeGroupData:{get:function(){return this.j},set:function(a){this.j=a}},memberValidation:{get:function(){return this.ij},set:function(a){this.ij=a}},defaultScale:{get:function(){return this.diagram.defaultScale},set:function(a){this.diagram.defaultScale=a}},zoomFactor:{get:function(){return this.Hb},set:function(a){1<a||It("zoomFactor must be larger than 1.0, not: "+a),this.Hb=a}},isZoomToFitRestoreEnabled:{get:function(){return this.hb},set:function(a){this.hb=a}},scrollToPartPause:{get:function(){return this.ob},set:function(a){this.ob=a}}}),Nt.className="CommandHandler",Ug=function(){return new Nt};function Kt(){bi(this),this.l=30723,this.pb=1,this.bn="",this.Ma=this.Me=null,this.pa=new Pt(NaN,NaN).freeze(),this.jd=so,this.Ab=new bn,this.wh=new bn,this.Lb=null,this.Ca=this.Kk=1,this.Kb=0,this.Kg=Vs,this.uc=new be(NaN,NaN,NaN,NaN).freeze(),this.Ib=new be(NaN,NaN,NaN,NaN).freeze(),this.dc=new be(0,0,NaN,NaN).freeze(),this.ba=this.Yn=this.Zn=null,this.sk=this.Jb=Fi,this.Ag=this.io=0,this.V=this.tb=this.Dh=this.A=this.Ua=null,this.Uc=!1,this.jo=this.Ng=null}var ri,Qe,Yi,$i,dn,Dn,tr,Wn,lr,Pr;Kt.prototype.cloneProtected=function(a){a.l=this.l|6144,a.pb=this.pb,a.bn=this.bn,a.Ma=this.Ma,a.pa.assign(this.pa),a.jd=this.jd.J(),this.Lb!==null?a.Lb=this.Lb.copy():a.Lb=null,a.Ca=this.Ca,a.Kb=this.Kb,a.Kg=this.Kg.J(),a.uc.assign(this.uc),a.Ib.assign(this.Ib),a.dc.assign(this.dc),a.Yn=this.Yn,this.ba!==null&&(a.ba=this.ba.copy()),a.Jb=this.Jb.J(),a.sk=this.sk.J(),a.io=this.io,a.Ag=this.Ag,this.Ua!==null&&(a.Ua=this.Ua.copy()),this.A!==null&&(a.A=this.A.nc?this.A:this.A.copy()),this.Dh!==null&&(a.Dh=rn(this.Dh)),this.tb!==null&&(a.tb=this.tb.copy())},Kt.prototype.Vw=function(a){var y=this.Dh;if(Ti(y)){for(var x=0;x<y.length;x++)if(y[x]===a)return}else this.Dh=y=[];y.push(a)},Kt.prototype.Af=function(a){a.Zn=null,a.Ng=null,a.v()},Kt.prototype.clone=function(){var a=new this.constructor;if(this.cloneProtected(a),this.Dh!==null)for(var y=0;y<this.Dh.length;y++){var x=this.Dh[y];a[x]=this[x]}return a},Kt.prototype.copy=function(){return this.clone()},yt=Kt.prototype,yt.qb=function(a){a.classType===fi?a.name.indexOf("Orient")===0?this.segmentOrientation=a:It("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.classType===Kt&&(this.stretch=a)},yt.toString=function(){return Xi(this.constructor)+"#"+kn(this)},yt.th=function(){this.A!==null&&(this.A.nc=!0)};function _n(a){a.A===null?a.A=new Sf:a.A.nc&&(a.A=a.A.copy())}yt.Xc=function(){if(this.ba===null){var a=new Rp;a.Xi=Jn,a.yj=Jn,a.Vi=10,a.wj=10,a.Wi=0,a.xj=0,this.ba=a}},yt.cb=function(a,y,x,E,b,z,tt){var it=this.part;if(it!==null&&(it.gk(a,y,x,E,b,z,tt),x===this&&a===Yr&&ss(this)&&Zr(this,it,y),z=this.diagram,this.animationTriggers===null||z===null||!z.pi||z.undoManager.isUndoingRedoing||z.animationManager.Dm||(a=this.animationTriggers.get(y),a!==null&&z.animationManager.isEnabled&&!z.animationManager.isTicking&&(this.jo===null&&(this.jo=new ji),tt=z.undoManager.transactionLevel===0,a.startCondition===Rh?tt=!0:a.startCondition===Sc&&(tt=!1),tt?(z=new us,Zg(a,z),tt=this.jo.get(a),tt!==null&&tt.stop(),this.jo.add(a,z),z.vu=this,z.Nw=a,z.add(this,y,E,b),z.start()):(nu(z.animationManager,"Trigger"),z.animationManager.defaultAnimation.add(this,y,E,b)))),this instanceof si&&x===it&&(it.l&16777216)!==0&&it.data!==null))for(x=this.O.s,E=x.length,b=0;b<E;b++)it=x[b],it instanceof si&&Oc(it,function(nt){nt.data!==null&&nt.l&16777216&&nt.La(y)})};function Zr(a,y,x){var E=a.ih();if(E!==null)for(var b=a.localBindings.iterator;b.next();){var z=b.value,tt=null;if(z.sourceName!==null){if(tt=N1(z,E,a),tt===null)continue;z.sp(a,tt,x,null)}else if(z.isToModel){var it=y.diagram;it===null||it.skipsModelSourceBindings||z.sp(a,it.model.modelData,x,E)}else{if(it=E.data,it===null)continue;var nt=y.diagram;nt===null||nt.skipsModelSourceBindings||z.sp(a,it,x,E)}tt===a&&(it=E.ks(z.Ai),it!==null&&z.Mv(it,tt,x))}}yt.ks=function(a){return this.bindingId===a?this:null},yt.g=function(a,y,x){this.cb(Yr,a,this,y,x)},yt.Ge=function(a,y,x,E){var b=this.uc;if(b.h(a,y,x,E),this.Ca!==1||this.Kb!==0){this.Lb===null&&(this.Lb=new bn);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),z.pp(b)}};function Ho(a,y,x,E){return a.pickable===!1?!1:(E.multiply(a.transform),x?a.Yc(y,E):a.fh(y,E))}yt.tx=function(a,y,x){if(this.pickable===!1)return!1;var E=this.naturalBounds;return y=a.Bf(y),x?mn(a.x,a.y,0,0,0,E.height)<=y||mn(a.x,a.y,0,E.height,E.width,E.height)<=y||mn(a.x,a.y,E.width,E.height,E.width,0)<=y||mn(a.x,a.y,E.width,0,0,0)<=y:a.zd(0,0)<=y&&a.zd(0,E.height)<=y&&a.zd(E.width,0)<=y&&a.zd(E.width,E.height)<=y},yt.se=function(){return!0},yt.ca=function(a){var y=Pt.alloc();y.assign(a),this.transform.Ga(y);var x=this.actualBounds;if(!x.w())return Pt.free(y),!1;var E=this.diagram;if(E!==null&&E.wq){var b=E.Ql("extraTouchThreshold"),z=E.Ql("extraTouchArea"),tt=z/2,it=this.naturalBounds;E=this.Df()*E.scale;var nt=1/E;if(it.width*E<b&&it.height*E<b)return a=Io(x.x-tt*nt,x.y-tt*nt,x.width+z*nt,x.height+z*nt,y.x,y.y),Pt.free(y),a}return b=!1,(this instanceof cr||this instanceof Rn?Io(x.x-5,x.y-5,x.width+10,x.height+10,y.x,y.y):x.ca(y))&&(this.tb&&!this.tb.ca(y)?b=!1:this.areaBackground!==null&&x.ca(y)||this.Ma!==null&&this.dc.ca(a)?b=!0:b=this.gh(a)),Pt.free(y),b},yt.gh=function(a){var y=this.naturalBounds;return Io(0,0,y.width,y.height,a.x,a.y)},yt.Re=function(a){if(this.angle===0)return this.actualBounds.Re(a);var y=this.naturalBounds;y=be.allocAt(0,0,y.width,y.height);var x=this.transform,E=!1,b=Pt.allocAt(a.x,a.y);return y.ca(x.Cd(b))&&(b.h(a.x,a.bottom),y.ca(x.Cd(b))&&(b.h(a.right,a.bottom),y.ca(x.Cd(b))&&(b.h(a.right,a.y),y.ca(x.Cd(b))&&(E=!0)))),Pt.free(b),be.free(y),E},yt.fh=function(a,y){if(y===void 0)return a.Re(this.actualBounds);var x=this.naturalBounds,E=!1,b=Pt.allocAt(0,0);return a.ca(y.Ga(b))&&(b.h(0,x.height),a.ca(y.Ga(b))&&(b.h(x.width,x.height),a.ca(y.Ga(b))&&(b.h(x.width,0),a.ca(y.Ga(b))&&(E=!0)))),Pt.free(b),E},yt.Yc=function(a,y){if(y===void 0&&(y=this.transform,this.angle===0))return a.Yc(this.actualBounds);var x=this.naturalBounds,E=Pt.allocAt(0,0),b=Pt.allocAt(0,x.height),z=Pt.allocAt(x.width,x.height),tt=Pt.allocAt(x.width,0),it=!1;if(a.ca(y.Ga(E))||a.ca(y.Ga(b))||a.ca(y.Ga(z))||a.ca(y.Ga(tt)))it=!0;else{x=be.allocAt(0,0,x.width,x.height);var nt=Pt.allocAt(a.x,a.y);x.ca(y.Cd(nt))?it=!0:(nt.h(a.x,a.bottom),x.ca(y.Cd(nt))?it=!0:(nt.h(a.right,a.bottom),x.ca(y.Cd(nt))?it=!0:(nt.h(a.right,a.y),x.ca(y.Cd(nt))&&(it=!0)))),Pt.free(nt),be.free(x),!it&&(Gt.us(a,E,b)||Gt.us(a,b,z)||Gt.us(a,z,tt)||Gt.us(a,tt,E))&&(it=!0)}return Pt.free(E),Pt.free(b),Pt.free(z),Pt.free(tt),it},yt.ga=function(a,y){if(y===void 0&&(y=new Pt),a instanceof nn){var x=this.naturalBounds;y.h(a.x*x.width+a.offsetX,a.y*x.height+a.offsetY)}else y.set(a);return this.oe.Ga(y),y},yt.mi=function(a){a===void 0&&(a=new be);var y=this.naturalBounds,x=this.oe,E=Pt.allocAt(0,0).transform(x);return a.h(E.x,E.y,0,0),E.h(y.width,0).transform(x),jr(a,E.x,E.y,0,0),E.h(y.width,y.height).transform(x),jr(a,E.x,E.y,0,0),E.h(0,y.height).transform(x),jr(a,E.x,E.y,0,0),Pt.free(E),a},yt.li=function(){var a=this.oe;return a.m11===1&&a.m12===0?a=0:(a=180*Math.atan2(a.m12,a.m11)/Math.PI,0>a&&(a+=360)),a},yt.Df=function(){if(!(this.l&4096))return this.Kk;var a=this.Ca;return this.panel!==null?a*this.panel.Df():a},yt.qs=function(a,y){return y===void 0&&(y=new Pt),y.assign(a),this.oe.Cd(y),y},yt.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},yt.Sj=function(a,y,x,E,b){var z=this.transform,tt=1/(z.m11*z.m22-z.m12*z.m21),it=z.m22*tt,nt=-z.m12*tt,ot=-z.m21*tt,st=z.m11*tt,ut=tt*(z.m21*z.dy-z.m22*z.dx),ct=tt*(z.m12*z.dx-z.m11*z.dy);return this.areaBackground!==null?(z=this.actualBounds,Gt.Ff(z.left,z.top,z.right,z.bottom,a,y,x,E,b)):(tt=a*it+y*ot+ut,a=a*nt+y*st+ct,y=x*it+E*ot+ut,x=x*nt+E*st+ct,b.h(0,0),E=this.naturalBounds,x=Gt.Ff(0,0,E.width,E.height,tt,a,y,x,b),b.transform(z),x)},Kt.prototype.measure=function(a,y,x,E){if(Ta(this)!==!1){var b=this.Kg,z=b.right+b.left;b=b.top+b.bottom,a=Math.max(a-z,0),y=Math.max(y-b,0),x=Math.max((x||0)-z,0),E=Math.max((E||0)-b,0),z=this.angle,b=this.desiredSize;var tt=this.kq();z===90||z===270?(a=isFinite(b.height)?b.height+tt:a,y=isFinite(b.width)?b.width+tt:y):(a=isFinite(b.width)?b.width+tt:a,y=isFinite(b.height)?b.height+tt:y),b=x||0,tt=E||0;var it=this instanceof si;switch(Xs(this,!0)){case Qe:tt=b=0,it&&(y=a=1/0);break;case ri:isFinite(a)&&a>x&&(b=a),isFinite(y)&&y>E&&(tt=y);break;case $i:isFinite(a)&&a>x&&(b=a),tt=0,it&&(y=1/0);break;case dn:isFinite(y)&&y>E&&(tt=y),b=0,it&&(a=1/0)}it=this.maxSize;var nt=this.minSize;b>it.width&&nt.width<it.width&&(b=it.width),tt>it.height&&nt.height<it.height&&(tt=it.height),x=Math.max(b,nt.width),E=Math.max(tt,nt.height),it.width<x&&(x=Math.min(nt.width,x)),it.height<E&&(E=Math.min(nt.height,E)),a=Math.min(it.width,a),y=Math.min(it.height,y),a=Math.max(x,a),y=Math.max(E,y),(z===90||z===270)&&(z=a,a=y,y=z,z=x,x=E,E=z),this.uc.ka(),this.Wl(a,y,x,E),this.uc.freeze(),this.uc.w()||It("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.uc.toString()),No(this,!1)}},Kt.prototype.Wl=function(){},Kt.prototype.Dd=function(){return!1},Kt.prototype.arrange=function(a,y,x,E,b){this.Uk();var z=be.alloc();z.assign(this.Ib),this.Ib.ka(),Os(this)===!1?this.Ib.h(a,y,x,E):this.eh(a,y,x,E),this.Ib.freeze(),b===void 0?this.tb=null:this.tb=b,x=!1,b!==void 0?x=!0:(b=this.panel,b!==null&&ah(b)&&(b=b.panel),b!==null&&(b=b.dc,E=this.measuredBounds,this.areaBackground!==null&&(E=this.Ib),x=y+E.height,E=a+E.width,x=!(0<=a+.05&&E<=b.width+.05&&0<=y+.05&&x<=b.height+.05),this instanceof Or&&(a=this.naturalBounds,this.Lq>a.height||this.Cb>a.width))&&(x=!0)),this.l=x?this.l|256:this.l&-257,this.Ib.w()||It("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ib.toString()),this.Xl(z,this.Ib),au(this,!1),be.free(z)},yt=Kt.prototype,yt.eh=function(){};function ks(a,y,x,E,b){if(a.Ib.h(y,x,E,b),!a.desiredSize.w()){var z=a.uc;x=a.Kg,y=x.right+x.left;var tt=x.top+x.bottom;switch(x=z.width+y,z=z.height+tt,E+=y,b+=tt,y=Xs(a,!0),x===E&&z===b&&(y=Qe),y){case Qe:(x>E||z>b)&&(No(a,!0),a.measure(x>E?E:x,z>b?b:z,0,0));break;case ri:No(a,!0),a.measure(E,b,0,0);break;case $i:No(a,!0),a.measure(E,z,0,0);break;case dn:No(a,!0),a.measure(x,b,0,0)}}}yt.Xl=function(a,y){var x=this.part;x!==null&&x.diagram!==null&&(x.selectionObject!==this&&x.resizeObject!==this&&x.rotateObject!==this||z0(x,!0),this.N(),Qr(a,y)||(x.oh(),this.Pn(x)))},yt.Pn=function(a){this.portId!==null&&(z0(a,!0),a instanceof Ci&&Vx(a,this))},yt.gc=function(a,y){if(!Ha(this,a,y)&&this.visible){var x=this.opacity;if(x!==0){var E=1;x!==1&&(E=a.globalAlpha,a.globalAlpha=E*x);var b="";this.filter!==""&&(b=a.filter,a.filter=this.filter);var z=this instanceof si&&ah(this),tt=this.Ib;if(z){var it=this.Ib,nt=this.dc,ot=this.areaBackground,st=this.Ma;ot===null&&st===null||a.yc(),ot!==null&&(uo(this,a,ot,!0,!0,nt,it),ot instanceof kr&&ot.type===Ka?(a.beginPath(),a.rect(it.x,it.y,it.width,it.height),a.ng(ot)):a.fillRect(it.x,it.y,it.width,it.height)),st!==null&&(uo(this,a,st,!0,!1,nt,it),st instanceof kr&&st.type===Ka?(a.beginPath(),a.rect(it.x,it.y,it.width,it.height),a.ng(st)):a.fillRect(it.x,it.y,it.width,it.height)),this.hh(a,y)}if(!z&&(z||tt.width!==0&&tt.height!==0&&!isNaN(tt.x)&&!isNaN(tt.y))){z=this.transform,it=this.panel,this.l&4096&&es(this),ot=this.part,nt=!1;var ut=0;ot&&y.Gf("drawShadows")&&(nt=ot.isShadowed)&&(st=ot.shadowOffset,ut=Math.max(st.y,st.x)*y.scale*y.Mb),st=this.Dd();var ct;if(!(ct=y.$i||!st)){var dt=this.naturalBounds;ct=this.wh;var vt=ct.m11,xt=ct.m21,Tt=ct.dx,Et=ct.m12,Ft=ct.m22,Ot=ct.dy,Rt,Ht=Rt=0;ct=Rt*vt+Ht*xt+Tt;var ae=Rt*Et+Ht*Ft+Ot;Rt=dt.width+ut,Ht=0;var wi=Rt*vt+Ht*xt+Tt;Rt=Rt*Et+Ht*Ft+Ot,Ht=Math.min(ct,wi);var Ki=Math.min(ae,Rt),Ii=Math.max(ct+0,wi)-Ht,hi=Math.max(ae+0,Rt)-Ki;ct=Ht,ae=Ki,Rt=dt.width+ut,Ht=dt.height+ut,wi=Rt*vt+Ht*xt+Tt,Rt=Rt*Et+Ht*Ft+Ot,Ht=Math.min(ct,wi),Ki=Math.min(ae,Rt),Ii=Math.max(ct+Ii,wi)-Ht,hi=Math.max(ae+hi,Rt)-Ki,ct=Ht,ae=Ki,Rt=0,Ht=dt.height+ut,wi=Rt*vt+Ht*xt+Tt,Rt=Rt*Et+Ht*Ft+Ot,Ht=Math.min(ct,wi),Ki=Math.min(ae,Rt),Ii=Math.max(ct+Ii,wi)-Ht,hi=Math.max(ae+hi,Rt)-Ki,ct=Ht,ae=Ki,ut=y.viewportBounds,dt=ut.x,vt=ut.y,ct=!(ct>ut.width+dt||dt>Ii+ct||ae>ut.height+vt||vt>hi+ae)}if(ct){if(ct=(this.l&256)!==0,a.clipInsteadOfFill&&(ct=!1),this instanceof Or&&(a.font=this.font),ct){if(ae=it.se()?it.naturalBounds:it.actualBounds,Ii=Math.max(tt.x,ae.x),hi=Math.max(tt.y,ae.y),ut=Math.min(tt.right,ae.right)-Ii,dt=Math.min(tt.bottom,ae.bottom)-hi,vt=this.tb,vt!==null&&(Ii=vt.x,hi=vt.y,ut=vt.width,dt=vt.height),Ii>tt.width+tt.x||tt.x>ae.width+ae.x){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}a.save(),a.beginPath(),a.rect(Ii,hi,ut,dt),a.clip()}if(st){if(!ot.isVisible()){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}nt&&(ae=ot.shadowOffset,a.Ev(ae.x*y.scale*this.scale*y.Mb,ae.y*y.scale*this.scale*y.Mb,ot.shadowBlur),Tu(a),a.shadowColor=ot.shadowColor)}nt&&this.shadowVisible===!0?Tu(a):nt&&this.shadowVisible===!1&&lu(a),ot=this.naturalBounds,this.areaBackground!==null&&(a.yc(),Na(this,a,ot,tt)),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),nt&&Xo(this,it)&&this.shadowVisible===null&&lu(a),this.Ma!==null&&(a.yc(),ra(this,a,ot,tt)),nt&&(this.Ma!==null||this.areaBackground!==null||Xo(this,it))?(yl(this,!0),this.shadowVisible===null&&lu(a)):yl(this,!1),this.hh(a,y),nt&&this.l&512&&Tu(a),st&&nt&&lu(a),ct&&(a.restore(),a.Vc(this instanceof si)),z.ws()||(y=1/(z.m11*z.m22-z.m12*z.m21),a.transform(z.m22*y,-z.m12*y,-z.m21*y,z.m11*y,y*(z.m21*z.dy-z.m22*z.dx),y*(z.m12*z.dx-z.m11*z.dy)))}}x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b)}}};function Xo(a,y){return y===null?!1:(ah(y)&&(y=y.panel),(y.l&512)!==0||(y.type===si.Auto||y.type===si.Spot)&&y.Pb()!==a)}yt.Dv=function(){};function Na(a,y,x,E){uo(a,y,a.areaBackground,!0,!0,x,E),a.areaBackground instanceof kr&&a.areaBackground.type===Ka?(y.beginPath(),y.rect(E.x,E.y,E.width,E.height),y.ng(a.areaBackground)):y.fillRect(E.x,E.y,E.width,E.height)}function ra(a,y,x,E){var b=a.kq(),z=x.x,tt=x.y,it=x.width+b,nt=x.height+b;uo(a,y,a.Ma,!0,!1,x,E),a.Ma instanceof kr&&a.Ma.type===Ka?(y.beginPath(),y.rect(z-b/2,tt-b/2,it,nt),y.ng(a.Ma)):y.fillRect(z-b/2,tt-b/2,it,nt)}function ms(a,y,x){for(var E=y.O.s,b=E.length,z=-1,tt=0;tt<b;tt++)if(E[tt]===a){z=tt;break}if(a=z,a!==-1)if(a===0)y.svg.gd?y.svg.gd.after(x):y.svg.Ma?y.svg.Ma.after(x):y.type===si.Table?(y=y.svg.getElementsByClassName("gojs-ts"),y=y.length!==0?y[0]:null,y!==null&&y.after(x)):y.svg.prepend(x);else{for(;a!==0&&!y.M(a-1).Ed();)a--;a===0?y.svg.prepend(x):(a=y.M(a-1).svg,a!==null?a.after(x):y.svg.appendChild(x))}}function Ha(a,y,x){if(!(y instanceof ga))return!1;if(!a.visible||a.opacity===0||a.Dd()&&!a.isVisible())return a.svg!==null&&a.svg.parentNode!==null&&a.svg.remove(),!0;var E=a.panel,b=a.nk(y);if(a.kk(y,x,b))return a.svg.parentElement!==null?(a.Dd()&&(y.ti=a.svg),!0):(a.Dd()?(y.ti!==null?y.ti.after(a.svg):y.Nj.prepend(a.svg),y.ti=a.svg):E&&ms(a,E,a.svg),!0);if(a.Dd()&&a.isShadowed){var z=a.shadowOffset;y.Ev(z.x*x.scale*a.scale*x.Mb,z.y*x.scale*a.scale*x.Mb,a.shadowBlur),Tu(y),y.shadowColor=a.shadowColor}a instanceof Or&&(y.font=a.font),y.yd=null;var tt=a.transform;z=a instanceof si;var it=a instanceof si?ah(a):!1;a.l&4096&&es(a);var nt=a.Ib;if(y.rb.ha=[1,0,0,1,0,0],y.o=!1,b&&(y.o=!0,z&&it?(jp(y,1,0,0,1,0,0),a.svg=y.ad):z?(jp(y,tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy),a.svg=y.ad):jp(y,1,0,0,1,0,0)),b=a.naturalBounds,a.areaBackground!==null){var ot=tt.copy().Vj();y.rb.ha=[ot.m11,ot.m12,ot.m21,ot.m22,ot.dx,ot.dy],Na(a,y,b,nt),y.rb.ha=[1,0,0,1,0,0],y.yd.gd=y.ad,y.yd.prepend(y.ad)}return z||(y.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy]),a.background!==null&&(z?(it&&(y.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy]),ra(a,y,b,nt),it&&(y.rb.ha=[1,0,0,1,0,0])):(y.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy],ra(a,y,b,nt)),y.yd.Ma=y.ad,y.yd.prepend(y.ad)),tt=y.yd,b=a.part,it=!1,b&&x.Gf("drawShadows")&&(it=b.isShadowed),y.clipInsteadOfFill&&(it=!1),a.Dd()&&it&&Tu(y),it&&a.shadowVisible===!0?Tu(y):it&&a.shadowVisible===!1&&lu(y),b=a.panel,it&&Xo(a,b)&&a.shadowVisible===null&&lu(y),y.Il&&(ot=x.computePixelRatio(),ot="drop-shadow("+y.shadowOffsetX/ot+"px "+y.shadowOffsetY/ot+"px "+y.shadowBlur/ot/2+"px "+y.shadowColor+")",a.background!==null&&tt.Ma.setAttributeNS(null,"filter",ot),a.areaBackground!==null&&tt.gd.setAttributeNS(null,"filter",ot)),it&&(a.Ma!==null||a.areaBackground!==null||Xo(a,b))?(yl(a,!0),a.shadowVisible===null&&lu(y)):yl(a,!1),b=it,a.hh(y,x),z&&y.nh.pop(),y.o&&y.nh.pop(),tt=y.Gv.hs,it=z?a.svg:y.yd,ot=a.svg,!z&&ot!==null&&it!==ot&&ot.parentNode===a.panel.svg?(a.svg.replaceWith(it),a.svg=it,it!==null&&a.$o(y,E,nt,it),Ys(y,ot),!0):(a.svg=it,tt!==null&&it===null&&(lv(y),y.nh.pop()),it===null||(a.$o(y,E,nt,it),y.Il&&(x=x.computePixelRatio(),a.Dv(it,"drop-shadow("+y.shadowOffsetX/x+"px "+y.shadowOffsetY/x+"px "+y.shadowBlur/x/2+"px "+y.shadowColor+")")),b&&a.l&512&&Tu(y),a.Dd()&&lu(y),x=a.Dd()?a.opacity*y.globalAlpha:a.opacity,x!==1&&it.setAttributeNS(null,"opacity",x.toString()),a.filter!==""&&it.setAttributeNS(null,"filter",a.filter),a.Dd()?(y.ti?y.ti.after(it):y.Nj.prepend(it),y.ti=it):E!==null&&ms(a,E,it),tt!==null&&tt(a,it)),!0)}yt.$o=function(a,y,x,E){var b=(this.l&256)!==0;if(a.clipInsteadOfFill&&(b=!1),b){var z=y.se()?y.naturalBounds:y.actualBounds;y=Math.max(x.x,z.x),b=Math.max(x.y,z.y);var tt=Math.min(x.right,z.right)-y;x=Math.min(x.bottom,z.bottom)-b,z=this.tb,z!==null&&(y=z.x,b=z.y,tt=z.width,x=z.height),z=E.getAttribute("clip-path");var it=null;z!==null&&(it=a.svg.getElementById(z.split("#")[1].slice(0,-1))),it===null?(z="CLIP"+zn++,it=a.Ud("clipPath",{id:z}),y=a.Ud("rect",{x:y,y:b,width:tt,height:x}),this instanceof si&&(b=this.transform.copy().Vj(),y.setAttribute("transform","matrix("+b.m11+", "+b.m12+", "+b.m21+", "+b.m22+", "+b.dx+", "+b.dy+")")),it.appendChild(y),a.svg.appendChild(it),E.setAttributeNS(null,"clip-path","url(#"+z+")")):(a=it.firstElementChild,a.setAttribute("x",y.toString()),a.setAttribute("y",b.toString()),a.setAttribute("width",tt.toString()),a.setAttribute("height",x.toString()))}else E.removeAttributeNS(null,"clip-path"),Ys(a,E)};function Ys(a,y){y=y.getAttribute("clip-path"),y!==null&&(a=a.svg.getElementById(y.split("#")[1].slice(0,-1)),a!==null&&a.remove())}function ys(a){if(a.svg!==null){var y=a.svg.innerHTML.match(/url\(#((CLIP|GRAD).+?)\)/g),x=a.svg.ownerDocument;if(y!==null){y=on(y);for(var E=y.next();!E.done;E=y.next())E=x.getElementById(E.value.split("#")[1].slice(0,-1)),E!==null&&E.remove()}a.svg.remove()}}yt.hh=function(){},yt.lv=function(){this.Uc=!0},yt.kk=function(a,y,x){if(this.Uc)return this.lv(),this.Uc=!1;if(y=this.svg,y===null)return!1;if(!this.visible)return y.remove(),!1;if(y.nodeName!=="g"&&x||y.nodeName==="g"&&!x)return!1;var E=this.transform,b=this instanceof si?ah(this):!1;if(!(this instanceof si&&b))if(this instanceof Qs){var z=this.bt;a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy],z!==null&&Qy(a,z[0],z[1],z[2],z[3],z[4],z[5],z[6],z[7]),x?y.lastElementChild.setAttributeNS(null,"transform",$y(a)):y.setAttributeNS(null,"transform",$y(a))}else if(!x||this instanceof si)y.setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")");else if(this instanceof Rn){z=y.getElementsByTagName("path");for(var tt=0;tt<z.length;tt++)z[tt].setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")")}else y.lastElementChild.setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")");return z=this.Dd()?this.opacity*a.globalAlpha:this.opacity,z===1?y.removeAttribute("opacity"):y.setAttributeNS(null,"opacity",z.toString()),a.rb.ha=[1,0,0,1,0,0],(this.areaBackground!==null||y.gd!==void 0)&&(z=y.gd,this.areaBackground===null?(y.gd.remove(),y.gd=void 0):(tt=E.copy().Vj(),a.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy],Na(this,a,this.naturalBounds,this.actualBounds),a.rb.ha=[1,0,0,1,0,0],y.gd?(tt=y.gd.getAttribute("filter"),tt!==null&&a.ad.setAttribute("filter",tt),y.gd.replaceWith(a.ad)):y.prepend(a.ad),y.gd=a.ad),z&&uv(a,z)),(this.background!==null||y.Ma!==void 0)&&(z=y.Ma,this.background===null?(uv(a,y.Ma),y.Ma.remove(),y.Ma=void 0):((b||x&&!(this instanceof si))&&(a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy]),ra(this,a,this.naturalBounds,this.actualBounds),y.Ma?(uv(a,y.Ma),x=y.Ma.getAttribute("filter"),x!==null&&a.ad.setAttribute("filter",x),y.Ma.replaceWith(a.ad)):y.prepend(a.ad),y.Ma=a.ad),z&&uv(a,z)),this.$o(a,this.panel,this.actualBounds,y),!0},yt.nk=function(a){if(this.background!==null||this.areaBackground!==null)return!0;var y=(this.l&256)!==0;return a.clipInsteadOfFill&&(y=!1),!!y};function uo(a,y,x,E,b,z,tt){if(x!==null){var it=1,nt=1;if(typeof x=="string")E?y.fillStyle=x:y.strokeStyle=x;else if(x.type===sh)E?y.fillStyle=x.color:y.strokeStyle=x.color;else{var ot=a.kq();if(it=z.width,nt=z.height,b?(it=tt.width,nt=tt.height):E||(it+=ot,nt+=ot),(z=y instanceof Bc)&&x.xe&&(x.type===wd||x.yk===it&&x.ft===nt))var st=x.xe;else{var ut=0,ct=0,dt=0,vt=0,xt=0,Tt=0;if(Tt=xt=0,b?(xt=tt.x,Tt=tt.y):E||(xt-=ot/2,Tt-=ot/2),ut=x.start.x*it+x.start.offsetX,ct=x.start.y*nt+x.start.offsetY,dt=x.end.x*it+x.end.offsetX,vt=x.end.y*nt+x.end.offsetY,ut+=xt,dt+=xt,ct+=Tt,vt+=Tt,x.type===Au)st=y.createLinearGradient(ut,ct,dt,vt);else if(x.type===Ka)Tt=isNaN(x.endRadius)?Math.max(it,nt)/2:x.endRadius,isNaN(x.startRadius)?(xt=0,Tt=Math.max(it,nt)/2):xt=x.startRadius,st=y.createRadialGradient(ut,ct,xt,dt,vt,Tt);else if(x.type===wd)try{st=y.createPattern(x.pattern,"repeat")}catch(Ft){st=null}if(x.type!==wd&&(b=x.colorStops,b!==null))for(b=b.iterator;b.next();)st.addColorStop(b.key,b.value);if(z&&(x.xe=st,st!==null&&(x.yk=it,x.ft=nt),st===null&&x.type===wd&&x.yk!==-1)){x.yk=-1;var Et=a.diagram;Et!==null&&x.yk===-1&&On(function(){Et.redraw()},600)}}E?y.fillStyle=st:y.strokeStyle=st}}}yt.rg=function(a){if(a instanceof si)t:{if(this!==a&&a!==null)for(var y=this.panel;y!==null;){if(y===a){a=!0;break t}y=y.panel}a=!1}else a=!1;return a},yt.Ed=function(){if(!this.visible)return!1;var a=this.panel;return a!==null?a.Ed():!0},yt.If=function(){for(var a=this instanceof si?this:this.panel;a!==null&&a.isEnabled;)a=a.panel;return a===null};function es(a){if(a.l&2048){var y=a.Ab;if(y.reset(),!a.Ib.w()||!a.uc.w()){il(a,!1);return}if(y.translate(a.Ib.x-a.uc.x,a.Ib.y-a.uc.y),a.scale!==1||a.angle!==0){var x=a.naturalBounds;a.no(y,x.x,x.y,x.width,x.height)}il(a,!1),Wa(a,!0)}a.l&4096&&(y=a.panel,y===null?(a.wh.set(a.Ab),a.Kk=a.scale,Wa(a,!1)):y.oe!==null&&(x=a.wh,x.reset(),y.se()?x.multiply(y.wh):y.panel!==null&&x.multiply(y.panel.wh),x.multiply(a.Ab),a.Kk=a.scale*y.Kk,Wa(a,!1)))}yt.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=Pt.alloc();z.yi(y,x,E,b,Hn),a.rotate(this.Kb,z.x,z.y),Pt.free(z)}},yt.v=function(a){if(!Ta(this)){a===void 0&&(a=!1),No(this,!0),au(this,!0);var y=this.panel;y===null||a||y.v()}},yt.Uj=function(){Ta(this)||(No(this,!0),au(this,!0))};function Bs(a){if(!Os(a)){var y=a.panel;y!==null?y.v():a.Dd()&&(y=a.diagram,y!==null&&(y.De.add(a),a instanceof Ci&&a.Bd(),y.$b())),au(a,!0)}}yt.Uk=function(){!(this.l&2048)&&(il(this,!0),Wa(this,!0))},yt.Wu=function(){Wa(this,!0)},yt.N=function(){var a=this.part;a!==null&&a.N()};function Xs(a,y){var x=a.stretch,E=a.panel;return E!==null&&E.type===si.Table?Ll(a,E.Fb(a.row),E.Eb(a.column),y):E!==null&&E.type===si.Auto&&E.Pb()===a?Jo(a,ri,y):x===Dn?E!==null?E.type===si.Spot&&E.Pb()===a?Jo(a,ri,y):(x=E.defaultStretch,x===Dn?Jo(a,Qe,y):Jo(a,x,y)):Jo(a,Qe,y):Jo(a,x,y)}function Ll(a,y,x,E){var b=a.stretch;if(b!==Dn)return Jo(a,b,E);var z=b=null;switch(y.stretch){case dn:z=!0;break;case ri:z=!0}switch(x.stretch){case $i:b=!0;break;case ri:b=!0}return y=a.panel.defaultStretch,b===null&&(b=y===$i||y===ri),z===null&&(z=y===dn||y===ri),b===!0&&z===!0?Jo(a,ri,E):b===!0?Jo(a,$i,E):z===!0?Jo(a,dn,E):Jo(a,Qe,E)}function Jo(a,y,x){if(x)return y;if(y===Qe||(x=a.desiredSize,x.w()))return Qe;if(a=a.angle,!isNaN(x.width))if(a!==90&&a!==270){if(y===$i)return Qe;if(y===ri)return dn}else{if(y===dn)return Qe;if(y===ri)return $i}if(!isNaN(x.height))if(a!==90&&a!==270){if(y===dn)return Qe;if(y===ri)return $i}else{if(y===$i)return Qe;if(y===ri)return dn}return y}function yl(a,y){a.l=y?a.l|512:a.l&-513}function ss(a){return(a.l&1024)!==0}function wf(a,y){a.l=y?a.l|1024:a.l&-1025}function il(a,y){a.l=y?a.l|2048:a.l&-2049}function Wa(a,y){a.l=y?a.l|4096:a.l&-4097}function Ta(a){return(a.l&8192)!==0}function No(a,y){a.l=y?a.l|8192:a.l&-8193}function Os(a){return(a.l&16384)!==0}function au(a,y){a.l=y?a.l|16384:a.l&-16385}yt.Gj=function(){this.svg=null},yt.wi=function(a){this.Me=a,this.svg!==null&&this.svg.remove()},yt.Av=function(){},yt.zv=function(a){return this.pa=a,Bs(this),!0},yt.mm=function(a,y){(this.pa.x!==a||this.pa.y!==y)&&(this.pa.h(a,y),this.Uk())},yt.kq=function(){return 0};function Dc(a){var y=a.part;if(y instanceof Ci&&(a.portId!==null||a===y.port)){var x=y.diagram;x===null||x.undoManager.isUndoingRedoing||Vx(y,a)}}function Xy(a){var y=a.diagram;y===null||y.undoManager.isUndoingRedoing||(a instanceof si?a instanceof Ci?a.Bd():a.qm(a,function(x){Dc(x)}):Dc(a))}yt.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new Co(a,y,x,E):b=a,b.xd=this,a=this.ih(),a!==null&&px(a)&&It("Cannot add a Binding to a template that has already been copied: "+b),this.localBindings===null&&(this.localBindings=new Me),this.localBindings.add(b),this},yt.set=function(a){return Object.assign(this,a),this},yt.Du=function(a){return n0(this,a),this},yt.apply=function(a){return a(this),this},yt.nm=function(a){return Mc(this,a),this},yt.pz=function(){return this.ih()},yt.ih=function(){for(var a=this instanceof si?this:this.panel;a!==null;){if(a.allBindings!==null)return a;a=a.panel}return null},yt.Jv=function(a){return a.xd=this,this.animationTriggers===null&&(this.animationTriggers=new ji),this.animationTriggers.add(a.propertyName,a),this};function Za(a,y){for(var x=1;x<arguments.length;++x);x=arguments;var E=null,b=null;if(typeof a=="function")b=a;else if(typeof a=="string"){var z=pd.I(a);typeof z=="function"?(x=rn(arguments),E=z(x),Oe(E)||It('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):b=Xe.go[a]}if(E===null&&(b!=null&&b.constructor||It("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+a),E=new b),b=1,E instanceof le&&1<x.length){z=E;var tt=x[1];(typeof tt=="string"||tt instanceof HTMLDivElement)&&(fp(z,tt),b++)}for(;b<x.length;b++)z=x[b],z===void 0?It("Undefined value at argument "+b+" for object being constructed by GraphObject.make: "+E):n0(E,z);return E}function n0(a,y){if(typeof y=="string")if(a instanceof Or)a.text=y;else if(a instanceof Rn)a.figure=y;else if(a instanceof Qs)a.source=y;else if(a instanceof si)y=xl.I(y),y!==null&&(a.type=y);else if(a instanceof kr){var x=gn(kr,y);x!==null?a.type=x:It("Unknown Brush type as an argument to GraphObject.make: "+y)}else a instanceof ci?(y=gn(ci,y),y!==null&&(a.type=y)):a instanceof pr&&(y=gn(pr,y),y!==null&&(a.type=y));else if(y instanceof Kt)a instanceof si||It("A GraphObject can only be added to a Panel, not to: "+a),a.add(y);else if(y instanceof To){var E;y.isRow&&typeof a.getRowDefinition=="function"?E=a.getRowDefinition(y.index):y.isRow||typeof a.getColumnDefinition!="function"||(E=a.getColumnDefinition(y.index)),E instanceof To?Ev(E,y):It("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+a)}else if(y instanceof ze)typeof a.qb=="function"&&a.qb(y);else if(y instanceof Do)a.type=y;else if(y instanceof Co)a instanceof Kt||a instanceof To?a.bind(y):It("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(y instanceof vl)a instanceof Kt?a.Jv(y):It("An AnimationTrigger can only be applied to a GraphObject, not to: "+a);else if(y instanceof zo)a instanceof ci&&a.type===ci.o?a.figures.add(y):It("A PathFigure can only be added to a Path Geometry, not to: "+a);else if(y instanceof pr)a instanceof zo?a.segments.add(y):It("A PathSegment can only be added to a PathFigure, not to: "+a);else if(y instanceof Gr)a instanceof le||a instanceof An?a.layout=y:It("A Layout can only be assigned to a Diagram or a Group, not to: "+a);else if(Array.isArray(y))for(x=0;x<y.length;x++)n0(a,y[x]);else if(typeof y=="object"&&y!==null)if(a instanceof kr){x=new Sn;for(var b in y)E=parseFloat(b),isNaN(E)?x[b]=y[b]:a.addColorStop(E,y[b]);Mc(a,x)}else if(a instanceof To){y.row!==void 0?(b=y.row,(b==null||b===1/0||isNaN(b)||0>b)&&It("Must specify non-negative integer row for RowColumnDefinition "+y+", not: "+b),a.isRow=!0,a.index=b):y.column!==void 0&&(b=y.column,(b==null||b===1/0||isNaN(b)||0>b)&&It("Must specify non-negative integer column for RowColumnDefinition "+y+", not: "+b),a.isRow=!1,a.index=b),b=new Sn;for(x in y)x!=="row"&&x!=="column"&&(b[x]=y[x]);Mc(a,b)}else Mc(a,y);else It('Unknown initializer "'+y+'" for object being constructed by GraphObject.make: '+a)}function oh(a,y){pd.add(a,y)}function av(a,y,x){x===void 0&&(x=null);var E=a[1];if(typeof x=="function"?x(E):typeof E=="string")return a.splice(1,1),E;if(y===void 0)throw Error("no "+(typeof x=="function"?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return y}zi.Object.defineProperties(Kt.prototype,{bindingId:{get:function(){return this.A!==null?this.A.zp:-1},set:function(a){this.bindingId!==a&&(this.A===null&&(this.A=new Sf),this.A.zp=a)}},localBindings:{get:function(){return this.A!==null?this.A.te:null},set:function(a){this.localBindings!==a&&(this.A===null&&(this.A=new Sf),this.A.te=a)}},srcBindings:{get:function(){return this.A!==null?this.A.wm:null},set:function(a){this.srcBindings!==a&&(this.A===null&&(this.A=new Sf),this.A.wm=a)}},shadowVisible:{get:function(){return this.A!==null?this.A.Ci:null},set:function(a){var y=this.shadowVisible;y!==a&&(_n(this),this.A.Ci=a,this.Uc=!0,this.N(),this.g("shadowVisible",y,a))}},enabledChanged:{get:function(){return this.A!==null?this.A.Hb:null},set:function(a){var y=this.enabledChanged;y!==a&&(_n(this),this.A.Hb=a,this.g("enabledChanged",y,a))}},segmentOrientation:{get:function(){return this.Ua!==null?this.Ua.rr:js},set:function(a){var y=this.segmentOrientation;y!==a&&(this.Ua===null&&(this.Ua=new Vh),this.Ua.rr=a,this.v(),this.g("segmentOrientation",y,a),a===js&&(this.angle=0))}},segmentIndex:{get:function(){return this.Ua!==null?this.Ua.u:-1/0},set:function(a){a=Math.round(a);var y=this.segmentIndex;y!==a&&(this.Ua===null&&(this.Ua=new Vh),this.Ua.u=a,this.v(),this.g("segmentIndex",y,a))}},segmentFraction:{get:function(){return this.Ua!==null?this.Ua.o:0},set:function(a){isNaN(a)||0>a?a=0:1<a&&(a=1);var y=this.segmentFraction;y!==a&&(this.Ua===null&&(this.Ua=new Vh),this.Ua.o=a,this.v(),this.g("segmentFraction",y,a))}},segmentOffset:{get:function(){return this.Ua!==null?this.Ua.F:gr},set:function(a){var y=this.segmentOffset;y.D(a)||(a=a.J(),this.Ua===null&&(this.Ua=new Vh),this.Ua.F=a,this.v(),this.g("segmentOffset",y,a))}},stretch:{get:function(){return this.A!==null?this.A.hg:Dn},set:function(a){var y=this.stretch;y!==a&&(_n(this),this.A.hg=a,this.v(),this.g("stretch",y,a))}},name:{get:function(){return this.A!==null?this.A.xa:""},set:function(a){var y=this.name;y!==a&&(_n(this),this.A.xa=a,this.part!==null&&(this.part.Rh=null),this.g("name",y,a))}},opacity:{get:function(){return this.pb},set:function(a){var y=this.pb;y!==a&&((0>a||1<a)&&xi(a,"0 <= value <= 1",Kt,"opacity"),this.pb=a,this.g("opacity",y,a),a=this.diagram,y=this.part,a!==null&&y!==null&&a.N(jc(y,y.actualBounds)))}},filter:{get:function(){return this.bn},set:function(a){var y=this.bn;y!==a&&(this.bn=a,this.Uc=!0,this.g("filter",y,a),a=this.diagram,y=this.part,a!==null&&y!==null&&a.N(jc(y,y.actualBounds)))}},visible:{get:function(){return(this.l&1)!==0},set:function(a){var y=(this.l&1)!==0;y!==a&&(this.l^=1,this.g("visible",y,a),y=this.panel,y!==null?y.v():this.Dd()&&this.Zb(a),this.N(),Xy(this))}},pickable:{get:function(){return(this.l&2)!==0},set:function(a){var y=(this.l&2)!==0;y!==a&&(this.l^=2,this.g("pickable",y,a))}},fromLinkableDuplicates:{get:function(){return(this.l&4)!==0},set:function(a){var y=(this.l&4)!==0;y!==a&&(this.l^=4,this.g("fromLinkableDuplicates",y,a))}},fromLinkableSelfNode:{get:function(){return(this.l&8)!==0},set:function(a){var y=(this.l&8)!==0;y!==a&&(this.l^=8,this.g("fromLinkableSelfNode",y,a))}},toLinkableDuplicates:{get:function(){return(this.l&16)!==0},set:function(a){var y=(this.l&16)!==0;y!==a&&(this.l^=16,this.g("toLinkableDuplicates",y,a))}},toLinkableSelfNode:{get:function(){return(this.l&32)!==0},set:function(a){var y=(this.l&32)!==0;y!==a&&(this.l^=32,this.g("toLinkableSelfNode",y,a))}},isPanelMain:{get:function(){return(this.l&64)!==0},set:function(a){var y=(this.l&64)!==0;y!==a&&(this.l^=64,this.v(),this.g("isPanelMain",y,a))}},isActionable:{get:function(){return(this.l&128)!==0},set:function(a){var y=(this.l&128)!==0;y!==a&&(this.l^=128,this.g("isActionable",y,a))}},areaBackground:{get:function(){return this.A!==null?this.A.gd:null},set:function(a){var y=this.areaBackground;y!==a&&(a!==null&&kf(a,"GraphObject.areaBackground"),a instanceof kr&&a.freeze(),_n(this),this.A.gd=a,this.N(),this.g("areaBackground",y,a))}},background:{get:function(){return this.Ma},set:function(a){var y=this.Ma;y!==a&&(a!==null&&kf(a,"GraphObject.background"),a instanceof kr&&a.freeze(),this.Ma=a,this.N(),this.g("background",y,a))}},part:{get:function(){if(this.Dd())return this;if(this.Ng!==null)return this.Ng;var a;for(a=this.panel;a;){if(a instanceof tn)return this.Ng=a;a=a.panel}return null}},svg:{get:function(){return this.V},set:function(a){this.V=a}},panel:{get:function(){return this.Me}},layer:{get:function(){var a=this.part;return a!==null?a.layer:null}},diagram:{get:function(){var a=this.part;return a!==null?a.diagram:null}},position:{get:function(){return this.pa},set:function(a){var y=a.x,x=a.y,E=this.pa,b=E.x;E=E.y,(b===y||isNaN(b)&&isNaN(y))&&(E===x||isNaN(E)&&isNaN(x))?this.Av():(a=a.copy(),this.zv(a,b,E)&&this.g("position",new Pt(b,E),a))}},actualBounds:{get:function(){return this.Ib}},scale:{get:function(){return this.Ca},set:function(a){var y=this.Ca;y!==a&&(0>=a&&It("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.Ca=a,this.v(),this.g("scale",y,a))}},angle:{get:function(){return this.Kb},set:function(a){var y=this.Kb;y!==a&&(a%=360,0>a&&(a+=360),y!==a&&(this.Kb=a,Xy(this),this.v(),this.g("angle",y,a)))}},desiredSize:{get:function(){return this.jd},set:function(a){var y=a.width,x=a.height,E=this.jd,b=E.width,z=E.height;(b===y||isNaN(b)&&isNaN(y))&&(z===x||isNaN(z)&&isNaN(x))||(this.jd=a=a.J(),this.v(),this instanceof Rn&&this.qc(),this.g("desiredSize",E,a),ss(this)&&(a=this.part,a!==null&&(Zr(this,a,"width"),Zr(this,a,"height"))))}},width:{get:function(){return this.jd.width},set:function(a){var y=this.jd.width;y===a||isNaN(y)&&isNaN(a)||(y=this.jd,this.jd=a=new li(a,this.jd.height).freeze(),this.v(),this instanceof Rn&&this.qc(),this.g("desiredSize",y,a),ss(this)&&(a=this.part,a!==null&&Zr(this,a,"width")))}},height:{get:function(){return this.jd.height},set:function(a){var y=this.jd.height;y===a||isNaN(y)&&isNaN(a)||(y=this.jd,this.jd=a=new li(this.jd.width,a).freeze(),this.v(),this instanceof Rn&&this.qc(),this.g("desiredSize",y,a),ss(this)&&(a=this.part,a!==null&&Zr(this,a,"height")))}},minSize:{get:function(){return this.A!==null?this.A.u:Pn},set:function(a){var y=this.minSize;y.D(a)||(a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),_n(this),this.A.u=a,this.v(),this.g("minSize",y,a))}},maxSize:{get:function(){return this.A!==null?this.A.o:oo},set:function(a){var y=this.maxSize;y.D(a)||(a=a.copy(),isNaN(a.width)&&(a.width=1/0),isNaN(a.height)&&(a.height=1/0),a.freeze(),_n(this),this.A.o=a,this.v(),this.g("maxSize",y,a))}},measuredBounds:{get:function(){return this.uc}},naturalBounds:{get:function(){return this.dc}},margin:{get:function(){return this.Kg},set:function(a){typeof a=="number"&&(a=new jn(a));var y=this.Kg;y.D(a)||(this.Kg=a=a.J(),this.v(),this.g("margin",y,a))}},transform:{get:function(){return this.l&2048&&es(this),this.Ab}},oe:{get:function(){return this.l&4096&&es(this),this.wh}},animationTriggers:{get:function(){return this.A!==null?this.A.hb:null},set:function(a){this.animationTriggers!==a&&(_n(this),this.A.hb=a)}},reshapingBehavior:{get:function(){return this.A!==null?this.A.Pf:Qe},set:function(a){this.reshapingBehavior!==a&&(_n(this),this.A.Pf=a)}},alignment:{get:function(){return this.Jb},set:function(a){var y=this.Jb;y.D(a)||(a.Mc()&&!a.Xb()&&It("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Jb=a=a.J(),Bs(this),this.g("alignment",y,a))}},column:{get:function(){return this.Ag},set:function(a){a=Math.round(a);var y=this.Ag;y!==a&&(0>a&&xi(a,">= 0",Kt,"column"),this.Ag=a,this.v(),this.g("column",y,a),this.svg!==null&&this.svg.remove())}},columnSpan:{get:function(){return this.A!==null?this.A.ob:1},set:function(a){a=Math.round(a);var y=this.columnSpan;y!==a&&(1>a&&xi(a,">= 1",Kt,"columnSpan"),_n(this),this.A.ob=a,this.v(),this.g("columnSpan",y,a))}},row:{get:function(){return this.io},set:function(a){a=Math.round(a);var y=this.io;y!==a&&(0>a&&xi(a,">= 0",Kt,"row"),this.io=a,this.v(),this.g("row",y,a),this.svg!==null&&this.svg.remove())}},rowSpan:{get:function(){return this.A!==null?this.A.Bi:1},set:function(a){a=Math.round(a);var y=this.rowSpan;y!==a&&(1>a&&xi(a,">= 1",Kt,"rowSpan"),_n(this),this.A.Bi=a,this.v(),this.g("rowSpan",y,a))}},spanAllocation:{get:function(){return this.A!==null?this.A.Di:null},set:function(a){var y=this.spanAllocation;y!==a&&(_n(this),this.A.Di=a,this.v(),this.g("spanAllocation",y,a))}},alignmentFocus:{get:function(){return this.sk},set:function(a){var y=this.sk;y.D(a)||(this.sk=a=a.J(),this.v(),this.g("alignmentFocus",y,a))}},portId:{get:function(){return this.Yn},set:function(a){var y=this.Yn;if(y!==a){var x=this.part;x===null||x instanceof Ci||It("Cannot set portID on a Link: "+a),y!==null&&x!==null&&Z0(x,this),this.Yn=a,a!==null&&x!==null&&(x.Te=!0,Yx(x,this)),this.g("portId",y,a)}}},toSpot:{get:function(){return this.ba!==null?this.ba.yj:Jn},set:function(a){var y=this.toSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.yj=a,this.g("toSpot",y,a),Dc(this))}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:10},set:function(a){var y=this.toEndSegmentLength;y!==a&&(0>a&&xi(a,">= 0",Kt,"toEndSegmentLength"),this.Xc(),this.ba.wj=a,this.g("toEndSegmentLength",y,a),Dc(this))}},toShortLength:{get:function(){return this.ba!==null?this.ba.xj:0},set:function(a){var y=this.toShortLength;y!==a&&(this.Xc(),this.ba.xj=a,this.g("toShortLength",y,a),Dc(this))}},toLinkable:{get:function(){return this.ba!==null?this.ba.Tr:null},set:function(a){var y=this.toLinkable;y!==a&&(this.Xc(),this.ba.Tr=a,this.g("toLinkable",y,a))}},toMaxLinks:{get:function(){return this.ba!==null?this.ba.Ur:1/0},set:function(a){var y=this.toMaxLinks;y!==a&&(0>a&&xi(a,">= 0",Kt,"toMaxLinks"),this.Xc(),this.ba.Ur=a,this.g("toMaxLinks",y,a))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:Jn},set:function(a){var y=this.fromSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.Xi=a,this.g("fromSpot",y,a),Dc(this))}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:10},set:function(a){var y=this.fromEndSegmentLength;y!==a&&(0>a&&xi(a,">= 0",Kt,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=a,this.g("fromEndSegmentLength",y,a),Dc(this))}},fromShortLength:{get:function(){return this.ba!==null?this.ba.Wi:0},set:function(a){var y=this.fromShortLength;y!==a&&(this.Xc(),this.ba.Wi=a,this.g("fromShortLength",y,a),Dc(this))}},fromLinkable:{get:function(){return this.ba!==null?this.ba.hq:null},set:function(a){var y=this.fromLinkable;y!==a&&(this.Xc(),this.ba.hq=a,this.g("fromLinkable",y,a))}},fromMaxLinks:{get:function(){return this.ba!==null?this.ba.iq:1/0},set:function(a){var y=this.fromMaxLinks;y!==a&&(0>a&&xi(a,">= 0",Kt,"fromMaxLinks"),this.Xc(),this.ba.iq=a,this.g("fromMaxLinks",y,a))}},cursor:{get:function(){return this.A!==null?this.A.j:""},set:function(a){var y=this.cursor;y!==a&&(_n(this),this.A.j=a,this.g("cursor",y,a))}},click:{get:function(){return this.A!==null?this.A.zh:null},set:function(a){var y=this.click;y!==a&&(_n(this),this.A.zh=a,this.g("click",y,a))}},doubleClick:{get:function(){return this.A!==null?this.A.Fh:null},set:function(a){var y=this.doubleClick;y!==a&&(_n(this),this.A.Fh=a,this.g("doubleClick",y,a))}},contextClick:{get:function(){return this.A!==null?this.A.Bh:null},set:function(a){var y=this.contextClick;y!==a&&(_n(this),this.A.Bh=a,this.g("contextClick",y,a))}},mouseEnter:{get:function(){return this.A!==null?this.A.Mh:null},set:function(a){var y=this.mouseEnter;y!==a&&(_n(this),this.A.Mh=a,this.g("mouseEnter",y,a))}},mouseLeave:{get:function(){return this.A!==null?this.A.Ph:null},set:function(a){var y=this.mouseLeave;y!==a&&(_n(this),this.A.Ph=a,this.g("mouseLeave",y,a))}},mouseOver:{get:function(){return this.A!==null?this.A.Qh:null},set:function(a){var y=this.mouseOver;y!==a&&(_n(this),this.A.Qh=a,this.g("mouseOver",y,a))}},mouseHover:{get:function(){return this.A!==null?this.A.Oh:null},set:function(a){var y=this.mouseHover;y!==a&&(_n(this),this.A.Oh=a,this.g("mouseHover",y,a))}},mouseHold:{get:function(){return this.A!==null?this.A.Nh:null},set:function(a){var y=this.mouseHold;y!==a&&(_n(this),this.A.Nh=a,this.g("mouseHold",y,a))}},mouseDragEnter:{get:function(){return this.A!==null?this.A.Of:null},set:function(a){var y=this.mouseDragEnter;y!==a&&(_n(this),this.A.Of=a,this.g("mouseDragEnter",y,a))}},mouseDragLeave:{get:function(){return this.A!==null?this.A.Xd:null},set:function(a){var y=this.mouseDragLeave;y!==a&&(_n(this),this.A.Xd=a,this.g("mouseDragLeave",y,a))}},mouseDrop:{get:function(){return this.A!==null?this.A.Lh:null},set:function(a){var y=this.mouseDrop;y!==a&&(_n(this),this.A.Lh=a,this.g("mouseDrop",y,a))}},actionDown:{get:function(){return this.A!==null?this.A.V:null},set:function(a){var y=this.actionDown;y!==a&&(_n(this),this.A.V=a,this.g("actionDown",y,a))}},actionMove:{get:function(){return this.A!==null?this.A.ia:null},set:function(a){var y=this.actionMove;y!==a&&(_n(this),this.A.ia=a,this.g("actionMove",y,a))}},actionUp:{get:function(){return this.A!==null?this.A.Ha:null},set:function(a){var y=this.actionUp;y!==a&&(_n(this),this.A.Ha=a,this.g("actionUp",y,a))}},actionCancel:{get:function(){return this.A!==null?this.A.F:null},set:function(a){var y=this.actionCancel;y!==a&&(_n(this),this.A.F=a,this.g("actionCancel",y,a))}},toolTip:{get:function(){return this.A!==null?this.A.$h:null},set:function(a){var y=this.toolTip;y!==a&&(_n(this),this.A.$h=a,this.g("toolTip",y,a))}},contextMenu:{get:function(){return this.A!==null?this.A.Ch:null},set:function(a){var y=this.contextMenu;y!==a&&(_n(this),this.A.Ch=a,this.g("contextMenu",y,a))}}}),Kt.prototype.trigger=Kt.prototype.Jv,Kt.prototype.findBindingPanel=Kt.prototype.ih,Kt.prototype.findTemplateBinder=Kt.prototype.pz,Kt.prototype.setProperties=Kt.prototype.nm,Kt.prototype.apply=Kt.prototype.apply,Kt.prototype.attach=Kt.prototype.Du,Kt.prototype.set=Kt.prototype.set,Kt.prototype.isEnabledObject=Kt.prototype.If,Kt.prototype.isVisibleObject=Kt.prototype.Ed,Kt.prototype.isContainedBy=Kt.prototype.rg,Kt.prototype.getNearestIntersectionPoint=Kt.prototype.rs,Kt.prototype.getLocalPoint=Kt.prototype.qs,Kt.prototype.getDocumentScale=Kt.prototype.Df,Kt.prototype.getDocumentAngle=Kt.prototype.li,Kt.prototype.getDocumentBounds=Kt.prototype.mi,Kt.prototype.getDocumentPoint=Kt.prototype.ga,Kt.prototype.intersectsRect=Kt.prototype.Yc,Kt.prototype.containedInRect=Kt.prototype.fh,Kt.prototype.containsRect=Kt.prototype.Re,Kt.prototype.containsPoint=Kt.prototype.ca,Kt.prototype.raiseChanged=Kt.prototype.g,Kt.prototype.raiseChangedEvent=Kt.prototype.cb,Kt.prototype.addCopyProperty=Kt.prototype.Vw;var pd=null;Kt.className="GraphObject",pd=new ji,oh("Button",function(){function a(x,E){return x.diagram.ic(x.documentPoint,function(b){for(;b.panel!==null&&!b.isActionable;)b=b.panel;return b},function(b){return b===E})!==null}var y=Za(si,si.Auto,{isActionable:!0,enabledChanged:function(x,E){if(x instanceof si){var b=x.fb("ButtonBorder");b!==null&&(b.fill=E?x._buttonFillNormal:x._buttonFillDisabled)}},cursor:"pointer",_buttonFillNormal:"#F5F5F5",_buttonStrokeNormal:"#BDBDBD",_buttonFillOver:"#E0E0E0",_buttonStrokeOver:"#9E9E9E",_buttonFillPressed:"#BDBDBD",_buttonStrokePressed:"#9E9E9E",_buttonFillDisabled:"#E5E5E5"},Za(Rn,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new nn(0,0,2.76142374915397,2.761423749153969),spot2:new nn(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));return y.mouseEnter=function(x,E){if(E.If()&&E instanceof si&&(x=E.fb("ButtonBorder"),x instanceof Rn)){var b=E._buttonFillOver;E._buttonFillNormal=x.fill,x.fill=b,b=E._buttonStrokeOver,E._buttonStrokeNormal=x.stroke,x.stroke=b}},y.mouseLeave=function(x,E){E.If()&&E instanceof si&&(x=E.fb("ButtonBorder"),x instanceof Rn&&(x.fill=E._buttonFillNormal,x.stroke=E._buttonStrokeNormal))},y.actionDown=function(x,E){if(E.If()&&E instanceof si&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof Rn){x=x.diagram;var z=x.skipsUndoManager;x.skipsUndoManager=!0;var tt=E._buttonFillPressed;E._buttonFillOver=b.fill,b.fill=tt,tt=E._buttonStrokePressed,E._buttonStrokeOver=b.stroke,b.stroke=tt,x.skipsUndoManager=z}}},y.actionUp=function(x,E){if(E.If()&&E instanceof si&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof Rn){var z=x.diagram,tt=z.skipsUndoManager;z.skipsUndoManager=!0,a(x,E)?(b.fill=E._buttonFillOver,b.stroke=E._buttonStrokeOver):(b.fill=E._buttonFillNormal,b.stroke=E._buttonStrokeNormal),z.skipsUndoManager=tt}}},y.actionCancel=function(x,E){if(E.If()&&E instanceof si&&E._buttonFillPressed!==null){var b=E.fb("ButtonBorder");if(b instanceof Rn){var z=x.diagram,tt=z.skipsUndoManager;z.skipsUndoManager=!0,a(x,E)?(b.fill=E._buttonFillOver,b.stroke=E._buttonStrokeOver):(b.fill=E._buttonFillNormal,b.stroke=E._buttonStrokeNormal),z.skipsUndoManager=tt}}},y.actionMove=function(x,E){if(E.If()&&E instanceof si&&E._buttonFillPressed!==null){var b=x.diagram;if(b.firstInput.button===0&&(b.currentTool.standardMouseOver(),a(x,E)&&(x=E.fb("ButtonBorder"),x instanceof Rn))){var z=b.skipsUndoManager;b.skipsUndoManager=!0;var tt=E._buttonFillPressed;x.fill!==tt&&(x.fill=tt),tt=E._buttonStrokePressed,x.stroke!==tt&&(x.stroke=tt),b.skipsUndoManager=z}}},y}),oh("TreeExpanderButton",function(){var a=Za("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Za(Rn,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Lr},new Co("figure","isTreeExpanded",function(y,x){return x=x.panel,y?x._treeExpandedFigure:x._treeCollapsedFigure}).cp()),{visible:!1},new Co("visible","isTreeLeaf",function(y){return!y}).cp());return a.click=function(y,x){if(x=x.part,x instanceof cr&&(x=x.adornedPart),x instanceof Ci){var E=x.diagram;if(E!==null){if(E=E.commandHandler,x.isTreeExpanded){if(!E.canCollapseTree(x))return}else if(!E.canExpandTree(x))return;y.handled=!0,x.isTreeExpanded?E.collapseTree(x):E.expandTree(x)}}},a}),oh("SubGraphExpanderButton",function(){var a=Za("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Za(Rn,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Lr},new Co("figure","isSubGraphExpanded",function(y,x){return x=x.panel,y?x._subGraphExpandedFigure:x._subGraphCollapsedFigure}).cp()));return a.click=function(y,x){if(x=x.part,x instanceof cr&&(x=x.adornedPart),x instanceof An){var E=x.diagram;if(E!==null){if(E=E.commandHandler,x.isSubGraphExpanded){if(!E.canCollapseSubGraph(x))return}else if(!E.canExpandSubGraph(x))return;y.handled=!0,x.isSubGraphExpanded?E.collapseSubGraph(x):E.expandSubGraph(x)}}},a}),oh("ToolTip",function(){return Za(cr,si.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new Pt(0,3),shadowBlur:5},Za(Rn,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new nn(0,0,4,6),spot2:new nn(1,1,-4,-4)}))}),oh("ContextMenu",function(){return Za(cr,si.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new Pt(0,3),shadowBlur:5},new Co("background","",function(a){return a.adornedPart!==null&&a.placeholder!==null?null:"#F5F5F5"}))}),oh("ContextMenuButton",function(){var a=Za("Button");a.stretch=$i;var y=a.fb("ButtonBorder");return y instanceof Rn&&(y.figure="Rectangle",y.strokeWidth=0,y.spot1=new nn(0,0,2,3),y.spot2=new nn(1,1,-2,-2)),a}),oh("PanelExpanderButton",function(a){var y=av(a,"COLLAPSIBLE"),x=Za("Button",{_buttonExpandedFigure:"M0 0 M0 6 L4 2 8 6 M8 8",_buttonCollapsedFigure:"M0 0 M0 2 L4 6 8 2 M8 8",_buttonFillNormal:"rgba(0, 0, 0, 0)",_buttonStrokeNormal:null,_buttonFillOver:"rgba(0, 0, 0, .2)",_buttonStrokeOver:null,_buttonFillPressed:"rgba(0, 0, 0, .4)",_buttonStrokePressed:null},Za(Rn,{name:"ButtonIcon",strokeWidth:2},new Co("geometryString","visible",function(E){return E?x._buttonExpandedFigure:x._buttonCollapsedFigure}).cp(y)));return a=x.fb("ButtonBorder"),a instanceof Rn&&(a.stroke=null,a.fill="rgba(0, 0, 0, 0)"),x.click=function(E,b){var z=b.diagram;if(z!==null&&!z.isReadOnly){var tt=b.ih();tt===null&&(tt=b.part),tt!==null&&(b=tt.fb(y),b!==null&&(E.handled=!0,z.Ea("Collapse/Expand Panel"),b.visible=!b.visible,z.eb("Collapse/Expand Panel")))}},x}),oh("CheckBoxButton",function(a){var y=av(a);return a=Za("Button",{desiredSize:new li(14,14)},Za(Rn,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:ri,geometryStretch:Yi,visible:!1},y!==""?new Co("visible",y).Kx():[])),a.click=function(x,E){if(E instanceof si){var b=x.diagram;if(!(b===null||b.isReadOnly||y!==""&&b.model.isReadOnly)){x.handled=!0;var z=E.fb("ButtonIcon");b.Ea("checkbox"),z.visible=!z.visible,typeof E._doClick=="function"&&E._doClick(x,E),b.eb("checkbox")}}},a}),oh("CheckBox",function(a){a=av(a),a=Za("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new jn(0,1,0,0)});var y=Za(si,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:new jn(1),_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillPressed:a._buttonFillPressed,_buttonStrokePressed:a._buttonStrokePressed,_buttonFillDisabled:a._buttonFillDisabled,mouseEnter:a.mouseEnter,mouseLeave:a.mouseLeave,actionDown:a.actionDown,actionUp:a.actionUp,actionCancel:a.actionCancel,actionMove:a.actionMove,click:a.click,_buttonClick:a.click});return a.mouseEnter=null,a.mouseLeave=null,a.actionDown=null,a.actionUp=null,a.actionCancel=null,a.actionMove=null,a.click=null,y}),Kt.None=Qe=new ze(Kt,"None",0),Kt.Default=Dn=new ze(Kt,"Default",0),Kt.Vertical=dn=new ze(Kt,"Vertical",4),Kt.Horizontal=$i=new ze(Kt,"Horizontal",5),Kt.Fill=ri=new ze(Kt,"Fill",3),Kt.Uniform=Yi=new ze(Kt,"Uniform",1),Kt.UniformToFill=tr=new ze(Kt,"UniformToFill",2),Kt.FlipVertical=Wn=new ze(Kt,"FlipVertical",1),Kt.FlipHorizontal=lr=new ze(Kt,"FlipHorizontal",2),Kt.FlipBoth=Pr=new ze(Kt,"FlipBoth",3),Kt.make=Za,Kt.getBuilders=function(){var a=new ji,y;for(y in pd)if(y!==y.toLowerCase()){var x=pd.I(y);typeof x=="function"&&a.add(y,x)}return a.freeze(),a},Kt.defineBuilder=oh,Kt.build=function(a,y,x){for(var E=[],b=2;b<arguments.length;++b)E[b-2]=arguments[b];if(b=pd.I(a),typeof b=="function"&&(E=b([a].concat(E)),E instanceof Kt))return y&&E.set(y),E;It('GraphObject.build invoked object builder "'+a+'", but it did not return an Object')},Kt.takeBuilderArgument=av;function Sf(){this.nc=!1,this.xa="",this.zp=-1,this.nb=this.wm=this.te=null,this.j="",this.hb=this.Di=this.Hb=this.Ch=this.$h=this.F=this.Ha=this.ia=this.V=this.Lh=this.Xd=this.Of=this.Nh=this.Oh=this.Qh=this.Ph=this.Mh=this.Bh=this.Fh=this.zh=null,this.u=Pn,this.o=oo,this.hg=Dn,this.ob=this.Bi=1,this.Pf=Qe,this.Pc=this.Ci=this.gd=null,this.Oc="category"}Sf.prototype.copy=function(){var a=new Sf;return a.xa=this.xa,a.zp=this.zp,a.te=this.te,a.nb=this.nb,a.j=this.j,a.zh=this.zh,a.Fh=this.Fh,a.Bh=this.Bh,a.Mh=this.Mh,a.Ph=this.Ph,a.Qh=this.Qh,a.Oh=this.Oh,a.Nh=this.Nh,a.Of=this.Of,a.Xd=this.Xd,a.Lh=this.Lh,a.V=this.V,a.ia=this.ia,a.Ha=this.Ha,a.F=this.F,a.$h=this.$h,a.Ch=this.Ch,a.Hb=this.Hb,a.Di=this.Di,a.hb=this.hb,a.u=this.u.J(),a.o=this.o.J(),a.hg=this.hg,a.Bi=this.Bi,a.ob=this.ob,a.Pf=this.Pf,a.gd=this.gd,a.Ci=this.Ci,a.Pc=this.Pc,a.Oc=this.Oc,a};function Vh(){this.u=-1/0,this.o=0,this.F=gr,this.rr=js,this.j=this.V="None"}Vh.prototype.copy=function(){var a=new Vh;return a.u=this.u,a.o=this.o,a.F=this.F.J(),a.rr=this.rr,a.V=this.V,a.j=this.j,a},Vh.className="LinkElementSettings";function Rp(){this.yj=this.Xi=Fi,this.xj=this.Wi=this.wj=this.Vi=NaN,this.Tr=this.hq=null,this.Ur=this.iq=1/0}Rp.prototype.copy=function(){var a=new Rp;return a.Xi=this.Xi.J(),a.yj=this.yj.J(),a.Vi=this.Vi,a.wj=this.wj,a.Wi=this.Wi,a.xj=this.xj,a.hq=this.hq,a.Tr=this.Tr,a.iq=this.iq,a.Ur=this.Ur,a},Rp.className="LinkSettings";function Fc(){this.ha=[1,0,0,1,0,0]}Fc.prototype.copy=function(){var a=new Fc;return a.ha[0]=this.ha[0],a.ha[1]=this.ha[1],a.ha[2]=this.ha[2],a.ha[3]=this.ha[3],a.ha[4]=this.ha[4],a.ha[5]=this.ha[5],a},Fc.prototype.translate=function(a,y){this.ha[4]+=this.ha[0]*a+this.ha[2]*y,this.ha[5]+=this.ha[1]*a+this.ha[3]*y},Fc.prototype.scale=function(a,y){this.ha[0]*=a,this.ha[1]*=a,this.ha[2]*=y,this.ha[3]*=y},Fc.prototype.rotate=function(a,y,x){if(360<=a?a-=360:0>a&&(a+=360),a!==0){if(this.translate(y,x),a===90){a=0;var E=1}else a===180?(a=-1,E=0):a===270?(a=0,E=-1):(E=a*Math.PI/180,a=Math.cos(E),E=Math.sin(E));var b=this.ha[1]*a+this.ha[3]*E,z=this.ha[0]*-E+this.ha[2]*a,tt=this.ha[1]*-E+this.ha[3]*a;this.ha[0]=this.ha[0]*a+this.ha[2]*E,this.ha[1]=b,this.ha[2]=z,this.ha[3]=tt,this.translate(-y,-x)}},Fc.className="STransform";function Cf(a){this.type=a,this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0,this.gx=[],this.pattern=null}Cf.prototype.addColorStop=function(a,y){this.gx.push({offset:a,color:y})},Cf.className="SGradient";function Gl(a,y,x){this.ownerDocument=a=y===void 0?Xe.document:y,this.cA="http://www.w3.org/2000/svg",a!==void 0&&(this.Oa=this.Ud("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.style.display="block",this.style.letterSpacing="normal",this.style.wordSpacing="normal",this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink")),this.hs=null,this.context=new ga(this,x)}Gl.prototype.resize=function(a,y,x,E){return this.width!==a||this.height!==y?(this.width=a,this.height=y,this.style.width=x+"px",this.style.height=E+"px",this.Oa.setAttributeNS(null,"width",x+"px"),this.Oa.setAttributeNS(null,"height",E+"px"),this.Oa.setAttributeNS(null,"viewBox","0 0 "+x+" "+E),this.context.ww.firstElementChild.setAttributeNS(null,"width",x+"px"),this.context.ww.firstElementChild.setAttributeNS(null,"height",E+"px"),!0):!1},Gl.prototype.Ud=function(a,y,x){if(a=this.ownerDocument.createElementNS(this.cA,a),Oe(y))for(var E in y)a.setAttributeNS(E==="href"?"http://www.w3.org/1999/xlink":"",E,y[E]);return x!==void 0&&(a.textContent=x),a},Gl.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},Gl.prototype.focus=function(){this.Oa.focus()},Gl.prototype.mx=function(){this.ownerDocument=null},zi.Object.defineProperties(Gl.prototype,{width:{get:function(){return this.Oa.width.baseVal.value},set:function(a){this.Oa.setAttribute("width",a+"px")}},height:{get:function(){return this.Oa.height.baseVal.value},set:function(a){this.Oa.setAttribute("height",a+"px")}},style:{get:function(){return this.Oa.style}}}),Gl.className="SVGSurface";function ga(a,y){this.Gv=a,this.svg=a.Oa,this.stack=[],this.nh=[],this.fillStyle="#000000",this.font="10px sans-serif",this.globalAlpha=1,this.lineCap="butt",this.lineDashOffset=0,this.lineJoin="miter",this.lineWidth=1,this.miterLimit=10,this.shadowBlur=0,this.shadowColor="rgba(0, 0, 0, 0)",this.shadowOffsetY=this.shadowOffsetX=0,this.Il=!1,this.strokeStyle="#000000",this.textAlign="start",this.clipInsteadOfFill=!1,this.Vg=this.Br=this.Ar=0,this.yd=this.ad=null,this.path=[],this.Yl={},this.Ct=!1,this.Yg=null,this.uj=0,this.rb=new Fc,this.j=lv(this),this.Nj=lv(this,"gojs-diagram"),this.Hl=this.ti=null;var x=zn++,E=this.Ud("clipPath",{id:"mainClip"+x});E.appendChild(this.Ud("rect",{x:0,y:0,width:a.width,height:a.height})),this.ww=E,this.svg.appendChild(this.j),this.j.appendChild(this.Nj),this.svg.appendChild(E),this.j.setAttributeNS(null,"clip-path","url(#mainClip"+x+")"),this.eA={},this.isTemporary=!!y,this.filter="",this.bk=null}function Jy(a,y,x,E,b,z,tt){a.Nj===void 0?jp(a,y,x,E,b,z,tt):a.Nj.setAttribute("transform","matrix("+y+", "+x+", "+E+", "+b+", "+z+", "+tt+")")}yt=ga.prototype,yt.arc=function(a,y,x,E,b,z,tt,it){var nt=2*Math.PI,ot=nt-1e-6,st=x*Math.cos(E),ut=x*Math.sin(E),ct=a+st,dt=y+ut,vt=z?0:1;E=z?E-b:b-E,(1e-6<Math.abs(tt-ct)||1e-6<Math.abs(it-dt))&&this.path.push(["L",ct,+dt]),0>E&&(E=E%nt+nt),E>ot?(this.path.push(["A",x,x,0,1,vt,a-st,y-ut]),this.path.push(["A",x,x,0,1,vt,ct,dt])):1e-6<E&&this.path.push(["A",x,x,0,+(E>=Math.PI),vt,a+x*Math.cos(b),y+x*Math.sin(b)])},yt.beginPath=function(){this.path=[],this.Yl={stroke:"none",fill:"none"}},yt.Se=function(a){this.addPath(this.path,this.rb,a||0)},yt.bezierCurveTo=function(a,y,x,E,b,z){this.path.push(["C",a,y,x,E,b,z])},yt.clearRect=function(){},yt.clip=function(){this.Yl.clipPath=!0},yt.closePath=function(){this.path.push(["z"])},yt.createLinearGradient=function(a,y,x,E){var b=new Cf("linear");return b.x1=a,b.y1=y,b.x2=x,b.y2=E,b},yt.createPattern=function(a){var y="";a instanceof HTMLCanvasElement&&(y=a.toDataURL()),a instanceof HTMLImageElement&&(y=a.getAttribute("src"));var x=this.eA;if(x[y])return"url(#"+x[y]+")";var E="PATTERN"+zn++,b={x:0,y:0,width:a.width,height:a.height,href:y};return a=this.Ud("pattern",{width:a.width,height:a.height,id:E,patternUnits:"userSpaceOnUse"}),a.appendChild(this.Ud(Lc,b)),this.svg.appendChild(a),x[y]=E,"url(#"+E+")"},yt.createRadialGradient=function(a,y,x,E,b,z){var tt=new Cf("radial");return tt.x1=a,tt.y1=y,tt.r1=x,tt.x2=E,tt.y2=b,tt.r2=z,tt};function Qy(a,y,x,E,b,z,tt,it,nt){E=it/E,b=nt/b,z===0&&tt===0||a.rb.translate(z,tt),E===1&&b===1||a.rb.scale(E,b),y===0&&x===0||a.rb.translate(-y,-x)}yt.drawImage=function(a,y,x,E,b,z,tt,it,nt){var ot="";a instanceof HTMLCanvasElement&&(ot=a.toDataURL()),a instanceof HTMLImageElement&&(ot=a.getAttribute("src"));var st=a instanceof HTMLImageElement?a.naturalWidth:a.width;a=a instanceof HTMLImageElement?a.naturalHeight:a.height,E===void 0&&(z=y,tt=x,it=E=st,nt=b=a),E=E||0,b=b||0,it=it||0,nt=nt||0,Qy(this,y,x,E,b,z||0,tt||0,it,nt),z={x:0,y:0,width:st||E,height:a||b,href:ot},Gt.$(E,it)&&Gt.$(b,nt)?ot.toLowerCase().indexOf(".svg")===-1&&ot.toLowerCase().indexOf("data:image/svg")===-1&&(z.preserveAspectRatio="xMidYMid slice"):z.preserveAspectRatio="none",(y!==0||x!==0||E!==st||b!==a)&&(E+=y,b+=x,z["clip-path"]="path('M "+y+","+x+" L "+E+" "+x+" L "+E+" "+b+" L "+y+" "+b+" z')"),gd(this,Lc,z,this.rb),this.addElement(Lc,z)},yt.fill=function(a){a&&(this.Yl["fill-rule"]="evenodd"),r0(this,this.Yl)},yt.ng=function(a,y){this.clipInsteadOfFill?this.clip():this.fill(y)},yt.fillRect=function(a,y,x,E){a=[a,y,x,E],a={x:a[0],y:a[1],width:a[2],height:a[3]},gd(this,"fill",a,this.rb),this.addElement("rect",a)},yt.ox=function(a,y,x,E){a={x:a,y,width:x,height:E},gd(this,"fill",a,this.rb),r0(this,a),this.svg.prepend(this.Ud("rect",a))},yt.fillText=function(a,y,x){a=[a,y,x],y=this.textAlign,y==="left"?y="start":y==="right"?y="end":y==="center"&&(y="middle"),y={x:a[1],y:a[2],style:"font: "+this.font,"text-anchor":y},gd(this,"fill",y,this.rb),this.addElement("text",y,a[0])},yt.lineTo=function(a,y){this.path.push(["L",a,y])},yt.moveTo=function(a,y){this.path.push(["M",a,y])},yt.quadraticCurveTo=function(a,y,x,E){this.path.push(["Q",a,y,x,E])},yt.rect=function(a,y,x,E){this.path.push(["M",a,y],["L",a+x,y],["L",a+x,y+E],["L",a,y+E],["z"])},yt.restore=function(){this.rb=this.stack.pop(),this.path=this.stack.pop();var a=this.stack.pop();this.fillStyle=a.fillStyle,this.font=a.font,this.globalAlpha=a.globalAlpha,this.lineCap=a.lineCap,this.lineDashOffset=a.lineDashOffset,this.lineJoin=a.lineJoin,this.lineWidth=a.lineWidth,this.miterLimit=a.miterLimit,this.shadowBlur=a.shadowBlur,this.shadowColor=a.shadowColor,this.shadowOffsetX=a.shadowOffsetX,this.shadowOffsetY=a.shadowOffsetY,this.strokeStyle=a.strokeStyle,this.textAlign=a.textAlign,this.bk=a.bk},yt.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign,bk:this.bk});for(var a=[],y=0;y<this.path.length;y++)a.push(this.path[y]);this.stack.push(a),this.stack.push(this.rb.copy())},yt.setTransform=function(a,y,x,E,b,z){a===1&&y===0&&x===0&&E===1&&b===0&&z===0||jp(this,a,y,x,E,b,z)};function $y(a){return a=a.rb.ha,"matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")"}yt.scale=function(a,y){this.rb.scale(a,y)},yt.translate=function(a,y){this.rb.translate(a,y)},yt.transform=function(){},yt.yc=function(){},yt.stroke=function(){tx(this,this.Yl)},yt.jk=function(){this.clipInsteadOfFill||this.stroke()},yt.Ud=function(a,y,x){return this.Gv.Ud(a,y,x)},yt.addElement=function(a,y,x){return a=this.Ud(a,y,x),this.yd!==null?this.yd.appendChild(a):this.yd=a,this.ad=a};function gd(a,y,x,E){y==="fill"?r0(a,x):y==="stroke"&&tx(a,x),E!==null&&(a=E.ha,x.transform="matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")")}function r0(a,y){a.fillStyle instanceof Cf?y.fill=o0(a,a.fillStyle,!0):/^rgba\(/.test(a.fillStyle)?(a=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle),y.fill="rgb("+a[1]+","+a[2]+","+a[3]+")",y["fill-opacity"]=a[4]):y.fill=a.fillStyle}function qy(a,y,x){x=x?"fill":"stroke",a.fillStyle instanceof Cf?y.setAttributeNS(null,"fill",o0(a,a.fillStyle,!0)):/^rgba\(/.test(a.fillStyle)?(a=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle),y.setAttributeNS(null,x,"rgb("+a[1]+","+a[2]+","+a[3]+")"),y.setAttributeNS(null,x+"-opacity",a[4])):y.setAttributeNS(null,x,a.fillStyle)}function tx(a,y){if(a.strokeStyle instanceof Cf)y.stroke=o0(a,a.strokeStyle,!1);else if(/^rgba\(/.test(a.strokeStyle)){var x=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.strokeStyle);y.stroke="rgb("+x[1]+","+x[2]+","+x[3]+")",y["stroke-opacity"]=x[4]}else y.stroke=a.strokeStyle;y["stroke-width"]=a.lineWidth,y["stroke-linecap"]=a.lineCap,y["stroke-linejoin"]=a.lineJoin,y["stroke-miterlimit"]=a.miterLimit,a.Ct&&(y["stroke-dasharray"]=a.Yg.toString(),y["stroke-dashoffset"]=a.uj)}function o0(a,y,x){var E="";if(E=a.Hl!==null?a.Hl.getAttribute(x?"fill":"stroke"):null,E!==null&&E.indexOf("GRAD")!==-1?(E=E.split("#")[1].slice(0,-1),x=a.svg.getElementById(E),x!==null&&x.remove()):E="GRAD"+zn++,y.type==="linear")x=a.Ud("linearGradient",{x1:y.x1,x2:y.x2,y1:y.y1,y2:y.y2,id:E,gradientUnits:"userSpaceOnUse"});else if(y.type==="radial")x=a.Ud("radialGradient",{x1:y.x1,x2:y.x2,y1:y.y1,y2:y.y2,r1:y.r1,r2:y.r2,id:E});else throw Error("invalid gradient");var b=y.gx;y=b.length;for(var z=[],tt=0;tt<y;tt++){var it=b[tt],nt=it.color;it={offset:it.offset,"stop-color":nt},/^rgba\(/.test(nt)&&(nt=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(nt),it["stop-color"]="rgb("+nt[1]+","+nt[2]+","+nt[3]+")",it["stop-opacity"]=nt[4]),z.push(it)}for(z.sort(function(ot,st){return ot.offset>st.offset?1:-1}),b=0;b<y;b++)x.appendChild(a.Ud("stop",z[b]));return a.svg.appendChild(x),"url(#"+E+")"}yt.addPath=function(a,y,x){for(var E=[],b=0;b<a.length;b++){var z=rn(a[b]),tt=[z.shift()];if(tt[0]==="A")tt.push(z.shift()+","+z.shift(),z.shift(),z.shift()+","+z.shift(),z.shift()+","+z.shift());else for(;z.length;)tt.push(z.shift()+","+z.shift());E.push(tt.join(" "))}if(E=E.join(" "),a=this.Yl,a.clipPath)0<this.nh.length&&this.nh[this.nh.length-1].setAttributeNS(null,"clip-path",'path("'+E+'")');else if(a.d=E,gd(this,"",a,y),this.Hl!==null)if(y=this.Hl,y.nodeName!=="g")for(var it in a)it!=="transform"&&y.setAttributeNS(null,it,a[it]);else{it=y.getElementsByTagName("path");for(var nt in a)nt!=="transform"&&it[x].setAttributeNS(null,nt,a[nt])}else this.addElement("path",a)};function jp(a,y,x,E,b,z,tt){var it=new Fc;it.ha=[y,x,E,b,z,tt],y={},gd(a,"g",y,it),it=a.addElement("g",y),a.nh.push(it)}function lv(a,y){var x={};return y&&(x.class=y),y=a.addElement("g",x),a.nh.push(y),y}yt.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x};function lu(a){a.Il=!1,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0}function Tu(a){a.Il=!0,a.shadowOffsetX=a.Ar,a.shadowOffsetY=a.Br,a.shadowBlur=a.Vg}yt.js=function(a,y){this.Ct=!0,this.Yg=a,this.uj=y},yt.fs=function(){this.Ct=!1},yt.Vc=function(){},yt.Wx=function(){},ga.prototype.rotate=function(a){this.rb.rotate(57.2958*a,0,0)},ga.prototype.getImageData=function(){return null},ga.prototype.measureText=function(){return null};function uv(a,y){y=y.getAttribute("fill"),y!==null&&(y=y.split("#"),y.length!==1&&(y=a.svg.getElementById(y[1].slice(0,-1)),y!==null&&a.svg.innerHTML.match(new RegExp(y.id,"g")).length===1&&y.remove()))}ga.prototype.Hs=function(a){a.svg!==null&&a.svg.parentNode===this.Nj&&a.svg.remove()},ga.className="SVGContext",le.prototype.Cs=function(a){this.pj.contains("SVG")||this.bs("SVG",new Gl(this,Xe.document));var y=new Gl(this,Xe.document,!0);a===void 0&&(a=new Sn);var x=this;return gf(this,function(E,b){return E=nv(x,E,"SVG",y),E=E!==null?E.svg:null,typeof b=="function"?(b(E),null):E},a)},le.prototype.makeSvg=le.prototype.Cs,le.prototype.av=function(a){return this.Cs(a)},le.prototype.makeSVG=le.prototype.av;function nl(a,y,x,E){this.ownerDocument=y=y===void 0?Xe.document:y,this.hs=null,y=y.createElement("canvas"),y.tabIndex=0,this.Oa=y,this.context=new Bc(y,x,E),y.H=a}nl.prototype.resize=function(a,y,x,E){return this.width!==a||this.height!==y?(this.width=a,this.height=y,this.style.width=x+"px",this.style.height=E+"px",!0):!1},nl.prototype.toDataURL=function(a,y){return this.Oa.toDataURL(a,y)},nl.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},nl.prototype.focus=function(){this.Oa.focus()},nl.prototype.mx=function(){this.ownerDocument=this.Oa.H=null},zi.Object.defineProperties(nl.prototype,{width:{get:function(){return this.Oa.width},set:function(a){this.Oa.width=a}},height:{get:function(){return this.Oa.height},set:function(a){this.Oa.height=a}},style:{get:function(){return this.Oa.style}}}),nl.className="CanvasSurface";function Bc(a,y,x){this.Z=a.getContext?a.getContext("2d",y):null,this.Z===null&&It("Browser does not support HTML Canvas Element"),this.ct=this.et=this.dt="",this.Hm=!1,this.Vg=this.Br=this.Ar=0,this.Il=!1,this.El=new bn,this.isTemporary=!!x}yt=Bc.prototype,yt.Wx=function(a){this.Z.imageSmoothingEnabled=a},yt.arc=function(a,y,x,E,b,z){this.Z.arc(a,y,x,E,b,z)},yt.beginPath=function(){this.Z.beginPath()},yt.Se=function(){},yt.bezierCurveTo=function(a,y,x,E,b,z){this.Z.bezierCurveTo(a,y,x,E,b,z)},yt.clearRect=function(a,y,x,E){this.yc(),this.Z.clearRect(a,y,x,E)},yt.clip=function(){this.Z.clip()},yt.closePath=function(){this.Z.closePath()},yt.createLinearGradient=function(a,y,x,E){return this.Z.createLinearGradient(a,y,x,E)},yt.createPattern=function(a,y){return this.Z.createPattern(a,y)},yt.createRadialGradient=function(a,y,x,E,b,z){return this.Z.createRadialGradient(a,y,x,E,b,z)},yt.drawImage=function(a,y,x,E,b,z,tt,it,nt){E===void 0?this.Z.drawImage(a,y,x):this.Z.drawImage(a,y,x,E,b,z,tt,it,nt)},yt.fill=function(a){this.Z.fill(a?"evenodd":"nonzero")},yt.fillRect=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},yt.ox=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},yt.fillText=function(a,y,x){this.Z.fillText(a,y,x)},yt.getImageData=function(a,y,x,E){return this.Z.getImageData(a,y,x,E)},yt.lineTo=function(a,y){this.Z.lineTo(a,y)},yt.measureText=function(a){return this.Z.measureText(a)},yt.moveTo=function(a,y){this.Z.moveTo(a,y)},yt.quadraticCurveTo=function(a,y,x,E){this.Z.quadraticCurveTo(a,y,x,E)},yt.rect=function(a,y,x,E){this.Z.rect(a,y,x,E)},yt.restore=function(){this.Z.restore()},yt.save=function(){this.yc(),this.Z.save()},Bc.prototype.rotate=function(a){this.El.rotate(57.2958*a,0,0)},yt=Bc.prototype,yt.setTransform=function(a,y,x,E,b,z){this.El.setTransform(a,y,x,E,b,z)},yt.scale=function(a,y){this.El.scale(a,y)},yt.translate=function(a,y){this.El.translate(a,y)},yt.stroke=function(){this.Z.stroke()},yt.transform=function(a,y,x,E,b,z){if(a!==1||y!==0||x!==0||E!==1||b!==0||z!==0){var tt=this.El,it=tt.m11*a+tt.m21*y;a=tt.m12*a+tt.m22*y,y=tt.m11*x+tt.m21*E,x=tt.m12*x+tt.m22*E,tt.dx=tt.m11*b+tt.m21*z+tt.dx,tt.dy=tt.m12*b+tt.m22*z+tt.dy,tt.m11=it,tt.m12=a,tt.m21=y,tt.m22=x}},yt.yc=function(){var a=this.El;this.Z.setTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy)},yt.ng=function(a,y){if(a instanceof kr&&a.type===Ka){var x=a.yk;a=a.ft,a>x?(this.scale(x/a,1),this.translate((a-x)/2,0)):x>a&&(this.scale(1,a/x),this.translate(0,(x-a)/2)),this.Hm?this.clip():this.fill(y),a>x?(this.translate(-(a-x)/2,0),this.scale(1/(x/a),1)):x>a&&(this.translate(0,-(x-a)/2),this.scale(1,1/(a/x)))}else this.Hm?this.clip():this.fill(y)},yt.jk=function(){this.Hm||this.stroke()},yt.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x},yt.js=function(a,y){var x=this.Z;x.setLineDash!==void 0&&(x.setLineDash(a),x.lineDashOffset=y)},yt.fs=function(){var a=this.Z;a.setLineDash!==void 0&&(a.setLineDash(Cw),a.lineDashOffset=0)},yt.Vc=function(a){a&&(this.dt=""),this.ct=this.et=""},yt.Hs=function(){},zi.Object.defineProperties(Bc.prototype,{fillStyle:{get:function(){return this.Z.fillStyle},set:function(a){this.ct!==a&&(this.ct=this.Z.fillStyle=a)}},font:{get:function(){return this.Z.font},set:function(a){this.dt!==a&&(this.dt=this.Z.font=a)}},globalAlpha:{get:function(){return this.Z.globalAlpha},set:function(a){this.Z.globalAlpha=a}},lineCap:{get:function(){return this.Z.lineCap},set:function(a){this.Z.lineCap=a}},lineDashOffset:{get:function(){return this.Z.lineDashOffset},set:function(a){this.Z.lineDashOffset=a}},lineJoin:{get:function(){return this.Z.lineJoin},set:function(a){this.Z.lineJoin=a}},lineWidth:{get:function(){return this.Z.lineWidth},set:function(a){this.Z.lineWidth=a}},miterLimit:{get:function(){return this.Z.miterLimit},set:function(a){this.Z.miterLimit=a}},shadowBlur:{get:function(){return this.Z.shadowBlur},set:function(a){this.Z.shadowBlur=a}},shadowColor:{get:function(){return this.Z.shadowColor},set:function(a){this.Z.shadowColor=a}},shadowOffsetX:{get:function(){return this.Z.shadowOffsetX},set:function(a){this.Z.shadowOffsetX=a}},shadowOffsetY:{get:function(){return this.Z.shadowOffsetY},set:function(a){this.Z.shadowOffsetY=a}},strokeStyle:{get:function(){return this.Z.strokeStyle},set:function(a){this.et!==a&&(this.et=this.Z.strokeStyle=a)}},textAlign:{get:function(){return this.Z.textAlign},set:function(a){this.Z.textAlign=a}},imageSmoothingEnabled:{get:function(){return this.Z.imageSmoothingEnabled},set:function(a){this.Z.imageSmoothingEnabled=a}},filter:{get:function(){return this.Z.filter},set:function(a){this.Z.filter=a===""?"none":a}},clipInsteadOfFill:{get:function(){return this.Hm},set:function(a){this.Hm=a}}});var Cw=Object.freeze([]);Bc.className="CanvasSurfaceContext";function zp(){this.F=this.o=this.u=this.j=0}zp.className="ColorNumbers";function kr(a,y){xd||(c0(),xd=!0),bi(this),this._isFrozen=!1,a===void 0?(this.na=sh,this.xk="black"):typeof a=="string"?(this.na=sh,this.xk=a):(this.na=a,this.xk="black"),a=this.na,a===Au?(this.Qd=mr,this.Lk=$o):this.Lk=a===Ka?this.Qd=Hn:this.Qd=Jn,this.Gr=0,this.Xp=NaN,this.xe=this.cr=this.we=null,this.ft=this.yk=0,y&&Object.assign(this,y)}kr.prototype.copy=function(){var a=new kr;return a.na=this.na,a.xk=this.xk,a.Qd=this.Qd.J(),a.Lk=this.Lk.J(),a.Gr=this.Gr,a.Xp=this.Xp,this.we!==null&&(a.we=this.we.copy()),a.cr=this.cr,a},yt=kr.prototype,yt.freeze=function(){return this._isFrozen=!0,this.we!==null&&this.we.freeze(),this},yt.ka=function(){return Object.isFrozen(this)&&It("cannot thaw constant: "+this),this._isFrozen=!1,this.we!==null&&this.we.ka(),this},yt.qb=function(a){a.classType===kr&&(this.type=a)},yt.toString=function(){var a="Brush(";if(this.type===sh)a+=this.color;else if(a=this.type===Au?a+"Linear ":this.type===Ka?a+"Radial ":this.type===wd?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,this.colorStops!==null)for(var y=this.colorStops.iterator;y.next();)a+=" "+y.key+":"+y.value;return a+")"},yt.addColorStop=function(a,y){return this._isFrozen&&se(this),(typeof a!="number"||!isFinite(a)||1<a||0>a)&&xi(a,"0 <= loc <= 1",kr,"addColorStop:loc"),this.we===null&&(this.we=new ji),this.we.add(a,y),this.na===sh&&(this.type=Au),this.xe=null,this},yt.Vz=function(a,y){if(this._isFrozen&&se(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?Sd:y,this.type===sh)Lu(this.color),this.color=md(a,y);else if((this.type===Au||this.type===Ka)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)Lu(x.value),this.addColorStop(x.key,md(a,y));return this};function ex(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?Sd:x,Lu(a),md(y,x)}yt.Wy=function(a,y){if(this._isFrozen&&se(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?Sd:y,this.type===sh)Lu(this.color),this.color=md(-a,y);else if((this.type===Au||this.type===Ka)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)Lu(x.value),this.addColorStop(x.key,md(-a,y));return this};function ix(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?Sd:x,Lu(a),md(-y,x)}function s0(a,y,x){Lu(a),a=Rr.j;var E=Rr.u,b=Rr.o,z=Rr.F;return Lu(y),x===void 0&&(x=.5),"rgba("+Math.round((Rr.j-a)*x+a)+", "+Math.round((Rr.u-E)*x+E)+", "+Math.round((Rr.o-b)*x+b)+", "+Math.round((Rr.F-z)*x+z)+")"}yt.Gx=function(){if(this.type===sh)return vd(this.color);if((this.type===Au||this.type===Ka)&&this.colorStops!==null){var a=this.colorStops;if(this.type===Ka)return vd(a.first().value);if(a.get(.5)!==null)return vd(a.get(.5));if(a.count===2)return a=a.Fa(),vd(s0(a[0].value,a[1].value));for(var y=a.iterator,x=-1,E=-1,b=1,z=1;y.next();){var tt=y.key,it=Math.abs(.5-y.key);b>z&&it<b?(x=tt,b=it):z>=b&&it<z&&(E=tt,z=it)}return x>E&&(z=x,x=E,E=z,z=b),b=E-x,vd(s0(a.get(x),a.get(E),1-z/b))}return!1};function vd(a){return a?a instanceof kr?a.Gx():(Lu(a),128>(299*Rr.j+587*Rr.u+114*Rr.o)/1e3):!1}function md(a,y){switch(y){case Sd:y=100*l0(Rr.j);var x=100*l0(Rr.u),E=100*l0(Rr.o);return Is.j=.4124564*y+.3575761*x+.1804375*E,Is.u=.2126729*y+.7151522*x+.072175*E,Is.o=.0193339*y+.119192*x+.9503041*E,Is.F=Rr.F,y=h0(Is.j/yd[0]),x=h0(Is.u/yd[1]),E=h0(Is.o/yd[2]),uu.j=116*x-16,uu.u=500*(y-x),uu.o=200*(x-E),uu.F=Is.F,uu.j=Math.min(100,Math.max(0,uu.j+100*a)),a=(uu.j+16)/116,y=a-uu.o/200,Is.j=yd[0]*nx(uu.u/500+a),Is.u=yd[1]*(uu.j>hv*f0?Math.pow(a,3):uu.j/hv),Is.o=yd[2]*nx(y),Is.F=uu.F,a=-.969266*Is.j+1.8760108*Is.u+.041556*Is.o,y=.0556434*Is.j+-.2040259*Is.u+1.0572252*Is.o,Rr.j=255*u0((3.2404542*Is.j+-1.5371385*Is.u+-.4985314*Is.o)/100),Rr.u=255*u0(a/100),Rr.o=255*u0(y/100),Rr.F=Is.F,Rr.j=Math.round(Rr.j),255<Rr.j?Rr.j=255:0>Rr.j&&(Rr.j=0),Rr.u=Math.round(Rr.u),255<Rr.u?Rr.u=255:0>Rr.u&&(Rr.u=0),Rr.o=Math.round(Rr.o),255<Rr.o?Rr.o=255:0>Rr.o&&(Rr.o=0),"rgba("+Rr.j+", "+Rr.u+", "+Rr.o+", "+Rr.F+")";case rx:return a0(),La.o=Math.min(100,Math.max(0,La.o+100*a)),"hsla("+La.j+", "+La.u+"%, "+La.o+"%, "+La.F+")";default:It("Unknown color space: "+y)}}function Lu(a){xd||(c0(),xd=!0);var y=d0;if(y!==null){y.clearRect(0,0,1,1),y.fillStyle="#000000";var x=y.fillStyle;y.fillStyle=a,y.fillStyle!==x?(y.fillRect(0,0,1,1),a=y.getImageData(0,0,1,1).data,Rr.j=a[0],Rr.u=a[1],Rr.o=a[2],Rr.F=a[3]/255):(y.fillStyle="#FFFFFF",y.fillStyle=a,Rr.j=0,Rr.u=0,Rr.o=0,Rr.F=1)}}function a0(){var a=Rr.j/255,y=Rr.u/255,x=Rr.o/255,E=Math.max(a,y,x),b=Math.min(a,y,x),z=E-b;if(b=(E+b)/2,z===0)var tt=a=0;else{switch(E){case a:tt=(y-x)/z%6;break;case y:tt=(x-a)/z+2;break;case x:tt=(a-y)/z+4}tt*=60,0>tt&&(tt+=360),a=z/(1-Math.abs(2*b-1))}La.j=Math.round(tt),La.u=Math.round(100*a),La.o=Math.round(100*b),La.F=Rr.F}function l0(a){return a/=255,.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function u0(a){return .0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}function h0(a){return a>f0?Math.pow(a,1/3):(hv*a+16)/116}function nx(a){var y=a*a*a;return y>f0?y:(116*a-16)/hv}function kf(a,y){typeof a!="string"&&(a instanceof kr||It("Value for "+y+" must be a color string or a Brush, not "+a))}function c0(){d0=lo?new nl(null,void 0,{willReadFrequently:!0}).context:null}zi.Object.defineProperties(kr.prototype,{type:{get:function(){return this.na},set:function(a){this._isFrozen&&se(this,a),this.na=a,this.start.Mc()&&(a===Au?this.start=mr:a===Ka&&(this.start=Hn)),this.end.Mc()&&(a===Au?this.end=$o:a===Ka&&(this.end=Hn)),this.xe=null}},color:{get:function(){return this.xk},set:function(a){this._isFrozen&&se(this,a),this.xk=a,this.xe=null}},start:{get:function(){return this.Qd},set:function(a){this._isFrozen&&se(this,a),this.Qd=a.J(),this.xe=null}},end:{get:function(){return this.Lk},set:function(a){this._isFrozen&&se(this,a),this.Lk=a.J(),this.xe=null}},startRadius:{get:function(){return this.Gr},set:function(a){this._isFrozen&&se(this,a),0>a&&xi(a,">= zero",kr,"startRadius"),this.Gr=a,this.xe=null}},endRadius:{get:function(){return this.Xp},set:function(a){this._isFrozen&&se(this,a),0>a&&xi(a,">= zero",kr,"endRadius"),this.Xp=a,this.xe=null}},colorStops:{get:function(){return this.we},set:function(a){this._isFrozen&&se(this,a),this.we=a,this.xe=null}},pattern:{get:function(){return this.cr},set:function(a){this._isFrozen&&se(this,a),this.cr=a,this.xe=null}}}),kr.prototype.isDark=kr.prototype.Gx,kr.prototype.darkenBy=kr.prototype.Wy,kr.prototype.lightenBy=kr.prototype.Vz,kr.prototype.addColorStop=kr.prototype.addColorStop;var f0=216/24389,hv=24389/27,yd=[95.047,100,108.883],d0=null,Rr=new zp,La=new zp,Is=new zp,uu=new zp,xd=!1;kr.className="Brush";var sh;kr.Solid=sh=new ze(kr,"Solid",0);var Au;kr.Linear=Au=new ze(kr,"Linear",1);var Ka;kr.Radial=Ka=new ze(kr,"Radial",2);var wd;kr.Pattern=wd=new ze(kr,"Pattern",4);var Sd;kr.Lab=Sd=new ze(kr,"Lab",5);var rx;kr.HSL=rx=new ze(kr,"HSL",6),kr.randomColor=function(a,y){a===void 0&&(a=128),y===void 0&&(y=Math.max(a,255));var x=Math.abs(y-a);y=Math.floor(a+Math.random()*x).toString(16);var E=Math.floor(a+Math.random()*x).toString(16);return a=Math.floor(a+Math.random()*x).toString(16),2>y.length&&(y="0"+y),2>E.length&&(E="0"+E),2>a.length&&(a="0"+a),"#"+y+E+a},kr.isValidColor=function(a){if(a==="black")return!0;if(a==="")return!1;xd||(c0(),xd=!0);var y=d0;if(y===null)return!0;y.fillStyle="#000000";var x=y.fillStyle;return y.fillStyle=a,y.fillStyle!==x?!0:(y.fillStyle="#FFFFFF",x=y.fillStyle,y.fillStyle=a,y.fillStyle!==x)},kr.lighten=function(a){return ex(a)},kr.lightenBy=ex,kr.darken=function(a){return ix(a)},kr.darkenBy=ix,kr.mix=s0,kr.isDark=vd;function Do(){this.xa="Base"}Do.prototype.measure=function(){},Do.prototype.Yz=function(a,y,x,E,b){a.measure(y,x,E,b)},Do.prototype.arrange=function(){},Do.prototype.Ly=function(a,y,x,E,b,z){a.arrange(y,x,E,b,z)},Do.prototype.iA=function(a){a.Uj()},Do.prototype.gc=function(){},zi.Object.defineProperties(Do.prototype,{name:{get:function(){return this.xa},set:function(a){this.xa=a}},classType:{get:function(){return si}}}),Do.prototype.remeasureObject=Do.prototype.iA,Do.prototype.arrangeElement=Do.prototype.Ly,Do.prototype.measureElement=Do.prototype.Yz,Do.className="PanelLayout";function cv(){this.xa="Base"}Vi(cv,Do),cv.prototype.measure=function(a,y,x,E,b,z,tt){var it=E.length;a=Du(a);for(var nt=0;nt<it;nt++){var ot=E[nt];if(ot.visible||ot===a){var st=ot.margin,ut=st.right+st.left;st=st.top+st.bottom,ot.measure(y,x,z,tt);var ct=ot.measuredBounds;ut=Math.max(ct.width+ut,0),st=Math.max(ct.height+st,0),ct=ot.position.x;var dt=ot.position.y;isFinite(ct)||(ct=0),isFinite(dt)||(dt=0),ot instanceof Rn&&ot.isGeometryPositioned&&(ot=ot.strokeWidth/2,ct-=ot,dt-=ot),jr(b,ct,dt,ut,st)}}},cv.prototype.arrange=function(a,y,x){var E=y.length,b=a.padding;for(a=x.x-b.left,x=x.y-b.top,b=0;b<E;b++){var z=y[b],tt=z.measuredBounds,it=z.margin,nt=z.position.x,ot=z.position.y;if(nt=isNaN(nt)?-a:nt-a,ot=isNaN(ot)?-x:ot-x,z instanceof Rn&&z.isGeometryPositioned){var st=z.strokeWidth/2;nt-=st,ot-=st}z.visible&&z.arrange(nt+it.left,ot+it.top,tt.width,tt.height)}};function fv(){this.xa="Base"}Vi(fv,Do),fv.prototype.measure=function(a,y,x,E,b,z,tt){var it=E.length;y=ii(),z=Du(a);for(var nt=0;nt<it;nt++){var ot=E[nt];if(ot.visible||ot===z){var st=Xs(ot,!1);if(st!==Qe&&st!==$i)y.push(ot);else{ot.measure(1/0,x,0,tt),st=ot.margin,ot=ot.measuredBounds;var ut=Math.max(ot.height+st.top+st.bottom,0);b.width+=Math.max(ot.width+st.right+st.left,0),b.height=Math.max(b.height,ut)}}}for(E=y.length,a.desiredSize.height?x=Math.min(a.desiredSize.height,a.maxSize.height):b.height!==0&&(x=Math.min(b.height,a.maxSize.height)),a=0;a<E;a++)nt=y[a],(nt.visible||nt===z)&&(st=nt.margin,it=st.right+st.left,st=st.top+st.bottom,nt.measure(1/0,x,0,tt),nt=nt.measuredBounds,st=Math.max(nt.height+st,0),b.width+=Math.max(nt.width+it,0),b.height=Math.max(b.height,st));Hi(y)},fv.prototype.arrange=function(a,y,x){for(var E=y.length,b=a.padding,z=b.top,tt=a.isOpposite,it=tt?x.width:b.left,nt=0;nt<E;nt++){var ot=z,st=y[nt];if(st.visible){var ut=st.measuredBounds,ct=st.margin,dt=ct.top+ct.bottom,vt=z+b.bottom,xt=ut.height,Tt=Xs(st,!1);(isNaN(st.desiredSize.height)&&Tt===ri||Tt===dn)&&(xt=Math.max(x.height-dt-vt,0)),dt=xt+dt+vt,vt=st.alignment,vt.Xb()&&(vt=a.defaultAlignment),vt.sb()||(vt=Hn),tt&&(it-=ut.width+ct.left+ct.right),st.arrange(it+vt.offsetX+ct.left,ot+vt.offsetY+ct.top+(x.height*vt.y-dt*vt.y),ut.width,xt),tt||(it+=ut.width+ct.left+ct.right)}}};function dv(){this.xa="Base"}Vi(dv,Do),dv.prototype.measure=function(a,y,x,E,b,z){var tt=E.length;x=ii();for(var it=Du(a),nt=0;nt<tt;nt++){var ot=E[nt];if(ot.visible||ot===it){var st=Xs(ot,!1);if(st!==Qe&&st!==dn)x.push(ot);else{var ut=ot.margin;st=ut.right+ut.left,ut=ut.top+ut.bottom,ot.measure(y,1/0,z,0),ot=ot.measuredBounds,Oo(b,Math.max(b.width,Math.max(ot.width+st,0)),b.height+Math.max(ot.height+ut,0))}}}if(E=x.length,E!==0){for(a.desiredSize.width?y=Math.min(a.desiredSize.width,a.maxSize.width):b.width!==0&&(y=Math.min(b.width,a.maxSize.width)),a=0;a<E;a++)nt=x[a],(nt.visible||nt===it)&&(ot=nt.margin,tt=ot.right+ot.left,ot=ot.top+ot.bottom,nt.measure(y,1/0,z,0),nt=nt.measuredBounds,ot=Math.max(nt.height+ot,0),b.width=Math.max(b.width,Math.max(nt.width+tt,0)),b.height+=ot);Hi(x)}},dv.prototype.arrange=function(a,y,x){for(var E=y.length,b=a.padding,z=b.left,tt=a.isOpposite,it=tt?x.height:b.top,nt=0;nt<E;nt++){var ot=z,st=y[nt];if(st.visible){var ut=st.measuredBounds,ct=st.margin,dt=ct.left+ct.right,vt=z+b.right,xt=ut.width,Tt=Xs(st,!1);(isNaN(st.desiredSize.width)&&Tt===ri||Tt===$i)&&(xt=Math.max(x.width-dt-vt,0)),dt=xt+dt+vt,vt=st.alignment,vt.Xb()&&(vt=a.defaultAlignment),vt.sb()||(vt=Hn),tt&&(it-=ut.height+ct.bottom+ct.top),st.arrange(ot+vt.offsetX+ct.left+(x.width*vt.x-dt*vt.x),it+vt.offsetY+ct.top,xt,ut.height),tt||(it+=ut.height+ct.bottom+ct.top)}}};function pv(){this.xa="Base"}Vi(pv,Do),pv.prototype.measure=function(a,y,x,E,b,z,tt){var it=E.length,nt=a.Pb(),ot=nt.margin,st=ot.right+ot.left,ut=ot.top+ot.bottom;nt.measure(y,x,z,tt);var ct=nt.measuredBounds;z=ct.width,tt=ct.height;var dt=Math.max(z+st,0),vt=Math.max(tt+ut,0),xt=a.isClipping,Tt=be.allocAt(-ot.left,-ot.top,dt,vt),Et=be.allocAt(0,0,z,tt);p0(nt,Et,!0),z=Et.width,tt=Et.height;for(var Ft=!0,Ot=Du(a),Rt=0;Rt<it;Rt++){var Ht=E[Rt];ct=y;var ae=x;if(Ht!==nt&&(Ht.visible||Ht===Ot)){ot=Ht.margin;var wi=ot.left,Ki=ot.top;switch(dt=ot.right+ot.left,vt=ot.top+ot.bottom,ot=Xs(Ht,!1),ot){case ri:ct=z,ae=tt,Ki=wi=vt=dt=0;break;case $i:ct=z,wi=dt=0;break;case dn:ae=tt,Ki=vt=0}Ht.measure(ct,ae,0,0),ct=Ht.measuredBounds,dt=Math.max(ct.width+dt,0),vt=Math.max(ct.height+vt,0),ot=Ht.alignment,ot.Xb()&&(ot=a.defaultAlignment),ot.sb()||(ot=Hn);var Ii=Ht.alignmentFocus;if(Ii.Xb()&&(Ii=Hn),ae=null,Ht instanceof si&&Ht.$e!==""&&(ae=Ht.fb(Ht.$e),ae===Ht&&(ae=null)),wi=Et.x-wi,Ki=Et.y-Ki,ae!==null){for(Ht.arrange(0,0,ct.width,ct.height),ct=ae.actualBounds,ct=Pt.allocAt(ct.x+(Ii.x*ct.width-Ii.offsetX),ct.y+(Ii.y*ct.height-Ii.offsetY)),ae=ae.panel;ae!==Ht;)ae.transform.Ga(ct),ae=ae.panel;wi+=ot.x*z+ot.offsetX-ct.x,Ki+=ot.y*tt+ot.offsetY-ct.y,Pt.free(ct)}else wi+=ot.x*z+ot.offsetX-(Ii.x*ct.width+Ii.offsetX),Ki+=ot.y*tt+ot.offsetY-(Ii.y*ct.height+Ii.offsetY);Ft?(Ft=!1,b.h(wi,Ki,dt,vt)):jr(b,wi,Ki,dt,vt)}}switch(Ft?b.assign(Tt):xt?b.Uu(Et.x,Et.y,Et.width,Et.height):jr(b,Tt.x,Tt.y,Tt.width,Tt.height),be.free(Tt),be.free(Et),ot=nt.stretch,ot===Dn&&(ot=Xs(nt,!1)),ot){case Qe:return;case ri:if(!isFinite(y)&&!isFinite(x))return;break;case $i:if(!isFinite(y))return;break;case dn:if(!isFinite(x))return}for(ct=nt.measuredBounds,z=ct.width,tt=ct.height,dt=Math.max(z+st,0),vt=Math.max(tt+ut,0),ot=nt.margin,Et=be.allocAt(-ot.left,-ot.top,dt,vt),p0(nt,Et,!0),z=Et.width,tt=Et.height,y=0;y<it;y++)x=E[y],x===nt||!x.visible&&x!==Ot||(ot=x.margin,dt=ot.right+ot.left,vt=ot.top+ot.bottom,ct=x.measuredBounds,dt=Math.max(ct.width+dt,0),vt=Math.max(ct.height+vt,0),st=x.alignment,st.Xb()&&(st=a.defaultAlignment),st.sb()||(st=Hn),x=x.alignmentFocus,x.Xb()&&(x=Hn),Ft?(Ft=!1,b.h(st.x*z+st.offsetX-(x.x*ct.width+x.offsetX)-ot.left,st.y*tt+st.offsetY-(x.y*ct.height+x.offsetY)-ot.top,dt,vt)):jr(b,st.x*z+st.offsetX-(x.x*ct.width+x.offsetX)-ot.left,st.y*tt+st.offsetY-(x.y*ct.height+x.offsetY)-ot.top,dt,vt));Ft?b.assign(Tt):xt?b.Uu(Et.x,Et.y,Et.width,Et.height):jr(b,Tt.x,Tt.y,Tt.width,Tt.height),be.free(Et)},pv.prototype.arrange=function(a,y,x){var E=y.length,b=a.Pb(),z=b.measuredBounds,tt=z.width,it=z.height,nt=a.padding;z=nt.left,nt=nt.top;var ot=z-x.x,st=nt-x.y;for(b.arrange(ot,st,tt,it),tt=be.allocAt(0,0,tt,it),p0(b,tt,!1),it=0;it<E;it++){var ut=y[it];if(ut!==b){ot=ut.measuredBounds;var ct=ot.width,dt=ot.height;st=ut.alignment,st.Xb()&&(st=a.defaultAlignment),st.sb()||(st=Hn);var vt=ut.alignmentFocus;if(vt.Xb()&&(vt=Hn),ot=null,ut instanceof si&&ut.$e!==""&&(ot=ut.fb(ut.$e),ot===ut&&(ot=null)),ot!==null){var xt=ot.actualBounds;for(vt=Pt.allocAt(xt.x+(vt.x*xt.width-vt.offsetX),xt.y+(vt.y*xt.height-vt.offsetY)),ot=ot.panel;ot!==ut;)ot.transform.Ga(vt),ot=ot.panel;ot=st.x*tt.width+st.offsetX-vt.x,st=st.y*tt.height+st.offsetY-vt.y,Pt.free(vt)}else ot=st.x*tt.width+st.offsetX-(vt.x*ct+vt.offsetX),st=st.y*tt.height+st.offsetY-(vt.y*dt+vt.offsetY);ot+=tt.x-x.x,st+=tt.y-x.y,ut.visible&&ut.arrange(z+ot,nt+st,ct,dt)}}be.free(tt)};function p0(a,y,x){var E=null;if(a instanceof si&&a.$e!==""&&(E=a.fb(a.$e),E===a&&(E=null)),E!==null)for(x&&a.arrange(0,0,y.width,y.height),y.assign(E.actualBounds),E=E.panel;E!==a;)E.transform.pp(y),E=E.panel}function gv(){this.xa="Base"}Vi(gv,Do),gv.prototype.measure=function(a,y,x,E,b,z,tt){var it=E.length,nt=a.Pb(),ot=nt.margin,st=y,ut=x,ct=ot.right+ot.left,dt=ot.top+ot.bottom;nt.measure(y,x,z,tt),ot=nt.measuredBounds;var vt=0,xt=null;nt instanceof Rn&&(xt=nt,vt=xt.strokeWidth*xt.scale);var Tt=Math.max(ot.width+ct,0);ot=Math.max(ot.height+dt,0);var Et=y0(nt),Ft=Et.x*Tt+Et.offsetX;Et=Et.y*ot+Et.offsetY;var Ot=x0(nt),Rt=Ot.x*Tt+Ot.offsetX;for(Ot=Ot.y*ot+Ot.offsetY,isFinite(y)&&(st=Math.max(Math.abs(Ft-Rt)-vt,0)),isFinite(x)&&(ut=Math.max(Math.abs(Et-Ot)-vt,0)),vt=li.alloc(),vt.h(0,0),a=Du(a),Ot=0;Ot<it;Ot++)Et=E[Ot],Et===nt||!Et.visible&&Et!==a||(ot=Et.margin,Tt=ot.right+ot.left,Ft=ot.top+ot.bottom,Et.measure(st,ut,0,0),ot=Et.measuredBounds,Tt=Math.max(ot.width+Tt,0),ot=Math.max(ot.height+Ft,0),vt.h(Math.max(Tt,vt.width),Math.max(ot,vt.height)));if(it===1)b.width=Tt,b.height=ot,li.free(vt);else{switch(Et=y0(nt),Ot=x0(nt),it=E=0,Ot.x!==Et.x&&Ot.y!==Et.y&&(E=vt.width/Math.abs(Ot.x-Et.x),it=vt.height/Math.abs(Ot.y-Et.y)),li.free(vt),vt=0,xt!==null&&(vt=xt.strokeWidth*xt.scale,E0(xt)===Yi&&(E=it=Math.max(E,it))),E+=Math.abs(Et.offsetX)+Math.abs(Ot.offsetX)+vt,it+=Math.abs(Et.offsetY)+Math.abs(Ot.offsetY)+vt,xt=nt.stretch,xt===Dn&&(xt=Xs(nt,!1)),xt){case Qe:tt=z=0;break;case ri:isFinite(y)&&(E=y),isFinite(x)&&(it=x);break;case $i:isFinite(y)&&(E=y),tt=0;break;case dn:z=0,isFinite(x)&&(it=x)}nt.Uj(),nt.measure(E,it,z,tt),b.width=nt.measuredBounds.width+ct,b.height=nt.measuredBounds.height+dt}},gv.prototype.arrange=function(a,y){var x=y.length,E=a.Pb(),b=E.measuredBounds,z=be.alloc();z.h(0,0,1,1);var tt=E.margin,it=tt.left;tt=tt.top;var nt=a.padding,ot=nt.left;nt=nt.top,E.arrange(ot+it,nt+tt,b.width,b.height);var st=y0(E),ut=x0(E),ct=st.y*b.height+st.offsetY,dt=ut.x*b.width+ut.offsetX;for(ut=ut.y*b.height+ut.offsetY,z.x=st.x*b.width+st.offsetX,z.y=ct,jr(z,dt,ut,0,0),z.x+=it+ot,z.y+=tt+nt,b=0;b<x;b++)it=y[b],it!==E&&(ot=it.measuredBounds,tt=it.margin,nt=Math.max(ot.width+tt.right+tt.left,0),st=Math.max(ot.height+tt.top+tt.bottom,0),ct=it.alignment,ct.Xb()&&(ct=a.defaultAlignment),ct.sb()||(ct=Hn),nt=z.width*ct.x+ct.offsetX-nt*ct.x+tt.left+z.x,tt=z.height*ct.y+ct.offsetY-st*ct.y+tt.top+z.y,it.visible&&(Io(z.x,z.y,z.width,z.height,nt,tt,ot.width,ot.height)?it.arrange(nt,tt,ot.width,ot.height):it.arrange(nt,tt,ot.width,ot.height,new be(z.x,z.y,z.width,z.height))));be.free(z)};function vv(){this.xa="Base",this.name="Table"}Vi(vv,Do),vv.prototype.measure=function(a,y,x,E,b){for(var z=E.length,tt=ii(),it=ii(),nt=0;nt<z;nt++){var ot=E[nt],st=ot instanceof si?ot:null;if(st!==null&&ah(st)&&ot.visible){it.push(st);for(var ut=st.O.s,ct=ut.length,dt=0;dt<ct;dt++){var vt=ut[dt];st.type===si.TableRow?vt.row=ot.row:st.type===si.TableColumn&&(vt.column=ot.column),tt.push(vt)}}else tt.push(ot)}z=tt.length,z===0&&(a.Fb(0),a.Eb(0));for(var xt=[],Tt=0;Tt<z;Tt++){var Et=tt[Tt];Et.visible&&(No(Et,!0),au(Et,!0),xt[Et.row]||(xt[Et.row]=[]),xt[Et.row][Et.column]||(xt[Et.row][Et.column]=[]),xt[Et.row][Et.column].push(Et))}Hi(tt);var Ft=ii(),Ot=ii(),Rt=ii(),Ht={count:0},ae={count:0},wi=y,Ki=x,Ii=a.rowDefs,hi=a.colDefs,Ue=null;z=Ii.length;for(var Ln=0;Ln<z;Ln++)Ue=Ii[Ln],Ue!==void 0&&(Ue.actual=0);z=hi.length;for(var wn=0;wn<z;wn++)Ue=hi[wn],Ue!==void 0&&(Ue.actual=0);for(var vr=xt.length,Br=0,Wo=0;Wo<vr;Wo++)xt[Wo]&&(Br=Math.max(Br,xt[Wo].length));var Go=Math.min(a.topIndex,vr-1),Ms=Math.min(a.leftIndex,Br-1),Zo=0;vr=xt.length;for(var mh=Du(a),ko=0;ko<vr;ko++)if(xt[ko]){Br=xt[ko].length;var Ol=a.Fb(ko);Ol.actual=0;for(var Es=Ol.oc=0;Es<Br;Es++)if(xt[ko][Es]){var yh=a.Eb(Es);Ft[Es]===void 0&&(yh.actual=0,yh.oc=0,Ft[Es]=!0);for(var Fa=xt[ko][Es],al=Fa.length,ya=0;ya<al;ya++){var sa=Fa[ya];if(sa.visible||sa===mh){var oc=1<sa.rowSpan||1<sa.columnSpan;oc&&(ko<Go||Es<Ms||Ot.push(sa));var Il=sa.margin,Kd=Il.right+Il.left,xa=Il.top+Il.bottom,bs=Ll(sa,Ol,yh,!1),bg=sa.desiredSize,Of=!isNaN(bg.height),Xl=!isNaN(bg.width)&&Of;if(oc||bs===Qe||Xl||ko<Go||Es<Ms||(Ht[Es]!==void 0||bs!==ri&&bs!==$i||(Ht[Es]=-1,Ht.count++),ae[ko]!==void 0||bs!==ri&&bs!==dn||(ae[ko]=-1,ae.count++),Rt.push(sa)),sa.measure(1/0,1/0,0,0),!(ko<Go||Es<Ms)){var aa=sa.measuredBounds,Zc=Math.max(aa.width+Kd,0),wa=Math.max(aa.height+xa,0);if(sa.rowSpan===1&&(bs===Qe||bs===$i)){Ue=a.Fb(ko);var sc=Ue.Wc();Zo=Math.max(wa-Ue.actual,0),Zo+sc>Ki&&(Zo=Math.max(Ki-sc,0));var zm=Ue.oa===0;Ue.oc=Ue.oc+Zo,Ue.actual=Ue.oa+Zo,Ki=Math.max(Ki-(Zo+(zm?sc:0)),0)}if(sa.columnSpan===1&&(bs===Qe||bs===dn)){Ue=a.Eb(Es);var Pg=Ue.Wc();Zo=Math.max(Zc-Ue.actual,0),Zo+Pg>wi&&(Zo=Math.max(wi-Pg,0));var Hy=Ue.oa===0;Ue.oc=Ue.oc+Zo,Ue.actual=Ue.oa+Zo,wi=Math.max(wi-(Zo+(Hy?Pg:0)),0)}oc&&sa.Uj()}}}}}Hi(Ft);var yu=0,Ou=0;z=a.columnCount;for(var If=0;If<z;If++){var ac=hi[If];ac!==void 0&&(yu+=isNaN(ac.Hc)?ac.oc:ac.Hc,ac.oc!==0&&(yu+=ac.Wc()))}z=a.rowCount;for(var Vd=0;Vd<z;Vd++){var lc=Ii[Vd];lc!==void 0&&(Ou+=isNaN(lc.Hc)?lc.oc:lc.Hc,lc.oc!==0&&(Ou+=lc.Wc()))}wi=Math.max(y-yu,0);var xu=Ki=Math.max(x-Ou,0),xh=wi;z=Rt.length;for(var la=0;la<z;la++){var Jl=Rt[la],_m=a.Fb(Jl.row),Iu=a.Eb(Jl.column),Gd=Jl.measuredBounds,Rl=Jl.margin,Kc=Rl.right+Rl.left,Ql=Rl.top+Rl.bottom;Ht[Jl.column]=Iu.oc===0&&Ht[Jl.column]!==void 0?Math.max(Gd.width+Kc,Ht[Jl.column]):null,ae[Jl.row]=_m.oc===0&&ae[Jl.row]!==void 0?Math.max(Gd.height+Ql,ae[Jl.row]):null}var Rf=0,Ud=0,El;for(El in ae)El!=="count"&&(Rf+=ae[El]);for(El in Ht)El!=="count"&&(Ud+=Ht[El]);for(var ns=li.alloc(),Ng=0;Ng<z;Ng++){var Zs=Rt[Ng];if(Zs.visible||Zs===mh){var Mo=a.Fb(Zs.row),Ks=a.Eb(Zs.column),Ru=0;isFinite(Ks.width)?Ru=Ks.width:(isFinite(wi)&&Ht[Zs.column]!==null?Ud===0?Ru=Ks.actual+wi:Ru=Ht[Zs.column]/Ud*xh:Ht[Zs.column]!==null?Ru=wi:Ru=Ks.actual||wi,Ru=Math.max(0,Ru-Ks.Wc()));var wh=0;switch(isFinite(Mo.height)?wh=Mo.height:(isFinite(Ki)&&ae[Zs.row]!==null?Rf===0?wh=Mo.actual+Ki:wh=ae[Zs.row]/Rf*xu:ae[Zs.row]!==null?wh=Ki:wh=Mo.actual||Ki,wh=Math.max(0,wh-Mo.Wc())),ns.h(Math.max(Ks.minimum,Math.min(Ru,Ks.maximum)),Math.max(Mo.minimum,Math.min(wh,Mo.maximum))),bs=Ll(Zs,Mo,Ks,!1),bs){case $i:ns.height=Math.max(ns.height,Mo.actual+Ki);break;case dn:ns.width=Math.max(ns.width,Ks.actual+wi)}var Vc=Zs.margin,Wy=Vc.right+Vc.left,Hm=Vc.top+Vc.bottom;Zs.Uj(),Zs.measure(ns.width,ns.height,Ks.minimum,Mo.minimum);var Yd=Zs.measuredBounds,Gc=Math.max(Yd.width+Wy,0),jf=Math.max(Yd.height+Hm,0);isFinite(wi)&&(Gc=Math.min(Gc,ns.width)),isFinite(Ki)&&(jf=Math.min(jf,ns.height));var ua=0;ua=Mo.actual,Mo.actual=Math.max(Mo.actual,jf),Mo.oc=Math.max(Mo.oc,jf),Zo=Mo.actual-ua,Ki=Math.max(Ki-Zo,0),ae[Zs.row]===null&&(xu=Math.max(xu-Zo,0)),ua=Ks.actual,Ks.actual=Math.max(Ks.actual,Gc),Ks.oc=Math.max(Ks.oc,Gc),Zo=Ks.actual-ua,wi=Math.max(wi-Zo,0),Ht[Zs.column]===null&&(xh=Math.max(xh-Zo,0))}}Hi(Rt);var ju=li.alloc(),jl=ii(),Xa=ii();if(z=Ot.length,z!==0){for(var uc=0;uc<vr;uc++)if(xt[uc]){Br=xt[uc].length;var Xd=a.Fb(uc);jl[uc]=Xd.actual;for(var hc=0;hc<Br;hc++)if(xt[uc][hc]){var Wm=a.Eb(hc);Xa[hc]=Wm.actual}}}for(var Jd=0;Jd<z;Jd++){var fo=Ot[Jd];if(fo.visible||fo===mh){var bl=a.Fb(fo.row),ll=a.Eb(fo.column);switch(ns.h(Math.max(ll.minimum,Math.min(y,ll.maximum)),Math.max(bl.minimum,Math.min(x,bl.maximum))),bs=Ll(fo,bl,ll,!1),bs){case ri:Xa[ll.index]!==0&&(ns.width=Math.min(ns.width,Xa[ll.index])),jl[bl.index]!==0&&(ns.height=Math.min(ns.height,jl[bl.index]));break;case $i:Xa[ll.index]!==0&&(ns.width=Math.min(ns.width,Xa[ll.index]));break;case dn:jl[bl.index]!==0&&(ns.height=Math.min(ns.height,jl[bl.index]))}isFinite(ll.width)&&(ns.width=ll.width),isFinite(bl.height)&&(ns.height=bl.height),ju.h(0,0);for(var Zm=ll.minimum,Sa=bl.minimum,Sh=1;Sh<fo.rowSpan&&!(fo.row+Sh>=a.rowCount);Sh++)Ue=a.Fb(fo.row+Sh),Zo=0,Zo=bs===ri||bs===dn?Math.max(Ue.minimum,jl[fo.row+Sh]===0?Ue.maximum:Math.min(jl[fo.row+Sh],Ue.maximum)):Math.max(Ue.minimum,isNaN(Ue.Hc)?Ue.maximum:Math.min(Ue.Hc,Ue.maximum)),ju.height+=Zo,Sa+=Ue.minimum;for(var ul=1;ul<fo.columnSpan&&!(fo.column+ul>=a.columnCount);ul++)Ue=a.Eb(fo.column+ul),Zo=0,Zo=bs===ri||bs===$i?Math.max(Ue.minimum,Xa[fo.column+ul]===0?Ue.maximum:Math.min(Xa[fo.column+ul],Ue.maximum)):Math.max(Ue.minimum,isNaN(Ue.Hc)?Ue.maximum:Math.min(Ue.Hc,Ue.maximum)),ju.width+=Zo,Zm+=Ue.minimum;ns.width+=ju.width,ns.height+=ju.height;var Qd=fo.margin,cc=Qd.right+Qd.left,Tg=Qd.top+Qd.bottom;fo.measure(ns.width,ns.height,Zm,Sa);for(var $d=fo.measuredBounds,$l=Math.max($d.width+cc,0),Uc=Math.max($d.height+Tg,0),fc=0,qd=0;qd<fo.rowSpan&&!(fo.row+qd>=a.rowCount);qd++)Ue=a.Fb(fo.row+qd),fc+=Ue.total||0;if(fc<Uc){var Ch=Uc-fc,wu=Uc-fc;if(fo.spanAllocation!==null)for(var kh=fo.spanAllocation,zu=0;zu<fo.rowSpan&&!(0>=Ch)&&!(fo.row+zu>=a.rowCount);zu++){Ue=a.Fb(fo.row+zu);var Mh=Ue.oa||0,Yc=kh(fo,Ue,wu);Ue.actual=Math.min(Ue.maximum,Mh+Yc),Ue.oa!==Mh&&(Ch-=Ue.oa-Mh)}for(;0<Ch;){var zl=Ue.oa||0;if(isNaN(Ue.height)&&Ue.maximum>zl&&(Ue.actual=Math.min(Ue.maximum,zl+Ch),Ue.oa!==zl&&(Ch-=Ue.oa-zl)),Ue.index===0)break;Ue=a.Fb(Ue.index-1)}}for(var zf=0,Eh=0;Eh<fo.columnSpan&&!(fo.column+Eh>=a.columnCount);Eh++)Ue=a.Eb(fo.column+Eh),zf+=Ue.total||0;if(zf<$l){var _f=$l-zf,Zy=$l-zf;if(fo.spanAllocation!==null)for(var _u=fo.spanAllocation,Xc=0;Xc<fo.columnSpan&&!(0>=_f)&&!(fo.column+Xc>=a.columnCount);Xc++){Ue=a.Eb(fo.column+Xc);var Lg=Ue.oa||0,Ky=_u(fo,Ue,Zy);Ue.actual=Math.min(Ue.maximum,Lg+Ky),Ue.oa!==Lg&&(_f-=Ue.oa-Lg)}for(;0<_f;){var Km=Ue.oa||0;if(isNaN(Ue.width)&&Ue.maximum>Km&&(Ue.actual=Math.min(Ue.maximum,Km+_f),Ue.oa!==Km&&(_f-=Ue.oa-Km)),Ue.index===0)break;Ue=a.Eb(Ue.index-1)}}}}Hi(Ot),li.free(ju),li.free(ns),jl!==void 0&&Hi(jl),Xa!==void 0&&Hi(Xa);var Hf=0,Wf=0,Vm=a.desiredSize,vw=a.maxSize;bs=Xs(a,!0);var Ag=Ou=yu=0,Dg=0;z=a.columnCount;for(var Gm=0;Gm<z;Gm++)hi[Gm]!==void 0&&(Ue=a.Eb(Gm),isFinite(Ue.width)?(Ag+=Ue.width,Ag+=Ue.Wc()):bv(Ue)===Zp?(Ag+=Ue.oa,Ag+=Ue.Wc()):Ue.oa!==0&&(yu+=Ue.oa,yu+=Ue.Wc()));isFinite(Vm.width)?Hf=Math.min(Vm.width,vw.width):Hf=bs!==Qe&&isFinite(y)?y:yu,Hf=Math.max(Hf,a.minSize.width),Hf=Math.max(Hf-Ag,0);for(var nS=yu===0?1:Math.max(Hf/yu,1),Um=0;Um<z;Um++)hi[Um]!==void 0&&(Ue=a.Eb(Um),isFinite(Ue.width)||bv(Ue)===Zp||(Ue.actual=Ue.oa*nS),Ue.position=b.width,Ue.oa!==0&&(b.width+=Ue.oa,b.width+=Ue.Wc()));z=a.rowCount;for(var Ym=0;Ym<z;Ym++)Ii[Ym]!==void 0&&(Ue=a.Fb(Ym),isFinite(Ue.height)?(Dg+=Ue.height,Dg+=Ue.Wc()):bv(Ue)===Zp?(Dg+=Ue.oa,Dg+=Ue.Wc()):Ue.oa!==0&&(Ou+=Ue.oa,Ou+=Ue.Wc()));isFinite(Vm.height)?Wf=Math.min(Vm.height,vw.height):Wf=bs!==Qe&&isFinite(x)?x:Ou,Wf=Math.max(Wf,a.minSize.height),Wf=Math.max(Wf-Dg,0);for(var rS=Ou===0?1:Math.max(Wf/Ou,1),Xm=0;Xm<z;Xm++)Ii[Xm]!==void 0&&(Ue=a.Fb(Xm),isFinite(Ue.height)||bv(Ue)===Zp||(Ue.actual=Ue.oa*rS),Ue.position=b.height,Ue.oa!==0&&(b.height+=Ue.oa,b.height+=Ue.Wc()));z=it.length;for(var Vy=0;Vy<z;Vy++){var Fg=it[Vy],Gy=0,Uy=0;Fg.type===si.TableRow?(Gy=b.width,Ue=a.Fb(Fg.row),Uy=Ue.actual):(Ue=a.Eb(Fg.column),Gy=Ue.actual,Uy=b.height),Fg.measuredBounds.h(0,0,Gy,Uy),No(Fg,!1)}Hi(it),a.inRowsCols=xt},vv.prototype.arrange=function(a,y,x){var E=y.length,b=a.padding,z=b.left;b=b.top;var tt=a.inRowsCols;if(tt!==null){for(var it,nt,ot=tt.length,st=0,ut=0;ut<ot;ut++)tt[ut]&&(st=Math.max(st,tt[ut].length));nt=a.rowDefs,it=a.colDefs;var ct=ut=0,dt=Math.min(a.topIndex,ot-1);if(0<nt.length){for(;dt!==ot&&(nt[dt]===void 0||nt[dt].oa===0);)dt++;dt=Math.max(Math.min(dt,ot-1),0),ut=-nt[dt].position}var vt=Math.min(a.leftIndex,st-1);if(0<it.length){for(;vt!==st&&(it[vt]===void 0||it[vt].oa===0);)vt++;vt=Math.max(Math.min(vt,st-1),0),ct=-it[vt].position}for(var xt=0,Tt=0;xt!==ot&&nt[xt]===void 0;)xt++;for(;Tt!==ot&&it[Tt]===void 0;)Tt++;st=a.part,a.Fb(xt),a.Eb(Tt);for(var Et=0;Et<y.length;Et++){var Ft=y[Et];if(Ft instanceof si&&Ft.visible&&ah(Ft)){if(Ft.type===si.TableRow){it=a.Fb(Ft.row);var Ot=a.Eb(Tt)}else it=a.Fb(xt),Ot=a.Eb(Ft.column);nt=it.position+ut+b,it.oa!==0&&(nt+=it.Io(Math.max(xt,dt))),it=Ot.position+ct+z,Ot.oa!==0&&(it+=Ot.Io(Math.max(Tt,vt))),Ot=Ft.measuredBounds,Ft.Uk(),Ft.actualBounds.ka();var Rt=Ft.actualBounds,Ht=be.allocAt(Rt.x,Rt.y,Rt.width,Rt.height);Rt.x=Ft.type===si.TableRow?z:it,Rt.y=Ft.type===si.TableColumn?b:nt,Rt.width=Ot.width,Rt.height=Ot.height,Ft.actualBounds.freeze(),au(Ft,!1),Qr(Ht,Rt)||st===null||(st.oh(),Ft.Pn(st)),be.free(Ht)}}for(Et=li.alloc(),Ft=0;Ft<ot;Ft++)if(tt[Ft]){for(st=tt[Ft].length,Ot=a.Fb(Ft),nt=Ot.position+ut+b,Ot.oa!==0&&(nt+=Ot.Io(Math.max(xt,dt))),Rt=0;Rt<st;Rt++)if(tt[Ft][Rt]){Ht=a.Eb(Rt),it=Ht.position+ct+z,Ht.oa!==0&&(it+=Ht.Io(Math.max(Tt,vt)));for(var ae=tt[Ft][Rt],wi=ae.length,Ki=0;Ki<wi;Ki++){var Ii=ae[Ki],hi=Ii.measuredBounds;Et.h(0,0);for(var Ue=1;Ue<Ii.rowSpan&&!(Ft+Ue>=a.rowCount);Ue++){var Ln=a.Fb(Ft+Ue);Ln.oa!==0&&(Et.height+=Ln.total)}for(Ue=1;Ue<Ii.columnSpan&&!(Rt+Ue>=a.columnCount);Ue++)Ln=a.Eb(Rt+Ue),Ln.oa!==0&&(Et.width+=Ln.total);var wn=Ht.oa+Et.width,vr=Ot.oa+Et.height;Ue=it,Ln=nt;var Br=wn,Wo=vr,Go=it,Ms=nt,Zo=wn,mh=vr;it+wn>x.width&&(Zo=Math.max(x.width-it,0)),nt+vr>x.height&&(mh=Math.max(x.height-nt,0));var ko=Ii.alignment;if(ko.Xb()){ko=a.defaultAlignment,ko.sb()||(ko=Hn);var Ol=ko.x,Es=ko.y,yh=ko.offsetX;ko=ko.offsetY;var Fa=Ht.alignment,al=Ot.alignment;Fa.sb()&&(Ol=Fa.x,yh=Fa.offsetX),al.sb()&&(Es=al.y,ko=al.offsetY)}else Ol=ko.x,Es=ko.y,yh=ko.offsetX,ko=ko.offsetY;(isNaN(Ol)||isNaN(Es))&&(Es=Ol=.5,ko=yh=0),Fa=hi.width,al=hi.height;var ya=Ii.margin,sa=ya.left+ya.right,oc=ya.top+ya.bottom,Il=Ll(Ii,Ot,Ht,!1);!isNaN(Ii.desiredSize.width)||Il!==ri&&Il!==$i||(Fa=Math.max(wn-sa,0)),!isNaN(Ii.desiredSize.height)||Il!==ri&&Il!==dn||(al=Math.max(vr-oc,0)),wn=Ii.maxSize,vr=Ii.minSize,Fa=Math.min(wn.width,Fa),al=Math.min(wn.height,al),Fa=Math.max(vr.width,Fa),al=Math.max(vr.height,al),wn=al+oc,Ue+=Br*Ol-(Fa+sa)*Ol+yh+ya.left,Ln+=Wo*Es-wn*Es+ko+ya.top,Ii.visible&&(Io(Go,Ms,Zo,mh,Ue,Ln,hi.width,hi.height)?Ii.arrange(Ue,Ln,Fa,al):Ii.arrange(Ue,Ln,Fa,al,new be(Go,Ms,Zo,mh)))}}}for(li.free(Et),a=0;a<E;a++)x=y[a],z=x instanceof si?x:null,z!==null&&ah(z)&&(z=x.actualBounds,x.naturalBounds.ka(),x.naturalBounds.h(0,0,z.width,z.height),x.naturalBounds.freeze())}};function mv(){this.xa="Base"}Vi(mv,Do),mv.prototype.measure=function(){},mv.prototype.arrange=function(){};function yv(){this.xa="Base"}Vi(yv,Do),yv.prototype.measure=function(){},yv.prototype.arrange=function(){};function xv(){this.xa="Base"}Vi(xv,Do),xv.prototype.measure=function(a,y,x,E,b,z,tt){1<E.length&&It("Viewbox Panel cannot contain more than one GraphObject."),E=E[0],E.Ca=1,E.Uj(),E.measure(1/0,1/0,z,tt);var it=E.measuredBounds,nt=E.margin,ot=nt.right+nt.left;if(nt=nt.top+nt.bottom,isFinite(y)||isFinite(x)){var st=E.scale,ut=it.width;it=it.height;var ct=Math.max(y-ot,0),dt=Math.max(x-nt,0),vt=1;a.viewboxStretch===Yi?ut!==0&&it!==0&&(vt=Math.min(ct/ut,dt/it)):ut!==0&&it!==0&&(vt=Math.max(ct/ut,dt/it)),vt===0&&(vt=1e-4),E.Ca*=vt,st!==E.scale&&(No(E,!0),E.measure(1/0,1/0,z,tt))}it=E.measuredBounds,b.width=isFinite(y)?y:Math.max(it.width+ot,0),b.height=isFinite(x)?x:Math.max(it.height+nt,0)},xv.prototype.arrange=function(a,y,x){y=y[0];var E=y.measuredBounds,b=y.margin,z=Math.max(E.width+(b.right+b.left),0);b=Math.max(E.height+(b.top+b.bottom),0);var tt=y.alignment;tt.Xb()&&(tt=a.defaultAlignment),tt.sb()||(tt=Hn),y.arrange(x.width*tt.x-z*tt.x+tt.offsetX,x.height*tt.y-b*tt.y+tt.offsetY,E.width,E.height)};function _p(){this.xa="Base"}Vi(_p,Do),_p.prototype.measure=function(){},_p.prototype.arrange=function(){},_p.prototype.gc=function(a,y,x){x=a.Df()*x.scale,0>=x&&(x=1);var E=a.gridCellSize,b=E.width;E=E.height;var z=a.naturalBounds,tt=a.actualBounds,it=z.width,nt=z.height,ot=Math.ceil(it/b),st=Math.ceil(nt/E),ut=a.gridOrigin,ct=ut.x;ut=ut.y,y.save(),y.beginPath(),y.rect(0,0,it,nt),y.clip(),y.Se();for(var dt=[],vt=a.O.s,xt=vt.length,Tt=0;Tt<xt;Tt++){var Et=vt[Tt],Ft=[];if(dt.push(Ft),Et.visible){var Ot=Et.interval;if(!(0>Ot)){Et=v0(Et.figure);for(var Rt=0;Rt<xt;Rt++)if(Rt!==Tt){var Ht=vt[Rt];Ht.visible&&v0(Ht.figure)===Et&&(Ht=Ht.interval,Ht>Ot&&Ft.push(Ht))}}}}for(vt=a.O.s,xt=vt.length,Tt=0;Tt<xt;Tt++){var ae=vt[Tt];if(ae.visible&&(Ft=ae.interval||1,Et=Math.abs(Ft),!(2>b*Et*x))){if(Ot=ae.segmentIndex,(!isFinite(Ot)||isNaN(Ot))&&(Ot=0),0>Ot&&(Ot=Et-Math.min(-Ot,Et)),Ot=Math.round(Ot%Et),Et=ae.opacity,Rt=1,Et!==1){if(Et===0)continue;Rt=y.globalAlpha,y.globalAlpha=Rt*Et}Ht=dt[Tt];var wi=!1,Ki=ae.strokeDashArray;if(Ki!==null&&(wi=!0,y.js(Ki,ae.strokeDashOffset)),ae.figure==="LineV"&&ae.stroke!==null&&0<ae.strokeWidth){for(y.lineWidth=ae.strokeWidth,uo(a,y,ae.stroke,!1,!1,z,tt),y.beginPath(),Ki=ae=Math.floor((ct-b)/b);Ki<=ae+ot;Ki++){var Ii=Ki*b+ct;0<=Ii&&Ii<=it&&wv(Ki,Ft,Ot,Ht)&&(y.moveTo(Ii,0),y.lineTo(Ii,nt))}y.stroke(),y.Se()}else if(ae.figure==="LineH"&&ae.stroke!==null&&0<ae.strokeWidth){for(y.lineWidth=ae.strokeWidth,uo(a,y,ae.stroke,!1,!1,z,tt),y.beginPath(),Ki=ae=Math.floor((ut-E)/E);Ki<=ae+st;Ki++)Ii=Ki*E+ut,0<=Ii&&Ii<=nt&&wv(Ki,Ft,Ot,Ht)&&(y.moveTo(0,Ii),y.lineTo(it,Ii));y.stroke(),y.Se()}else if(ae.figure==="BarV"&&ae.fill!==null)for(uo(a,y,ae.fill,!0,!1,z,tt),ae=ae.width,isNaN(ae)&&(ae=b),Ii=Ki=Math.floor((ct-b)/b);Ii<=Ki+ot;Ii++){var hi=Ii*b+ct;0<=hi+ae&&hi<=it&&wv(Ii,Ft,Ot,Ht)&&y.fillRect(hi,0,ae,nt)}else if(ae.figure==="BarH"&&ae.fill!==null)for(uo(a,y,ae.fill,!0,!1,z,tt),ae=ae.height,isNaN(ae)&&(ae=E),Ii=Ki=Math.floor((ut-E)/E);Ii<=Ki+st;Ii++)hi=Ii*E+ut,0<=hi+ae&&hi<=nt&&wv(Ii,Ft,Ot,Ht)&&y.fillRect(0,hi,it,ae);wi&&y.fs(),Et!==1&&(y.globalAlpha=Rt)}}y.restore(),y.Vc(!1)};function wv(a,y,x,E){if(0>y)return a%y===x;if(a%y!==x)return!1;y=E.length;for(var b=0;b<y;b++)if(a%E[b]===x)return!1;return!0}function Sv(){this.xa="Base"}Vi(Sv,Do),Sv.prototype.measure=function(a,y,x,E,b){var z=E.length;if(a instanceof cr||a instanceof fi){var tt=null,it=null;if(a instanceof fi&&(tt=a),a instanceof cr&&(it=a,tt=it.adornedPart,a.j===null&&(a.j=[])),tt instanceof fi){var nt=tt;if(z===0)Oo(a.naturalBounds,0,0),a.measuredBounds.h(0,0,0,0);else{var ot=a instanceof cr?null:tt.path;y=tt.routeBounds,x=a.jg,x.h(0,0,y.width,y.height);var st=nt.points,ut=tt.pointsCount;it!==null?it.Ul(!1):tt!==null&&tt.Ul(!1),it=y.width;var ct=y.height,dt=a.j;if(dt.length=0,ot!==null){ox(a,it,ct,ot);var vt=ot.measuredBounds;x.ed(vt),dt.push(vt)}vt=bn.alloc();for(var xt=Pt.alloc(),Tt=Pt.alloc(),Et=0;Et<z;Et++){var Ft=E[Et];if(Ft!==ot)if(Ft.isPanelMain&&Ft instanceof Rn){ox(a,it,ct,Ft);var Ot=Ft.measuredBounds;x.ed(Ot),dt.push(Ot)}else if(2>ut)Ft.measure(1/0,1/0,0,0),Ot=Ft.measuredBounds,x.ed(Ot),dt.push(Ot);else{var Rt=Ft.segmentIndex,Ht=Ft.segmentFraction,ae=Ft.alignmentFocus;ae.Mc()&&(ae=Hn);var wi=Ft.segmentOrientation,Ki=Ft.segmentOffset;if(isNaN(Rt)){var Ii=nt.ua;Ot=ii(),Ii.Qu(Ht,Ot);var hi=Pt.allocAt(Ot[0],Ot[1]);if(hi.add(nt.i(0)),Ii.type===ci.j?hi.offset(-Ii.startX,-Ii.startY):(Ii=Ii.figures.first(),Ii!==null&&hi.offset(-Ii.startX,-Ii.startY)),Ii=Ot[2],wi!==js){var Ue=nt.computeAngle(Ft,wi,Ii);Ft.Kb=Ue}Ue=hi.x-y.x;var Ln=hi.y-y.y;Pt.free(hi),Hi(Ot)}else if(Rt<-ut||Rt>=ut)Ot=Pt.alloc(),nt.vg(),nt.computeMidPoint(Ot),Ii=nt.midAngle,wi!==js&&(Ue=nt.computeAngle(Ft,wi,Ii),Ft.Kb=Ue),Ue=Ot.x-y.x,Ln=Ot.y-y.y,Pt.free(Ot);else{if(Ue=0,0<=Rt?(Ln=st.M(Rt),Ot=Rt<ut-1?st.M(Rt+1):Ln):(Ue=ut+Rt,Ln=st.M(Ue),Ot=0<Ue?st.M(Ue-1):Ln),Ln.Xa(Ot)){0<=Rt?(Ii=0<Rt?st.M(Rt-1):Ln,Ue=Rt<ut-2?st.M(Rt+2):Ot):(Ii=Ue<ut-1?st.M(Ue+1):Ln,Ue=1<Ue?st.M(Ue-2):Ot),hi=Ii.Bf(Ln);var wn=Ot.Bf(Ue);Ii=hi>wn+10?0<=Rt?Ii.ab(Ln):Ln.ab(Ii):wn>hi+10?0<=Rt?Ot.ab(Ue):Ue.ab(Ot):0<=Rt?Ii.ab(Ue):Ue.ab(Ii)}else Ii=0<=Rt?Ln.ab(Ot):Ot.ab(Ln);wi!==js&&(Ue=nt.computeAngle(Ft,wi,Ii),Ft.Kb=Ue),Ue=Ln.x+(Ot.x-Ln.x)*Ht-y.x,Ln=Ln.y+(Ot.y-Ln.y)*Ht-y.y}Ft.measure(1/0,1/0,0,0),Ot=Ft.measuredBounds,hi=Ft.naturalBounds;var vr=0;Ft instanceof Rn&&(vr=Ft.strokeWidth),wn=hi.width+vr;var Br=hi.height+vr;vt.reset(),vt.translate(-Ot.x,-Ot.y),vt.scale(Ft.scale,Ft.scale),vt.rotate(wi===js?Ft.angle:Ii,wn/2,Br/2),wi!==qp&&wi!==eg||vt.rotate(90,wn/2,Br/2),wi!==tg&&wi!==ig||vt.rotate(-90,wn/2,Br/2),wi===Qv&&(45<Ii&&135>Ii||225<Ii&&315>Ii)&&vt.rotate(-Ii,wn/2,Br/2),hi=new be(0,0,wn,Br),xt.xi(hi,ae),vt.Ga(xt),ae=-xt.x+vr/2*Ft.scale,Ft=-xt.y+vr/2*Ft.scale,Tt.assign(Ki),vr=isNaN(Ki.x);var Wo=isNaN(Ki.y);if(vr||Wo){wn=wn/2+3,Br=Br/2+3;var Go=45<=Ii&&135>=Ii,Ms=225<=Ii&&315>=Ii;wi===js&&(Go||Ms)?(Tt.x=Wo?wn:Ki.y,Tt.y=vr?Br:Ki.x,Go?0<=Rt||isNaN(Rt)&&.5>Ht||!vr||(Tt.y=-Br):Ms&&((0<=Rt||isNaN(Rt)&&.5>Ht)&&vr&&(Tt.y=-Br),Wo&&(Tt.x=-wn))):(vr&&(Tt.x=0<=Rt||isNaN(Rt)&&.5>Ht?wn:-wn),Wo&&(Tt.y=-Br),Tt.rotate(Ii))}else Tt.rotate(Ii);Ue+=Tt.x,Ln+=Tt.y,hi.set(Ot),hi.h(Ue+ae,Ln+Ft,Ot.width,Ot.height),dt.push(hi),x.ed(hi)}}if(tt!==null)for(E=tt.labelNodes;E.next();)E.value.measure(1/0,1/0);a.jg=x,a.position.h(y.x+x.x,y.y+x.y),Oo(b,x.width||0,x.height||0),bn.free(vt),Pt.free(xt),Pt.free(Tt)}}}},Sv.prototype.arrange=function(a,y){var x=y.length;if(a instanceof cr||a instanceof fi){var E=a,b=null;a instanceof cr&&(b=a,E=b.adornedPart);var z=a instanceof cr?null:E.path,tt=a.j;if(tt.length!==0){var it=0;if(z!==null&&it<tt.length){var nt=tt[it];it++,z.arrange(nt.x-a.jg.x,nt.y-a.jg.y,nt.width,nt.height)}for(nt=0;nt<x;nt++){var ot=y[nt];if(ot!==z&&it<tt.length){var st=tt[it];it++,ot.arrange(st.x-a.jg.x,st.y-a.jg.y,st.width,st.height)}}}if(y=E.points,x=y.count,2<=x&&a instanceof fi)for(z=a.labelNodes;z.next();){var ut=a;tt=z.value,it=tt.segmentIndex,nt=tt.segmentFraction;var ct=tt.alignmentFocus;if(ot=tt.segmentOrientation,st=tt.segmentOffset,isNaN(it)){var dt=ut.ua,vt=ii();dt.Qu(nt,vt);var xt=Pt.allocAt(vt[0],vt[1]);xt.add(ut.i(0)),dt.type===ci.j||(dt=dt.figures.first()),xt.offset(-dt.startX,-dt.startY),dt=vt[2],ot!==js&&(ut=ut.computeAngle(tt,ot,dt),tt.angle=ut),ut=xt.x;var Tt=xt.y;Pt.free(xt),Hi(vt)}else if(it<-x||it>=x)vt=Pt.alloc(),dt=ut,Tt=vt,dt.vg(),dt.computeMidPoint(Tt),dt=ut.midAngle,ot!==js&&(ut=ut.computeAngle(tt,ot,dt),tt.angle=ut),ut=vt.x,Tt=vt.y,Pt.free(vt);else{if(xt=0,0<=it?(vt=y.s[it],Tt=it<x-1?y.s[it+1]:vt):(xt=x+it,vt=y.s[xt],Tt=0<xt?y.s[xt-1]:vt),vt.Xa(Tt)){0<=it?(dt=0<it?y.s[it-1]:vt,xt=it<x-2?y.s[it+2]:Tt):(dt=xt<x-1?y.s[xt+1]:vt,xt=1<xt?y.s[xt-2]:Tt);var Et=dt.Bf(vt),Ft=Tt.Bf(xt);dt=Et>Ft+10?0<=it?dt.ab(vt):vt.ab(dt):Ft>Et+10?0<=it?Tt.ab(xt):xt.ab(Tt):0<=it?dt.ab(xt):xt.ab(dt)}else dt=0<=it?vt.ab(Tt):Tt.ab(vt);ot!==js&&(ut=ut.computeAngle(tt,ot,dt),tt.angle=ut),ut=vt.x+(Tt.x-vt.x)*nt,Tt=vt.y+(Tt.y-vt.y)*nt}if(ct.ys())tt.location=new Pt(ut,Tt);else{ct.Mc()&&(ct=Hn),vt=bn.alloc(),vt.reset(),vt.scale(tt.scale,tt.scale),vt.rotate(tt.angle,0,0);var Ot=tt.naturalBounds;xt=be.allocAt(0,0,Ot.width,Ot.height),Et=Pt.alloc(),Et.xi(xt,ct),vt.Ga(Et),ct=-Et.x,Ft=-Et.y;var Rt=Ot.width,Ht=Ot.height;Ot=Pt.alloc(),Ot.assign(st);var ae=isNaN(st.x),wi=isNaN(st.y);if(ae||wi){Rt=Rt/2+3,Ht=Ht/2+3;var Ki=45<=dt&&135>=dt,Ii=225<=dt&&315>=dt;ot===js&&(Ki||Ii)?(Ot.x=wi?Rt:st.y,Ot.y=ae?Ht:st.x,Ki?0<=it||isNaN(it)&&.5>nt||!ae||(Ot.y=-Ht):Ii&&((0<=it||isNaN(it)&&.5>nt)&&ae&&(Ot.y=-Ht),wi&&(Ot.x=-Rt))):(ae&&(Ot.x=0<=it||isNaN(it)&&.5>nt?Rt:-Rt),wi&&(Ot.y=-Ht),Ot.rotate(dt))}else Ot.rotate(dt);ut+=Ot.x,Tt+=Ot.y,vt.pp(xt),ct+=xt.x,Ft+=xt.y,it=Pt.allocAt(ut+ct,Tt+Ft),tt.move(it),Pt.free(it),Pt.free(Ot),Pt.free(Et),be.free(xt),bn.free(vt)}}b!==null?b.Ul(!1):E.Ul(!1),E=Bx(a),a.location.h(a.position.x+E.x,a.position.y+E.y),Pt.free(E)}};function ox(a,y,x,E){if(Ta(E)!==!1){var b=E.strokeWidth;b===0&&a instanceof cr&&a.type===si.Link&&a.adornedObject instanceof Rn&&(b=a.adornedObject.strokeWidth),b*=E.Ca,a instanceof fi&&a.ua!==null?(a=a.geometry.bounds,E.Ge(a.x-b/2,a.y-b/2,a.width+b,a.height+b)):a instanceof cr&&a.adornedPart.ua!==null?(a=a.adornedPart.ua.bounds,E.Ge(a.x-b/2,a.y-b/2,a.width+b,a.height+b)):E.Ge(-(b/2),-(b/2),y+b,x+b),b=E.desiredSize,b.w()||E.ua===null?E.dc.h(0,0,b.width,b.height):E.dc.assign(E.ua.bounds),No(E,!1)}}function Hp(){this.xa="Base"}Vi(Hp,Do),Hp.prototype.measure=function(a,y,x,E,b,z,tt){var it=a.Pb();a.graduatedBounds=[];var nt=it.margin,ot=nt.right+nt.left,st=nt.top+nt.bottom;it.measure(y,x,z,tt);var ut=it.measuredBounds,ct=new be(-nt.left,-nt.top,Math.max(ut.width+ot,0),Math.max(ut.height+st,0));a.graduatedBounds.push(ct),b.assign(ct);for(var dt=it.geometry,vt=it.strokeWidth,xt=dt.flattenedSegments,Tt=dt.flattenedLengths,Et=dt.flattenedTotalLength,Ft=xt.length,Ot=0,Rt=0,Ht=ii(),ae=0;ae<Ft;ae++){var wi=xt[ae],Ki=[];Rt=Ot=0;for(var Ii=wi.length,hi=0;hi<Ii;hi+=2){var Ue=wi[hi],Ln=wi[hi+1];if(hi!==0){var wn=180*Math.atan2(Ln-Rt,Ue-Ot)/Math.PI;0>wn&&(wn+=360),Ki.push(wn)}Ot=Ue,Rt=Ln}Ht.push(Ki)}if(a.graduatedIntervals===null){for(var vr=[],Br=a.O.s,Wo=Br.length,Go=0;Go<Wo;Go++){var Ms=Br[Go],Zo=[];if(vr.push(Zo),Ms.visible){var mh=Ms.interval;if(!(0>mh)){for(var ko=0;ko<Wo;ko++)if(ko!==Go){var Ol=Br[ko];if(Ol.visible&&Ms.constructor===Ol.constructor){var Es=Ol.interval;Es>mh&&Zo.push(Es)}}}}}a.graduatedIntervals=vr}var yh=a.graduatedIntervals,Fa=a.O.s,al=Fa.length,ya=0,sa=0,oc=Et;a.graduatedMarks=[];for(var Il,Kd=0;Kd<al;Kd++){var xa=Fa[Kd];if(Il=[],xa.visible&&xa!==it){var bs=Math.abs(xa.interval),bg=a.graduatedTickUnit;if(!(2>bg*bs*Et/a.graduatedRange&&xa.graduatedSkip===null)){var Of=Tt[0][0],Xl=0,aa=0;sa=Et*xa.graduatedStart-1e-4,oc=Et*xa.graduatedEnd+1e-4;var Zc=bg*bs,wa=a.graduatedTickBase;if(wa<a.graduatedMin){var sc=(a.graduatedMin-wa)/Zc;sc=sc%1===0?sc:Math.floor(sc+1),wa+=sc*Zc}else wa>a.graduatedMin+Zc&&(wa-=Math.floor((wa-a.graduatedMin)/Zc)*Zc);for(var zm=yh[Kd],Pg=wa,Hy=1e-6*a.graduatedMax,yu=1;wa<=a.graduatedMax+Hy;yu++){t:{for(var Ou=zm.length,If=0;If<Ou;If++){var ac=(wa-a.graduatedTickBase)%(zm[If]*a.graduatedTickUnit),Vd=1e-6*a.graduatedTickUnit;if(ac<Vd&&ac>-Vd){var lc=!1;break t}}lc=!0}if(lc&&(wa>a.graduatedMax&&(wa=a.graduatedMax),xa.graduatedSkip===null||xa instanceof Or&&!xa.graduatedSkip(wa,xa)||xa instanceof Rn&&!xa.graduatedSkip(wa,xa))&&(ya=(wa-a.graduatedMin)*Et/a.graduatedRange,ya>Et&&(ya=Et),sa<=ya&&ya<=oc)){for(var xu=Ht[Xl][aa],xh=Tt[Xl][aa];Xl<Tt.length;){for(;ya>Of&&aa<Tt[Xl].length-1;)aa++,xu=Ht[Xl][aa],xh=Tt[Xl][aa],Of+=xh;if(ya<=Of)break;Xl++,aa=0,xu=Ht[Xl][aa],xh=Tt[Xl][aa],Of+=xh}var la=xt[Xl],Jl=la[2*aa],_m=la[2*aa+1],Iu=(ya-(Of-xh))/xh,Gd=new Pt(Jl+(la[2*aa+2]-Jl)*Iu+vt/2-dt.bounds.x,_m+(la[2*aa+3]-_m)*Iu+vt/2-dt.bounds.y);Gd.scale(it.scale,it.scale);t:{var Rl=xu,Kc=Ht[Xl];if(!(.5005>Iu&&.4995<Iu)){var Ql=Rl;if(.5>Iu?0<aa?Ql=Kc[aa-1]:Gt.$(la[0],la[la.length-2])&&Gt.$(la[1],la[la.length-1])&&(Ql=Kc[Kc.length-1]):.5<Iu&&(aa+1<Kc.length?Ql=Kc[aa+1]:Gt.$(la[0],la[la.length-2])&&Gt.$(la[1],la[la.length-1])&&(Ql=Kc[0])),Rl!==Ql){var Rf=Math.abs(Rl-Ql);if(180<Rf&&(Rl<Ql?Rl+=360:Ql+=360,Rf=Math.abs(Rl-Ql)),5e-4>Iu||.9995<Iu){xu=(Rl+Ql)/2%360;break t}if(10>Rf){var Ud=1-Math.abs(.5-Iu);xu=(Rl*Ud+Ql*(1-Ud))%360;break t}}}xu=Rl}if(xa instanceof Or){var El="";xa.graduatedFunction!==null?(El=xa.graduatedFunction(wa,xa),El=El!=null?El.toString():""):El=(+wa.toFixed(2)).toString(),El!==""&&Il.push({$l:Gd,angle:xu,text:El})}else Il.push({$l:Gd,angle:xu})}wa=Pg+yu*Zc}}}a.graduatedMarks.push(Il)}Hi(Ht);var ns=a.graduatedMarks;if(ns!==null)for(var Ng=E.length,Zs=0;Zs<Ng;Zs++){var Mo=E[Zs],Ks=ns[Zs];if(Mo.visible&&Mo!==it&&Ks.length!==0){if(Mo instanceof Rn){var Ru=a,wh=b,Vc=Mo.alignmentFocus;Vc.Mc()&&(Vc=mr);var Wy=Mo.angle;Mo.Kb=0,Mo.measure(1/0,1/0,0,0),Mo.Kb=Wy;var Hm=Mo.measuredBounds,Yd=Hm.width,Gc=Hm.height,jf=be.allocAt(0,0,Yd,Gc),ua=Pt.alloc();ua.xi(jf,Vc),be.free(jf);for(var ju=-ua.x,jl=-ua.y,Xa=new be,uc=Ks.length,Xd=0;Xd<uc;Xd++)for(var hc=Ks[Xd],Wm=hc.$l.x,Jd=hc.$l.y,fo=hc.angle,bl=0;4>bl;bl++){switch(bl){case 0:ua.h(ju,jl);break;case 1:ua.h(ju+Yd,jl);break;case 2:ua.h(ju,jl+Gc);break;case 3:ua.h(ju+Yd,jl+Gc)}ua.rotate(fo+Mo.angle),ua.offset(Wm,Jd),Xd===0&&bl===0?Xa.h(ua.x,ua.y,0,0):Xa.Ye(ua),ua.offset(-Wm,-Jd),ua.rotate(-fo-Mo.angle)}Pt.free(ua),Ru.graduatedBounds!==null&&Ru.graduatedBounds.push(Xa),jr(wh,Xa.x,Xa.y,Xa.width,Xa.height)}else if(Mo instanceof Or){var ll=a,Zm=b;ll.temporaryTextBlock===null&&(ll.temporaryTextBlock=new Or);var Sa=ll.temporaryTextBlock;wx(Sa,Mo);var Sh=Mo.alignmentFocus;Sh.Mc()&&(Sh=mr);for(var ul=Mo.segmentOrientation,Qd=Mo.segmentOffset,cc=new be,Tg=0,$d=0,$l=0,Uc=0,fc=0,qd=Ks.length,Ch=0;Ch<qd;Ch++){var wu=Ks[Ch];Tg=wu.$l.x,$d=wu.$l.y,$l=wu.angle,fc=Uc=Mo.angle,ul!==js&&(fc=ul===$p||ul===Jv?$l+Mo.angle:$l,Uc=fi.computeAngle(ul,fc)),Sa.Kb=Uc,Sa.text=wu.text||"",Sa.measure(1/0,1/0,0,0);var kh=Sa.measuredBounds,zu=Sa.naturalBounds,Mh=zu.width,Yc=zu.height,zl=bn.alloc();zl.reset(),zl.translate(-kh.x,-kh.y),zl.scale(Sa.scale,Sa.scale),zl.rotate(fc,Mh/2,Yc/2),ul!==qp&&ul!==eg||zl.rotate(90,Mh/2,Yc/2),ul!==tg&&ul!==ig||zl.rotate(-90,Mh/2,Yc/2),ul===Qv&&(45<$l&&135>$l||225<$l&&315>$l)&&zl.rotate(-$l,Mh/2,Yc/2);var zf=be.allocAt(0,0,Mh,Yc),Eh=Pt.alloc();Eh.xi(zf,Sh),zl.Ga(Eh);var _f=-Eh.x,Zy=-Eh.y,_u=Pt.alloc();_u.assign(Qd),isNaN(_u.x)&&(_u.x=Mh/2+3),isNaN(_u.y)&&(_u.y=-(Yc/2+3)),_u.rotate($l),Tg+=_u.x+_f,$d+=_u.y+Zy;var Xc=new be(Tg,$d,kh.width,kh.height),Lg=new be(kh.x,kh.y,kh.width,kh.height),Ky=new be(zu.x,zu.y,zu.width,zu.height);wu.Sz=Uc,wu.lineCount=Sa.lineCount,wu.lines=[Sa.Cb,Sa.Ih,Sa.df,Sa.Le,Sa.Qc,Sa.Qb,Sa.ze],wu.actualBounds=Xc,wu.measuredBounds=Lg,wu.naturalBounds=Ky,Ch===0?cc.assign(Xc):cc.ed(Xc),Pt.free(_u),Pt.free(Eh),be.free(zf),bn.free(zl)}ll.graduatedBounds!==null&&ll.graduatedBounds.push(cc),jr(Zm,cc.x,cc.y,cc.width,cc.height)}No(Mo,!1)}}},Hp.prototype.arrange=function(a,y,x){if(a.graduatedBounds!==null){var E=a.Pb(),b=a.graduatedMarks;if(b!==null){var z=a.graduatedBounds,tt=0,it=z[tt];tt++,E!==null&&E.arrange(it.x-x.x,it.y-x.y,it.width,it.height);for(var nt=y.length,ot=0;ot<nt;ot++){var st=y[ot];it=b[ot],st.visible&&st!==E&&it.length!==0&&(it=z[tt],tt++,st.arrange(it.x-x.x,it.y-x.y,it.width,it.height))}a.graduatedBounds=null}}},Hp.prototype.gc=function(a,y,x){var E=x.$i;x.$i=!0;var b=a.naturalBounds,z=b.width,tt=b.height;b=y instanceof ga,y.save(),y.beginPath(),y.rect(-1,-1,z+1,tt+1),y.clip(),y.Se(),z=a.Pb(),z.gc(y,x),tt=a.Df()*x.scale,0>=tt&&(tt=1);for(var it=z.actualBounds,nt=a.O.s,ot=a.graduatedMarks,st=nt.length,ut=0;ut<st;ut++){var ct=nt[ut],dt=ot[ut],vt=dt.length;if(ct.visible&&ct!==z&&dt.length!==0){if(ct instanceof Rn){if(!(2>a.graduatedTickUnit*ct.interval*z.geometry.flattenedTotalLength/a.graduatedRange*tt&&ct.graduatedSkip===null)){var xt=ct.measuredBounds,Tt=ct.strokeWidth*ct.scale,Et=ct.alignmentFocus;Et.Mc()&&(Et=mr);for(var Ft=0;Ft<vt;Ft++){var Ot=dt[Ft].$l,Rt=dt[Ft].angle,Ht=Et,ae=ct.Ab;ae.reset(),ae.translate(Ot.x+it.x,Ot.y+it.y),ae.rotate(Rt+ct.angle,0,0),ae.translate(-xt.width*Ht.x+Ht.offsetX+Tt/2,-xt.height*Ht.y+Ht.offsetY+Tt/2),ae.scale(ct.scale,ct.scale),il(ct,!1),ct.wh.set(ct.Ab),ct.Kk=ct.scale,Wa(ct,!1),ct.gc(y,x),b&&(a.svg.appendChild(ct.svg),ct.svg=null),ct.Ab.reset()}}}else if(ct instanceof Or)for(a.temporaryTextBlock===null&&(a.temporaryTextBlock=new Or),xt=a.temporaryTextBlock,wx(xt,ct),Tt=0;Tt<vt;Tt++)Et=dt[Tt],Et.actualBounds&&Et.measuredBounds&&Et.naturalBounds&&(xt.ec=Et.text||"",xt.Kb=Et.Sz||0,xt.Gc=Et.lineCount||0,Ft=Et.lines,Ft!==void 0&&(xt.Cb=Ft[0],xt.Ih=Ft[1],xt.df=Ft[2],xt.Le=Ft[3],xt.Qc=Ft[4],xt.Qb=Ft[5],xt.ze=Ft[6]),Et.naturalBounds&&(xt.dc=Et.naturalBounds),Et.actualBounds&&(Ft=Et.actualBounds,xt.arrange(Ft.x,Ft.y,Ft.width,Ft.height)),Ft=Et.actualBounds,xt.arrange(Ft.x,Ft.y,Ft.width,Ft.height),Ot=Et.measuredBounds,Et=Et.naturalBounds,Rt=xt.Ab,Rt.reset(),Rt.translate(Ft.x+it.x,Ft.y+it.y),Rt.translate(-Ot.x,-Ot.y),xt.no(Rt,Et.x,Et.y,Et.width,Et.height),il(xt,!1),xt.wh.set(xt.Ab),xt.Kk=xt.scale,Wa(xt,!1),xt.Ng=ct.part,xt.Me=ct.panel,xt.gc(y,x),xt.Me=null,xt.Ng=null,b&&(a.svg.appendChild(xt.svg),xt.svg=null))}}x.$i=E,y.restore(),y.Vc(!0)};function si(a,y){if(Kt.call(this),this.na=null,a===void 0)this.na=si.Position;else if(typeof a=="string"){var x=xl.I(a);x!==null&&(this.na=x)}else a instanceof Do?this.na=a:a&&(this.na=si.Position,y=a);this.na===null&&It("Panel type not specified or PanelLayout not loaded: "+a),this.l=this.l|4194304|(this.na===si.Grid?1048576:0),this.O=new Me,this.yb=Vs,this.Tm=Fi,this.Uf=Dn,this.$g=null,this.$e="",this.jg=new be(NaN,NaN,NaN,NaN),this.T=this.F=null,this.xo=Yi,this.jn=Xr,this.kn=gr,this.ub=this.ra=null,this.zn=NaN,this.ge=this.Hh=null,y&&Object.assign(this,y)}Vi(si,Kt),si.prototype.cloneProtected=function(a){Kt.prototype.cloneProtected.call(this,a),a.na=this.na,a.yb=this.yb.J(),a.Tm=this.Tm.J(),a.Uf=this.Uf,a.$e=this.$e,a.jg.assign(this.jg),this.T!==null&&(a.T=this.T.copy(a)),a.xo=this.xo,a.jn=this.jn.J(),a.kn=this.kn.J(),this.ra!==null&&(a.ra=this.ra.copy()),a.ub=this.ub,a.zn=this.zn,a.Hh=this.Hh},si.prototype.Af=function(a){Kt.prototype.Af.call(this,a),a.O=this.O;for(var y=a.O.s,x=y.length,E=0;E<x;E++)y[E].Me=a;a.$g=null},si.prototype.copy=function(){var a=Kt.prototype.copy.call(this);if(a!==null){for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E].copy();b.wi(a),b.Ng=null;var z=a.O,tt=z.count;if(z.Gb(tt,b),z=a.part,z!==null){z.Rh=null,b.portId!==null&&z instanceof Ci&&(z.Te=!0);var it=a.diagram;it!==null&&it.undoManager.isUndoingRedoing||z.cb(xo,"elements",a,null,b,null,tt)}}return a}return null},yt=si.prototype,yt.toString=function(){return"Panel("+this.type.name+")#"+kn(this)},yt.Pn=function(a){Kt.prototype.Pn.call(this,a);for(var y=this.O.s,x=y.length,E=0;E<x;E++)y[E].Pn(a)},yt.hh=function(a,y){if(this.na===si.Grid)a.yc(),this.na.gc(this,a,y);else if(this.na===si.Graduated)a.yc(),this.na.gc(this,a,y);else{if(this.na===si.Table)if(a.yc(),a instanceof ga){var x=a.yd;a.yd=lv(a,"gojs-ts"),g0(this,a),a.nh.pop(),a.yd=x}else g0(this,a);(x=this.isClipping&&this.na===si.Spot)&&a.save();for(var E=this.Pb(),b=this.O.s,z=b.length,tt=0;tt<z;tt++){var it=b[tt];x&&it===E&&(a.clipInsteadOfFill=!0),it.gc(a,y),x&&it===E&&(a.clipInsteadOfFill=!1)}x&&(a.restore(),a.Vc(!0))}};function g0(a,y){y.lineCap="butt";var x=0<a.rowCount?a.rowDefs:null,E=0<a.columnCount?a.colDefs:null;x!==null&&Cv(a,y,!0,x,!0),E!==null&&Cv(a,y,!1,E,!0),x!==null&&sx(a,y,!0,x),E!==null&&sx(a,y,!1,E),x!==null&&Cv(a,y,!0,x,!1),E!==null&&Cv(a,y,!1,E,!1)}function sx(a,y,x,E){for(var b=E.length,z=a.actualBounds,tt=a.naturalBounds,it=!0,nt=0;nt<b;nt++){var ot=E[nt];if(ot!==void 0&&ot.actual!==0)if(it)it=!1;else{if(x){if(ot.position>tt.height)continue}else if(ot.position>tt.width)continue;var st=ot.separatorStrokeWidth;isNaN(st)&&(st=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var ut=ot.separatorStroke;if(ut===null&&(ut=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),st!==0&&ut!==null){uo(a,y,ut,!1,!1,tt,z),ut=!1;var ct=ot.separatorDashArray;ct===null&&(ct=x?a.defaultRowSeparatorDashArray:a.defaultColumnSeparatorDashArray),ct!==null&&(ut=!0,y.js(ct,0)),y.beginPath(),ct=ot.position+st,x?ct>tt.height&&(st-=ct-tt.height):ct>tt.width&&(st-=ct-tt.width),ot=ot.position+st/2,y.lineWidth=st,st=a.yb,x?(ot+=st.top,ct=tt.width-st.right,y.moveTo(st.left,ot),y.lineTo(ct,ot)):(ot+=st.left,ct=tt.height-st.bottom,y.moveTo(ot,st.top),y.lineTo(ot,ct)),y.stroke(),y.Se(),ut&&y.fs()}}}}function Cv(a,y,x,E,b){for(var z=E.length,tt=a.actualBounds,it=a.naturalBounds,nt=ax(a,!0),ot=ax(a,!1),st=0;st<z;st++){var ut=E[st];if(ut!==void 0&&ut.background!==null&&ut.coversSeparators!==b&&ut.actual!==0){var ct=x?tt.height:tt.width;if(!(ut.position>ct)){var dt=ut.Wc(),vt=ut.separatorStrokeWidth;isNaN(vt)&&(vt=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var xt=ut.separatorStroke;xt===null&&(xt=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),(xt===null||ut.index===(x?nt:ot))&&(vt=0),dt-=vt,vt=ut.position+vt,dt+=ut.actual,vt+dt>ct&&(dt=ct-vt),0>=dt||(ct=a.yb,uo(a,y,ut.background,!0,!1,it,tt),x?y.fillRect(ct.left,vt+ct.top,tt.width-(ct.left+ct.right),dt):y.fillRect(vt+ct.left,ct.top,dt,tt.height-(ct.top+ct.bottom)))}}}}function ax(a,y){for(var x=y?a.rowCount:a.columnCount,E=0;E<x;E++){var b=y?a.rowDefs[E]:a.colDefs[E];if(b!==void 0)return b.index}return 0}function v0(a){return a==="LineV"||a==="BarV"}yt.lv=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].lv();this.Uc=!0},yt.kk=function(a,y,x){if(!Kt.prototype.kk.call(this,a,y,x))return!1;if(this.type===si.Table)x=this.svg.getElementsByClassName("gojs-ts"),x=x.length!==0?x[0]:null,x!==null&&(x.innerHTML=""),a.yd=x,g0(this,a),a.yd=null;else if(this.na===si.Grid||this.na===si.Graduated)return this.svg.innerHTML="",this.svg.remove(),!1;x=this.O.s;for(var E=x.length,b=0;b<E;b++)x[b].gc(a,y);return!0},yt.nk=function(){return!0},yt.$o=function(a,y,x,E){if(!this.isClipping)if(this.Dd()&&a.bk!==null){a=a.bk,y=this.O.s;for(var b=0,z=0,tt=0;tt<y.length;tt++)if(y[tt].Ed()){var it=y[tt].actualBounds;b=tt===0?it.x:Math.min(it.x,b),z=tt===0?it.y:Math.min(it.y,z)}E.setAttributeNS(null,"clip-path","path('M "+(a.x-x.x-b)+","+(a.y-x.y-z)+" l "+a.width+" 0 l 0 "+a.height+" l -"+a.width+" 0 z')")}else Kt.prototype.$o.call(this,a,y,x,E)},yt.Sj=function(a,y,x,E,b){var z=this.se(),tt=this.transform,it=1/(tt.m11*tt.m22-tt.m12*tt.m21),nt=tt.m22*it,ot=-tt.m12*it,st=-tt.m21*it,ut=tt.m11*it,ct=it*(tt.m21*tt.dy-tt.m22*tt.dx),dt=it*(tt.m12*tt.dx-tt.m11*tt.dy);if(this.areaBackground!==null)return tt=this.actualBounds,Gt.Ff(tt.left,tt.top,tt.right,tt.bottom,a,y,x,E,b);if(this.background!==null)return z=a*nt+y*st+ct,it=a*ot+y*ut+dt,a=x*nt+E*st+ct,nt=x*ot+E*ut+dt,b.h(0,0),x=this.naturalBounds,z=Gt.Ff(0,0,x.width,x.height,z,it,a,nt,b),b.transform(tt),z;z||(nt=1,st=ot=0,ut=1,dt=ct=0),it=a*nt+y*st+ct,a=a*ot+y*ut+dt,nt=x*nt+E*st+ct,x=x*ot+E*ut+dt,b.h(nt,x),E=(nt-it)*(nt-it)+(x-a)*(x-a),ot=!1,ut=this.O.s,dt=ut.length,st=Pt.alloc(),ct=null,y=1/0;var vt=null,xt=this.isClipping&&this.na===si.Spot;xt&&(vt=Pt.alloc(),ct=this.Pb(),(ot=ct.Sj(it,a,nt,x,vt))&&(y=(it-vt.x)*(it-vt.x)+(a-vt.y)*(a-vt.y)));for(var Tt=0;Tt<dt;Tt++){var Et=ut[Tt];Et.visible&&Et!==ct&&Et.Sj(it,a,nt,x,st)&&(ot=!0,Et=(it-st.x)*(it-st.x)+(a-st.y)*(a-st.y),Et<E&&(E=Et,b.set(st)))}return xt&&(y>E&&b.set(vt),Pt.free(vt)),Pt.free(st),z&&b.transform(tt),ot},yt.Gj=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Gj();Kt.prototype.Gj.call(this)},yt.v=function(a){if(!Ta(this)){Kt.prototype.v.call(this,a),a=null,(this.na===si.Auto||this.na===si.Link)&&(a=this.Pb());for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E];if((b===a||b.isPanelMain)&&b.v(!0),!b.desiredSize.w()){var z=Xs(b,!1);(b instanceof Rs||b instanceof si||b instanceof Or||z!==Qe)&&b.v(!0)}}}},yt.Uj=function(){if(!Ta(this)){No(this,!0),au(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Uj()}},yt.Uk=function(){if(!(this.l&2048)){il(this,!0),Wa(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()}},yt.Wu=function(){Wa(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()},yt.Wl=function(a,y,x,E){var b=this.jg;b.h(0,0,0,0);var z=this.desiredSize,tt=this.minSize;x===void 0&&(x=tt.width,E=tt.height),x=Math.max(x,tt.width),E=Math.max(E,tt.height);var it=this.maxSize;isNaN(z.width)||(a=Math.min(z.width,it.width)),isNaN(z.height)||(y=Math.min(z.height,it.height)),a=Math.max(x,a),y=Math.max(E,y);var nt=this.yb;a=Math.max(a-nt.left-nt.right,0),y=Math.max(y-nt.top-nt.bottom,0);var ot=this.O.s;ot.length!==0&&this.na.measure(this,a,y,ot,b,x,E),a=b.width+nt.left+nt.right,nt=b.height+nt.top+nt.bottom,isFinite(z.width)&&(a=z.width),isFinite(z.height)&&(nt=z.height),a=Math.min(it.width,a),nt=Math.min(it.height,nt),a=Math.max(tt.width,a),nt=Math.max(tt.height,nt),a=Math.max(x,a),nt=Math.max(E,nt),Oo(b,a,nt),Oo(this.naturalBounds,a,nt),this.Ge(0,0,a,nt)},yt.Pb=function(){if(this.$g===null){var a=this.O.s,y=a.length;if(y===0)return null;for(var x=0;x<y;x++){var E=a[x];if(E.isPanelMain===!0)return this.$g=E}this.$g=a[0]}return this.$g};function Du(a){return a.part!==null?a.part.locationObject:null}yt.eh=function(a,y,x,E){var b=this.O.s;if(this.actualBounds.h(a,y,x,E),b.length!==0){if(!this.desiredSize.w()){a=Xs(this,!0);var z=this.measuredBounds;y=z.width,z=z.height;var tt=this.Kg,it=tt.left+tt.right;switch(tt=tt.top+tt.bottom,y===x&&z===E&&(a=Qe),a){case Qe:(y>x||z>E)&&(this.v(),this.measure(y>x?x:y,z>E?E:z,0,0));break;case ri:this.v(!0),this.measure(x+it,E+tt,0,0);break;case $i:this.v(!0),this.measure(x+it,z+tt,0,0);break;case dn:this.v(!0),this.measure(y+it,E+tt,0,0)}}this.na.arrange(this,b,this.jg)}},yt.gh=function(a){var y=this.naturalBounds,x=Du(this);if(Io(0,0,y.width,y.height,a.x,a.y)){y=this.O.s;for(var E=y.length,b=Pt.allocAt(0,0);E--;){var z=y[E];if((z.visible||z===x)&&(Gi(b.set(a),z.transform),z.ca(b)))return Pt.free(b),!0}return Pt.free(b),!(this.Ma===null&&this.areaBackground===null)}return!1},yt.ks=function(a){if(this.bindingId===a)return this;for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E].ks(a);if(b!==null)return b}return null},yt.qm=function(a,y){if(y(this,a),a instanceof si){a=a.O.s;for(var x=a.length,E=0;E<x;E++)this.qm(a[E],y)}};function Oc(a,y){lx(a,a,y)}function lx(a,y,x){x(y),y=y.O.s;for(var E=y.length,b=0;b<E;b++){var z=y[b];z instanceof si&&lx(a,z,x)}}function kw(a,y){ux(a,a,y)}function ux(a,y,x){if(x(y),y instanceof si){y=y.O.s;for(var E=y.length,b=0;b<E;b++)ux(a,y[b],x)}}yt.Nl=function(a){return hx(this,this,a)};function hx(a,y,x){if(x(y))return y;if(y instanceof si){y=y.O.s;for(var E=y.length,b=0;b<E;b++){var z=hx(a,y[b],x);if(z!==null)return z}}return null}yt.fb=function(a){if(this.name===a)return this;var y=this.O.s,x=y.length;this.Hh===null&&this.itemTemplateMap===null||(x=Wp(this));for(var E=0;E<x;E++){var b=y[E];if(b instanceof si){var z=b.fb(a);if(z!==null)return z}if(b.name===a)return b}return null};function cx(a){a=a.O.s;for(var y=a.length,x=0,E=0;E<y;E++){var b=a[E];b instanceof si?x=Math.max(x,cx(b)):b instanceof Rn&&(x=Math.max(x,b.ig/2*b.strokeMiterLimit*b.Df()))}return x}yt.se=function(){return!(this.type===si.TableRow||this.type===si.TableColumn)};function ah(a){return a.type===si.TableRow||a.type===si.TableColumn}yt.ic=function(a,y,x){if(this.pickable===!1||(y===void 0&&(y=null),x===void 0&&(x=null),Os(this)))return null;var E=this.naturalBounds,b=1/this.Df(),z=this.se(),tt=z?a:Gi(Pt.allocAt(a.x,a.y),this.transform),it=this.diagram,nt=10,ot=5;if(it!==null&&(nt=it.Ql("extraTouchArea"),ot=nt/2),Io(-(ot*b),-(ot*b),E.width+nt*b,E.height+nt*b,tt.x,tt.y)){if(!this.isAtomic){b=this.O.s;var st=b.length;if(it=Pt.alloc(),ot=(nt=this.isClipping&&this.na===si.Spot)?this.Pb():null,nt&&(ot.se()?Gi(it.set(a),ot.transform):it.set(a),!ot.ca(it)))return Pt.free(it),z||Pt.free(tt),null;for(var ut=Du(this);st--;){var ct=b[st];if((ct.visible||ct===ut)&&(ct.se()?Gi(it.set(a),ct.transform):it.set(a),!nt||ct!==ot)){var dt=null;if(ct instanceof si?dt=ct.ic(it,y,x):ct.pickable===!0&&ct.ca(it)&&(dt=ct),dt!==null&&(y!==null&&(dt=y(dt)),dt!==null&&(x===null||x(dt))))return Pt.free(it),z||Pt.free(tt),dt}}Pt.free(it)}return this.background===null&&this.areaBackground===null?(z||Pt.free(tt),null):(a=Io(0,0,E.width,E.height,tt.x,tt.y)?this:null,z||Pt.free(tt),a)}return z||Pt.free(tt),null},yt.ji=function(a,y,x,E){if(this.pickable===!1)return!1;y===void 0&&(y=null),x===void 0&&(x=null);var b=this.naturalBounds,z=this.se(),tt=z?a:Gi(Pt.allocAt(a.x,a.y),this.transform);if(b=Io(0,0,b.width,b.height,tt.x,tt.y),ah(this)||b){if(!this.isAtomic){for(var it=this.O.s,nt=it.length,ot=Pt.alloc(),st=Du(this);nt--;){var ut=it[nt];if(ut.visible||ut===st){ut.se()?Gi(ot.set(a),ut.transform):ot.set(a);var ct=ut;ut=ut instanceof si?ut:null,(ut!==null?ut.ji(ot,y,x,E):ct.ca(ot))&&ct.pickable!==!1&&(y!==null&&(ct=y(ct)),ct===null||x!==null&&!x(ct)||E.add(ct))}}Pt.free(ot)}return z||Pt.free(tt),b&&(this.background!==null||this.areaBackground!==null)}return z||Pt.free(tt),!1},yt.Cf=function(a,y,x,E,b,z){if(this.pickable===!1)return!1;y===void 0&&(y=null),x===void 0&&(x=null);var tt=z;if(z===void 0&&(tt=bn.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return m0(this,y,x,b),z===void 0&&bn.free(tt),!0;if(this.Yc(a,tt)){if(!this.isAtomic)for(var it=Du(this),nt=this.O.s,ot=nt.length;ot--;){var st=nt[ot];if(st.visible||st===it){var ut=st.actualBounds,ct=this.naturalBounds;ut.x>ct.width||ut.y>ct.height||0>ut.x+ut.width||0>ut.y+ut.height||(ut=st,st=st instanceof si?st:null,ct=bn.alloc(),ct.set(tt),(st!==null?st.Cf(a,y,x,E,b,ct):Ho(ut,a,E,ct))&&(y!==null&&(ut=y(ut)),ut===null||x!==null&&!x(ut)||b.add(ut)),bn.free(ct))}}return z===void 0&&bn.free(tt),E}return z===void 0&&bn.free(tt),!1};function m0(a,y,x,E){for(var b=a.O.s,z=b.length;z--;){var tt=b[z];if(tt.visible){var it=tt.actualBounds,nt=a.naturalBounds;it.x>nt.width||it.y>nt.height||0>it.x+it.width||0>it.y+it.height||(tt instanceof si&&m0(tt,y,x,E),y!==null&&(tt=y(tt)),tt===null||x!==null&&!x(tt)||E.add(tt))}}}yt.og=function(a,y,x,E,b,z){if(this.pickable===!1)return!1;x===void 0&&(x=null),E===void 0&&(E=null);var tt=this.naturalBounds,it=this.se(),nt=it?a:Gi(Pt.allocAt(a.x,a.y),this.transform),ot=it?y:Gi(Pt.allocAt(y.x,y.y),this.transform),st=nt.Bf(ot),ut=0<nt.x&&nt.x<tt.width&&0<nt.y&&nt.y<tt.height||mn(nt.x,nt.y,0,0,0,tt.height)<=st||mn(nt.x,nt.y,0,tt.height,tt.width,tt.height)<=st||mn(nt.x,nt.y,tt.width,tt.height,tt.width,0)<=st||mn(nt.x,nt.y,tt.width,0,0,0)<=st;if(tt=nt.zd(0,0)<=st&&nt.zd(0,tt.height)<=st&&nt.zd(tt.width,0)<=st&&nt.zd(tt.width,tt.height)<=st,it||(Pt.free(nt),Pt.free(ot)),ut){if(!this.isAtomic){nt=Pt.alloc(),ot=Pt.alloc(),st=Du(this);for(var ct=this.O.s,dt=ct.length;dt--;){var vt=ct[dt];if(vt.visible||vt===st){var xt=vt.actualBounds,Tt=this.naturalBounds;(!it||!(xt.x>Tt.width||xt.y>Tt.height||0>xt.x+xt.width||0>xt.y+xt.height))&&(vt.se()?(xt=vt.transform,Gi(nt.set(a),xt),Gi(ot.set(y),xt)):(nt.set(a),ot.set(y)),xt=vt,vt=vt instanceof si?vt:null,(vt!==null?vt.og(nt,ot,x,E,b,z):xt.tx(nt,ot,b))&&(x!==null&&(xt=x(xt)),xt===null||E!==null&&!E(xt)||z.add(xt)))}}Pt.free(nt),Pt.free(ot)}return b?ut:tt}return!1};function y0(a){var y=null;return a instanceof Rn&&(y=a.spot1,y===Fi&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot1)),y===null&&(y=qn),y}function x0(a){var y=null;return a instanceof Rn&&(y=a.spot2,y===Fi&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot2)),y===null&&(y=vo),y}yt.add=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];for(x=0;x<y.length;x++)this.Gb(this.O.count,y[x]);return this},yt.M=function(a){return this.O.M(a)},yt.Gb=function(a,y){y instanceof tn&&It("Cannot add a Part to a Panel: "+y+"; use a Panel instead"),(this===y||this.rg(y))&&(this===y&&It("Cannot make a Panel contain itself: "+this.toString()),It("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+y.toString()));var x=y.panel;if(x!==null&&x!==this&&It("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+y.toString()+", already contained by "+x.toString()+", cannot be shared by this Panel: "+this.toString()),this.na!==si.Grid||y instanceof Rn||It("Can only add Shapes to a Grid Panel, not: "+y),this.na!==si.Graduated||y instanceof Rn||y instanceof Or||It("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+y),y.wi(this),y.Ng=null,this.itemArray!==null){var E=y.data;E!==null&&typeof E=="object"&&(this.ge===null&&(this.ge=new ji),this.ge.add(E,y))}var b=this.O;if(E=-1,x===this){for(var z=-1,tt=this.O.s,it=tt.length,nt=0;nt<it;nt++)if(tt[nt]===y){z=nt;break}if(z!==-1){if(z===a||z+1>=b.count&&a>=b.count)return;b.mb(z),E=z}else It("element "+y.toString()+" has panel "+x.toString()+" but is not contained by it.")}(0>a||a>b.count)&&(a=b.count),b.Gb(a,y),(a===0||y.isPanelMain)&&(this.$g=null),Ta(this)||this.v(),y.v(!1),y.portId!==null?this.Te=!0:y instanceof si&&y.Te===!0&&(this.Te=!0),this.graduatedIntervals=null,this.If()||Mv(this,y,!1),x=this.part,x!==null&&(x.Rh=null,x.ag=NaN,this.Te&&x instanceof Ci&&(x.Te=!0),x.Te&&x instanceof Ci&&(x.wc=null),b=this.diagram,b!==null&&b.undoManager.isUndoingRedoing||(E!==-1&&x.cb(Ao,"elements",this,y,null,E,null),x.cb(xo,"elements",this,null,y,null,a)))};function w0(a,y){a.l=y?a.l|16777216:a.l&-16777217}yt.remove=function(a){for(var y=this.O.s,x=y.length,E=-1,b=0;b<x;b++)if(y[b]===a){E=b;break}E!==-1&&this.pc(E,!0)},yt.mb=function(a){0<=a&&this.pc(a,!0)},yt.pc=function(a,y){var x=this.O,E=x.M(a);if(E.Ng=null,E.wi(null),this.ge!==null){var b=E.data;typeof b=="object"&&this.ge.remove(b)}x.mb(a),No(this,!1),this.v(),this.$g===E&&(this.$g=null),this.graduatedIntervals=null;var z=this.part;z!==null&&(z.Rh=null,z.ag=NaN,z.Wb(),z instanceof Ci&&(E instanceof si?E.qm(E,function(tt,it){Z0(z,it,y)}):Z0(z,E,y)),x=this.diagram,x!==null&&x.undoManager.isUndoingRedoing||z.cb(Ao,"elements",this,E,null,a,null))},yt.Fb=function(a){0>a&&xi(a,">= 0",si,"getRowDefinition:idx"),a=Math.round(a);var y=this.rowDefs;if(y[a]===void 0){var x=new To;x.wi(this),x.isRow=!0,x.index=a,y[a]=x,this.cb(xo,"rowdefs",this,null,x,null,a)}return y[a]},yt.oA=function(a){if(0>a&&xi(a,">= 0",si,"removeRowDefinition:idx"),this.rowCount!==0){a=Math.round(a);var y=this.rowDefs,x=y[a];if(x){y[a]=void 0;for(var E=y.length-1;0<=E&&y[E--]===void 0;)y.length--;this.cb(Ao,"rowdefs",this,x,null,a,null),this.v()}}};function fx(a,y,x){var E=a.rowDefs;if(!(0>y)){if(E[y]=x instanceof To?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}yt.Eb=function(a){0>a&&xi(a,">= 0",si,"getColumnDefinition:idx"),a=Math.round(a);var y=this.colDefs;if(y[a]===void 0){var x=new To;x.wi(this),x.isRow=!1,x.index=a,y[a]=x,this.cb(xo,"coldefs",this,null,x,null,a)}return y[a]},yt.jA=function(a){if(0>a&&xi(a,">= 0",si,"removeColumnDefinition:idx"),this.columnCount!==0){a=Math.round(a);var y=this.colDefs,x=y[a];if(x){y[a]=void 0;for(var E=y.length-1;0<=E&&y[E--]===void 0;)y.length--;this.cb(Ao,"coldefs",this,x,null,a,null),this.v()}}};function dx(a,y,x){var E=a.colDefs;if(!(0>y)){if(E[y]=x instanceof To?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}yt.Gy=function(a){var y=null;return a.isRow?y=this.Fb(a.index):a.isRow||(y=this.Eb(a.index)),y&&Ev(y,a),this},yt.Hy=function(a,y){return(a=this.Fb(a))&&Ev(a,new To(y)),this},yt.By=function(a,y){return(a=this.Eb(a))&&Ev(a,new To(y)),this},yt.nz=function(a){if(0>a||this.type!==si.Table||this.rowCount===0)return-1;for(var y=0,x=this.rowDefs,E=x.length,b=this.topIndex;b<E;b++){var z=x[b];if(z!==void 0&&(y+=z.total,a<y))break}return b},yt.fz=function(a){if(0>a||this.type!==si.Table||this.columnCount===0)return-1;for(var y=0,x=this.colDefs,E=x.length,b=this.leftIndex;b<E;b++){var z=x[b];if(z!==void 0&&(y+=z.total,a<y))break}return b},yt.Fz=function(a,y){if(y===void 0&&(y=new Pt(NaN,NaN)),this.type!==si.Graduated)return y.h(NaN,NaN),y;a=Math.min(Math.max(a,this.graduatedMin),this.graduatedMax);var x=this.Pb();return x.geometry.Pu((a-this.graduatedMin)/this.graduatedRange,y),x.transform.Ga(y)},yt.Gz=function(a){if(this.type!==si.Graduated)return NaN;var y=this.Pb();return y.transform.Cd(a),y.geometry.xx(a)*this.graduatedRange+this.graduatedMin};function px(a){return a=a.allBindings,a!==null&&a._isFrozen}function rl(a){var y=a.allBindings;if(y===null)a.data!==null&&It("Template cannot have .data be non-null: "+a),a.allBindings=y=new Me;else if(y._isFrozen)return;var x=new Me;w0(a,!1),a.qm(a,function(ot,st){st.th();var ut=st.localBindings;if(ut!==null)for(wf(st,!1),ut=ut.iterator;ut.next();){var ct=ut.value;ct.mode===hg&&wf(st,!0);var dt=ct.sourceName;dt!==null&&(dt==="/"&&w0(ot,!0),dt=N1(ct,ot,st),dt!==null&&(x.add(dt),dt.srcBindings===null&&(dt.srcBindings=new Me),dt.srcBindings.add(ct))),y.add(ct)}if(st instanceof si&&st.type===si.Table){if(0<st.rowCount){for(ot=st.rowDefs,ut=ot.length,ct=0;ct<ut;ct++)if(dt=ot[ct],dt!==void 0&&dt.be!==null)for(var vt=dt.be.iterator;vt.next();){var xt=vt.value;xt.xd=dt,xt.to=2,xt.wl=dt.index,y.add(xt)}}if(0<st.columnCount){for(st=st.colDefs,ot=st.length,ut=0;ut<ot;ut++)if(ct=st[ut],ct!==void 0&&ct.be!==null)for(dt=ct.be.iterator;dt.next();)vt=dt.value,vt.xd=ct,vt.to=1,vt.wl=ct.index,y.add(vt)}}});for(var E=x.iterator;E.next();){var b=E.value;if(b.srcBindings!==null){wf(b,!0);for(var z=b.srcBindings.iterator;z.next();){var tt=z.value;b.localBindings===null&&(b.localBindings=new Me),b.localBindings.add(tt)}}b.srcBindings=null}for(E=y.iterator;E.next();)if(b=E.value,z=b.xd,z!==null){b.xd=null;var it=b.targetProperty,nt=it.indexOf(".");0<nt&&z instanceof si&&(tt=it.substring(0,nt),it=it.substr(nt+1),nt=z.fb(tt),nt!==null?(z=nt,b.targetProperty=it):Di('Warning: unable to find GraphObject named "'+tt+'" for Binding: '+b.toString())),z instanceof To?(tt=kn(z.panel),b.Ai=tt===void 0?-1:tt,z.panel.bindingId=b.Ai):z instanceof Kt?(tt=kn(z),b.Ai=tt===void 0?-1:tt,z.bindingId=b.Ai):It("Unknown type of binding target: "+z)}y.freeze(),a instanceof tn&&a.Zc()&&a.Va()}yt.Uy=function(a){a===void 0&&(a=!1);var y=this.copy();return kw(y,function(x){x instanceof si&&(x.allBindings=null,x.ub=null);var E=x.localBindings;E!==null&&(x.localBindings=null,E.each(function(b){x.bind(b.copy())})),E=x.animationTriggers,E!==null&&(x.animationTriggers=null,E.each(function(b){x.Jv(b.value.copy())}))}),a&&rl(y),y},yt.La=function(a){var y=this.allBindings;if(y!==null)for(a===void 0&&(a=""),y=y.iterator;y.next();){var x=y.value,E=x.sourceProperty;if((a===""||E===""||E===a)&&(E=x.targetProperty,x.converter!==null||E!=="")){E=this.data;var b=x.sourceName;if(b!==null){if(b==="")E=this;else if(b==="/")E=this;else if(b===".")E=this;else if(b==="..")E=this;else if(E=this.fb(b),E===null)continue}else if(x.isToModel)if(E=this.diagram,E!==null)E=E.model.modelData;else continue;var z=this,tt=x.Ai;if(tt!==-1){if(z=this.ks(tt),z===null)continue}else x.xd!==null&&(z=x.xd);if(b==="/"?E=z.part:b==="."?E=z:b===".."&&(E=z.panel),b=x.to,b!==0){if(!(z instanceof si))continue;b===1?z=z.Eb(x.wl):b===2&&(z=z.Fb(x.wl))}z!==void 0&&x.Mv(z,E)}}},yt.sx=function(a){return a==null||this.ge===null?null:this.ge.I(a)};function Mw(a,y){a=a.O.s;for(var x=a.length,E=y.length,b=0,z=null;b<x&&(z=a[b],!(z instanceof si&&z.data!==null));)b++,z=a[b];if(x-b!==E)return!0;if(z===null)return 0<E;for(var tt=0;b<x&&tt<E;){if(z=a[b],!(z instanceof si)||z.data!==y[tt])return!0;b++,tt++}return!1}function Wp(a){if(a.type===si.Spot||a.type===si.Auto)return Math.min(a.O.length,1);if(a.type===si.Link){a=a.O;for(var y=a.length,x=0;x<y;x++){var E=a.M(x);if(!(E instanceof Rn&&E.isPanelMain))break}return x}return a.type===si.Table&&0<a.O.length&&(a=a.O.M(0),a.isPanelMain&&a instanceof si&&ah(a))?1:0}yt.mv=function(){for(var a=Wp(this);this.O.length>a;)this.pc(this.O.length-1,!1);gx(this,this.itemArray)};function gx(a,y){var x=Wp(a);if(y===null||y.length===0)for(;a.O.length>x;)a.pc(a.O.length-1,!1);else if(a.O.length<=x){x=y.length;for(var E=0;E<x;E++)kv(a,y[E],E,!0)}else{E=x;for(var b=0;b<y.length;b++,E++){var z=y[b],tt=E<a.O.length?a.O.M(E):null;if(tt instanceof si){if(tt.data!==z){var it=C0(a,tt.data),nt=C0(a,z),ot=nt!==it;ot||(it=k0(a,it),ot=k0(a,nt)!==it),ot?(a.pc(E,!1),kv(a,z,b,!1)):tt.data=z}}else kv(a,z,b,!1)}for(;E<a.O.length;)a.pc(E,!1);a.$g=null,S0(a,x,0),Ta(a)||a.v(),a.graduatedIntervals=null,a.If()||Mv(a,a,!1),y=a.part,y!==null&&(y.Rh=null,y.ag=NaN,a.Te&&y instanceof Ci&&(y.Te=!0),y.Te&&y instanceof Ci&&(y.wc=null))}}function kv(a,y,x,E){if(!(y==null||0>x)){var b=C0(a,y);if(b=k0(a,b),b!==null){if(rl(b),b=b.copy(),b.l&16777216){var z=a.ih();z!==null&&w0(z,!0)}typeof y=="object"&&(a.ge===null&&(a.ge=new ji),a.ge.add(y,b)),z=x+Wp(a),a.Gb(z,b),E&&(b.ub=y,S0(a,z,x),b.ub=null),b.data=y}}}function S0(a,y,x){for(a=a.O;y<a.length;){var E=a.M(y);if(E instanceof si){var b=y,z=x;E.type===si.TableRow?E.row=b:E.type===si.TableColumn&&(E.column=b),E.itemIndex=z}y++,x++}}function C0(a,y){if(y===null)return"";if(a=a.itemCategoryProperty,typeof a=="function")a=a(y);else if(typeof a=="string"&&typeof y=="object"){if(a==="")return"";a=mo(y,a)}else return"";if(a===void 0)return"";if(typeof a=="string")return a;It("Panel.getCategoryForItemData found a non-string category for "+y+": "+a)}function k0(a,y){var x=a.itemTemplateMap,E=null;return x!==null&&(E=x.I(y)),E===null&&(x!==null&&(E=x.I("")),E===null&&(vx||(vx=!0,Di('No item template Panel found for category "'+y+'" on '+a),Di(" Using default item template."),a=new si,y=new Or,y.bind(new Co("text","",ki)),a.add(y),mx=a),E=mx)),E}function Mv(a,y,x){var E=y.enabledChanged;if(E!==null&&E(y,x),y instanceof si){y=y.O.s,E=y.length;for(var b=0;b<E;b++){var z=y[b];x&&z instanceof si&&!z.isEnabled||Mv(a,z,x)}}}function Ul(a,y){y.name=a,xl.add(a,y)}zi.Object.defineProperties(si.prototype,{type:{get:function(){return this.na},set:function(a){var y=this.na;y!==a&&(this.na=a,this.isAtomic=this.na===si.Grid,this.v(),this.g("type",y,a))}},elements:{get:function(){return this.O.iterator}},naturalBounds:{get:function(){return this.dc}},padding:{get:function(){return this.yb},set:function(a){typeof a=="number"?(0>a&&xi(a,">= 0",si,"padding"),a=new jn(a)):(0>a.left&&xi(a.left,">= 0",si,"padding:value.left"),0>a.right&&xi(a.right,">= 0",si,"padding:value.right"),0>a.top&&xi(a.top,">= 0",si,"padding:value.top"),0>a.bottom&&xi(a.bottom,">= 0",si,"padding:value.bottom"));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.v(),this.g("padding",y,a))}},defaultAlignment:{get:function(){return this.Tm},set:function(a){var y=this.Tm;y.D(a)||(this.Tm=a=a.J(),this.v(),this.g("defaultAlignment",y,a))}},defaultStretch:{get:function(){return this.Uf},set:function(a){var y=this.Uf;y!==a&&(this.Uf=a,this.v(),this.g("defaultStretch",y,a))}},defaultSeparatorPadding:{get:function(){return this.T!==null?this.T.Qp:Vs},set:function(a){typeof a=="number"&&(a=new jn(a));var y=this.defaultSeparatorPadding;y.D(a)||(a=a.J(),this.T===null&&(this.T=new Va),this.T.Qp=a,this.v(),this.g("defaultSeparatorPadding",y,a))}},defaultRowSeparatorStroke:{get:function(){return this.T!==null?this.T.ia:null},set:function(a){var y=this.defaultRowSeparatorStroke;y!==a&&(a===null||typeof a=="string"||a instanceof kr)&&(a instanceof kr&&a.freeze(),this.T===null&&(this.T=new Va),this.T.ia=a,this.N(),this.g("defaultRowSeparatorStroke",y,a))}},defaultRowSeparatorStrokeWidth:{get:function(){return this.T!==null?this.T.Ha:1},set:function(a){var y=this.defaultRowSeparatorStrokeWidth;y!==a&&isFinite(a)&&0<=a&&(this.T===null&&(this.T=new Va),this.T.Ha=a,this.v(),this.g("defaultRowSeparatorStrokeWidth",y,a))}},defaultRowSeparatorDashArray:{get:function(){return this.T!==null?this.T.V:null},set:function(a){var y=this.defaultRowSeparatorDashArray;if(y!==a){if(a!==null){for(var x=a.length,E=0,b=0;b<x;b++){var z=a[b];typeof z=="number"&&0<=z&&isFinite(z)||It("defaultRowSeparatorDashArray value "+z+" at index "+b+" must be a positive number or zero."),E+=z}if(E===0){if(y===null)return;a=null}}this.T===null&&(this.T=new Va),this.T.V=a,this.N(),this.g("defaultRowSeparatorDashArray",y,a)}}},defaultColumnSeparatorStroke:{get:function(){return this.T!==null?this.T.u:null},set:function(a){var y=this.defaultColumnSeparatorStroke;y!==a&&(a===null||typeof a=="string"||a instanceof kr)&&(a instanceof kr&&a.freeze(),this.T===null&&(this.T=new Va),this.T.u=a,this.N(),this.g("defaultColumnSeparatorStroke",y,a))}},defaultColumnSeparatorStrokeWidth:{get:function(){return this.T!==null?this.T.F:1},set:function(a){var y=this.defaultColumnSeparatorStrokeWidth;y!==a&&isFinite(a)&&0<=a&&(this.T===null&&(this.T=new Va),this.T.F=a,this.v(),this.g("defaultColumnSeparatorStrokeWidth",y,a))}},defaultColumnSeparatorDashArray:{get:function(){return this.T!==null?this.T.o:null},set:function(a){var y=this.defaultColumnSeparatorDashArray;if(y!==a){if(a!==null){for(var x=a.length,E=0,b=0;b<x;b++){var z=a[b];typeof z=="number"&&0<=z&&isFinite(z)||It("defaultColumnSeparatorDashArray value "+z+" at index "+b+" must be a positive number or zero."),E+=z}if(E===0){if(y===null)return;a=null}}this.T===null&&(this.T=new Va),this.T.o=a,this.N(),this.g("defaultColumnSeparatorDashArray",y,a)}}},inRowsCols:{get:function(){return this.T!==null?this.T.nb:null},set:function(a){this.T===null&&(this.T=new Va),this.T.nb=a}},viewboxStretch:{get:function(){return this.xo},set:function(a){var y=this.xo;y!==a&&(this.xo=a,this.v(),this.g("viewboxStretch",y,a))}},gridCellSize:{get:function(){return this.jn},set:function(a){var y=this.jn;if(!y.D(a)){a.w()&&a.width!==0&&a.height!==0||It("Invalid Panel.gridCellSize: "+a),this.jn=a.J();var x=this.diagram;x!==null&&this===x.grid&&Kl(x),this.N(),this.g("gridCellSize",y,a)}}},gridOrigin:{get:function(){return this.kn},set:function(a){var y=this.kn;if(!y.D(a)){a.w()||It("Invalid Panel.gridOrigin: "+a),this.kn=a.J();var x=this.diagram;x!==null&&this===x.grid&&Kl(x),this.N(),this.g("gridOrigin",y,a)}}},graduatedMin:{get:function(){return this.ra!==null?this.ra.lq:0},set:function(a){var y=this.graduatedMin;y!==a&&(this.ra===null&&(this.ra=new Fu),this.ra.lq=a,this.v(),this.g("graduatedMin",y,a),ss(this)&&(a=this.part,a!==null&&Zr(this,a,"graduatedRange")))}},graduatedMax:{get:function(){return this.ra!==null?this.ra.F:100},set:function(a){var y=this.graduatedMax;y!==a&&(this.ra===null&&(this.ra=new Fu),this.ra.F=a,this.v(),this.g("graduatedMax",y,a),ss(this)&&(a=this.part,a!==null&&Zr(this,a,"graduatedRange")))}},graduatedRange:{get:function(){return this.graduatedMax-this.graduatedMin}},graduatedTickUnit:{get:function(){return this.ra!==null?this.ra.ia:10},set:function(a){var y=this.graduatedTickUnit;y!==a&&0<a&&(this.ra===null&&(this.ra=new Fu),this.ra.ia=a,this.v(),this.g("graduatedTickUnit",y,a))}},graduatedTickBase:{get:function(){return this.ra!==null?this.ra.V:0},set:function(a){var y=this.graduatedTickBase;y!==a&&(this.ra===null&&(this.ra=new Fu),this.ra.V=a,this.v(),this.g("graduatedTickBase",y,a))}},graduatedMarks:{get:function(){return this.ra!==null?this.ra.u:null},set:function(a){this.ra!==null?this.ra.u=a:a!==null&&(this.ra=new Fu,this.ra.u=a)}},graduatedBounds:{get:function(){return this.ra!==null?this.ra.j:null},set:function(a){this.ra!==null?this.ra.j=a:a!==null&&(this.ra=new Fu,this.ra.j=a)}},graduatedIntervals:{get:function(){return this.ra!==null?this.ra.o:null},set:function(a){this.ra!==null?this.ra.o=a:a!==null&&(this.ra=new Fu,this.ra.o=a)}},temporaryTextBlock:{get:function(){return this.ra!==null?this.ra.Zh:null},set:function(a){this.ra!==null?this.ra.Zh=a:a!==null&&(this.ra=new Fu,this.ra.Zh=a)}},panelLayoutState:{get:function(){return this.F},set:function(a){this.F=a}},Te:{get:function(){return(this.l&8388608)!==0},set:function(a){(this.l&8388608)!==0!==a&&(this.l^=8388608)}},rowDefs:{get:function(){return this.T===null&&(this.T=new Va),this.T.Pc}},rowCount:{get:function(){return this.T===null?0:this.rowDefs.length}},colDefs:{get:function(){return this.T===null&&(this.T=new Va),this.T.Oc}},columnCount:{get:function(){return this.T===null?0:this.colDefs.length}},rowSizing:{get:function(){return this.T!==null?this.T.ob:Pv},set:function(a){var y=this.rowSizing;y!==a&&(this.T===null&&(this.T=new Va),this.T.ob=a,this.v(),this.g("rowSizing",y,a))}},columnSizing:{get:function(){return this.T!==null?this.T.j:Pv},set:function(a){var y=this.columnSizing;y!==a&&(this.T===null&&(this.T=new Va),this.T.j=a,this.v(),this.g("columnSizing",y,a))}},topIndex:{get:function(){return this.T!==null?this.T.Hb:0},set:function(a){var y=this.topIndex;y!==a&&((!isFinite(a)||0>a)&&It("Panel.topIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new Va),this.T.Hb=a,this.v(),this.g("topIndex",y,a))}},leftIndex:{get:function(){return this.T!==null?this.T.hb:0},set:function(a){var y=this.leftIndex;y!==a&&((!isFinite(a)||0>a)&&It("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new Va),this.T.hb=a,this.v(),this.g("leftIndex",y,a))}},data:{get:function(){return this.ub},set:function(a){var y=this.ub;if(y!==a){var x=this instanceof tn&&!(this instanceof cr);rl(this),this.ub=a;var E=this.diagram;E!==null&&(x?(x=E.partManager,this instanceof fi?(y!==null&&x.bf.remove(y),a!==null&&x.bf.add(a,this)):this instanceof tn&&(y!==null&&x.cf.remove(y),a!==null&&x.cf.add(a,this))):(x=this.panel,x!==null&&x.ge!==null&&(y!==null&&x.ge.remove(y),a!==null&&x.ge.add(a,this)))),this.g("data",y,a),E!==null&&E.undoManager.isUndoingRedoing||a!==null&&this.La()}}},itemIndex:{get:function(){return this.zn},set:function(a){var y=this.zn;y!==a&&(this.zn=a,this.g("itemIndex",y,a))}},allBindings:{get:function(){return this.A!==null?this.A.nb:null},set:function(a){this.localBindings!==a&&(this.A===null&&(this.A=new Sf),this.A.nb=a)}},itemArray:{get:function(){return this.Hh},set:function(a){var y=this.Hh;if(y!==a||a!==null&&Mw(this,a)){var x=this.diagram;y!==a&&(x!==null&&y!==null&&uy(x.partManager,this,x),this.Hh=a,x!==null&&a!==null&&ly(x.partManager,this)),this.g("itemArray",y,a),x!==null&&x.undoManager.isUndoingRedoing||gx(this,a)}}},itemTemplate:{get:function(){return this.itemTemplateMap===null?null:this.itemTemplateMap.I("")},set:function(a){if(this.itemTemplateMap===null){if(a===null)return;this.itemTemplateMap=new ji}var y=this.itemTemplateMap.I("");y!==a&&((a instanceof tn||a.isPanelMain)&&It("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.itemTemplateMap.add("",a),this.g("itemTemplate",y,a),a=this.diagram,a!==null&&a.undoManager.isUndoingRedoing||this.mv())}},itemTemplateMap:{get:function(){return this.A!==null?this.A.Pc:null},set:function(a){var y=this.itemTemplateMap;if(y!==a){for(var x=a.iterator;x.next(););_n(this),this.A.Pc=a,this.g("itemTemplateMap",y,a),a=this.diagram,a!==null&&a.undoManager.isUndoingRedoing||this.mv()}}},itemCategoryProperty:{get:function(){return this.A!==null?this.A.Oc:"category"},set:function(a){var y=this.itemCategoryProperty;y!==a&&(_n(this),this.A.Oc=a,this.g("itemCategoryProperty",y,a))}},isAtomic:{get:function(){return(this.l&1048576)!==0},set:function(a){var y=(this.l&1048576)!==0;y!==a&&(this.l^=1048576,this.g("isAtomic",y,a))}},isClipping:{get:function(){return(this.l&2097152)!==0},set:function(a){var y=(this.l&2097152)!==0;y!==a&&(this.l^=2097152,this instanceof An&&(this.tb=null),this.v(),this.g("isClipping",y,a))}},isOpposite:{get:function(){return(this.l&33554432)!==0},set:function(a){var y=(this.l&33554432)!==0;y!==a&&(this.l^=33554432,this.v(),this.g("isOpposite",y,a))}},isEnabled:{get:function(){return(this.l&4194304)!==0},set:function(a){var y=(this.l&4194304)!==0;if(y!==a){var x=this.panel===null||this.panel.If();this.l^=4194304,this.g("isEnabled",y,a),y=this.diagram,y!==null&&y.undoManager.isUndoingRedoing||x&&Mv(this,this,a)}}},alignmentFocusName:{get:function(){return this.$e},set:function(a){var y=this.$e;y!==a&&(this.$e=a,this.v(),this.g("alignmentFocusName",y,a))}}}),zi.Object.defineProperties(si,{Position:{get:function(){return xl.I("Position")}},Horizontal:{get:function(){return xl.I("Horizontal")}},Vertical:{get:function(){return xl.I("Vertical")}},Spot:{get:function(){return xl.I("Spot")}},Auto:{get:function(){return xl.I("Auto")}},Table:{get:function(){return xl.I("Table")}},Viewbox:{get:function(){return xl.I("Viewbox")}},TableRow:{get:function(){return xl.I("TableRow")}},TableColumn:{get:function(){return xl.I("TableColumn")}},Link:{get:function(){return xl.I("Link")}},Grid:{get:function(){return xl.I("Grid")}},Graduated:{get:function(){return xl.I("Graduated")}}}),si.prototype.rebuildItemElements=si.prototype.mv,si.prototype.findItemPanelForData=si.prototype.sx,si.prototype.updateTargetBindings=si.prototype.La,si.prototype.copyTemplate=si.prototype.Uy,si.prototype.graduatedValueForPoint=si.prototype.Gz,si.prototype.graduatedPointForValue=si.prototype.Fz,si.prototype.findColumnForLocalX=si.prototype.fz,si.prototype.findRowForLocalY=si.prototype.nz,si.prototype.addColumnDefinition=si.prototype.By,si.prototype.addRowDefinition=si.prototype.Hy,si.prototype.addRowColumnDefinition=si.prototype.Gy,si.prototype.removeColumnDefinition=si.prototype.jA,si.prototype.getColumnDefinition=si.prototype.Eb,si.prototype.removeRowDefinition=si.prototype.oA,si.prototype.getRowDefinition=si.prototype.Fb,si.prototype.removeAt=si.prototype.mb,si.prototype.remove=si.prototype.remove,si.prototype.insertAt=si.prototype.Gb,si.prototype.elt=si.prototype.M,si.prototype.add=si.prototype.add,si.prototype.findObject=si.prototype.fb,si.prototype.findInVisualTree=si.prototype.Nl,si.prototype.walkVisualTreeFrom=si.prototype.qm,si.prototype.findMainElement=si.prototype.Pb;var vx=!1,mx=null,xl=new ji;si.className="Panel",si.definePanelLayout=Ul,Ul("Position",new cv),Ul("Vertical",new dv),Ul("Auto",new gv),Ul("Link",new Sv);function Fu(){this.lq=0,this.F=100,this.ia=10,this.V=0,this.Zh=this.o=this.j=this.u=null}Fu.prototype.copy=function(){var a=new Fu;return a.lq=this.lq,a.F=this.F,a.ia=this.ia,a.V=this.V,a.u=this.u,a.j=this.j,a.o=this.o,a.Zh=this.Zh,a},Fu.className="GradPanelSettings";function Va(){this.Pc=[],this.Oc=[],this.j=this.ob=Pv,this.hb=this.Hb=0,this.Qp=Vs,this.Ha=1,this.V=this.ia=null,this.F=1,this.nb=this.o=this.u=null}Va.prototype.copy=function(a){for(var y=new Va,x=this.Pc,E=x.length,b=y.Pc,z=0;z<E;z++)if(x[z]!==void 0){var tt=x[z].copy();tt.wi(a),b[z]=tt}for(x=this.Oc,E=x.length,b=y.Oc,z=0;z<E;z++)x[z]!==void 0&&(tt=x[z].copy(),tt.wi(a),b[z]=tt);return y.ob=this.ob,y.j=this.j,y.Hb=this.Hb,y.hb=this.hb,y.Qp=this.Qp.J(),y.Ha=this.Ha,y.ia=this.ia,y.V=this.V,y.F=this.F,y.u=this.u,y.o=this.o,y.nb=this.nb,y},Va.className="TablePanelSettings";function To(a){bi(this),this.Me=null,this.uq=!0,this.Za=0,this.Hc=NaN,this.jj=0,this.hj=1/0,this.Jb=Fi,this.pa=this.oc=this.oa=0,this.be=null,this.oo=M0,this.hg=Dn,this.lo=this.dg=null,this.mo=NaN,this.Ma=this.tj=null,this.Pm=!1,a&&(Object.assign(this,a),a.column!==void 0?(this.isRow=!1,this.index=a.column):a.row!==void 0&&(this.isRow=!0,this.index=a.row))}To.prototype.copy=function(){var a=new To;return a.uq=this.uq,a.Za=this.Za,a.Hc=this.Hc,a.jj=this.jj,a.hj=this.hj,a.Jb=this.Jb,a.oa=this.oa,a.oc=this.oc,a.pa=this.pa,a.hg=this.hg,a.oo=this.oo,this.dg===null?a.dg=null:a.dg=this.dg.J(),a.lo=this.lo,a.mo=this.mo,a.tj=null,this.tj!==null&&(a.separatorDashArray=rn(this.separatorDashArray)),a.Ma=this.Ma,a.Pm=this.Pm,a.be=this.be,a};function Ev(a,y){y.isRow?a.height=y.height:a.width=y.width,a.minimum=y.minimum,a.maximum=y.maximum,a.alignment=y.alignment,a.stretch=y.stretch,a.sizing=y.sizing,a.dg=y.separatorPadding===null?null:y.separatorPadding.J(),a.separatorStroke=y.separatorStroke,a.separatorStrokeWidth=y.separatorStrokeWidth,a.tj=null,y.separatorDashArray&&(a.tj=rn(y.separatorDashArray)),a.background=y.background,a.coversSeparators=y.coversSeparators,a.be=y.be}yt=To.prototype,yt.qb=function(a){a.classType===To&&(this.sizing=a)},yt.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+kn(this)},yt.wi=function(a){this.Me=a},yt.Io=function(a){var y=0,x=this.Me;if(this.index!==a&&(a=this.separatorStroke,a===null&&x!==null&&(a=this.isRow?x.defaultRowSeparatorStroke:x.defaultColumnSeparatorStroke),a!==null&&(y=this.separatorStrokeWidth,isNaN(y)&&(x!==null?y=this.isRow?x.defaultRowSeparatorStrokeWidth:x.defaultColumnSeparatorStrokeWidth:y=0))),a=this.dg,a===null)if(x!==null)a=x.defaultSeparatorPadding;else return y;return y+(this.isRow?a.top:a.left)},yt.Wc=function(){var a=0,y=this.Me,x=0,E=this.isRow;if(y!==null&&y.type===si.Table)for(var b=E?y.rowDefs.length:y.colDefs.length,z=0;z<b;z++){var tt=E?y.rowDefs[z]:y.colDefs[z];if(tt!==void 0&&tt.oa!==0){x=tt.index;break}}if(this.index!==x&&(x=this.separatorStroke,x===null&&y!==null&&(x=E?y.defaultRowSeparatorStroke:y.defaultColumnSeparatorStroke),x!==null&&(a=this.separatorStrokeWidth,isNaN(a)&&(y!==null?a=E?y.defaultRowSeparatorStrokeWidth:y.defaultColumnSeparatorStrokeWidth:a=0))),E=this.dg,E===null)if(y!==null)E=y.defaultSeparatorPadding;else return a;return a+(this.isRow?E.top+E.bottom:E.left+E.right)},yt.Ob=function(a,y,x){var E=this.Me;if(E!==null&&(E.cb(Yr,a,this,y,x,void 0,void 0),this.be!==null&&(y=E.diagram,y!==null&&!y.skipsModelSourceBindings&&(E=E.ih(),E!==null&&(y=E.data,y!==null)))))for(x=this.be.iterator;x.next();)x.value.sp(this,y,a,E)};function bv(a){if(a.sizing===M0){var y=a.Me;return a.isRow?y.rowSizing:y.columnSizing}return a.sizing}yt.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new Co(a,y,x,E):b=a,b.xd=this,a=this.panel,a!==null&&(y=a.ih(),y!==null&&px(y)&&It("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+b+" on "+a)),this.be===null&&(this.be=new Me),this.be.add(b),this},zi.Object.defineProperties(To.prototype,{panel:{get:function(){return this.Me}},isRow:{get:function(){return this.uq},set:function(a){this.uq=a}},index:{get:function(){return this.Za},set:function(a){this.Za=a}},height:{get:function(){return this.Hc},set:function(a){var y=this.Hc;y!==a&&(0>a&&xi(a,">= 0",To,"height"),this.Hc=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("height",y,a))}},width:{get:function(){return this.Hc},set:function(a){var y=this.Hc;y!==a&&(0>a&&xi(a,">= 0",To,"width"),this.Hc=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("width",y,a))}},minimum:{get:function(){return this.jj},set:function(a){var y=this.jj;y!==a&&((0>a||!isFinite(a))&&xi(a,">= 0",To,"minimum"),this.jj=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("minimum",y,a))}},maximum:{get:function(){return this.hj},set:function(a){var y=this.hj;y!==a&&(0>a&&xi(a,">= 0",To,"maximum"),this.hj=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("maximum",y,a))}},alignment:{get:function(){return this.Jb},set:function(a){var y=this.Jb;y.D(a)||(this.Jb=a.J(),this.panel!==null&&this.panel.v(),this.Ob("alignment",y,a))}},stretch:{get:function(){return this.hg},set:function(a){var y=this.hg;y!==a&&(this.hg=a,this.panel!==null&&this.panel.v(),this.Ob("stretch",y,a))}},separatorPadding:{get:function(){return this.dg},set:function(a){typeof a=="number"&&(a=new jn(a));var y=this.dg;a!==null&&y!==null&&y.D(a)||(a!==null&&(a=a.J()),this.dg=a,this.panel!==null&&this.panel.v(),this.Ob("separatorPadding",y,a))}},separatorStroke:{get:function(){return this.lo},set:function(a){var y=this.lo;y!==a&&(a!==null&&kf(a,"RowColumnDefinition.separatorStroke"),a instanceof kr&&a.freeze(),this.lo=a,this.panel!==null&&this.panel.v(),this.Ob("separatorStroke",y,a))}},separatorStrokeWidth:{get:function(){return this.mo},set:function(a){var y=this.mo;y!==a&&(this.mo=a,this.panel!==null&&this.panel.v(),this.Ob("separatorStrokeWidth",y,a))}},separatorDashArray:{get:function(){return this.tj},set:function(a){var y=this.tj;if(y!==a){if(a!==null){for(var x=a.length,E=0,b=0;b<x;b++){var z=a[b];typeof z=="number"&&0<=z&&isFinite(z)||It("separatorDashArray value "+z+" at index "+b+" must be a positive number or zero."),E+=z}if(E===0){if(y===null)return;a=null}}this.tj=a,this.panel!==null&&this.panel.N(),this.Ob("separatorDashArray",y,a)}}},background:{get:function(){return this.Ma},set:function(a){var y=this.Ma;y!==a&&(a!==null&&kf(a,"RowColumnDefinition.background"),a instanceof kr&&a.freeze(),this.Ma=a,this.panel!==null&&this.panel.N(),this.Ob("background",y,a))}},coversSeparators:{get:function(){return this.Pm},set:function(a){var y=this.Pm;y!==a&&(this.Pm=a,this.panel!==null&&this.panel.N(),this.Ob("coversSeparators",y,a))}},sizing:{get:function(){return this.oo},set:function(a){var y=this.oo;y!==a&&(this.oo=a,this.panel!==null&&this.panel.v(),this.Ob("sizing",y,a))}},actual:{get:function(){return this.oa},set:function(a){this.oa=isNaN(this.Hc)?Math.max(Math.min(this.hj,a),this.jj):Math.max(Math.min(this.hj,this.Hc),this.jj)}},measured:{get:function(){return this.oc},set:function(a){this.oc=a}},total:{get:function(){return this.oa+this.Wc()}},position:{get:function(){return this.pa},set:function(a){this.pa=a}}}),To.prototype.computeEffectiveSpacing=To.prototype.Wc,To.prototype.computeEffectiveSpacingTop=To.prototype.Io;var M0=new ze(To,"Default",0),Zp=new ze(To,"None",1),Pv=new ze(To,"ProportionalExtra",2);To.className="RowColumnDefinition",To.Default=M0,To.None=Zp,To.ProportionalExtra=Pv;function Rn(a,y){Kt.call(this),this.Rd=this.ua=null,this.an="None",this.xc=this.Ui="black",this.ig=1,this.Na=this.Yg=null,this.Vn=this.Un=NaN,this.fa=null,typeof a=="string"?this.figure=a:a&&Object.assign(this,a),y&&Object.assign(this,y)}Vi(Rn,Kt),Rn.prototype.cloneProtected=function(a){Kt.prototype.cloneProtected.call(this,a),a.ua=this.ua,a.Rd=this.Rd,a.an=this.an,a.Ui=this.Ui,a.xc=this.xc,a.ig=this.ig,this.Yg!==null&&(a.Yg=rn(this.Yg)),this.Na!==null&&(a.Na=this.Na.nc?this.Na:this.Na.copy()),a.Un=this.Un,a.Vn=this.Vn,this.fa!==null&&(a.fa=this.fa.copy())};function Ic(a){a.Na===null?a.Na=new P0:a.Na.nc&&(a.Na=a.Na.copy())}yt=Rn.prototype,yt.th=function(){Kt.prototype.th.call(this),this.Na!==null&&(this.Na.nc=!0)},yt.qb=function(a){a===Qe||a===Yi||a===tr||a===Dn?this.geometryStretch=a:Kt.prototype.qb.call(this,a)},yt.toString=function(){return"Shape("+(this.figure!=="None"?this.figure:this.toArrow!=="None"?this.toArrow:this.fromArrow)+")#"+kn(this)};function Cd(a,y,x,E){var b=x.length;if(!(4>b)){var z=E.measuredBounds,tt=Math.max(1,z.width);z=z.height;for(var it=x[0],nt=x[1],ot,st,ut,ct,dt,vt,xt=0,Tt=ii(),Et=2;Et<b;Et+=2)ot=x[Et],st=x[Et+1],ut=ot-it,it=st-nt,ut===0&&(ut=.001),ct=it/ut,dt=Math.atan2(it,ut),vt=Math.sqrt(ut*ut+it*it),Tt.push([ut,dt,ct,vt]),xt+=vt,it=ot,nt=st;it=x[0],nt=x[1],ut=E.measuredBounds.width,E instanceof Rn&&(ut-=E.strokeWidth),1>ut&&(ut=1),b=x=ut,ot=tt/2,st=ot!==0,Et=0,vt=Tt[Et],ut=vt[0],dt=vt[1],ct=vt[2],vt=vt[3];for(var Ft=0;.1<=xt;){if(Ft===0&&(st?(b=x,b-=ot,xt-=ot,st=!1):b=x,b===0&&(b=1)),b>xt){Hi(Tt);return}b>vt?(Ft=b-vt,b=vt):Ft=0;var Ot=Math.sqrt(b*b/(1+ct*ct));if(0>ut&&(Ot=-Ot),it+=Ot,nt+=ct*Ot,a.translate(it,nt),a.rotate(dt),a.translate(-(tt/2),-(z/2)),Ft===0&&E.hh(a,y),a.translate(tt/2,z/2),a.rotate(-dt),a.translate(-it,-nt),xt-=b,vt-=b,Ft!==0){if(Et++,Et===Tt.length){Hi(Tt);return}vt=Tt[Et],ut=vt[0],dt=vt[1],ct=vt[2],vt=vt[3],b=Ft}}Hi(Tt)}}yt.hh=function(a,y){var x=this.xc,E=this.Ui;if(x!==null||E!==null){var b=this.ua;if(b!==null){a.yc();var z=this.actualBounds,tt=this.naturalBounds;E!==null&&uo(this,a,E,!0,!1,tt,z);var it=this.part,nt=this.ig;if(x===null||nt!==0||it===null||!this.isPanelMain&&it.Pb()!==this||(nt=it.type===si.Link&&it instanceof cr&&it.category==="Selection"&&it.adornedObject instanceof Rn&&it.adornedPart.Pb()===it.adornedObject?it.adornedObject.strokeWidth:0),nt===0&&(x=null),x!==null&&nt!==0&&(uo(this,a,x,!1,!1,tt,z),a.lineWidth=nt,a.lineJoin=this.strokeJoin,a.lineCap=this.strokeCap,a.miterLimit=this.strokeMiterLimit),z=!1,it&&y.Gf("drawShadows")&&(z=it.isShadowed),a.Il===!1&&(z=!1),it=!0,x===null||E!==null&&E!=="transparent"||(it=!1),tt=!1,nt=this.strokeDashArray,nt!==null&&(tt=!0,a.js(nt,this.strokeDashOffset)),b.type===ci.j)a.beginPath(),a.moveTo(b.startX,b.startY),a.lineTo(b.endX,b.endY),x!==null&&a.jk(),a.Se();else if(b.type===ci.u){var ot=b.startX;nt=b.startY;var st=b.endX,ut=b.endY;b=Math.min(ot,st);var ct=Math.min(nt,ut);ot=Math.abs(st-ot),nt=Math.abs(ut-nt),a.beginPath(),a.rect(b,ct,ot,nt),E!==null&&a.ng(E),x!==null&&(it&&z&&lu(a),a.jk(),it&&z&&Tu(a)),a.Se()}else if(b.type===ci.F)ot=b.startX,nt=b.startY,st=b.endX,ut=b.endY,b=Math.abs(st-ot)/2,ct=Math.abs(ut-nt)/2,ot=Math.min(ot,st)+b,nt=Math.min(nt,ut)+ct,a.beginPath(),a.moveTo(ot,nt-ct),a.bezierCurveTo(ot+Gt.wg*b,nt-ct,ot+b,nt-Gt.wg*ct,ot+b,nt),a.bezierCurveTo(ot+b,nt+Gt.wg*ct,ot+Gt.wg*b,nt+ct,ot,nt+ct),a.bezierCurveTo(ot-Gt.wg*b,nt+ct,ot-b,nt+Gt.wg*ct,ot-b,nt),a.bezierCurveTo(ot-b,nt-Gt.wg*ct,ot-Gt.wg*b,nt-ct,ot,nt-ct),a.closePath(),E!==null&&a.ng(E),x!==null&&(it&&z&&lu(a),a.jk(),it&&z&&Tu(a)),a.Se();else if(b.type===ci.o)for(b=b.figures,nt=b.length,ct=0;ct<nt;ct++){ot=b.s[ct],a.beginPath(),a.moveTo(ot.startX,ot.startY),st=ot.segments.s,ut=st.length;for(var dt=null,vt=0;vt<ut;vt++){var xt=st[vt];switch(xt.type){case _o:a.moveTo(xt.endX,xt.endY);break;case _r:a.lineTo(xt.endX,xt.endY);break;case as:a.bezierCurveTo(xt.point1X,xt.point1Y,xt.point2X,xt.point2Y,xt.endX,xt.endY);break;case Ea:a.quadraticCurveTo(xt.point1X,xt.point1Y,xt.endX,xt.endY);break;case Eo:if(xt.radiusX===xt.radiusY){var Tt=Math.PI/180;a.arc(xt.point1X,xt.point1Y,xt.radiusX,xt.startAngle*Tt,(xt.startAngle+xt.sweepAngle)*Tt,0>xt.sweepAngle,dt!==null?dt.endX:ot.startX,dt!==null?dt.endY:ot.startY)}else if(dt=fa(xt,ot),Tt=dt.length,Tt===0)a.lineTo(xt.centerX,xt.centerY);else for(var Et=0;Et<Tt;Et++){var Ft=dt[Et];Et===0&&a.lineTo(Ft[0],Ft[1]),a.bezierCurveTo(Ft[2],Ft[3],Ft[4],Ft[5],Ft[6],Ft[7])}break;case Ra:if(Et=Tt=0,dt!==null&&dt.type===Eo){if(dt=fa(dt,ot),Ft=dt.length,Ft===0){a.lineTo(xt.endX,xt.endY);break}dt=dt[Ft-1]||null,dt!==null&&(Tt=dt[6],Et=dt[7])}else Tt=dt!==null?dt.endX:ot.startX,Et=dt!==null?dt.endY:ot.startY;if(dt=$a(xt,ot,Tt,Et),Tt=dt.length,Tt===0){a.lineTo(xt.endX,xt.endY);break}for(Et=0;Et<Tt;Et++)Ft=dt[Et],a.bezierCurveTo(Ft[2],Ft[3],Ft[4],Ft[5],Ft[6],Ft[7]);break;default:It("Segment not of valid type: "+xt.type)}xt.isClosed&&a.closePath(),dt=xt}st=ot.isFilled,z?ot.isShadowed?(st===!0&&E!=="transparent"&&E!==null&&a.ng(E,ot.isEvenOdd),x!==null&&(st&&it&&lu(a),a.jk(),st&&it&&Tu(a))):(lu(a),st&&E!=="transparent"&&E!==null&&a.ng(E,ot.isEvenOdd),x!==null&&a.jk(),Tu(a)):(st&&E!==null&&a.ng(E,ot.isEvenOdd),x!==null&&a.jk()),a.Se(ct)}if(tt&&a.fs(),this.pathPattern!==null){if(x=this.pathPattern,x.measure(1/0,1/0),E=x.measuredBounds,x.arrange(0,0,E.width,E.height),z=this.geometry,a.save(),a.beginPath(),E=ii(),z.type===ci.j)E.push(z.startX),E.push(z.startY),E.push(z.endX),E.push(z.endY),Cd(a,y,E,x);else if(z.type===ci.o)for(z=z.figures.iterator;z.next();){for(it=z.value,E.length=0,E.push(it.startX),E.push(it.startY),tt=it.startX,b=it.startY,nt=tt,ct=b,ot=it.segments.s,st=ot.length,ut=0;ut<st;ut++){switch(vt=ot[ut],vt.type){case _o:Cd(a,y,E,x),E.length=0,E.push(vt.endX),E.push(vt.endY),tt=vt.endX,b=vt.endY,nt=tt,ct=b;break;case _r:E.push(vt.endX),E.push(vt.endY),tt=vt.endX,b=vt.endY;break;case as:Gt.Qe(tt,b,vt.point1X,vt.point1Y,vt.point2X,vt.point2Y,vt.endX,vt.endY,.5,E),tt=vt.endX,b=vt.endY;break;case Ea:Gt.ep(tt,b,vt.point1X,vt.point1Y,vt.endX,vt.endY,.5,E),tt=vt.endX,b=vt.endY;break;case Eo:if(xt=fa(vt,it),dt=xt.length,dt===0){E.push(vt.centerX),E.push(vt.centerY),tt=vt.centerX,b=vt.centerY;break}for(Tt=0;Tt<dt;Tt++)Et=xt[Tt],Gt.Qe(tt,b,Et[2],Et[3],Et[4],Et[5],Et[6],Et[7],.5,E),tt=Et[6],b=Et[7];break;case Ra:if(xt=$a(vt,it,tt,b),dt=xt.length,dt===0){E.push(vt.endX),E.push(vt.endY),tt=vt.endX,b=vt.endY;break}for(Tt=0;Tt<dt;Tt++)Et=xt[Tt],Gt.Qe(tt,b,Et[2],Et[3],Et[4],Et[5],Et[6],Et[7],.5,E),tt=Et[6],b=Et[7];break;default:It("Segment not of valid type: "+vt.type)}vt.isClosed&&(E.push(nt),E.push(ct),Cd(a,y,E,x))}Cd(a,y,E,x)}else if(z.type===ci.u)E.push(z.startX),E.push(z.startY),E.push(z.endX),E.push(z.startY),E.push(z.endX),E.push(z.endY),E.push(z.startX),E.push(z.endY),E.push(z.startX),E.push(z.startY),Cd(a,y,E,x);else if(z.type===ci.F){if(b=new zo,b.startX=z.endX,b.startY=(z.startY+z.endY)/2,tt=new pr(Eo),tt.startAngle=0,tt.sweepAngle=360,tt.centerX=(z.startX+z.endX)/2,tt.centerY=(z.startY+z.endY)/2,tt.radiusX=Math.abs(z.startX-z.endX)/2,tt.radiusY=Math.abs(z.startY-z.endY)/2,b.add(tt),z=fa(tt,b),it=z.length,it===0)E.push(tt.centerX),E.push(tt.centerY);else for(tt=b.startX,b=b.startY,nt=0;nt<it;nt++)ct=z[nt],Gt.Qe(tt,b,ct[2],ct[3],ct[4],ct[5],ct[6],ct[7],.5,E),tt=ct[6],b=ct[7];Cd(a,y,E,x)}Hi(E),a.restore(),a.Vc(!1)}}}},yt.kk=function(a,y,x){return!Kt.prototype.kk.call(this,a,y,x)||this.xc===null&&this.Ui===null||this.ua===null||this.pathPattern!==null||this.geometry.figures.length!==this.svg.getElementsByTagName("path").length?!1:(a.Hl=this.svg,this.hh(a,y),a.Hl=null,!0)},yt.nk=function(a){return this.geometry!==null&&1<this.geometry.figures.length||this.pathPattern!==null?!0:Kt.prototype.nk.call(this,a)},yt.Dv=function(a,y){if(a.nodeName!=="g")a.setAttributeNS(null,"filter",y);else{a=a.getElementsByTagName("path");for(var x=0;x<a.length;x++)a[x].setAttributeNS(null,"filter",y)}},yt.ga=function(a,y){if(y===void 0&&(y=new Pt),a instanceof nn){a.Mc()&&It("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var x=this.naturalBounds,E=this.strokeWidth;y.h(a.x*(x.width+E)-E/2+x.x+a.offsetX,a.y*(x.height+E)-E/2+x.y+a.offsetY)}else y.set(a);return this.oe.Ga(y),y},yt.mi=function(a){a===void 0&&(a=new be);var y=this.naturalBounds,x=this.oe;y=be.allocAt(y.x,y.y,y.width,y.height);var E=this.strokeWidth;return y.Bc(E/2,E/2),E=Pt.allocAt(y.x,y.y).transform(x),a.h(E.x,E.y,0,0),E.h(y.right,y.y).transform(x),jr(a,E.x,E.y,0,0),E.h(y.right,y.bottom).transform(x),jr(a,E.x,E.y,0,0),E.h(y.x,y.bottom).transform(x),jr(a,E.x,E.y,0,0),be.free(y),Pt.free(E),a},yt.gh=function(a,y){var x=this.geometry;if(x===null||this.fill===null&&this.stroke===null)return!1;var E=x.bounds,b=this.strokeWidth/2;x.type!==ci.j||y||(b+=2);var z=be.alloc();if(z.assign(E),z.Bc(b+2,b+2),!z.ca(a))return be.free(z),!1;if(E=b+1e-4,x.type===ci.j)return this.stroke===null||(E=(x.endX-x.startX)*(a.x-x.startX)+(x.endY-x.startY)*(a.y-x.startY),0>(x.startX-x.endX)*(a.x-x.endX)+(x.startY-x.endY)*(a.y-x.endY)||0>E)?!1:(be.free(z),Gt.Yb(x.startX,x.startY,x.endX,x.endY,b,a.x,a.y));if(x.type===ci.u){y=x.startX;var tt=x.startY,it=x.endX;if(x=x.endY,z.x=Math.min(y,it),z.y=Math.min(tt,x),z.width=Math.abs(it-y),z.height=Math.abs(x-tt),this.fill===null){if(z.Bc(-E,-E),z.ca(a))return be.free(z),!1;z.Bc(E,E)}return this.stroke!==null&&z.Bc(b,b),a=z.ca(a),be.free(z),a}if(x.type===ci.F){tt=x.startX,b=x.startY,it=x.endX;var nt=x.endY;if(x=Math.min(tt,it),y=Math.min(b,nt),tt=Math.abs(it-tt)/2,b=Math.abs(nt-b)/2,x=a.x-(x+tt),y=a.y-(y+b),this.fill===null){if(tt-=E,b-=E,0>=tt||0>=b||1>=x*x/(tt*tt)+y*y/(b*b))return be.free(z),!1;tt+=E,b+=E}return this.stroke!==null&&(tt+=E,b+=E),be.free(z),0>=tt||0>=b?!1:1>=x*x/(tt*tt)+y*y/(b*b)}if(x.type===ci.o)return be.free(z),this.fill===null?Nl(x,a.x,a.y,b):Ma(x,a,b,1<this.strokeWidth,y);It("Unknown Geometry type: "+x.type)},yt.Wl=function(a,y,x,E){var b=this.desiredSize,z=this.ig;if(a=Math.max(a,0),y=Math.max(y,0),this.Rd!==null)var tt=this.geometry.bounds;else{var it=this.figure,nt=b0[it];if(nt===void 0){var ot=Gt.Ze[it];typeof ot=="string"&&(ot=Gt.Ze[ot]),typeof ot=="function"?(nt=ot(null,100,100),b0[it]=nt):It("Unsupported Figure: "+it)}tt=nt.bounds}it=tt.width,nt=tt.height,ot=tt.width;var st=tt.height;switch(Xs(this,!0)){case Qe:E=x=0;break;case ri:ot=Math.max(a-z,0),st=Math.max(y-z,0);break;case $i:ot=Math.max(a-z,0),E=0;break;case dn:x=0,st=Math.max(y-z,0)}isFinite(b.width)&&(ot=b.width),isFinite(b.height)&&(st=b.height);var ut=this.maxSize,ct=this.minSize;switch(x=Math.max(x-z,ct.width),E=Math.max(E-z,ct.height),ot=Math.min(ut.width,ot),st=Math.min(ut.height,st),ot=isFinite(ot)?Math.max(x,ot):Math.max(it,x),st=isFinite(st)?Math.max(E,st):Math.max(nt,E),x=E0(this),x){case Qe:break;case ri:it=ot,nt=st;break;case Yi:x=Math.min(ot/it,st/nt),isFinite(x)||(x=1),it*=x,nt*=x;break;default:It(x+" is not a valid geometryStretch.")}this.Rd!==null?(it===0&&(it=.001),nt===0&&(nt=.001),x=this.Rd!==null?this.Rd:this.ua,tt=x.bounds,E=it/tt.width,tt=nt/tt.height,isFinite(E)||(E=1),isFinite(tt)||(tt=1),this.ua=E===1&&tt===1?x:x.copy().scale(E,tt)):this.ua!==null&&Gt.$(this.ua.Sk,a-z)&&Gt.$(this.ua.Rk,y-z)||(this.ua=Rn.makeGeometry(this,it,nt)),tt=this.ua.bounds,a===1/0||y===1/0?this.Ge(tt.x-z/2,tt.y-z/2,a===0&&it===0?0:tt.width+z,y===0&&nt===0?0:tt.height+z):this.Ge(-(z/2),-(z/2),ot+z,st+z),b.w()?(ot=b.width,st=b.height,ot=Math.min(ut.width,ot),st=Math.min(ut.height,st),ot=Math.max(ct.width,ot),st=Math.max(ct.height,st),this.dc.h(0,0,ot,st)):this.dc.assign(tt)};function E0(a){var y=a.geometryStretch;return a.Rd!==null?y===Dn?ri:y:y===Dn?b0[a.figure].defaultStretch:y}yt.eh=function(a,y,x,E){ks(this,a,y,x,E)},yt.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},yt.Sj=function(a,y,x,E,b){var z=this.transform,tt=1/(z.m11*z.m22-z.m12*z.m21),it=z.m22*tt,nt=-z.m12*tt,ot=-z.m21*tt,st=z.m11*tt,ut=tt*(z.m21*z.dy-z.m22*z.dx),ct=tt*(z.m12*z.dx-z.m11*z.dy);z=a*it+y*ot+ut,tt=a*nt+y*st+ct,it=x*it+E*ot+ut,nt=x*nt+E*st+ct,ut=this.ig/2,ot=this.ua,ot===null&&(this.measure(1/0,1/0),ot=this.ua);var dt=ot.bounds;if(st=!1,ot.type===ci.j)if(1.5>=this.strokeWidth)st=Gt.Ve(ot.startX,ot.startY,ot.endX,ot.endY,z,tt,it,nt,b);else{if(ot.startX===ot.endX?(E=ut,st=0):(y=(ot.endY-ot.startY)/(ot.endX-ot.startX),st=ut/Math.sqrt(1+y*y),E=st*y),y=ii(),a=new Pt,Gt.Ve(ot.startX+E,ot.startY+st,ot.endX+E,ot.endY+st,z,tt,it,nt,a)&&y.push(a),a=new Pt,Gt.Ve(ot.startX-E,ot.startY-st,ot.endX-E,ot.endY-st,z,tt,it,nt,a)&&y.push(a),a=new Pt,Gt.Ve(ot.startX+E,ot.startY+st,ot.startX-E,ot.startY-st,z,tt,it,nt,a)&&y.push(a),a=new Pt,Gt.Ve(ot.endX+E,ot.endY+st,ot.endX-E,ot.endY-st,z,tt,it,nt,a)&&y.push(a),it=y.length,it===0)return Hi(y),!1;for(st=!0,nt=1/0,E=0;E<it;E++)a=y[E],x=(a.x-z)*(a.x-z)+(a.y-tt)*(a.y-tt),x<nt&&(nt=x,b.x=a.x,b.y=a.y);Hi(y)}else if(ot.type===ci.u)st=Gt.Ff(dt.x-ut,dt.y-ut,dt.x+dt.width+ut,dt.y+dt.height+ut,z,tt,it,nt,b);else if(ot.type===ci.F){y=be.allocAt(dt.x,dt.y,dt.width,dt.height).Bc(ut,ut);t:if(y.width===0)st=Gt.Ve(y.x,y.y,y.x,y.y+y.height,z,tt,it,nt,b);else if(y.height===0)st=Gt.Ve(y.x,y.y,y.x+y.width,y.y,z,tt,it,nt,b);else{if(a=y.width/2,ot=y.height/2,E=y.x+a,st=y.y+ot,x=9999,z!==it&&(x=(tt-nt)/(z-it)),9999>Math.abs(x)){if(nt=tt-st-x*(z-E),0>a*a*x*x+ot*ot-nt*nt){b.x=NaN,b.y=NaN,st=!1;break t}ut=Math.sqrt(a*a*x*x+ot*ot-nt*nt),it=(-(a*a*x*nt)+a*ot*ut)/(ot*ot+a*a*x*x)+E,a=(-(a*a*x*nt)-a*ot*ut)/(ot*ot+a*a*x*x)+E,ot=x*(it-E)+nt+st,nt=x*(a-E)+nt+st,Math.abs((z-it)*(z-it))+Math.abs((tt-ot)*(tt-ot))<Math.abs((z-a)*(z-a))+Math.abs((tt-nt)*(tt-nt))?(b.x=it,b.y=ot):(b.x=a,b.y=nt)}else{if(it=ot*ot,nt=z-E,it-=it/(a*a)*nt*nt,0>it){b.x=NaN,b.y=NaN,st=!1;break t}nt=Math.sqrt(it),it=st+nt,nt=st-nt,Math.abs(it-tt)<Math.abs(nt-tt)?(b.x=z,b.y=it):(b.x=z,b.y=nt)}st=!0}be.free(y)}else if(ot.type===ci.o){ct=Pt.alloc();var vt=it-z,xt=nt-tt,Tt=vt*vt+xt*xt,Et=z,Ft=tt;if(0<Tt&&dt.contains(Et,Ft)&&(ct.x=Et,ct.y=Ft,this.ca(ct)))for(vt!==0&&.5>Math.abs(vt)?(xt*=.5/vt,vt=.5):xt!==0&&.5>Math.abs(xt)&&(vt*=.5/xt,xt=.5),Et-=vt,Ft-=xt;dt.contains(Et,Ft);)Et-=vt,Ft-=xt;for(b.x=it,b.y=nt,xt=0;xt<ot.figures.count;xt++){var Ot=ot.figures.s[xt],Rt=Ot.isFilled?Et:z,Ht=Ot.isFilled?Ft:tt,ae=Ot.segments;dt=Ot.startX,vt=Ot.startY;for(var wi=dt,Ki=vt,Ii=0;Ii<ae.count;Ii++){var hi=ae.s[Ii],Ue=hi.type,Ln=hi.endX,wn=hi.endY,vr=!1;switch(Ue){case _o:wi=Ln,Ki=wn;break;case _r:vr=Tv(dt,vt,Ln,wn,Rt,Ht,it,nt,ct);break;case as:vr=Gt.Eo(dt,vt,hi.point1X,hi.point1Y,hi.point2X,hi.point2Y,Ln,wn,Rt,Ht,it,nt,.6,ct);break;case Ea:vr=Gt.Eo(dt,vt,dt+2/3*(hi.point1X-dt),vt+2/3*(hi.point1Y-vt),Ln+2/3*(hi.point1X-Ln),wn+2/3*(hi.point1Y-wn),Ln,wn,Rt,Ht,it,nt,.6,ct);break;case Eo:case Ra:Ue=hi.type===Eo?fa(hi,Ot):$a(hi,Ot,dt,vt);var Br=Ue.length;if(Br===0){vr=Tv(dt,vt,hi.type===Eo?hi.centerX:hi.endX,hi.type===Eo?hi.centerY:hi.endY,Rt,Ht,it,nt,ct);break}for(wn=null,Ln=0;Ln<Br;Ln++){if(wn=Ue[Ln],Ln===0&&Tv(dt,vt,wn[0],wn[1],Rt,Ht,it,nt,ct)){var Wo=Nv(Rt,Ht,ct,Tt,b);Wo<Tt&&(Tt=Wo,st=!0)}Gt.Eo(wn[0],wn[1],wn[2],wn[3],wn[4],wn[5],wn[6],wn[7],Rt,Ht,it,nt,.6,ct)&&(Wo=Nv(Rt,Ht,ct,Tt,b),Wo<Tt&&(Tt=Wo,st=!0))}Ln=wn[6],wn=wn[7];break;default:It("Unknown Segment type: "+Ue)}dt=Ln,vt=wn,vr&&(vr=Nv(Rt,Ht,ct,Tt,b),vr<Tt&&(Tt=vr,st=!0)),hi.isClosed&&(Ln=wi,wn=Ki,Tv(dt,vt,Ln,wn,Rt,Ht,it,nt,ct)&&(hi=Nv(Rt,Ht,ct,Tt,b),hi<Tt&&(Tt=hi,st=!0)))}}z=x-a,tt=E-y,it=Math.sqrt(z*z+tt*tt),it!==0&&(z/=it,tt/=it),b.x-=z*ut,b.y-=tt*ut,Pt.free(ct)}else It("Unknown Geometry type: "+ot.type);return st?(this.transform.Ga(b),!0):!1};function Nv(a,y,x,E,b){return a=x.x-a,y=x.y-y,y=a*a+y*y,y<E?(b.x=x.x,b.y=x.y,y):E}function Tv(a,y,x,E,b,z,tt,it,nt){if(Gt.$(a,x)&&Gt.$(y,E)||Gt.$(b,tt)&&Gt.$(z,it))return!1;var ot=!1,st=(b-tt)*(y-E)-(z-it)*(a-x);return st===0?!1:(nt.x=((b*it-z*tt)*(a-x)-(b-tt)*(a*E-y*x))/st,nt.y=((b*it-z*tt)*(y-E)-(z-it)*(a*E-y*x))/st,(a>x?a-x:x-a)<(y>E?y-E:E-y)?(a=y<E?y:E,y=y<E?E:y,(nt.y>a||Gt.$(nt.y,a))&&(nt.y<y||Gt.$(nt.y,y))&&(ot=!0)):(y=a<x?a:x,a=a<x?x:a,(nt.x>y||Gt.$(nt.x,y))&&(nt.x<a||Gt.$(nt.x,a))&&(ot=!0)),ot)}yt.fh=function(a,y){if(y===void 0)return a.Re(this.actualBounds);var x=this.ua;x===null&&(this.measure(1/0,1/0),x=this.ua),x=x.bounds;var E=this.strokeWidth/2,b=!1,z=Pt.alloc();return z.h(x.x-E,x.y-E),a.ca(y.Ga(z))&&(z.h(x.x-E,x.bottom+E),a.ca(y.Ga(z))&&(z.h(x.right+E,x.bottom+E),a.ca(y.Ga(z))&&(z.h(x.right+E,x.y-E),a.ca(y.Ga(z))&&(b=!0)))),Pt.free(z),b},yt.Yc=function(a,y){if(this.fh(a,y)||y===void 0&&(y=this.transform,a.Re(this.actualBounds)))return!0;var x=bn.alloc();x.set(y),x.Vj();var E=a.left,b=a.right,z=a.top;a=a.bottom;var tt=Pt.alloc();if(tt.h(E,z),x.Ga(tt),this.gh(tt,!0)||(tt.h(b,z),x.Ga(tt),this.gh(tt,!0))||(tt.h(E,a),x.Ga(tt),this.gh(tt,!0))||(tt.h(b,a),x.Ga(tt),this.gh(tt,!0)))return Pt.free(tt),!0;var it=Pt.alloc(),nt=Pt.alloc();return x.set(y),x.bv(this.transform),x.Vj(),it.x=b,it.y=z,it.transform(x),tt.x=E,tt.y=z,tt.transform(x),y=!1,Rc(this,tt,it,nt)?y=!0:(tt.x=b,tt.y=a,tt.transform(x),Rc(this,tt,it,nt)?y=!0:(it.x=E,it.y=a,it.transform(x),Rc(this,tt,it,nt)?y=!0:(tt.x=E,tt.y=z,tt.transform(x),Rc(this,tt,it,nt)&&(y=!0)))),Pt.free(tt),bn.free(x),Pt.free(it),Pt.free(nt),y};function Rc(a,y,x,E){if(!a.rs(y,x,E))return!1;a=y.x,y=y.y;var b=x.x,z=x.y;return x=E.x,E=E.y,a===b?(y<z?(a=y,y=z):a=z,E>=a&&E<=y):(a<b?(E=a,a=b):E=b,x>=E&&x<=a)}yt.tx=function(a,y,x){function E(Tt,Et){for(var Ft=Tt.length,Ot=0;Ot<Ft;Ot+=2)if(Et.zd(Tt[Ot],Tt[Ot+1])>b)return!0;return!1}if(x&&this.fill!==null&&this.gh(a,!0))return!0;var b=a.Bf(y),z=b;if(1.5<this.strokeWidth&&(b=this.strokeWidth/2+Math.sqrt(b),b*=b),y=this.ua,y===null&&(this.measure(1/0,1/0),y=this.ua,y===null))return!1;if(!x){var tt=y.bounds,it=tt.x,nt=tt.y,ot=tt.x+tt.width;if(tt=tt.y+tt.height,Kn(a.x,a.y,it,nt)<=b&&Kn(a.x,a.y,ot,nt)<=b&&Kn(a.x,a.y,it,tt)<=b&&Kn(a.x,a.y,ot,tt)<=b)return!0}if(it=y.startX,nt=y.startY,ot=y.endX,tt=y.endY,y.type===ci.j){if(x=(it-ot)*(a.x-ot)+(nt-tt)*(a.y-tt),mn(a.x,a.y,it,nt,ot,tt)<=(0<=(ot-it)*(a.x-it)+(tt-nt)*(a.y-nt)&&0<=x?b:z))return!0}else{if(y.type===ci.u)return y=!1,x&&(y=mn(a.x,a.y,it,nt,it,tt)<=b||mn(a.x,a.y,it,nt,ot,nt)<=b||mn(a.x,a.y,ot,nt,ot,tt)<=b||mn(a.x,a.y,it,tt,ot,tt)<=b),y;if(y.type===ci.F){y=a.x-(it+ot)/2,z=a.y-(nt+tt)/2;var st=Math.abs(ot-it)/2,ut=Math.abs(tt-nt)/2;if(st===0||ut===0)return mn(a.x,a.y,it,nt,ot,tt)<=b;if(x){if(a=Gt.$y(st,ut,y,z),a*a<=b)return!0}else return!(Kn(y,z,-st,0)>=b||Kn(y,z,0,-ut)>=b||Kn(y,z,0,ut)>=b||Kn(y,z,st,0)>=b)}else if(y.type===ci.o){if(ot=y.bounds,z=ot.x,it=ot.y,nt=ot.x+ot.width,ot=ot.y+ot.height,a.x>nt&&a.x<z&&a.y>ot&&a.y<it&&mn(a.x,a.y,z,it,z,ot)>b&&mn(a.x,a.y,z,it,nt,it)>b&&mn(a.x,a.y,nt,ot,z,ot)>b&&mn(a.x,a.y,nt,ot,nt,it)>b)return!1;if(z=Math.sqrt(b),x){if(this.fill===null?Nl(y,a.x,a.y,z):Ma(y,a,z,!0,!1))return!0}else{for(x=y.figures,y=0;y<x.count;y++){if(z=x.s[y],tt=z.startX,st=z.startY,a.zd(tt,st)>b)return!1;for(it=z.segments.s,nt=it.length,ot=0;ot<nt;ot++)switch(ut=it[ot],ut.type){case _o:case _r:if(tt=ut.endX,st=ut.endY,a.zd(tt,st)>b)return!1;break;case as:var ct=ii();if(Gt.Qe(tt,st,ut.point1X,ut.point1Y,ut.point2X,ut.point2Y,ut.endX,ut.endY,.8,ct),tt=E(ct,a),Hi(ct),tt||(tt=ut.endX,st=ut.endY,a.zd(tt,st)>b))return!1;break;case Ea:if(ct=ii(),Gt.ep(tt,st,ut.point1X,ut.point1Y,ut.endX,ut.endY,.8,ct),tt=E(ct,a),Hi(ct),tt||(tt=ut.endX,st=ut.endY,a.zd(tt,st)>b))return!1;break;case Eo:case Ra:ct=ut.type===Eo?fa(ut,z):$a(ut,z,tt,st);var dt=ct.length;if(dt===0){if(tt=ut.type===Eo?ut.centerX:ut.endX,st=ut.type===Eo?ut.centerY:ut.endY,a.zd(tt,st)>b)return!1;break}ut=null;for(var vt=ii(),xt=0;xt<dt;xt++)if(ut=ct[xt],vt.length=0,Gt.Qe(ut[0],ut[1],ut[2],ut[3],ut[4],ut[5],ut[6],ut[7],.8,vt),E(vt,a))return Hi(vt),!1;Hi(vt),ut!==null&&(tt=ut[6],st=ut[7]);break;default:It("Unknown Segment type: "+ut.type)}}return!0}}}return!1},yt.qc=function(){this.ua=null},yt.kq=function(){return this.ig};function yx(a){var y=a.diagram;y!==null&&y.undoManager.isUndoingRedoing||(a.segmentOrientation=$p,a.toArrow!=="None"?(a.segmentIndex=-1,a.alignmentFocus=jo):a.fromArrow!=="None"&&(a.segmentIndex=0,a.alignmentFocus=new nn(1-jo.x,jo.y)))}Rn.makeGeometry=function(a,y,x){if(a.toArrow!=="None")var E=hu[a.toArrow];else a.fromArrow!=="None"?E=hu[a.fromArrow]:(E=Gt.Ze[a.figure],typeof E=="string"&&(E=Gt.Ze[E]),E===void 0&&It("Unknown Shape.figure: "+a.figure),E=E(a,y,x),E.Sk=y,E.Rk=x);if(E===null){var b=Gt.Ze.Rectangle;typeof b=="function"&&(E=b(a,y,x))}return E};function xx(a){var y=hu[a];if(y===void 0){var x=a.toLowerCase();if(x==="none")return"None";if(y=hu[x],y===void 0){var E=null,b;for(b in Gt.um)if(b.toLowerCase()===x){E=b;break}if(E!==null)return a=ci.parse(Gt.um[E],!1),hu[E]=a,x!==E&&(hu[x]=E),E}}return typeof y=="string"?y:y instanceof ci?a:null}zi.Object.defineProperties(Rn.prototype,{geometry:{get:function(){return this.ua!==null?this.ua:this.Rd},set:function(a){var y=this.ua,x=this.Rd;if(y!==a){a!==null?this.Rd=this.ua=a.freeze():this.Rd=this.ua=null;var E=this.part;E!==null&&(E.ag=NaN),this.v(),this.g("geometry",y||x,a),ss(this)&&(a=this.part,a!==null&&Zr(this,a,"geometryString"))}}},geometryString:{get:function(){return this.geometry===null?"":this.geometry.toString()},set:function(a){a=ci.parse(a);var y=a.normalize();this.geometry=a,this.position=a=Pt.allocAt(-y.x,-y.y),Pt.free(a)}},isGeometryPositioned:{get:function(){return(this.l&1048576)!==0},set:function(a){var y=(this.l&1048576)!==0;y!==a&&(this.l^=1048576,this.v(),this.g("isGeometryPositioned",y,a))}},fill:{get:function(){return this.Ui},set:function(a){var y=this.Ui;y!==a&&(a!==null&&kf(a,"Shape.fill"),a instanceof kr&&a.freeze(),this.Ui=a,this.N(),this.g("fill",y,a))}},stroke:{get:function(){return this.xc},set:function(a){var y=this.xc;y!==a&&(a!==null&&kf(a,"Shape.stroke"),a instanceof kr&&a.freeze(),this.xc=a,this.N(),this.g("stroke",y,a))}},strokeWidth:{get:function(){return this.ig},set:function(a){var y=this.ig;if(y!==a)if(0<=a){this.ig=a,this.v();var x=this.part;x!==null&&(x.ag=NaN),this.g("strokeWidth",y,a)}else xi(a,"value >= 0",Rn,"strokeWidth:value")}},strokeCap:{get:function(){return this.Na!==null?this.Na.Hr:"butt"},set:function(a){var y=this.strokeCap;y!==a&&(typeof a!="string"||a!=="butt"&&a!=="round"&&a!=="square"?xi(a,'"butt", "round", or "square"',Rn,"strokeCap"):(Ic(this),this.Na.Hr=a,this.N(),this.g("strokeCap",y,a)))}},strokeJoin:{get:function(){return this.Na!==null?this.Na.Ir:"miter"},set:function(a){var y=this.strokeJoin;y!==a&&(typeof a!="string"||a!=="miter"&&a!=="bevel"&&a!=="round"?xi(a,'"miter", "bevel", or "round"',Rn,"strokeJoin"):(Ic(this),this.Na.Ir=a,this.N(),this.g("strokeJoin",y,a)))}},strokeMiterLimit:{get:function(){return this.Na!==null?this.Na.Jr:10},set:function(a){var y=this.strokeMiterLimit;if(y!==a&&1<=a){Ic(this),this.Na.Jr=a,this.N();var x=this.part;x!==null&&(x.ag=NaN),this.g("strokeMiterLimit",y,a)}}},strokeDashArray:{get:function(){return this.Yg},set:function(a){var y=this.Yg;if(y!==a){if(a!==null){for(var x=a.length,E=0,b=0;b<x;b++){var z=a[b];0<=z&&isFinite(z)||It("strokeDashArray:value "+z+" at index "+b+" must be a positive number or zero."),E+=z}if(E===0){if(y===null)return;a=null}}this.Yg=a,this.N(),this.g("strokeDashArray",y,a)}}},strokeDashOffset:{get:function(){return this.Na!==null?this.Na.uj:0},set:function(a){var y=this.strokeDashOffset;y!==a&&0<=a&&(Ic(this),this.Na.uj=a,this.N(),this.g("strokeDashOffset",y,a))}},figure:{get:function(){return this.an},set:function(a){var y=this.an;if(y!==a){var x=Gt.Ze[a];typeof x=="function"?x=a:(x=Gt.Ze[a.toLowerCase()])||It("Unknown Shape.figure: "+a),y!==x&&(a=this.part,a!==null&&(a.ag=NaN),this.an=x,this.Rd=null,this.qc(),this.v(),this.g("figure",y,x))}}},toArrow:{get:function(){return this.Ua!==null?this.Ua.V:"None"},set:function(a){var y=this.toArrow;if(a===!0?a="Standard":a===!1&&(a=""),y!==a){var x=xx(a);x===null?It("Unknown Shape.toArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new Vh),this.Ua.V=x,this.Rd=null,this.qc(),this.v(),yx(this),this.g("toArrow",y,x))}}},fromArrow:{get:function(){return this.Ua!==null?this.Ua.j:"None"},set:function(a){var y=this.fromArrow;if(a===!0?a="Standard":a===!1&&(a=""),y!==a){var x=xx(a);x===null?It("Unknown Shape.fromArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new Vh),this.Ua.j=x,this.Rd=null,this.qc(),this.v(),yx(this),this.g("fromArrow",y,x))}}},spot1:{get:function(){return this.Na!==null?this.Na.fg:Fi},set:function(a){var y=this.spot1;y.D(a)||(a=a.J(),Ic(this),this.Na.fg=a,this.v(),this.g("spot1",y,a))}},spot2:{get:function(){return this.Na!==null?this.Na.gg:Fi},set:function(a){var y=this.spot2;y.D(a)||(a=a.J(),Ic(this),this.Na.gg=a,this.v(),this.g("spot2",y,a))}},parameter1:{get:function(){return this.Un},set:function(a){var y=this.Un;y!==a&&(this.Un=a,this.qc(),this.v(),this.g("parameter1",y,a))}},parameter2:{get:function(){return this.Vn},set:function(a){var y=this.Vn;y!==a&&(this.Vn=a,this.qc(),this.v(),this.g("parameter2",y,a))}},naturalBounds:{get:function(){return this.dc}},pathPattern:{get:function(){return this.Na!==null?this.Na.br:null},set:function(a){var y=this.pathPattern;y!==a&&(Ic(this),this.Na.br=a,this.N(),this.g("pathPattern",y,a))}},geometryStretch:{get:function(){return this.Na!==null?this.Na.jq:Dn},set:function(a){var y=this.geometryStretch;y!==a&&(Ic(this),this.Na.jq=a,this.v(),this.g("geometryStretch",y,a))}},interval:{get:function(){return this.fa!==null?this.fa.Tk:1},set:function(a){var y=this.interval;if(a=Math.round(a),y!==a&&a!==0&&isFinite(a)){this.fa===null&&(this.fa=new cu),this.fa.Tk=a;var x=this.diagram;x!==null&&this.panel===x.grid&&Kl(x),this.v(),x=this.panel,x!==null&&(x.graduatedIntervals=null),this.g("interval",y,a)}}},graduatedStart:{get:function(){return this.fa!==null?this.fa.u:0},set:function(a){var y=this.graduatedStart;y!==a&&(0>a?a=0:1<a&&(a=1),this.fa===null&&(this.fa=new cu),this.fa.u=a,this.v(),this.g("graduatedStart",y,a))}},graduatedEnd:{get:function(){return this.fa!==null?this.fa.j:1},set:function(a){var y=this.graduatedEnd;y!==a&&(0>a?a=0:1<a&&(a=1),this.fa===null&&(this.fa=new cu),this.fa.j=a,this.v(),this.g("graduatedEnd",y,a))}},graduatedSkip:{get:function(){return this.fa!==null?this.fa.o:null},set:function(a){var y=this.graduatedSkip;y!==a&&(this.fa===null&&(this.fa=new cu),this.fa.o=a,this.v(),this.g("graduatedSkip",y,a))}}}),Rn.prototype.intersectsRect=Rn.prototype.Yc,Rn.prototype.containedInRect=Rn.prototype.fh,Rn.prototype.getNearestIntersectionPoint=Rn.prototype.rs,Rn.prototype.getDocumentBounds=Rn.prototype.mi,Rn.prototype.getDocumentPoint=Rn.prototype.ga;var hu=new Sn,b0=new Sn;Rn.className="Shape",Rn.getFigureGenerators=function(){var a=new ji,y;for(y in Gt.Ze)y!==y.toLowerCase()&&a.add(y,Gt.Ze[y]);return a.freeze(),a},Rn.defineFigureGenerator=function(a,y){var x=a.toLowerCase(),E=Gt.Ze;E[a]=y,E[x]=a},Rn.getArrowheadGeometries=function(){var a=new ji;for(E in Gt.um)if(hu[E]===void 0){var y=ci.parse(Gt.um[E],!1);hu[E]=y,y=E.toLowerCase(),y!==E&&(hu[y]=E)}for(var x in hu)if(x!==x.toLowerCase()){var E=hu[x];E instanceof ci&&a.add(x,E)}return a.freeze(),a},Rn.defineArrowheadGeometry=function(a,y){var x=null;typeof y=="string"?x=ci.parse(y,!1):x=y,y=a.toLowerCase(),y!=="none"&&a!==y||It("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var E=hu;E[a]=x,E[y]=a};function P0(){this.nc=!1,this.Hr="butt",this.Ir="miter",this.Jr=10,this.uj=0,this.br=null,this.jq=Dn,this.gg=this.fg=Fi}P0.prototype.copy=function(){var a=new P0;return a.Hr=this.Hr,a.Ir=this.Ir,a.Jr=this.Jr,a.uj=this.uj,a.br=this.br,a.jq=this.jq,a.fg=this.fg.J(),a.gg=this.gg.J(),a};function Or(a,y){return Kt.call(this),Bv||(Js=lo?new nl(null).context:null,Bv=!0),this.l|=2097152,this.ec="",this.xc="black",this.Ae="13px sans-serif",this.Lq=this.Cb=this.Gc=0,this.da=this.fa=this.Gm=null,this.Ih=0,this.df=null,this.Le=0,this.ze=this.Qb=this.Qc=null,typeof a=="string"?this.text=a:a&&Object.assign(this,a),y&&Object.assign(this,y),this}Vi(Or,Kt),Or.prototype.cloneProtected=function(a){Kt.prototype.cloneProtected.call(this,a),a.ec=this.ec,a.xc=this.xc,a.Ae=this.Ae,a.Gc=this.Gc,a.Cb=this.Cb,a.Lq=this.Lq,a.Gm=this.Gm,this.fa!==null&&(a.fa=this.fa.copy()),this.da!==null&&(a.da=this.da.nc?this.da:this.da.copy()),a.Ih=this.Ih,a.df=this.df,a.Le=this.Le,a.Qc=this.Qc,a.Qb=this.Qb,a.ze=this.ze};function Yl(a){a.da===null?a.da=new B0:a.da.nc&&(a.da=a.da.copy())}yt=Or.prototype,yt.th=function(){Kt.prototype.th.call(this),this.da!==null&&(this.da.nc=!0)};function wx(a,y){a.l=y.l|6144,a.pb=y.opacity,a.Ma=y.background,a.areaBackground=y.areaBackground,a.jd=y.desiredSize.J(),a.minSize=y.minSize.J(),a.maxSize=y.maxSize.J(),y.Lb!==null?a.Lb=y.Lb.copy():a.Lb=null,a.Ca=y.scale,a.Kb=y.angle,a.stretch=y.stretch,a.Kg=y.margin.J(),a.Jb=y.alignment.J(),a.sk=y.alignmentFocus.J(),a.segmentFraction=y.segmentFraction,a.segmentOffset=y.segmentOffset.J(),a.segmentOrientation=y.segmentOrientation,y.tb!==null&&(a.tb=y.tb.copy()),a.shadowVisible=y.shadowVisible,a.ec=y.ec,a.xc=y.xc,a.Ae=y.Ae,a.fa!==null&&(a.fa=y.fa.copy()),y.da!==null&&(a.da=y.da.nc?y.da:y.da.copy()),a.Ih=y.Ih}yt.qb=function(a){a.classType===Or?this.wrap=a:Kt.prototype.qb.call(this,a)},yt.toString=function(){return 22<this.ec.length?'TextBlock("'+this.ec.substring(0,20)+'"...)':'TextBlock("'+this.ec+'")'},yt.v=function(){Kt.prototype.v.call(this)},yt.hh=function(a,y){if(this.xc!==null&&this.ec.length!==0&&this.Ae!==null){var x=this.naturalBounds,E=this.actualBounds,b=x.width,z=x.height,tt=Vp(this),it=a.textAlign=this.textAlign,nt=y.tn;it==="start"?it=nt?"right":"left":it==="end"&&(it=nt?"left":"right"),nt=this.isUnderline;var ot=this.isStrikethrough;uo(this,a,this.xc,!0,!1,x,E),(nt||ot)&&uo(this,a,this.xc,!1,!1,x,E),E=0,x=!1;var st=this.oe,ut=st.dx-(tt*st.m21+st.dx);st=st.dy-(tt*st.m22+st.dy);var ct=y.scale;switch(8>(ut*ut+st*st)*ct*ct&&(x=!0),y.ib!==a&&(x=!1),y.ib instanceof ga&&(x=!1),y.Gf("textGreeking")===!1&&(x=!1),y=this.spacingAbove,ut=this.spacingBelow,this.flip){case lr:a.translate(b,0),a.scale(-1,1);break;case Wn:a.translate(0,z),a.scale(1,-1);break;case Pr:a.translate(b,z),a.scale(-1,-1)}if(a.yc(),st=this.Gc,ct=(y+tt+ut)*st,z>ct&&(E=this.verticalAlignment,E=E.y*z-E.y*ct+E.offsetY),st===1&&this.ze!==null)ut=this.Cb,ut>b&&(ut=b),this.Oj(this.ze,a,0,E+y,b,tt,ut,x,it,nt,ot);else if(this.Qc!==null&&this.Qb!==null)for(ct=0;ct<st;ct++){var dt=this.Qc[ct];dt>b&&(dt=b),E+=y,this.Oj(this.Qb[ct],a,0,E,b,tt,dt,x,it,nt,ot),E+=tt+ut}switch(this.flip){case lr:a.scale(-1,1),a.translate(-b,0);break;case Wn:a.scale(1,-1),a.translate(0,-z);break;case Pr:a.scale(-1,-1),a.translate(-b,-z)}}},yt.Oj=function(a,y,x,E,b,z,tt,it,nt,ot,st){var ut=0;if(it)nt==="left"?ut=0:nt==="right"?ut=b-tt:nt==="center"&&(ut=(b-tt)/2),y.fillRect(x+ut,E+.25*z,tt,1);else{if(nt==="left"?ut=0:nt==="right"?ut=b:nt==="center"&&(ut=b/2),b=Lv!==null?Lv(this,z):.75*z,y.fillText(a,x+ut,E+b),a=z/20|0,a===0&&(a=1),nt==="right"?ut-=tt:nt==="center"&&(ut-=tt/2),ot){it=Av!==null?Av(this,z):.8*z,nt=x+ut,ot=E+it,b=x+ut+tt,it=E+it;var ct=a;y.beginPath(),y.lineWidth=ct,y.moveTo(nt,ot),y.lineTo(b,it),y.stroke(),y.Se(),y instanceof ga&&y.ad.classList.add("gojs-td")}st&&(st=E+z-z/2.2|0,a%2!==0&&(st+=.5),E=x+ut,z=st,x=x+ut+tt,tt=st,ut=a,y.beginPath(),y.lineWidth=ut,y.moveTo(E,z),y.lineTo(x,tt),y.stroke(),y.Se(),y instanceof ga&&y.ad.classList.add("gojs-td"))}},yt.kk=function(a,y,x){if(!Kt.prototype.kk.call(this,a,y,x))return!1;if(uo(this,a,this.xc,!0,!1,this.naturalBounds,this.actualBounds),x){if(this.svg.getElementsByTagName("text").length===0)return!0;for(y=this.svg.getElementsByClassName("gojs-td"),x=0;x<y.length;x++)qy(a,y[x],!1)}else y=this.svg,y.innerHTML=this.text,qy(a,y,!0);return!0},yt.nk=function(a){return 1<this.lineCount||this.isUnderline||this.isStrikethrough?!0:Kt.prototype.nk.call(this,a)},yt.Dv=function(a,y){if(a.nodeName!=="g")a.setAttributeNS(null,"filter",y);else{a=a.getElementsByTagName("text");for(var x=0;x<a.length;x++)a[x].setAttributeNS(null,"filter",y)}},yt.Wl=function(a,y,x,E){var b=this.Gc;this.Ih=a,this.l&=-16777217;var z=this.Ae;Js!==null&&Px!==z&&(Px=Js.font=z),this.Cb=this.Le=0,this.ze=this.Qb=this.Qc=this.df=null;var tt;if(isNaN(this.desiredSize.width)){if(z=this.ec.replace(/\r\n/g,`
|
|
`).replace(/\r/g,`
|
|
`),z.length===0)z=8;else if(this.isMultiline){for(var it=tt=0,nt=!1;!nt;){var ot=z.indexOf(`
|
|
`,it);ot===-1&&(ot=z.length,nt=!0),it=z.substr(it,ot-it),this.formatting===Gp&&(it=it.trim()),tt=Math.max(tt,wl(it)),it=ot+1}z=tt}else tt=z.indexOf(`
|
|
`,0),0<=tt&&(z=z.substr(0,tt)),z=wl(z);z=Math.min(z,a/this.scale)}else z=this.desiredSize.width;if(this.panel!==null&&(z=Math.min(z,this.panel.maxSize.width)),tt=Cx(this,z),isNaN(this.desiredSize.height)?tt=Math.min(tt,y/this.scale):tt=this.desiredSize.height,nt=tt,this.Cb!==0&&this.Qc!==null&&this.Qb!==null&&this.overflow===Dv&&(y=this.Ae,y=this.overflow===Dv?Sx(y):0,ot=this.spacingAbove+this.spacingBelow,ot=Math.max(0,Vp(this)+ot),nt=Math.min(this.maxLines-1,Math.max(Math.floor(nt/ot+.01)-1,0)),!(nt+1>=this.Qb.length))){for(this.l|=16777216,ot=this.Qb[nt],y=Math.max(1,a-y);wl(ot)>y&&1<ot.length;)ot=ot.substr(0,ot.length-1);ot+=Up,y=wl(ot),this.Qb[nt]=ot,this.Qb=this.Qb.slice(0,nt+1),this.Qc[nt]=y,this.Qc=this.Qc.slice(0,nt+1),this.Le=this.Qb.length,this.Cb=Math.max(this.Cb,y),this.Gc=this.Le,this.Gc===1&&(this.ze=this.Qb[0])}(this.wrap===kx||isNaN(this.desiredSize.width))&&(z=isNaN(a)?this.Cb:Math.min(a,this.Cb)),z=Math.max(x,z),tt=Math.max(E,tt),Oo(this.dc,z,tt),this.Ge(0,0,z,tt),this.svg!==null&&b!==this.Gc&&(this.Uc=!0)},yt.eh=function(a,y,x,E){ks(this,a,y,x,E)};function Kp(a,y,x){a.ze===null?(a.ze=y,a.Cb=x):((a.Qb===null||a.Qc===null)&&(a.Qb=[],a.Qc=[],a.Qb.push(a.ze),a.Qc.push(a.Cb)),a.Qb.push(y),a.Qc.push(x),a.Qb.length>a.maxLines&&(a.l|=16777216))}function N0(a,y,x,E){var b=a.formatting===Gp;b&&(y=y.trim());var z=0,tt=a.Ae,it=a.spacingAbove+a.spacingBelow;it=Math.max(0,Vp(a)+it);var nt=a.overflow===Dv?Sx(tt):0;if(a.Gc>=a.maxLines)E!==null&&E.h(0,it);else if(tt=y,a.wrap===T0){a.Le=1;var ot=wl(y);if(nt===0||ot<=x)a.Cb=Math.max(a.Cb,ot),Kp(a,y,a.Cb),E!==null&&E.h(ot,it);else{for(z=kd(a,tt),tt=tt.substr(z.length),y=kd(a,tt),ot=wl(z+y);0<y.length&&ot<=x;)z+=y,tt=tt.substr(y.length),y=kd(a,tt),ot=z+y,b&&(ot=ot.trim()),ot=wl(ot);for(b&&(y=y.trim()),z+=y,x=Math.max(1,x-nt);wl(z)>x&&1<z.length;)z=z.substr(0,z.length-1);a.l|=16777216,z+=Up;var st=wl(z);a.Cb=st,Kp(a,z,st),E!==null&&E.h(st,it)}}else{for(nt=0,tt.length===0&&(nt=1,Kp(a,tt,0));0<tt.length;){for(y=kd(a,tt),tt=tt.substr(y.length);wl(y)>x;){var ut=1;for(ot=wl(y.substr(0,ut)),st=0;ot<=x;)ut++,st=ot,ot=wl(y.substr(0,ut));if(ut===1){var ct=ot;z=Math.max(z,ot)}else ct=st,z=Math.max(z,st);if(ut--,1>ut&&(ut=1),Kp(a,y.substr(0,ut),ct),nt++,y=y.substr(ut),a.Gc+nt>a.maxLines)break}for(st=kd(a,tt),ot=wl(y+st);0<st.length&&ot<=x;)y+=st,tt=tt.substr(st.length),st=kd(a,tt),ot=y+st,b&&(ot=ot.trim()),ot=wl(ot);if(b&&(y=y.trim()),y!==""&&(y[y.length-1]==="\xAD"&&(y=y.substring(0,y.length-1)+"\u2010"),st.length===0?(ut=ot,z=Math.max(z,ot)):(ut=st=wl(y),z=Math.max(z,st)),Kp(a,y,ut),nt++,a.Gc+nt>a.maxLines))break}a.Le=Math.min(a.maxLines,nt),a.Cb=Math.max(a.Cb,z),E!==null&&E.h(a.Cb,it*a.Le)}}function kd(a,y){if(a.wrap===Mx)return y.substr(0,1);for(var x=y.length,E=0,b=Ew;E<x&&!b.test(y.charAt(E));)E++;for(a.formatting===Ex&&(x=Math.min(x,E+1));E<x&&b.test(y.charAt(E));)E++;return E>=y.length?y:y.substr(0,E)}function wl(a){return Js===null?8*a.length:Js.measureText(a).width}function Vp(a){if(a.df!==null)return a.df;var y=a.Ae;if(Js===null){var x=16;return a.df=x}return D0[y]!==void 0&&5e3>bx?x=D0[y]:(x=1.3*Js.measureText("M").width,D0[y]=x,bx++),a.df=x}function Sx(a){if(Js===null)return 6;if(Fv[a]!==void 0&&5e3>F0)var y=Fv[a];else y=Js.measureText(Up).width,Fv[a]=y,F0++;return y}function Cx(a,y){var x=a.ec.replace(/\r\n/g,`
|
|
`).replace(/\r/g,`
|
|
`),E=a.spacingAbove+a.spacingBelow;if(E=Math.max(0,Vp(a)+E),x.length===0)return a.Cb=0,a.Gc=1,E;if(!a.isMultiline){var b=x.indexOf(`
|
|
`,0);0<=b&&(x=x.substr(0,b))}b=0;for(var z=a.Gc=0,tt,it=!1;!it;){if(tt=x.indexOf(`
|
|
`,z),tt===-1&&(tt=x.length,it=!0),z<=tt){if(z=x.substr(z,tt-z),a.wrap!==T0){a.Le=0;var nt=li.alloc();N0(a,z,y,nt),b+=nt.height,li.free(nt),a.Gc+=a.Le}else N0(a,z,y,null),b+=E,a.Gc++;a.Gc===a.maxLines&&(it=!0)}z=tt+1}return a.Lq=b}zi.Object.defineProperties(Or.prototype,{font:{get:function(){return this.Ae},set:function(a){var y=this.Ae;y!==a&&(this.Ae=a,this.df=null,this.v(),this.g("font",y,a))}},text:{get:function(){return this.ec},set:function(a){var y=this.ec;a!=null?a=a.toString():a="",y!==a&&(this.ec=a,this.v(),this.g("text",y,a),this.Uc=!0)}},textAlign:{get:function(){return this.da!==null?this.da.Or:"start"},set:function(a){var y=this.textAlign;y===a||a!=="start"&&a!=="end"&&a!=="left"&&a!=="right"&&a!=="center"||(Yl(this),this.da.Or=a,this.N(),this.g("textAlign",y,a))}},flip:{get:function(){return this.da!==null?this.da.Xf:Qe},set:function(a){var y=this.flip;y!==a&&(Yl(this),this.da.Xf=a,this.N(),this.g("flip",y,a))}},verticalAlignment:{get:function(){return this.da!==null?this.da.Yr:xr},set:function(a){var y=this.verticalAlignment;y.D(a)||(a=a.J(),Yl(this),this.da.Yr=a,Bs(this),this.g("verticalAlignment",y,a))}},naturalBounds:{get:function(){if(!this.dc.w()){var a=li.alloc();N0(this,this.ec,999999,a);var y=a.width;li.free(a),a=Cx(this,y);var x=this.desiredSize;isNaN(x.width)||(y=x.width),isNaN(x.height)||(a=x.height),Oo(this.dc,y,a)}return this.dc}},isMultiline:{get:function(){return(this.l&2097152)!==0},set:function(a){var y=(this.l&2097152)!==0;y!==a&&(this.l^=2097152,this.v(),this.g("isMultiline",y,a))}},isUnderline:{get:function(){return(this.l&4194304)!==0},set:function(a){var y=(this.l&4194304)!==0;y!==a&&(this.l^=4194304,this.Uc=!0,this.N(),this.g("isUnderline",y,a))}},isStrikethrough:{get:function(){return(this.l&8388608)!==0},set:function(a){var y=(this.l&8388608)!==0;y!==a&&(this.l^=8388608,this.Uc=!0,this.N(),this.g("isStrikethrough",y,a))}},wrap:{get:function(){return this.da!==null?this.da.$r:L0},set:function(a){var y=this.wrap;y!==a&&(Yl(this),this.da.$r=a,this.v(),this.g("wrap",y,a))}},overflow:{get:function(){return this.da!==null?this.da.$q:A0},set:function(a){var y=this.overflow;y!==a&&(Yl(this),this.da.$q=a,this.v(),this.g("overflow",y,a))}},isOverflowed:{get:function(){return(this.l&16777216)!==0}},stroke:{get:function(){return this.xc},set:function(a){var y=this.xc;y!==a&&(a!==null&&kf(a,"TextBlock.stroke"),a instanceof kr&&a.freeze(),this.xc=a,this.N(),this.g("stroke",y,a))}},lineCount:{get:function(){return this.Gc}},lineHeight:{get:function(){return Vp(this)}},editable:{get:function(){return(this.l&1048576)!==0},set:function(a){var y=(this.l&1048576)!==0;y!==a&&(this.l^=1048576,this.g("editable",y,a))}},textEditor:{get:function(){return this.da!==null?this.da.Qr:null},set:function(a){var y=this.textEditor;y!==a&&(Yl(this),this.da.Qr=a,this.g("textEditor",y,a))}},errorFunction:{get:function(){return this.da!==null?this.da.Hd:null},set:function(a){var y=this.errorFunction;y!==a&&(Yl(this),this.da.Hd=a,this.g("errorFunction",y,a))}},interval:{get:function(){return this.fa!==null?this.fa.Tk:1},set:function(a){var y=this.interval;if(a=Math.round(a),y!==a&&a!==0&&isFinite(a)){this.fa===null&&(this.fa=new cu),this.fa.Tk=a,this.v();var x=this.panel;x!==null&&(x.graduatedIntervals=null),this.g("interval",y,a)}}},graduatedStart:{get:function(){return this.fa!==null?this.fa.u:0},set:function(a){var y=this.graduatedStart;y!==a&&(0>a?a=0:1<a&&(a=1),this.fa===null&&(this.fa=new cu),this.fa.u=a,this.v(),this.g("graduatedStart",y,a))}},graduatedEnd:{get:function(){return this.fa!==null?this.fa.j:1},set:function(a){var y=this.graduatedEnd;y!==a&&(0>a?a=0:1<a&&(a=1),this.fa===null&&(this.fa=new cu),this.fa.j=a,this.v(),this.g("graduatedEnd",y,a))}},graduatedFunction:{get:function(){return this.fa!==null?this.fa.F:null},set:function(a){var y=this.graduatedFunction;y!==a&&(this.fa===null&&(this.fa=new cu),this.fa.F=a,this.v(),this.g("graduatedFunction",y,a))}},graduatedSkip:{get:function(){return this.fa!==null?this.fa.o:null},set:function(a){var y=this.graduatedSkip;y!==a&&(this.fa===null&&(this.fa=new cu),this.fa.o=a,this.v(),this.g("graduatedSkip",y,a))}},textValidation:{get:function(){return this.da!==null?this.da.vj:null},set:function(a){var y=this.textValidation;y!==a&&(Yl(this),this.da.vj=a,this.g("textValidation",y,a))}},textEdited:{get:function(){return this.da!==null?this.da.Pr:null},set:function(a){var y=this.textEdited;y!==a&&(Yl(this),this.da.Pr=a,this.g("textEdited",y,a))}},spacingAbove:{get:function(){return this.da!==null?this.da.Dr:0},set:function(a){var y=this.spacingAbove;y!==a&&(Yl(this),this.da.Dr=a,this.v(),this.g("spacingAbove",y,a))}},spacingBelow:{get:function(){return this.da!==null?this.da.Er:0},set:function(a){var y=this.spacingBelow;y!==a&&(Yl(this),this.da.Er=a,this.v(),this.g("spacingBelow",y,a))}},formatting:{get:function(){return this.da!==null?this.da.gq:Gp},set:function(a){var y=this.formatting;y!==a&&(Yl(this),this.da.gq=a,this.v(),this.g("formatting",y,a))}},maxLines:{get:function(){return this.da!==null?this.da.Jq:1/0},set:function(a){var y=this.maxLines;y!==a&&(a=Math.floor(a),0>=a&&xi(a,"> 0",Or,"maxLines"),Yl(this),this.da.Jq=a,this.v(),this.g("maxLines",y,a))}},metrics:{get:function(){return{arrSize:this.Qc!==null?this.Qc:[this.Cb],arrText:this.Qb!==null?this.Qb:[this.ze],maxLineWidth:this.Cb,fontHeight:this.df}}},choices:{get:function(){return this.Gm},set:function(a){var y=this.Gm;y!==a&&(this.Gm=a,this.g("choices",y,a))}}});var Lv=null,Av=null,T0=new ze(Or,"None",0),kx=new ze(Or,"WrapFit",1),L0=new ze(Or,"WrapDesiredSize",2),Mx=new ze(Or,"WrapBreakAll",3),A0=new ze(Or,"OverflowClip",0),Dv=new ze(Or,"OverflowEllipsis",1),Gp=new ze(Or,"FormatTrim",0),Ex=new ze(Or,"FormatNone",0),Ew=/[ \u200b\u00ad]/,D0=new Sn,bx=0,Fv=new Sn,F0=0,Up="...",Px="",Js=null,Bv=!1;Or.className="TextBlock";function B0(){this.nc=!1,this.Hd=null,this.Xf=Qe,this.gq=Gp,this.Jq=1/0,this.$q=A0,this.Er=this.Dr=0,this.Or="start",this.vj=this.Qr=this.Pr=null,this.Yr=xr,this.$r=L0}B0.prototype.copy=function(){var a=new B0;return a.Hd=this.Hd,a.Xf=this.Xf,a.gq=this.gq,a.Jq=this.Jq,a.$q=this.$q,a.Dr=this.Dr,a.Er=this.Er,a.Or=this.Or,a.Pr=this.Pr,a.Qr=this.Qr,a.vj=this.vj,a.Yr=this.Yr,a.$r=this.$r,a},Or.getEllipsis=function(){return Up},Or.setEllipsis=function(a){Up=a,Fv=new Sn,F0=0},Or.getBaseline=function(){return Lv},Or.setBaseline=function(a){Lv=a},Or.getUnderline=function(){return Av},Or.setUnderline=function(a){Av=a},Or.isValidFont=function(a){if(Bv||(Js=lo?new nl(null).context:null,Bv=!0),Js===null)return!0;var y=Js.font;if(a===y||a==="10px sans-serif")return!0;Js.font="10px sans-serif",Js.font=a;var x=Js.font;if(x!=="10px sans-serif")return Js.font=y,!0;Js.font="19px serif";var E=Js.font;return Js.font=a,x=Js.font,Js.font=y,x!==E},Or.FormatNone=Ex,Or.FormatTrim=Gp,Or.None=T0,Or.OverflowClip=A0,Or.OverflowEllipsis=Dv,Or.WrapBreakAll=Mx,Or.WrapDesiredSize=L0,Or.WrapFit=kx;function cu(){this.Tk=1,this.u=0,this.j=1,this.o=this.F=null}cu.prototype.copy=function(){var a=new cu;return a.Tk=this.Tk,a.u=this.u,a.j=this.j,a.F=this.F,a.o=this.o,a},cu.className="GradElementSettings";function Qs(a,y){Kt.call(this),this.Eg=null,this.qo="",this.Xg=ho,this.Nk=ri,this.Zg=this.Hd=null,this.Mk=Hn,this.Xf=Qe,this.vl=null,this.qn=!1,this.en=!0,this.al=!1,this.bt=this.rl=null,typeof a=="string"?this.source=a:a&&Object.assign(this,a),y&&Object.assign(this,y)}var Md;Vi(Qs,Kt),Qs.prototype.cloneProtected=function(a){Kt.prototype.cloneProtected.call(this,a),a.qo=this.qo,a.element=this.Eg,a.Xg=this.Xg.J(),a.Nk=this.Nk,a.Xf=this.Xf,a.Hd=this.Hd,a.Zg=this.Zg,a.Mk=this.Mk.J(),a.en=this.en,a.rl=this.rl},Qs.prototype.qb=function(a){a===Qe||a===Yi||a===tr?this.imageStretch=a:Kt.prototype.qb.call(this,a)},Qs.prototype.toString=function(){return"Picture("+this.source+")#"+kn(this)};function Ed(a){a===void 0&&(a=""),a!==""?Md[a]&&(delete Md[a],Ov--):(Md=new Sn,Ov=0)}function Nx(a,y){y.qy||(y.Fq=function(x){y.sq=!0,y.ln=!1;var E=y.Bg.copy();if(E!=null){for(E=E.iterator;E.next();){var b=E.value;b.N();var z=y.getAttribute("src")||"",tt=b.Og.I(z);if(tt!==null)for(var it=tt.length,nt=0;nt<it;nt++)z=tt[nt],b.Xn.add(z),z.Uc=!0,b.$b(),y.hn&&(y.eu===void 0&&(y.eu=x),z.Zg!==null&&z.Zg(z,x))}y.Bg.clear()}a.desiredSize.w()||(No(a,!1),a.v())},y.Yp=function(x){y.ln=x;var E=y.Bg.copy();if(E!=null){for(E=E.iterator;E.next();){var b=E.value,z=y.getAttribute("src")||"",tt=b.Og.I(z);if(tt!==null){b=tt.length,z=ii();for(var it=0;it<b;it++)z.push(tt[it]);if(y.hn)for(it=0;it<b;it++)tt=z[it],tt.Hd!==null&&tt.Hd(tt,x);Hi(z)}}y.Bg.clear()}},y.addEventListener("load",y.Fq),y.addEventListener("error",y.Yp),y.qy=!0)}Qs.prototype.hA=function(){if(this.source!==""){Ed(this.source);var a=this.source;this.source="",this.source=a}},Qs.prototype.redraw=function(){this.N(),this.Uc=!0},Qs.prototype.hh=function(a,y){var x=this.Eg;if(x!==null){var E=x.getAttribute("src");if(!(x instanceof HTMLImageElement&&(E===null||E==="")||x.ln instanceof Event&&a instanceof Bc)){var b=a instanceof ga;E=this.naturalBounds;var z=0,tt=0,it=this.qn,nt=it?+x.width:x.naturalWidth;if(it=it?+x.height:x.naturalHeight,nt===void 0&&x.videoWidth&&(nt=x.videoWidth),it===void 0&&x.videoHeight&&(it=x.videoHeight),nt=nt||E.width,it=it||E.height,nt!==0&&it!==0){var ot=nt,st=it;this.sourceRect.w()&&(z=this.Xg.x,tt=this.Xg.y,nt=this.Xg.width,it=this.Xg.height);var ut=nt,ct=it,dt=this.Nk,vt=this.Mk;switch(dt){case Qe:if(this.sourceRect.w())break;ut>=E.width&&(z=z+vt.offsetX+(ut*vt.x-E.width*vt.x)),ct>=E.height&&(tt=tt+vt.offsetY+(ct*vt.y-E.height*vt.y)),nt=Math.min(E.width,ut),it=Math.min(E.height,ct);break;case ri:ut=E.width,ct=E.height;break;case Yi:case tr:dt===Yi?(dt=Math.min(E.height/ct,E.width/ut),ut*=dt,ct*=dt):dt===tr&&(dt=Math.max(E.height/ct,E.width/ut),ut*=dt,ct*=dt,ut>=E.width&&(z=(z+vt.offsetX+(ut*vt.x-E.width*vt.x)/ut)*nt),ct>=E.height&&(tt=(tt+vt.offsetY+(ct*vt.y-E.height*vt.y)/ct)*it),nt*=1/(ut/E.width),it*=1/(ct/E.height),ut=E.width,ct=E.height)}dt=this.Df()*y.scale;var xt=ut*dt*ct*dt,Tt=nt*it/xt,Et=x.__goCache;dt=null;var Ft=bw;if(!b){if(x.sq&&Et!==void 0&&4<xt&&Tt>Ft*Ft)for(Et.gi===null&&(Lx(Et,4,ot,st,x),Lx(Et,16,ot,st,x)),b=Et.gi,ot=b.length,st=0;st<ot&&b[st].ratio*b[st].ratio<Tt;st++)dt=b[st];if(!y.Xm){if(this.vl===null)if(this.Eg===null)this.vl=!1;else{b=new nl(null).context;try{b.drawImage(this.Eg,0,0)}catch(Ot){this.en=!1}try{b.getImageData(0,0,1,1).data[3]&&(this.vl=!1),this.vl=!1}catch(Ot){this.vl=!0}}if(this.vl)return}}switch(b=ut<E.width?vt.offsetX+(E.width*vt.x-ut*vt.x):0,vt=ct<E.height?vt.offsetY+(E.height*vt.y-ct*vt.y):0,this.flip){case lr:a.translate(Math.min(E.width,ut),0),a.scale(-1,1);break;case Wn:a.translate(0,Math.min(E.height,ct)),a.scale(1,-1);break;case Pr:a.translate(Math.min(E.width,ut),Math.min(E.height,ct)),a.scale(-1,-1)}if(a.yc(),y.Gf("pictureRatioOptimization")&&!y.$i&&Et!==void 0&&dt!==null&&dt.ratio!==1){a.save(),y=dt.ratio;try{a.drawImage(dt.source,z/y,tt/y,Math.min(dt.source.width,nt/y),Math.min(dt.source.height,it/y),b,vt,Math.min(E.width,ut),Math.min(E.height,ct)),a instanceof ga&&(this.bt=[z/y,tt/y,Math.min(dt.source.width,nt/y),Math.min(dt.source.height,it/y),b,vt,Math.min(E.width,ut),Math.min(E.height,ct)])}catch(Ot){this.en=!1}a.restore()}else try{a.drawImage(x,z,tt,nt,it,b,vt,Math.min(E.width,ut),Math.min(E.height,ct)),a instanceof ga&&(this.bt=[z,tt,nt,it,b,vt,Math.min(E.width,ut),Math.min(E.height,ct)])}catch(Ot){this.en=!1}switch(this.flip){case lr:a.scale(-1,1),a.translate(-Math.min(E.width,ut),0);break;case Wn:a.scale(1,-1),a.translate(0,-Math.min(E.height,ct));break;case Pr:a.scale(-1,-1),a.translate(-Math.min(E.width,ut),-Math.min(E.height,ct))}}}}},Qs.prototype.Wl=function(a,y,x,E){var b=this.desiredSize,z=Xs(this,!0),tt=this.Eg,it=this.qn,nt=0,ot=0;(it||!this.al&&tt&&tt.complete)&&(this.al=!0),tt===null?(isFinite(b.width)||(a=0),isFinite(b.height)||(y=0)):(nt=it?+tt.width:tt.naturalWidth,ot=it?+tt.height:tt.naturalHeight),isFinite(b.width)||z===ri||z===$i?(isFinite(a)||(this.sourceRect.w()?a=this.sourceRect.width:tt!==null&&(a=nt)),x=0):tt!==null&&this.al!==!1&&(a=this.sourceRect.w()?this.sourceRect.width:nt),isFinite(b.height)||z===ri||z===dn?(isFinite(y)||(this.sourceRect.w()?y=this.sourceRect.height:tt!==null&&(y=ot)),E=0):tt!==null&&this.al!==!1&&(y=this.sourceRect.w()?this.sourceRect.height:ot),isFinite(b.width)&&(a=b.width),isFinite(b.height)&&(y=b.height),b=this.maxSize,z=this.minSize,x=Math.max(x||0,z.width),E=Math.max(E||0,z.height),a=Math.min(b.width,a),y=Math.min(b.height,y),a=Math.max(x,a),y=Math.max(E,y),tt===null||tt.complete||(isFinite(a)||(a=0),isFinite(y)||(y=0)),Oo(this.dc,a,y),this.Ge(0,0,a,y)},Qs.prototype.eh=function(a,y,x,E){ks(this,a,y,x,E)},zi.Object.defineProperties(Qs.prototype,{element:{get:function(){return this.Eg},set:function(a){var y=this.Eg;if(this.Uc=!0,y!==a){this.qn=a instanceof HTMLCanvasElement;var x=a instanceof HTMLImageElement;a===null||x||a instanceof HTMLVideoElement||this.qn||It("Picture.element must be an instance of Image, Canvas, or Video, not: "+a);var E=this.diagram;E!==null&&bp(E,this),this.Eg=a,a!==null&&x&&a.Bg===void 0&&(a.Bg=new _e),E!==null&&x&&Wh(E,this),a!==null&&(this.qn||a.complete===!0?(a.hn&&(a.ln instanceof Event&&this.Hd!==null?this.Hd(this,a.ln):a.sq===!0&&!a.ln&&this.Zg!==null&&a.eu&&this.Zg(this,a.eu)),a.sq=!0,this.desiredSize.w()||(No(this,!1),this.v())):x&&Nx(this,a)),this.g("element",y,a),this.N()}}},source:{get:function(){return this.qo},set:function(a){var y=this.qo;if(y!==a){this.Uc=!0,this.qo=a;var x=Md;if(lo){var E=null;if(x[a]!==void 0)E=x[a];else if(a!==""){30<Ov&&(Ed(),x=Md),E=Gn("img"),E.hn=!0,Nx(this,E);var b=this.rl;b!==null&&(E.crossOrigin=b(this)),E.src=a,x[a]=E,Ov++}this.element=E,E!==null&&E.__goCache===void 0&&(E.__goCache=new Tx),this.v(),this.N()}this.g("source",y,a)}}},sourceCrossOrigin:{get:function(){return this.rl},set:function(a){if(this.rl!==a&&(this.rl=a,this.element!==null)){var y=this.element.getAttribute("src");a===null&&typeof y=="string"?this.element.crossOrigin=null:a!==null&&(this.element.crossOrigin=a(this)),this.element.src=y}}},sourceRect:{get:function(){return this.Xg},set:function(a){var y=this.Xg;y.D(a)||(this.Xg=a=a.J(),this.N(),this.g("sourceRect",y,a))}},imageStretch:{get:function(){return this.Nk},set:function(a){var y=this.Nk;y!==a&&(this.Nk=a,this.N(),this.g("imageStretch",y,a))}},flip:{get:function(){return this.Xf},set:function(a){var y=this.Xf;y!==a&&(this.Xf=a,this.N(),this.g("flip",y,a))}},imageAlignment:{get:function(){return this.Mk},set:function(a){var y=this.Mk;y.D(a)||(this.Mk=a=a.J(),this.N(),this.g("imageAlignment",y,a))}},errorFunction:{get:function(){return this.Hd},set:function(a){var y=this.Hd;y!==a&&(this.Hd=a,this.g("errorFunction",y,a))}},successFunction:{get:function(){return this.Zg},set:function(a){var y=this.Zg;y!==a&&(this.Zg=a,this.g("successFunction",y,a))}},naturalBounds:{get:function(){return this.dc}}}),Qs.prototype.redraw=Qs.prototype.redraw,Qs.prototype.reloadSource=Qs.prototype.hA;var Ov=0,bw=4;Qs.className="Picture",Md=new Sn,Qs.clearCache=Ed;function Tx(){this.gi=null}function Lx(a,y,x,E,b){a.gi===null&&(a.gi=[]);var z=new nl(null),tt=z.context,it=1/y;z.width=x/y,z.height=E/y,z.width!==0&&z.height!==0&&(y=new Ax(z.Oa,y),x=1,0<a.gi.length&&(x=a.gi[a.gi.length-1],b=x.source,x=x.ratio),tt.setTransform(it*x,0,0,it*x,0,0),tt.yc(),tt.drawImage(b,0,0),a.gi.push(y))}Tx.className="PictureCacheArray";function Ax(a,y){this.source=a,this.ratio=y}Ax.className="PictureCacheInstance";function bd(){this.os=new ci,this.mc=null}bd.prototype.reset=function(a){a!==null?(a.ka(),this.os=a,a.figures.clear()):this.os=new ci,this.mc=null};function Pd(a,y,x,E,b,z){a.mc=new zo,a.mc.startX=y,a.mc.startY=x,a.mc.isFilled=E,a.mc.isEvenOdd=z||!1,a.os.figures.add(a.mc),b!==void 0&&(a.mc.isShadowed=b)}function Pw(a){var y=a.mc.segments.length;0<y&&a.mc.segments.M(y-1).close()}bd.prototype.moveTo=function(a,y,x){x===void 0&&(x=!1);var E=new pr(_o);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)},bd.prototype.lineTo=function(a,y,x){x===void 0&&(x=!1);var E=new pr(_r);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)};function lh(a,y,x,E,b,z,tt){var it;it===void 0&&(it=!1);var nt=new pr(as);nt.point1X=y,nt.point1Y=x,nt.point2X=E,nt.point2Y=b,nt.endX=z,nt.endY=tt,it&&nt.close(),a.mc.segments.add(nt)}function Iv(a,y,x,E,b){var z;z===void 0&&(z=!1);var tt=new pr(Ea);tt.point1X=y,tt.point1Y=x,tt.endX=E,tt.endY=b,z&&tt.close(),a.mc.segments.add(tt)}bd.prototype.arcTo=function(a,y,x,E,b,z,tt){z===void 0&&(z=0),tt===void 0&&(tt=!1);var it=new pr(Eo);it.startAngle=a,it.sweepAngle=y,it.centerX=x,it.centerY=E,it.radiusX=b,it.radiusY=z!==0?z:b,tt&&it.close(),this.mc.segments.add(it)};function Nw(a,y,x,E,b,z,tt,it){var nt;nt===void 0&&(nt=!1),y=new pr(Ra,tt,it,y,x,E,b,z),nt&&y.close(),a.mc.segments.add(y)}function Dx(a){var y=Rv;return y!==null?(Rv=null,y.reset(a),y):(y=new bd,y.reset(a),y)}var Rv=null;bd.className="StreamGeometryContext";function xs(a,y){var x=a.toLowerCase(),E=Gt.Ze;E[a]=y,E[x]=a}xs("Rectangle",function(a,y,x){a="r"+y+","+x;var E=Gt.Mf[a];return E!==void 0||(E=new ci(ci.u),E.endX=y,E.endY=x,Gt.Nf<Gt.vm&&(Gt.Mf[a]=E,Gt.Nf++)),E}),xs("Square",function(a,y,x){a="s"+y+","+x;var E=Gt.Mf[a];return E!==void 0||(E=new ci(ci.u),E.endX=y,E.endY=x,E.defaultStretch=Yi,Gt.Nf<Gt.vm&&(Gt.Mf[a]=E,Gt.Nf++)),E}),xs("RoundedRectangle",function(a,y,x){a=a?a.parameter1:NaN,(isNaN(a)||0>a)&&(a=5),a=Math.min(a,y/3),a=Math.min(a,x/3);var E="rr"+y+","+x+","+a,b=Gt.Mf[E];if(b!==void 0)return b;var z=a*Gt.wg;return b=new ci().add(new zo(a,0,!0).add(new pr(_r,y-a,0)).add(new pr(as,y,a,y-z,0,y,z)).add(new pr(_r,y,x-a)).add(new pr(as,y-a,x,y,x-z,y-z,x)).add(new pr(_r,a,x)).add(new pr(as,0,x-a,z,x,0,x-z)).add(new pr(_r,0,a)).add(new pr(as,a,0,0,z,z,0).close())),1<z&&(b.spot1=new nn(0,0,z,z),b.spot2=new nn(1,1,-z,-z)),Gt.Nf<Gt.vm&&(Gt.Mf[E]=b,Gt.Nf++),b}),xs("Border","RoundedRectangle"),xs("Ellipse",function(a,y,x){a="e"+y+","+x;var E=Gt.Mf[a];return E!==void 0||(E=new ci(ci.F),E.endX=y,E.endY=x,E.spot1=Qa,E.spot2=ka,Gt.Nf<Gt.vm&&(Gt.Mf[a]=E,Gt.Nf++)),E}),xs("Circle",function(a,y,x){a="c"+y+","+x;var E=Gt.Mf[a];return E!==void 0||(E=new ci(ci.F),E.endX=y,E.endY=x,E.spot1=Qa,E.spot2=ka,E.defaultStretch=Yi,Gt.Nf<Gt.vm&&(Gt.Mf[a]=E,Gt.Nf++)),E}),xs("TriangleRight",function(a,y,x){return new ci().add(new zo(0,0).add(new pr(_r,y,.5*x)).add(new pr(_r,0,x).close())).pm(0,.25,.5,.75)}),xs("TriangleDown",function(a,y,x){return new ci().add(new zo(0,0).add(new pr(_r,y,0)).add(new pr(_r,.5*y,x).close())).pm(.25,0,.75,.5)}),xs("TriangleLeft",function(a,y,x){return new ci().add(new zo(y,x).add(new pr(_r,0,.5*x)).add(new pr(_r,y,0).close())).pm(.5,.25,1,.75)}),xs("TriangleUp",function(a,y,x){return new ci().add(new zo(y,x).add(new pr(_r,0,x)).add(new pr(_r,.5*y,0).close())).pm(.25,.5,.75,1)}),xs("Triangle","TriangleUp"),xs("Diamond",function(a,y,x){return new ci().add(new zo(.5*y,0).add(new pr(_r,0,.5*x)).add(new pr(_r,.5*y,x)).add(new pr(_r,y,.5*x).close())).pm(.25,.25,.75,.75)}),xs("LineH",function(a,y,x){return a=new ci(ci.j),a.startX=0,a.startY=x/2,a.endX=y,a.endY=x/2,a}),xs("LineV",function(a,y,x){return a=new ci(ci.j),a.startX=y/2,a.startY=0,a.endX=y/2,a.endY=x,a}),xs("None","Rectangle"),xs("BarH","Rectangle"),xs("BarV","Rectangle"),xs("MinusLine","LineH"),xs("PlusLine",function(a,y,x){return new ci().add(new zo(0,x/2,!1).add(new pr(_r,y,x/2)).add(new pr(_o,y/2,0)).add(new pr(_r,y/2,x)))}),xs("XLine",function(a,y,x){return new ci().add(new zo(0,x,!1).add(new pr(_r,y,0)).add(new pr(_o,0,0)).add(new pr(_r,y,x)))}),xs("LineRight",function(a,y,x){return new ci().add(new zo(.25*y,0,!1).add(new pr(_r,.75*y,.5*x)).add(new pr(_r,.25*y,x)))}),xs("LineDown",function(a,y,x){return new ci().add(new zo(0,.25*x,!1).add(new pr(_r,.5*y,.75*x)).add(new pr(_r,y,.25*x)))}),xs("LineLeft",function(a,y,x){return new ci().add(new zo(.75*y,0,!1).add(new pr(_r,.25*y,.5*x)).add(new pr(_r,.75*y,x)))}),xs("LineUp",function(a,y,x){return new ci().add(new zo(0,.75*x,!1).add(new pr(_r,.5*y,.25*x)).add(new pr(_r,y,.75*x)))}),Gt.um={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8",BackwardOpenTriangleLine:"m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4",BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8",TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z",OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8",OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"};function O0(){this.nc=!1,this.tr=this.Kp=this.zq=null,this.vr="",this.fr=this.oq=this.ur=null,this.hr="",this.gr=so,this.ir=null,this.jr="",this.lr=Fi,this.Gq="",this.Hq=qn,this.Pq=Un,this.Kq=Ar,this.Up=null,this.Cq=127,this.zr=Dr,this.yr="gray",this.Vg=4}O0.prototype.copy=function(){var a=new O0;return a.zq=this.zq,a.Kp=this.Kp,a.tr=this.tr,a.vr=this.vr,a.ur=this.ur,a.oq=this.oq,a.fr=this.fr,a.hr=this.hr,a.gr=this.gr.J(),a.ir=this.ir,a.jr=this.jr,a.lr=this.lr.J(),a.Gq=this.Gq,a.Hq=this.Hq.J(),a.Pq=this.Pq.J(),a.Kq=this.Kq.J(),a.Up=this.Up,a.Cq=this.Cq,a.zr=this.zr.J(),a.yr=this.yr,a.Vg=this.Vg,a};function tn(a,y){a===void 0||a instanceof Do||typeof a=="string"?si.call(this,a):(si.call(this),a&&(y=a)),this.G=2408959,this.Tf="",this.P=null,this.Jg="",this.Qf=this.Ug=null,this.ec="",this.Ah=this.Ig=null,this.ke=new Pt(NaN,NaN).freeze(),this.nf=null,this.Ao=NaN,this.vw=-1,this.py=new be,this.Rh=null,this.ag=NaN,y&&Object.assign(this,y)}Vi(tn,si),tn.prototype.cloneProtected=function(a){si.prototype.cloneProtected.call(this,a),a.G=this.G&-4097|49152,a.Tf=this.Tf,this.P!==null&&(a.P=this.P.nc?this.P:this.P.copy()),a.Jg=this.Jg,a.Qf=null,a.ec=this.ec,a.ke.assign(this.ke),a.Ao=this.Ao},yt=tn.prototype,yt.Af=function(a){si.prototype.Af.call(this,a),a.oh(),a.Ug=null,a.nf=null,a.Rh=null},yt.toString=function(){var a=Xi(this.constructor)+"#"+kn(this);return this.data!==null&&(a+="("+ki(this.data)+")"),a};function $s(a){a.P===null?a.P=new O0:a.P.nc&&(a.P=a.P.copy())}yt.th=function(){si.prototype.th.call(this),this.P!==null&&(this.P.nc=!0)},yt.gk=function(a,y,x,E,b,z,tt){var it=this.diagram;it!==null&&(a===xo&&y==="elements"?b instanceof si?Oc(b,function(nt){ly(it.partManager,nt),Pc(it,nt)}):Wh(it,b):a===Ao&&y==="elements"&&(b instanceof si?Oc(b,function(nt){uy(it.partManager,nt,it)}):bp(it,b)),it.cb(a,y,x,E,b,z,tt))},yt.La=function(a){if(si.prototype.La.call(this,a),this.data!==null){for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E];b instanceof si&&Oc(b,function(z){z.data!==null&&z.La()})}for(y=this.adornments;y.next();)y.value.La(a)}},tn.prototype.updateRelationshipsFromData=function(){var a;this.data!==null&&((a=this.diagram)===null||a===void 0||a.partManager.updateRelationshipsFromData(this))},tn.prototype.Pj=function(a){var y=this.Qf;return y===null?null:y.I(a)},tn.prototype.bh=function(a,y){if(y!==null){var x=null,E=this.Qf;if(E!==null&&(x=E.I(a)),x!==y){if(x!==null){var b=x.diagram;b!==null&&b.remove(x)}E===null&&(this.Qf=E=new ji),y.Tf!==a&&(y.category=a),E.add(a,y),a=this.diagram,a!==null&&(a.add(y),a=y.adornedObject,a!==null&&(a=a.ih(),a!==null&&(y.data=a.data)))}}},tn.prototype.Jf=function(a){var y=this.Qf;if(y!==null){var x=y.I(a);if(x!==null){var E=x.diagram;E!==null&&E.remove(x)}y.remove(a),y.count===0&&(this.Qf=null)}},tn.prototype.Ej=function(){var a=this.Qf;if(a!==null){var y=ii();for(a=a.iterator;a.next();)y.push(a.key);a=y.length;for(var x=0;x<a;x++)this.Jf(y[x]);Hi(y)}},tn.prototype.updateAdornments=function(){var a=this.diagram;if(a!==null){for(var y=this.adornments;y.next();){var x=y.value;x.v(),x.placeholder&&x.placeholder.v()}t:{if(this.isSelected&&this.selectionAdorned&&(y=this.selectionObject,y!==null&&this.actualBounds.w()&&this.isVisible()&&y.Ed()&&y.actualBounds.w())){if(x=this.Pj("Selection"),x===null){if(x=this.selectionAdornmentTemplate,x===null&&(x=this.ph()?a.linkSelectionAdornmentTemplate:this instanceof An?a.groupSelectionAdornmentTemplate:a.nodeSelectionAdornmentTemplate),!(x instanceof cr))break t;rl(x),x=x.copy(),x!==null&&(this.ph()&&this.selectionObject===this.path&&(x.type=si.Link),x.adornedObject=y)}if(x!==null){x.type===si.Link&&x.v(),this.bh("Selection",x);break t}}this.Jf("Selection")}for(Tw(this,a),y=this.adornments;y.next();)y.value.La()}},tn.prototype.Wb=function(){var a=this.diagram;a!==null&&(a.vd=!0,!(this.G&16384)&&(this.G|=16384))};function I0(a){a.G&16384&&(a.updateAdornments(),a.G&=-16385)}function Tw(a,y){y.toolManager.mouseDownTools.each(function(x){x.isEnabled&&x.updateAdornments(a)}),y.toolManager.updateAdornments(a)}function jv(a){if(Gh(a)===!1){j0(a,!0),a.Uk();var y=a.diagram;y!==null&&(y.De.add(a),y.$b())}}function Fx(a){if(a.G|=2097152,Gh(a)!==!1){var y=a.position,x=a.location;x.w()&&y.w()||Ix(a,y,x),x=a.Ib;var E=be.alloc().assign(x);x.ka(),x.x=y.x,x.y=y.y,x.freeze(),a.Xl(E,x),be.free(E),j0(a,!1)}}tn.prototype.Ge=function(a,y,x,E){var b=this.uc;b.h(a,y,x,E),this.Lb===null&&(this.Lb=new bn);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),this.Lb=z,z.ws()||z.pp(b)},tn.prototype.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=Hn;this.locationSpot.sb()&&(z=this.locationSpot);var tt=Pt.alloc();if(this.locationObject!==this)for(y=this.locationObject,x=y.naturalBounds,tt.yi(x.x,x.y,x.width,x.height,z),y.Lb!==null&&y.Lb.Ga(tt),tt.offset(-y.measuredBounds.x,-y.measuredBounds.y),z=y.panel;z!==null&&z!==this;)z.Lb!==null&&z.Lb.Ga(tt),tt.offset(-z.measuredBounds.x,-z.measuredBounds.y),z=z.panel;else tt.yi(y,x,E,b,z);a.rotate(this.Kb,tt.x,tt.y),Pt.free(tt)}},tn.prototype.move=function(a,y){y===!0?this.location=a:this.position=a},tn.prototype.moveTo=function(a,y,x){a=Pt.allocAt(a,y),this.move(a,x),Pt.free(a)},tn.prototype.isVisible=function(){if(!this.visible)return!1;var a=this.layer;if(a!==null){if(!a.visible)return!1;if(a=a.diagram,a!==null&&a.animationManager.fv(this))return!0}return a=this.containingGroup,!!(a===null||a.isSubGraphExpanded&&a.isVisible())},tn.prototype.Zb=function(a){var y=this.diagram;a?(this.C(4),this.Wb(),y!==null&&y.De.add(this)):(this.C(8),this.Ej()),this.oh(),y!==null&&(y.Ya(),y.N())},tn.prototype.fb=function(a){if(this.name===a)return this;var y=this.Rh;if(y===null&&(this.Rh=y=new ji),y.I(a)!==null)return y.I(a);var x=si.prototype.fb.call(this,a);return x!==null?(y.set(a,x),x):(y.set(a,null),null)};function uh(a,y,x,E){E===void 0&&(E=new Pt),x=x.Mc()?Hn:x;var b=y.naturalBounds;if(E.h(b.width*x.x+x.offsetX,b.height*x.y+x.offsetY),y===null||y===a)return E;for(y.transform.Ga(E),y=y.panel;y!==null&&y!==a;)y.transform.Ga(E),y=y.panel;return a.Lb!==null&&a.Lb.Ga(E),E.offset(-a.uc.x,-a.uc.y),E}tn.prototype.mi=function(a){return a===void 0&&(a=new be),a.assign(this.actualBounds)},tn.prototype.Va=function(){this.measure(1/0,1/0),this.arrange()};function Bx(a){var y=Pt.alloc(),x=a.locationObject,E=x.naturalBounds,b=x instanceof Rn?x.strokeWidth:0;if(y.yi(0,0,E.width+b,E.height+b,a.locationSpot),x!==a)for(y.offset(-b/2,-b/2),x.transform.Ga(y),x=x.panel;x!==null&&x!==a;)x.transform.Ga(y),x=x.panel;return a.Lb!==null&&a.Lb.Ga(y),y.offset(-a.uc.x,-a.uc.y),y}function jc(a,y){var x=a.py;isNaN(a.ag)&&(a.ag=cx(a));var E=a.ag,b=2*E;if(!a.isShadowed)return x.h(y.x-1-E,y.y-1-E,y.width+2+b,y.height+2+b),x;E=y.x,b=y.y;var z=y.width;y=y.height;var tt=a.shadowBlur;return a=a.shadowOffset,z+=tt,y+=tt,E-=tt/2,b-=tt/2,0<a.x?z+=a.x:(E+=a.x,z-=a.x),0<a.y?y+=a.y:(b+=a.y,y-=a.y),x.h(E-1,b-1,z+2,y+2),x}tn.prototype.arrange=function(){if(Os(this)===!1)Fx(this);else{au(this,!1);var a=this.Ib,y=be.alloc();y.assign(a);var x=Uh(this);this.eh(0,0,this.uc.width,this.uc.height);var E=this.position;Ix(this,E,this.location),a.ka(),a.x=E.x,a.y=E.y,a.freeze(),this.Xl(y,a),y.D(a)?this.Fd(x):!this.Zc()||Gt.B(y.width,a.width)&&Gt.B(y.height,a.height)||0<=this.vw&&this.C(16),be.free(y),j0(this,!1)}},yt=tn.prototype,yt.Xl=function(a,y){var x=this.diagram;if(x!==null){var E=!1;if(x.Zi===!1&&a.w()){var b=be.alloc();b.assign(x.documentBounds),b.Fv(x.padding),a.x>b.x&&a.y>b.y&&a.right<b.right&&a.bottom<b.bottom&&y.x>b.x&&y.y>b.y&&y.right<b.right&&y.bottom<b.bottom&&(E=!0),be.free(b)}!(this.G&65536)&&a.D(y)||zx(this,E,x),x.N(),!a.w()&&!y.w()||Qr(a,y)||(this instanceof Ci&&!x.undoManager.isUndoingRedoing&&this.Bd(),this.oh())}},yt.zv=function(a,y,x){if(this.ph()||!a.w())return!1;var E=this.diagram;return E!==null&&Ox(this,E,a,y,x),this.pa=a,this.G&=-2097153,!this.ke.w()||E!==null&&!E.animationManager.isTicking&&E.undoManager.isUndoingRedoing||(E=this.ke,this.ke=new Pt(E.x+(a.x-y),E.y+(a.y-x)),this.g("location",E,this.ke.copy())),Gh(this)===!1&&Os(this)===!1&&(jv(this),Fx(this)),!0};function Ox(a,y,x,E,b){y===null||a instanceof cr||(y=y.animationManager,y.zb&&$f(y,a,new Pt(E,b),x))}yt.mm=function(a,y,x){var E=this.ke,b=this.pa;if(x){if(E.x===a&&E.y===y)return;Gh(this)||Os(this)?b.h(NaN,NaN):b.h(b.x+a-E.x,b.y+y-E.y),E.h(a,y)}else{if(b.x===a&&b.y===y)return;E.h(E.x+a-b.x,E.y+y-b.y),b.h(a,y)}jv(this)},yt.Av=function(){this.G&=-2097153,jv(this)};function Ix(a,y,x){var E=Bx(a),b=a.diagram,z=x.w(),tt=y.w();z&&tt?a.G&2097152?Rx(a,y,x,b,E):jx(a,y,x,b,E):z?Rx(a,y,x,b,E):tt&&jx(a,y,x,b,E),a.G|=2097152,Pt.free(E),a.Uk()}function Rx(a,y,x,E,b){var z=y.x,tt=y.y;y.h(x.x-b.x,x.y-b.y),E!==null&&(x=E.animationManager,(E=x.defaultAnimation.isAnimating)||!x.zb||a instanceof cr||$f(x,a,new Pt(z,tt),y),E||y.x===z&&y.y===tt||a.g("position",new Pt(z,tt),y.copy()))}function jx(a,y,x,E,b){var z=x.copy();x.h(y.x+b.x,y.y+b.y),x.D(z)||E===null||a.g("location",z,x.copy())}function zx(a,y,x){z0(a,!1),a instanceof Ci&&ih(x,a),a.layer.isTemporary||y||x.Ya(),y=a.Ib;var E=x.viewportBounds;E.w()?Uh(a)?(Pl(y,E)||a.Fd(!1),a.updateAdornments()):a.isVisible()&&y.Yc(E)?(a.Fd(!0),a.updateAdornments()):a.Wb():x.vd=!0}yt.si=function(){return!0},yt.Zc=function(){return!0},yt.ph=function(){return!1},yt.Dd=function(){return!0};function R0(a,y,x,E){y.constructor===a.constructor||Wx||(Wx=!0,Di('Should not change the class of the Part when changing category from "'+x+'" to "'+E+'"'),Di(" Old class: "+Xi(a.constructor)+", new class: "+Xi(y.constructor)+", part: "+a.toString())),a.Ej();var b=a.data;x=a.layerName;var z=a.isSelected,tt=a.isHighlighted,it=!0,nt=!0,ot=!1;a instanceof Ci&&(it=a.isTreeLeaf,nt=a.isTreeExpanded,ot=a.wasTreeExpanded),y.Af(a),y.cloneProtected(a),a.Tf=E,a.svg!==null&&(a.svg.remove(),a.svg=null,a.Uc=!0),a.v(),a.N(),y=a.diagram,E=!0,y!==null&&(E=y.skipsUndoManager,y.skipsUndoManager=!0),a.ub=b,a.G=z?a.G|4096:a.G&-4097,a.G=tt?a.G|524288:a.G&-524289,a instanceof Ci&&(a.U=it?a.U|4:a.U&-5,a.U=nt?a.U|1:a.U&-2,a.U=ot?a.U|2:a.U&-3),b!==null&&a.La(),b=a.layerName,b!==x&&(a.Jg=x,a.layerName=b),y!==null&&(y.skipsUndoManager=E),a.Zc()&&a.C(64)}tn.prototype.canCopy=function(){if(!this.copyable)return!1;var a=this.layer;return a===null?!0:a.allowCopy?(a=a.diagram,a===null?!0:!!a.allowCopy):!1},tn.prototype.canDelete=function(){if(!this.deletable)return!1;var a=this.layer;return a===null?!0:a.allowDelete?(a=a.diagram,a===null?!0:!!a.allowDelete):!1},tn.prototype.canEdit=function(){if(!this.textEditable)return!1;var a=this.layer;return a===null?!0:a.allowTextEdit?(a=a.diagram,a===null?!0:!!a.allowTextEdit):!1},tn.prototype.canGroup=function(){if(!this.groupable)return!1;var a=this.layer;return a===null?!0:a.allowGroup?(a=a.diagram,a===null?!0:!!a.allowGroup):!1},tn.prototype.canMove=function(){if(!this.movable)return!1;var a=this.layer;return a===null?!0:a.allowMove?(a=a.diagram,a===null?!0:!!a.allowMove):!1},tn.prototype.canReshape=function(){if(!this.reshapable)return!1;var a=this.layer;return a===null?!0:a.allowReshape?(a=a.diagram,a===null?!0:!!a.allowReshape):!1},tn.prototype.canResize=function(){if(!this.resizable)return!1;var a=this.layer;return a===null?!0:a.allowResize?(a=a.diagram,a===null?!0:!!a.allowResize):!1},tn.prototype.canRotate=function(){if(!this.rotatable)return!1;var a=this.layer;return a===null?!0:a.allowRotate?(a=a.diagram,a===null?!0:!!a.allowRotate):!1},tn.prototype.canSelect=function(){if(!this.selectable)return!1;var a=this.layer;return a===null?!0:a.allowSelect?(a=a.diagram,a===null?!0:!!a.allowSelect):!1};function Gh(a){return(a.G&32768)!==0}function j0(a,y){a.G=y?a.G|32768:a.G&-32769}function z0(a,y){a.G=y?a.G|65536:a.G&-65537}function Uh(a){return(a.G&131072)!==0}yt=tn.prototype,yt.Fd=function(a){this.G=a?this.G|131072:this.G&-131073};function zv(a,y){a.G=y?a.G|1048576:a.G&-1048577}yt.oh=function(){var a=this.containingGroup;a!==null&&(a.v(),a.placeholder!==null&&a.placeholder.v(),a.Bd())},yt.N=function(){var a=this.diagram;a!==null&&!Os(this)&&!Gh(this)&&this.isVisible()&&this.Ib.w()&&a.N(jc(this,this.Ib))},yt.v=function(){si.prototype.v.call(this);var a=this.diagram;a!==null&&(a.De.add(this),this instanceof Ci&&this.labeledLink!==null&&Bs(this.labeledLink),a.$b(!0))},yt.Vo=function(a){a||(a=this.Ah,a!==null&&V0(a,this))},yt.Wo=function(a){a||(a=this.Ah,a!==null&&G0(a,this))},yt.Lj=function(){var a=this.data;if(a!==null){var y=this.diagram;y!==null&&(y=y.model,y!==null&&y.cm(a))}},yt.oz=function(){return _0(this,this)};function _0(a,y){var x=y.containingGroup;return x!==null?1+_0(a,x):y instanceof Ci&&(y=y.labeledLink,y!==null)?_0(a,y):0}yt.sz=function(){return _x(this,this)};function _x(a,y){var x=y.containingGroup;return x!==null||y instanceof Ci&&(x=y.labeledLink,x!==null)?_x(a,x):y}yt.Td=function(a){return a instanceof An?H0(this,this,a):!1};function H0(a,y,x){if(y===x||x===null)return!1;var E=y.containingGroup;return E===null||E!==x&&!H0(a,E,x)?y instanceof Ci&&(y=y.labeledLink,y!==null)?H0(a,y,x):!1:!0}yt.px=function(a){if(a===null)return null;if(this===a)return this.containingGroup;for(var y=this;y!==null;){if(y instanceof An&&zv(y,!0),y instanceof Ci){var x=y.labeledLink;x!==null&&(y=x)}y=y.containingGroup}for(x=null,y=a;y!==null;){if(y.G&1048576){x=y;break}y instanceof Ci&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup}for(y=this;y!==null;)y instanceof An&&zv(y,!1),y instanceof Ci&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup;return x},tn.prototype.canLayout=function(){if(!this.isLayoutPositioned||!this.isVisible())return!1;var a=this.layer;return!(a!==null&&a.isTemporary||this instanceof Ci&&this.isLinkLabel)},tn.prototype.C=function(a){if(a===void 0&&(a=16777215),this.isLayoutPositioned&&a&this.layoutConditions){var y=this.layer;y!==null&&y.isTemporary||this instanceof Ci&&this.isLinkLabel?y=!1:(y=this.diagram,y=!(y!==null&&y.undoManager.isUndoingRedoing))}else y=!1;if(y)if(y=this.Ah,y!==null){var x=y.layout;x!==null?x.C():y.C(a)}else a=this.diagram,a!==null&&(a=a.layout,a!==null&&a.C())};function Hx(a){return a.isVisible()?(a=a.layer,!(a!==null&&a.isTemporary)):!1}function Yh(a,y,x,E,b,z){if(z===void 0&&(z=null),!(a.contains(y)||z!==null&&!z(y)||y instanceof cr)){if(a.add(y),y instanceof Ci){if(x&&y instanceof An)for(var tt=y.memberParts;tt.next();)Yh(a,tt.value,x,E,b,z);if(b!==!1)for(tt=y.linksConnected;tt.next();){var it=tt.value;if(!a.contains(it)){var nt=it.fromNode,ot=it.toNode;nt=nt===null||a.contains(nt),ot=ot===null||a.contains(ot),(b?nt&&ot:nt||ot)&&Yh(a,it,x,E,b,z)}}if(1<E)for(y=y.Ou();y.next();)Yh(a,y.value,x,E-1,b,z)}else if(y instanceof fi)for(y=y.labelNodes;y.next();)Yh(a,y.value,x,E,b,z)}}zi.Object.defineProperties(tn.prototype,{key:{get:function(){var a=this.diagram;if(a!==null)return a.model.wa(this.data)}},adornments:{get:function(){return this.Qf===null?ke:this.Qf.iteratorValues}},layer:{get:function(){return this.Ig}},diagram:{get:function(){var a=this.Ig;return a==null?null:a.diagram}},layerName:{get:function(){return this.Jg},set:function(a){var y=this.Jg;if(y!==a){var x=this.diagram;if((x===null||x.Qj(a)!==null&&!x.partManager.addsToTemporaryLayer)&&(this.Jg=a,x!==null&&x.Ya(),this.g("layerName",y,a),y=this.layer,y!==null&&y.name!==a&&(x=y.diagram,x!==null&&(a=x.Qj(a),a!==null&&a!==y)))){var E=y.pc(-1,this,!0);if(0<=E&&x.cb(Ao,"parts",y,this,null,E,!0),E=a.oi(99999999,this,!0),y.visible!==a.visible&&this.Zb(a.visible),0<=E&&x.cb(xo,"parts",a,null,this,!0,E),E=this.layerChanged,E!==null){var b=x.aa;x.aa=!0,E(this,y,a),x.aa=b}}}}},layerChanged:{get:function(){return this.P!==null?this.P.zq:null},set:function(a){var y=this.layerChanged;y!==a&&($s(this),this.P.zq=a,this.g("layerChanged",y,a))}},zOrder:{get:function(){return this.Ao},set:function(a){var y=this.Ao;if(y!==a){this.Ao=a;var x=this.layer;x!==null&&ed(x,-1,this),this.g("zOrder",y,a),a=this.diagram,a!==null&&a.N()}}},locationObject:{get:function(){if(this.nf===null){var a=this.locationObjectName;a!==""?(a=this.fb(a),a!==null?this.nf=a:this.nf=this):this instanceof cr?this.type!==si.Link&&this.placeholder!==null?this.nf=this.placeholder:this.nf=this:this.nf=this}return this.nf.visible?this.nf:this}},minLocation:{get:function(){return this.P!==null?this.P.Pq:Un},set:function(a){var y=this.minLocation;y.D(a)||(a=a.J(),$s(this),this.P.Pq=a,this.g("minLocation",y,a))}},maxLocation:{get:function(){return this.P!==null?this.P.Kq:Ar},set:function(a){var y=this.maxLocation;y.D(a)||(a=a.J(),$s(this),this.P.Kq=a,this.g("maxLocation",y,a))}},locationObjectName:{get:function(){return this.P!==null?this.P.Gq:""},set:function(a){var y=this.locationObjectName;y!==a&&($s(this),this.P.Gq=a,this.nf=null,this.v(),this.g("locationObjectName",y,a))}},locationSpot:{get:function(){return this.P!==null?this.P.Hq:qn},set:function(a){var y=this.locationSpot;y.D(a)||(a=a.J(),$s(this),this.P.Hq=a,this.v(),this.g("locationSpot",y,a))}},location:{get:function(){return this.ke},set:function(a){var y=a.x,x=a.y,E=this.ke;if(!(E.x===y||isNaN(E.x)&&isNaN(y))||!(E.y===x||isNaN(E.y)&&isNaN(x))){if(a=a.copy(),y=a,this.ph())y=!1;else{if(this.ke=y,this.G|=2097152,Os(this)===!1&&(jv(this),x=this.pa,x.w())){var b=this.diagram;if(b===null||b.animationManager.isTicking||!b.undoManager.isUndoingRedoing){var z=x.copy();x.h(x.x+(y.x-E.x),x.y+(y.y-E.y)),Ox(this,b,x,z.x,z.y),this.g("position",z,x.copy())}}y=!0}y&&this.g("location",E,a.copy())}}},category:{get:function(){return this.Tf},set:function(a){var y=this.Tf;if(y!==a){this.svg!==null&&(this.svg.remove(),this.Uc=!0);var x=this.diagram,E=this.data,b=null;if(x!==null&&E!==null&&!(this instanceof cr)){var z=x.model.undoManager;z.isEnabled&&!z.isUndoingRedoing&&(b=this.clone(),b.O.addAll(this.O))}this.Tf=a,this.g("category",y,a),x===null||E===null||this instanceof cr?this instanceof cr&&(b=this.adornedPart,b!==null&&(a=b.Qf,a!==null&&a.remove(y),b.bh(this.category,this))):(z=x.model,z.undoManager.isUndoingRedoing||(this.ph()?(x.partManager.setLinkCategoryForData(E,a),x=x.partManager.findLinkTemplateForCategory(a),x!==null&&(rl(x),x=x.copy(),x!==null&&R0(this,x,y,a))):(z!==null&&z.jm(E,a),x=d1(x.partManager,E,a),x!==null&&(rl(x),x=x.copy(),x===null||x instanceof fi||(E=this.location.copy(),R0(this,x,y,a),this.location.w()||(this.location=E)))),b!==null&&(y=this.clone(),y.O.addAll(this.O),this.g("self",b,y))))}}},self:{get:function(){return this},set:function(a){R0(this,a,this.category,a.category)}},copyable:{get:function(){return(this.G&1)!==0},set:function(a){var y=(this.G&1)!==0;y!==a&&(this.G^=1,this.g("copyable",y,a))}},deletable:{get:function(){return(this.G&2)!==0},set:function(a){var y=(this.G&2)!==0;y!==a&&(this.G^=2,this.g("deletable",y,a))}},textEditable:{get:function(){return(this.G&4)!==0},set:function(a){var y=(this.G&4)!==0;y!==a&&(this.G^=4,this.g("textEditable",y,a),this.Wb())}},groupable:{get:function(){return(this.G&8)!==0},set:function(a){var y=(this.G&8)!==0;y!==a&&(this.G^=8,this.g("groupable",y,a))}},movable:{get:function(){return(this.G&16)!==0},set:function(a){var y=(this.G&16)!==0;y!==a&&(this.G^=16,this.g("movable",y,a))}},selectionAdorned:{get:function(){return(this.G&32)!==0},set:function(a){var y=(this.G&32)!==0;y!==a&&(this.G^=32,this.g("selectionAdorned",y,a),this.Wb())}},isInDocumentBounds:{get:function(){return(this.G&64)!==0},set:function(a){var y=(this.G&64)!==0;if(y!==a){this.G^=64;var x=this.diagram;x!==null&&x.Ya(),this.g("isInDocumentBounds",y,a)}}},isLayoutPositioned:{get:function(){return(this.G&128)!==0},set:function(a){var y=(this.G&128)!==0;y!==a&&(this.G^=128,this.g("isLayoutPositioned",y,a),this.C(a?4:8))}},selectable:{get:function(){return(this.G&256)!==0},set:function(a){var y=(this.G&256)!==0;y!==a&&(this.G^=256,this.g("selectable",y,a),this.Wb())}},reshapable:{get:function(){return(this.G&512)!==0},set:function(a){var y=(this.G&512)!==0;y!==a&&(this.G^=512,this.g("reshapable",y,a),this.Wb())}},resizable:{get:function(){return(this.G&1024)!==0},set:function(a){var y=(this.G&1024)!==0;y!==a&&(this.G^=1024,this.g("resizable",y,a),this.Wb())}},rotatable:{get:function(){return(this.G&2048)!==0},set:function(a){var y=(this.G&2048)!==0;y!==a&&(this.G^=2048,this.g("rotatable",y,a),this.Wb())}},isSelected:{get:function(){return(this.G&4096)!==0},set:function(a){var y=(this.G&4096)!==0;if(y!==a){var x=this.diagram;if(!a||this.canSelect()&&!(x!==null&&x.selection.count>=x.maxSelectionCount)){this.G^=4096;var E=!1;if(x!==null){E=x.skipsUndoManager,x.skipsUndoManager=!0;var b=x.selection;b.ka(),a?b.add(this):b.remove(this),b.freeze()}this.g("isSelected",y,a),this.Wb(),a=this.selectionChanged,a!==null&&a(this),x!==null&&(x.$b(),x.skipsUndoManager=E)}}}},isHighlighted:{get:function(){return(this.G&524288)!==0},set:function(a){var y=(this.G&524288)!==0;if(y!==a){this.G^=524288;var x=this.diagram;x!==null&&(x=x.highlighteds,x.ka(),a?x.add(this):x.remove(this),x.freeze()),this.g("isHighlighted",y,a),this.N(),a=this.highlightedChanged,a!==null&&a(this)}}},isShadowed:{get:function(){return(this.G&8192)!==0},set:function(a){var y=(this.G&8192)!==0;y!==a&&(this.G^=8192,this.Uc=!0,this.g("isShadowed",y,a),this.N())}},isAnimated:{get:function(){return(this.G&262144)!==0},set:function(a){var y=(this.G&262144)!==0;y!==a&&(this.G^=262144,this.g("isAnimated",y,a))}},highlightedChanged:{get:function(){return this.P!==null?this.P.oq:null},set:function(a){var y=this.highlightedChanged;y!==a&&($s(this),this.P.oq=a,this.g("highlightedChanged",y,a))}},selectionObjectName:{get:function(){return this.P!==null?this.P.vr:""},set:function(a){var y=this.selectionObjectName;y!==a&&($s(this),this.P.vr=a,this.Ug=null,this.g("selectionObjectName",y,a))}},selectionAdornmentTemplate:{get:function(){return this.P!==null?this.P.tr:null},set:function(a){var y=this.selectionAdornmentTemplate;y!==a&&($s(this),this.P.tr=a,this.g("selectionAdornmentTemplate",y,a))}},selectionObject:{get:function(){if(this.Ug===null){var a=this.selectionObjectName;a!==null&&a!==""?(a=this.fb(a),a!==null?this.Ug=a:this.Ug=this):this instanceof fi?(a=this.path,a!==null?this.Ug=a:this.Ug=this):this.Ug=this}return this.Ug}},selectionChanged:{get:function(){return this.P!==null?this.P.ur:null},set:function(a){var y=this.selectionChanged;y!==a&&($s(this),this.P.ur=a,this.g("selectionChanged",y,a))}},resizeAdornmentTemplate:{get:function(){return this.P!==null?this.P.fr:null},set:function(a){var y=this.resizeAdornmentTemplate;y!==a&&($s(this),this.P.fr=a,this.g("resizeAdornmentTemplate",y,a))}},resizeObjectName:{get:function(){return this.P!==null?this.P.hr:""},set:function(a){var y=this.resizeObjectName;y!==a&&($s(this),this.P.hr=a,this.g("resizeObjectName",y,a))}},resizeObject:{get:function(){var a=this.resizeObjectName;return a!==""&&(a=this.fb(a),a!==null)?a:this}},resizeCellSize:{get:function(){return this.P!==null?this.P.gr:so},set:function(a){var y=this.resizeCellSize;y.D(a)||(a=a.J(),$s(this),this.P.gr=a,this.g("resizeCellSize",y,a))}},rotateAdornmentTemplate:{get:function(){return this.P!==null?this.P.ir:null},set:function(a){var y=this.rotateAdornmentTemplate;y!==a&&($s(this),this.P.ir=a,this.g("rotateAdornmentTemplate",y,a))}},rotateObjectName:{get:function(){return this.P!==null?this.P.jr:""},set:function(a){var y=this.rotateObjectName;y!==a&&($s(this),this.P.jr=a,this.g("rotateObjectName",y,a))}},rotateObject:{get:function(){var a=this.rotateObjectName;return a!==""&&(a=this.fb(a),a!==null)?a:this}},rotationSpot:{get:function(){return this.P!==null?this.P.lr:Fi},set:function(a){var y=this.rotationSpot;y.D(a)||(a=a.J(),$s(this),this.P.lr=a,this.g("rotationSpot",y,a))}},text:{get:function(){return this.ec},set:function(a){var y=this.ec;y!==a&&(this.ec=a,this.g("text",y,a))}},containingGroup:{get:function(){return this.Ah},set:function(a){if(this.Zc()){var y=this.Ah;if(y!==a){a===null||this!==a&&!a.Td(this)||(this===a&&It("Cannot make a Group a member of itself: "+this.toString()),It("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString())),this.C(2);var x=this.diagram;if(y!==null?G0(y,this):this instanceof An&&x!==null&&x.ai.remove(this),this.Ah=a,a!==null?V0(a,this):this instanceof An&&x!==null&&x.ai.add(this),this.C(1),x!==null&&x.aa){var E=this.data,b=x.model;if(E!==null&&b.Xj()){var z=b.wa(a!==null?a.data:null);b.mp(E,z)}}if(E=this.containingGroupChanged,E!==null&&(b=!0,x!==null&&(b=x.aa,x.aa=!0),E(this,y,a),x!==null&&(x.aa=b)),this instanceof An){for(x=new _e,Yh(x,this,!0,0,!0),x=x.iterator;x.next();)if(E=x.value,E instanceof Ci)for(E=E.linksConnected;E.next();)Nd(E.value)}if(this instanceof Ci){for(x=this.linksConnected;x.next();)Nd(x.value);x=this.labeledLink,x!==null&&Nd(x)}this.g("containingGroup",y,a),a!==null&&(y=a.layer,y!==null&&ed(y,-1,a))}}else It("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{get:function(){return this.P!==null?this.P.Kp:null},set:function(a){var y=this.containingGroupChanged;y!==a&&($s(this),this.P.Kp=a,this.g("containingGroupChanged",y,a))}},isTopLevel:{get:function(){return!(this.containingGroup!==null||this instanceof Ci&&this.labeledLink!==null)}},layoutConditions:{get:function(){return this.P!==null?this.P.Cq:127},set:function(a){var y=this.layoutConditions;y!==a&&($s(this),this.P.Cq=a,this.g("layoutConditions",y,a))}},dragComputation:{get:function(){return this.P!==null?this.P.Up:null},set:function(a){var y=this.dragComputation;y!==a&&($s(this),this.P.Up=a,this.g("dragComputation",y,a))}},shadowOffset:{get:function(){return this.P!==null?this.P.zr:Dr},set:function(a){var y=this.shadowOffset;y.D(a)||(a=a.J(),$s(this),this.P.zr=a,this.N(),this.g("shadowOffset",y,a))}},shadowColor:{get:function(){return this.P!==null?this.P.yr:"gray"},set:function(a){var y=this.shadowColor;y!==a&&($s(this),this.P.yr=a,this.N(),this.g("shadowColor",y,a))}},shadowBlur:{get:function(){return this.P!==null?this.P.Vg:4},set:function(a){var y=this.shadowBlur;y!==a&&($s(this),this.P.Vg=a,this.N(),this.g("shadowBlur",y,a))}}}),tn.prototype.invalidateLayout=tn.prototype.C,tn.prototype.findCommonContainingGroup=tn.prototype.px,tn.prototype.isMemberOf=tn.prototype.Td,tn.prototype.findTopLevelPart=tn.prototype.sz,tn.prototype.findSubGraphLevel=tn.prototype.oz,tn.prototype.ensureBounds=tn.prototype.Va,tn.prototype.getDocumentBounds=tn.prototype.mi,tn.prototype.findObject=tn.prototype.fb,tn.prototype.moveTo=tn.prototype.moveTo,tn.prototype.invalidateAdornments=tn.prototype.Wb,tn.prototype.clearAdornments=tn.prototype.Ej,tn.prototype.removeAdornment=tn.prototype.Jf,tn.prototype.addAdornment=tn.prototype.bh,tn.prototype.findAdornment=tn.prototype.Pj,tn.prototype.updateTargetBindings=tn.prototype.La;var Wx=!1;tn.className="Part",tn.LayoutNone=0,tn.LayoutAdded=1,tn.LayoutRemoved=2,tn.LayoutShown=4,tn.LayoutHidden=8,tn.LayoutNodeSized=16,tn.LayoutGroupLayout=32,tn.LayoutNodeReplaced=64,tn.LayoutStandard=127,tn.LayoutAll=16777215;function cr(a,y){a===void 0||a instanceof Do||typeof a=="string"?tn.call(this,a):(tn.call(this),a&&(y=a)),this.G&=-257,this.Jg="Adornment",this.ue=null,this.Aw=0,this.Uw=!1,this.j=this.$a=null,y&&Object.assign(this,y)}Vi(cr,tn),cr.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(a!==null?a.toString():"")},cr.prototype.updateRelationshipsFromData=function(){},cr.prototype.Ul=function(a){var y=this.adornedObject,x=y==null?void 0:y.part;if(x instanceof fi&&y instanceof Rn){y=x.path,x.Ul(a),a=y.geometry,x=this.O.s,y=x.length;for(var E=0;E<y;E++){var b=x[E];b.isPanelMain&&b instanceof Rn&&(b.ua=a)}}},cr.prototype.si=function(){var a=this.ue;return a===null?!0:(a=a.part,a===null||!Os(a))},cr.prototype.Zc=function(){return!1},cr.prototype.gk=function(a,y,x,E,b,z,tt){if(a===xo&&y==="elements"){if(b instanceof Rs)this.$a===null&&(this.$a=b);else if(b instanceof si){var it=b.Nl(function(nt){return nt instanceof Rs});it instanceof Rs&&this.$a===null&&(this.$a=it)}}else a===Ao&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof si&&this.$a.rg(E)&&(this.$a=null));tn.prototype.gk.call(this,a,y,x,E,b,z,tt)},cr.prototype.updateAdornments=function(){},cr.prototype.Lj=function(){},zi.Object.defineProperties(cr.prototype,{placeholder:{get:function(){return this.$a}},adornedObject:{get:function(){return this.ue},set:function(a){var y=this.adornedPart,x=null;a!==null&&(x=a.part),y===null||a!==null&&y===x||y.Jf(this.category),this.ue=a,x!==null&&x.bh(this.category,this)}},adornedPart:{get:function(){var a=this.ue;return a!==null?a.part:null}},containingGroup:{get:function(){return null}}}),cr.className="Adornment";function W0(){this.nc=!1,this.Vr=this.gj=this.Eq=this.Dq=null,this.yp=Qo,this.er=Wv,this.Kr=this.ij=this.Nq=this.Mq=null}W0.prototype.copy=function(){var a=new W0;return a.Dq=this.Dq,a.Eq=this.Eq,a.gj=this.gj,a.Vr=this.Vr,a.yp=this.yp.J(),a.er=this.er,a.Mq=this.Mq,a.Nq=this.Nq,a.ij=this.ij,a.Kr=this.Kr,a};function Ci(a,y){a===void 0||a instanceof Do||typeof a=="string"?tn.call(this,a):(tn.call(this),a&&(y=a)),this.U=13,this.Ba=null,this.jb=new Me,this.wc=this.af=this.Yk=null,this.ci=!1,y&&Object.assign(this,y)}Vi(Ci,tn),Ci.prototype.cloneProtected=function(a){tn.prototype.cloneProtected.call(this,a),a.U=this.U,this.Ba!==null&&(a.Ba=this.Ba.nc?this.Ba:this.Ba.copy())},yt=Ci.prototype,yt.Af=function(a){tn.prototype.Af.call(this,a),a.Bd(),a.af=this.af,a.wc=null};function hh(a){a.Ba===null?a.Ba=new W0:a.Ba.nc&&(a.Ba=a.Ba.copy())}yt.th=function(){tn.prototype.th.call(this),this.Ba!==null&&(this.Ba.nc=!0)};function Zx(a,y){y!==null&&(a.af===null&&(a.af=new _e),a.af.add(y))}function Kx(a,y,x,E){if(y===null||a.af===null)return null;for(var b=a.af.iterator;b.next();){var z=b.value;if(z.Ds===a&&z.cv===y&&z.Ox===x&&z.Px===E||z.Ds===y&&z.cv===a&&z.Ox===E&&z.Px===x)return z}return null}yt.Lz=function(a,y,x){y==null&&(y=""),x==null&&(x=""),a=Kx(this,a,y,x),a!==null&&a.Sl()},yt.gk=function(a,y,x,E,b,z,tt){a===xo&&y==="elements"?this.wc=null:a===Ao&&y==="elements"&&(this.wc=null),tn.prototype.gk.call(this,a,y,x,E,b,z,tt)},yt.Bd=function(a){for(var y=this.linksConnected;y.next();){var x=y.value;a!==void 0&&a.contains(x)||(va(x.fromPort),va(x.toPort),x.bb())}};function Vx(a,y){for(a=a.linksConnected;a.next();){var x=a.value;(x.fromPort===y||x.toPort===y)&&(va(x.fromPort),va(x.toPort),x.bb())}}function va(a){if(a!==null){var y=a.Zn;y!==null&&y.Sl(),a=a.part,y=a.containingGroup,y===null||a.isVisible()||va(y.port)}}yt.si=function(){return!0},Ci.prototype.getAvoidableRect=function(a){return a.set(this.actualBounds),a.Co(this.avoidableMargin),a},Ci.prototype.findVisibleNode=function(){for(var a=this;a!==null&&!a.isVisible();)a=a.containingGroup;return a},Ci.prototype.isVisible=function(){if(!tn.prototype.isVisible.call(this))return!1;var a=!0,y=rh,x=this.diagram;if(x!==null&&(a=x.isTreePathToChildren,y=x.treeCollapsePolicy),y===rh){if(a=this.pg(),a!==null&&!a.isTreeExpanded)return!1}else if(y===Po){if(a=a?this.Oo():this.Po(),0<a.count&&a.all(function(E){return!E.isTreeExpanded}))return!1}else if(y===dd&&(a=a?this.Oo():this.Po(),0<a.count&&a.any(function(E){return!E.isTreeExpanded})))return!1;return a=this.labeledLink,a!==null?a.isVisible():!0},Ci.prototype.Zb=function(a){tn.prototype.Zb.call(this,a);for(var y=this.linksConnected;y.next();){var x=y.value;if(a&&this.containingGroup!==null){var E=x.To(this);E===null||E.Td(this.containingGroup)||x.bb()}x.Zb(a)}},Ci.prototype.qx=function(){var a=new _e,y=new _e;return Gx(this,this,a,y),y.iterator};function Gx(a,y,x,E){if(y!==null&&!x.has(y)){x.add(y);var b=!0,z=a.diagram;z!==null&&(b=z.isTreePathToChildren),y.linksConnected.each(function(tt){tt.isTreeLink?(b?tt.fromNode===y:tt.toNode===y)&&Gx(a,b?tt.toNode:tt.fromNode,x,E):E.add(tt)})}}Ci.prototype.findLinksConnected=function(a){if(a===void 0&&(a=null),a===null)return this.jb.iterator;var y=new pi(this.jb),x=this;return y.predicate=function(E){return E.fromNode===x&&E.fromPortId===a||E.toNode===x&&E.toPortId===a},y},yt=Ci.prototype,yt.Mo=function(a){a===void 0&&(a=null);var y=new pi(this.jb),x=this;return y.predicate=function(E){return E.fromNode!==x?!1:a===null?!0:E.fromPortId===a},y},yt.Sd=function(a){a===void 0&&(a=null);var y=new pi(this.jb),x=this;return y.predicate=function(E){return E.toNode!==x?!1:a===null?!0:E.toPortId===a},y},yt.Mu=function(a){a===void 0&&(a=null);for(var y=null,x=null,E=this.jb.iterator;E.next();){var b=E.value;b.fromNode===this?(a===null||b.fromPortId===a)&&(b=b.toNode,y!==null?y.add(b):x!==null&&x!==b?(y=new _e,y.add(x),y.add(b)):x=b):b.toNode!==this||a!==null&&b.toPortId!==a||(b=b.fromNode,y!==null?y.add(b):x!==null&&x!==b?(y=new _e,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new $e(x):ke},yt.Po=function(a){a===void 0&&(a=null);for(var y=null,x=null,E=this.jb.iterator;E.next();){var b=E.value;b.fromNode!==this||a!==null&&b.fromPortId!==a||(b=b.toNode,y!==null?y.add(b):x!==null&&x!==b?(y=new _e,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new $e(x):ke},yt.Oo=function(a){a===void 0&&(a=null);for(var y=null,x=null,E=this.jb.iterator;E.next();){var b=E.value;b.toNode!==this||a!==null&&b.toPortId!==a||(b=b.fromNode,y!==null?y.add(b):x!==null&&x!==b?(y=new _e,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new $e(x):ke},yt.jz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new pi(this.jb),b=this;return E.predicate=function(z){return!((z.fromNode!==b||z.toNode!==a||y!==null&&z.fromPortId!==y||x!==null&&z.toPortId!==x)&&(z.fromNode!==a||z.toNode!==b||x!==null&&z.fromPortId!==x||y!==null&&z.toPortId!==y))},E},yt.kz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new pi(this.jb),b=this;return E.predicate=function(z){return!(z.fromNode!==b||z.toNode!==a||y!==null&&z.fromPortId!==y||x!==null&&z.toPortId!==x)},E};function _v(a,y,x){va(x);var E=a.jb.contains(y);if(E||a.jb.add(y),!E||y.fromNode===y.toNode){var b=a.linkConnected;if(b!==null){var z=!0,tt=a.diagram;tt!==null&&(z=tt.aa,tt.aa=!0),b(a,y,x),tt!==null&&(tt.aa=z)}}!E&&y.isTreeLink&&(x=y.fromNode,y=y.toNode,x!==null&&y!==null&&x!==y&&(E=!0,a=a.diagram,a!==null&&(E=a.isTreePathToChildren),b=E?y:x,z=E?x:y,b.ci||(b.ci=z),!z.isTreeLeaf||a!==null&&a.undoManager.isUndoingRedoing||(E?x===z&&(z.isTreeLeaf=!1):y===z&&(z.isTreeLeaf=!1))))}function Hv(a,y,x){va(x);var E=a.jb.remove(y),b=null;if(E||y.toNode===y.fromNode){var z=a.linkDisconnected;if(b=a.diagram,z!==null){var tt=!0;b!==null&&(tt=b.aa,b.aa=!0),z(a,y,x),b!==null&&(b.aa=tt)}}E&&y.isTreeLink&&(x=!0,b!==null&&(x=b.isTreePathToChildren),a=x?y.toNode:y.fromNode,y=x?y.fromNode:y.toNode,a!==null&&(a.ci=!1),y===null||y.isTreeLeaf||(y.jb.count===0?(y.ci=null,b!==null&&b.undoManager.isUndoingRedoing||(y.isTreeLeaf=!0)):Yp(y)))}function Yp(a){if(a.ci=!1,a.jb.count!==0){var y=!0,x=a.diagram;if(x===null||!x.undoManager.isUndoingRedoing){for(x!==null&&(y=x.isTreePathToChildren),x=a.jb.iterator;x.next();){var E=x.value;if(E.isTreeLink){if(y){if(E.fromNode===a){a.isTreeLeaf=!1;return}}else if(E.toNode===a){a.isTreeLeaf=!1;return}}}a.isTreeLeaf=!0}}}Ci.prototype.updateRelationshipsFromData=function(){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)},yt=Ci.prototype,yt.Vo=function(a){tn.prototype.Vo.call(this,a),a||(Yp(this),a=this.Yk,a!==null&&e1(a,this))},yt.Wo=function(a){tn.prototype.Wo.call(this,a),a||(a=this.Yk,a!==null&&a.wd!==null&&(a.wd.remove(this),a.v()))},yt.Lj=function(){if(0<this.jb.count){var a=this.diagram;if(a!==null)for(var y=a.commandHandler!==null?a.commandHandler.deletesConnectedLinks:!0,x=this.jb.copy().iterator;x.next();){var E=x.value;y?a.remove(E):(E.fromNode===this&&(E.fromNode=null),E.toNode===this&&(E.toNode=null))}}this.labeledLink=null,tn.prototype.Lj.call(this)},yt.ns=function(a){if(this.wc===null){if(a===""&&this.Te===!1)return this;Ux(this)}var y=this.wc.I(a);return y!==null||a!==""&&(y=this.wc.I(""),y!==null)?y:this};function Ux(a){a.wc===null?a.wc=new ji:a.wc.clear(),a.qm(a,function(y,x){Yx(y,x)}),a.wc.count===0&&a.wc.add("",a)}function Yx(a,y){var x=y.portId;x!==null&&a.wc!==null&&a.wc.add(x,y)}function Z0(a,y,x){var E=y.portId;if(E!==null&&(a.wc!==null&&a.wc.remove(E),y=a.diagram,y!==null&&x)){for(x=null,a=a.findLinksConnected(E);a.next();)E=a.value,x===null&&(x=ii()),x.push(E);if(x!==null){for(a=0;a<x.length;a++)y.remove(x[a]);Hi(x)}}}yt.Nz=function(a){if(a===null||a===this)return!1;var y=!0,x=this.diagram;if(x!==null&&(y=x.isTreePathToChildren),x=this,y)for(;x!==a;){y=null;for(var E=x.jb.iterator;E.next();){var b=E.value;if(b.isTreeLink&&(y=b.fromNode,y!==x&&y!==this))break}if(y===this||y===null||y===x)return!1;x=y}else for(;x!==a;){for(y=null,E=x.jb.iterator;E.next()&&(b=E.value,!b.isTreeLink||(y=b.toNode,y===x||y===this)););if(y===this||y===null||y===x)return!1;x=y}return!0},yt.xz=function(){var a=!0,y=this.diagram;if(y!==null&&(a=y.isTreePathToChildren),y=this,a)for(;;){a=null;for(var x=y.jb.iterator;x.next();){var E=x.value;if(E.isTreeLink&&(a=E.fromNode,a!==y&&a!==this))break}if(a===this)return this;if(a===null||a===y)return y;y=a}else for(;;){for(a=null,x=y.jb.iterator;x.next()&&(E=x.value,!E.isTreeLink||(a=E.toNode,a===y||a===this)););if(a===this)return this;if(a===null||a===y)return y;y=a}},yt.gz=function(a){if(a===null)return null;if(this===a)return this;for(var y=this;y!==null;)zv(y,!0),y=y.pg();var x=null;for(y=a;y!==null;){if(y.G&1048576){x=y;break}y=y.pg()}for(y=this;y!==null;)zv(y,!1),y=y.pg();return x},yt.kh=function(){var a=!0,y=this.diagram;if(y!==null&&(a=y.isTreePathToChildren),y=this.jb.iterator,a){for(;y.next();)if(a=y.value,a.isTreeLink&&a.fromNode!==this)return a}else for(;y.next();)if(a=y.value,a.isTreeLink&&a.toNode!==this)return a;return null},yt.pg=function(){var a=this.ci;if(a===null)return null;if(a instanceof Ci)return a;a=this.diagram,a=a!==null?a.isTreePathToChildren:!0;for(var y=this.jb.iterator;y.next();){var x=y.value;if(x.isTreeLink&&(x=a?x.fromNode:x.toNode,x!==this))return this.ci=x}return this.ci=null},yt.vz=function(){function a(x,E){E.add(x);var b=x.kh();b!==null&&(E.add(b),x=x.pg(),x!==null&&a(x,E))}var y=new _e;return a(this,y),y},yt.uz=function(){return Xx(this,this)};function Xx(a,y){return y=y.pg(),y===null?0:1+Xx(a,y)}yt.Qo=function(){var a=!0,y=this.diagram;y!==null&&(a=y.isTreePathToChildren),y=new pi(this.jb);var x=this;return y.predicate=a?function(E){return!!(E.isTreeLink&&E.fromNode===x)}:function(E){return!!(E.isTreeLink&&E.toNode===x)},y},yt.Ou=function(){var a=!0,y=this.diagram;y!==null&&(a=y.isTreePathToChildren);var x=y=null,E=this.jb.iterator;if(a)for(;E.next();)a=E.value,a.isTreeLink&&a.fromNode===this&&(a=a.toNode,y!==null?y.add(a):x!==null&&x!==a?(y=new Me,y.add(x),y.add(a)):x=a);else for(;E.next();)a=E.value,a.isTreeLink&&a.toNode===this&&(a=a.fromNode,y!==null?y.add(a):x!==null&&x!==a?(y=new Me,y.add(x),y.add(a)):x=a);return y!==null?y.iterator:x!==null?new $e(x):ke},yt.wz=function(a){a===void 0&&(a=1/0);var y=new _e;return Yh(y,this,!1,a,!0),y},Ci.prototype.collapseTree=function(a){a===void 0&&(a=1),1>a&&(a=1);var y=this.diagram;if(y!==null&&!y.Ue){y.Ue=!0;var x=new _e;x.add(this),Jx(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===rh),y.Ue=!1}};function Jx(a,y,x,E,b,z,tt){if(1<E)for(var it=x?a.Mo():a.Sd();it.next();){var nt=it.value;nt.isTreeLink&&(nt=nt.To(a),nt===null||nt===a||y.contains(nt)||(y.add(nt),Jx(nt,y,x,E-1,b,z,tt)))}else Qx(a,y,x,b,z,tt)}function Qx(a,y,x,E,b,z){for(var tt=b===a?!0:a.isTreeExpanded,it=x?a.Mo():a.Sd(),nt={};it.next();){var ot=it.value;if(ot.isTreeLink&&(ot=ot.To(a),ot!==null&&ot!==a)){var st=y.contains(ot);if(st||y.add(ot),tt){var ut=x?ot.Oo():ot.Po();nt.uv=a,ut.all(function(ct){return function(dt){return dt===ct.uv||!dt.isTreeExpanded}}(nt))&&E.Aj(ot,b),ot.oh(),ot.Zb(!1)}ot.isTreeExpanded&&(ot.wasTreeExpanded=ot.isTreeExpanded,st||Qx(ot,y,x,E,b,z))}nt={uv:nt.uv}}a.isTreeExpanded=!1}Ci.prototype.expandTree=function(a){a===void 0&&(a=2),2>a&&(a=2);var y=this.diagram;if(y!==null&&!y.Ue){y.Ue=!0;var x=new _e;x.add(this),$x(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===rh),y.Ue=!1}};function $x(a,y,x,E,b,z,tt){for(var it=z===a?!1:a.isTreeExpanded,nt=x?a.Mo():a.Sd(),ot={};nt.next();){var st=nt.value;if(st.isTreeLink&&(it||st.fd||st.bb(),st=st.To(a),st!==null&&st!==a&&!y.contains(st))){if(y.add(st),!it){st.Zb(!0),st.oh();var ut=x?st.Oo():st.Po();ot.vv=a,ut.all(function(ct){return function(dt){return dt===ct.vv||!dt.isTreeExpanded}}(ot))&&b.Cj(st,z)}(2<E||st.wasTreeExpanded)&&(st.wasTreeExpanded=!1,$x(st,y,x,E-1,b,z,tt))}ot={vv:ot.vv}}a.isTreeExpanded=!0}zi.Object.defineProperties(Ci.prototype,{portSpreading:{get:function(){return this.Ba!==null?this.Ba.er:Wv},set:function(a){var y=this.portSpreading;y!==a&&(hh(this),this.Ba.er=a,this.g("portSpreading",y,a),a=this.diagram,a!==null&&a.undoManager.isUndoingRedoing||this.Bd())}},avoidable:{get:function(){return(this.U&8)!==0},set:function(a){var y=(this.U&8)!==0;if(y!==a){this.U^=8;var x=this.diagram;x!==null&&ih(x,this),this.g("avoidable",y,a)}}},avoidableMargin:{get:function(){return this.Ba!==null?this.Ba.yp:Qo},set:function(a){typeof a=="number"&&(a=new jn(a));var y=this.avoidableMargin;if(!y.D(a)){a=a.J(),hh(this),this.Ba.yp=a;var x=this.diagram;x!==null&&ih(x,this),this.g("avoidableMargin",y,a)}}},linksConnected:{get:function(){return this.jb.iterator}},linkConnected:{get:function(){return this.Ba!==null?this.Ba.Dq:null},set:function(a){var y=this.linkConnected;y!==a&&(hh(this),this.Ba.Dq=a,this.g("linkConnected",y,a))}},linkDisconnected:{get:function(){return this.Ba!==null?this.Ba.Eq:null},set:function(a){var y=this.linkDisconnected;y!==a&&(hh(this),this.Ba.Eq=a,this.g("linkDisconnected",y,a))}},linkValidation:{get:function(){return this.Ba!==null?this.Ba.gj:null},set:function(a){var y=this.linkValidation;y!==a&&(hh(this),this.Ba.gj=a,this.g("linkValidation",y,a))}},isLinkLabel:{get:function(){return this.Yk!==null}},labeledLink:{get:function(){return this.Yk},set:function(a){var y=this.Yk;if(y!==a){var x=this.diagram,E=this.data;if(y!==null){if(y.wd!==null&&(y.wd.remove(this),y.v()),x!==null&&E!==null&&!x.undoManager.isUndoingRedoing){var b=y.data,z=x.model;if(b!==null&&z.ri()){var tt=z.wa(E);tt!==void 0&&z.Qx(b,tt)}}this.containingGroup=null}this.Yk=a,a!==null&&(e1(a,this),x===null||E===null||x.undoManager.isUndoingRedoing||(b=a.data,x=x.model,b!==null&&x.ri()&&(E=x.wa(E),E!==void 0&&x.Bu(b,E))),this.containingGroup=a.containingGroup),Bs(this),this.g("labeledLink",y,a)}}},port:{get:function(){return this.ns("")}},ports:{get:function(){return this.wc===null&&Ux(this),this.wc.iteratorValues}},isTreeExpanded:{get:function(){return(this.U&1)!==0},set:function(a){var y=(this.U&1)!==0;if(y!==a){this.U^=1;var x=this.diagram;if(this.g("isTreeExpanded",y,a),y=this.treeExpandedChanged,y!==null){var E=!0;x!==null&&(E=x.aa,x.aa=!0),y(this),x!==null&&(x.aa=E)}x!==null&&x.undoManager.isUndoingRedoing?this.Zb(a):a?this.expandTree():this.collapseTree()}}},wasTreeExpanded:{get:function(){return(this.U&2)!==0},set:function(a){var y=(this.U&2)!==0;y!==a&&(this.U^=2,this.g("wasTreeExpanded",y,a))}},treeExpandedChanged:{get:function(){return this.Ba!==null?this.Ba.Vr:null},set:function(a){var y=this.treeExpandedChanged;y!==a&&(hh(this),this.Ba.Vr=a,this.g("treeExpandedChanged",y,a))}},isTreeLeaf:{get:function(){return(this.U&4)!==0},set:function(a){var y=(this.U&4)!==0;y!==a&&(this.U^=4,this.g("isTreeLeaf",y,a))}}}),Ci.prototype.expandTree=Ci.prototype.expandTree,Ci.prototype.collapseTree=Ci.prototype.collapseTree,Ci.prototype.findTreeParts=Ci.prototype.wz,Ci.prototype.findTreeChildrenNodes=Ci.prototype.Ou,Ci.prototype.findTreeChildrenLinks=Ci.prototype.Qo,Ci.prototype.findTreeLevel=Ci.prototype.uz,Ci.prototype.findTreeParentChain=Ci.prototype.vz,Ci.prototype.findTreeParentNode=Ci.prototype.pg,Ci.prototype.findTreeParentLink=Ci.prototype.kh,Ci.prototype.findCommonTreeParent=Ci.prototype.gz,Ci.prototype.findTreeRoot=Ci.prototype.xz,Ci.prototype.isInTreeOf=Ci.prototype.Nz,Ci.prototype.findPort=Ci.prototype.ns,Ci.prototype.findLinksTo=Ci.prototype.kz,Ci.prototype.findLinksBetween=Ci.prototype.jz,Ci.prototype.findNodesInto=Ci.prototype.Oo,Ci.prototype.findNodesOutOf=Ci.prototype.Po,Ci.prototype.findNodesConnected=Ci.prototype.Mu,Ci.prototype.findLinksInto=Ci.prototype.Sd,Ci.prototype.findLinksOutOf=Ci.prototype.Mo,Ci.prototype.findExternalTreeLinksConnected=Ci.prototype.qx,Ci.prototype.invalidateConnectedLinks=Ci.prototype.Bd,Ci.prototype.invalidateLinkBundle=Ci.prototype.Lz;var Lw=new ze(Ci,"SpreadingNone",10),Wv=new ze(Ci,"SpreadingEvenly",11),K0=new ze(Ci,"SpreadingPacked",12);Ci.className="Node",Ci.SpreadingNone=Lw,Ci.SpreadingEvenly=Wv,Ci.SpreadingPacked=K0;function An(a,y){a===void 0||a instanceof Do||typeof a=="string"?Ci.call(this,a):(Ci.call(this),a&&(y=a)),this.U|=4608,this.Gn=new _e,this.$a=null,this.Sc=new Gr,this.Sc.group=this,this.gl=new _e,this.tb=this.$p=null,y&&Object.assign(this,y)}Vi(An,Ci),An.prototype.cloneProtected=function(a){Ci.prototype.cloneProtected.call(this,a),this.U=this.U&-32769;var y=a.Nl(function(x){return x instanceof Rs});y instanceof Rs?a.$a=y:a.$a=null,this.Sc!==null?(a.Sc=this.Sc.copy(),a.Sc.group=a):(a.Sc!==null&&(a.Sc.group=null),a.Sc=null),this.tb!==null&&(a.tb=this.tb.copy())},yt=An.prototype,yt.Af=function(a){Ci.prototype.Af.call(this,a);var y=a.Rj();for(a=a.memberParts;a.next();){var x=a.value;if(x.v(),x.C(8),x.Ej(),x instanceof Ci)x.Bd(y);else if(x instanceof fi)for(x=x.labelNodes;x.next();)x.value.Bd(y)}},yt.gk=function(a,y,x,E,b,z,tt){if(a===xo&&y==="elements"){if(b instanceof Rs)this.$a===null?this.$a=b:this.$a!==b&&It("Cannot insert a second Placeholder into the visual tree of a Group.");else if(b instanceof si){var it=b.Nl(function(nt){return nt instanceof Rs});it instanceof Rs&&(this.$a===null?this.$a=it:this.$a!==it&&It("Cannot insert a second Placeholder into the visual tree of a Group."))}}else a===Ao&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof si&&this.$a.rg(E)&&(this.$a=null));Ci.prototype.gk.call(this,a,y,x,E,b,z,tt)},yt.Xl=function(a,y){Ci.prototype.Xl.call(this,a,y),this.isClipping&&this.type!==si.Spot&&this.isSubGraphExpanded&&(a=this.resizeObject,a instanceof si&&(a=a.Pb()),this.tb===null&&(this.tb=new be),a.mi(this.tb),a instanceof Rn&&this.tb.Bc(-a.strokeWidth,-a.strokeWidth))},yt.eh=function(a,y,x,E){this.nf=this.$a,Ci.prototype.eh.call(this,a,y,x,E)},yt.Va=function(){var a=this;a.isSubGraphExpanded&&this.memberParts.each(function(y){!a.computesBoundsIncludingLinks&&y instanceof fi||y.Va()}),Ci.prototype.Va.call(this)},yt.si=function(){if(!Ci.prototype.si.call(this))return!1;for(var a=this.memberParts;a.next();){var y=a.value;if(y instanceof Ci){if(y.isVisible()&&Os(y))return!1}else if(y instanceof fi&&y.isVisible()&&Os(y)&&y.fromNode!==this&&y.toNode!==this)return!1}return!0};function V0(a,y){if(a.Gn.add(y)){y instanceof An&&a.gl.add(y);var x=a.memberAdded;if(x!==null){var E=!0,b=a.diagram;b!==null&&(E=b.aa,b.aa=!0),x(a,y),b!==null&&(b.aa=E)}a.isVisible()&&a.isSubGraphExpanded||y.Zb(!1)}y instanceof fi&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}function G0(a,y){if(a.Gn.remove(y)){y instanceof An&&a.gl.remove(y);var x=a.memberRemoved;if(x!==null){var E=!0,b=a.diagram;b!==null&&(E=b.aa,b.aa=!0),x(a,y),b!==null&&(b.aa=E)}a.isVisible()&&a.isSubGraphExpanded||y.Zb(!0)}y instanceof fi&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}yt.Lj=function(){if(0<this.Gn.count){var a=this.diagram;if(a!==null)for(var y=this.Gn.copy().iterator;y.next();)a.remove(y.value)}Ci.prototype.Lj.call(this)},An.prototype.canAddMembers=function(a){var y=this.diagram;if(y===null)return!1;for(y=y.commandHandler,a=Ee(a).iterator;a.next();)if(!y.isValidMember(this,a.value))return!1;return!0},An.prototype.addMembers=function(a,y){var x=this.diagram;if(x===null)return!1;x=x.commandHandler;var E=!0;for(a=Ee(a).iterator;a.next();){var b=a.value;!y||x.isValidMember(this,b)?b.containingGroup=this:E=!1}return E},An.prototype.canUngroup=function(){if(!this.ungroupable)return!1;var a=this.layer;return a===null||!a.allowUngroup?!1:(a=a.diagram,!!(a===null||a.allowUngroup))},yt=An.prototype,yt.Bd=function(a){var y=(this.U&65536)!==0;if(Ci.prototype.Bd.call(this,a),!y)for(!(this.U&65536)&&(this.U=this.U^65536),y=this.Lu();y.next();){var x=y.value;if(a===void 0||!a.contains(x)){var E=x.fromNode;E!==null&&E!==this&&E.Td(this)&&!E.isVisible()?(va(x.fromPort),va(x.toPort),x.bb()):(E=x.toNode,E!==null&&E!==this&&E.Td(this)&&!E.isVisible()&&(va(x.fromPort),va(x.toPort),x.bb()))}}},yt.Lu=function(){var a=this.diagram!==null&&this.diagram.Pw;if(a&&this.$p!==null)return this.$p.iterator;var y=this.Rj();y.add(this);for(var x=new _e,E=y.iterator;E.next();){var b=E.value;if(b instanceof Ci)for(b=b.linksConnected;b.next();){var z=b.value;y.contains(z)||x.add(z)}}return a&&(this.$p=x),x.iterator},yt.iz=function(){var a=this.Rj();a.add(this);for(var y=new _e,x=a.iterator;x.next();){var E=x.value;if(E instanceof Ci)for(E=E.linksConnected;E.next();){var b=E.value,z=b.fromNode;z===null||a.contains(z)&&z!==this||y.add(z),b=b.toNode,b===null||a.contains(b)&&b!==this||y.add(b)}}return y.iterator},yt.hz=function(){function a(x,E){x!==null&&(E.add(x),a(x.containingGroup,E))}var y=new _e;return a(this,y),y},yt.Rj=function(){var a=new _e;return Yh(a,this,!0,0,!0),a.remove(this),a},yt.Zb=function(a){Ci.prototype.Zb.call(this,a);for(var y=this.memberParts;y.next();)y.value.Zb(a)},An.prototype.collapseSubGraph=function(){var a=this.diagram;if(a!==null&&!a.Ue){a.Ue=!0;var y=this.Rj();qx(this,y,a,this),a.Ue=!1}};function qx(a,y,x,E){for(var b=a.memberParts;b.next();){var z=b.value;if(z.Zb(!1),z instanceof An&&z.isSubGraphExpanded&&(z.wasSubGraphExpanded=z.isSubGraphExpanded,qx(z,y,x,E)),z instanceof Ci)z.Bd(y),x.Aj(z,E);else if(z instanceof fi)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!1}An.prototype.expandSubGraph=function(){var a=this.diagram;if(a!==null&&!a.Ue){a.Ue=!0;var y=this.Rj();t1(this,y,a,this),a.Ue=!1}};function t1(a,y,x,E){for(var b=a.memberParts;b.next();){var z=b.value;if(z.Zb(!0),z instanceof An&&z.wasSubGraphExpanded&&(z.wasSubGraphExpanded=!1,t1(z,y,x,E)),z instanceof Ci)z.Bd(y),x.Cj(z,E);else if(z instanceof fi)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!0}An.prototype.move=function(a,y){y===void 0&&(y=!1);var x=y?this.location:this.position,E=x.x;x=x.y;var b=a.x,z=a.y;if(!(E===b||isNaN(E)&&isNaN(b))||!(x===z||isNaN(x)&&isNaN(z))){for(E=b-(isNaN(E)?0:E),x=z-(isNaN(x)?0:x),z=Pt.alloc(),Ci.prototype.move.call(this,a,y),a=new _e,y=this.Rj().iterator;y.next();)b=y.value,b instanceof fi&&(b.suspendsRouting&&a.add(b),b.fd||b.fromNode!==this&&b.toNode!==this)&&(b.suspendsRouting=!0);for(y.reset();y.next();)if(b=y.value,!(b.ph()||b instanceof Ci&&b.isLinkLabel)){var tt=b.position,it=b.location;tt.w()?(z.x=tt.x+E,z.y=tt.y+x,b.position=z):it.w()&&(z.x=it.x+E,z.y=it.y+x,b.location=z)}for(y.reset();y.next();)b=y.value,b instanceof fi&&(b.suspendsRouting=a.contains(b),b.fd||b.fromNode!==this&&b.toNode!==this)&&(tt=b.position,z.x=tt.x+E,z.y=tt.y+x,z.w()?b.move(z):b.bb(),Y0(b)&&b.bb());Pt.free(z)}},zi.Object.defineProperties(An.prototype,{placeholder:{get:function(){return this.$a}},computesBoundsAfterDrag:{get:function(){return(this.U&2048)!==0},set:function(a){var y=(this.U&2048)!==0;y!==a&&(this.U^=2048,this.g("computesBoundsAfterDrag",y,a))}},computesBoundsIncludingLinks:{get:function(){return(this.U&4096)!==0},set:function(a){var y=(this.U&4096)!==0;y!==a&&(this.U^=4096,this.g("computesBoundsIncludingLinks",y,a))}},computesBoundsIncludingLocation:{get:function(){return(this.U&8192)!==0},set:function(a){var y=(this.U&8192)!==0;y!==a&&(this.U^=8192,this.g("computesBoundsIncludingLocation",y,a))}},handlesDragDropForMembers:{get:function(){return(this.U&16384)!==0},set:function(a){var y=(this.U&16384)!==0;y!==a&&(this.U^=16384,this.g("handlesDragDropForMembers",y,a))}},memberParts:{get:function(){return this.Gn.iterator}},layout:{get:function(){return this.Sc},set:function(a){var y=this.Sc;if(y!==a){a!==null&&a.diagram!==null&&a.diagram.layout===a&&It("A layout cannot be both the Diagram.layout and a Group.layout: "+a),y!==null&&(y.diagram=null,y.group=null),this.Sc=a;var x=this.diagram;a!==null&&(a.diagram=x,a.group=this),x!==null&&(x.xh=!0),this.g("layout",y,a),x!==null&&x.$b()}}},memberAdded:{get:function(){return this.Ba!==null?this.Ba.Mq:null},set:function(a){var y=this.memberAdded;y!==a&&(hh(this),this.Ba.Mq=a,this.g("memberAdded",y,a))}},memberRemoved:{get:function(){return this.Ba!==null?this.Ba.Nq:null},set:function(a){var y=this.memberRemoved;y!==a&&(hh(this),this.Ba.Nq=a,this.g("memberRemoved",y,a))}},memberValidation:{get:function(){return this.Ba!==null?this.Ba.ij:null},set:function(a){var y=this.memberValidation;y!==a&&(hh(this),this.Ba.ij=a,this.g("memberValidation",y,a))}},ungroupable:{get:function(){return(this.U&256)!==0},set:function(a){var y=(this.U&256)!==0;y!==a&&(this.U^=256,this.g("ungroupable",y,a))}},isSubGraphExpanded:{get:function(){return(this.U&512)!==0},set:function(a){var y=(this.U&512)!==0;if(y!==a){this.U^=512;var x=this.diagram;if(this.g("isSubGraphExpanded",y,a),y=this.subGraphExpandedChanged,y!==null){var E=!0;x!==null&&(E=x.aa,x.aa=!0),y(this),x!==null&&(x.aa=E)}x!==null&&x.undoManager.isUndoingRedoing?(this.$a!==null&&this.$a.v(),this.memberParts.each(function(b){b.updateAdornments()})):a?this.expandSubGraph():this.collapseSubGraph()}}},wasSubGraphExpanded:{get:function(){return(this.U&1024)!==0},set:function(a){var y=(this.U&1024)!==0;y!==a&&(this.U^=1024,this.g("wasSubGraphExpanded",y,a))}},subGraphExpandedChanged:{get:function(){return this.Ba!==null?this.Ba.Kr:null},set:function(a){var y=this.subGraphExpandedChanged;y!==a&&(hh(this),this.Ba.Kr=a,this.g("subGraphExpandedChanged",y,a))}},rh:{get:function(){return(this.U&32768)!==0},set:function(a){(this.U&32768)!==0!==a&&(this.U^=32768)}}}),An.prototype.expandSubGraph=An.prototype.expandSubGraph,An.prototype.collapseSubGraph=An.prototype.collapseSubGraph,An.prototype.findSubGraphParts=An.prototype.Rj,An.prototype.findContainingGroupChain=An.prototype.hz,An.prototype.findExternalNodesConnected=An.prototype.iz,An.prototype.findExternalLinksConnected=An.prototype.Lu,An.prototype.ensureBounds=An.prototype.Va,An.className="Group";function Rs(a){Kt.call(this),this.yb=Vs,this.ko=new be(NaN,NaN,NaN,NaN),a&&Object.assign(this,a)}Vi(Rs,Kt),Rs.prototype.cloneProtected=function(a){Kt.prototype.cloneProtected.call(this,a),a.yb=this.yb.J(),a.ko=this.ko.copy()},Rs.prototype.gh=function(a){if(this.background===null&&this.areaBackground===null)return!1;var y=this.naturalBounds;return Io(0,0,y.width,y.height,a.x,a.y)},Rs.prototype.Wl=function(){var a=this.part;if(a!==null&&(a instanceof An||a instanceof cr)||It("Placeholder is not inside a Group or Adornment."),a instanceof An){var y=this.computeBorder(this.ko),x=this.minSize,E=this.dc;for(Oo(E,(isFinite(x.width)?Math.max(x.width,y.width):y.width)||0,(isFinite(x.height)?Math.max(x.height,y.height):y.height)||0),this.Ge(0,0,E.width,E.height),E=a.memberParts,x=!1;E.next();)if(E.value.isVisible()){x=!0;break}E=a.diagram,!x||E===null||E.animationManager.Xu(a)||isNaN(y.x)||isNaN(y.y)||(x=Pt.alloc(),x.xi(y,a.locationSpot),x.D(a.location)||(a.location=x),Pt.free(x))}else{y=this.dc,x=this.yb,E=x.left+x.right;var b=x.top+x.bottom,z=a.adornedObject;a.angle=z.li();var tt=0;z instanceof Rn&&(tt=z.strokeWidth);var it=z.Df(),nt=z.naturalBounds,ot=(nt.width+tt)*it;tt=(nt.height+tt)*it,a.type!==si.Link&&(it=z.ga(a.category==="Selection"?qn:a.locationSpot,Pt.alloc()),a.location=it,Pt.free(it)),isNaN(ot)||isNaN(tt)?(a=z.ga(qn,Pt.alloc()),ot=be.allocAt(a.x,a.y,0,0),ot.Ye(z.ga(vo,a)),ot.Ye(z.ga(Nr,a)),ot.Ye(z.ga(os,a)),Oo(y,ot.width+E||0,ot.height+b||0),this.Ge(-x.left,-x.top,y.width,y.height),Pt.free(a),be.free(ot)):(Oo(y,ot+E||0,tt+b||0),this.Ge(-x.left,-x.top,y.width,y.height))}},Rs.prototype.eh=function(a,y,x,E){this.actualBounds.h(a,y,x,E)},Rs.prototype.computeBorder=function(a){var y=this.part,x=y.diagram,E=x===null||!x.animationManager.isAnimating;if(x!==null&&y instanceof An&&!y.layer.isTemporary&&y.computesBoundsAfterDrag&&this.ko.w()){var b=x.toolManager.findTool("Dragging");if(b===x.currentTool&&(x=b.computeBorder(y,this.ko,a),x!==null))return x}x=be.alloc(),b=this.computeMemberBounds(x);var z=this.yb;return y instanceof An&&!y.isSubGraphExpanded?a.h(b.x-z.left,b.y-z.top,0,0):a.h(b.x-z.left,b.y-z.top,Math.max(b.width+z.left+z.right,0),Math.max(b.height+z.top+z.bottom,0)),be.free(x),E&&y instanceof An&&y.computesBoundsIncludingLocation&&y.location.w()&&a.Ye(y.location),a},Rs.prototype.computeMemberBounds=function(a){if(!(this.part instanceof An))return a.h(0,0,0,0),a;for(var y=this.part,x=1/0,E=1/0,b=-1/0,z=-1/0,tt=y.memberParts;tt.next();){var it=tt.value;if(it.isVisible()){if(it instanceof fi&&(!y.computesBoundsIncludingLinks||Ta(it)||it.fromNode===y||it.toNode===y))continue;it=it.actualBounds,it.left<x&&(x=it.left),it.top<E&&(E=it.top),it.right>b&&(b=it.right),it.bottom>z&&(z=it.bottom)}}return isFinite(x)&&isFinite(E)?a.h(x,E,b-x,z-E):(y=y.location,a.h(y.x,y.y,0,0)),a},zi.Object.defineProperties(Rs.prototype,{padding:{get:function(){return this.yb},set:function(a){typeof a=="number"&&(a=new jn(a));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.g("padding",y,a),this.v())}}}),Rs.className="Placeholder";function fi(a){tn.call(this,si.Link),this.Qa=8,this.ef=null,this.ff="",this.uf=this.gn=null,this.vf="",this.uo=null,this.qk=js,this.Om=0,this.Qm=js,this.Rm=NaN,this.qj=Q0,this.po=.5,this.wd=null,this.Nb=new Me().freeze(),this.Tg=this.Mg=null,this.ml=new be,this.ua=new ci,this.u=this.o=this.Sf=this.Wf=null,this.su=new Pt,this.cq=this.Mw=this.Lw=null,this.vt=NaN,this.ba=null,this.j=[],a&&Object.assign(this,a)}Vi(fi,tn),fi.prototype.cloneProtected=function(a){tn.prototype.cloneProtected.call(this,a),a.Qa=this.Qa&-113,a.ff=this.ff,a.gn=this.gn,a.vf=this.vf,a.uo=this.uo,a.qk=this.qk,a.Om=this.Om,a.Qm=this.Qm,a.Rm=this.Rm,a.qj=this.qj,a.po=this.po,this.ba!==null&&(a.ba=this.ba.copy())},yt=fi.prototype,yt.Af=function(a){tn.prototype.Af.call(this,a),this.ff=a.ff,this.vf=a.vf,a.Mg=null,a.bb(),a.Sf=this.Sf;var y=a.fromPort;y!==null&&va(y),a=a.toPort,a!==null&&va(a)},yt.qb=function(a){a.classType===fi?(a.value&2)===2?this.routing=a:a===Aa||a===fh||a===Ld?this.curve=a:a===Qp||a===Yv||a===Xv?this.adjusting=a:a!==Q0&&a!==js&&It("Unknown Link enum value for a Link property: "+a):tn.prototype.qb.call(this,a)},yt.Xc=function(){this.ba===null&&(this.ba=new Rp)},yt.si=function(){var a=this.fromNode;if(a!==null){var y=a.findVisibleNode();if(y!==null&&(a=y),Os(a)||Gh(a))return!1}return a=this.toNode,!(a!==null&&(y=a.findVisibleNode(),y!==null&&(a=y),Os(a)||Gh(a)))},yt.zv=function(){return!1},yt.Av=function(){},yt.Zc=function(){return!1},fi.prototype.computeAngle=function(a,y,x){return fi.computeAngle(y,x)},fi.computeAngle=function(a,y){switch(a){default:case js:a=0;break;case $p:a=y;break;case qp:a=y+90;break;case tg:a=y-90;break;case $0:a=y+180;break;case Jv:a=Gt.bp(y),90<a&&270>a&&(a-=180);break;case eg:a=Gt.bp(y+90),90<a&&270>a&&(a-=180);break;case ig:a=Gt.bp(y-90),90<a&&270>a&&(a-=180);break;case Qv:if(a=Gt.bp(y),45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return Gt.bp(a)};function Nd(a){var y=a.fromNode,x=a.toNode,E=null;if(y!==null?E=x!==null?y.px(x):y.containingGroup:x!==null?E=x.containingGroup:E=null,y=E,x=a.Ah,x!==y){x!==null&&G0(x,a),a.Ah=y,y!==null&&V0(y,a);var b=a.containingGroupChanged;if(b!==null){var z=!0,tt=a.diagram;tt!==null&&(z=tt.aa,tt.aa=!0),b(a,x,y),tt!==null&&(tt.aa=z)}!a.fd||a.Lw!==x&&a.Mw!==x||a.bb()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=E}yt=fi.prototype,yt.oh=function(){var a=this.containingGroup;a!==null&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&tn.prototype.oh.call(this)},yt.To=function(a){var y=this.fromNode;return a===y?this.toNode:y},yt.Cz=function(a){var y=this.fromPort;return a===y?this.toPort:y};function e1(a,y){a.wd===null&&(a.wd=new _e),a.wd.add(y),a.v()}yt.Vo=function(a){if(tn.prototype.Vo.call(this,a),zc(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,_v(a,this,y));var x=this.uf;if(x!==null){var E=this.toPort;x===a&&E===y||_v(x,this,E)}Xp(this)}},yt.Wo=function(a){if(tn.prototype.Wo.call(this,a),zc(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,Hv(a,this,y));var x=this.uf;if(x!==null){var E=this.toPort;x===a&&E===y||Hv(x,this,E)}Jp(this)}},yt.Lj=function(){if(this.fd=!0,this.wd!==null){var a=this.diagram;if(a!==null)for(var y=this.wd.copy().iterator;y.next();)a.remove(y.value)}this.data!==null&&(a=this.diagram,a!==null&&a.partManager.removeDataForLink(this))},fi.prototype.updateRelationshipsFromData=function(){if(this.data!==null){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)}},fi.prototype.move=function(a,y){var x=y?this.location:this.position,E=x.x;isNaN(E)&&(E=0);var b=x.y;for(isNaN(b)&&(b=0),E=a.x-E,b=a.y-b,y===!0?tn.prototype.move.call(this,a,!1):(a=Pt.allocAt(x.x+E,x.y+b),tn.prototype.move.call(this,a,!1),Pt.free(a)),ch(this,E,b),a=this.labelNodes;a.next();)y=a.value,x=y.position,y.moveTo(x.x+E,x.y+b)},fi.prototype.canRelinkFrom=function(){if(!this.relinkableFrom)return!1;var a=this.layer;return a===null?!0:a.allowRelink?(a=a.diagram,!!(a===null||a.allowRelink)):!1},fi.prototype.canRelinkTo=function(){if(!this.relinkableTo)return!1;var a=this.layer;return a===null?!0:a.allowRelink?(a=a.diagram,!!(a===null||a.allowRelink)):!1},fi.prototype.computeMidPoint=function(a){var y=this.pointsCount;if(y===0)return a.assign(Cr),a;if(y===1)return a.assign(this.i(0)),a;if(y===2){var x=this.i(0),E=this.i(1);return a.h((x.x+E.x)/2,(x.y+E.y)/2),a}if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===Aa))return this.ua.Pu(.5,a),a.add(this.i(0)),x=this.ua.figures.first(),a.offset(-x.startX,-x.startY),a;if(this.computeCurve()===Aa){if(y===3){x=this.i(0),E=this.i(1);var b=this.i(2);return Gt.ax(x.x,x.y,E.x,E.y,E.x,E.y,b.x,b.y,a),a}if(E=(y-1)/3|0,x=3*(E/2|0),E%2===1){E=this.i(x),b=this.i(x+1);var z=this.i(x+2);x=this.i(x+3),Gt.ax(E.x,E.y,b.x,b.y,z.x,z.y,x.x,x.y,a)}else a.assign(this.i(x));return a}var tt=this.flattenedLengths;for(x=this.flattenedTotalLength,b=z=E=0;E<x/2&&z<y&&(b=tt[z],!(E+b>x/2));)E+=b,z++;return y=this.i(z),z=this.i(z+1),1>Math.abs(y.x-z.x)?y.y>z.y?a.h(y.x,y.y-(x/2-E)):a.h(y.x,y.y+(x/2-E)):1>Math.abs(y.y-z.y)?y.x>z.x?a.h(y.x-(x/2-E),y.y):a.h(y.x+(x/2-E),y.y):(x=(x/2-E)/b,a.h(y.x+x*(z.x-y.x),y.y+x*(z.y-y.y))),a},fi.prototype.computeMidAngle=function(){var a=this.pointsCount;if(2>a)return NaN;if(a===2)return this.i(0).ab(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===Aa))return this.ua.wx(.5);if(this.computeCurve()===Aa&&4<=a){var y=(a-1)/3|0,x=3*(y/2|0);if(y%2===1){x=Math.floor(x),a=this.i(x),y=this.i(x+1);var E=this.i(x+2);return x=this.i(x+3),Gt.My(a.x,a.y,y.x,y.y,E.x,E.y,x.x,x.y)}if(0<x&&x+1<a)return this.i(x-1).ab(this.i(x+1))}y=this.flattenedLengths,E=this.flattenedTotalLength;var b=0;x=0;for(var z;b<E/2&&x<a&&(z=y[x],!(b+z>E/2));)b+=z,x++;if(y=this.i(x),E=this.i(x+1),1>Math.abs(y.x-E.x)&&1>Math.abs(y.y-E.y)){if(0<x&&x+2<a)return this.i(x-1).ab(this.i(x+2))}else{if(1>Math.abs(y.x-E.x))return y.y>E.y?270:90;if(1>Math.abs(y.y-E.y))return y.x>E.x?180:0}return y.ab(E)},yt=fi.prototype,yt.i=function(a){return this.Nb.s[a]},yt.dd=function(a,y){this.Nb.cd(a,y)},yt.L=function(a,y,x){this.Nb.cd(a,new Pt(y,x))},yt.Kz=function(a,y){this.Nb.Gb(a,y)},yt.m=function(a,y,x){this.Nb.Gb(a,new Pt(y,x))},yt.ne=function(a){this.Nb.add(a)},yt.yf=function(a,y){this.Nb.add(new Pt(a,y))},yt.pv=function(a){this.Nb.mb(a)},yt.Fj=function(){this.Nb.clear()};function ch(a,y,x){if(y!==0||x!==0)if(a.pointsCount===0)a.defaultFromPoint&&a.defaultFromPoint.offset(y,x),a.defaultToPoint&&a.defaultToPoint.offset(y,x);else{for(var E=a.fd,b=new Me,z=a.Nb.iterator;z.next();){var tt=z.value;b.add(new Pt(tt.x+y,tt.y+x).freeze())}b.freeze(),z=a.Nb,a.Nb=b,tt=a.diagram,isNaN(y)||isNaN(x)||tt!==null&&tt.animationManager.zb?a.v():(a.ke.h(a.ke.x+y,a.ke.y+x),a.pa.h(a.pa.x+y,a.pa.y+x),Bs(a)),E?Zv(a):(a.defaultFromPoint&&(a.defaultFromPoint=a.i(0)),a.defaultToPoint&&(a.defaultToPoint=a.i(a.pointsCount-1))),tt!==null&&tt.animationManager.zb&&td(tt.animationManager,a,b),a.g("points",z,b)}}yt.uh=function(){this.Mg===null&&(this.Mg=this.Nb,this.Nb=this.Nb.copy())},yt.zf=function(){if(this.Mg!==null){for(var a=this.Mg,y=this.Nb,x=1/0,E=1/0,b=a.s,z=b.length,tt=0;tt<z;tt++){var it=b[tt];x=Math.min(it.x,x),E=Math.min(it.y,E)}it=tt=1/0;for(var nt=y.s,ot=nt.length,st=0;st<ot;st++){var ut=nt[st];tt=Math.min(ut.x,tt),it=Math.min(ut.y,it),ut.freeze()}if(y.freeze(),ot===z){for(z=0;z<ot;z++)if(st=b[z],ut=nt[z],st.x-x!==ut.x-tt||st.y-E!==ut.y-it){this.qc();break}}else this.qc();this.Mg=null,x=this.diagram,x!==null&&x.animationManager.zb&&td(x.animationManager,this,y),Zv(this),this.g("points",a,y)}},yt.rv=function(){this.Mg!==null&&(this.Nb=this.Mg,this.Mg=null)};function Zv(a){a.Nb.count===0?a.fd=!1:(a.fd=!0,a.cq=null,a.vt=NaN,a.defaultFromPoint=a.i(0),a.defaultToPoint=a.i(a.pointsCount-1),Uv(a,!1))}yt.bb=function(){if(!this.suspendsRouting){var a=this.diagram;if(a){if(a.As.contains(this)||a.undoManager.isUndoingRedoing||(a=a.animationManager,a.isTicking&&!a.isAnimating))return;this.Tg===null||a.isTicking||(this.Tg=null)}a=this.path,a!==null&&(this.fd=!1,this.v(),a.v())}},yt.vg=function(){if(!this.fd&&!this.computingPoints){var a=!0;try{this.computingPoints=!0,this.uh(),a=this.computePoints()}catch(y){this.computingPoints=!1,this.rv()}finally{this.computingPoints=!1,a?this.zf():this.rv()}}},fi.prototype.computePoints=function(){if(this.diagram===null)return!1;var a=this.fromNode,y=null;if(a===null?(bf||(bf=new Ci,bf.desiredSize=Pn,bf.Va()),this.defaultFromPoint&&(bf.location=this.defaultFromPoint,bf.Va(),y=a=bf)):y=this.fromPort,y!==null&&!a.isVisible()){var x=a.findVisibleNode();x!==null&&x!==a?(a=x,y=x.port):a=x}if(this.Lw=a,a===null||!a.location.w())return!1;for(;!(y===null||y.actualBounds.w()&&y.Ed());)y=y.panel;if(y===null)return!1;var E=this.toNode,b=null;if(E===null?(Pf||(Pf=new Ci,Pf.desiredSize=Pn,Pf.Va()),this.defaultToPoint&&(Pf.location=this.defaultToPoint,Pf.Va(),b=E=Pf)):b=this.toPort,b===null||E.isVisible()||(x=E.findVisibleNode(),x!==null&&x!==E?(E=x,b=x.port):E=x),this.Mw=E,E===null||!E.location.w())return!1;for(;!(b===null||b.actualBounds.w()&&b.Ed());)b=b.panel;if(b===null)return!1;var z=this.pointsCount,tt=this.computeSpot(!0,y);x=this.computeSpot(!1,b);var it=Td(tt),nt=Td(x),ot=y===b&&y!==null,st=this.isOrthogonal,ut=this.curve===Aa;this.Wf=ot&&!st?ut=!0:!1;var ct=this.computeAdjusting()===js||ot;if(!st&&!ot&&it&&nt){if(it=!1,!ct&&3<=z&&(ct=this.getLinkPoint(a,y,tt,!0,!1,E,b),nt=this.getLinkPoint(E,b,x,!1,!1,a,y),it=this.adjustPoints(0,ct,z-1,nt))&&(ct=this.getLinkPoint(a,y,tt,!0,!1,E,b),nt=this.getLinkPoint(E,b,x,!1,!1,a,y),this.adjustPoints(0,ct,z-1,nt)),!it)if(this.Fj(),ut){z=this.getLinkPoint(a,y,tt,!0,!1,E,b),ct=this.getLinkPoint(E,b,x,!1,!1,a,y),it=ct.x-z.x,nt=ct.y-z.y,ot=this.computeCurviness(),ut=st=0;var dt=z.x+it/3,vt=z.y+nt/3,xt=dt,Tt=vt;Gt.B(nt,0)?Tt=0<it?Tt-ot:Tt+ot:(st=-it/nt,ut=Math.sqrt(ot*ot/(st*st+1)),0>ot&&(ut=-ut),xt=(0>nt?-1:1)*ut+dt,Tt=st*(xt-dt)+vt),dt=z.x+2*it/3,vt=z.y+2*nt/3;var Et=dt,Ft=vt;Gt.B(nt,0)?Ft=0<it?Ft-ot:Ft+ot:(Et=(0>nt?-1:1)*ut+dt,Ft=st*(Et-dt)+vt),this.Fj(),this.ne(z),this.yf(xt,Tt),this.yf(Et,Ft),this.ne(ct),this.dd(0,this.getLinkPoint(a,y,tt,!0,!1,E,b)),this.dd(3,this.getLinkPoint(E,b,x,!1,!1,a,y))}else z=E,ct=b,E=this.getLinkPoint(a,y,tt,!0,!1,z,ct),b=this.getLinkPoint(z,ct,x,!1,!1,a,y),this.hasCurviness()?(ct=b.x-E.x,x=b.y-E.y,tt=this.computeCurviness(),a=E.x+ct/2,y=E.y+x/2,z=a,it=y,Gt.B(x,0)?it=0<ct?it-tt:it+tt:(ct=-ct/x,z=Math.sqrt(tt*tt/(ct*ct+1)),0>tt&&(z=-z),z=(0>x?-1:1)*z+a,it=ct*(z-a)+y),this.ne(E),this.yf(z,it),this.ne(b)):(this.ne(E),this.ne(b),it=be.alloc(),y.mi(it),nt=it.ca(b),ct.mi(it),ot=it.ca(E),(nt||ot)&&(tt=y.ga(Vv(tt),new Pt),this.dd(0,this.getLinkPointFromPoint(a,y,tt,b,!0,tt)),x=ct.ga(Vv(x),new Pt),this.dd(1,this.getLinkPointFromPoint(z,ct,x,E,!1,x))),be.free(it))}else{ut=this.isAvoiding,ct&&(st&&ut||ot)&&this.Fj();var Ot=ot?this.computeCurviness():0;ut=this.getLinkPoint(a,y,tt,!0,st,E,b),dt=xt=vt=0,(st||!it||ot)&&(Tt=this.computeEndSegmentLength(a,y,tt,!0),dt=this.getLinkDirection(a,y,ut,tt,!0,st,E,b),ot&&(it||tt.D(x)||!st&&tt.x+x.x===1&&tt.y+x.y===1)&&(dt-=st?90:30,0>Ot&&(dt-=180)),0>dt?dt+=360:360<=dt&&(dt-=360),ot&&(Tt+=Math.abs(Ot)*(st?1:2)),dt===0?vt=Tt:dt===90?xt=Tt:dt===180?vt=-Tt:dt===270?xt=-Tt:(vt=Tt*Math.cos(dt*Math.PI/180),xt=Tt*Math.sin(dt*Math.PI/180)),tt.Mc()&&ot&&(Tt=y.ga(Hn,Pt.alloc()),Et=Pt.allocAt(Tt.x+1e3*vt,Tt.y+1e3*xt),this.getLinkPointFromPoint(a,y,Tt,Et,!0,ut),Pt.free(Tt),Pt.free(Et))),Tt=this.getLinkPoint(E,b,x,!1,st,a,y);var Rt=Ft=Et=0;if(st||!nt||ot){var Ht=this.computeEndSegmentLength(E,b,x,!1);Rt=this.getLinkDirection(E,b,Tt,x,!1,st,a,y),ot&&(nt||tt.D(x)||!st&&tt.x+x.x===1&&tt.y+x.y===1)&&(Rt+=st?0:30,0>Ot&&(Rt+=180)),0>Rt?Rt+=360:360<=Rt&&(Rt-=360),ot&&(Ht+=Math.abs(Ot)*(st?1:2)),Rt===0?Et=Ht:Rt===90?Ft=Ht:Rt===180?Et=-Ht:Rt===270?Ft=-Ht:(Et=Ht*Math.cos(Rt*Math.PI/180),Ft=Ht*Math.sin(Rt*Math.PI/180)),x.Mc()&&ot&&(x=b.ga(Hn,Pt.alloc()),tt=Pt.allocAt(x.x+1e3*Et,x.y+1e3*Ft),this.getLinkPointFromPoint(E,b,x,tt,!1,Tt),Pt.free(x),Pt.free(tt))}x=ut,(st||!it||ot)&&(x=new Pt(ut.x+vt,ut.y+xt)),tt=Tt,(st||!nt||ot)&&(tt=new Pt(Tt.x+Et,Tt.y+Ft)),!ct&&!st&&it&&3<z&&this.adjustPoints(0,ut,z-2,tt)?this.dd(z-1,Tt):!ct&&!st&&nt&&3<z&&this.adjustPoints(1,x,z-1,Tt)?this.dd(0,ut):!ct&&(st?6<=z:4<z)&&this.adjustPoints(1,x,z-2,tt)?(this.dd(0,ut),this.dd(z-1,Tt)):(this.Fj(),this.ne(ut),(st||!it||ot)&&this.ne(x),st&&this.addOrthoPoints(x,dt,tt,Rt,a,E),(st||!nt||ot)&&this.ne(tt),this.ne(Tt))}return!0};function U0(a,y){return Math.abs(y.x-a.x)>Math.abs(y.y-a.y)?(y.x>=a.x?y.x=a.x+9e9:y.x=a.x-9e9,y.y=a.y):(y.y>=a.y?y.y=a.y+9e9:y.y=a.y-9e9,y.x=a.x),y}fi.prototype.getLinkPointFromPoint=function(a,y,x,E,b,z){if(z===void 0&&(z=new Pt),a===null||y===null)return z.assign(x),z;if(a.isVisible()||(b=a.findVisibleNode(),b!==null&&b!==a&&(y=b.port)),a=null,b=y.panel,b===null||b.se()||(b=b.panel),b===null){b=E.x,E=E.y;var tt=x.x;x=x.y}else{a=b.oe,b=1/(a.m11*a.m22-a.m12*a.m21),tt=a.m22*b;var it=-a.m12*b,nt=-a.m21*b,ot=a.m11*b,st=b*(a.m21*a.dy-a.m22*a.dx),ut=b*(a.m12*a.dx-a.m11*a.dy);b=E.x*tt+E.y*nt+st,E=E.x*it+E.y*ot+ut,tt=x.x*tt+x.y*nt+st,x=x.x*it+x.y*ot+ut}return y.Sj(b,E,tt,x,z),a!==null&&z.transform(a),z};function Kv(a,y){var x=y.Zn;return x===null&&(x=new Nf,x.port=y,x.node=y.part,y.Zn=x),u1(x,a)}fi.prototype.getLinkPoint=function(a,y,x,E,b,z,tt,it){if(it===void 0&&(it=new Pt),x.sb()&&!Td(x))return y.ga(x,it),it;if(x.$c()){var nt=Kv(this,y);if(nt!==null){if(it.assign(nt.Zo),b&&this.routing===n1){var ot=Kv(this,tt);if(ot!==null&&nt.Gl<ot.Gl){nt=Pt.alloc(),ot=Pt.alloc();var st=new be(y.ga(qn,nt),y.ga(vo,ot)),ut=this.computeSpot(!E,tt);a=this.getLinkPoint(z,tt,ut,!E,b,a,y,ot),(x.Hf(ha)||x.Hf(Ns))&&a.y>=st.y&&a.y<=st.y+st.height?it.y=a.y:(x.Hf(Ps)||x.Hf(ia))&&a.x>=st.x&&a.x<=st.x+st.width&&(it.x=a.x),Pt.free(nt),Pt.free(ot)}}return it}}return x=y.ga(Vv(x),Pt.alloc()),this.pointsCount>(b?6:2)?(tt=E?this.i(1):this.i(this.pointsCount-2),b&&(tt=U0(x,tt.copy()))):(nt=this.computeSpot(!E,tt),z=Pt.alloc(),tt=tt.ga(Vv(nt),z),b&&(tt=U0(x,tt)),Pt.free(z)),this.getLinkPointFromPoint(a,y,x,tt,E,it),Pt.free(x),it},fi.prototype.getLinkDirection=function(a,y,x,E,b,z,tt,it){t:if(E.sb())var nt=E.x>E.y?E.x>1-E.y?0:E.x<1-E.y?270:315:E.x<E.y?E.x>1-E.y?90:E.x<1-E.y?180:135:.5>E.x?225:.5<E.x?45:0;else{if(E.$c()&&(nt=Kv(this,y),nt!==null))switch(nt.Nc){case 1:nt=270;break t;case 2:nt=180;break t;default:case 4:nt=0;break t;case 8:nt=90;break t}nt=y.ga(Hn,Pt.alloc()),this.pointsCount>(z?6:2)?(it=b?this.i(1):this.i(this.pointsCount-2),it=z?U0(nt,it.copy()):x):(x=Pt.alloc(),it=it.ga(Hn,x),Pt.free(x)),x=Math.abs(it.x-nt.x)>Math.abs(it.y-nt.y)?it.x>=nt.x?0:180:it.y>=nt.y?90:270,Pt.free(nt),nt=x}return E.Mc()&&tt.Td(a)&&(nt+=180,360<=nt&&(nt-=360)),Td(E)||(a=y.li(),a===0)||(45<=a&&135>a?nt+=90:135<=a&&225>a?nt+=180:225<=a&&315>a&&(nt+=270),360<=nt&&(nt-=360)),nt},fi.prototype.computeEndSegmentLength=function(a,y,x,E){return y!==null&&x.$c()&&(a=Kv(this,y),a!==null)?a.Ju:(a=E?this.fromEndSegmentLength:this.toEndSegmentLength,y!==null&&isNaN(a)&&(a=E?y.fromEndSegmentLength:y.toEndSegmentLength),isNaN(a)&&(a=10),a)},fi.prototype.computeSpot=function(a,y){return y===void 0&&(y=null),a?(a=y||this.fromPort,a===null?a=Hn:(y=this.fromSpot,y.Xb()&&(y=a.fromSpot),a=y===Fi?Jn:y)):(a=y||this.toPort,a===null?a=Hn:(y=this.toSpot,y.Xb()&&(y=a.toSpot),a=y===Fi?Jn:y)),a};function Td(a){return a===Jn||a.x===.5&&a.y===.5}function Vv(a){return a.x===.5&&a.y===.5?a:Hn}fi.prototype.computeOtherPoint=function(a,y){return this.computeAdjusting()!==js&&4<this.pointsCount?this.computeMidPoint(new Pt):(a=y.Zn,a=a!==null?u1(a,this):null,a!==null?a.Zo:y.ga(Hn))},fi.prototype.computeShortLength=function(a){if(a){if(a=this.fromShortLength,isNaN(a)){var y=this.fromPort;y!==null&&(a=y.fromShortLength)}return isNaN(a)?0:a}return a=this.toShortLength,isNaN(a)&&(y=this.toPort,y!==null&&(a=y.toShortLength)),isNaN(a)?0:a},fi.prototype.Cf=function(a,y,x,E,b,z){if(this.pickable===!1)return!1;y===void 0&&(y=null),x===void 0&&(x=null);var tt=z;if(z===void 0&&(tt=bn.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return m0(this,y,x,b),z===void 0&&bn.free(tt),!0;if(this.Yc(a,tt)){var it=!1;if(!this.isAtomic)for(var nt=this.O.s,ot=nt.length;ot--;){var st=nt[ot];if(st.visible||st===this.locationObject){var ut=st.actualBounds,ct=this.naturalBounds;if(!(ut.x>ct.width||ut.y>ct.height||0>ut.x+ut.width||0>ut.y+ut.height)){if(ut=bn.alloc(),ut.set(tt),st instanceof si)it=st.Cf(a,y,x,E,b,ut);else if(this.path===st){if(st instanceof Rn)if(it=a,ct=E,st.pickable===!1)it=!1;else if(ut.multiply(st.transform),ct)t:{var dt=it,vt=ut;if(st.fh(dt,vt))it=!0;else{if(vt===void 0&&(vt=st.transform,dt.Re(st.actualBounds))){it=!0;break t}it=dt.left,ct=dt.right;var xt=dt.top;dt=dt.bottom;var Tt=Pt.alloc(),Et=Pt.alloc(),Ft=Pt.alloc(),Ot=bn.alloc();Ot.set(vt),Ot.bv(st.transform),Ot.Vj(),Et.x=ct,Et.y=xt,Et.transform(Ot),Tt.x=it,Tt.y=xt,Tt.transform(Ot),vt=!1,Rc(st,Tt,Et,Ft)?vt=!0:(Tt.x=ct,Tt.y=dt,Tt.transform(Ot),Rc(st,Tt,Et,Ft)?vt=!0:(Et.x=it,Et.y=dt,Et.transform(Ot),Rc(st,Tt,Et,Ft)?vt=!0:(Tt.x=it,Tt.y=xt,Tt.transform(Ot),Rc(st,Tt,Et,Ft)&&(vt=!0)))),bn.free(Ot),Pt.free(Tt),Pt.free(Et),Pt.free(Ft),it=vt}}else it=st.fh(it,ut)}else it=Ho(st,a,E,ut);it&&(ct=st,y!==null&&(ct=y(st)),ct&&(x===null||x(ct))&&b.add(ct)),bn.free(ut)}}}return z===void 0&&bn.free(tt),it||this.background!==null||this.areaBackground!==null}return z===void 0&&bn.free(tt),!1},fi.prototype.computeCurve=function(){if(this.Wf===null){var a=this.fromPort,y=this.isOrthogonal;this.Wf=a!==null&&a===this.toPort&&!y}return this.Wf?Aa:this.curve},fi.prototype.computeCorner=function(){if(this.curve===Aa)return 0;var a=this.corner;return(isNaN(a)||0>a)&&(a=10),a},fi.prototype.findMidLabel=function(){for(var a=this.path,y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E];if(b!==a&&!b.isPanelMain&&(b.segmentIndex===-1/0||isNaN(b.segmentIndex)))return b}for(a=this.labelNodes;a.next();)if(y=a.value,y.segmentIndex===-1/0||isNaN(y.segmentIndex))return y;return null},fi.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var a=o1;a=Math.max(a,this.computeThickness());var y=this.fromPort,x=this.toPort;if(y!==null&&x!==null){var E=this.findMidLabel();if(E!==null){var b=E.naturalBounds,z=E.margin,tt=isNaN(b.width)?30:b.width*E.scale+z.left+z.right;b=isNaN(b.height)?14:b.height*E.scale+z.top+z.bottom,E=E.segmentOrientation,E===$p||E===Jv||E===$0?a=Math.max(a,b):E===tg||E===ig||E===qp||E===eg?a=Math.max(a,tt):(y=y.ga(Hn).ab(x.ga(Hn))/180*Math.PI,a=Math.max(a,Math.abs(Math.sin(y)*tt)+Math.abs(Math.cos(y)*b)+1)),this.curve===Aa&&(a*=1.333)}}return a},fi.prototype.arrangeBundledLinks=function(a,y){if(y)for(y=0;y<a.length;y++){var x=a[y];x.computeAdjusting()===js&&x.bb()}},fi.prototype.computeCurviness=function(){var a=this.curviness;if(isNaN(a)){a=r1;var y=this.Sf;if(y!==null){for(var x=ii(),E=0,b=y.links,z=0;z<b.length;z++){var tt=b[z].computeSpacing();x.push(tt),E+=tt}for(E=-E/2,z=0;z<b.length;z++){if(b[z]===this){a=E+x[z]/2;break}E+=x[z]}y.Ds===this.fromNode&&(a=-a),Hi(x)}}return a},fi.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return a!==null?Math.max(a.strokeWidth,1):1},fi.prototype.hasCurviness=function(){return!isNaN(this.curviness)||this.Sf!==null},fi.prototype.adjustPoints=function(a,y,x,E){var b=this.computeAdjusting();if(this.isOrthogonal){if(b===Yv)return!1;b===Xv&&(b=Qp)}switch(b){case Yv:var z=this.i(a),tt=this.i(x);if(!z.Xa(y)||!tt.Xa(E)){b=z.x,z=z.y;var it=tt.x-b,nt=tt.y-z,ot=Math.sqrt(it*it+nt*nt);if(!Gt.$(ot,0)){if(Gt.$(it,0))var st=0>nt?-Math.PI/2:Math.PI/2;else st=Math.atan(nt/Math.abs(it)),0>it&&(st=Math.PI-st);tt=y.x;var ut=y.y;it=E.x-tt;var ct=E.y-ut;for(nt=Math.sqrt(it*it+ct*ct),Gt.$(it,0)?ct=0>ct?-Math.PI/2:Math.PI/2:(ct=Math.atan(ct/Math.abs(it)),0>it&&(ct=Math.PI-ct)),ot=nt/ot,st=ct-st,this.dd(a,y),a+=1;a<x;a++)y=this.i(a),it=y.x-b,nt=y.y-z,y=Math.sqrt(it*it+nt*nt),Gt.$(y,0)||(Gt.$(it,0)?nt=0>nt?-Math.PI/2:Math.PI/2:(nt=Math.atan(nt/Math.abs(it)),0>it&&(nt=Math.PI-nt)),it=nt+st,y*=ot,this.L(a,tt+y*Math.cos(it),ut+y*Math.sin(it)));this.dd(x,E)}}return!0;case Xv:if(z=this.i(a),ut=this.i(x),!z.Xa(y)||!ut.Xa(E)){b=z.x,z=z.y,tt=ut.x,ut=ut.y,ot=(tt-b)*(tt-b)+(ut-z)*(ut-z),it=y.x,st=y.y,nt=E.x,ct=E.y;var dt=1;if(nt-it!==0){var vt=(ct-st)/(nt-it);dt=Math.sqrt(1+1/(vt*vt))}else vt=9e9;for(this.dd(a,y),a+=1;a<x;a++){y=this.i(a);var xt=y.x,Tt=y.y,Et=.5;ot!==0&&(Et=((b-xt)*(b-tt)+(z-Tt)*(z-ut))/ot);var Ft=b+Et*(tt-b),Ot=z+Et*(ut-z);y=Math.sqrt((xt-Ft)*(xt-Ft)+(Tt-Ot)*(Tt-Ot)),Tt<vt*(xt-Ft)+Ot&&(y=-y),0<vt&&(y=-y),xt=it+Et*(nt-it),Et=st+Et*(ct-st),vt!==0?(y=xt+y/dt,this.L(a,y,Et-(y-xt)/vt)):this.L(a,xt,Et+y)}this.dd(x,E)}return!0;case Qp:t:{if(this.isOrthogonal&&(b=this.i(a),z=this.i(a+1),tt=this.i(a+2),it=z.x,st=z.y,ut=it,ot=st,Gt.B(b.y,z.y)?Gt.B(z.x,tt.x)?st=y.y:Gt.B(z.y,tt.y)&&(it=y.x):Gt.B(b.x,z.x)&&(Gt.B(z.y,tt.y)?it=y.x:Gt.B(z.x,tt.x)&&(st=y.y)),this.L(a+1,it,st),b=this.i(x),z=this.i(x-1),tt=this.i(x-2),it=z.x,st=z.y,nt=it,ct=st,Gt.B(b.y,z.y)?Gt.B(z.x,tt.x)?st=E.y:Gt.B(z.y,tt.y)&&(it=E.x):Gt.B(b.x,z.x)&&(Gt.B(z.y,tt.y)?it=E.x:Gt.B(z.x,tt.x)&&(st=E.y)),this.L(x-1,it,st),Y0(this))){this.L(a+1,ut,ot),this.L(x-1,nt,ct),x=!1;break t}this.dd(a,y),this.dd(x,E),x=!0}return x;default:return!1}},fi.prototype.addOrthoPoints=function(a,y,x,E,b,z){0>y?y+=360:360<=y&&(y-=360),0>E?E+=360:360<=E&&(E-=360);var tt=E;y=315<=y||45>y?0:45<=y&&135>y?90:135<=y&&225>y?180:270,E=315<=E||45>E?0:45<=E&&135>E?90:135<=E&&225>E?180:270;var it=b.actualBounds.copy(),nt=z.actualBounds.copy();if(it.w()&&nt.w()){it.Bc(ng,ng),nt.Bc(ng,ng),it.Ye(a),nt.Ye(x);var ot=Pt.alloc(),st=Pt.alloc();y===0?x.x>a.x||E===270&&x.y<a.y&&nt.right>a.x||E===90&&x.y>a.y&&nt.right>a.x?(ot.h(x.x,a.y),st.h(x.x,(a.y+x.y)/2),E===180?(ot.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),st.x=ot.x,st.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(ot.x=a.x<nt.left?this.computeMidOrthoPosition(a.x,a.y,nt.left,x.y,!1):a.x<nt.right&&(E===270&&a.y<nt.top||E===90&&a.y>nt.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):nt.right,st.x=ot.x,st.y=x.y):E===0&&a.x<nt.left&&a.y>nt.top&&a.y<nt.bottom&&(ot.x=a.x,ot.y=a.y<x.y?Math.min(x.y,nt.top):Math.max(x.y,nt.bottom),st.y=ot.y)):(ot.h(a.x,x.y),st.h((a.x+x.x)/2,x.y),(E===180||E===90&&x.y<it.top||E===270&&x.y>it.bottom)&&(E===180&&(nt.ca(a)||it.ca(x))?ot.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===180||E===90)?ot.y=this.computeMidOrthoPosition(a.x,it.top,x.x,Math.max(x.y,nt.bottom),!0):x.y>a.y&&(E===180||E===270)&&(ot.y=this.computeMidOrthoPosition(a.x,it.bottom,x.x,Math.min(x.y,nt.top),!0)),st.x=x.x,st.y=ot.y),ot.y>it.top&&ot.y<it.bottom&&(x.x>=it.left&&x.x<=a.x||a.x<=nt.right&&a.x>=x.x?(E===90||E===270)&&(ot.h(Math.max((a.x+x.x)/2,a.x),a.y),st.h(ot.x,x.y)):(ot.y=E===270||(E===0||E===180)&&x.y<a.y?Math.min(x.y,E===0?it.top:Math.min(it.top,nt.top)):Math.max(x.y,E===0?it.bottom:Math.max(it.bottom,nt.bottom)),st.x=x.x,st.y=ot.y))):y===180?x.x<a.x||E===270&&x.y<a.y&&nt.left<a.x||E===90&&x.y>a.y&&nt.left<a.x?(ot.h(x.x,a.y),st.h(x.x,(a.y+x.y)/2),E===0?(ot.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),st.x=ot.x,st.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(ot.x=a.x>nt.right?this.computeMidOrthoPosition(a.x,a.y,nt.right,x.y,!1):a.x>nt.left&&(E===270&&a.y<nt.top||E===90&&a.y>nt.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):nt.left,st.x=ot.x,st.y=x.y):E===180&&a.x>nt.right&&a.y>nt.top&&a.y<nt.bottom&&(ot.x=a.x,ot.y=a.y<x.y?Math.min(x.y,nt.top):Math.max(x.y,nt.bottom),st.y=ot.y)):(ot.h(a.x,x.y),st.h((a.x+x.x)/2,x.y),(E===0||E===90&&x.y<it.top||E===270&&x.y>it.bottom)&&(E===0&&(nt.ca(a)||it.ca(x))?ot.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===0||E===90)?ot.y=this.computeMidOrthoPosition(a.x,it.top,x.x,Math.max(x.y,nt.bottom),!0):x.y>a.y&&(E===0||E===270)&&(ot.y=this.computeMidOrthoPosition(a.x,it.bottom,x.x,Math.min(x.y,nt.top),!0)),st.x=x.x,st.y=ot.y),ot.y>it.top&&ot.y<it.bottom&&(x.x<=it.right&&x.x>=a.x||a.x>=nt.left&&a.x<=x.x?(E===90||E===270)&&(ot.h(Math.min((a.x+x.x)/2,a.x),a.y),st.h(ot.x,x.y)):(ot.y=E===270||(E===0||E===180)&&x.y<a.y?Math.min(x.y,E===180?it.top:Math.min(it.top,nt.top)):Math.max(x.y,E===180?it.bottom:Math.max(it.bottom,nt.bottom)),st.x=x.x,st.y=ot.y))):y===90?x.y>a.y||E===180&&x.x<a.x&&nt.bottom>a.y||E===0&&x.x>a.x&&nt.bottom>a.y?(ot.h(a.x,x.y),st.h((a.x+x.x)/2,x.y),E===270?(ot.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),st.x=x.x,st.y=ot.y):E===180&&x.x<a.x||E===0&&x.x>a.x?(ot.y=a.y<nt.top?this.computeMidOrthoPosition(a.x,a.y,x.x,nt.top,!0):a.y<nt.bottom&&(E===180&&a.x<nt.left||E===0&&a.x>nt.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):nt.bottom,st.x=x.x,st.y=ot.y):E===90&&a.y<nt.top&&a.x>nt.left&&a.x<nt.right&&(ot.x=a.x<x.x?Math.min(x.x,nt.left):Math.max(x.x,nt.right),ot.y=a.y,st.x=ot.x)):(ot.h(x.x,a.y),st.h(x.x,(a.y+x.y)/2),(E===270||E===0&&x.x<it.left||E===180&&x.x>it.right)&&(E===270&&(nt.ca(a)||it.ca(x))?ot.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===270||E===0)?ot.x=this.computeMidOrthoPosition(it.left,a.y,Math.max(x.x,nt.right),x.y,!1):x.x>a.x&&(E===270||E===180)&&(ot.x=this.computeMidOrthoPosition(it.right,a.y,Math.min(x.x,nt.left),x.y,!1)),st.x=ot.x,st.y=x.y),ot.x>it.left&&ot.x<it.right&&(x.y>=it.top&&x.y<=a.y||a.y<=nt.bottom&&a.y>=x.y?(E===0||E===180)&&(ot.h(a.x,Math.max((a.y+x.y)/2,a.y)),st.h(x.x,ot.y)):(ot.x=E===180||(E===90||E===270)&&x.x<a.x?Math.min(x.x,E===90?it.left:Math.min(it.left,nt.left)):Math.max(x.x,E===90?it.right:Math.max(it.right,nt.right)),st.x=ot.x,st.y=x.y))):x.y<a.y||E===180&&x.x<a.x&&nt.top<a.y||E===0&&x.x>a.x&&nt.top<a.y?(ot.h(a.x,x.y),st.h((a.x+x.x)/2,x.y),E===90?(ot.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),st.x=x.x,st.y=ot.y):E===180&&x.x<a.x||E===0&&x.x>=a.x?(ot.y=a.y>nt.bottom?this.computeMidOrthoPosition(a.x,a.y,x.x,nt.bottom,!0):a.y>nt.top&&(E===180&&a.x<nt.left||E===0&&a.x>nt.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):nt.top,st.x=x.x,st.y=ot.y):E===270&&a.y>nt.bottom&&a.x>nt.left&&a.x<nt.right&&(ot.x=a.x<x.x?Math.min(x.x,nt.left):Math.max(x.x,nt.right),ot.y=a.y,st.x=ot.x)):(ot.h(x.x,a.y),st.h(x.x,(a.y+x.y)/2),(E===90||E===0&&x.x<it.left||E===180&&x.x>it.right)&&(E===90&&(nt.ca(a)||it.ca(x))?ot.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===90||E===0)?ot.x=this.computeMidOrthoPosition(it.left,a.y,Math.max(x.x,nt.right),x.y,!1):x.x>a.x&&(E===90||E===180)&&(ot.x=this.computeMidOrthoPosition(it.right,a.y,Math.min(x.x,nt.left),x.y,!1)),st.x=ot.x,st.y=x.y),ot.x>it.left&&ot.x<it.right&&(x.y<=it.bottom&&x.y>=a.y||a.y>=nt.top&&a.y<=x.y?(E===0||E===180)&&(ot.h(a.x,Math.min((a.y+x.y)/2,a.y)),st.h(x.x,ot.y)):(ot.x=E===180||(E===90||E===270)&&x.x<a.x?Math.min(x.x,E===270?it.left:Math.min(it.left,nt.left)):Math.max(x.x,E===270?it.right:Math.max(it.right,nt.right)),st.x=ot.x,st.y=x.y)));var ut=x;if(this.isAvoiding){var ct=this.diagram;if(ct===null||b===z||this.layer.isTemporary||!ud(ct)||it.ca(ut)&&!z.Td(b)||nt.ca(a)&&!b.Td(z))y=!1;else{var dt=hd(ct,!0,this.containingGroup,null);if(this.segmentIndex!==17&&dt.Yj(Math.min(a.x,ot.x),Math.min(a.y,ot.y),Math.abs(a.x-ot.x),Math.abs(a.y-ot.y))&&dt.Yj(Math.min(ot.x,st.x),Math.min(ot.y,st.y),Math.abs(ot.x-st.x),Math.abs(ot.y-st.y))&&dt.Yj(Math.min(st.x,ut.x),Math.min(st.y,ut.y),Math.abs(st.x-ut.x),Math.abs(st.y-ut.y)))y=!1;else{b=a,z=ut;var vt=x=null;if(ct.isVirtualized){ct=dt.bounds.copy(),ct.Bc(-dt.Ho,-dt.Go);var xt=Pt.alloc();Ad(dt,a.x,a.y)||(Gt.Ff(ct.x,ct.y,ct.x+ct.width,ct.y+ct.height,a.x,a.y,ot.x,ot.y,xt)?(x=a=xt.copy(),y=xt.ab(ot)):Gt.Ff(ct.x,ct.y,ct.x+ct.width,ct.y+ct.height,ot.x,ot.y,st.x,st.y,xt)?(x=a=xt.copy(),y=xt.ab(st)):Gt.Ff(ct.x,ct.y,ct.x+ct.width,ct.y+ct.height,st.x,st.y,ut.x,ut.y,xt)&&(x=a=xt.copy(),y=xt.ab(ut))),Ad(dt,ut.x,ut.y)||(Gt.Ff(ct.x,ct.y,ct.x+ct.width,ct.y+ct.height,ut.x,ut.y,st.x,st.y,xt)?(vt=ut=xt.copy(),E=st.ab(xt)):Gt.Ff(ct.x,ct.y,ct.x+ct.width,ct.y+ct.height,st.x,st.y,ot.x,ot.y,xt)?(vt=ut=xt.copy(),E=ot.ab(xt)):Gt.Ff(ct.x,ct.y,ct.x+ct.width,ct.y+ct.height,ot.x,ot.y,a.x,a.y,xt)&&(vt=ut=xt.copy(),E=a.ab(xt))),Pt.free(xt)}it=it.copy().ed(nt),it.Bc(dt.Ho*dt.Os,dt.Go*dt.Os),a1(dt,a,y,ut,E,it,!0),nt=fu(dt,ut.x,ut.y),!dt.abort&&nt>=Dd&&(s1(dt),it.Bc(dt.Ho*dt.Hx,dt.Go*dt.Ix),a1(dt,a,y,ut,E,it,!1),nt=fu(dt,ut.x,ut.y)),!dt.abort&&nt<Dd&&fu(dt,ut.x,ut.y)!==dh?(X0(this,dt,ut.x,ut.y,E,!0,tt),it=this.i(2),4>this.pointsCount?(y===0||y===180?(it.x=a.x,it.y=ut.y):(it.x=ut.x,it.y=a.y),this.L(2,it.x,it.y),this.m(3,it.x,it.y)):(tt=this.i(3),y===0||y===180?Gt.B(it.x,tt.x)?(it=y===0?Math.max(it.x,a.x):Math.min(it.x,a.x),this.L(2,it,a.y),this.L(3,it,tt.y)):Gt.B(it.y,tt.y)?(Math.abs(a.y-it.y)<=dt.Go/2&&(this.L(2,it.x,a.y),this.L(3,tt.x,a.y)),this.m(2,it.x,a.y)):this.L(2,a.x,it.y):(y===90||y===270)&&(Gt.B(it.y,tt.y)?(it=y===90?Math.max(it.y,a.y):Math.min(it.y,a.y),this.L(2,a.x,it),this.L(3,tt.x,it)):Gt.B(it.x,tt.x)?(Math.abs(a.x-it.x)<=dt.Ho/2&&(this.L(2,a.x,it.y),this.L(3,a.x,tt.y)),this.m(2,a.x,it.y)):this.L(2,it.x,a.y))),x!==null&&(a=this.i(1),tt=this.i(2),a.x!==tt.x&&a.y!==tt.y?y===0||y===180?this.m(2,a.x,tt.y):this.m(2,tt.x,a.y):y===0||y===180?this.m(2,b.x,x.y):this.m(2,x.x,b.y)),vt!==null&&(E===0||E===180?this.yf(z.x,vt.y):this.yf(vt.x,z.y)),y=!0):y=!1}}}else y=!1;y||(this.ne(ot.copy()),this.ne(st.copy())),Pt.free(ot),Pt.free(st)}},fi.prototype.computeMidOrthoPosition=function(a,y,x,E,b){var z=0;return!this.hasCurviness()||this.computeSpot(!0,this.fromPort).$c()||this.computeSpot(!1,this.toPort).$c()||(z=this.computeCurviness()),b?(y+E)/2+z:(a+x)/2+z};function Y0(a){if(a.diagram===null||!a.isAvoiding||!ud(a.diagram))return!1;var y=a.points.s,x=y.length;if(4>x)return!1;a=hd(a.diagram,!0,a.containingGroup,null);for(var E=1;E<x-2;E++){var b=y[E],z=y[E+1];if(!a.Yj(Math.min(b.x,z.x),Math.min(b.y,z.y),Math.abs(b.x-z.x),Math.abs(b.y-z.y)))return!0}return!1}function X0(a,y,x,E,b,z,tt){var it=y.Ho,nt=y.Go,ot=fu(y,x,E),st=x,ut=E;for(b===0?st+=it:b===90?ut+=nt:b===180?st-=it:ut-=nt,b!==tt&&ot>_c&&fu(y,st,ut)!==ot-1&&(fu(y,x-it,E)===ot-1?(b=180,st=x-it,ut=E):fu(y,x+it,E)===ot-1?(b=0,st=x+it,ut=E):fu(y,x,E-nt)===ot-1?(b=270,st=x,ut=E-nt):fu(y,x,E+nt)===ot-1&&(b=90,st=x,ut=E+nt));ot>_c&&fu(y,st,ut)===ot-1;)x=st,E=ut,b===0?st+=it:b===90?ut+=nt:b===180?st-=it:ut-=nt,--ot;z?ot>_c&&(b===180||b===0?x=Math.floor(x/it)*it+it/2:(b===90||b===270)&&(E=Math.floor(E/nt)*nt+nt/2)):(x=Math.floor(x/it)*it+it/2,E=Math.floor(E/nt)*nt+nt/2),ot>_c&&(z=b,tt=x,st=E,b===0?(z=90,st+=nt):b===90?(z=180,tt-=it):b===180?(z=270,st-=nt):b===270&&(z=0,tt+=it),fu(y,tt,st)===ot-1?X0(a,y,tt,st,z,!1,z):(tt=x,st=E,b===0?(z=270,st-=nt):b===90?(z=0,tt+=it):b===180?(z=90,st+=nt):b===270&&(z=180,tt-=it),fu(y,tt,st)===ot-1&&X0(a,y,tt,st,z,!1,z))),a.yf(x,E)}fi.prototype.ez=function(a){var y=a.x;a=a.y;for(var x=this.i(0),E=this.i(1),b=mn(y,a,x.x,x.y,E.x,E.y),z=0,tt=1;tt<this.pointsCount-1;tt++){x=this.i(tt+1);var it=mn(y,a,E.x,E.y,x.x,x.y);E=x,it<b&&(z=tt,b=it)}return z},fi.prototype.qc=function(){this.lk=!1,this.v()},fi.prototype.Ul=function(a){if(!(!a&&(this.fd===!1||(a=this.Pb(),this.lk&&(a===null||a.geometry!==null))))&&(2>this.pointsCount?this.lk=!0:this.ua=this.makeGeometry(),a=this.path,a!==null)){a.ua=this.ua;for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E];b!==a&&b.isPanelMain&&b instanceof Rn&&(b.ua=this.ua)}}},fi.prototype.makeGeometry=function(){var a=this.ua,y=this.pointsCount,x=!1,E=this.diagram;E!==null&&zc(this)&&E.Eh.contains(this)&&(this.ml.width!==0||this.ml.height!==0)&&(E.animationManager.isAnimating||E.currentTool!==E.toolManager)&&(x=!0);var b=this.i(0).copy(),z=b.copy();E=this.Nb.s;var tt=this.computeCurve();if(tt===Aa&&3<=y&&!Gt.$(this.smoothness,0))if(y===3){var it=this.i(1);E=Math.min(b.x,it.x);var nt=Math.min(b.y,it.y);it=this.i(2),E=Math.min(E,it.x),nt=Math.min(nt,it.y)}else{if(this.isOrthogonal)for(nt=0;nt<y;nt++)it=E[nt],z.x=Math.min(it.x,z.x),z.y=Math.min(it.y,z.y);else for(E=3;E<y;E+=3)E+3>=y&&(E=y-1),nt=this.i(E),z.x=Math.min(nt.x,z.x),z.y=Math.min(nt.y,z.y);E=z.x,nt=z.y}else{for(nt=0;nt<y;nt++)it=E[nt],z.x=Math.min(it.x,z.x),z.y=Math.min(it.y,z.y);E=z.x,nt=z.y}if(E-=this.su.x,nt-=this.su.y,b.x-=E,b.y-=nt,y!==2||zc(this)){if(a.type=ci.o,it=Dx(a),this.computeShortLength(!0)!==0&&(b=Mf(this,b,!0,z)),Pd(it,b.x,b.y,!1),tt===Aa&&3<=y&&!Gt.$(this.smoothness,0))if(y===3)x=this.i(1),y=x.x-E,x=x.y-nt,b=this.i(2).copy(),b.x-=E,b.y-=nt,this.computeShortLength(!1)!==0&&(b=Mf(this,b,!1,z)),lh(it,y,x,y,x,b.x,b.y);else if(this.isOrthogonal){y=Pt.allocAt(E,nt),x=Pt.alloc(),x.assign(this.i(1)),z=Pt.allocAt(E,nt),b=Pt.allocAt(E,nt),tt=this.i(0);for(var ot,st=this.smoothness/3,ut=1;ut<this.pointsCount-1;ut++){ot=this.i(ut);var ct=tt,dt=ot,vt=this.i(J0(this,ot,ut,!1));if((!Gt.$(ct.x,dt.x)||!Gt.$(dt.x,vt.x))&&(!Gt.$(ct.y,dt.y)||!Gt.$(dt.y,vt.y))){var xt=st;isNaN(xt)&&(xt=this.smoothness/3);var Tt=ct.x;ct=ct.y;var Et=dt.x;dt=dt.y;var Ft=vt.x;vt=vt.y;var Ot=xt*Gv(Tt,ct,Et,dt);xt*=Gv(Et,dt,Ft,vt),Gt.$(ct,dt)&&Gt.$(Et,Ft)&&(Et>Tt?vt>dt?(z.x=Et-Ot,z.y=dt-Ot,b.x=Et+xt,b.y=dt+xt):(z.x=Et-Ot,z.y=dt+Ot,b.x=Et+xt,b.y=dt-xt):vt>dt?(z.x=Et+Ot,z.y=dt-Ot,b.x=Et-xt,b.y=dt+xt):(z.x=Et+Ot,z.y=dt+Ot,b.x=Et-xt,b.y=dt-xt)),Gt.$(Tt,Et)&&Gt.$(dt,vt)&&(dt>ct?(Ft>Et?(z.x=Et-Ot,z.y=dt-Ot,b.x=Et+xt):(z.x=Et+Ot,z.y=dt-Ot,b.x=Et-xt),b.y=dt+xt):(Ft>Et?(z.x=Et-Ot,z.y=dt+Ot,b.x=Et+xt):(z.x=Et+Ot,z.y=dt+Ot,b.x=Et-xt),b.y=dt-xt)),(Gt.$(Tt,Et)&&Gt.$(Et,Ft)||Gt.$(ct,dt)&&Gt.$(dt,vt))&&(Tt=.5*(Tt+Ft),ct=.5*(ct+vt),z.x=Tt,z.y=ct,b.x=Tt,b.y=ct),(ut===1||ut===2&&Gt.$(tt.x,this.i(0).x)&&Gt.$(tt.y,this.i(0).y))&&(x.x=.5*(tt.x+ot.x),x.y=.5*(tt.y+ot.y)),lh(it,x.x-E,x.y-nt,z.x-E,z.y-nt,ot.x-E,ot.y-nt),y.set(z),x.set(b),tt=ot}}ot=tt.x,tt=tt.y,st=this.i(this.pointsCount-1),this.computeShortLength(!1)!==0&&(st=Mf(this,st.copy(),!1,gr)),ot=.5*(ot+st.x),tt=.5*(tt+st.y),lh(it,b.x-E,b.y-nt,ot-E,tt-nt,st.x-E,st.y-nt),Pt.free(y),Pt.free(x),Pt.free(z),Pt.free(b)}else for(x=3;x<y;x+=3)z=this.i(x-2),x+3>=y&&(x=y-1),b=this.i(x-1),tt=this.i(x),x===y-1&&this.computeShortLength(!1)!==0&&(tt=Mf(this,tt.copy(),!1,gr)),lh(it,z.x-E,z.y-nt,b.x-E,b.y-nt,tt.x-E,tt.y-nt);else{for(z=Pt.alloc(),z.assign(this.i(0)),b=Pt.alloc(),b.assign(z),tt=this.computeCorner(),ut=1,ot=0;ut<y;){if(ut=J0(this,z,ut,1<ut),st=this.i(ut),ut>=y-1){if(!z.D(st))this.computeShortLength(!1)!==0&&(st=Mf(this,st.copy(),!1,gr)),Ef(this,it,-E,-nt,z,st,x);else if(ot===0)for(ut=1;ut<y;)b.assign(z),st=this.i(ut++),Ef(this,it,-E,-nt,z,st,x),z.assign(st);break}if(ot=J0(this,st,ut+1,ut<y-3),ut=-E,Tt=-nt,ct=st,Et=this.i(ot),xt=x,Gt.B(z.y,ct.y)&&Gt.B(ct.x,Et.x))if(vt=Math.min(tt,Math.abs(ct.x-b.x)/2),vt=Ot=Math.min(vt,Math.abs(Et.y-ct.y)/2),Gt.B(vt,0))Ef(this,it,ut,Tt,z,ct,xt),z.assign(ct);else{var Rt=ct.x,Ht=ct.y;dt=Rt,Ft=Ht,ct.x>z.x?Rt=ct.x-vt:Rt=ct.x+vt,Et.y>ct.y?Ft=ct.y+Ot:Ft=ct.y-Ot,Et=Pt.allocAt(Rt,Ht),Ef(this,it,ut,Tt,z,Et,xt),Pt.free(Et),Iv(it,ct.x+ut,ct.y+Tt,dt+ut,Ft+Tt),z.h(dt,Ft)}else Gt.B(z.x,ct.x)&&Gt.B(ct.y,Et.y)?(vt=Math.min(tt,Math.abs(ct.y-b.y)/2),vt=Ot=Math.min(vt,Math.abs(Et.x-ct.x)/2),Gt.B(Ot,0)?(Ef(this,it,ut,Tt,z,ct,xt),z.assign(ct)):(Rt=ct.x,Ht=ct.y,dt=Rt,Ft=Ht,ct.y>z.y?Ht=ct.y-vt:Ht=ct.y+vt,Et.x>ct.x?dt=ct.x+Ot:dt=ct.x-Ot,Et=Pt.allocAt(Rt,Ht),Ef(this,it,ut,Tt,z,Et,xt),Pt.free(Et),Iv(it,ct.x+ut,ct.y+Tt,dt+ut,Ft+Tt),z.h(dt,Ft))):(Ef(this,it,ut,Tt,z,ct,xt),z.assign(ct));b.assign(st),ut=ot}Pt.free(z)}Rv=it}else it=this.i(1).copy(),it.x-=E,it.y-=nt,this.computeShortLength(!0)!==0&&(b=Mf(this,b,!0,z)),this.computeShortLength(!1)!==0&&(it=Mf(this,it,!1,z)),a.type=ci.j,a.startX=b.x,a.startY=b.y,a.endX=it.x,a.endY=it.y;return this.lk=!0,a};function Gv(a,y,x,E){return a=x-a,isNaN(a)||a===1/0||a===-1/0?NaN:(0>a&&(a=-a),y=E-y,isNaN(y)||y===1/0||y===-1/0?NaN:(0>y&&(y=-y),Gt.$(a,0)?y:Gt.$(y,0)?a:Math.sqrt(a*a+y*y)))}function Mf(a,y,x,E){var b=a.pointsCount;if(2>b)return y;if(x){var z=a.i(1);if(x=z.x-E.x,z=z.y-E.y,E=Gv(y.x,y.y,x,z),E===0)return y;b=b===2?.5*E:E,a=a.computeShortLength(!0),a>b&&(a=b),b=a*(z-y.y)/E,y.x+=a*(x-y.x)/E,y.y+=b}else{if(z=a.i(b-2),x=z.x-E.x,z=z.y-E.y,E=Gv(y.x,y.y,x,z),E===0)return y;b=b===2?.5*E:E,a=a.computeShortLength(!1),a>b&&(a=b),b=a*(y.y-z)/E,y.x-=a*(y.x-x)/E,y.y-=b}return y}function J0(a,y,x,E){for(var b=a.pointsCount,z=y;Gt.$(y.x,z.x)&&Gt.$(y.y,z.y);){if(x>=b)return b-1;z=a.i(x++)}if(!Gt.$(y.x,z.x)&&!Gt.$(y.y,z.y))return x-1;for(var tt=z;Gt.$(y.x,z.x)&&Gt.$(z.x,tt.x)&&(!E||(y.y>=z.y?z.y>=tt.y:z.y<=tt.y))||Gt.$(y.y,z.y)&&Gt.$(z.y,tt.y)&&(!E||(y.x>=z.x?z.x>=tt.x:z.x<=tt.x));){if(x>=b)return b-1;tt=a.i(x++)}return x-2}fi.prototype.computeJumpLength=function(){return 10};function Ef(a,y,x,E,b,z,tt){if(!tt&&zc(a)){tt=a.computeJumpLength();var it=tt/2,nt=[],ot=0;if(a.isVisible()&&(ot=Aw(a,b,z,nt)),0<ot){if(Gt.B(b.y,z.y))if(b.x<z.x)for(var st=0;st<ot;){var ut=Math.max(b.x,Math.min(nt[st++]-it,z.x-tt));y.lineTo(ut+x,z.y+E);for(var ct=ut+x,dt=Math.min(ut+tt,z.x);st<ot&&(ut=nt[st],ut<dt+tt);)st++,dt=Math.min(ut+it,z.x);ut=z.y-tt+E,dt+=x;var vt=z.y+E;a.curve===fh?Pd(y,dt,vt,!1):lh(y,ct,ut,dt,ut,dt,vt)}else for(--ot;0<=ot;){for(st=Math.min(b.x,Math.max(nt[ot--]+it,z.x+tt)),y.lineTo(st+x,z.y+E),ct=st+x,ut=Math.max(st-tt,z.x);0<=ot&&(st=nt[ot],st>ut-tt);)ot--,ut=Math.max(st-it,z.x);st=z.y-tt+E,ut+=x,dt=z.y+E,a.curve===fh?Pd(y,ut,dt,!1):lh(y,ct,st,ut,st,ut,dt)}else if(Gt.B(b.x,z.x))if(b.y<z.y)for(st=0;st<ot;){for(ut=Math.max(b.y,Math.min(nt[st++]-it,z.y-tt)),y.lineTo(z.x+x,ut+E),ct=ut+E,ut=Math.min(ut+tt,z.y);st<ot&&(dt=nt[st],dt<ut+tt);)st++,ut=Math.min(dt+it,z.y);dt=z.x-tt+x,vt=z.x+x,ut+=E,a.curve===fh?Pd(y,vt,ut,!1):lh(y,dt,ct,dt,ut,vt,ut)}else for(--ot;0<=ot;){for(st=Math.min(b.y,Math.max(nt[ot--]+it,z.y+tt)),y.lineTo(z.x+x,st+E),ct=st+E,st=Math.max(st-tt,z.y);0<=ot&&(ut=nt[ot],ut>st-tt);)ot--,st=Math.max(ut-it,z.y);ut=z.x-tt+x,dt=z.x+x,st+=E,a.curve===fh?Pd(y,dt,st,!1):lh(y,ut,ct,ut,st,dt,st)}}}y.lineTo(z.x+x,z.y+E)}function Aw(a,y,x,E){var b=a.diagram;if(b===null||y.D(x))return 0;for(b=b.layers;b.next();){var z=b.value;if(z!==null&&z.visible){z=z.Pa.s;for(var tt=z.length,it=0;it<tt;it++){var nt=z[it];if(nt instanceof fi){if(nt===a)return 0<E.length&&E.sort(function(st,ut){return st-ut}),E.length;if(nt.isVisible()&&zc(nt)){var ot=nt.routeBounds;ot.w()&&a.routeBounds.Yc(ot)&&!a.usesSamePort(nt)&&(ot=nt.path,ot!==null&&ot.Ed()&&Dw(y,x,E,nt))}}}}}return 0<E.length&&E.sort(function(st,ut){return st-ut}),E.length}function Dw(a,y,x,E){for(var b=Gt.B(a.y,y.y),z=E.pointsCount,tt=E.i(0),it=Pt.alloc(),nt=1;nt<z;nt++){var ot=E.i(nt);if(nt<z-1){var st=E.i(nt+1);if(tt.y===ot.y&&ot.y===st.y){if(ot.x>tt.x&&st.x>=ot.x||ot.x<tt.x&&st.x<=ot.x)continue}else if(tt.x===ot.x&&ot.x===st.x&&(ot.y>tt.y&&st.y>=ot.y||ot.y<tt.y&&st.y<=ot.y))continue}t:{st=a.x;var ut=a.y,ct=y.x,dt=y.y,vt=tt.x;tt=tt.y;var xt=ot.x,Tt=ot.y;if(Gt.B(st,ct)){if(!Gt.B(ut,dt)&&Gt.B(tt,Tt)&&Math.min(ut,dt)<tt&&Math.max(ut,dt)>tt&&Math.min(vt,xt)<st&&Math.max(vt,xt)>st&&!Gt.B(vt,xt)){it.x=st,it.y=tt,st=!0;break t}}else if(Gt.B(ut,dt)&&Gt.B(vt,xt)&&Math.min(st,ct)<vt&&Math.max(st,ct)>vt&&Math.min(tt,Tt)<ut&&Math.max(tt,Tt)>ut&&!Gt.B(tt,Tt)){it.x=vt,it.y=ut,st=!0;break t}it.x=0,it.y=0,st=!1}st&&(b?x.push(it.x):x.push(it.y)),tt=ot}Pt.free(it)}function zc(a){return a=a.curve,a===Ld||a===fh}function Uv(a,y){(y||zc(a))&&(y=a.diagram,y===null||y.animationManager.isTicking||y.Eh.contains(a)||a.ml.width===0&&a.ml.height===0||y.Eh.add(a,a.ml.copy()))}fi.prototype.Xo=function(a){var y=this.layer;if(y!==null&&y.visible&&!y.isTemporary){var x=y.diagram;if(x!==null&&!x.animationManager.isTicking){var E=!1;for(x=x.layers;x.next();){var b=x.value;if(b.visible){if(b===y){E=!0;var z=!1;b=b.Pa.s;for(var tt=b.length,it=0;it<tt;it++){var nt=b[it];nt instanceof fi&&(nt===this?z=!0:z&&i1(this,nt,a))}}else if(E)for(z=b.Pa.s,b=z.length,tt=0;tt<b;tt++)it=z[tt],it instanceof fi&&i1(this,it,a)}}}}};function i1(a,y,x){if(y!==null&&y.lk&&y.fd&&zc(y)){var E=y.routeBounds;E.w()&&(a.routeBounds.Yc(E)||x.Yc(E))&&(a.usesSamePort(y)||y.qc())}}fi.prototype.usesSamePort=function(a){var y=this.pointsCount,x=a.pointsCount;if(0<y&&0<x){var E=this.i(0),b=a.i(0);if(E.Xa(b)||(y=this.i(y-1),a=a.i(x-1),y.Xa(a)||E.Xa(a)||y.Xa(b)))return!0}else if(this.fromNode===a.fromNode||this.toNode===a.toNode||this.fromNode===a.toNode||this.toNode===a.fromNode)return!0;return!1},fi.prototype.isVisible=function(){if(!tn.prototype.isVisible.call(this))return!1;var a=this.containingGroup,y=!0,x=this.diagram;if(x!==null&&(y=x.isTreePathToChildren),x=this.fromNode,x!==null){if(this.isTreeLink&&y&&!x.isTreeExpanded)return!1;if(x===a)return!0;for(var E=x;E!==null;){if(E.labeledLink===this)return!0;E=E.containingGroup}if(x=x.findVisibleNode(),x===null||x===a)return!1}if(x=this.toNode,x!==null){if(this.isTreeLink&&!y&&!x.isTreeExpanded)return!1;if(x===a)return!0;for(y=x;y!==null;){if(y.labeledLink===this)return!0;y=y.containingGroup}if(y=x.findVisibleNode(),y===null||y===a)return!1}return!0},fi.prototype.Zb=function(a){if(tn.prototype.Zb.call(this,a),a&&Uv(this,!1),this.Sf!==null&&this.Sf.Sl(),this.wd!==null)for(var y=this.wd.iterator;y.next();)y.value.Zb(a)},fi.prototype.computeAdjusting=function(){return this.isAvoiding&&this.diagram!==null&&this.diagram.animationManager.defaultAnimation.isAnimating?Qp:this.qk};function Xp(a){var y=a.ef;if(y!==null){var x=a.uf;if(x!==null&&isNaN(a.curviness)){for(var E=a.ff,b=a.vf,z=a=null,tt=y.jb.s,it=tt.length,nt=0;nt<it;nt++){var ot=tt[nt];(ot.ef===y&&ot.ff===E&&ot.uf===x&&ot.vf===b||ot.ef===x&&ot.ff===b&&ot.uf===y&&ot.vf===E)&&(z===null?z=ot:(a===null&&(a=[],a.push(z)),a.push(ot)))}if(a!==null){for(z=Kx(y,x,E,b),z===null&&(z=new $v(y,E,x,b),Zx(y,z),Zx(x,z)),z.links=a,y=0;y<a.length;y++)a[y].Sf=z;z.Sl()}}}}function Jp(a){var y=a.Sf;y!==null&&isNaN(a.curviness)&&(a.Sf=null,a=y.links.indexOf(a),0<=a&&(yn(y.links,a),y.Sl()))}fi.prototype.ph=function(){return!0},zi.Object.defineProperties(fi.prototype,{fromNode:{get:function(){return this.ef},set:function(a){var y=this.ef;if(y!==a){var x=this.fromPort;y!==null&&(this.uf!==y&&Hv(y,this,x),Jp(this),this.C(2)),this.ef=a,a!==null&&this.Zb(a.isVisible()),this.Wf=null,this.bb();var E=this.diagram;E!==null&&E.aa&&E.partManager.setFromNodeForLink(this,a,y);var b=this.fromPort,z=this.fromPortChanged;if(z!==null){var tt=!0;E!==null&&(tt=E.aa,E.aa=!0),z(this,x,b),E!==null&&(E.aa=tt)}a!==null&&(this.uf!==a&&_v(a,this,b),Xp(this),this.C(1)),this.g("fromNode",y,a),Nd(this)}}},fromPortId:{get:function(){return this.ff},set:function(a){var y=this.ff;if(y!==a){var x=this.fromPort;x!==null&&va(x),Jp(this),this.ff=a;var E=this.fromPort;E!==null&&va(E);var b=this.diagram;if(b!==null){var z=this.data,tt=b.model;z!==null&&tt.ri()&&tt.xv(z,a)}x!==E&&(this.Wf=null,this.bb(),z=this.fromPortChanged,z!==null&&(tt=!0,b!==null&&(tt=b.aa,b.aa=!0),z(this,x,E),b!==null&&(b.aa=tt))),Xp(this),this.g("fromPortId",y,a)}}},fromPort:{get:function(){var a=this.ef;return a===null?null:a.ns(this.ff)}},fromPortChanged:{get:function(){return this.gn},set:function(a){var y=this.gn;y!==a&&(this.gn=a,this.g("fromPortChanged",y,a))}},toNode:{get:function(){return this.uf},set:function(a){var y=this.uf;if(y!==a){var x=this.toPort;y!==null&&(this.ef!==y&&Hv(y,this,x),Jp(this),this.C(2)),this.uf=a,a!==null&&this.Zb(a.isVisible()),this.Wf=null,this.bb();var E=this.diagram;E!==null&&E.aa&&E.partManager.setToNodeForLink(this,a,y);var b=this.toPort,z=this.toPortChanged;if(z!==null){var tt=!0;E!==null&&(tt=E.aa,E.aa=!0),z(this,x,b),E!==null&&(E.aa=tt)}a!==null&&(this.ef!==a&&_v(a,this,b),Xp(this),this.C(1)),this.g("toNode",y,a),Nd(this)}}},toPortId:{get:function(){return this.vf},set:function(a){var y=this.vf;if(y!==a){var x=this.toPort;x!==null&&va(x),Jp(this),this.vf=a;var E=this.toPort;E!==null&&va(E);var b=this.diagram;if(b!==null){var z=this.data,tt=b.model;z!==null&&tt.ri()&&tt.Cv(z,a)}x!==E&&(this.Wf=null,this.bb(),z=this.toPortChanged,z!==null&&(tt=!0,b!==null&&(tt=b.aa,b.aa=!0),z(this,x,E),b!==null&&(b.aa=tt))),Xp(this),this.g("toPortId",y,a)}}},toPort:{get:function(){var a=this.uf;return a===null?null:a.ns(this.vf)}},toPortChanged:{get:function(){return this.uo},set:function(a){var y=this.uo;y!==a&&(this.uo=a,this.g("toPortChanged",y,a))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:Fi},set:function(a){var y=this.fromSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.Xi=a,this.g("fromSpot",y,a),(y.$c()||a.$c())&&this.fromNode!==null&&va(this.fromPort),this.bb())}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:NaN},set:function(a){var y=this.fromEndSegmentLength;y!==a&&(0>a&&xi(a,">= 0",fi,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=a,this.g("fromEndSegmentLength",y,a),this.bb())}},fromShortLength:{get:function(){return this.ba!==null?this.ba.Wi:NaN},set:function(a){var y=this.fromShortLength;y!==a&&(this.Xc(),this.ba.Wi=a,this.qc(),this.g("fromShortLength",y,a))}},toSpot:{get:function(){return this.ba!==null?this.ba.yj:Fi},set:function(a){var y=this.toSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.yj=a,this.g("toSpot",y,a),(y.$c()||a.$c())&&this.toNode!==null&&va(this.toPort),this.bb())}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:NaN},set:function(a){var y=this.toEndSegmentLength;y!==a&&(0>a&&xi(a,">= 0",fi,"toEndSegmentLength"),this.Xc(),this.ba.wj=a,this.g("toEndSegmentLength",y,a),this.bb())}},toShortLength:{get:function(){return this.ba!==null?this.ba.xj:NaN},set:function(a){var y=this.toShortLength;y!==a&&(this.Xc(),this.ba.xj=a,this.qc(),this.g("toShortLength",y,a))}},isLabeledLink:{get:function(){return this.wd===null?!1:0<this.wd.count}},labelNodes:{get:function(){return this.wd===null?ke:this.wd.iterator}},relinkableFrom:{get:function(){return(this.Qa&1)!==0},set:function(a){var y=(this.Qa&1)!==0;y!==a&&(this.Qa^=1,this.g("relinkableFrom",y,a),this.Wb())}},relinkableTo:{get:function(){return(this.Qa&2)!==0},set:function(a){var y=(this.Qa&2)!==0;y!==a&&(this.Qa^=2,this.g("relinkableTo",y,a),this.Wb())}},resegmentable:{get:function(){return(this.Qa&4)!==0},set:function(a){var y=(this.Qa&4)!==0;y!==a&&(this.Qa^=4,this.g("resegmentable",y,a),this.Wb())}},isTreeLink:{get:function(){return(this.Qa&8)!==0},set:function(a){var y=(this.Qa&8)!==0;y!==a&&(this.Qa^=8,this.g("isTreeLink",y,a),this.fromNode!==null&&Yp(this.fromNode),this.toNode!==null&&Yp(this.toNode))}},path:{get:function(){var a=this.Pb();return a instanceof Rn?a:null}},routeBounds:{get:function(){this.vg();var a=this.ml,y=1/0,x=1/0,E=this.pointsCount;if(E===0)a.h(NaN,NaN,0,0);else{if(E===1)E=this.i(0),y=Math.min(E.x,y),x=Math.min(E.y,x),a.h(E.x,E.y,0,0);else if(E===2){E=this.i(0);var b=this.i(1);y=Math.min(E.x,b.x),x=Math.min(E.y,b.y),a.h(E.x,E.y,0,0),a.Ye(b)}else if(this.computeCurve()===Aa&&3<=E&&!this.isOrthogonal)if(b=this.i(0),y=b.x,x=b.y,a.h(y,x,0,0),E===3){E=this.i(1),y=Math.min(E.x,y),x=Math.min(E.y,x);var z=this.i(2);y=Math.min(z.x,y),x=Math.min(z.y,x),Gt.Dl(b.x,b.y,E.x,E.y,E.x,E.y,z.x,z.y,.5,a)}else for(z=3;z<E;z+=3){var tt=this.i(z-2);z+3>=E&&(z=E-1);var it=this.i(z-1),nt=this.i(z);Gt.Dl(b.x,b.y,tt.x,tt.y,it.x,it.y,nt.x,nt.y,.5,a),y=Math.min(nt.x,y),x=Math.min(nt.y,x),b=nt}else for(b=this.i(0),z=this.i(1),y=Math.min(b.x,z.x),x=Math.min(b.y,z.y),a.h(b.x,b.y,0,0),a.Ye(z),b=2;b<E;b++)z=this.i(b),y=Math.min(z.x,y),x=Math.min(z.y,x),a.Ye(z);this.su.h(y-a.x,x-a.y)}return a}},midPoint:{get:function(){return this.vg(),this.computeMidPoint(new Pt)}},midAngle:{get:function(){return this.vg(),this.computeMidAngle()}},flattenedLengths:{get:function(){if(this.cq===null){this.fd||Zv(this);for(var a=this.cq=[],y=this.pointsCount,x=0;x<y-1;x++){var E=this.i(x),b=this.i(x+1);Gt.$(E.x,b.x)?(E=b.y-E.y,0>E&&(E=-E)):Gt.$(E.y,b.y)?(E=b.x-E.x,0>E&&(E=-E)):E=Math.sqrt(E.Bf(b)),a.push(E)}}return this.cq}},flattenedTotalLength:{get:function(){var a=this.vt;if(isNaN(a)){for(var y=this.flattenedLengths,x=y.length,E=a=0;E<x;E++)a+=y[E];this.vt=a}return a}},points:{get:function(){return this.Nb},set:function(a){var y=this.Nb;if(y!==a){var x=null;if(Array.isArray(a)){var E=a.length%2===0;if(E){for(var b=0;b<a.length;b++)if(typeof a[b]!="number"||isNaN(a[b])){E=!1;break}}if(E)for(x=new Me,E=0;E<a.length/2;E++)b=new Pt(a[2*E],a[2*E+1]).freeze(),x.add(b);else{for(E=!0,b=0;b<a.length;b++){var z=a[b];if(!Oe(z)||typeof z.x!="number"||isNaN(z.x)||typeof z.y!="number"||isNaN(z.y)){E=!1;break}}if(E)for(x=new Me,E=0;E<a.length;E++)b=a[E],x.add(new Pt(b.x,b.y).freeze())}}else if(a instanceof Me)for(x=a.copy(),a=x.iterator;a.next();)a.value.freeze();else It("Link.points value is not an instance of List or Array: "+a);x.freeze(),this.Nb=x,this.qc(),Zv(this),a=this.diagram,a!==null&&(a.pi||a.undoManager.isUndoingRedoing||a.As.add(this),a.animationManager.zb&&td(a.animationManager,this,x)),this.g("points",y,x)}}},pointsCount:{get:function(){return this.Nb.count}},fd:{get:function(){return(this.Qa&16)!==0},set:function(a){(this.Qa&16)!==0!==a&&(this.Qa^=16)}},suspendsRouting:{get:function(){return(this.Qa&32)!==0},set:function(a){(this.Qa&32)!==0!==a&&(this.Qa^=32)}},computingPoints:{get:function(){return(this.Qa&64)!==0},set:function(a){(this.Qa&64)!==0!==a&&(this.Qa^=64)}},defaultFromPoint:{get:function(){return this.o},set:function(a){this.o=a.copy()}},defaultToPoint:{get:function(){return this.u},set:function(a){this.u=a.copy()}},isOrthogonal:{get:function(){return(this.qj.value&2)===2}},isAvoiding:{get:function(){return(this.qj.value&4)===4}},lk:{get:function(){return(this.Qa&128)!==0},set:function(a){(this.Qa&128)!==0!==a&&(this.Qa^=128)}},geometry:{get:function(){if(!this.lk){if(this.vg(),2>this.pointsCount)return this.lk=!0,this.ua;this.ua=this.makeGeometry()}return this.ua}},firstPickIndex:{get:function(){return 2>=this.pointsCount?0:this.isOrthogonal||!Td(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var a=this.pointsCount;return a===0?0:2>=a?a-1:this.isOrthogonal||!Td(this.computeSpot(!1))?a-2:a-1}},adjusting:{get:function(){return this.qk},set:function(a){var y=this.qk;y!==a&&(this.qk=a,this.g("adjusting",y,a))}},corner:{get:function(){return this.Om},set:function(a){var y=this.Om;y!==a&&(this.Om=a,this.qc(),this.g("corner",y,a))}},curve:{get:function(){return this.Qm},set:function(a){var y=this.Qm;y!==a&&(this.Qm=a,this.bb(),this.qc(),Uv(this,y===fh||y===Ld||a===fh||a===Ld),this.g("curve",y,a))}},curviness:{get:function(){return this.Rm},set:function(a){var y=this.Rm;y!==a&&(this.Rm=a,this.bb(),this.qc(),this.g("curviness",y,a))}},routing:{get:function(){return this.qj},set:function(a){var y=this.qj;y!==a&&(this.qj=a,this.Wf=null,this.bb(),Uv(this,(y.value&2)===2||(a.value&2)===2),this.g("routing",y,a))}},smoothness:{get:function(){return this.po},set:function(a){var y=this.po;y!==a&&(this.po=a,this.qc(),this.g("smoothness",y,a))}},key:{get:function(){var a=this.diagram;if(a!==null&&a.model.ri())return a.model.Ac(this.data)}}}),fi.prototype.invalidateOtherJumpOvers=fi.prototype.Xo,fi.prototype.findClosestSegment=fi.prototype.ez,fi.prototype.updateRoute=fi.prototype.vg,fi.prototype.invalidateRoute=fi.prototype.bb,fi.prototype.rollbackRoute=fi.prototype.rv,fi.prototype.commitRoute=fi.prototype.zf,fi.prototype.startRoute=fi.prototype.uh,fi.prototype.clearPoints=fi.prototype.Fj,fi.prototype.removePoint=fi.prototype.pv,fi.prototype.addPointAt=fi.prototype.yf,fi.prototype.addPoint=fi.prototype.ne,fi.prototype.insertPointAt=fi.prototype.m,fi.prototype.insertPoint=fi.prototype.Kz,fi.prototype.setPointAt=fi.prototype.L,fi.prototype.setPoint=fi.prototype.dd,fi.prototype.getPoint=fi.prototype.i,fi.prototype.getOtherPort=fi.prototype.Cz,fi.prototype.getOtherNode=fi.prototype.To;var bf=null,Pf=null,Q0=new ze(fi,"Normal",1),Fw=new ze(fi,"Orthogonal",2),Bw=new ze(fi,"AvoidsNodes",6),n1=new ze(fi,"AvoidsNodesStraight",7),js=new ze(fi,"None",0),Aa=new ze(fi,"Bezier",9),fh=new ze(fi,"JumpGap",10),Ld=new ze(fi,"JumpOver",11),Qp=new ze(fi,"End",17),Yv=new ze(fi,"Scale",18),Xv=new ze(fi,"Stretch",19),$p=new ze(fi,"OrientAlong",21),qp=new ze(fi,"OrientPlus90",22),tg=new ze(fi,"OrientMinus90",23),$0=new ze(fi,"OrientOpposite",24),Jv=new ze(fi,"OrientUpright",25),eg=new ze(fi,"OrientPlus90Upright",26),ig=new ze(fi,"OrientMinus90Upright",27),Qv=new ze(fi,"OrientUpright45",28),r1=16,o1=14,ng=8;fi.className="Link",fi.Normal=Q0,fi.Orthogonal=Fw,fi.AvoidsNodes=Bw,fi.AvoidsNodesStraight=n1,fi.None=js,fi.Bezier=Aa,fi.JumpGap=fh,fi.JumpOver=Ld,fi.End=Qp,fi.Scale=Yv,fi.Stretch=Xv,fi.OrientAlong=$p,fi.OrientPlus90=qp,fi.OrientMinus90=tg,fi.OrientOpposite=$0,fi.OrientUpright=Jv,fi.OrientPlus90Upright=eg,fi.OrientMinus90Upright=ig,fi.OrientUpright45=Qv,fi.EndSegmentStep=8,fi.CurvinessStart=r1,fi.SpacingMin=o1,fi.OrthoShortCut=ng;function $v(a,y,x,E){bi(this),this.Fe=this.qq=!1,this.Ds=a,this.Ox=y,this.cv=x,this.Px=E,this.links=[]}$v.prototype.Sl=function(){if(!this.qq){var a=this.links;0<a.length&&(a=a[0].diagram,a!==null&&(a.ow.add(this),this.Fe=a.undoManager.isUndoingRedoing))}this.qq=!0},$v.prototype.Nv=function(){if(this.qq){this.qq=!1;var a=this.links;if(0<a.length){var y=a[0],x=y.diagram;x=x===null||x.pi&&!this.Fe,this.Fe=!1,y.arrangeBundledLinks(a,x),a.length===1&&(y.Sf=null,a.length=0)}a.length===0&&(a=this.Ds,this!==null&&a.af!==null&&a.af.remove(this),a=this.cv,this!==null&&a.af!==null&&a.af.remove(this))}},$v.className="LinkBundle";function rg(a){bi(this),this.Yx=this.group=null,this.vs=!0,this.abort=!1,this.Od=this.Nd=1,this.Fn=this.En=-1,this.rc=a.width,this.sc=a.height,this.ac=null,this.ei=this.di=0,this.Os=11,this.Ix=this.Hx=22}rg.prototype.initialize=function(a){if(!(0>=a.width||0>=a.height)){var y=a.y,x=a.x+a.width,E=a.y+a.height;if(this.Nd=Math.floor((a.x-this.rc)/this.rc)*this.rc,this.Od=Math.floor((y-this.sc)/this.sc)*this.sc,this.En=Math.ceil((x+2*this.rc)/this.rc)*this.rc,this.Fn=Math.ceil((E+2*this.sc)/this.sc)*this.sc,a=1+(Math.ceil((this.En-this.Nd)/this.rc)|0),y=1+(Math.ceil((this.Fn-this.Od)/this.sc)|0),this.ac===null||this.di<a-1||this.ei<y-1){for(x=[],E=0;E<=a;E++)x[E]=new Uint32Array(y);this.ac=x,this.di=a-1,this.ei=y-1}if(a=q0,this.ac!==null)for(y=0;y<=this.di;y++)if(x=this.ac[y],x.fill)x.fill(a);else for(E=0;E<=this.ei;E++)x[E]=a}};function Ad(a,y,x){return a.Nd<=y&&y<=a.En&&a.Od<=x&&x<=a.Fn}function fu(a,y,x){return Ad(a,y,x)?(y-=a.Nd,y/=a.rc,x-=a.Od,x/=a.sc,a.ac[y|0][x|0]):q0}function s1(a){if(a.ac!==null)for(var y=0;y<=a.di;y++)for(var x=a.ac[y],E=0;E<=a.ei;E++)x[E]>=_c&&(x[E]=q0)}rg.prototype.Yj=function(a,y,x,E){if(a>this.En||a+x<this.Nd||y>this.Fn||y+E<this.Od)return!0;a=(a-this.Nd)/this.rc|0,y=(y-this.Od)/this.sc|0,x=Math.max(0,x)/this.rc+1|0;var b=Math.max(0,E)/this.sc+1|0;if(0>a&&(x+=a,a=0),0>y&&(b+=y,y=0),0>x||0>b)return!0;for(E=Math.min(a+x-1,this.di)|0,x=Math.min(y+b-1,this.ei)|0;a<=E;a++){b=this.ac[a];for(var z=y;z<=x;z++)if(b[z]===dh)return!1}return!0};function du(a,y,x,E,b,z,tt,it,nt){if(!(y<z||y>tt||x<it||x>nt)){var ot=y|0,st=x|0,ut=a.ac[ot][st];if(ut>=_c&&ut<Dd)for(b?st+=E:ot+=E,ut+=1;z<=ot&&ot<=tt&&it<=st&&st<=nt&&!(ut>=a.ac[ot][st]);)a.ac[ot][st]=ut,ut+=1,b?st+=E:ot+=E;if(ot=b?st:ot,b)if(0<E)for(x+=E;x<ot;x+=E)du(a,y,x,1,!b,z,tt,it,nt),du(a,y,x,-1,!b,z,tt,it,nt);else for(x+=E;x>ot;x+=E)du(a,y,x,1,!b,z,tt,it,nt),du(a,y,x,-1,!b,z,tt,it,nt);else if(0<E)for(y+=E;y<ot;y+=E)du(a,y,x,1,!b,z,tt,it,nt),du(a,y,x,-1,!b,z,tt,it,nt);else for(y+=E;y>ot;y+=E)du(a,y,x,1,!b,z,tt,it,nt),du(a,y,x,-1,!b,z,tt,it,nt)}}function qv(a,y,x,E,b,z,tt,it,nt){y|=0,x|=0;var ot=dh,st=_c;for(a.ac[y][x]=st;ot===dh&&y>z&&y<tt&&x>it&&x<nt;)st+=1,a.ac[y][x]=st,b?x+=E:y+=E,ot=a.ac[y][x]}function tm(a,y,x,E,b,z,tt,it,nt){y|=0,x|=0;var ot=dh,st=Dd;for(a.ac[y][x]=st;ot===dh&&y>z&&y<tt&&x>it&&x<nt;)a.ac[y][x]=st,b?x+=E:y+=E,ot=a.ac[y][x]}function a1(a,y,x,E,b,z,tt){if(a.ac!==null){a.abort=!1;var it=y.x,nt=y.y;if(Ad(a,it,nt)){it-=a.Nd,it/=a.rc,nt-=a.Od,nt/=a.sc;var ot=E.x,st=E.y;if(Ad(a,ot,st))if(ot-=a.Nd,ot/=a.rc,st-=a.Od,st/=a.sc,1>=Math.abs(it-ot)&&1>=Math.abs(nt-st))a.abort=!0;else{var ut=z.x;E=z.y,y=z.x+z.width;var ct=z.y+z.height;ut-=a.Nd,ut/=a.rc,E-=a.Od,E/=a.sc,y-=a.Nd,y/=a.rc,ct-=a.Od,ct/=a.sc,z=Math.max(0,Math.min(a.di,ut|0)),y=Math.min(a.di,Math.max(0,y|0)),ut=Math.max(0,Math.min(a.ei,E|0)),ct=Math.min(a.ei,Math.max(0,ct|0)),E=a.ac,it|=0,nt|=0,ot|=0,st|=0;var dt=x===0||x===90?1:-1;if(x=x===90||x===270,E[it][nt]===dh?(qv(a,it,nt,dt,x,z,y,ut,ct),qv(a,it,nt,1,!x,z,y,ut,ct),qv(a,it,nt,-1,!x,z,y,ut,ct)):qv(a,it,nt,dt,x,it,nt,it,nt),E[ot][st]===dh?(tm(a,ot,st,b===0||b===90?1:-1,b===90||b===270,z,y,ut,ct),tm(a,ot,st,1,!(b===90||b===270),z,y,ut,ct),tm(a,ot,st,-1,!(b===90||b===270),z,y,ut,ct)):tm(a,ot,st,dt,x,ot,st,ot,st),x=ii(),tt&&l1(a,ot,st,b,it,nt,x))for((x[0]!==ot||x[1]!==st)&&(x.unshift(st),x.unshift(ot)),(x[x.length-2]!==it||x[x.length-1]!==nt)&&(x.push(it),x.push(nt)),a=_c,b=x[x.length-2],tt=x[x.length-1],E[b][tt]=a++,z=x.length-4;0<=z;z-=2)for(b=x[z+2],tt=x[z+3],y=x[z],ot=x[z+1];y>b?b++:y<b?b--:ot>tt?tt++:ot<tt&&tt--,E[b][tt]=a++,b!==y||tt!==ot;);else du(a,it,nt,1,!1,z,y,ut,ct),du(a,it,nt,-1,!1,z,y,ut,ct),du(a,it,nt,1,!0,z,y,ut,ct),du(a,it,nt,-1,!0,z,y,ut,ct);Hi(x)}}}}function l1(a,y,x,E,b,z,tt){for(var it=a.ac,nt=y,ot=x;;){if(nt===b&&ot===z)return!0;var st=nt,ut=ot;if(E===0)if(st<b)st++;else break;else if(E===90)if(ut<z)ut++;else break;else if(E===180)if(st>b)st--;else break;else if(ut>z)ut--;else break;var ct=it[st][ut];if(ct===0||ct===ty)break;nt=st,ot=ut}for(;;){if(st=E,ut=nt,ct=ot,E===0?ct<z?(st=90,ct++):ct>z&&(st=270,ct--):E===90?ut<b?(st=0,ut++):ut>b&&(st=180,ut--):E===180?ct<z?(st=90,ct++):ct>z&&(st=270,ct--):ut<b?(st=0,ut++):ut>b&&(st=180,ut--),ut=it[ut][ct],st!==E&&ut!==0&&ut!==ty){if(tt.push(nt),tt.push(ot),l1(a,nt,ot,st,b,z,tt))return!0;tt.pop(),tt.pop()}if(it[nt][ot]=ty,E===0){if(nt===y)return!1;nt--}else if(E===90){if(ot===x)return!1;ot--}else if(E===180){if(nt===y)return!1;nt++}else{if(ot===x)return!1;ot++}}}zi.Object.defineProperties(rg.prototype,{bounds:{get:function(){return new be(this.Nd,this.Od,this.En-this.Nd,this.Fn-this.Od)}},Ho:{get:function(){return this.rc},set:function(a){0<a&&a!==this.rc&&(this.rc=a,this.initialize(this.bounds))}},Go:{get:function(){return this.sc},set:function(a){0<a&&a!==this.sc&&(this.sc=a,this.initialize(this.bounds))}}});var dh=0,_c=1,Dd=999999,q0=Dd+1,ty=Dd+2;rg.className="PositionArray";function Nf(){bi(this),this.port=this.node=null,this.pe=[],this.ap=!1}Nf.prototype.toString=function(){for(var a=this.pe,y=this.node.toString()+" "+a.length.toString()+":",x=0;x<a.length;x++){var E=a[x];E!==null&&(y+=`
|
|
`+E.toString())}return y};function Ow(a,y,x,E){switch(y=y.offsetY,y){case 8:return 90;case 2:return 180;case 1:return 270;case 4:return 0}switch(y){case 9:return 180<x?270:90;case 6:return 90<x&&270>=x?180:0}switch(a=180*Math.atan2(a.height,a.width)/Math.PI,y){case 3:return x>a&&x<=180+a?180:270;case 5:return x>180-a&&x<=360-a?270:0;case 12:return x>a&&x<=180+a?90:0;case 10:return x>180-a&&x<=360-a?180:90;case 7:return 90<x&&x<=180+a?180:x>180+a&&x<=360-a?270:0;case 13:return 180<x&&x<=360-a?270:x>a&&180>=x?90:0;case 14:return x>a&&x<=180-a?90:x>180-a&&270>=x?180:0;case 11:return x>180-a&&x<=180+a?180:x>180+a?270:90}return E&&y!==15&&(x-=15,0>x&&(x+=360)),x>a&&x<180-a?90:x>=180-a&&x<=180+a?180:x>180+a&&x<360-a?270:0}Nf.prototype.Sl=function(){this.pe.length=0};function u1(a,y){var x=a.pe;if(x.length===0){t:if(!a.ap){x=a.ap,a.ap=!0;var E=null,b=a.node,z=b instanceof An?b:null;if(z===null||z.isSubGraphExpanded)var tt=b.isTreeExpanded?b.findLinksConnected(a.port.portId):b.qx();else{if(!z.actualBounds.w()){a.ap=x;break t}E=z,tt=E.Lu()}z=a.pe.length=0;var it=a.port.ga(qn,Pt.alloc()),nt=a.port.ga(vo,Pt.alloc());for(b=be.allocAt(it.x,it.y,0,0),b.Ye(nt),Pt.free(it),Pt.free(nt),it=Pt.allocAt(b.x+b.width/2,b.y+b.height/2),nt=a.port.li(),tt=tt.iterator;tt.next();){var ot=tt.value;if(ot.isVisible()&&ot.fromPort!==ot.toPort){var st=ot.fromPort===a.port||ot.fromNode!==null&&ot.fromNode.Td(E),ut=ot.computeSpot(st,a.port);if(ut.$c()&&(st=st?ot.toPort:ot.fromPort,st!==null)){var ct=st.part;if(ct!==null){var dt=ct.findVisibleNode();dt!==null&&dt!==ct&&(ct=dt,st=ct.port),st=ot.computeOtherPoint(ct,st),ct=it.ab(st),ct-=nt,0>ct?ct+=360:360<=ct&&(ct-=360),ut=Ow(b,ut,ct,ot.isOrthogonal),ut===0?(ut=4,180<ct&&(ct-=360)):ut===90?(ut=8,270<ct&&(ct-=360)):ut===180?ut=2:(ut=1,90>ct&&(ct+=360)),dt=a.pe[z],dt===void 0?(dt=new ey(ot,ct,ut),a.pe[z]=dt):(dt.link=ot,dt.angle=ct,dt.Nc=ut),dt.hv.set(st),z++}}}}for(Pt.free(it),a.pe.sort(Nf.prototype.j),nt=a.pe.length,E=-1,z=it=0;z<nt;z++)tt=a.pe[z],tt!==void 0&&(tt.Nc!==E&&(E=tt.Nc,it=0),tt.Uo=it,it++);for(E=-1,it=0,z=nt-1;0<=z;z--)nt=a.pe[z],nt!==void 0&&(nt.Nc!==E&&(E=nt.Nc,it=nt.Uo+1),nt.Gl=it);if(z=a.pe,ut=a.port,E=a.node.portSpreading,it=Pt.alloc(),nt=Pt.alloc(),tt=Pt.alloc(),ot=Pt.alloc(),ut.ga(qn,it),ut.ga(Nr,nt),ut.ga(vo,tt),ut.ga(os,ot),dt=ct=st=ut=0,E===K0)for(var vt=0;vt<z.length;vt++){var xt=z[vt];if(xt!==null){var Tt=xt.link.computeThickness();switch(xt.Nc){case 8:ct+=Tt;break;case 2:dt+=Tt;break;case 1:ut+=Tt;break;default:case 4:st+=Tt}}}var Et=vt=0,Ft=1,Ot=xt=0;for(Tt=0;Tt<z.length;Tt++){var Rt=z[Tt];if(Rt!==null){if(vt!==Rt.Nc){switch(vt=Rt.Nc,vt){case 8:var Ht=tt;Et=ot;break;case 2:Ht=ot,Et=it;break;case 1:Ht=it,Et=nt;break;default:case 4:Ht=nt,Et=tt}switch(xt=Et.x-Ht.x,Ot=Et.y-Ht.y,vt){case 8:ct>Math.abs(xt)?(Ft=Math.abs(xt)/ct,ct=Math.abs(xt)):Ft=1;break;case 2:dt>Math.abs(Ot)?(Ft=Math.abs(Ot)/dt,dt=Math.abs(Ot)):Ft=1;break;case 1:ut>Math.abs(xt)?(Ft=Math.abs(xt)/ut,ut=Math.abs(xt)):Ft=1;break;default:case 4:st>Math.abs(Ot)?(Ft=Math.abs(Ot)/st,st=Math.abs(Ot)):Ft=1}Et=0}var ae=Rt.Zo;if(E===K0){switch(Rt=Rt.link.computeThickness(),Rt*=Ft,ae.set(Ht),vt){case 8:ae.x=Ht.x+xt/2+ct/2-Et-Rt/2;break;case 2:ae.y=Ht.y+Ot/2+dt/2-Et-Rt/2;break;case 1:ae.x=Ht.x+xt/2-ut/2+Et+Rt/2;break;default:case 4:ae.y=Ht.y+Ot/2-st/2+Et+Rt/2}Et+=Rt}else{var wi=.5;E===Wv&&(wi=(Rt.Uo+1)/(Rt.Gl+1)),ae.x=Ht.x+xt*wi,ae.y=Ht.y+Ot*wi}}}for(Pt.free(it),Pt.free(nt),Pt.free(tt),Pt.free(ot),Ht=a.pe,z=0;z<Ht.length;z++)E=Ht[z],E!==null&&(E.Ju=a.computeEndSegmentLength(E));a.ap=x,be.free(b)}x=a.pe}for(a=0;a<x.length;a++)if(b=x[a],b!==null&&b.link===y)return b;return null}Nf.prototype.j=function(a,y){return a===y?0:a===null?-1:y===null?1:a.Nc<y.Nc?-1:a.Nc>y.Nc?1:a.angle<y.angle?-1:a.angle>y.angle?1:0},Nf.prototype.computeEndSegmentLength=function(a){var y=a.link,x=y.computeEndSegmentLength(this.node,this.port,Jn,y.fromPort===this.port),E=a.Uo;if(0>E)return x;var b=a.Gl;if(1>=b||!y.isOrthogonal)return x;y=a.hv;var z=a.Zo;return(a.Nc===2||a.Nc===8)&&(E=b-1-E),((a=a.Nc===2||a.Nc===4)?y.y<z.y:y.x<z.x)?x+8*E:(a?y.y===z.y:y.x===z.x)?x:x+8*(b-1-E)},Nf.className="Knot";function ey(a,y,x){this.link=a,this.angle=y,this.Nc=x,this.hv=new Pt,this.Gl=this.Uo=0,this.Zo=new Pt,this.Ju=0}ey.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.Nc.toString()+":"+this.Uo.toString()+"/"+this.Gl.toString()+" "+this.Zo.toString()+" "+this.Ju.toString()+" "+this.hv.toString()},ey.className="LinkInfo";function Gr(a){bi(this),this.o=this.H=null,this.Gh=this.sn=!0,this.yn=!1,this.Am=new Pt(0,0).freeze(),this.vn=!0,this.Em=this.un=null,this.xn=!1,this.j=null,a&&Object.assign(this,a)}Gr.prototype.cloneProtected=function(a){a.sn=this.sn,a.Gh=this.Gh,a.yn=this.yn,a.Am.assign(this.Am),a.vn=this.vn,a.un=this.un,a.Em=this.Em,a.xn=!0},Gr.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},Gr.prototype.qb=function(){},Gr.prototype.toString=function(){var a=Xi(this.constructor);return a+="(",this.group!==null&&(a+=" in "+this.group),this.diagram!==null&&(a+=" for "+this.diagram),a+")"},Gr.prototype.C=function(){if(this.isValidLayout){var a=this.diagram;if(a!==null&&!a.undoManager.isUndoingRedoing){var y=a.animationManager;!y.isTicking&&(y.defaultAnimation.isAnimating&&y.Cc(),this.isOngoing&&a.pi||this.isInitial&&!a.pi)&&(this.isValidLayout=!1,a.$b())}}},Gr.prototype.createNetwork=function(){return new Ir(this)},Gr.prototype.makeNetwork=function(a){var y=this.createNetwork();return a instanceof le?(y.lg(a.nodes,!0),y.lg(a.links,!0)):a instanceof An?y.lg(a.memberParts):y.lg(a.iterator),y},Gr.prototype.updateParts=function(){this.isValidLayout=!0;var a=this.diagram;if(a===null&&this.network!==null)for(var y=this.network.vertexes.iterator;y.next();){var x=y.value.node;if(x!==null&&(a=x.diagram,a!==null))break}try{a!==null&&a.Ea("Layout"),this.commitLayout()}finally{a!==null&&a.eb("Layout")}},Gr.prototype.commitLayout=function(){if(this.network!==null){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();if(this.isRouting)for(a=this.network.edges.iterator;a.next();)a.value.commit()}},Gr.prototype.doLayout=function(a){var y=new _e;a instanceof le?(Xh(this,y,a.nodes,!0,this.rh,!0,!1,!0),Xh(this,y,a.parts,!0,this.rh,!0,!1,!0)):a instanceof An?Xh(this,y,a.memberParts,!1,this.rh,!0,!1,!0):y.addAll(a.iterator),0<y.count&&(a=this.diagram,a!==null&&a.Ea("Layout"),this.doMinimalNoNetworkLayout(y),a!==null&&a.eb("Layout")),this.isValidLayout=!0},Gr.prototype.doMinimalNoNetworkLayout=function(a){var y=Math.ceil(Math.sqrt(a.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var x=this.arrangementOrigin.x,E=x,b=this.arrangementOrigin.y,z=0,tt=0;for(a=a.iterator;a.next();){var it=a.value;og(it);var nt=it.measuredBounds,ot=nt.width;nt=nt.height,it.moveTo(E,b),it instanceof An&&(it.rh=!1),E+=Math.max(ot,50)+20,tt=Math.max(tt,Math.max(nt,50)),z>=y-1?(z=0,E=x,b+=tt+20,tt=0):z++}},Gr.prototype.doMinimalNetworkLayout=function(){var a=Math.ceil(Math.sqrt(this.network.vertexes.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);for(var y=this.arrangementOrigin.x,x=y,E=this.arrangementOrigin.y,b=0,z=0,tt=this.network.vertexes.iterator;tt.next();){var it=tt.value.node;if(!(it===null||it instanceof fi)&&(og(it),this.rh(it))){var nt=it.measuredBounds,ot=nt.width;nt=nt.height,it.moveTo(x,E),it instanceof An&&(it.rh=!1),x+=Math.max(ot,50)+20,z=Math.max(z,Math.max(nt,50)),b>=a-1?(b=0,x=y,E+=z+20,z=0):b++}}},Gr.prototype.rh=function(a){return!!(!a.location.w()||a instanceof An&&a.rh)};function Xh(a,y,x,E,b,z,tt,it){for(x=x.iterator;x.next();){var nt=x.value;E&&!nt.isTopLevel||b!==null&&!b(nt)||!nt.canLayout()||(z&&nt instanceof Ci?nt.isLinkLabel||(nt instanceof An&&nt.layout===null?Xh(a,y,nt.memberParts,!1,b,z,tt,it):(og(nt),y.add(nt))):tt&&nt instanceof fi?y.add(nt):!it||!nt.Zc()||nt instanceof Ci||(og(nt),y.add(nt)))}}function og(a){var y=a.actualBounds;(y.width===0||y.height===0||isNaN(y.width)||isNaN(y.height))&&a.Va()}Gr.prototype.ni=function(a,y){var x=this.boundsComputation;return x!==null?(y||(y=new be),x(a,this,y)):y?(y.set(a.actualBounds),y):a.actualBounds},Gr.prototype.ex=function(a){var y=new _e;return a instanceof le?(Xh(this,y,a.nodes,!0,null,!0,!0,!0),Xh(this,y,a.links,!0,null,!0,!0,!0),Xh(this,y,a.parts,!0,null,!0,!0,!0)):a instanceof An?Xh(this,y,a.memberParts,!1,null,!0,!0,!0):Xh(this,y,a.iterator,!1,null,!0,!0,!0),y},Gr.prototype.initialOrigin=function(a){var y=this.group;if(y!==null){var x=y.position.copy();return(isNaN(x.x)||isNaN(x.y))&&x.set(a),y=y.placeholder,y!==null&&(x=y.ga(qn),(isNaN(x.x)||isNaN(x.y))&&x.set(a),a=y.padding,x.x+=a.left,x.y+=a.top),x}return a},zi.Object.defineProperties(Gr.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},group:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a,a!==null&&(this.H=a.diagram))}},isOngoing:{get:function(){return this.sn},set:function(a){this.sn!==a&&(this.sn=a)}},isInitial:{get:function(){return this.Gh},set:function(a){this.Gh=a,a||(this.xn=!0)}},isViewportSized:{get:function(){return this.yn},set:function(a){this.yn!==a&&(this.yn=a)&&this.C()}},isRouting:{get:function(){return this.vn},set:function(a){this.vn!==a&&(this.vn=a)}},isRealtime:{get:function(){return this.un},set:function(a){this.un!==a&&(this.un=a)}},isValidLayout:{get:function(){return this.xn},set:function(a){this.xn!==a&&(this.xn=a,a||(a=this.diagram,a!==null&&(a.xh=!0)))}},network:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a,a!==null&&(a.layout=this))}},boundsComputation:{get:function(){return this.Em},set:function(a){this.Em!==a&&(this.Em=a,this.C())}},arrangementOrigin:{get:function(){return this.Am},set:function(a){this.Am.D(a)||(this.Am.assign(a),this.C())}}}),Gr.prototype.collectParts=Gr.prototype.ex,Gr.prototype.getLayoutBounds=Gr.prototype.ni,Gr.prototype.invalidateLayout=Gr.prototype.C,Gr.className="Layout";function Ir(a){bi(this),this.Sc=a,this.wf=new _e,this.ye=new _e,this.Es=new ji,this.zs=new ji}Ir.prototype.clear=function(){if(this.wf)for(var a=this.wf.iterator;a.next();)a.value.clear();if(this.ye)for(a=this.ye.iterator;a.next();)a.value.clear();this.wf=new _e,this.ye=new _e,this.Es=new ji,this.zs=new ji},Ir.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutNetwork"+(this.layout!==null?"("+this.layout.toString()+")":"");if(0>=a)return y;if(y+=" vertexes: "+this.wf.count+" edges: "+this.ye.count,1<a){for(var x=this.wf.iterator;x.next();)y+=`
|
|
`+x.value.toString(a-1);for(x=this.ye.iterator;x.next();)y+=`
|
|
`+x.value.toString(a-1)}return y},Ir.prototype.createVertex=function(){return new Fo(this)},Ir.prototype.createEdge=function(){return new ma(this)},Ir.prototype.lg=function(a,y,x){if(a!==null){for(y===void 0&&(y=!1),x===void 0&&(x=null),x===null&&(x=function(tt){if(tt instanceof Ci)return!tt.isLinkLabel;if(tt instanceof fi){var it=tt.fromNode;return it===null||it.isLinkLabel?!1:(tt=tt.toNode,!(tt===null||tt.isLinkLabel))}return!1}),a=a.iterator;a.next();){var E=a.value;if(E instanceof Ci&&(!y||E.isTopLevel)&&E.canLayout()&&x(E)){if(E instanceof An&&E.layout===null)this.lg(E.memberParts,!1);else if(this.ki(E)===null){var b=this.createVertex();b.node=E,this.dh(b)}}}for(a.reset();a.next();)if(E=a.value,E instanceof fi&&(!y||E.isTopLevel)&&E.canLayout()&&x(E)&&this.Lo(E)===null){var z=E.fromNode;b=E.toNode,z!==null&&b!==null&&z!==b&&(z=this.findGroupVertex(z),b=this.findGroupVertex(b),z!==null&&b!==null&&this.Zj(z,b,E))}}},Ir.prototype.findGroupVertex=function(a){if(a===null)return null;var y=a.findVisibleNode();if(y===null)return null;if(a=this.ki(y),a!==null)return a;for(y=y.containingGroup;y!==null;){if(a=this.ki(y),a!==null)return a;y=y.containingGroup}return null},yt=Ir.prototype,yt.dh=function(a){if(a!==null){this.wf.add(a);var y=a.node;y!==null&&this.Es.add(y,a),a.network=this}},yt.Bl=function(a){if(a===null)return null;var y=this.ki(a);return y===null&&(y=this.createVertex(),y.node=a,this.dh(y)),y},yt.Iu=function(a){if(a!==null&&h1(this,a)){for(var y=a.tg,x=y.count-1;0<=x;x--){var E=y.M(x);this.Mj(E)}for(y=a.mg,a=y.count-1;0<=a;a--)x=y.M(a),this.Mj(x)}};function h1(a,y){if(y===null)return!1;var x=a.wf.remove(y);return x&&(y=y.node,y!==null&&a.Es.remove(y)),x}yt.Zy=function(a){a!==null&&(a=this.ki(a),a!==null&&this.Iu(a))},yt.ki=function(a){return a===null?null:this.Es.I(a)},yt.Bo=function(a){if(a!==null){iy(this,a);var y=a.toVertex;y!==null&&y.Cl(a),y=a.fromVertex,y!==null&&y.zl(a)}};function iy(a,y){if(y!==null){a.ye.add(y);var x=y.link;x!==null&&a.Lo(x)===null&&a.zs.add(x,y),y.network=a}}yt.Dy=function(a){if(a===null)return null;var y=a.fromNode,x=a.toNode,E=this.Lo(a);return E===null?(E=this.createEdge(),E.link=a,y!==null&&(E.fromVertex=this.Bl(y)),x!==null&&(E.toVertex=this.Bl(x)),this.Bo(E)):(y!==null?E.fromVertex=this.Bl(y):E.fromVertex=null,x!==null?E.toVertex=this.Bl(x):E.toVertex=null),E},yt.Mj=function(a){if(a!==null){var y=a.toVertex;y!==null&&y.Kl(a),y=a.fromVertex,y!==null&&y.Jl(a),ny(this,a)}};function ny(a,y){y!==null&&a.ye.remove(y)&&(y=y.link,y!==null&&a.zs.remove(y))}yt.Yy=function(a){a!==null&&(a=this.Lo(a),a!==null&&this.Mj(a))},yt.Lo=function(a){return a===null?null:this.zs.I(a)},yt.Zj=function(a,y,x){if(a===null||y===null)return null;if(a.network===this&&y.network===this){var E=this.createEdge();return E.link=x,E.fromVertex=a,E.toVertex=y,this.Bo(E),E}return null},yt.gm=function(a){if(a!==null){var y=a.fromVertex,x=a.toVertex;y!==null&&x!==null&&(y.Jl(a),x.Kl(a),a.gm(),y.Cl(a),x.zl(a))}},yt.Ko=function(){for(var a=ii(),y=this.ye.iterator;y.next();){var x=y.value;x.fromVertex===x.toVertex&&a.push(x)}for(y=a.length,x=0;x<y;x++)this.Mj(a[x]);Hi(a)},Ir.prototype.deleteArtificialVertexes=function(){for(var a=ii(),y=this.wf.iterator;y.next();){var x=y.value;x.node===null&&x.data===null&&a.push(x)}for(x=a.length,y=0;y<x;y++)this.Iu(a[y]);for(y=ii(),x=this.ye.iterator;x.next();){var E=x.value;E.link===null&&E.data===null&&y.push(E)}for(x=y.length,E=0;E<x;E++)this.Mj(y[E]);Hi(a),Hi(y)};function Iw(a){for(var y=ii(),x=a.ye.iterator;x.next();){var E=x.value;E.fromVertex!==null&&E.toVertex!==null||y.push(E)}for(x=y.length,E=0;E<x;E++)a.Mj(y[E]);Hi(y)}Ir.prototype.Zx=function(a){a===void 0&&(a=!0),a&&(this.deleteArtificialVertexes(),Iw(this),this.Ko()),a=new Me;for(var y=!0;y;){y=!1;for(var x=this.wf.iterator;x.next();){var E=x.value;if(0<E.tg.count||0<E.mg.count){y=this.layout.createNetwork(),a.add(y),ry(this,y,E),y=!0;break}}}return a.sort(function(b,z){return b===null||z===null||b===z?0:z.vertexes.count-b.vertexes.count}),a};function ry(a,y,x){if(x!==null&&x.network!==y){h1(a,x),y.dh(x);for(var E=x.sourceEdges;E.next();){var b=E.value;b.network!==y&&(ny(a,b),iy(y,b),ry(a,y,b.fromVertex))}for(E=x.destinationEdges;E.next();)x=E.value,x.network!==y&&(ny(a,x),iy(y,x),ry(a,y,x.toVertex))}}Ir.prototype.dz=function(){for(var a=new _e,y=this.wf.iterator;y.next();)a.add(y.value.node);for(y=this.ye.iterator;y.next();)a.add(y.value.link);return a},zi.Object.defineProperties(Ir.prototype,{layout:{get:function(){return this.Sc},set:function(a){a!==null&&(this.Sc=a)}},vertexes:{get:function(){return this.wf}},edges:{get:function(){return this.ye}}}),Ir.prototype.findAllParts=Ir.prototype.dz,Ir.prototype.splitIntoSubNetworks=Ir.prototype.Zx,Ir.prototype.deleteSelfEdges=Ir.prototype.Ko,Ir.prototype.reverseEdge=Ir.prototype.gm,Ir.prototype.linkVertexes=Ir.prototype.Zj,Ir.prototype.findEdge=Ir.prototype.Lo,Ir.prototype.deleteLink=Ir.prototype.Yy,Ir.prototype.deleteEdge=Ir.prototype.Mj,Ir.prototype.addLink=Ir.prototype.Dy,Ir.prototype.addEdge=Ir.prototype.Bo,Ir.prototype.findVertex=Ir.prototype.ki,Ir.prototype.deleteNode=Ir.prototype.Zy,Ir.prototype.deleteVertex=Ir.prototype.Iu,Ir.prototype.addNode=Ir.prototype.Bl,Ir.prototype.addVertex=Ir.prototype.dh,Ir.prototype.addParts=Ir.prototype.lg,Ir.className="LayoutNetwork";function Fo(a){bi(this),this.ob=a,this.j=new be(0,0,10,10).freeze(),this.o=new Pt(5,5).freeze(),this.Sh=this.ub=null,this.tg=new Me,this.mg=new Me}Fo.prototype.clear=function(){this.Sh=this.ub=null,this.tg=new Me,this.mg=new Me},Fo.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutVertex#"+kn(this);if(0<a&&(y+=this.node!==null?"("+this.node.toString()+")":"",1<a)){a="";for(var x=!0,E=this.tg.iterator;E.next();){var b=E.value;x?x=!1:a+=",",a+=b.toString(0)}for(b="",x=!0,E=this.mg.iterator;E.next();){var z=E.value;x?x=!1:b+=",",b+=z.toString(0)}y+=" sources: "+a+" destinations: "+b}return y},Fo.prototype.commit=function(){var a=this.ub;if(a!==null){var y=this.bounds,x=a.bounds;Oe(x)?(x.x=y.x,x.y=y.y,x.width=y.width,x.height=y.height):a.bounds=y.copy()}else if(a=this.node,a!==null){if(y=this.bounds,!(a instanceof An)){x=be.alloc(),a.Va();var E=this.network.layout.ni(a,x),b=a.locationObject.ga(Hn);if(E.w()&&b.w()){a.moveTo(y.x+this.focusX-(b.x-E.x),y.y+this.focusY-(b.y-E.y)),be.free(x);return}be.free(x)}a.moveTo(y.x,y.y)}},Fo.prototype.Cl=function(a){a!==null&&(this.tg.contains(a)||this.tg.add(a))},Fo.prototype.Kl=function(a){a!==null&&this.tg.remove(a)},Fo.prototype.zl=function(a){a!==null&&(this.mg.contains(a)||this.mg.add(a))},Fo.prototype.Jl=function(a){a!==null&&this.mg.remove(a)};function oy(a,y){return a=a.Sh,y=y.Sh,a?y?(a=a.text,y=y.text,a<y?-1:a>y?1:0):1:y!==null?-1:0}zi.Object.defineProperties(Fo.prototype,{sourceEdgesArrayAccess:{get:function(){return this.tg._dataArray}},destinationEdgesArrayAccess:{get:function(){return this.mg._dataArray}},data:{get:function(){return this.ub},set:function(a){if(this.ub=a,a!==null&&a.bounds){var y=a.bounds;a=y.x;var x=y.y,E=y.width;y=y.height,this.o.h(E/2,y/2),this.j.h(a,x,E,y)}}},node:{get:function(){return this.Sh},set:function(a){if(this.Sh!==a){this.Sh=a,a.Va();var y=this.network.layout,x=be.alloc(),E=y.ni(a,x);y=E.x;var b=E.y,z=E.width;if(E=E.height,isNaN(y)&&(y=0),isNaN(b)&&(b=0),this.j.h(y,b,z,E),be.free(x),!(a instanceof An)&&(a=a.locationObject.ga(Hn),a.w())){this.o.h(a.x-y,a.y-b);return}this.o.h(z/2,E/2)}}},bounds:{get:function(){return this.j},set:function(a){this.j.D(a)||this.j.assign(a)}},focus:{get:function(){return this.o},set:function(a){this.o.D(a)||this.o.assign(a)}},centerX:{get:function(){return this.j.x+this.o.x},set:function(a){var y=this.j;y.x+this.o.x!==a&&(y.ka(),y.x=a-this.o.x,y.freeze())}},centerY:{get:function(){return this.j.y+this.o.y},set:function(a){var y=this.j;y.y+this.o.y!==a&&(y.ka(),y.y=a-this.o.y,y.freeze())}},focusX:{get:function(){return this.o.x},set:function(a){var y=this.o;y.x!==a&&(y.ka(),y.x=a,y.freeze())}},focusY:{get:function(){return this.o.y},set:function(a){var y=this.o;y.y!==a&&(y.ka(),y.y=a,y.freeze())}},x:{get:function(){return this.j.x},set:function(a){var y=this.j;y.x!==a&&(y.ka(),y.x=a,y.freeze())}},y:{get:function(){return this.j.y},set:function(a){var y=this.j;y.y!==a&&(y.ka(),y.y=a,y.freeze())}},width:{get:function(){return this.j.width},set:function(a){var y=this.j;y.width!==a&&(y.ka(),y.width=a,y.freeze())}},height:{get:function(){return this.j.height},set:function(a){var y=this.j;y.height!==a&&(y.ka(),y.height=a,y.freeze())}},network:{get:function(){return this.ob},set:function(a){this.ob=a}},sourceVertexes:{get:function(){for(var a=new _e,y=this.sourceEdges;y.next();)a.add(y.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new _e,y=this.destinationEdges;y.next();)a.add(y.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new _e,y=this.sourceEdges;y.next();)a.add(y.value.fromVertex);for(y=this.destinationEdges;y.next();)a.add(y.value.toVertex);return a.iterator}},sourceEdges:{get:function(){return this.tg.iterator}},destinationEdges:{get:function(){return this.mg.iterator}},edges:{get:function(){for(var a=new Me,y=this.sourceEdges;y.next();)a.add(y.value);for(y=this.destinationEdges;y.next();)a.add(y.value);return a.iterator}},edgesCount:{get:function(){return this.tg.count+this.mg.count}}}),Fo.prototype.deleteDestinationEdge=Fo.prototype.Jl,Fo.prototype.addDestinationEdge=Fo.prototype.zl,Fo.prototype.deleteSourceEdge=Fo.prototype.Kl,Fo.prototype.addSourceEdge=Fo.prototype.Cl,Fo.className="LayoutVertex",Fo.standardComparer=oy,Fo.smartComparer=function(a,y){if(a!==null){if(y!==null){a=a.Sh;var x=y.Sh;if(a!==null){if(x!==null){for(y=a.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),a=x.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),x=0;x<y.length;x++)if(a[x]!==""&&a[x]!==void 0){var E=parseFloat(y[x]),b=parseFloat(a[x]);if(isNaN(E))if(isNaN(b)){if(y[x].localeCompare(a[x])!==0)return y[x].localeCompare(a[x])}else return 1;else{if(isNaN(b))return-1;if(E-b!==0)return E-b}}else if(y[x]!=="")return 1;return a[x]!==""&&a[x]!==void 0?-1:0}return 1}return x!==null?-1:0}return 1}return y!==null?-1:0};function ma(a){bi(this),this.nb=a,this.qd=this.kd=this.$k=this.ub=null}ma.prototype.clear=function(){this.qd=this.kd=this.$k=this.ub=null},ma.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutEdge#"+kn(this);return 0<a&&(y+=this.$k!==null?"("+this.$k.toString()+")":"",1<a&&(y+=" "+(this.kd?this.kd.toString():"null")+" --> "+(this.qd?this.qd.toString():"null"))),y},ma.prototype.gm=function(){var a=this.kd;this.kd=this.qd,this.qd=a},ma.prototype.commit=function(){},ma.prototype.Ax=function(a){return this.qd===a?this.kd:this.kd===a?this.qd:null},zi.Object.defineProperties(ma.prototype,{network:{get:function(){return this.nb},set:function(a){this.nb=a}},data:{get:function(){return this.ub},set:function(a){this.ub!==a&&(this.ub=a)}},link:{get:function(){return this.$k},set:function(a){this.$k!==a&&(this.$k=a)}},fromVertex:{get:function(){return this.kd},set:function(a){this.kd!==a&&(this.kd=a)}},toVertex:{get:function(){return this.qd},set:function(a){this.qd!==a&&(this.qd=a)}}}),ma.prototype.getOtherVertex=ma.prototype.Ax,ma.className="LayoutEdge";function is(a){Gr.call(this),this.isViewportSized=!0,this.yo=this.zo=NaN,this.yg=new li(NaN,NaN).freeze(),this.tf=new li(10,10).freeze(),this.Jb=sg,this.Rb=im,this.nd=ag,this.hd=c1,a&&Object.assign(this,a)}Vi(is,Gr),is.prototype.cloneProtected=function(a){Gr.prototype.cloneProtected.call(this,a),a.zo=this.zo,a.yo=this.yo,a.yg.assign(this.yg),a.tf.assign(this.tf),a.Jb=this.Jb,a.Rb=this.Rb,a.nd=this.nd,a.hd=this.hd},is.prototype.qb=function(a){a.classType===is?a===ag||a===rm||a===sy||a===nm?this.sorting=a:a===im||a===Al?this.arrangement=a:a===sg||a===em?this.alignment=a:It("Unknown enum value: "+a):Gr.prototype.qb.call(this,a)},is.prototype.doLayout=function(a){this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var y=this.ex(a);a=this.diagram;for(var x=y.copy().iterator;x.next();){var E=x.value;if(!E.ph()||E.fromNode===null&&E.toNode===null){if(E.Va(),E instanceof An)for(E=E.memberParts;E.next();)y.remove(E.value)}else y.remove(E)}var b=y.Fa();if(b.length!==0){switch(this.sorting){case nm:b.reverse();break;case ag:b.sort(this.comparer);break;case rm:b.sort(this.comparer),b.reverse()}var z=this.wrappingColumn;isNaN(z)&&(z=0);var tt=this.wrappingWidth;switch(isNaN(tt)&&a!==null?(y=a.padding,tt=Math.max(a.viewportBounds.width-y.left-y.right,0)):tt=Math.max(this.wrappingWidth,0),0>=z&&0>=tt&&(z=1),y=this.spacing.width,isFinite(y)||(y=0),x=this.spacing.height,isFinite(x)||(x=0),a!==null&&a.Ea("Layout"),E=[],this.alignment){case em:var it=y,nt=x,ot=be.alloc(),st=Math.max(this.cellSize.width,1);if(!isFinite(st))for(var ut=st=0;ut<b.length;ut++){var ct=this.ni(b[ut],ot);st=Math.max(st,ct.width)}if(st=Math.max(st+it,1),ut=Math.max(this.cellSize.height,1),!isFinite(ut))for(ct=ut=0;ct<b.length;ct++){var dt=this.ni(b[ct],ot);ut=Math.max(ut,dt.height)}ut=Math.max(ut+nt,1),ct=this.arrangement;for(var vt=dt=this.arrangementOrigin.x,xt=this.arrangementOrigin.y,Tt=0,Et=0,Ft=0;Ft<b.length;Ft++){var Ot=b[Ft],Rt=this.ni(Ot,ot),Ht=Math.ceil((Rt.width+it)/st)*st,ae=Math.ceil((Rt.height+nt)/ut)*ut;switch(ct){case Al:var wi=Math.abs(vt-Rt.width);break;default:wi=vt+Rt.width}switch((0<z&&Tt>z-1||0<tt&&0<Tt&&wi-dt>tt)&&(E.push(new be(0,xt,tt+it,Et)),Tt=0,vt=dt,xt+=Et,Et=0),Et=Math.max(Et,ae),ct){case Al:Rt=-Rt.width;break;default:Rt=0}switch(Ot.moveTo(vt+Rt,xt),ct){case Al:vt-=Ht;break;default:vt+=Ht}Tt++}E.push(new be(0,xt,tt+it,Et)),be.free(ot);break;case sg:for(nt=tt,st=z,ut=y,ct=x,tt=be.alloc(),dt=Math.max(this.cellSize.width,1),z=xt=ot=0,it=Pt.alloc(),vt=0;vt<b.length;vt++)Et=b[vt],Tt=this.ni(Et,tt),Et=uh(Et,Et.locationObject,Et.locationSpot,it),ot=Math.max(ot,Et.x),xt=Math.max(xt,Tt.width-Et.x),z=Math.max(z,Et.y);switch(vt=this.arrangement,vt){case Al:ot+=ut;break;default:xt+=ut}dt=isFinite(dt)?Math.max(dt+ut,1):Math.max(ot+xt,1);var Ki=Et=this.arrangementOrigin.x;for(Ft=this.arrangementOrigin.y,xt=0,nt>=ot&&(nt-=ot),ot=Ot=0,Ht=Math.max(this.cellSize.height,1),Rt=z=0,ae=!0,Tt=Pt.alloc(),wi=0;wi<b.length;wi++){var Ii=b[wi],hi=this.ni(Ii,tt),Ue=uh(Ii,Ii.locationObject,Ii.locationSpot,it);if(0<xt)switch(vt){case Al:Ki=(Ki-Et-(hi.width-Ue.x))/dt,Ki=Gt.$(Math.round(Ki),Ki)?Math.round(Ki):Math.floor(Ki),Ki=Ki*dt+Et;break;default:Ki=(Ki-Et+Ue.x)/dt,Ki=Gt.$(Math.round(Ki),Ki)?Math.round(Ki):Math.ceil(Ki),Ki=Ki*dt+Et}else switch(vt){case Al:Ot=Ki+Ue.x+hi.width;break;default:Ot=Ki-Ue.x}switch(vt){case Al:var Ln=-(Ki+Ue.x)+Ot;break;default:Ln=Ki+hi.width-Ue.x-Ot}if(0<st&&xt>st-1||0<nt&&0<xt&&Ln>nt){for(E.push(new be(0,ae?Ft-z:Ft,nt+ut,Rt+z+ct)),Ki=0;Ki<xt&&wi!==xt;Ki++){Ln=b[wi-xt+Ki];var wn=uh(Ln,Ln.locationObject,Ln.locationSpot,Tt);Ln.moveTo(Ln.position.x,Ln.position.y+z-wn.y)}Rt+=ct,Ft=ae?Ft+Rt:Ft+(Rt+z),xt=Rt=z=0,Ki=Et,ae=!1}switch(Ki===Et&&(ot=vt===Al?Math.max(ot,hi.width-Ue.x):Math.min(ot,-Ue.x)),z=Math.max(z,Ue.y),Rt=Math.max(Rt,hi.height-Ue.y),isFinite(Ht)&&(Rt=Math.max(Rt,Math.max(hi.height,Ht)-Ue.y)),ae?Ii.moveTo(Ki-Ue.x,Ft-Ue.y):Ii.moveTo(Ki-Ue.x,Ft),vt){case Al:Ki-=Ue.x+ut;break;default:Ki+=hi.width-Ue.x+ut}xt++}if(E.push(new be(0,Ft,nt+ut,(ae?Rt:Rt+z)+ct)),b.length!==xt)for(nt=0;nt<xt;nt++)st=b[b.length-xt+nt],ut=uh(st,st.locationObject,st.locationSpot,it),st.moveTo(st.position.x,st.position.y+z-ut.y);if(Pt.free(it),Pt.free(Tt),vt===Al)for(b=0;b<E.length;b++)z=E[b],z.width+=ot,z.x-=ot;else for(b=0;b<E.length;b++)z=E[b],z.x>ot&&(z.width+=z.x-ot,z.x=ot);be.free(tt)}for(it=z=tt=b=0;it<E.length;it++)nt=E[it],b=Math.min(b,nt.x),tt=Math.min(tt,nt.y),z=Math.max(z,nt.x+nt.width);this.arrangement===Al?this.commitLayers(E,new Pt(b+y/2-(z+b),tt-x/2)):this.commitLayers(E,new Pt(b-y/2,tt-x/2)),a!==null&&a.eb("Layout"),this.isValidLayout=!0}},is.prototype.commitLayers=function(){};function c1(a,y){return a=a.text,y=y.text,a<y?-1:a>y?1:0}zi.Object.defineProperties(is.prototype,{wrappingWidth:{get:function(){return this.zo},set:function(a){this.zo!==a&&(0<a||isNaN(a))&&(this.zo=a,this.isViewportSized=isNaN(a),this.C())}},wrappingColumn:{get:function(){return this.yo},set:function(a){this.yo!==a&&(0<a||isNaN(a))&&(this.yo=a,this.C())}},cellSize:{get:function(){return this.yg},set:function(a){this.yg.D(a)||(this.yg.assign(a),this.C())}},spacing:{get:function(){return this.tf},set:function(a){this.tf.D(a)||(this.tf.assign(a),this.C())}},alignment:{get:function(){return this.Jb},set:function(a){this.Jb===a||a!==sg&&a!==em||(this.Jb=a,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==im&&a!==Al||(this.Rb=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==sy&&a!==nm&&a!==ag&&a!==rm||(this.nd=a,this.C())}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a,this.C())}}});var em=new ze(is,"Position",0),sg=new ze(is,"Location",1),im=new ze(is,"LeftToRight",2),Al=new ze(is,"RightToLeft",3),sy=new ze(is,"Forward",4),nm=new ze(is,"Reverse",5),ag=new ze(is,"Ascending",6),rm=new ze(is,"Descending",7);is.className="GridLayout",is.standardComparer=c1,is.smartComparer=function(a,y){if(a!==null){if(y!==null){a=a.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),y=y.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/);for(var x=0;x<a.length;x++)if(y[x]!==""&&y[x]!==void 0){var E=parseFloat(a[x]),b=parseFloat(y[x]);if(isNaN(E))if(isNaN(b)){if(a[x].localeCompare(y[x])!==0)return a[x].localeCompare(y[x])}else return 1;else{if(isNaN(b))return-1;if(E-b!==0)return E-b}}else if(a[x]!=="")return 1;return y[x]!==""&&y[x]!==void 0?-1:0}return 1}return y!==null?-1:0},is.Position=em,is.Location=sg,is.LeftToRight=im,is.RightToLeft=Al,is.Forward=sy,is.Reverse=nm,is.Ascending=ag,is.Descending=rm;function Mr(){this.On=new _e,this.Dn=new _e,this.Pa=new _e,this.cf=new ji,this.bf=new ji,this.aj=new ji,this.H=null,this.tp=!1}yt=Mr.prototype,yt.clear=function(){this.On.clear(),this.Dn.clear(),this.Pa.clear(),this.cf.clear(),this.bf.clear(),this.aj.clear()},yt.Xe=function(a){this.H=a},yt.oi=function(a){if(a instanceof Ci){if(this.On.add(a),a instanceof An){var y=a.containingGroup;y===null?this.H.ai.add(a):y.gl.add(a),y=a.layout,y!==null&&(y.diagram=this.H)}}else a instanceof fi?this.Dn.add(a):a instanceof cr||this.Pa.add(a);y=a.data,y===null||a instanceof cr||(a instanceof fi?this.bf.add(y,a):this.cf.add(y,a))},yt.pc=function(a){if(a.Ej(),a instanceof Ci){if(this.On.remove(a),a instanceof An){var y=a.containingGroup;y===null?this.H.ai.remove(a):y.gl.remove(a),y=a.layout,y!==null&&(y.diagram=null)}}else a instanceof fi?this.Dn.remove(a):a instanceof cr||this.Pa.remove(a);y=a.data,y===null||a instanceof cr||(a instanceof fi?this.bf.remove(y):this.cf.remove(y))},yt.Wd=function(){var a=this.H;if(a!==null){for(var y=a.nodeTemplateMap.iterator;y.next();){var x=y.value,E=y.key;(!x.Zc()||x instanceof An)&&It('Invalid node template in Diagram.nodeTemplateMap: template for "'+E+'" must be a Node or a simple Part, not a Group or Link: '+x)}for(y=a.groupTemplateMap.iterator;y.next();)x=y.value,E=y.key,x instanceof An||It('Invalid group template in Diagram.groupTemplateMap: template for "'+E+'" must be a Group, not a normal Node or Link: '+x);for(y=a.linkTemplateMap.iterator;y.next();)x=y.value,E=y.key,x instanceof fi||It('Invalid link template in Diagram.linkTemplateMap: template for "'+E+'" must be a Link, not a normal Node or simple Part: '+x);for(y=ii(),x=a.selection.iterator;x.next();)(E=x.value.data)&&y.push(E);for(x=ii(),a=a.highlighteds.iterator;a.next();)(E=a.value.data)&&x.push(E);for(a=ii(),E=this.nodes.iterator;E.next();){var b=E.value;b.data!==null&&(a.push(b.data),a.push(b.location))}for(E=this.links.iterator;E.next();)b=E.value,b.data!==null&&(a.push(b.data),a.push(b.location));for(E=this.parts.iterator;E.next();)b=E.value,b.data!==null&&(a.push(b.data),a.push(b.location));for(this.removeAllModeledParts(),this.addAllModeledParts(),E=0;E<y.length;E++)b=this.Lc(y[E]),b!==null&&(b.isSelected=!0);for(E=0;E<x.length;E++)b=this.Lc(x[E]),b!==null&&(b.isHighlighted=!0);for(E=0;E<a.length;E+=2)b=this.Lc(a[E]),b!==null&&(b.location=a[E+1]);Hi(y),Hi(x),Hi(a)}},Mr.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)},Mr.prototype.addModeledParts=function(a,y){var x=this,E=this.diagram.model;a.forEach(function(b){E.lb(b)&&f1(x,b,!1)}),a.forEach(function(b){E.lb(b)&&x.resolveReferencesForData(b)}),y!==!1&&ad(this.diagram,!1)};function f1(a,y,x){if(y!=null&&!a.diagram.undoManager.isUndoingRedoing&&!a.cf.contains(y)){x===void 0&&(x=!0);t:{if(y!=null&&!a.H.undoManager.isUndoingRedoing&&!a.cf.contains(y)){var E=a.Ro(y),b=d1(a,y,E);if(b!==null&&(rl(b),b=b.copy(),b!==null)){var z=a.diagram.skipsModelSourceBindings;a.diagram.skipsModelSourceBindings=!0,b.Tf=E,b.ub=y,a.tp&&(b.Jg="Tool"),a.diagram.add(b),b.ub=null,b.data=y,a.diagram.skipsModelSourceBindings=z,E=b;break t}}E=null}E!==null&&x&&a.resolveReferencesForData(y)}}Mr.prototype.insertLink=function(){return null},Mr.prototype.resolveReferencesForData=function(){},Mr.prototype.Ro=function(a){return this.H.model.Ro(a)};function d1(a,y,x){a=a.H;var E=a.model;return E.Xj()&&E.Yu(y)?(y=a.groupTemplateMap.I(x),y===null&&(y=a.groupTemplateMap.I(""),y===null&&(v1||(v1=!0,Di('No Group template found for category "'+x+'"'),Di(" Using default group template")),y=a.ly))):(y=a.nodeTemplateMap.I(x),y===null&&(y=a.nodeTemplateMap.I(""),y===null&&(g1||(g1=!0,Di('No Node template found for category "'+x+'"'),Di(" Using default node template")),y=a.ny))),y}Mr.prototype.getLinkCategoryForData=function(){return""},Mr.prototype.setLinkCategoryForData=function(){},Mr.prototype.setFromNodeForLink=function(){},Mr.prototype.setToNodeForLink=function(){},Mr.prototype.findLinkTemplateForCategory=function(a){var y=this.H,x=y.linkTemplateMap.I(a);return x===null&&(x=y.linkTemplateMap.I(""),x===null&&(m1||(m1=!0,Di('No Link template found for category "'+a+'"'),Di(" Using default link template")),x=y.my)),x},Mr.prototype.removeAllModeledParts=function(){this.Gs(this.diagram.model.nodeDataArray)},Mr.prototype.Gs=function(a){var y=this;a.forEach(function(x){y.ip(x)})},Mr.prototype.ip=function(a){a=this.Lc(a),a!==null&&(Sp(this.diagram,a,!1),this.unresolveReferencesForPart(a))},Mr.prototype.unresolveReferencesForPart=function(){},Mr.prototype.removeDataForLink=function(){},Mr.prototype.findPartForKey=function(a){return a==null?null:(a=this.H.model.hc(a),a!==null?this.cf.I(a):null)},Mr.prototype.Vb=function(a){return a==null||(a=this.H.model.hc(a),a===null)?null:(a=this.cf.I(a),a instanceof Ci?a:null)},Mr.prototype.findLinkForKey=function(){return null},yt=Mr.prototype,yt.Lc=function(a){if(a===null)return null;var y=this.cf.I(a);return y!==null?y:y=this.bf.I(a)},yt.ii=function(a){return a===null?null:(a=this.cf.I(a),a instanceof Ci?a:null)},yt.Kc=function(a){return a===null?null:this.bf.I(a)},yt.ms=function(a){for(var y=0;y<arguments.length;++y);y=new _e;for(var x=this.On.iterator;x.next();){var E=x.value,b=E.data;if(b!==null)for(var z=0;z<arguments.length;z++){var tt=arguments[z];if(Oe(tt)&&ay(this,b,tt)){y.add(E);break}}}return y.iterator},yt.ls=function(a){for(var y=0;y<arguments.length;++y);y=new _e;for(var x=this.Dn.iterator;x.next();){var E=x.value,b=E.data;if(b!==null)for(var z=0;z<arguments.length;z++){var tt=arguments[z];if(Oe(tt)&&ay(this,b,tt)){y.add(E);break}}}return y.iterator};function ay(a,y,x){for(var E in x){var b=y[E],z=x[E];if(Ti(z)){if(!Ti(b)||b.length<z.length)return!1;for(var tt=0;tt<b.length;tt++){var it=z[tt];if(it!==void 0&&!p1(a,b[tt],it))return!1}}else if(!p1(a,b,z))return!1}return!0}function p1(a,y,x){if(typeof x=="function"){if(!x(y))return!1}else if(x instanceof RegExp){if(!y||!x.test(y.toString()))return!1}else if(Oe(y)&&Oe(x)){if(!ay(a,y,x))return!1}else if(y!==x)return!1;return!0}Mr.prototype.doModelChanged=function(a){if(this.H){var y=this.H;if(a.model===y.model){var x=a.change;if(y.doModelChanged(a),y.aa){y.aa=!1;try{var E=a.modelChange;if(E!=="")if(x===Yr){if(E==="nodeCategory"){var b=this.Lc(a.object),z=a.newValue;b!==null&&typeof z=="string"&&(b.category=z)}else E==="nodeDataArray"&&(this.Gs(a.oldValue),this.addModeledParts(a.newValue));y.isModified=!0}else if(x===xo){var tt=a.newValue;E==="nodeDataArray"&&Oe(tt)&&f1(this,tt),y.isModified=!0}else if(x===Ao){var it=a.oldValue;E==="nodeDataArray"&&Oe(it)&&this.ip(it),y.isModified=!0}else x===da&&(E==="SourceChanged"?a.object!==null?this.updateDataBindings(a.object,a.propertyName):(this.rp(),this.updateAllTargetBindings()):E==="ModelDisplaced"&&this.Wd());else if(x===Yr){var nt=a.propertyName,ot=a.object;ot===y.model?(nt==="nodeKeyProperty"||nt==="nodeCategoryProperty")&&(y.undoManager.isUndoingRedoing||this.Wd()):this.updateDataBindings(ot,nt),y.isModified=!0}else if(x===xo||x===Ao){var st=a.change===xo,ut=st?a.newParam:a.oldParam,ct=st?a.newValue:a.oldValue,dt=this.aj.I(a.object);if(Array.isArray(dt))for(a=0;a<dt.length;a++){var vt=dt[a];if(st)kv(vt,ct,ut,!0);else if(!(0>ut)){var xt=ut+Wp(vt);vt.pc(xt,!0),S0(vt,xt,ut)}}y.isModified=!0}}finally{y.aa=!0}}}}},Mr.prototype.updateAllTargetBindings=function(a){a===void 0&&(a="");for(var y=this.parts.iterator;y.next();)y.value.La(a);for(y=this.nodes.iterator;y.next();)y.value.La(a);for(y=this.links.iterator;y.next();)y.value.La(a)},Mr.prototype.rp=function(){for(var a=this.H.model,y=new _e,x=a.nodeDataArray,E=0;E<x.length;E++)y.add(x[E]);var b=[];for(this.nodes.each(function(tt){tt.data===null||y.contains(tt.data)||b.push(tt.data)}),this.parts.each(function(tt){tt.data===null||y.contains(tt.data)||b.push(tt.data)}),b.forEach(function(tt){b1(a,tt,!1)}),E=0;E<x.length;E++){var z=x[E];this.Lc(z)===null&&E1(a,z,!1)}for(this.refreshDataBoundLinks(),x=this.parts.iterator;x.next();)x.value.updateRelationshipsFromData();for(x=this.nodes.iterator;x.next();)x.value.updateRelationshipsFromData();for(x=this.links.iterator;x.next();)x.value.updateRelationshipsFromData()},Mr.prototype.refreshDataBoundLinks=function(){},Mr.prototype.updateRelationshipsFromData=function(){},Mr.prototype.updateDataBindings=function(a,y){if(typeof y=="string"){var x=this.Lc(a);if(x!==null)x.La(y);else{x=null;for(var E=this.aj.iterator;E.next();){for(var b=E.value,z=0;z<b.length;z++){var tt=b[z].sx(a);tt!==null&&(x===null&&(x=ii()),x.push(tt))}if(x!==null)break}if(x!==null){for(E=0;E<x.length;E++)x[E].La(y);Hi(x)}}a===this.diagram.model.modelData&&this.updateAllTargetBindings(y)}};function ly(a,y){var x=y.Hh;if(Ti(x)){var E=a.aj.I(x);if(E===null)E=[],E.push(y),a.aj.add(x,E);else{for(a=0;a<E.length;a++)if(E[a]===y)return;E.push(y)}}}function uy(a,y,x){Oc(y,function(tt){tt=tt.O.s;for(var it=tt.length,nt=0;nt<it;nt++)bp(x,tt[nt])});var E=y.Hh;if(Ti(E)){var b=a.aj.I(E);if(b!==null){for(var z=0;z<b.length;z++)if(b[z]===y){b.splice(z,1),b.length===0&&a.aj.remove(E);break}}}}Mr.prototype.Kj=function(a,y,x){x===void 0&&(x=!1);var E=new ji;if(Ti(a))for(var b=0;b<a.length;b++)om(this,a[b],y,E,x);else for(a=a.iterator;a.next();)om(this,a.value,y,E,x);if(y!==null){x=y.model,a=y.toolManager.findTool("Dragging"),a=a!==null?a.dragOptions.dragsLink:y.Wm.dragsLink,b=new _e;for(var z=new ji,tt=E.iterator;tt.next();){var it=tt.value;if(it instanceof fi)a||it.fromNode!==null&&it.toNode!==null||b.add(it);else if(it instanceof Ci&&it.data!==null&&x.Tl()){var nt=it;it=tt.key;var ot=it.pg();ot!==null&&(ot=E.I(ot),ot!==null?(x.qe(nt.data,x.wa(ot.data)),nt=y.Kc(nt.data),it=it.kh(),it!==null&&nt!==null&&z.add(it,nt)):x.qe(nt.data,void 0))}}if(0<b.count&&y.Is(b,!1),0<z.count)for(x=z.iterator;x.next();)E.add(x.key,x.value)}if(y!==null&&this.H!==null&&(y=y.model,x=y.afterCopyFunction,x!==null)){var st=new ji;E.each(function(ut){ut.key.data!==null&&st.add(ut.key.data,ut.value.data)}),x(st,y,this.H.model)}for(y=E.iterator;y.next();)y.value.La();return E};function om(a,y,x,E,b){if(y===null||b&&!y.canCopy())return null;if(E.contains(y))return E.I(y);var z=a.copyPartData(y,x);if(!(z instanceof tn))return null;if(z.isSelected=!1,z.isHighlighted=!1,E.add(y,z),y instanceof Ci){for(var tt=y.linksConnected;tt.next();){var it=tt.value;if(it.fromNode===y){var nt=E.I(it);nt!==null&&(nt.fromNode=z)}it.toNode===y&&(it=E.I(it),it!==null&&(it.toNode=z))}if(y instanceof An&&z instanceof An)for(y=y.memberParts;y.next();)tt=om(a,y.value,x,E,b),tt instanceof fi||tt===null||(tt.containingGroup=z)}else if(y instanceof fi&&z instanceof fi)for(tt=y.fromNode,tt!==null&&(tt=E.I(tt),tt!==null&&(z.fromNode=tt)),tt=y.toNode,tt!==null&&(tt=E.I(tt),tt!==null&&(z.toNode=tt)),y=y.labelNodes;y.next();)tt=om(a,y.value,x,E,b),tt!==null&&tt instanceof Ci&&(tt.labeledLink=z);return z}Mr.prototype.copyPartData=function(a,y){var x=null,E=a.data;if(E!==null&&y!==null){var b=y.model;a instanceof fi||(E=b.copyNodeData(E),Oe(E)&&(b.xf(E),x=y.Lc(E)))}else rl(a),x=a.copy(),x!==null&&(b=this.H,y!==null?y.add(x):E!==null&&b!==null&&b.commandHandler!==null&&b.commandHandler.copiesClipboardData&&(y=b.model,b=null,x instanceof fi||(b=y.copyNodeData(E)),Oe(b)&&(x.data=b)));return x},zi.Object.defineProperties(Mr.prototype,{nodes:{get:function(){return this.On}},links:{get:function(){return this.Dn}},parts:{get:function(){return this.Pa}},diagram:{get:function(){return this.H}},addsToTemporaryLayer:{get:function(){return this.tp},set:function(a){this.tp=a}}}),Mr.prototype.updateAllRelationshipsFromData=Mr.prototype.rp,Mr.prototype.findLinksByExample=Mr.prototype.ls,Mr.prototype.findNodesByExample=Mr.prototype.ms,Mr.prototype.findLinkForData=Mr.prototype.Kc,Mr.prototype.findNodeForData=Mr.prototype.ii,Mr.prototype.findPartForData=Mr.prototype.Lc,Mr.prototype.findNodeForKey=Mr.prototype.Vb,Mr.prototype.removeModeledPart=Mr.prototype.ip,Mr.prototype.removeModeledParts=Mr.prototype.Gs,Mr.prototype.rebuildParts=Mr.prototype.Wd;var g1=!1,v1=!1,m1=!1;Mr.className="PartManager";function Vo(a){Mr.apply(this,arguments)}Vi(Vo,Mr),Vo.prototype.addAllModeledParts=function(){var a=this.diagram.model;this.addModeledParts(a.nodeDataArray),y1(this,a.linkDataArray)},Vo.prototype.addModeledParts=function(a){for(Mr.prototype.addModeledParts.call(this,a,!1),a=this.links.iterator;a.next();)Nd(a.value);ad(this.diagram,!1)};function y1(a,y){y.forEach(function(x){x1(a,x)}),ad(a.diagram,!1)}function x1(a,y){if(y!=null&&!a.diagram.undoManager.isUndoingRedoing&&!a.bf.contains(y)){var x=a.getLinkCategoryForData(y),E=a.findLinkTemplateForCategory(x);if(E!==null){rl(E);var b=E.copy();if(b!==null){E=a.diagram.skipsModelSourceBindings,a.diagram.skipsModelSourceBindings=!0,b.Tf=x,b.ub=y,x=a.diagram.model;var z=um(x,y,!0);z!==""&&(b.fromPortId=z),z=Da(x,y,!0),z!==void 0&&(z=a.Vb(z),z instanceof Ci&&(b.fromNode=z)),z=um(x,y,!1),z!==""&&(b.toPortId=z),z=Da(x,y,!1),z!==void 0&&(z=a.Vb(z),z instanceof Ci&&(b.toNode=z)),x=x.Ef(y),Array.isArray(x)&&x.forEach(function(tt){tt=a.Vb(tt),tt!==null&&(tt.labeledLink=b)}),a.tp&&(b.Jg="Tool"),a.diagram.add(b),b.ub=null,b.data=y,a.diagram.skipsModelSourceBindings=E}}}}Vo.prototype.removeAllModeledParts=function(){var a=this.diagram.model;w1(this,a.linkDataArray),this.Gs(a.nodeDataArray)};function w1(a,y){y.forEach(function(x){a.ip(x)})}Vo.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ps(a)},Vo.prototype.setLinkCategoryForData=function(a,y){return this.diagram.model.lp(a,y)},Vo.prototype.setFromNodeForLink=function(a,y){var x=this.diagram.model;x.wv(a.data,x.wa(y!==null?y.data:null))},Vo.prototype.setToNodeForLink=function(a,y){var x=this.diagram.model;x.Bv(a.data,x.wa(y!==null?y.data:null))},Vo.prototype.removeDataForLink=function(a){this.diagram.model.bm(a.data)},Vo.prototype.findPartForKey=function(a){var y=Mr.prototype.findPartForKey.call(this,a);return y===null&&(a=this.diagram.model.jh(a),a!==null)?this.bf.I(a):y},Vo.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.jh(a),a!==null?this.bf.I(a):null)},Vo.prototype.doModelChanged=function(a){var y=this;if(Mr.prototype.doModelChanged.call(this,a),this.diagram){var x=this.diagram;if(a.model===x.model){var E=a.change;if(x.aa){x.aa=!1;try{var b=a.modelChange;if(b!==""){if(E===Yr){if(b==="linkFromKey"){var z=this.Kc(a.object);if(z!==null){var tt=this.Vb(a.newValue);z.fromNode=tt}}else if(b==="linkToKey"){var it=this.Kc(a.object);if(it!==null){var nt=this.Vb(a.newValue);it.toNode=nt}}else if(b==="linkFromPortId"){var ot=this.Kc(a.object);if(ot!==null){var st=a.newValue;typeof st=="string"&&(ot.fromPortId=st)}}else if(b==="linkToPortId"){var ut=this.Kc(a.object);if(ut!==null){var ct=a.newValue;typeof ct=="string"&&(ut.toPortId=ct)}}else if(b==="nodeGroupKey"){var dt=this.Lc(a.object);if(dt!==null){var vt=a.newValue;if(vt!==void 0){var xt=this.Vb(vt);xt instanceof An?dt.containingGroup=xt:dt.containingGroup=null}else dt.containingGroup=null}}else if(b==="linkLabelKeys"){var Tt=this.Kc(a.object);if(Tt!==null){var Et=a.oldValue,Ft=a.newValue;Array.isArray(Et)&&Et.forEach(function(Ue){0<=Ft.indexOf(Ue)||(Ue=y.Vb(Ue),Ue!==null&&(Ue.labeledLink=null))}),Array.isArray(Ft)&&Ft.forEach(function(Ue){Ue=y.Vb(Ue),Ue!==null&&(Ue.labeledLink=Tt)})}}else if(b==="linkCategory"){var Ot=this.Kc(a.object),Rt=a.newValue;Ot!==null&&typeof Rt=="string"&&(Ot.category=Rt)}else b==="linkDataArray"&&(w1(this,a.oldValue),y1(this,a.newValue));x.isModified=!0}else if(E===xo){var Ht=a.newValue;if(b==="linkDataArray"&&typeof Ht=="object"&&Ht!==null)x1(this,Ht);else if(b==="linkLabelKeys"&&Qh(Ht)){var ae=this.Kc(a.object),wi=this.Vb(Ht);ae!==null&&wi!==null&&(wi.labeledLink=ae)}x.isModified=!0}else if(E===Ao){var Ki=a.oldValue;if(b==="linkDataArray"&&typeof Ki=="object"&&Ki!==null)this.ip(Ki);else if(b==="linkLabelKeys"&&Qh(Ki)){var Ii=this.Vb(Ki);Ii!==null&&(Ii.labeledLink=null)}x.isModified=!0}}else if(E===Yr){var hi=a.propertyName;a.object!==x.model||hi!=="linkFromKeyProperty"&&hi!=="linkToKeyProperty"&&hi!=="linkFromPortIdProperty"&&hi!=="linkToPortIdProperty"&&hi!=="linkLabelKeysProperty"&&hi!=="nodeIsGroupProperty"&&hi!=="nodeGroupKeyProperty"&&hi!=="linkCategoryProperty"||x.undoManager.isUndoingRedoing||this.Wd(),x.isModified=!0}}finally{x.aa=!0}}}}},Vo.prototype.refreshDataBoundLinks=function(){var a=this,y=this.diagram.model,x=new _e,E=y.linkDataArray;E.forEach(function(z){x.add(z)});var b=[];this.links.each(function(z){z.data===null||x.contains(z.data)||b.push(z.data)}),b.forEach(function(z){D1(y,z,!1)}),E.forEach(function(z){a.Kc(z)===null&&A1(y,z,!1)})},Vo.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var E=x.model;if(a instanceof fi){var b=Da(E,y,!0);if(b=x.Vb(b),a.fromNode=b,b=Da(E,y,!1),b=x.Vb(b),a.toNode=b,y=E.Ef(y),0<y.length||0<a.labelNodes.count){if(y.length===1&&a.labelNodes.count===1){b=y[0];var z=a.labelNodes.first();if(E.wa(z.data)===b)return}b=new _e().addAll(y);var tt=new _e;a.labelNodes.each(function(it){it.data!==null&&(it=E.wa(it.data),it!==void 0&&tt.add(it))}),y=tt.copy(),y.hp(b),b=b.copy(),b.hp(tt),(0<y.count||0<b.count)&&(y.each(function(it){it=x.Vb(it),it!==null&&it.labeledLink===a&&(it.labeledLink=null)}),b.each(function(it){it=x.Vb(it),it!==null&&it.labeledLink!==a&&(it.labeledLink=a)}))}}else!(a instanceof cr)&&(y=E.lh(y),y=x.findPartForKey(y),y===null||y instanceof An)&&(a.containingGroup=y)}}},Vo.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=lg(y,x),b=this.Lc(a);if(E!==null&&b!==null){E=E.iterator;for(var z={};E.next();){var tt=E.value;y.lb(tt)?b instanceof An&&y.lh(tt)===x&&(tt=this.Lc(tt),tt!==null&&(tt.containingGroup=b)):(z.link=this.Kc(tt),z.link!==null&&b instanceof Ci&&(Da(y,tt,!0)===x&&(z.link.fromNode=b),Da(y,tt,!1)===x&&(z.link.toNode=b),tt=y.Ef(tt),Array.isArray(tt)&&tt.some(function(it){return function(nt){return nt===x?(b.labeledLink=it.link,!0):!1}}(z)))),z={link:z.link}}Fl(y,x)}a=y.lh(a),a!==void 0&&(a=this.Vb(a),a instanceof An&&(b.containingGroup=a))}},Vo.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof Ci){var x=y.wa(a.data);if(x!==void 0){for(var E=a.linksConnected;E.next();)Dl(y,x,E.value.data);if(a.isLinkLabel&&(E=a.labeledLink,E!==null&&Dl(y,x,E.data)),a instanceof An)for(a=a.memberParts;a.next();)E=a.value.data,y.lb(E)&&Dl(y,x,E)}}},Vo.prototype.copyPartData=function(a,y){var x=Mr.prototype.copyPartData.call(this,a,y);if(a instanceof fi)if(a=a.data,a!==null&&y!==null){var E=y.model;a=E.Jo(a),typeof a=="object"&&a!==null&&(E.fi(a),x=y.Kc(a))}else x!==null&&(y=this.diagram,a!==null&&y!==null&&y.commandHandler!==null&&y.commandHandler.copiesClipboardData&&(y=y.model.Jo(a),typeof y=="object"&&y!==null&&(x.data=y)));return x},Vo.prototype.insertLink=function(a,y,x,E){var b=this.diagram,z=b.model,tt=b.toolManager.findTool("Linking"),it="";if(a!==null&&(y===null&&(y=a),it=y.portId,it===null&&(it="")),y="",x!==null&&(E===null&&(E=x),y=E.portId,y===null&&(y="")),E=tt.archetypeLinkData,E instanceof fi){if(rl(E),z=E.copy(),z!==null)return z.fromNode=a,z.fromPortId=it,z.toNode=x,z.toPortId=y,b.add(z),a=tt.archetypeLabelNodeData,a instanceof Ci&&(rl(a),a=a.copy(),a!==null&&(a.labeledLink=z,b.add(a))),z}else if(E!==null&&(E=z.Jo(E),typeof E=="object"&&E!==null))return a!==null&&Bd(z,E,z.wa(a.data),!0),Od(z,E,it,!0),x!==null&&Bd(z,E,z.wa(x.data),!1),Od(z,E,y,!1),z.fi(E),a=tt.archetypeLabelNodeData,a===null||a instanceof Ci||(a=z.copyNodeData(a),typeof a=="object"&&a!==null&&(z.xf(a),a=z.wa(a),a!==void 0&&z.Bu(E,a))),b.Kc(E);return null},Vo.prototype.findLinkForKey=Vo.prototype.findLinkForKey,Vo.prototype.findPartForKey=Vo.prototype.findPartForKey,Vo.prototype.removeAllModeledParts=Vo.prototype.removeAllModeledParts,Vo.prototype.addModeledParts=Vo.prototype.addModeledParts,Vo.prototype.addAllModeledParts=Vo.prototype.addAllModeledParts,Vo.className="GraphLinksPartManager";function Ga(){Mr.apply(this,arguments),this.Sg=null}Vi(Ga,Mr);function sm(a,y,x){if(y!==null&&x!==null&&x.kh()===null){var E=a.diagram.toolManager.findTool("Linking"),b=y,z=x;if(a.diagram.isTreePathToChildren||(b=x,z=y),(E===null||!Ts(E,b,z,null,!0))&&(y=a.getLinkCategoryForData(x.data),E=a.findLinkTemplateForCategory(y),E!==null&&(rl(E),E=E.copy(),E!==null))){var tt=a.diagram.skipsModelSourceBindings;a.diagram.skipsModelSourceBindings=!0,E.Tf=y,E.ub=x.data,E.fromNode=b,E.toNode=z,a.diagram.add(E),E.ub=null,E.data=x.data,a.diagram.skipsModelSourceBindings=tt}}}Ga.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ss(a)},Ga.prototype.setLinkCategoryForData=function(a,y){this.diagram.model.Ms(a,y)},Ga.prototype.setFromNodeForLink=function(a,y,x){var E=this.diagram.model;if(x===void 0&&(x=null),y=y!==null?y.data:null,this.diagram.isTreePathToChildren)E.qe(a.data,E.wa(y));else{var b=this.Sg;this.Sg=a,x!==null&&E.qe(x.data,void 0),E.qe(y,E.wa(a.toNode!==null?a.toNode.data:null)),this.Sg=b}},Ga.prototype.setToNodeForLink=function(a,y,x){var E=this.diagram.model;if(x===void 0&&(x=null),y=y!==null?y.data:null,this.diagram.isTreePathToChildren){var b=this.Sg;this.Sg=a,x!==null&&E.qe(x.data,void 0),E.qe(y,E.wa(a.fromNode!==null?a.fromNode.data:null)),this.Sg=b}else E.qe(a.data,E.wa(y))},Ga.prototype.removeDataForLink=function(a){this.diagram.model.qe(a.data,void 0)},Ga.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.hc(a),a!==null?this.bf.I(a):null)},Ga.prototype.doModelChanged=function(a){if(Mr.prototype.doModelChanged.call(this,a),this.diagram){var y=this.diagram;if(a.model===y.model){var x=a.change;if(y.aa){y.aa=!1;try{var E=a.modelChange;if(E!==""){if(x===Yr){if(E==="nodeParentKey"){var b=a.object,z=this.Vb(a.newValue),tt=this.ii(b);if(this.Sg!==null)z!==null&&(this.Sg.data=b,this.Sg.category=this.getLinkCategoryForData(b));else if(tt!==null){var it=tt.kh();it!==null?z===null?y.remove(it):y.isTreePathToChildren?it.fromNode=z:it.toNode=z:sm(this,z,tt)}}else if(E==="parentLinkCategory"){var nt=this.ii(a.object),ot=a.newValue;if(nt!==null&&typeof ot=="string"){var st=nt.kh();st!==null&&(st.category=ot)}}y.isModified=!0}}else if(x===Yr){var ut=a.propertyName;a.object===y.model&&ut==="nodeParentKeyProperty"&&(y.undoManager.isUndoingRedoing||this.Wd()),y.isModified=!0}}finally{y.aa=!0}}}}},Ga.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var E=x.model;a instanceof Ci&&(y=E.mh(y),y=x.Vb(y),E=a.pg(),y!==E&&(E=a.kh(),y!==null?E!==null?x.isTreePathToChildren?E.fromNode=y:E.toNode=y:sm(this,y,a):E!==null&&Sp(x,E,!1)))}}},Ga.prototype.updateDataBindings=function(a,y){Mr.prototype.updateDataBindings.call(this,a,y),typeof y=="string"&&this.Lc(a)!==null&&(a=this.Kc(a),a!==null&&a.La(y))},Ga.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=lg(y,x),b=this.Lc(a);if(E!==null&&b!==null){for(E=E.iterator;E.next();){var z=E.value;y.lb(z)&&b instanceof Ci&&y.mh(z)===x&&sm(this,b,this.ii(z))}Fl(y,x)}a=y.mh(a),a!==void 0&&b instanceof Ci&&(a=this.Vb(a),sm(this,a,b))}},Ga.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof Ci){var x=y.wa(a.data),E=this.Kc(a.data);if(E!==null){E.isSelected=!1,E.isHighlighted=!1;var b=E.layer;if(b!==null){var z=b.pc(-1,E,!1);0<=z&&this.diagram.cb(Ao,"parts",b,E,null,z,null),z=E.layerChanged,z!==null&&z(E,b,null)}}for(E=this.diagram.isTreePathToChildren,a=a.linksConnected;a.next();)b=a.value,b=(E?b.toNode:b.fromNode).data,y.lb(b)&&Dl(y,x,b)}},Ga.prototype.insertLink=function(a,y,x){y=this.diagram.model;var E=a,b=x;return this.diagram.isTreePathToChildren||(E=x,b=a),E!==null&&b!==null?(y.qe(b.data,y.wa(E.data)),b.kh()):null},Ga.prototype.findLinkForKey=Ga.prototype.findLinkForKey,Ga.className="TreePartManager";function Ji(a,y){this.kl=new _e,this.il=new _e,this.Wv=`,
|
|
"insertedNodeKeys": `,this.jy=`,
|
|
"modifiedNodeData": `,this.Yv=`,
|
|
"removedNodeKeys": `,this.vh=null,bi(this),this.Sm=this.xa="",this.Gg=!1,this.j={},this.Tc=[],this.kb=new ji,this.Th="key",this.Bk=this.bl=null,this.Jm=this.Km=!1,this.Mm=!0,this.xm=null,this.lj="category",this.Vf=new ji,this.Lt=new Me,this.Wg=!1,this.o=null,this.undoManager=new qr,a!==void 0&&(Ti(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}Ji.prototype.cloneProtected=function(a){a.xa=this.xa,a.Sm=this.Sm,a.Gg=this.Gg,a.Th=this.Th,a.bl=this.bl,a.Bk=this.Bk,a.Km=this.Km,a.Jm=this.Jm,a.Mm=this.Mm,a.xm=this.xm,a.lj=this.lj},Ji.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},Ji.prototype.clear=function(){this.Tc=[],this.kb.clear(),this.Vf.clear(),this.undoManager.clear()},Ji.prototype.toString=function(a){if(a===void 0&&(a=0),1<a)return this.np();var y=(this.name!==""?this.name:"")+" Model";if(0<a){y+=`
|
|
node data:`,a=this.nodeDataArray;for(var x=a.length,E=0;E<x;E++){var b=a[E];y+=" "+this.wa(b)+":"+ki(b)}}return y},Ji.prototype.xA=function(a){a.change!==da&&It("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+a.toString());var y=a.object;return a.isTransactionFinished&&y instanceof Ko?(C1(this,y),a=this.Qv(y,a.propertyName==="FinishedUndo"),this.vh=null,a):null},Ji.prototype.Qv=function(a,y){var x=this,E=!1,b=new _e,z=new _e,tt=new _e,it=this.vh;a.changes.each(function(ut){ut.model===x&&(ut.modelChange==="nodeDataArray"?ut.change===xo?b.add(ut.newValue):ut.change===Ao&&tt.add(ut.oldValue):x.lb(ut.object)?z.add(ut.object):ut.change!==Yr||x.modelData!==ut.object&&ut.propertyName!=="modelData"?ut.object!==null&&(it&&it.contains(ut.object)?it.get(ut.object).each(function(ct){x.lb(ct)&&z.add(ct)}):ut.object instanceof Ji||x.ri()&&x.Jc(ut.object)||k1(x,ut.object).each(function(ct){z.add(ct)})):E=!0)});var nt=this.il;nt.clear(),b.each(function(ut){nt.add(x.wa(ut)),y||z.add(ut)});var ot=this.kl;ot.clear(),tt.each(function(ut){ot.add(x.wa(ut)),y&&z.add(ut)}),a=x.cloneDeep(z.Fa());var st=null;return E&&(st===null&&(st={}),st.modelData=this.cloneDeep(this.modelData)),0<nt.count&&(st===null&&(st={}),y?st.removedNodeKeys=nt.Fa():st.insertedNodeKeys=nt.Fa()),0<a.length&&(st===null&&(st={}),st.modifiedNodeData=a),0<ot.count&&(st===null&&(st={}),y?st.insertedNodeKeys=ot.Fa():st.removedNodeKeys=ot.Fa()),ot.clear(),nt.clear(),st},Ji.prototype.cloneDeep=function(a){return Fd(this,a,!0)};function Fd(a,y,x,E,b,z){function tt(ut,ct){it?(ut.__gohashid===void 0&&z.push(ut),E.set(ut,ct)):(ut=zn++,E.set(ut,ct),b.set(ut,y))}if(!Oe(y))return y;z||(z=[]);var it=Object.isExtensible(y);if(E||(E=new ji),it){var nt=E.get(y);if(nt)return nt}else for(b||(b=new ji),nt=b.iterator;nt.next();){var ot=nt.key;if(nt.value===y&&(ot=E.get(ot)))return ot}if(Array.isArray(y)){nt=[],tt(y,nt);for(var st=0;st<y.length;st++)nt.push(Fd(a,y[st],!1,E,b,z))}else if(y instanceof Pt||y instanceof li||y instanceof be||y instanceof jn||y instanceof nn)nt=y.copy(),tt(y,nt);else{if(y instanceof kr||y instanceof ci||y instanceof ze)return y;if(y instanceof Me)nt=new Me().addAll(Fd(a,y.Fa(),!1,E,b,z)),tt(y,nt);else if(y instanceof _e)nt=new _e().addAll(Fd(a,y.Fa(),!1,E,b,z)),tt(y,nt);else if(y instanceof ji)nt=new ji().addAll(Fd(a,y.Fa(),!1,E,b,z)),tt(y,nt);else if(y instanceof Date)nt=new Date(y.getTime()),tt(y,nt);else if(y instanceof RegExp)nt=new RegExp(y),tt(y,nt),nt.lastIndex=y.lastIndex;else if(typeof y.copy=="function")nt=y.copy(),tt(y,nt);else for(st in nt={},tt(y,nt),y)st!=="__gohashid"&&(nt[st]=Fd(a,y[st],!1,E,b,z))}return x&&z.forEach(function(ut){delete ut.__gohashid}),nt}yt=Ji.prototype,yt.quote=function(a){return JSON.stringify(a).replace(/[\u007F-\uFFFF]/g,function(y){return"\\u"+("0000"+y.charCodeAt(0).toString(16)).substr(-4)})},yt.rm=function(){var a="";return this.name!==""&&(a+=`,
|
|
"name": `+this.quote(this.name)),this.dataFormat!==""&&(a+=`,
|
|
"dataFormat": `+this.quote(this.dataFormat)),this.isReadOnly&&(a+=`,
|
|
"isReadOnly": `+this.isReadOnly),this.nodeKeyProperty!=="key"&&typeof this.nodeKeyProperty=="string"&&(a+=`,
|
|
"nodeKeyProperty": `+this.quote(this.nodeKeyProperty)),this.copiesArrays&&(a+=`,
|
|
"copiesArrays": true`),this.copiesArrayObjects&&(a+=`,
|
|
"copiesArrayObjects": true`),this.copiesKey||(a+=`,
|
|
"copiesKey": false`),this.nodeCategoryProperty!=="category"&&typeof this.nodeCategoryProperty=="string"&&(a+=`,
|
|
"nodeCategoryProperty": `+this.quote(this.nodeCategoryProperty)),a},yt.gp=function(a){a.name&&(this.name=a.name),a.dataFormat&&(this.dataFormat=a.dataFormat),a.isReadOnly&&(this.isReadOnly=!0),a.nodeKeyProperty&&(this.nodeKeyProperty=a.nodeKeyProperty),a.copiesArrays&&(this.copiesArrays=!0),a.copiesArrayObjects&&(this.copiesArrayObjects=!0),a.copiesKey===!1&&(this.copiesKey=!1),a.nodeCategoryProperty&&(this.nodeCategoryProperty=a.nodeCategoryProperty)};function S1(a,y){y=y.modelData,Oe(y)&&(a.dm(y),a.modelData=y)}yt.Rv=function(){var a=this.modelData,y=!1,x;for(x in a)if(!M1(x,a[x])){y=!0;break}return a="",y&&(a=`,
|
|
"modelData": `+hy(this,this.modelData)),a+`,
|
|
"nodeDataArray": `+Jh(this,this.nodeDataArray,!0)},yt.kv=function(a){S1(this,a),a=a.nodeDataArray,Ti(a)&&(this.dm(a),this.nodeDataArray=a)};function C1(a,y){function x(b,z){if((z=z.part)&&(z=z.data,b!==z)){var tt=E.get(b);tt===null?(tt=new _e,tt.add(z),E.add(b,tt)):tt.add(z)}}var E=a.vh;E===null&&(E=new ji,y.changes.each(function(b){if(b.diagram!==null){var z=b.change;z===Yr?(b=b.object.panel)&&(z=b.data)&&x(z,b):(z===xo||z===Ao)&&(b=b.object,(z=b.itemArray)&&x(z,b))}}),a.vh=E)}function k1(a,y){for(var x=new _e,E=0;E<a.nodeDataArray.length;E++){var b=a.nodeDataArray[E];am(a,y,b,b,x)}return x}function am(a,y,x,E,b){if(Array.isArray(x))for(var z=0;z<x.length;z++){var tt=x[z];if(tt===y)return b.add(E),!0;if(am(a,y,tt,E,b))return!0}else if(Oe(x)&&Object.getPrototypeOf(x)===Object.prototype)for(z in x){if(tt=x[z],tt===y)return b.add(E),!0;if(am(a,y,tt,E,b))return!0}return!1}yt.Pv=function(a,y){var x=this,E=!1,b=new _e,z=new _e,tt=new _e,it=this.vh;a.changes.each(function(st){st.model===x&&(st.modelChange==="nodeDataArray"?st.change===xo?b.add(st.newValue):st.change===Ao&&tt.add(st.oldValue):x.lb(st.object)?z.add(st.object):st.change!==Yr||x.modelData!==st.object&&st.propertyName!=="modelData"?st.object!==null&&(it&&it.contains(st.object)?it.get(st.object).each(function(ut){x.lb(ut)&&z.add(ut)}):st.object instanceof Ji||x.ri()&&x.Jc(st.object)||k1(x,st.object).each(function(ut){z.add(ut)})):E=!0)});var nt=this.il;nt.clear(),b.each(function(st){nt.add(x.wa(st)),y||z.add(st)});var ot=this.kl;return ot.clear(),tt.each(function(st){ot.add(x.wa(st)),y&&z.add(st)}),a="",E&&(a+=`,
|
|
"modelData": `+hy(this,this.modelData)),0<nt.count&&(a+=(y?this.Yv:this.Wv)+Jh(this,nt.Fa(),!0)),0<z.count&&(a+=this.jy+Jh(this,z.Fa(),!0)),0<ot.count&&(a+=(y?this.Wv:this.Yv)+Jh(this,ot.Fa(),!0)),ot.clear(),nt.clear(),a},yt.fp=function(a){(a.name!==void 0&&a.name!==this.name||a.dataFormat!==void 0&&a.dataFormat!==this.dataFormat||a.isReadOnly!==void 0&&a.isReadOnly!==this.isReadOnly||a.nodeKeyProperty!==void 0&&a.nodeKeyProperty!==this.nodeKeyProperty||a.copiesArrays!==void 0&&a.copiesArrays!==this.copiesArrays||a.copiesArrayObjects!==void 0&&a.copiesArrayObjects!==this.copiesArrayObjects||a.copiesKey!==void 0&&a.copiesKey!==this.copiesKey||a.nodeCategoryProperty!==void 0&&a.nodeCategoryProperty!==this.nodeCategoryProperty)&&It("applyIncrementalJson cannot change Model properties"),S1(this,a);var y=a.insertedNodeKeys,x=a.modifiedNodeData,E=new ji;if(Array.isArray(x))for(var b=0;b<x.length;b++){var z=x[b],tt=this.wa(z);tt!=null&&E.set(tt,z)}if(Array.isArray(y))for(b=y.length,z=0;z<b;z++){tt=y[z];var it=this.hc(tt);it===null&&(it=(it=E.get(tt))?it:this.copyNodeData({}),this.km(it,tt),this.xf(it))}if(Array.isArray(x)){for(y=x.length,E=0;E<y;E++)if(b=x[E],z=this.wa(b),z=this.hc(z),z!==null){for(var nt in b)nt==="__gohashid"||nt===this.nodeKeyProperty||this.Wj()&&nt===this.nodeIsGroupProperty||this.setDataProperty(z,nt,b[nt]);this.lm(b,z)}}if(a=a.removedNodeKeys,Array.isArray(a))for(x=a.length,nt=0;nt<x;nt++)y=this.hc(a[nt]),y!==null&&this.cm(y)},yt.$x=function(a,y){a.change!==da&&It("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var x=a.object;return a.isTransactionFinished&&x instanceof Ko?(y===void 0&&(y=ug(this,this)),C1(this,x),a=this.Pv(x,a.propertyName==="FinishedUndo"),this.vh=null,y==="2"?'{ "incremental": 2'+a+"}":'{ "class": '+this.quote(y)+', "incremental": 1'+this.rm()+a+"}"):'{ "incremental": 0 }'},yt.yA=function(a,y){return this.$x(a,y)},yt.np=function(a){return a===void 0&&(a=ug(this,this)),'{ "class": '+this.quote(a)+this.rm()+this.Rv()+"}"},yt.toJSON=function(a){return this.np(a)},yt.Zw=function(a){var y=null;if(typeof a=="string")try{y=Xe.JSON.parse(a)}catch(E){}else typeof a=="object"?y=a:It("Unable to modify a Model from: "+a);var x=y.incremental;typeof x!="number"&&It("Unable to apply non-incremental changes to Model: "+a),x!==0&&(this.Ea("applyIncrementalJson"),this.fp(y),this.eb("applyIncrementalJson"))},yt.Ky=function(a){return this.Zw(a)},Ji.constructGraphLinksModel=function(){return new Ji},yt=Ji.prototype,yt.dm=function(a){if(Ti(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];if(Oe(E)){var b=x;E=this.dm(E),Array.isArray(a)?a[b]=E:It("Cannot replace an object in an HTMLCollection or NodeList at "+b)}}else if(Oe(a)){for(y in a)if(x=a[y],Oe(x)&&(x=this.dm(x),a[y]=x,y==="points"&&Array.isArray(x))){for(b=x.length%2===0,E=0;E<x.length;E++)if(typeof x[E]!="number"){b=!1;break}if(b){for(b=new Me,E=0;E<x.length/2;E++)b.add(new Pt(x[2*E],x[2*E+1]));b.freeze(),a[y]=b}}return Rw(a)}return a},yt.sm=function(a){return a===void 0?"undefined":a===null?"null":a===!0?"true":a===!1?"false":typeof a=="string"?this.quote(a):typeof a=="number"?a===1/0?"9e9999":a===-1/0?"-9e9999":isNaN(a)?'{"class":"NaN"}':a.toString():a instanceof Date?'{"class":"Date", "value":"'+a.toJSON()+'"}':a instanceof Number?this.sm(a.valueOf()):Ti(a)?Jh(this,a):Oe(a)?hy(this,a):typeof a=="function"?"null":a.toString()};function Jh(a,y,x){x===void 0&&(x=!1);var E=y.length;if(0>=E)return"[]";var b=new nr;b.add("["),x&&1<E&&b.add(`
|
|
`);for(var z=0;z<E;z++){var tt=y[z];tt!==void 0&&(0<z&&(b.add(","),x&&b.add(`
|
|
`)),b.add(a.sm(tt)))}return x&&1<E&&b.add(`
|
|
`),b.add("]"),b.toString()}function M1(a,y){return y===void 0||a==="__gohashid"||a[0]==="_"||typeof y=="function"}function zs(a){return isNaN(a)?"NaN":a===1/0?"9e9999":a===-1/0?"-9e9999":a}function hy(a,y){var x=y;if(x instanceof Pt)y={class:"go.Point",x:zs(x.x),y:zs(x.y)};else if(x instanceof li)y={class:"go.Size",width:zs(x.width),height:zs(x.height)};else if(x instanceof be)y={class:"go.Rect",x:zs(x.x),y:zs(x.y),width:zs(x.width),height:zs(x.height)};else if(x instanceof jn)y={class:"go.Margin",top:zs(x.top),right:zs(x.right),bottom:zs(x.bottom),left:zs(x.left)};else if(x instanceof nn)x.sb()?y={class:"go.Spot",x:zs(x.x),y:zs(x.y),offsetX:zs(x.offsetX),offsetY:zs(x.offsetY)}:y={class:"go.Spot",enum:x.toString()};else if(x instanceof kr){if(y={class:"go.Brush",type:x.type.name},x.type===sh?y.color=x.color:(x.type===Au||x.type===Ka)&&(y.start=x.start,y.end=x.end,x.type===Ka&&(x.startRadius!==0&&(y.startRadius=zs(x.startRadius)),isNaN(x.endRadius)||(y.endRadius=zs(x.endRadius)))),x.colorStops!==null){var E={};for(x=x.colorStops.iterator;x.next();)E[x.key]=x.value;y.colorStops=E}}else x instanceof ci?(y={class:"go.Geometry",type:x.type.name},x.startX!==0&&(y.startX=zs(x.startX)),x.startY!==0&&(y.startY=zs(x.startY)),x.endX!==0&&(y.endX=zs(x.endX)),x.endY!==0&&(y.endY=zs(x.endY)),x.spot1.D(qn)||(y.spot1=x.spot1),x.spot2.D(vo)||(y.spot2=x.spot2),x.type===ci.o&&(y.path=ci.ia(x))):x instanceof ze&&(y={class:"go.EnumValue",classType:ug(a,x.classType),name:x.name});E="{",x=!0;for(var b in y){var z=mo(y,b);if(!M1(b,z))if(x?x=!1:E+=",",E+=a.quote(b)+":",b==="points"&&z instanceof Me){var tt="[";for(z=z.iterator;z.next();){var it=z.value;1<tt.length&&(tt+=","),tt+=a.sm(it.x),tt+=",",tt+=a.sm(it.y)}tt+="]",E+=tt}else E+=a.sm(z)}return E+"}"}function _s(a){return typeof a=="number"?a:a==="NaN"?NaN:a==="9e9999"?1/0:a==="-9e9999"?-1/0:parseFloat(a)}function Rw(a){if(typeof a!="object")return a;var y=a.class||"";if(y==="NaN")return NaN;if(y==="Date")return new Date(a.value);if(y.indexOf("go.")!==0)return a;y=y.substr(3);var x=a;if(y==="Point")x=new Pt(_s(a.x),_s(a.y));else if(y==="Size")x=new li(_s(a.width),_s(a.height));else if(y==="Rect")x=new be(_s(a.x),_s(a.y),_s(a.width),_s(a.height));else if(y==="Margin")x=new jn(_s(a.top),_s(a.right),_s(a.bottom),_s(a.left));else if(y==="Spot")typeof a.enum=="string"?x=$r(a.enum):x=new nn(_s(a.x),_s(a.y),_s(a.offsetX),_s(a.offsetY));else if(y==="Brush"){if(x=new kr,x.type=gn(kr,a.type),typeof a.color=="string"&&(x.color=a.color),a.start instanceof nn&&(x.start=a.start),a.end instanceof nn&&(x.end=a.end),typeof a.startRadius=="number"&&(x.startRadius=_s(a.startRadius)),typeof a.endRadius=="number"&&(x.endRadius=_s(a.endRadius)),a=a.colorStops,Oe(a))for(var E in a)x.addColorStop(parseFloat(E),a[E])}else y==="Geometry"?(x=null,typeof a.path=="string"?x=ci.parse(a.path):x=new ci,x.type=gn(ci,a.type),typeof a.startX=="number"&&(x.startX=_s(a.startX)),typeof a.startY=="number"&&(x.startY=_s(a.startY)),typeof a.endX=="number"&&(x.endX=_s(a.endX)),typeof a.endY=="number"&&(x.endY=_s(a.endY)),a.spot1 instanceof nn&&(x.spot1=a.spot1),a.spot2 instanceof nn&&(x.spot2=a.spot2)):y==="EnumValue"&&(E=a.classType,E.indexOf("go.")===0&&(E=E.substr(3)),E=fy(E),typeof E=="function"&&(x=gn(E,a.name)));return x}yt.Pe=function(a){return this.Lt.add(a),this},yt.ik=function(a){this.Lt.remove(a)},yt.ds=function(a){this.skipsUndoManager||this.undoManager.Tu(a);for(var y=this.Lt,x=y.length,E=0;E<x;E++)y.M(E)(a)},yt.cb=function(a,y,x,E,b,z,tt){Lo(this,"",a,y,x,E,b,z,tt)},yt.g=function(a,y,x,E,b){Lo(this,"",Yr,a,this,y,x,E,b)},yt.Fs=function(a,y,x,E,b,z){Lo(this,"",Yr,y,a,x,E,b,z)};function Lo(a,y,x,E,b,z,tt,it,nt){it===void 0&&(it=null),nt===void 0&&(nt=null);var ot=new Jr;ot.model=a,ot.change=x,ot.modelChange=y,ot.propertyName=E,ot.object=b,ot.oldValue=z,ot.oldParam=it,ot.newValue=tt,ot.newParam=nt,a.ds(ot)}Ji.prototype.changeState=function(a,y){if(a!==null&&a.model===this)if(a.change===Yr){var x=a.object,E=a.propertyName,b=a.I(y);E===this.nodeKeyProperty&&this.lb(x)&&(y=a.I(!y),y!==void 0&&this.kb.remove(y),b!==void 0&&this.kb.add(b,x)),Vr(x,E,b)}else a.change===xo?(x=a.newParam,a.modelChange==="nodeDataArray"?(a=a.newValue,Oe(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]===a&&yn(this.Tc,x),E!==void 0&&this.kb.remove(E)):(this.Tc[x]!==a&&ln(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)))):a.modelChange===""?((E=a.object)&&!Ti(E)&&a.propertyName&&(E=mo(a.object,a.propertyName)),Ti(E)&&typeof x=="number"&&(a=a.newValue,y?yn(E,x):ln(E,x,a))):It("unknown ChangedEvent.Insert modelChange: "+a.toString())):a.change===Ao?(x=a.oldParam,a.modelChange==="nodeDataArray"?(a=a.oldValue,Oe(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]!==a&&ln(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)):(this.Tc[x]===a&&yn(this.Tc,x),E!==void 0&&this.kb.remove(E)))):a.modelChange===""?((E=a.object)&&!Ti(E)&&a.propertyName&&(E=mo(a.object,a.propertyName)),Ti(E)&&typeof x=="number"&&(a=a.oldValue,y?ln(E,x,a):yn(E,x))):It("unknown ChangedEvent.Remove modelChange: "+a.toString())):a.change!==da&&It("unknown ChangedEvent: "+a.toString())},Ji.prototype.Ea=function(a){return this.undoManager.Ea(a)},Ji.prototype.eb=function(a){return this.undoManager.eb(a)},Ji.prototype.Kf=function(){return this.undoManager.Kf()},Ji.prototype.commit=function(a,y){y===void 0&&(y="");var x=this.skipsUndoManager;y===null&&(this.skipsUndoManager=!0,y=""),this.undoManager.Ea(y);var E=!1;try{a(this),E=!0}finally{E?this.undoManager.eb(y):this.undoManager.Kf(),this.skipsUndoManager=x}},yt=Ji.prototype,yt.La=function(a,y){y===void 0&&(y=""),Lo(this,"SourceChanged",da,y,a,null,null)},yt.wa=function(a){if(a!==null){var y=this.Th;if(y!==""&&(y=mo(a,y),y!==void 0)){if(Qh(y))return y;It("Key value for node data "+a+" is not a number or a string: "+y)}}},yt.km=function(a,y){if(a!==null){var x=this.Th;if(x!=="")if(this.lb(a)){var E=mo(a,x);E!==y&&this.hc(y)===null&&(Vr(a,x,y),E!==void 0&&this.kb.remove(E),this.kb.add(y,a),Lo(this,"nodeKey",Yr,x,a,E,y),typeof x=="string"&&this.La(a,x),this.jp(E,y))}else Vr(a,x,y)}};function Qh(a){return typeof a=="number"||typeof a=="string"}yt.lb=function(a){var y=this.wa(a);return y===void 0?!1:this.kb.I(y)===a},yt.hc=function(a){return a===null&&It("Model.findNodeDataForKey:key must not be null"),a!==void 0&&Qh(a)?this.kb.I(a):null},yt.$u=function(a){if(a!==null){var y=this.Th;if(y!==""){var x=this.wa(a);if(x===void 0||this.kb.contains(x)){var E=this.bl;if(E!==null&&(x=E(this,a),x!=null&&!this.kb.contains(x))){Vr(a,y,x);return}if(typeof x=="string"){for(E=2;this.kb.contains(x+E);)E++;Vr(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.kb.count-1;this.kb.contains(x);)x--;Vr(a,y,x)}}}}},yt.xf=function(a){a!==null&&(pn(a),this.lb(a)||E1(this,a,!0))};function E1(a,y,x){var E=a.wa(y);(E===void 0||a.kb.I(E)!==y)&&(a.$u(y),E=a.wa(y),E===void 0&&It("Model.makeNodeDataKeyUnique failed on "+y+". Data not added to Model."),a.kb.add(E,y),E=null,x&&(E=a.Tc.length,ln(a.Tc,E,y)),Lo(a,"nodeDataArray",xo,"nodeDataArray",a,null,y,null,E),a.fm(y),a.em(y))}yt.Fy=function(a){if(Ti(a))for(var y=a.length,x=0;x<y;x++)this.xf(a[x]);else for(a=a.iterator;a.next();)this.xf(a.value)},yt.cm=function(a){a!==null&&b1(this,a,!0)};function b1(a,y,x){var E=a.wa(y);if(E!==void 0&&a.kb.remove(E),E=null,x){t:if(x=a.Tc,Array.isArray(x))E=x.indexOf(y);else{E=x.length;for(var b=0;b<E;b++)if(x[b]===y){E=b;break t}E=-1}if(0>E)return;yn(a.Tc,E)}Lo(a,"nodeDataArray",Ao,"nodeDataArray",a,y,null,E,null),a.qp(y)}yt.nA=function(a){if(Ti(a))for(var y=a.length,x=0;x<y;x++)this.cm(a[x]);else for(a=a.iterator;a.next();)this.cm(a.value)},yt.$z=function(a){if(a!==this.nodeDataArray&&Ti(a)){var y=this.kl;y.clear(),y.addAll(this.kb.iteratorKeys);var x=this.il;x.clear();for(var E=a.length,b=0;b<E;b++){var z=a[b],tt=this.wa(z);if(tt!==void 0){x.add(tt);var it=this.hc(tt);it!==z&&(it!==null?(this.Do(it,z),this.lm(z,it)):(z=this.cloneDeep(z),this.km(z,tt),this.xf(z)))}else tt=this.cloneDeep(z),this.xf(tt),x.add(this.wa(tt))}for(a=y.iterator;a.next();)E=a.value,x.contains(E)||(E=this.hc(E))&&this.cm(E);y.clear(),x.clear()}},yt.jp=function(a,y){y!==void 0&&(a=lg(this,a),a instanceof _e&&this.Vf.add(y,a))},yt.Lv=function(){},yt.fm=function(){},yt.em=function(){},yt.qp=function(){};function Dl(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E===null&&(E=new _e,a.Vf.add(y,E)),E.add(x)}}function Fl(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E instanceof _e&&(x==null?a.Vf.remove(y):(E.remove(x),E.count===0&&a.Vf.remove(y)))}}function lg(a,y){return y===void 0?null:(a=a.Vf.I(y),a instanceof _e?a:null)}yt.Qy=function(a){a===void 0?this.Vf.clear():this.Vf.remove(a)},Ji.prototype.copyNodeData=function(a){if(a===null)return null;var y=this.Bk;return a=y!==null?y(a,this):lm(this,a,!0),Oe(a)&&bi(a),a};function lm(a,y,x){if(a.copiesArrays&&Array.isArray(y)){var E=[];for(x=0;x<y.length;x++){var b=lm(a,y[x],a.copiesArrayObjects);E.push(b)}return bi(E),E}if(x&&Oe(y)){x=(x=y.constructor)?new x:{},b=a.copiesKey||typeof a.nodeKeyProperty!="string"?null:a.nodeKeyProperty;for(E in y)if(E==="__gohashid")x.__gohashid=void 0;else if(E===b)x[b]=void 0;else{var z=mo(y,E),tt=ug(a,z);tt==="GraphObject"||tt==="Diagram"||tt==="Layer"||tt==="RowColumnDefinition"||tt==="AnimationManager"||tt==="Tool"||tt==="CommandHandler"||tt==="Layout"||tt==="InputEvent"||tt==="DiagramEvent"||z instanceof Ji||z instanceof qr||z instanceof Ko||z instanceof Jr||(z=lm(a,z,!1)),Vr(x,E,z)}return bi(x),x}return y instanceof Pt||y instanceof li||y instanceof be||y instanceof nn||y instanceof jn?y.copy():y}Ji.prototype.setDataProperty=function(a,y,x){if(this.lb(a)){if(y===this.nodeKeyProperty){this.km(a,x);return}if(y===this.nodeCategoryProperty){this.jm(a,x);return}}else!P1&&a instanceof Kt&&(P1=!0,Di('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),Di(" Is that really your intent?"));var E=mo(a,y);E!==x&&(Vr(a,y,x),this.Fs(a,y,E,x))},yt=Ji.prototype,yt.set=function(a,y,x){this.setDataProperty(a,y,x)},yt.Do=function(a,y){if(y){var x=this.lb(a),E;for(E in y)E==="__gohashid"||x&&E===this.nodeKeyProperty||this.setDataProperty(a,E,y[E])}},yt.Ay=function(a,y){this.ts(a,-1,y)},yt.ts=function(a,y,x){0>y&&(y=a.length),ln(a,y,x),Lo(this,"",xo,"",a,null,x,null,y)},yt.ov=function(a,y){y===void 0&&(y=-1),a===this.Tc&&It("Model.removeArrayItem should not be called on the Model.nodeDataArray"),y===-1&&(y=a.length-1);var x=a[y];yn(a,y),Lo(this,"",Ao,"",a,x,null,y,null)},yt.Ro=function(a){if(a===null)return"";var y=this.lj;if(y===""||(y=mo(a,y),y===void 0))return"";if(typeof y=="string")return y;It("getCategoryForNodeData found a non-string category for "+a+": "+y)},yt.jm=function(a,y){if(a!==null){var x=this.lj;if(x!=="")if(this.lb(a)){var E=mo(a,x);E===void 0&&(E=""),E!==y&&(Vr(a,x,y),Lo(this,"nodeCategory",Yr,x,a,E,y))}else Vr(a,x,y)}},yt.lm=function(a,y){this.jm(y,this.Ro(a))},yt.Tl=function(){return!1},yt.Wj=function(){return!1},yt.ri=function(){return!1},yt.xs=function(){return!1},yt.Xj=function(){return!1};function cy(){return new Ji}function ug(a,y){if(typeof y=="function"){if(y.className)return y.className;if(y.name)return y.name}else if(typeof y=="object"&&y!==null&&y.constructor)return ug(a,y.constructor);return typeof y}function fy(a){return Sl[a]?Sl[a]:Xe.go!==void 0&&Xe.go[a]?Xe.go[a]:null}function mo(a,y){if(!a||!y)return null;try{if(typeof y=="function")var x=y(a);else typeof a.getAttribute=="function"?(x=a.getAttribute(y),x===null&&(x=void 0)):x=a[y]}catch(E){}return x}function Vr(a,y,x){if(a&&y)try{typeof y=="function"?y(a,x):typeof a.setAttribute=="function"?a.setAttribute(y,x):a[y]=x}catch(E){}}zi.Object.defineProperties(Ji.prototype,{name:{get:function(){return this.xa},set:function(a){var y=this.xa;y!==a&&(this.xa=a,this.g("name",y,a))}},dataFormat:{get:function(){return this.Sm},set:function(a){var y=this.Sm;y!==a&&(this.Sm=a,this.g("dataFormat",y,a))}},isReadOnly:{get:function(){return this.Gg},set:function(a){var y=this.Gg;y!==a&&(this.Gg=a,this.g("isReadOnly",y,a))}},modelData:{get:function(){return this.j},set:function(a){var y=this.j;y!==a&&(this.j=a,this.g("modelData",y,a),this.La(a))}},undoManager:{get:function(){return this.o},set:function(a){var y=this.o;y!==a&&(y!==null&&y.Rx(this),this.o=a,a!==null&&a.Xw(this))}},skipsUndoManager:{get:function(){return this.Wg},set:function(a){this.Wg=a}},nodeKeyProperty:{get:function(){return this.Th},set:function(a){var y=this.Th;y!==a&&(a===""&&It("Model.nodeKeyProperty may not be the empty string"),0<this.kb.count&&It("Cannot set Model.nodeKeyProperty when there is existing node data"),this.Th=a,this.g("nodeKeyProperty",y,a))}},makeUniqueKeyFunction:{get:function(){return this.bl},set:function(a){var y=this.bl;y!==a&&(this.bl=a,this.g("makeUniqueKeyFunction",y,a))}},nodeDataArray:{get:function(){return this.Tc},set:function(a){var y=this.Tc;if(y!==a){this.kb.clear(),this.Lv();for(var x=a.length,E=0;E<x;E++){var b=a[E];Oe(b)||It("Model.nodeDataArray must only contain Objects, not: "+b),pn(b)}for(this.Tc=a,E=new Me,b=0;b<x;b++){var z=a[b],tt=this.wa(z);tt===void 0||this.kb.I(tt)!==null?E.add(z):this.kb.add(tt,z)}for(E=E.iterator;E.next();)b=E.value,this.$u(b),z=this.wa(b),z!==void 0&&this.kb.add(z,b);for(Lo(this,"nodeDataArray",Yr,"nodeDataArray",this,y,a),y=0;y<x;y++)E=a[y],this.fm(E),this.em(E);Array.isArray(a)||(this.isReadOnly=!0)}}},copyNodeDataFunction:{get:function(){return this.Bk},set:function(a){var y=this.Bk;y!==a&&(this.Bk=a,this.g("copyNodeDataFunction",y,a))}},copiesArrays:{get:function(){return this.Km},set:function(a){var y=this.Km;y!==a&&(this.Km=a,this.g("copiesArrays",y,a))}},copiesArrayObjects:{get:function(){return this.Jm},set:function(a){var y=this.Jm;y!==a&&(this.Jm=a,this.g("copiesArrayObjects",y,a))}},copiesKey:{get:function(){return this.Mm},set:function(a){var y=this.Mm;y!==a&&(this.Mm=a,this.g("copiesKey",y,a))}},afterCopyFunction:{get:function(){return this.xm},set:function(a){var y=this.xm;y!==a&&(this.xm=a,this.g("afterCopyFunction",y,a))}},nodeCategoryProperty:{get:function(){return this.lj},set:function(a){var y=this.lj;y!==a&&(this.lj=a,this.g("nodeCategoryProperty",y,a))}},type:{get:function(){return"Model"}}}),Ji.prototype.setCategoryForNodeData=Ji.prototype.jm,Ji.prototype.getCategoryForNodeData=Ji.prototype.Ro,Ji.prototype.removeArrayItem=Ji.prototype.ov,Ji.prototype.insertArrayItem=Ji.prototype.ts,Ji.prototype.addArrayItem=Ji.prototype.Ay,Ji.prototype.assignAllDataProperties=Ji.prototype.Do,Ji.prototype.set=Ji.prototype.set,Ji.prototype.clearUnresolvedReferences=Ji.prototype.Qy,Ji.prototype.mergeNodeDataArray=Ji.prototype.$z,Ji.prototype.removeNodeDataCollection=Ji.prototype.nA,Ji.prototype.removeNodeData=Ji.prototype.cm,Ji.prototype.addNodeDataCollection=Ji.prototype.Fy,Ji.prototype.addNodeData=Ji.prototype.xf,Ji.prototype.makeNodeDataKeyUnique=Ji.prototype.$u,Ji.prototype.findNodeDataForKey=Ji.prototype.hc,Ji.prototype.containsNodeData=Ji.prototype.lb,Ji.prototype.setKeyForNodeData=Ji.prototype.km,Ji.prototype.getKeyForNodeData=Ji.prototype.wa,Ji.prototype.updateTargetBindings=Ji.prototype.La,Ji.prototype.commit=Ji.prototype.commit,Ji.prototype.rollbackTransaction=Ji.prototype.Kf,Ji.prototype.commitTransaction=Ji.prototype.eb,Ji.prototype.startTransaction=Ji.prototype.Ea,Ji.prototype.raiseDataChanged=Ji.prototype.Fs,Ji.prototype.raiseChanged=Ji.prototype.g,Ji.prototype.raiseChangedEvent=Ji.prototype.cb,Ji.prototype.removeChangedListener=Ji.prototype.ik,Ji.prototype.addChangedListener=Ji.prototype.Pe,Ji.prototype.writeJsonValue=Ji.prototype.sm,Ji.prototype.replaceJsonObjects=Ji.prototype.dm,Ji.prototype.applyIncrementalJSON=Ji.prototype.Ky,Ji.prototype.applyIncrementalJson=Ji.prototype.Zw,Ji.prototype.toJSON=Ji.prototype.toJSON,Ji.prototype.toJson=Ji.prototype.np,Ji.prototype.toIncrementalJSON=Ji.prototype.yA,Ji.prototype.toIncrementalJson=Ji.prototype.$x,Ji.prototype.toIncrementalData=Ji.prototype.xA,Ji.prototype.clear=Ji.prototype.clear;var P1=!1,Sl={};Ji.className="Model",Ji.fromJSON=Ji.fromJson=function(a,y){y===void 0&&(y=null);var x=null;if(typeof a=="string")try{x=Xe.JSON.parse(a)}catch(z){}else typeof a=="object"?x=a:It("Unable to construct a Model from: "+a);if(y===null){a=null;var E=x.class;if(typeof E=="string")try{var b=null;E.indexOf("go.")===0?(E=E.substr(3),b=fy(E)):(b=fy(E),b===null&&(b=Xe[E])),typeof b=="function"&&(a=new b)}catch(z){}a===null||a instanceof Ji?y=a:It("Unable to construct a Model of declared class: "+x.class)}return y===null&&(y=Ji.constructGraphLinksModel()),y.gp(x),y.kv(x),y},Ji.safePropertyValue=mo,Ji.safePropertySet=Vr,Sl.Brush=kr,Sl.ChangedEvent=Jr,Sl.Geometry=ci,Sl.Margin=jn,Sl.Panel=si,Sl.Point=Pt,Sl.Rect=be,Sl.Size=li,Sl.Spot=nn,Sl.Transaction=Ko,Sl.UndoManager=qr;function Co(a,y,x,E){bi(this),this._isFrozen=!1,a===void 0&&(a=""),y===void 0&&(y=a),x===void 0&&(x=null),this.j=-1,this.xd=null,this.xl=a,this.wl=this.to=0,this.Cr=null,this.wn=!1,this.sl=y,this.Im=x,E===void 0?(this.el=T1,this.wk=null):(this.el=hg,this.wk=E),this.st=new _e}Co.prototype.copy=function(){var a=new Co;return a.xl=this.xl,a.to=this.to,a.wl=this.wl,a.Cr=this.Cr,a.wn=this.wn,a.sl=this.sl,a.Im=this.Im,a.el=this.el,a.wk=this.wk,a},yt=Co.prototype,yt.qb=function(a){a.classType===Co&&(this.mode=a)},yt.toString=function(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(this.Ai!==-1?" "+this.Ai:"")+" "+this.mode.name+")"},yt.freeze=function(){return this._isFrozen=!0,this},yt.ka=function(){return this._isFrozen=!1,this},yt.Kx=function(a){return a===void 0&&(a=null),this.mode=hg,this.backConverter=a,this},yt.cp=function(a){return a===void 0&&(a=""),this.sourceName=a,this.isToModel=!1,this},yt.dA=function(){return this.sourceName=null,this.isToModel=!0,this};function N1(a,y,x){return a=a.sourceName,a===null||a===""?y:a==="/"?x.part:a==="."?x:a===".."?x.panel:y.fb(a)}yt.Mv=function(a,y,x){var E=this.sl;if(x===void 0||E===""||E===x){x=this.xl;var b=this.Im;if(b===null&&x==="")Di("Binding error: target property is the empty string: "+this.toString());else{var z=y;if(E!==""&&(z=mo(y,E)),z!==void 0)if(b===null)x!==""&&Vr(a,x,z);else try{if(x!==""){var tt=b(z,a);Vr(a,x,tt)}else b(z,a)}catch(it){}}}},yt.sp=function(a,y,x,E){if(this.el===hg){var b=this.xl;if(x===void 0||b===x){x=this.sl;var z=this.wk,tt=a;if(b!==""&&(tt=mo(a,b)),tt!==void 0&&!this.st.contains(a))try{this.st.add(a);var it=E!==null?E.diagram:null,nt=it!==null?it.model:null;if(z===null){if(x!=="")nt!==null?nt.setDataProperty(y,x,tt):Vr(y,x,tt);else if(nt!==null&&E!==null&&0<=E.itemIndex&&E.panel!==null&&Array.isArray(E.panel.itemArray)){var ot=E.itemIndex,st=E.panel.itemArray;nt.ov(st,ot),nt.ts(st,ot,tt)}}else try{if(x!==""){var ut=z(tt,y,nt);nt!==null?nt.setDataProperty(y,x,ut):Vr(y,x,ut)}else{var ct=z(tt,y,nt);if(ct!==void 0&&nt!==null&&E!==null&&0<=E.itemIndex&&E.panel!==null&&Array.isArray(E.panel.itemArray)){var dt=E.itemIndex,vt=E.panel.itemArray;nt.ov(vt,dt),nt.ts(vt,dt,ct)}}}catch(xt){}}finally{this.st.remove(a)}}}},zi.Object.defineProperties(Co.prototype,{Ai:{get:function(){return this.j},set:function(a){this._isFrozen&&se(this),this.j=a}},targetProperty:{get:function(){return this.xl},set:function(a){this._isFrozen&&se(this),this.xl=a}},sourceName:{get:function(){return this.Cr},set:function(a){this._isFrozen&&se(this),this.Cr=a,a!==null&&(this.wn=!1)}},isToModel:{get:function(){return this.wn},set:function(a){this._isFrozen&&se(this),this.wn=a}},sourceProperty:{get:function(){return this.sl},set:function(a){this._isFrozen&&se(this),this.sl=a}},converter:{get:function(){return this.Im},set:function(a){this._isFrozen&&se(this),this.Im=a}},backConverter:{get:function(){return this.wk},set:function(a){this._isFrozen&&se(this),this.wk=a}},mode:{get:function(){return this.el},set:function(a){this._isFrozen&&se(this),this.el=a}}}),Co.prototype.updateSource=Co.prototype.sp,Co.prototype.updateTarget=Co.prototype.Mv,Co.prototype.ofModel=Co.prototype.dA,Co.prototype.ofObject=Co.prototype.cp,Co.prototype.makeTwoWay=Co.prototype.Kx;var jw="Binding",T1=new ze(Co,"OneWay",1),hg=new ze(Co,"TwoWay",2);Co.className="Binding",Co.parseEnum=function(a,y){return function(x){return x=gn(a,x),x===null?y:x}},Co.toString=ki,Co.OneWay=T1,Co.TwoWay=hg;function sr(a,y,x){Ji.call(this),this.Vv=`,
|
|
"insertedLinkKeys": `,this.iy=`,
|
|
"modifiedLinkData": `,this.Xv=`,
|
|
"removedLinkKeys": `,this.md=[],this.$f=new _e,this.wb=new ji,this.Jh="",this.Ri=this.Ak=this.cl=null,this.lf="from",this.mf="to",this.fj=this.ej="",this.dj="category",this.je="",this.jl="isGroup",this.Je="group",this.Lm=!1,y!==void 0&&(this.linkDataArray=y),a!==void 0&&(Ti(a)?this.nodeDataArray=a:x=a),x&&(Object.assign(this,x),a=x.Changed)&&(delete this.Changed,this.Pe(a))}Vi(sr,Ji),sr.constructGraphLinksModel=Ji.constructGraphLinksModel,sr.prototype.cloneProtected=function(a){Ji.prototype.cloneProtected.call(this,a),a.Jh=this.Jh,a.cl=this.cl,a.Ak=this.Ak,a.lf=this.lf,a.mf=this.mf,a.ej=this.ej,a.fj=this.fj,a.dj=this.dj,a.je=this.je,a.jl=this.jl,a.Je=this.Je,a.Lm=this.Lm},yt=sr.prototype,yt.clear=function(){Ji.prototype.clear.call(this),this.md=[],this.wb.clear(),this.$f.clear()},yt.toString=function(a){if(a===void 0&&(a=0),2<=a)return this.np();var y=(this.name!==""?this.name:"")+" GraphLinksModel";if(0<a){y+=`
|
|
node data:`,a=this.nodeDataArray;var x=a.length,E;for(E=0;E<x;E++){var b=a[E];y+=" "+this.wa(b)+":"+ki(b)}for(y+=`
|
|
link data:`,a=this.linkDataArray,x=a.length,E=0;E<x;E++)b=a[E],y+=" "+Da(this,b,!0)+"-->"+Da(this,b,!1)}return y},yt.Qv=function(a,y){this.linkKeyProperty===""&&It("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalData() to succeed.");var x=Ji.prototype.Qv.call(this,a,y),E=this,b=new _e,z=new _e,tt=new _e,it=this.vh;a.changes.each(function(st){st.model===E&&(st.modelChange==="linkDataArray"?st.change===xo?b.add(st.newValue):st.change===Ao&&tt.add(st.oldValue):E.Jc(st.object)?z.add(st.object):st.object!==null&&(st.object!==null&&it&&it.contains(st.object)?it.get(st.object).each(function(ut){E.Jc(ut)&&z.add(ut)}):st.object instanceof Ji||E.lb(st.object)||L1(E,st.object).each(function(ut){z.add(ut)})))});var nt=this.il;nt.clear(),b.each(function(st){nt.add(E.Ac(st)),y||z.add(st)});var ot=this.kl;return ot.clear(),tt.each(function(st){ot.add(E.Ac(st)),y&&z.add(st)}),a=E.cloneDeep(z.Fa()),0<nt.count&&(x===null&&(x={}),y?x.removedLinkKeys=nt.Fa():x.insertedLinkKeys=nt.Fa()),0<a.length&&(x===null&&(x={}),x.modifiedLinkData=a),0<ot.count&&(x===null&&(x={}),y?x.insertedLinkKeys=ot.Fa():x.removedLinkKeys=ot.Fa()),ot.clear(),nt.clear(),x},yt.rm=function(){var a=Ji.prototype.rm.call(this),y="";return this.linkCategoryProperty!=="category"&&typeof this.linkCategoryProperty=="string"&&(y+=`,
|
|
"linkCategoryProperty": `+this.quote(this.linkCategoryProperty)),this.linkKeyProperty!==""&&typeof this.linkKeyProperty=="string"&&(y+=`,
|
|
"linkKeyProperty": `+this.quote(this.linkKeyProperty)),this.linkFromKeyProperty!=="from"&&typeof this.linkFromKeyProperty=="string"&&(y+=`,
|
|
"linkFromKeyProperty": `+this.quote(this.linkFromKeyProperty)),this.linkToKeyProperty!=="to"&&typeof this.linkToKeyProperty=="string"&&(y+=`,
|
|
"linkToKeyProperty": `+this.quote(this.linkToKeyProperty)),this.linkFromPortIdProperty!==""&&typeof this.linkFromPortIdProperty=="string"&&(y+=`,
|
|
"linkFromPortIdProperty": `+this.quote(this.linkFromPortIdProperty)),this.linkToPortIdProperty!==""&&typeof this.linkToPortIdProperty=="string"&&(y+=`,
|
|
"linkToPortIdProperty": `+this.quote(this.linkToPortIdProperty)),this.linkLabelKeysProperty!==""&&typeof this.linkLabelKeysProperty=="string"&&(y+=`,
|
|
"linkLabelKeysProperty": `+this.quote(this.linkLabelKeysProperty)),this.nodeIsGroupProperty!=="isGroup"&&typeof this.nodeIsGroupProperty=="string"&&(y+=`,
|
|
"nodeIsGroupProperty": `+this.quote(this.nodeIsGroupProperty)),this.nodeGroupKeyProperty!=="group"&&typeof this.nodeGroupKeyProperty=="string"&&(y+=`,
|
|
"nodeGroupKeyProperty": `+this.quote(this.nodeGroupKeyProperty)),a+y},yt.gp=function(a){Ji.prototype.gp.call(this,a),a.linkKeyProperty&&(this.linkKeyProperty=a.linkKeyProperty),a.linkFromKeyProperty&&(this.linkFromKeyProperty=a.linkFromKeyProperty),a.linkToKeyProperty&&(this.linkToKeyProperty=a.linkToKeyProperty),a.linkFromPortIdProperty&&(this.linkFromPortIdProperty=a.linkFromPortIdProperty),a.linkToPortIdProperty&&(this.linkToPortIdProperty=a.linkToPortIdProperty),a.linkCategoryProperty&&(this.linkCategoryProperty=a.linkCategoryProperty),a.linkLabelKeysProperty&&(this.linkLabelKeysProperty=a.linkLabelKeysProperty),a.nodeIsGroupProperty&&(this.nodeIsGroupProperty=a.nodeIsGroupProperty),a.nodeGroupKeyProperty&&(this.nodeGroupKeyProperty=a.nodeGroupKeyProperty)},yt.Rv=function(){var a=Ji.prototype.Rv.call(this),y=`,
|
|
"linkDataArray": `+Jh(this,this.linkDataArray,!0);return a+y},yt.kv=function(a){Ji.prototype.kv.call(this,a),a=a.linkDataArray,Array.isArray(a)&&(this.dm(a),this.linkDataArray=a)};function L1(a,y){for(var x=new _e,E=0;E<a.linkDataArray.length;E++){var b=a.linkDataArray[E];am(a,y,b,b,x)}return x}yt.Pv=function(a,y){this.linkKeyProperty===""&&It("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var x=Ji.prototype.Pv.call(this,a,y),E=this,b=new _e,z=new _e,tt=new _e,it=this.vh;a.changes.each(function(st){st.model===E&&(st.modelChange==="linkDataArray"?st.change===xo?b.add(st.newValue):st.change===Ao&&tt.add(st.oldValue):E.Jc(st.object)?z.add(st.object):st.object!==null&&(st.object!==null&&it&&it.contains(st.object)?it.get(st.object).each(function(ut){E.Jc(ut)&&z.add(ut)}):st.object instanceof Ji||E.lb(st.object)||L1(E,st.object).each(function(ut){z.add(ut)})))});var nt=this.il;nt.clear(),b.each(function(st){nt.add(E.Ac(st)),y||z.add(st)});var ot=this.kl;return ot.clear(),tt.each(function(st){ot.add(E.Ac(st)),y&&z.add(st)}),a=x,0<nt.count&&(a+=(y?this.Xv:this.Vv)+Jh(this,nt.Fa(),!0)),0<z.count&&(a+=this.iy+Jh(this,z.Fa(),!0)),0<ot.count&&(a+=(y?this.Vv:this.Xv)+Jh(this,ot.Fa(),!0)),ot.clear(),nt.clear(),a},yt.fp=function(a){(a.linkCategoryProperty!==void 0&&a.linkCategoryProperty!==this.linkCategoryProperty||a.linkKeyProperty!==void 0&&a.linkKeyProperty!==this.linkKeyProperty||a.linkFromKeyProperty!==void 0&&a.linkFromKeyProperty!==this.linkFromKeyProperty||a.linkToKeyProperty!==void 0&&a.linkToKeyProperty!==this.linkToKeyProperty||a.linkFromPortIdProperty!==void 0&&a.linkFromPortIdProperty!==this.linkFromPortIdProperty||a.linkToPortIdProperty!==void 0&&a.linkToPortIdProperty!==this.linkToPortIdProperty||a.linkLabelKeysProperty!==void 0&&a.linkLabelKeysProperty!==this.linkLabelKeysProperty||a.nodeIsGroupProperty!==void 0&&a.nodeIsGroupProperty!==this.nodeIsGroupProperty||a.nodeGroupKeyProperty!==void 0&&a.nodeGroupKeyProperty!==this.nodeGroupKeyProperty)&&It("applyIncrementalJson cannot change Model properties"),Ji.prototype.fp.call(this,a);var y=a.insertedLinkKeys;if(Array.isArray(y))for(var x=y.length,E=0;E<x;E++){var b=y[E],z=this.jh(b);z===null&&(z=this.Jo({}),this.Ks(z,b),this.fi(z))}if(y=a.modifiedLinkData,Array.isArray(y)){for(x=y.length,E=0;E<x;E++)if(b=y[E],z=this.Ac(b),z=this.jh(z),z!==null){for(var tt in b)tt!=="__gohashid"&&tt!==this.linkKeyProperty&&this.setDataProperty(z,tt,b[tt]);F1(this,b,z)}}if(a=a.removedLinkKeys,Array.isArray(a))for(tt=a.length,y=0;y<tt;y++)x=this.jh(a[y]),x!==null&&this.bm(x)},sr.prototype.changeState=function(a,y){if(a!==null&&a.model===this){if(a.change===Yr){var x=a.object,E=a.propertyName;if(E===this.linkKeyProperty&&this.Jc(x)){var b=a.I(y);y=a.I(!y),y!==void 0&&this.wb.remove(y),b!==void 0&&this.wb.add(b,x),Vr(x,E,b);return}}else if(a.change===xo){if(x=a.newParam,a.modelChange==="linkDataArray"){a=a.newValue,Oe(a)&&typeof x=="number"&&(E=this.Ac(a),y?(this.$f.remove(a),this.md[x]===a&&this.md.splice(x,1),E!==void 0&&this.wb.remove(E)):(this.$f.add(a),this.md[x]!==a&&this.md.splice(x,0,a),E!==void 0&&this.wb.add(E,a)));return}if(a.modelChange==="linkLabelKeys"){E=this.Ef(a.object),Array.isArray(E)&&typeof x=="number"&&(y?(x=E.indexOf(a.newValue),0<=x&&E.splice(x,1)):0>E.indexOf(a.newValue)&&E.splice(x,0,a.newValue));return}}else if(a.change===Ao){if(x=a.oldParam,a.modelChange==="linkDataArray"){a=a.oldValue,Oe(a)&&typeof x=="number"&&(E=this.Ac(a),y?(this.$f.add(a),this.md[x]!==a&&this.md.splice(x,0,a),E!==void 0&&this.wb.add(E,a)):(this.$f.remove(a),this.md[x]===a&&this.md.splice(x,1),E!==void 0&&this.wb.remove(E)));return}if(a.modelChange==="linkLabelKeys"){E=this.Ef(a.object),Array.isArray(E)&&typeof x=="number"&&(y?0>E.indexOf(a.newValue)&&E.splice(x,0,a.newValue):(x=E.indexOf(a.newValue),0<=x&&E.splice(x,1)));return}}Ji.prototype.changeState.call(this,a,y)}},yt=sr.prototype,yt.Vl=function(a){if(a!==void 0){var y=this.Ri;if(y!==null){var x=this.hc(a);x===null&&(x=this.copyNodeData(y),Vr(x,this.nodeKeyProperty,a),this.xf(x))}return a}},yt.yx=function(a){return Da(this,a,!0)},yt.wv=function(a,y){Bd(this,a,y,!0)},yt.Bx=function(a){return Da(this,a,!1)},yt.Bv=function(a,y){Bd(this,a,y,!1)};function Da(a,y,x){if(y!==null&&(a=x?a.lf:a.mf,a!==""&&(a=mo(y,a),a!==void 0))){if(Qh(a))return a;It((x?"FromKey":"ToKey")+" value for link data "+y+" is not a number or a string: "+a)}}function Bd(a,y,x,E){if(x===null&&(x=void 0),y!==null){var b=E?a.lf:a.mf;if(b!=="")if(x=a.Vl(x),a.Jc(y)){var z=mo(y,b);z!==x&&(Fl(a,z,y),Vr(y,b,x),a.hc(x)===null&&Dl(a,x,y),Lo(a,E?"linkFromKey":"linkToKey",Yr,b,y,z,x),typeof b=="string"&&a.La(y,b))}else Vr(y,b,x)}}yt.zx=function(a){return um(this,a,!0)},yt.xv=function(a,y){Od(this,a,y,!0)},yt.Cx=function(a){return um(this,a,!1)},yt.Cv=function(a,y){Od(this,a,y,!1)};function um(a,y,x){return y===null||(a=x?a.ej:a.fj,a==="")?"":(y=mo(y,a),y===void 0?"":y)}function Od(a,y,x,E){if(y!==null){var b=E?a.ej:a.fj;if(b!=="")if(a.Jc(y)){var z=mo(y,b);z===void 0&&(z=""),z!==x&&(Vr(y,b,x),Lo(a,E?"linkFromPortId":"linkToPortId",Yr,b,y,z,x),typeof b=="string"&&a.La(y,b))}else Vr(y,b,x)}}yt.Ef=function(a){if(a===null)return hm;var y=this.je;return y===""?hm:(a=mo(a,y),a===void 0?hm:a)},yt.Ls=function(a,y){if(a!==null){var x=this.je;if(x!=="")if(this.Jc(a)){var E=mo(a,x);if(E===void 0&&(E=hm),E!==y){if(Array.isArray(E))for(var b=E.length,z=0;z<b;z++)Fl(this,E[z],a);for(Vr(a,x,y),b=y.length,z=0;z<b;z++){var tt=y[z];this.hc(tt)===null&&Dl(this,tt,a)}Lo(this,"linkLabelKeys",Yr,x,a,E,y),typeof x=="string"&&this.La(a,x)}}else Vr(a,x,y)}},yt.Bu=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=mo(a,x);if(E===void 0)x=[],x.push(y),this.Ls(a,x);else if(Array.isArray(E)){var b=E.indexOf(y);0<=b||(b=E.length,E.push(y),this.Jc(a)&&(this.hc(y)===null&&Dl(this,y,a),Lo(this,"linkLabelKeys",xo,x,a,null,y,null,b)))}else It(x+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}},yt.Qx=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=mo(a,x);if(Array.isArray(E)){var b=E.indexOf(y);0>b||(E.splice(b,1),this.Jc(a)&&(Fl(this,y,a),Lo(this,"linkLabelKeys",Ao,x,a,y,null,b,null)))}else E!==void 0&&It(x+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}},yt.Ac=function(a){if(a!==null){var y=this.Jh;if(y!==""&&(y=mo(a,y),y!==void 0)){if(Qh(y))return y;It("Key value for link data "+a+" is not a number or a string: "+y)}}},yt.Ks=function(a,y){if(a!==null){var x=this.Jh;if(x!=="")if(this.Jc(a)){var E=mo(a,x);E!==y&&this.jh(y)===null&&(Vr(a,x,y),E!==void 0&&this.wb.remove(E),this.wb.add(y,a),Lo(this,"linkKey",Yr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vr(a,x,y)}},yt.jh=function(a){return a===null&&It("GraphLinksModel.findLinkDataForKey:key must not be null"),a!==void 0&&Qh(a)?this.wb.I(a):null},yt.Bs=function(a){if(a!==null){var y=this.Jh;if(y!==""){var x=this.Ac(a);if(x===void 0||this.wb.contains(x)){var E=this.cl;if(E!==null&&(x=E(this,a),x!=null&&!this.wb.contains(x))){Vr(a,y,x);return}if(typeof x=="string"){for(E=2;this.wb.contains(x+E);)E++;Vr(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.wb.count-1;this.wb.contains(x);)x--;Vr(a,y,x)}}}}},yt.Jc=function(a){return a===null?!1:this.$f.contains(a)},yt.fi=function(a){a!==null&&(pn(a),this.Jc(a)||A1(this,a,!0))};function A1(a,y,x){if(a.linkKeyProperty!==""){var E=a.Ac(y);if(E!==void 0&&a.wb.I(E)===y)return;a.Bs(y),E=a.Ac(y),E===void 0&&It("GraphLinksModel.makeLinkDataKeyUnique failed on "+y+". Data not added to model."),a.wb.add(E,y)}a.$f.add(y),E=null,x&&(E=a.md.length,a.md.splice(E,0,y)),Lo(a,"linkDataArray",xo,"linkDataArray",a,null,y,null,E),dy(a,y)}yt.Ey=function(a){if(Array.isArray(a))for(var y=a.length,x=0;x<y;x++)this.fi(a[x]);else for(a=a.iterator;a.next();)this.fi(a.value)},yt.bm=function(a){a!==null&&D1(this,a,!0)};function D1(a,y,x){a.$f.remove(y);var E=a.Ac(y);if(E!==void 0&&a.wb.remove(E),E=null,x){if(E=a.md.indexOf(y),0>E)return;a.md.splice(E,1)}if(Lo(a,"linkDataArray",Ao,"linkDataArray",a,y,null,E,null),x=Da(a,y,!0),Fl(a,x,y),x=Da(a,y,!1),Fl(a,x,y),E=a.Ef(y),Array.isArray(E))for(var b=E.length,z=0;z<b;z++)x=E[z],Fl(a,x,y)}yt.lA=function(a){if(Array.isArray(a))for(var y=a.length,x=0;x<y;x++)this.bm(a[x]);else for(a=a.iterator;a.next();)this.bm(a.value)},yt.Zz=function(a){if(this.linkKeyProperty===""&&It("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed."),a!==this.linkDataArray&&Ti(a)){var y=this.kl;y.clear(),y.addAll(this.wb.iteratorKeys);var x=this.il;x.clear();for(var E=a.length,b=0;b<E;b++){var z=a[b],tt=this.Ac(z);if(tt!==void 0){x.add(tt);var it=this.jh(tt);it!==z&&(it!==null?(this.Do(it,z),F1(this,z,it)):(z=this.cloneDeep(z),this.Ks(z,tt),this.fi(z)))}else tt=this.cloneDeep(z),this.fi(tt),x.add(this.Ac(tt))}for(a=y.iterator;a.next();)E=a.value,x.contains(E)||(E=this.jh(E))&&this.bm(E);y.clear(),x.clear()}};function dy(a,y){var x=Da(a,y,!0);x=a.Vl(x),a.hc(x)===null&&Dl(a,x,y),x=Da(a,y,!1),x=a.Vl(x),a.hc(x)===null&&Dl(a,x,y);var E=a.Ef(y);if(Array.isArray(E))for(var b=E.length,z=0;z<b;z++)x=E[z],a.hc(x)===null&&Dl(a,x,y)}yt.Jo=function(a){if(a===null)return null;var y=this.Ak;return a=y!==null?y(a,this):lm(this,a,!0),Oe(a)&&(bi(a),this.lf!==""&&Vr(a,this.lf,void 0),this.mf!==""&&Vr(a,this.mf,void 0),this.je!==""&&Vr(a,this.je,[])),a},yt.Yu=function(a){if(a===null)return!1;var y=this.jl;return y===""?!1:!!mo(a,y)},yt.lh=function(a){if(a!==null){var y=this.Je;if(y!==""&&(y=mo(a,y),y!==void 0)){if(Qh(y))return y;It("GroupKey value for node data "+a+" is not a number or a string: "+y)}}},yt.mp=function(a,y){if(y===null&&(y=void 0),a!==null){var x=this.Je;if(x!=="")if(this.lb(a)){var E=mo(a,x);E!==y&&(Fl(this,E,a),Vr(a,x,y),this.hc(y)===null&&Dl(this,y,a),Lo(this,"nodeGroupKey",Yr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vr(a,x,y)}},sr.prototype.copyNodeData=function(a){return a===null?null:(a=Ji.prototype.copyNodeData.call(this,a),this.Ij||this.Je===""||mo(a,this.Je)===void 0||Vr(a,this.Je,void 0),a)},sr.prototype.setDataProperty=function(a,y,x){if(this.lb(a)){if(y===this.nodeKeyProperty){this.km(a,x);return}if(y===this.nodeCategoryProperty){this.jm(a,x);return}if(y===this.nodeGroupKeyProperty){this.mp(a,x);return}}else if(this.Jc(a)){if(y===this.linkFromKeyProperty){Bd(this,a,x,!0);return}if(y===this.linkToKeyProperty){Bd(this,a,x,!1);return}if(y===this.linkFromPortIdProperty){Od(this,a,x,!0);return}if(y===this.linkToPortIdProperty){Od(this,a,x,!1);return}if(y===this.linkKeyProperty){this.Ks(a,x);return}if(y===this.linkCategoryProperty){this.lp(a,x);return}if(y===this.linkLabelKeysProperty){this.Ls(a,x);return}}var E=mo(a,y);E!==x&&(Vr(a,y,x),this.Fs(a,y,E,x))},yt=sr.prototype,yt.Do=function(a,y){if(y){var x=this.lb(a),E=this.Jc(a),b;for(b in y)b==="__gohashid"||x&&b===this.nodeKeyProperty||x&&b===this.nodeIsGroupProperty&&mo(a,b)===y[b]||E&&b===this.linkKeyProperty||this.setDataProperty(a,b,y[b])}},yt.jp=function(a,y){Ji.prototype.jp.call(this,a,y);for(var x=this.kb.iterator;x.next();)this.qv(x.value,a,y);for(x=this.$f.iterator;x.next();){var E=x.value,b=a,z=y;if(Da(this,E,!0)===b){var tt=this.lf;Vr(E,tt,z),Lo(this,"linkFromKey",Yr,tt,E,b,z),typeof tt=="string"&&this.La(E,tt)}if(Da(this,E,!1)===b&&(tt=this.mf,Vr(E,tt,z),Lo(this,"linkToKey",Yr,tt,E,b,z),typeof tt=="string"&&this.La(E,tt)),tt=this.Ef(E),Array.isArray(tt))for(var it=tt.length,nt=this.je,ot=0;ot<it;ot++)tt[ot]===b&&(tt[ot]=z,Lo(this,"linkLabelKeys",xo,nt,E,b,z,ot,ot))}},yt.qv=function(a,y,x){if(this.lh(a)===y){var E=this.Je;Vr(a,E,x),Lo(this,"nodeGroupKey",Yr,E,a,y,x),typeof E=="string"&&this.La(a,E)}},yt.Lv=function(){Ji.prototype.Lv.call(this);for(var a=this.linkDataArray,y=a.length,x=0;x<y;x++)dy(this,a[x])},yt.fm=function(a){Ji.prototype.fm.call(this,a),a=this.wa(a);var y=lg(this,a);if(y!==null){var x=ii();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)){if(this.lh(E)===a){var b=this.Je;Lo(this,"nodeGroupKey",Yr,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}else if(Da(this,E,!0)===a&&(b=this.lf,Lo(this,"linkFromKey",Yr,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)),Da(this,E,!1)===a&&(b=this.mf,Lo(this,"linkToKey",Yr,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)),b=this.Ef(E),Array.isArray(b))for(var z=b.length,tt=this.je,it=0;it<z;it++)b[it]===a&&(Lo(this,"linkLabelKeys",xo,tt,E,a,a,it,it),x.push(E))}for(y=0;y<x.length;y++)Fl(this,a,x[y]);Hi(x)}},yt.em=function(a){Ji.prototype.em.call(this,a);var y=this.lh(a);this.hc(y)===null&&Dl(this,y,a)},yt.qp=function(a){Ji.prototype.qp.call(this,a);var y=this.lh(a);Fl(this,y,a)},yt.ps=function(a){if(a===null)return"";var y=this.dj;if(y===""||(y=mo(a,y),y===void 0))return"";if(typeof y=="string")return y;It("getCategoryForLinkData found a non-string category for "+a+": "+y)},sr.prototype.getLinkCategoryForData=function(a){return this.ps(a)},sr.prototype.lp=function(a,y){if(a!==null){var x=this.dj;if(x!=="")if(this.Jc(a)){var E=mo(a,x);E===void 0&&(E=""),E!==y&&(Vr(a,x,y),Lo(this,"linkCategory",Yr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vr(a,x,y)}},sr.prototype.setLinkCategoryForData=function(a,y){this.lp(a,y)},yt=sr.prototype,yt.lm=function(a,y){Ji.prototype.lm.call(this,a,y),this.mp(y,this.lh(a))};function F1(a,y,x){a.lp(x,a.ps(y)),a.wv(x,a.yx(y)),a.Bv(x,a.Bx(y)),a.Ls(x,a.Ef(y)),a.xv(x,a.zx(y)),a.Cv(x,a.Cx(y))}yt.Wj=function(){return!0},yt.ri=function(){return!0},yt.xs=function(){return!0},yt.Xj=function(){return!0},zi.Object.defineProperties(sr.prototype,{archetypeNodeData:{get:function(){return this.Ri},set:function(a){var y=this.Ri;y!==a&&(this.Ri=a,this.g("archetypeNodeData",y,a))}},linkFromKeyProperty:{get:function(){return this.lf},set:function(a){var y=this.lf;y!==a&&(this.lf=a,this.g("linkFromKeyProperty",y,a))}},linkToKeyProperty:{get:function(){return this.mf},set:function(a){var y=this.mf;y!==a&&(this.mf=a,this.g("linkToKeyProperty",y,a))}},linkFromPortIdProperty:{get:function(){return this.ej},set:function(a){var y=this.ej;y!==a&&(this.ej=a,this.g("linkFromPortIdProperty",y,a))}},linkToPortIdProperty:{get:function(){return this.fj},set:function(a){var y=this.fj;y!==a&&(this.fj=a,this.g("linkToPortIdProperty",y,a))}},linkLabelKeysProperty:{get:function(){return this.je},set:function(a){var y=this.je;y!==a&&(this.je=a,this.g("linkLabelKeysProperty",y,a))}},linkDataArray:{get:function(){return this.md},set:function(a){var y=this.md;if(y!==a){this.wb.clear();for(var x=a.length,E=0;E<x;E++){var b=a[E];Oe(b)||It("GraphLinksModel.linkDataArray must only contain Objects, not: "+b),pn(b)}if(this.md=a,this.linkKeyProperty!==""){for(E=new Me,b=0;b<x;b++){var z=a[b],tt=this.Ac(z);tt===void 0||this.wb.I(tt)!==null?E.add(z):this.wb.add(tt,z)}for(E=E.iterator;E.next();)b=E.value,this.Bs(b),z=this.Ac(b),z!==void 0&&this.wb.add(z,b)}for(E=new _e,b=0;b<x;b++)E.add(a[b]);for(this.$f=E,Lo(this,"linkDataArray",Yr,"linkDataArray",this,y,a),y=0;y<x;y++)dy(this,a[y])}}},linkKeyProperty:{get:function(){return this.Jh},set:function(a){var y=this.Jh;if(y!==a){this.Jh=a,this.wb.clear();for(var x=this.linkDataArray.length,E=0;E<x;E++){var b=this.linkDataArray[E],z=this.Ac(b);z===void 0&&(this.Bs(b),z=this.Ac(b)),z!==void 0&&this.wb.add(z,b)}this.g("linkKeyProperty",y,a)}}},makeUniqueLinkKeyFunction:{get:function(){return this.cl},set:function(a){var y=this.cl;y!==a&&(this.cl=a,this.g("makeUniqueLinkKeyFunction",y,a))}},copyLinkDataFunction:{get:function(){return this.Ak},set:function(a){var y=this.Ak;y!==a&&(this.Ak=a,this.g("copyLinkDataFunction",y,a))}},nodeIsGroupProperty:{get:function(){return this.jl},set:function(a){var y=this.jl;y!==a&&(this.jl=a,this.g("nodeIsGroupProperty",y,a))}},nodeGroupKeyProperty:{get:function(){return this.Je},set:function(a){var y=this.Je;y!==a&&(this.Je=a,this.g("nodeGroupKeyProperty",y,a))}},Ij:{get:function(){return this.Lm},set:function(a){this.Lm!==a&&(this.Lm=a)}},linkCategoryProperty:{get:function(){return this.dj},set:function(a){var y=this.dj;y!==a&&(this.dj=a,this.g("linkCategoryProperty",y,a))}},type:{get:function(){return"GraphLinksModel"}}}),sr.prototype.setCategoryForLinkData=sr.prototype.lp,sr.prototype.getCategoryForLinkData=sr.prototype.ps,sr.prototype.assignAllDataProperties=sr.prototype.Do,sr.prototype.setGroupKeyForNodeData=sr.prototype.mp,sr.prototype.getGroupKeyForNodeData=sr.prototype.lh,sr.prototype.isGroupForNodeData=sr.prototype.Yu,sr.prototype.copyLinkData=sr.prototype.Jo,sr.prototype.mergeLinkDataArray=sr.prototype.Zz,sr.prototype.removeLinkDataCollection=sr.prototype.lA,sr.prototype.removeLinkData=sr.prototype.bm,sr.prototype.addLinkDataCollection=sr.prototype.Ey,sr.prototype.addLinkData=sr.prototype.fi,sr.prototype.containsLinkData=sr.prototype.Jc,sr.prototype.makeLinkDataKeyUnique=sr.prototype.Bs,sr.prototype.findLinkDataForKey=sr.prototype.jh,sr.prototype.setKeyForLinkData=sr.prototype.Ks,sr.prototype.getKeyForLinkData=sr.prototype.Ac,sr.prototype.removeLabelKeyForLinkData=sr.prototype.Qx,sr.prototype.addLabelKeyForLinkData=sr.prototype.Bu,sr.prototype.setLabelKeysForLinkData=sr.prototype.Ls,sr.prototype.getLabelKeysForLinkData=sr.prototype.Ef,sr.prototype.setToPortIdForLinkData=sr.prototype.Cv,sr.prototype.getToPortIdForLinkData=sr.prototype.Cx,sr.prototype.setFromPortIdForLinkData=sr.prototype.xv,sr.prototype.getFromPortIdForLinkData=sr.prototype.zx,sr.prototype.setToKeyForLinkData=sr.prototype.Bv,sr.prototype.getToKeyForLinkData=sr.prototype.Bx,sr.prototype.setFromKeyForLinkData=sr.prototype.wv,sr.prototype.getFromKeyForLinkData=sr.prototype.yx,sr.prototype.clear=sr.prototype.clear;var hm=Object.freeze([]);sr.className="GraphLinksModel",Sl.GraphLinksModel=sr,Ji.constructGraphLinksModel=Ji.constructGraphLinksModel=function(){return new sr},Ji.initDiagramModel=cy=function(){return new sr};function Hs(a,y){Ji.call(this),this.Ke="parent",this.Nm=!1,this.nj="parentLinkCategory",a!==void 0&&(Ti(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}Vi(Hs,Ji),Hs.constructGraphLinksModel=Ji.constructGraphLinksModel,Hs.prototype.cloneProtected=function(a){Ji.prototype.cloneProtected.call(this,a),a.Ke=this.Ke,a.Nm=this.Nm,a.nj=this.nj},yt=Hs.prototype,yt.toString=function(a){if(a===void 0&&(a=0),2<=a)return this.np();var y=(this.name!==""?this.name:"")+" TreeModel";if(0<a){y+=`
|
|
node data:`,a=this.nodeDataArray;for(var x=a.length,E=0;E<x;E++){var b=a[E];y+=" "+this.wa(b)+":"+ki(b)}}return y},yt.rm=function(){var a=Ji.prototype.rm.call(this),y="";return this.nodeParentKeyProperty!=="parent"&&typeof this.nodeParentKeyProperty=="string"&&(y+=`,
|
|
"nodeParentKeyProperty": `+this.quote(this.nodeParentKeyProperty)),a+y},yt.gp=function(a){Ji.prototype.gp.call(this,a),a.nodeParentKeyProperty&&(this.nodeParentKeyProperty=a.nodeParentKeyProperty)},yt.fp=function(a){a.nodeParentKeyProperty!==void 0&&a.nodeParentKeyProperty!==this.nodeParentKeyProperty&&It("applyIncrementalJson cannot change Model properties"),Ji.prototype.fp.call(this,a)},yt.Vl=function(a){return a},yt.mh=function(a){if(a!==null){var y=this.Ke;if(y!==""&&(y=mo(a,y),y!==void 0)){if(Qh(y))return y;It("ParentKey value for node data "+a+" is not a number or a string: "+y)}}},yt.qe=function(a,y){if(y===null&&(y=void 0),a!==null){var x=this.Ke;if(x!=="")if(y=this.Vl(y),this.lb(a)){var E=mo(a,x);E!==y&&(Fl(this,E,a),Vr(a,x,y),this.hc(y)===null&&Dl(this,y,a),Lo(this,"nodeParentKey",Yr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vr(a,x,y)}},yt.ss=function(a){if(a===null)return"";var y=this.nj;return y===""||(y=mo(a,y),y===void 0)?"":typeof y=="string"?y:(It("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+y),"")},Hs.prototype.getLinkCategoryForData=function(a){return this.ss(a)},Hs.prototype.Ms=function(a,y){if(a!==null){var x=this.nj;if(x!=="")if(this.lb(a)){var E=mo(a,x);E===void 0&&(E=""),E!==y&&(Vr(a,x,y),Lo(this,"parentLinkCategory",Yr,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Vr(a,x,y)}},Hs.prototype.setLinkCategoryForData=function(a,y){this.Ms(a,y)},Hs.prototype.copyNodeData=function(a){return a===null?null:(a=Ji.prototype.copyNodeData.call(this,a),this.Jj||this.Ke===""||mo(a,this.Ke)===void 0||Vr(a,this.Ke,void 0),a)},Hs.prototype.setDataProperty=function(a,y,x){if(this.lb(a)){if(y===this.nodeKeyProperty){this.km(a,x);return}if(y===this.nodeCategoryProperty){this.jm(a,x);return}if(y===this.nodeParentKeyProperty){this.qe(a,x);return}}var E=mo(a,y);E!==x&&(Vr(a,y,x),this.Fs(a,y,E,x))},yt=Hs.prototype,yt.jp=function(a,y){Ji.prototype.jp.call(this,a,y);for(var x=this.kb.iterator;x.next();)this.qv(x.value,a,y)},yt.qv=function(a,y,x){if(this.mh(a)===y){var E=this.Ke;Vr(a,E,x),Lo(this,"nodeParentKey",Yr,E,a,y,x),typeof E=="string"&&this.La(a,E)}},yt.fm=function(a){Ji.prototype.fm.call(this,a),a=this.wa(a);var y=lg(this,a);if(y!==null){var x=ii();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)&&this.mh(E)===a){var b=this.Ke;Lo(this,"nodeParentKey",Yr,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}for(y=0;y<x.length;y++)Fl(this,a,x[y]);Hi(x)}},yt.em=function(a){Ji.prototype.em.call(this,a);var y=this.mh(a);y=this.Vl(y),this.hc(y)===null&&Dl(this,y,a)},yt.qp=function(a){Ji.prototype.qp.call(this,a);var y=this.mh(a);Fl(this,y,a)},yt.lm=function(a,y){Ji.prototype.lm.call(this,a,y),this.Ms(y,this.ss(a)),this.qe(y,this.mh(a))},yt.Tl=function(){return!0},yt.xs=function(){return!0},zi.Object.defineProperties(Hs.prototype,{nodeParentKeyProperty:{get:function(){return this.Ke},set:function(a){var y=this.Ke;y!==a&&(this.Ke=a,this.g("nodeParentKeyProperty",y,a))}},Jj:{get:function(){return this.Nm},set:function(a){this.Nm!==a&&(this.Nm=a)}},parentLinkCategoryProperty:{get:function(){return this.nj},set:function(a){var y=this.nj;y!==a&&(this.nj=a,this.g("parentLinkCategoryProperty",y,a))}},linkCategoryProperty:{get:function(){return this.parentLinkCategoryProperty},set:function(a){this.parentLinkCategoryProperty=a}},type:{get:function(){return"TreeModel"}}}),Hs.prototype.setParentLinkCategoryForNodeData=Hs.prototype.Ms,Hs.prototype.getParentLinkCategoryForNodeData=Hs.prototype.ss,Hs.prototype.setParentKeyForNodeData=Hs.prototype.qe,Hs.prototype.getParentKeyForNodeData=Hs.prototype.mh,Hs.className="TreeModel",Sl.TreeModel=Hs;function eo(a){Gr.call(this),this.lw=this.Zm=this.lc=0,this.Wp=360,this.kw=Cl,this.Ti=0,this.Zv=new Pt,this.Jp=this.me=0,this.Xr=new pg,this.gt=this.mj=0,this.ty=600,this.eo=NaN,this.Cm=1,this.ro=0,this.ul=360,this.Rb=Cl,this.K=Ws,this.nd=Rd,this.hd=oy,this.tf=6,this.Nn=mm,a&&Object.assign(this,a)}Vi(eo,Gr),eo.prototype.cloneProtected=function(a){Gr.prototype.cloneProtected.call(this,a),a.eo=this.eo,a.Cm=this.Cm,a.ro=this.ro,a.ul=this.ul,a.Rb=this.Rb,a.K=this.K,a.nd=this.nd,a.hd=this.hd,a.tf=this.tf,a.Nn=this.Nn},eo.prototype.qb=function(a){a.classType===eo?a===gm||a===vm||a===dm||a===pm||a===Rd?this.sorting=a:a===Hc||a===Id||a===Ws||a===qh?this.direction=a:a===ph||a===$h||a===Cl||a===kl?this.arrangement=a:(a===Tf||a===mm)&&(this.nodeDiameterFormula=a):Gr.prototype.qb.call(this,a)},eo.prototype.createNetwork=function(){return new jd(this)},eo.prototype.doLayout=function(a){if(this.network===null&&(this.network=this.makeNetwork(a)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),a=this.network.vertexes,1>=a.count)a.count===1&&(a=a.first(),a.centerX=0,a.centerY=0);else{var y=new Me;y.addAll(a.iterator),a=new Me;var x=new Me,E=this.sort(y),b,z,tt=this.Jp,it=this.arrangement,nt=this.nodeDiameterFormula,ot=this.radius;(!isFinite(ot)||0>=ot)&&(ot=NaN);var st=this.aspectRatio;(!isFinite(st)||0>=st)&&(st=1);var ut=this.startAngle;isFinite(ut)||(ut=0);var ct=this.sweepAngle;if((!isFinite(ct)||360<ct||1>ct)&&(ct=360),y=this.spacing,isFinite(y)||(y=NaN),it===kl&&nt===Tf?it=Cl:it===kl&&nt!==Tf&&(it=this.arrangement),(this.direction===Hc||this.direction===Id)&&this.sorting!==Rd){for(nt=0;!(nt>=E.length)&&(a.add(E.M(nt)),!(nt+1>=E.length));nt+=2)x.add(E.M(nt+1));this.direction===Hc?(this.arrangement===kl&&a.reverse(),E=new Me,E.addAll(a),E.addAll(x)):(this.arrangement===kl&&x.reverse(),E=new Me,E.addAll(x),E.addAll(a))}nt=E.length;for(var dt=z=b=0;dt<E.length;dt++){var vt=ut+ct*z*(this.direction===Ws?1:-1)/nt,xt=E.M(dt).diameter;isNaN(xt)&&(xt=tc(E.M(dt),vt)),360>ct&&(dt===0||dt===E.length-1)&&(xt/=2),b+=xt,z++}if(isNaN(ot)||it===kl){if(isNaN(y)&&(y=6),it!==Cl&&it!==kl){for(z=-1/0,tt=0;tt<nt;tt++)dt=E.M(tt),b=E.M(tt===nt-1?0:tt+1),isNaN(dt.diameter)&&tc(dt,0),isNaN(b.diameter)&&tc(b,0),z=Math.max(z,(dt.diameter+b.diameter)/2);tt=z+y,it===ph?ot=(z+y)/(2*Math.PI/nt):ot=cm(this,tt*(360<=ct?nt:nt-1),st,ut*Math.PI/180,ct*Math.PI/180)}else ot=cm(this,b+(360<=ct?nt:nt-1)*(it!==kl?y:1.6*y),st,ut*Math.PI/180,ct*Math.PI/180);z=ot*st}else if(z=ot*st,dt=py(this,ot,z,ut*Math.PI/180,ct*Math.PI/180),isNaN(y))(it===Cl||it===kl)&&(y=(dt-b)/(360<=ct?nt:nt-1));else if(it===Cl||it===kl)dt=(dt-b)/(360<=ct?nt:nt-1),dt<y?(ot=cm(this,b+y*(360<=ct?nt:nt-1),st,ut*Math.PI/180,ct*Math.PI/180),z=ot*st):y=dt;else{for(tt=-1/0,b=0;b<nt;b++)vt=E.M(b),xt=E.M(b===nt-1?0:b+1),isNaN(vt.diameter)&&tc(vt,0),isNaN(xt.diameter)&&tc(xt,0),tt=Math.max(tt,(vt.diameter+xt.diameter)/2);tt+=y,b=cm(this,tt*(360<=ct?nt:nt-1),st,ut*Math.PI/180,ct*Math.PI/180),b>ot?(ot=b,z=ot*st):tt=dt/(360<=ct?nt:nt-1)}if(this.kw=it,this.lc=ot,this.Zm=st,this.lw=ut,this.Wp=ct,this.Ti=y,this.me=z,this.Jp=tt,y=E,E=this.kw,it=this.lc,ot=this.lw,st=this.Wp,ut=this.Ti,ct=this.me,nt=this.Jp,this.direction!==Hc&&this.direction!==Id||E!==kl)if(this.direction===Hc||this.direction===Id){switch(tt=0,E){case $h:tt=180*fm(this,it,ct,ot,nt)/Math.PI;break;case Cl:nt=y=0,tt=a.first(),tt!==null&&(y=tc(tt,Math.PI/2)),tt=x.first(),tt!==null&&(nt=tc(tt,Math.PI/2)),tt=180*fm(this,it,ct,ot,ut+(y+nt)/2)/Math.PI;break;case ph:tt=st/y.length}if(this.direction===Hc){switch(E){case $h:dg(this,a,ot,qh);break;case Cl:fg(this,a,ot,qh);break;case ph:cg(this,a,st/2,ot,qh)}switch(E){case $h:dg(this,x,ot+tt,Ws);break;case Cl:fg(this,x,ot+tt,Ws);break;case ph:cg(this,x,st/2,ot+tt,Ws)}}else{switch(E){case $h:dg(this,x,ot,qh);break;case Cl:fg(this,x,ot,qh);break;case ph:cg(this,x,st/2,ot,qh)}switch(E){case $h:dg(this,a,ot+tt,Ws);break;case Cl:fg(this,a,ot+tt,Ws);break;case ph:cg(this,a,st/2,ot+tt,Ws)}}}else switch(E){case $h:dg(this,y,ot,this.direction);break;case Cl:fg(this,y,ot,this.direction);break;case ph:cg(this,y,st,ot,this.direction);break;case kl:B1(this,y,st,ot,this.direction)}else B1(this,y,st,ot-st/2,Ws)}this.updateParts(),this.network=null,this.isValidLayout=!0};function cg(a,y,x,E,b){var z=a.Wp,tt=a.lc;a=a.me,E=E*Math.PI/180,x=x*Math.PI/180;for(var it=y.length,nt=0;nt<it;nt++){var ot=E+(b===Ws?nt*x/(360<=z?it:it-1):-(nt*x)/it),st=y.M(nt),ut=tt*Math.tan(ot)/a;ut=Math.sqrt((tt*tt+a*a*ut*ut)/(1+ut*ut)),st.centerX=ut*Math.cos(ot),st.centerY=ut*Math.sin(ot),st.actualAngle=180*ot/Math.PI}}function fg(a,y,x,E){var b=a.lc,z=a.me,tt=a.Ti;x=x*Math.PI/180;for(var it=y.length,nt=0;nt<it;nt++){var ot=y.M(nt),st=y.M(nt===it-1?0:nt+1),ut=z*Math.sin(x);ot.centerX=b*Math.cos(x),ot.centerY=ut,ot.actualAngle=180*x/Math.PI,isNaN(ot.diameter)&&tc(ot,0),isNaN(st.diameter)&&tc(st,0),ot=fm(a,b,z,E===Ws?x:-x,(ot.diameter+st.diameter)/2+tt),x+=E===Ws?ot:-ot}}function dg(a,y,x,E){var b=a.lc,z=a.me,tt=a.Jp;x=x*Math.PI/180;for(var it=y.length,nt=0;nt<it;nt++){var ot=y.M(nt);ot.centerX=b*Math.cos(x),ot.centerY=z*Math.sin(x),ot.actualAngle=180*x/Math.PI,ot=fm(a,b,z,E===Ws?x:-x,tt),x+=E===Ws?ot:-ot}}function B1(a,y,x,E,b){var z=a.Wp;if(a.mj=0,a.Xr=new pg,360>x){for(z=E+(b===Ws?z:-z);0>z;)z+=360;z%=360,180<z&&(z-=360),z*=Math.PI/180,a.gt=z,I1(a,y,x,E,b)}else O1(a,y,x,E,b);a.Xr.commit(y)}function O1(a,y,x,E,b){var z=a.lc,tt=a.Ti,it=a.Zm,nt=z*Math.cos(E*Math.PI/180),ot=a.me*Math.sin(E*Math.PI/180),st=y.Fa();if(st.length===3)st[0].centerX=z,st[0].centerY=0,st[1].centerX=st[0].centerX-st[0].width/2-st[1].width/2-tt,st[1].y=st[0].y,st[2].centerX=(st[0].centerX+st[1].centerX)/2,st[2].y=st[0].y-st[2].height-tt;else if(st.length===4)st[0].centerX=z,st[0].centerY=0,st[2].centerX=-st[0].centerX,st[2].centerY=st[0].centerY,st[1].centerX=0,st[1].y=Math.min(st[0].y,st[2].y)-st[1].height-tt,st[3].centerX=0,st[3].y=Math.max(st[0].y+st[0].height+tt,st[2].y+st[2].height+tt);else{z=Pt.alloc();for(var ut=0;ut<st.length&&(st[ut].centerX=nt,st[ut].centerY=ot,!(ut>=st.length-1));ut++)R1(a,nt,ot,st,ut,b,z)||j1(a,nt,ot,st,ut,b,z),nt=z.x,ot=z.y;if(Pt.free(z),a.mj++,!(23<a.mj)){nt=st[0].centerX,ot=st[0].centerY,z=st[st.length-1].centerX,ut=st[st.length-1].centerY;var ct=Math.abs(nt-z)-((st[0].width+st[st.length-1].width)/2+tt),dt=Math.abs(ot-ut)-((st[0].height+st[st.length-1].height)/2+tt);tt=0,1>Math.abs(dt)?Math.abs(nt-z)<(st[0].width+st[st.length-1].width)/2&&(tt=0):tt=0<dt?dt:1>Math.abs(ct)?0:ct,nt=Math.abs(z)>Math.abs(ut)?0<z!=ot>ut:0<ut!=nt<z,(nt=b===Ws?nt:!nt)&&(tt=-Math.abs(tt),tt=Math.min(tt,-st[st.length-1].width),tt=Math.min(tt,-st[st.length-1].height)),a.Xr.compare(tt,st),1<Math.abs(tt)&&(a.lc=8>a.mj?a.lc-tt/(2*Math.PI):5>st.length&&10<tt?a.lc/2:a.lc-(0<tt?1.7:-2.3),a.me=a.lc*it,O1(a,y,x,E,b))}}}function I1(a,y,x,E,b){for(var z=a.lc,tt=a.me,it=a.Zm,nt=z*Math.cos(E*Math.PI/180),ot=tt*Math.sin(E*Math.PI/180),st=Pt.alloc(),ut=y.Fa(),ct=0;ct<ut.length&&(ut[ct].centerX=nt,ut[ct].centerY=ot,!(ct>=ut.length-1));ct++)R1(a,nt,ot,ut,ct,b,st)||j1(a,nt,ot,ut,ct,b,st),nt=st.x,ot=st.y;if(Pt.free(st),a.mj++,!(23<a.mj)){if(nt=Math.atan2(ot,nt),nt=b===Ws?a.gt-nt:nt-a.gt,nt=Math.abs(nt)<Math.abs(nt-2*Math.PI)?nt:nt-2*Math.PI,z=nt*(z+tt)/2,tt=a.Xr,Math.abs(z)<Math.abs(tt.Pl))for(tt.Pl=z,tt.mk=[],tt.tm=[],nt=0;nt<ut.length;nt++)tt.mk[nt]=ut[nt].bounds.x,tt.tm[nt]=ut[nt].bounds.y;1<Math.abs(z)&&(a.lc=8>a.mj?a.lc-z/(2*Math.PI):a.lc-(0<z?1.7:-2.3),a.me=a.lc*it,I1(a,y,x,E,b))}}function R1(a,y,x,E,b,z,tt){var it=a.lc,nt=a.me,ot=0;a=(E[b].width+E[b+1].width)/2+a.Ti;var st=!1;if(0<=x!=(z===Ws)){if(z=y+a,z>it){if(z=y-a,z<-it)return tt.x=z,tt.y=ot,!1;st=!0}}else if(z=y-a,z<-it){if(z=y+a,z>it)return tt.x=z,tt.y=ot,!1;st=!0}return ot=Math.sqrt(1-Math.min(1,z*z/(it*it)))*nt,0>x!==st&&(ot=-ot),Math.abs(x-ot)>(E[b].height+E[b+1].height)/2?(tt.x=z,tt.y=ot,!1):(tt.x=z,tt.y=ot,!0)}function j1(a,y,x,E,b,z,tt){var it=a.lc,nt=a.me,ot=0;if(a=(E[b].height+E[b+1].height)/2+a.Ti,E=!1,0<=y!=(z===Ws)){if(z=x-a,z<-nt){if(z=x+a,z>nt){tt.x=ot,tt.y=z;return}E=!0}}else if(z=x+a,z>nt){if(z=x-a,z<-nt){tt.x=ot,tt.y=z;return}E=!0}ot=Math.sqrt(1-Math.min(1,z*z/(nt*nt)))*it,0>y!==E&&(ot=-ot),tt.x=ot,tt.y=z}eo.prototype.commitLayout=function(){this.commitNodes(),this.isRouting&&this.commitLinks()},eo.prototype.commitNodes=function(){var a=this.group!==null&&this.group.placeholder!==null&&this.group.isSubGraphExpanded,y=a?this.group.location.copy():null,x=this.actualCenter;a?x=new Pt(0,0):(x.x=this.arrangementOrigin.x+this.lc,x.y=this.arrangementOrigin.y+this.me);for(var E=this.network.vertexes.iterator;E.next();){var b=E.value;b.x+=x.x,b.y+=x.y,b.commit()}a&&(this.group.Va(),a=this.group.position.copy(),x=this.group.location.copy(),y=y.re(x.re(a)),this.group.move(y),this.Zv=y.re(a))},eo.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function py(a,y,x,E,b){var z=a.ty;if(.001>Math.abs(a.Zm-1))return E!==void 0&&b!==void 0?b*y:2*Math.PI*y;a=y>x?Math.sqrt(y*y-x*x)/y:Math.sqrt(x*x-y*y)/x;for(var tt=0,it=E!==void 0&&b!==void 0?b/(z+1):Math.PI/(2*(z+1)),nt=0,ot=0;ot<=z;ot++){E!==void 0&&b!==void 0?nt=E+ot*b/z:nt=ot*Math.PI/(2*z);var st=Math.sin(nt);tt+=Math.sqrt(1-a*a*st*st)*it}return E!==void 0&&b!==void 0?(y>x?y:x)*tt:4*(y>x?y:x)*tt}function cm(a,y,x,E,b){return y/(E!==void 0&&b!==void 0?py(a,1,x,E,b):py(a,1,x))}function fm(a,y,x,E,b){if(.001>Math.abs(a.Zm-1))return b/y;var z=y>x?Math.sqrt(y*y-x*x)/y:Math.sqrt(x*x-y*y)/x,tt=0;a=2*Math.PI/(700*a.network.vertexes.count),y>x&&(E+=Math.PI/2);for(var it=0;;it++){var nt=Math.sin(E+it*a);if(tt+=(y>x?y:x)*Math.sqrt(1-z*z*nt*nt)*a,tt>=b)return it*a}}eo.prototype.sort=function(a){switch(this.sorting){case dm:break;case pm:a.reverse();break;case gm:a.sort(this.comparer);break;case vm:a.sort(this.comparer),a.reverse();break;case Rd:return this.ak(zw(a));default:It("Invalid sorting type.")}return a};function zw(a){for(var y=[],x=0;x<a.length;x++)y.push(0);x=new Me;for(var E=0;E<a.length;E++){var b=-1,z=-1;if(E===0)for(var tt=0;tt<a.length;tt++){var it=a.M(tt).edgesCount;it>b&&(b=it,z=tt)}else for(tt=0;tt<a.length;tt++)it=y[tt],it>b&&(b=it,z=tt);for(x.add(a.M(z)),y[z]=-1,z=a.M(z),tt=z.sourceEdges;tt.next();)b=a.indexOf(tt.value.fromVertex),0>b||0<=y[b]&&y[b]++;for(z=z.destinationEdges;z.next();)b=a.indexOf(z.value.toVertex),0>b||0<=y[b]&&y[b]++}return x}eo.prototype.ak=function(a){for(var y=[],x=0;x<a.length;x++){var E=a.M(x);y[x]=[];for(var b,z=E.destinationEdges;z.next();)b=a.indexOf(z.value.toVertex),b!==x&&0>y[x].indexOf(b)&&y[x].push(b);for(E=E.sourceEdges;E.next();)b=a.indexOf(E.value.fromVertex),b!==x&&0>y[x].indexOf(b)&&y[x].push(b)}for(z=[],x=0;x<y.length;x++)z[x]=0;x=[];var tt=[],it=[];E=[],b=new Me;for(var nt=0,ot=0;ot<y.length;ot++){var st=y[ot].length;if(st===1)E.push(ot);else if(st===0)b.add(a.M(ot));else{if(nt===0)x.push(ot);else{for(var ut=st=1/0,ct=-1,dt=[],vt=0;vt<x.length;vt++)0>y[x[vt]].indexOf(x[vt===x.length-1?0:vt+1])&&dt.push(vt===x.length-1?0:vt+1);if(dt.length===0)for(vt=0;vt<x.length;vt++)dt.push(vt);for(vt=0;vt<dt.length;vt++){for(var xt=dt[vt],Tt=y[ot],Et=0,Ft=0;Ft<tt.length;Ft++){var Ot=z[tt[Ft]],Rt=z[it[Ft]];if(Ot<Rt){var Ht=Ot;Ot=Rt}else Ht=Rt;if(Ht<xt&&xt<=Ot)for(Rt=0;Rt<Tt.length;Rt++){var ae=Tt[Rt];0>x.indexOf(ae)||Ht<z[ae]&&z[ae]<Ot||Ht===z[ae]||Ot===z[ae]||Et++}else for(Rt=0;Rt<Tt.length;Rt++)ae=Tt[Rt],0>x.indexOf(ae)||Ht<z[ae]&&z[ae]<Ot&&Ht!==z[ae]&&Ot!==z[ae]&&Et++}for(Tt=Et,Ft=Et=0;Ft<y[ot].length;Ft++)Ht=x.indexOf(y[ot][Ft]),0<=Ht&&(Ht=Math.abs(xt-(Ht>=xt?Ht+1:Ht)),Et+=Ht<x.length+1-Ht?Ht:x.length+1-Ht);for(Ft=0;Ft<tt.length;Ft++)Ht=z[tt[Ft]],Ot=z[it[Ft]],Ht>=xt&&Ht++,Ot>=xt&&Ot++,Ht>Ot&&(Rt=Ot,Ot=Ht,Ht=Rt),Ot-Ht<(x.length+2)/2==(Ht<xt&&xt<=Ot)&&Et++;(Tt<st||Tt===st&&Et<ut)&&(st=Tt,ut=Et,ct=xt)}for(x.splice(ct,0,ot),st=0;st<x.length;st++)z[x[st]]=st;for(st=0;st<y[ot].length;st++)ut=y[ot][st],0<=x.indexOf(ut)&&(tt.push(ot),it.push(ut))}nt++}}for(tt=x.length;;){for(z=!0,it=0;it<E.length;it++)if(nt=E[it],ot=y[nt][0],st=x.indexOf(ot),0<=st){for(ct=ut=0;ct<y[ot].length;ct++)dt=x.indexOf(y[ot][ct]),0>dt||dt===st||(vt=dt>st?dt-st:st-dt,ut+=dt<st!=vt>tt-vt?1:-1);x.splice(0>ut?st:st+1,0,nt),E.splice(it,1),it--}else z=!1;if(z)break;x.push(E[0]),E.splice(0,1)}for(y=0;y<x.length;y++)b.add(a.M(x[y]));return b},zi.Object.defineProperties(eo.prototype,{radius:{get:function(){return this.eo},set:function(a){this.eo!==a&&(0<a||isNaN(a))&&(this.eo=a,this.C())}},aspectRatio:{get:function(){return this.Cm},set:function(a){this.Cm!==a&&0<a&&(this.Cm=a,this.C())}},startAngle:{get:function(){return this.ro},set:function(a){this.ro!==a&&(this.ro=a,this.C())}},sweepAngle:{get:function(){return this.ul},set:function(a){this.ul!==a&&(0<a&&360>=a?this.ul=a:this.ul=360,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==kl&&a!==Cl&&a!==$h&&a!==ph||(this.Rb=a,this.C())}},direction:{get:function(){return this.K},set:function(a){this.K===a||a!==Ws&&a!==qh&&a!==Hc&&a!==Id||(this.K=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==dm&&a!==pm&&a!==gm&&!vm&&a!==Rd||(this.nd=a,this.C())}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a,this.C())}},spacing:{get:function(){return this.tf},set:function(a){this.tf!==a&&(this.tf=a,this.C())}},nodeDiameterFormula:{get:function(){return this.Nn},set:function(a){this.Nn===a||a!==mm&&a!==Tf||(this.Nn=a,this.C())}},actualXRadius:{get:function(){return this.lc}},actualYRadius:{get:function(){return this.me}},actualSpacing:{get:function(){return this.Ti}},actualCenter:{get:function(){return this.Zv}}});var Cl=new ze(eo,"ConstantSpacing",0),$h=new ze(eo,"ConstantDistance",1),ph=new ze(eo,"ConstantAngle",2),kl=new ze(eo,"Packed",3),Ws=new ze(eo,"Clockwise",4),qh=new ze(eo,"Counterclockwise",5),Hc=new ze(eo,"BidirectionalLeft",6),Id=new ze(eo,"BidirectionalRight",7),dm=new ze(eo,"Forwards",8),pm=new ze(eo,"Reverse",9),gm=new ze(eo,"Ascending",10),vm=new ze(eo,"Descending",11),Rd=new ze(eo,"Optimized",12),mm=new ze(eo,"Pythagorean",13),Tf=new ze(eo,"Circular",14);eo.className="CircularLayout",eo.ConstantSpacing=Cl,eo.ConstantDistance=$h,eo.ConstantAngle=ph,eo.Packed=kl,eo.Clockwise=Ws,eo.Counterclockwise=qh,eo.BidirectionalLeft=Hc,eo.BidirectionalRight=Id,eo.Forwards=dm,eo.Reverse=pm,eo.Ascending=gm,eo.Descending=vm,eo.Optimized=Rd,eo.Pythagorean=mm,eo.Circular=Tf;function pg(){this.Pl=-1/0,this.tm=this.mk=null}pg.prototype.compare=function(a,y){if(0<a&&0>this.Pl||Math.abs(a)<Math.abs(this.Pl)&&!(0>a&&0<this.Pl))for(this.Pl=a,this.mk=[],this.tm=[],a=0;a<y.length;a++)this.mk[a]=y[a].bounds.x,this.tm[a]=y[a].bounds.y},pg.prototype.commit=function(a){if(this.mk!==null&&this.tm!==null)for(var y=0;y<this.mk.length;y++){var x=a.M(y);x.x=this.mk[y],x.y=this.tm[y]}},pg.className="VertexArrangement";function jd(a){Ir.call(this,a)}Vi(jd,Ir),jd.prototype.createVertex=function(){return new gg(this)},jd.prototype.createEdge=function(){return new ym(this)},jd.className="CircularNetwork";function gg(a){Fo.call(this,a),this.u=this.Si=NaN}Vi(gg,Fo);function tc(a,y){var x=a.network;if(x===null)return NaN;if(x=x.layout,x===null)return NaN;if(x.arrangement===kl)if(x.nodeDiameterFormula===Tf)a.Si=Math.max(a.width,a.height);else{if(x=Math.abs(Math.sin(y)),y=Math.abs(Math.cos(y)),x===0)return a.width;if(y===0)return a.height;a.Si=Math.min(a.height/x,a.width/y)}else a.Si=x.nodeDiameterFormula===Tf?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.Si}zi.Object.defineProperties(gg.prototype,{diameter:{get:function(){return this.Si},set:function(a){this.Si!==a&&(this.Si=a)}},actualAngle:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}}}),gg.className="CircularVertex";function ym(a){ma.call(this,a)}Vi(ym,ma),ym.className="CircularEdge";function cs(a){Gr.call(this),this.ah=null,this.An=0,this.$d=new li(100,100).freeze(),this.Bm=!1,this.sf=!0,this.td=!1,this.dl=100,this.$m=1,this.Zf=1e3,this.In=10,this.fo=Math,this.Hk=.05,this.Gk=50,this.Ek=150,this.Fk=0,this.Vm=10,this.Um=5,a&&Object.assign(this,a)}Vi(cs,Gr),cs.prototype.cloneProtected=function(a){Gr.prototype.cloneProtected.call(this,a),a.$d.assign(this.$d),a.Bm=this.Bm,a.sf=this.sf,a.td=this.td,a.dl=this.dl,a.$m=this.$m,a.Zf=this.Zf,a.In=this.In,a.fo=this.fo,a.Hk=this.Hk,a.Gk=this.Gk,a.Ek=this.Ek,a.Fk=this.Fk,a.Vm=this.Vm,a.Um=this.Um},cs.prototype.createNetwork=function(){return new Lf(this)},cs.prototype.doLayout=function(a){if(this.network===null&&(this.network=this.makeNetwork(a)),a=this.maxIterations,0<this.network.vertexes.count){this.network.Ko();for(var y=this.network.vertexes.iterator;y.next();){var x=y.value;x.charge=this.electricalCharge(x),x.mass=this.gravitationalMass(x)}for(y=this.network.edges.iterator;y.next();)x=y.value,x.stiffness=this.springStiffness(x),x.length=this.springLength(x);if(this.Cu(),this.An=0,this.needsClusterLayout()){y=this.network,x=y.Zx();for(var E=x.iterator;E.next();){this.network=E.value;for(var b=this.network.vertexes.iterator;b.next();){var z=b.value;z.Vd=z.vertexes.count,z.sh=1,z.Hj=null,z.We=null}z1(this,0,a)}this.network=y;var tt=E=x.iterator;E=this.arrangementSpacing;var it=tt.count,nt=!0;z=b=0;for(var ot=ii(),st=0;st<it+y.vertexes.count+2;st++)ot[st]=null;it=0,tt.reset();for(var ut=be.alloc();tt.next();)if(st=tt.value,this.computeBounds(st,ut),nt)nt=!1,b=ut.x+ut.width/2,z=ut.y+ut.height/2,ot[0]=new Pt(ut.x+ut.width+E.width,ut.y),ot[1]=new Pt(ut.x,ut.y+ut.height+E.height),it=2;else{var ct=_1(ot,it,b,z,ut.width,ut.height,E),dt=ot[ct],vt=new Pt(dt.x+ut.width+E.width,dt.y),xt=new Pt(dt.x,dt.y+ut.height+E.height);for(ct+1<it&&ot.splice(ct+1,0,null),ot[ct]=vt,ot[ct+1]=xt,it++,ct=dt.x-ut.x,dt=dt.y-ut.y,st=st.vertexes.iterator;st.next();)vt=st.value,vt.centerX+=ct,vt.centerY+=dt}for(be.free(ut),st=y.vertexes.iterator;st.next();)tt=st.value,ct=tt.bounds,2>it?(b=ct.x+ct.width/2,z=ct.y+ct.height/2,ot[0]=new Pt(ct.x+ct.width+E.width,ct.y),ot[1]=new Pt(ct.x,ct.y+ct.height+E.height),it=2):(nt=_1(ot,it,b,z,ct.width,ct.height,E),ut=ot[nt],dt=new Pt(ut.x+ct.width+E.width,ut.y),ct=new Pt(ut.x,ut.y+ct.height+E.height),nt+1<it&&ot.splice(nt+1,0,null),ot[nt]=dt,ot[nt+1]=ct,it++,tt.centerX=ut.x+tt.width/2,tt.centerY=ut.y+tt.height/2);for(Hi(ot),E=x.iterator;E.next();){for(x=E.value,b=x.vertexes.iterator;b.next();)y.dh(b.value);for(x=x.edges.iterator;x.next();)y.Bo(x.value)}}W1(this,a),this.updateParts()}this.dl=a,this.network=null,this.isValidLayout=!0},cs.prototype.needsClusterLayout=function(){if(3>this.network.vertexes.count)return!1;for(var a=0,y=0,x=this.network.vertexes.first().bounds,E=this.network.vertexes.iterator;E.next();){if(E.value.bounds.Yc(x)&&(a++,2<a))return!0;if(10<y)break;y++}return!1},cs.prototype.computeBounds=function(a,y){var x=!0;for(a=a.vertexes.iterator;a.next();){var E=a.value;x?(x=!1,y.set(E.bounds)):y.ed(E.bounds)}return y};function z1(a,y,x){if(_w(a,y)){var E=a.Zf;a.Zf*=1+1/(y+1);var b=Hw(a,y),z=Math.max(0,Math.max(Math.min(a.network.vertexes.count,x*(y+1)/11),10));for(a.maxIterations+=z,z1(a,y+1,x),W1(a,z),Ww(a,b),y=b.vertexes.Fa(),y.sort(function(tt,it){return tt===null||it===null||tt===it?0:it.Vd-tt.Vd}),x=0;x<y.length;x++)Zw(a,y[x]);a.Zf=E}}function _w(a,y){if(10<y||3>a.network.vertexes.count)return!1;for(a.ah=a.network.vertexes.Fa(),a=a.ah,a.sort(function(x,E){return x===null||E===null||x===E?0:E.Vd-x.Vd}),y=a.length-1;0<=y&&1>=a[y].Vd;)y--;return 1<a.length-y}function Hw(a,y){for(var x=a.network,E=new Lf(a),b=0;b<a.ah.length;b++){var z=a.ah[b];if(1<z.Vd){E.dh(z);var tt=new Z1;tt.Rs=z.Vd,tt.Ss=z.width,tt.Qs=z.height,tt.Sv=z.focus.x,tt.Tv=z.focus.y,z.We===null&&(z.We=new Me),z.We.add(tt),z.sv=z.We.count-1}else break}for(z=x.edges.iterator;z.next();){var it=z.value;b=it.fromVertex,tt=it.toVertex,b.network===E&&tt.network===E?E.Bo(it):b.network===E?(it=b.Hj,it===null&&(it=new Me,b.Hj=it),it.add(tt),b.Vd--,b.sh+=tt.sh):tt.network===E&&(it=tt.Hj,it===null&&(it=new Me,tt.Hj=it),it.add(b),tt.Vd--,tt.sh+=b.sh)}for(b=E.edges.iterator;b.next();)z=b.value,z.length*=Math.max(1,Gt.sqrt((z.fromVertex.sh+z.toVertex.sh)/(4*y+1)));for(y=E.vertexes.iterator;y.next();){b=y.value;var nt=b.Hj;if(nt!==null&&0<nt.count&&(tt=b.We.M(b.We.count-1).Rs-b.Vd,!(0>=tt))){for(var ot=it=0,st=nt.count-tt;st<nt.count;st++){var ut=nt.M(st),ct=null;for(z=ut.edges.iterator;z.next();){var dt=z.value;if(dt.Ax(ut)===b){ct=dt;break}}ct!==null&&(ot+=ct.length,it+=ut.width*ut.height)}z=b.centerX,nt=b.centerY,st=b.width,ut=b.height,ct=b.focus,dt=st*ut,1>dt&&(dt=1),it=Gt.sqrt((it+dt+ot*ot*4/(tt*tt))/dt),tt=(it-1)*st/2,it=(it-1)*ut/2,b.bounds=new be(z-ct.x-tt,nt-ct.y-it,st+2*tt,ut+2*it),b.focus=new Pt(ct.x+tt,ct.y+it)}}return a.network=E,x}function Ww(a,y){for(var x=a.network.vertexes.iterator;x.next();){var E=x.value;if(E.network=y,E.We!==null){var b=E.We.M(E.sv);E.Vd=b.Rs;var z=b.Sv,tt=b.Tv;E.bounds=new be(E.centerX-z,E.centerY-tt,b.Ss,b.Qs),E.focus=new Pt(z,tt),E.sv--}}for(x=a.network.edges.iterator;x.next();)x.value.network=y;a.network=y}function Zw(a,y){var x=y.Hj;if(x!==null&&x.count!==0){var E=y.centerX,b=y.centerY,z=y.width,tt=y.height;y.We!==null&&0<y.We.count&&(tt=y.We.M(0),z=tt.Ss,tt=tt.Qs),z=Gt.sqrt(z*z+tt*tt)/2;for(var it=!1,nt=tt=0,ot=0,st=y.vertexes.iterator;st.next();){var ut=st.value;1>=ut.Vd?nt++:(it=!0,ot++,tt+=Math.atan2(y.centerY-ut.centerY,y.centerX-ut.centerX))}if(nt!==0){for(0<ot&&(tt/=ot),ot=y=0,y=it?2*Math.PI/(nt+1):2*Math.PI/nt,nt%2===0&&(ot=y/2),1<x.count&&x.sort(function(dt,vt){return dt===null||vt===null||dt===vt?0:vt.width*vt.height-dt.width*dt.height}),it=nt%2===0?0:1,x=x.iterator;x.next();)if(nt=x.value,!(1<nt.Vd||a.isFixed(nt))){for(st=null,ut=nt.edges.iterator;ut.next();){st=ut.value;break}ut=nt.width;var ct=nt.height;ut=Gt.sqrt(ut*ut+ct*ct)/2,st=z+st.length+ut,ut=tt+(y*(it/2>>1)+ot)*(it%2===0?1:-1),nt.centerX=E+st*Math.cos(ut),nt.centerY=b+st*Math.sin(ut),it++}}}}function _1(a,y,x,E,b,z,tt){var it=9e19,nt=-1,ot=0;t:for(;ot<y;ot++){var st=a[ot],ut=st.x-x,ct=st.y-E;if(ut=ut*ut+ct*ct,ut<it){for(ct=ot-1;0<=ct;ct--)if(a[ct].y>st.y&&a[ct].x-st.x<b+tt.width)continue t;for(ct=ot+1;ct<y;ct++)if(a[ct].x>st.x&&a[ct].y-st.y<z+tt.height)continue t;nt=ot,it=ut}}return nt}cs.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},cs.prototype.addComments=function(a){var y=a.node;if(y!==null)for(y=y.Mu();y.next();){var x=y.value;if(x.category==="Comment"&&x.isVisible()){var E=this.network.ki(x);E===null&&(E=this.network.Bl(x)),E.charge=this.defaultCommentElectricalCharge,x=null;for(var b=E.destinationEdges;b.next();){var z=b.value;if(z.toVertex===a){x=z;break}}if(x===null){for(b=E.sourceEdges;b.next();)if(z=b.value,z.fromVertex===a){x=z;break}}x===null&&(x=this.network.Zj(a,E,null)),x.length=this.defaultCommentSpringLength}}};function H1(a,y){var x=a.bounds,E=x.x;a=x.y;var b=x.width;x=x.height;var z=y.bounds,tt=z.x;y=z.y;var it=z.width;return z=z.height,E+b<tt?a>y+z?(x=E+b-tt,a=a-y-z,Gt.sqrt(x*x+a*a)):a+x<y?(E=E+b-tt,a=a+x-y,Gt.sqrt(E*E+a*a)):tt-(E+b):E>tt+it?a>y+z?(x=E-tt-it,a=a-y-z,Gt.sqrt(x*x+a*a)):a+x<y?(E=E-tt-it,a=a+x-y,Gt.sqrt(E*E+a*a)):E-(tt+it):a>y+z?a-(y+z):a+x<y?y-(a+x):.1}function W1(a,y){for(a.ah=null,y=a.An+y;a.An<y&&(a.An++,Kw(a)););a.ah=null}function Kw(a){a.ah===null&&(a.ah=a.network.vertexes.Fa());var y=a.ah;if(0>=y.length)return!1;var x=y[0];x.forceX=0,x.forceY=0;for(var E=x.centerX,b=E,z=x=x.centerY,tt=1;tt<y.length;tt++){var it=y[tt];it.forceX=0,it.forceY=0;var nt=it.centerX;it=it.centerY,E=Math.min(E,nt),b=Math.max(b,nt),x=Math.min(x,it),z=Math.max(z,it)}(b=b-E>z-x)?y.sort(function(xt,Tt){return xt===null||Tt===null||xt===Tt?0:xt.centerX-Tt.centerX}):y.sort(function(xt,Tt){return xt===null||Tt===null||xt===Tt?0:xt.centerY-Tt.centerY}),x=a.Zf;var ot=E=it=0;for(z=0;z<y.length;z++){tt=y[z],E=tt.bounds,it=tt.focus,nt=E.x+it.x;var st=E.y+it.y;E=tt.charge*a.electricalFieldX(nt,st),ot=tt.charge*a.electricalFieldY(nt,st),E+=tt.mass*a.gravitationalFieldX(nt,st),ot+=tt.mass*a.gravitationalFieldY(nt,st),tt.forceX+=E,tt.forceY+=ot;for(var ut=z+1;ut<y.length;ut++){var ct=y[ut];if(ct!==tt){E=ct.bounds,it=ct.focus,ot=E.x+it.x;var dt=E.y+it.y;if(nt-ot>x||ot-nt>x){if(b)break}else if(st-dt>x||dt-st>x){if(!b)break}else{var vt=H1(tt,ct);1>vt?(E=a.randomNumberGenerator,E===null&&(a.randomNumberGenerator=E=new xm),vt=E.random(),it=E.random(),nt>ot?(E=Math.abs(ct.bounds.right-tt.bounds.x),E=(1+E)*vt):nt<ot?(E=Math.abs(ct.bounds.x-tt.bounds.right),E=-(1+E)*vt):(E=Math.max(ct.width,tt.width),E=(1+E)*vt-E/2),st>dt?(ot=Math.abs(ct.bounds.bottom-tt.bounds.y),ot=(1+ot)*it):nt<ot?(ot=Math.abs(ct.bounds.y-tt.bounds.bottom),ot=-(1+ot)*it):(ot=Math.max(ct.height,tt.height),ot=(1+ot)*it-ot/2)):(it=-(tt.charge*ct.charge)/(vt*vt),E=(ot-nt)/vt*it,ot=(dt-st)/vt*it),tt.forceX+=E,tt.forceY+=ot,ct.forceX-=E,ct.forceY-=ot}}}}for(b=a.network.edges.iterator;b.next();)it=b.value,x=it.fromVertex,z=it.toVertex,tt=x.bounds,nt=x.focus,E=tt.x+nt.x,tt=tt.y+nt.y,st=z.bounds,ut=z.focus,nt=st.x+ut.x,st=st.y+ut.y,ut=H1(x,z),1>ut?(ut=a.randomNumberGenerator,ut===null&&(a.randomNumberGenerator=ut=new xm),it=ut.random(),ut=ut.random(),E=(E>nt?1:-1)*(1+(z.width>x.width?z.width:x.width))*it,ot=(tt>st?1:-1)*(1+(z.height>x.height?z.height:x.height))*ut):(it=it.stiffness*(ut-it.length),E=(nt-E)/ut*it,ot=(st-tt)/ut*it),x.forceX+=E,x.forceY+=ot,z.forceX-=E,z.forceY-=ot;for(b=E=0;b<y.length;b++)x=y[b],a.isFixed(x)?a.moveFixedVertex(x):E=Math.max(E,a.moveVertex(x)||0);return E>a.epsilonDistance*a.epsilonDistance}cs.prototype.moveVertex=function(a){var y=a.forceX,x=a.forceY,E=this.moveLimit;return y<-E?y=-E:y>E&&(y=E),x<-E?x=-E:x>E&&(x=E),a.centerX+=y,a.centerY+=x,y*y+x*x},cs.prototype.moveFixedVertex=function(){},cs.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.isRouting&&this.commitLinks()},cs.prototype.yv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var y=a.value.link;y!==null&&(y.fromSpot=Fi,y.toSpot=Fi)}},cs.prototype.commitNodes=function(){var a=0,y=0;if(this.arrangesToOrigin){var x=be.alloc();this.computeBounds(this.network,x),y=this.arrangementOrigin,a=y.x-x.x,y=y.y-x.y,be.free(x)}x=be.alloc();for(var E=this.network.vertexes.iterator;E.next();){var b=E.value;(a!==0||y!==0)&&(x.assign(b.bounds),x.x+=a,x.y+=y,b.bounds=x),b.commit()}be.free(x)},cs.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},cs.prototype.springStiffness=function(a){return a=a.stiffness,isNaN(a)?this.Hk:a},cs.prototype.springLength=function(a){return a=a.length,isNaN(a)?this.Gk:a},cs.prototype.electricalCharge=function(a){return a=a.charge,isNaN(a)?this.Ek:a},cs.prototype.electricalFieldX=function(){return 0},cs.prototype.electricalFieldY=function(){return 0},cs.prototype.gravitationalMass=function(a){return a=a.mass,isNaN(a)?this.Fk:a},cs.prototype.gravitationalFieldX=function(){return 0},cs.prototype.gravitationalFieldY=function(){return 0},cs.prototype.isFixed=function(a){return a.isFixed},zi.Object.defineProperties(cs.prototype,{currentIteration:{get:function(){return this.An}},arrangementSpacing:{get:function(){return this.$d},set:function(a){this.$d.D(a)||(this.$d.assign(a),this.C())}},arrangesToOrigin:{get:function(){return this.Bm},set:function(a){this.Bm!==a&&(this.Bm=a,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(a){this.sf!==a&&(this.sf=a,this.C())}},comments:{get:function(){return this.td},set:function(a){this.td!==a&&(this.td=a,this.C())}},maxIterations:{get:function(){return this.dl},set:function(a){this.dl!==a&&0<=a&&(this.dl=a,this.C())}},epsilonDistance:{get:function(){return this.$m},set:function(a){this.$m!==a&&0<a&&(this.$m=a,this.C())}},infinityDistance:{get:function(){return this.Zf},set:function(a){this.Zf!==a&&1<a&&(this.Zf=a,this.C())}},moveLimit:{get:function(){return this.In},set:function(a){this.In!==a&&1<a&&(this.In=a,this.C())}},randomNumberGenerator:{get:function(){return this.fo},set:function(a){this.fo!==a&&(a!==null&&typeof a.random!="function"&&It('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+a),this.fo=a)}},defaultSpringStiffness:{get:function(){return this.Hk},set:function(a){this.Hk!==a&&(this.Hk=a,this.C())}},defaultSpringLength:{get:function(){return this.Gk},set:function(a){this.Gk!==a&&(this.Gk=a,this.C())}},defaultElectricalCharge:{get:function(){return this.Ek},set:function(a){this.Ek!==a&&(this.Ek=a,this.C())}},defaultGravitationalMass:{get:function(){return this.Fk},set:function(a){this.Fk!==a&&(this.Fk=a,this.C())}},defaultCommentSpringLength:{get:function(){return this.Vm},set:function(a){this.Vm!==a&&(this.Vm=a,this.C())}},defaultCommentElectricalCharge:{get:function(){return this.Um},set:function(a){this.Um!==a&&(this.Um=a,this.C())}}}),cs.className="ForceDirectedLayout";function Z1(){this.Tv=this.Sv=this.Qs=this.Ss=this.Rs=0}Z1.className="ForceDirectedSubnet";function Lf(a){Ir.call(this,a)}Vi(Lf,Ir),Lf.prototype.createVertex=function(){return new vg(this)},Lf.prototype.createEdge=function(){return new mg(this)},Lf.className="ForceDirectedNetwork";function vg(a){Fo.call(this,a),this.ia=!1,this.Ha=this.u=NaN,this.sh=this.Vd=this.V=this.F=0,this.We=this.Hj=null,this.sv=0}Vi(vg,Fo),zi.Object.defineProperties(vg.prototype,{isFixed:{get:function(){return this.ia},set:function(a){this.ia!==a&&(this.ia=a)}},charge:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},mass:{get:function(){return this.Ha},set:function(a){this.Ha!==a&&(this.Ha=a)}},forceX:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}},forceY:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}}}),vg.className="ForceDirectedVertex";function mg(a){ma.call(this,a),this.j=this.o=NaN}Vi(mg,ma),zi.Object.defineProperties(mg.prototype,{stiffness:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a)}},length:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a)}}}),mg.className="ForceDirectedEdge";function xm(){var a=0;a===void 0&&(a=42),this.seed=a,this.ay=48271,this.ey=2147483647,this.Q=44488.07041494893,this.gy=3399,this.by=1/2147483647,this.random()}xm.prototype.random=function(){var a=this.seed%this.Q*this.ay-this.seed/this.Q*this.gy;return 0<a?this.seed=a:this.seed=a+this.ey,this.seed*this.by},xm.className="RandomNumberGenerator";function Er(a){Gr.call(this),this.kc=this.ie=25,this.K=0,this.Dk=Mm,this.Zk=Em,this.Qk=bm,this.bj=4,this.rk=Pm,this.bg=15,this.sf=!0,this.Cn=4,this.Ra=this.Iq=this.Ia=-1,this.Md=this.Hn=0,this.Ta=this.Kd=this.Ld=this.he=this.tc=null,this.Kn=0,this.Jn=this.kj=null,this.le=0,this.fl=null,this.Rf=new Pt,this.He=[],this.He.length=100,this.xw=this.ve=0,a&&Object.assign(this,a)}Vi(Er,Gr),Er.prototype.cloneProtected=function(a){Gr.prototype.cloneProtected.call(this,a),a.ie=this.ie,a.kc=this.kc,a.K=this.K,a.Dk=this.Dk,a.Zk=this.Zk,a.Qk=this.Qk,a.bj=this.bj,a.rk=this.rk,a.bg=this.bg,a.sf=this.sf,a.Cn=this.Cn,a.ve=this.ve},Er.prototype.qb=function(a){a.classType===Er?a.name.indexOf("Aggressive")===0?this.aggressiveOption=a:a.name.indexOf("Cycle")===0?this.cycleRemoveOption=a:a.name.indexOf("Init")===0?this.initializeOption=a:a.name.indexOf("Layer")===0?this.layeringOption=a:It("Unknown enum value: "+a):Gr.prototype.qb.call(this,a)},Er.prototype.createNetwork=function(){return new _d(this)},Er.prototype.doLayout=function(a){for(this.network===null&&(this.network=this.makeNetwork(a)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),this.Iq=-1,this.Md=this.Hn=0,this.fl=this.Jn=this.kj=null,a=0;a<this.He.length;a++)this.He[a]=null;if(0<this.network.vertexes.count){for(this.network.Ko(),this.cycleRemoveOption!==xg&&this.removeCycles(),a=this.network.vertexes.iterator;a.next();)a.value.layer=-1;for(this.Ia=-1,this.assignLayers(),a.reset();a.next();)this.Ia=Math.max(this.Ia,a.value.layer);this.cycleRemoveOption===xg&&this.removeCycles(),a=this.network;for(var y=[],x=a.edges.iterator;x.next();){var E=x.value;E.valid=!1,y.push(E)}for(x=0;x<y.length;x++){E=y[x];var b=E.fromVertex,z=E.toVertex;if(!(E.valid||(b.node===null&&b.data===null||z.node===null&&z.data===null)&&b.layer===z.layer)){var tt=0,it=0,nt=0,ot=0;if(E.link!==null){if(it=E.link,it===null)continue;var st=b.node;if(tt=z.node,st===null||tt===null)continue;var ut=it.fromNode;nt=it.toNode;for(var ct=it.fromPort;ct!==null&&!ct.Ed();)ct=ct.panel;for(it=it.toPort;it!==null&&!it.Ed();)it=it.panel;if(E.rev){ot=ut;var dt=ct;ut=nt,ct=it,nt=ot,it=dt}var vt=b.focus;ot=z.focus;var xt=E.rev?z.bounds:b.bounds;dt=Pt.alloc(),st!==ut?xt.w()&&ut.isVisible()?ut.actualBounds.w()?(uh(ut,ct,Hn,dt),dt.x+=ut.actualBounds.x-xt.x,dt.y+=ut.actualBounds.y-xt.y):(uh(ut,ct,Hn,dt),dt.w()||dt.assign(vt)):dt.assign(vt):xt.w()?(uh(ut,ct,Hn,dt),dt.w()||dt.assign(vt)):dt.assign(vt),ut=E.rev?b.bounds:z.bounds,st=Pt.alloc(),tt!==nt?ut.w()&&nt.isVisible()?nt.actualBounds.w()?(uh(nt,it,Hn,st),st.x+=nt.actualBounds.x-ut.x,st.y+=nt.actualBounds.y-ut.y):(uh(nt,it,Hn,st),st.w()||st.assign(ot)):st.assign(ot):ut.w()?(uh(nt,it,Hn,st),st.w()||st.assign(ot)):st.assign(ot),this.K===90||this.K===270?(tt=Math.round((dt.x-vt.x)/this.kc),nt=dt.x,it=Math.round((st.x-ot.x)/this.kc),ot=st.x):(tt=Math.round((dt.y-vt.y)/this.kc),nt=dt.y,it=Math.round((st.y-ot.y)/this.kc),ot=st.y),Pt.free(dt),Pt.free(st),E.portFromColOffset=tt,E.portFromPos=nt,E.portToColOffset=it,E.portToPos=ot}else E.portFromColOffset=0,E.portFromPos=0,E.portToColOffset=0,E.portToPos=0;if(dt=b.layer,st=z.layer,ut=0,xt=E.link,xt!==null){var Tt=xt.fromPort,Et=xt.toPort;if(Tt!==null&&Et!==null){var Ft=xt.fromNode;if(ct=xt.toNode,Ft!==null&&ct!==null){var Ot=km(this,!0),Rt=km(this,!1),Ht=this.setsPortSpots?Ot:xt.computeSpot(!0,Tt);vt=this.setsPortSpots?Rt:xt.computeSpot(!1,Et);var ae=xt.isOrthogonal;Ht.$c()&&Ht.Hf(Rt)&&vt.$c()&&vt.Hf(Ot)?ut=0:(Ot=xt.getLinkPoint(Ft,Tt,Ht,!0,ae,ct,Et,Pt.alloc()),Rt=xt.getLinkDirection(Ft,Tt,Ot,Ht,!0,ae,ct,Et),Pt.free(Ot),Ht.ys()||Rt!==$1(this,E,!0)?this.setsPortSpots&&Ft!==null&&Ft.ports.count===1&&E.rev&&(ut+=1):ut+=1,Ht=xt.getLinkPoint(ct,Et,vt,!1,ae,Ft,Tt,Pt.alloc()),xt=xt.getLinkDirection(ct,Et,Ht,vt,!1,ae,Ft,Tt),Pt.free(Ht),vt.ys()||xt!==$1(this,E,!1)?this.setsPortSpots&&ct!==null&&ct.ports.count===1&&E.rev&&(ut+=2):ut+=2)}}}if(ct=ut,ut=ct===1||ct===3,(ct=ct===2||ct===3)&&(vt=a.createVertex(),vt.node=null,vt.Dj=1,vt.layer=dt,vt.near=b,a.dh(vt),b=a.Zj(b,vt,E.link),b.valid=!1,b.rev=E.rev,b.portFromColOffset=tt,b.portToColOffset=0,b.portFromPos=nt,b.portToPos=0,b=vt),xt=1,ut&&xt--,dt-st>xt&&0<dt){for(E.valid=!1,vt=a.createVertex(),vt.node=null,vt.Dj=2,vt.layer=dt-1,a.dh(vt),b=a.Zj(b,vt,E.link),b.valid=!0,b.rev=E.rev,b.portFromColOffset=ct?0:tt,b.portToColOffset=0,b.portFromPos=ct?0:nt,b.portToPos=0,b=vt,dt--;dt-st>xt&&0<dt;)vt=a.createVertex(),vt.node=null,vt.Dj=3,vt.layer=dt-1,a.dh(vt),b=a.Zj(b,vt,E.link),b.valid=!0,b.rev=E.rev,b.portFromColOffset=0,b.portToColOffset=0,b.portFromPos=0,b.portToPos=0,b=vt,dt--;b=a.Zj(vt,z,E.link),b.valid=!ut,ut&&(vt.near=z),b.rev=E.rev,b.portFromColOffset=0,b.portToColOffset=it,b.portFromPos=0,b.portToPos=ot}else E.valid=!0}}for(a=this.tc=[],y=0;y<=this.Ia;y++)a[y]=0;for(y=this.network.vertexes.iterator;y.next();)y.value.index=-1;for(this.initializeIndices(),this.Iq=-1,x=this.Md=this.Hn=0;x<=this.Ia;x++)a[x]>a[this.Md]&&(this.Iq=a[x]-1,this.Md=x),a[x]<a[this.Hn]&&(this.Hn=x);for(this.fl=[],x=0;x<a.length;x++)this.fl[x]=[];for(y.reset();y.next();)a=y.value,this.fl[a.layer][a.index]=a;for(this.Ra=-1,a=0;a<=this.Ia;a++){for(y=ec(this,a),x=0,E=this.tc[a],z=0;z<E;z++)b=y[z],x+=this.nodeMinColumnSpace(b,!0),b.column=x,x+=1,x+=this.nodeMinColumnSpace(b,!1);this.Ra=Math.max(this.Ra,x-1),ic(this,a,y)}this.reduceCrossings(),this.straightenAndPack(),this.updateParts()}this.network=null,this.isValidLayout=!0},Er.prototype.linkMinLength=function(){return 1};function gy(a){var y=a.fromVertex.node||a.fromVertex.data;return a=a.toVertex.node||a.toVertex.data,y===null&&a===null?8:y===null||a===null?4:1}Er.prototype.nodeMinLayerSpace=function(a,y){return a.node===null&&a.data===null?0:this.K===90||this.K===270?y?a.focus.y+10:a.bounds.height-a.focus.y+10:y?a.focus.x+10:a.bounds.width-a.focus.x+10},Er.prototype.nodeMinColumnSpace=function(a,y){if(a.node===null&&a.data===null)return 0;var x=y?a.ev:a.dv;return x!==null?x:(x=this.K,x===90||x===270?y?a.ev=a.focus.x/this.kc+1|0:a.dv=(a.bounds.width-a.focus.x)/this.kc+1|0:y?a.ev=a.focus.y/this.kc+1|0:a.dv=(a.bounds.height-a.focus.y)/this.kc+1|0)};function qs(a){a.kj===null&&(a.kj=[]);for(var y=0,x=a.network.vertexes.iterator;x.next();){var E=x.value;a.kj[y]=E.layer,y++,a.kj[y]=E.column,y++,a.kj[y]=E.index,y++}return a.kj}function Ua(a,y){var x=0;for(a=a.network.vertexes.iterator;a.next();){var E=a.value;E.layer=y[x],x++,E.column=y[x],x++,E.index=y[x],x++}}function K1(a,y,x){var E=ec(a,y),b=a.tc[y];(a.Jn===null||a.Jn.length<b*b)&&(a.Jn=[]);for(var z=a.Jn,tt=0;tt<b;tt++){var it=0,nt=E[tt],ot=nt.near;if(ot!==null&&ot.layer===nt.layer)if(nt=ot.index,nt>tt)for(var st=tt+1;st<nt;st++){var ut=E[st];ut.near===ot&&ut.Dj===ot.Dj||it++}else for(st=tt-1;st>nt;st--)ut=E[st],ut.near===ot&&ut.Dj===ot.Dj||it++;var ct;if(0<=x)for(nt=E[tt].sourceEdgesArrayAccess,ot=0;ot<nt.length;ot++){var dt=nt[ot];if(dt.valid&&dt.fromVertex.layer!==y)for(ut=dt.fromVertex.index,st=dt.portToPos,dt=dt.portFromPos,ct=ot+1;ct<nt.length;ct++){var vt=nt[ct];if(vt.valid&&vt.fromVertex.layer!==y){var xt=vt.fromVertex.index,Tt=vt.portToPos;vt=vt.portFromPos,st<Tt&&(ut>xt||ut===xt&&dt>vt)&&it++,Tt<st&&(xt>ut||xt===ut&&vt>dt)&&it++}}}if(0>=x){for(nt=E[tt].destinationEdgesArrayAccess,ot=0;ot<nt.length;ot++)if(dt=nt[ot],dt.valid&&dt.toVertex.layer!==y)for(ut=dt.toVertex.index,st=dt.portToPos,dt=dt.portFromPos,ct=ot+1;ct<nt.length;ct++)vt=nt[ct],vt.valid&&vt.toVertex.layer!==y&&(xt=vt.toVertex.index,Tt=vt.portToPos,vt=vt.portFromPos,dt<vt&&(ut>xt||ut===xt&&st>Tt)&&it++,vt<dt&&(xt>ut||xt===ut&&Tt>st)&&it++)}for(z[tt*b+tt]=it,nt=tt+1;nt<b;nt++){var Et=0,Ft=0;if(0<=x){it=E[tt].sourceEdgesArrayAccess;var Ot=E[nt].sourceEdgesArrayAccess;for(ot=0;ot<it.length;ot++)if(dt=it[ot],dt.valid&&dt.fromVertex.layer!==y)for(ut=dt.fromVertex.index,dt=dt.portFromPos,ct=0;ct<Ot.length;ct++)vt=Ot[ct],vt.valid&&vt.fromVertex.layer!==y&&(xt=vt.fromVertex.index,vt=vt.portFromPos,(ut<xt||ut===xt&&dt<vt)&&Ft++,(xt<ut||xt===ut&&vt<dt)&&Et++)}if(0>=x){for(it=E[tt].destinationEdgesArrayAccess,Ot=E[nt].destinationEdgesArrayAccess,ot=0;ot<it.length;ot++)if(dt=it[ot],dt.valid&&dt.toVertex.layer!==y)for(ut=dt.toVertex.index,st=dt.portToPos,ct=0;ct<Ot.length;ct++)vt=Ot[ct],vt.valid&&vt.toVertex.layer!==y&&(xt=vt.toVertex.index,Tt=vt.portToPos,(ut<xt||ut===xt&&st<Tt)&&Ft++,(xt<ut||xt===ut&&Tt<st)&&Et++)}z[tt*b+nt]=Et,z[nt*b+tt]=Ft}}return ic(a,y,E),z}Er.prototype.countCrossings=function(){for(var a=0,y=0;y<=this.Ia;y++)for(var x=K1(this,y,1),E=this.tc[y],b=0;b<E;b++)for(var z=b;z<E;z++)a+=x[b*E+z];return a};function wm(a){for(var y=0,x=0;x<=a.Ia;x++){for(var E=a,b=x,z=ec(E,b),tt=E.tc[b],it=0,nt=0;nt<tt;nt++){var ot=z[nt].destinationEdgesArrayAccess;if(ot!==null)for(var st=0;st<ot.length;st++){var ut=ot[st];if(ut.valid&&ut.toVertex.layer!==b){var ct=ut.fromVertex.column+ut.portFromColOffset,dt=ut.toVertex.column+ut.portToColOffset;it+=(Math.abs(ct-dt)+1)*gy(ut)}}}ic(E,b,z),y+=it}return y}Er.prototype.normalize=function(){var a=1/0;this.Ra=-1;for(var y=this.network.vertexes.iterator;y.next();){var x=y.value;a=Math.min(a,x.column-this.nodeMinColumnSpace(x,!0)),this.Ra=Math.max(this.Ra,x.column+this.nodeMinColumnSpace(x,!1))}for(y.reset();y.next();)y.value.column-=a;this.Ra-=a};function vy(a,y,x){for(var E=ec(a,y),b=a.tc[y],z=[],tt=0;tt<b;tt++){var it=E[tt],nt=null;0>=x&&(nt=it.sourceEdgesArrayAccess);var ot=null;0<=x&&(ot=it.destinationEdgesArrayAccess);var st=0,ut=0,ct=it.near;if(ct!==null&&ct.layer===it.layer&&(st+=ct.column-1,ut++),nt!==null)for(ct=0;ct<nt.length;ct++){it=nt[ct];var dt=it.fromVertex;it.valid&&!it.rev&&dt.layer!==y&&(st+=dt.column,ut++)}if(ot!==null)for(nt=0;nt<ot.length;nt++)it=ot[nt],ct=it.toVertex,it.valid&&!it.rev&&ct.layer!==y&&(st+=ct.column,ut++);z[tt]=ut===0?-1:st/ut}return ic(a,y,E),z}function V1(a,y,x){for(var E=ec(a,y),b=a.tc[y],z=[],tt=0;tt<b;tt++){var it=E[tt],nt=null;0>=x&&(nt=it.sourceEdgesArrayAccess);var ot=null;0<=x&&(ot=it.destinationEdgesArrayAccess);var st=0,ut=[],ct=it.near;if(ct!==null&&ct.layer===it.layer&&(ut[st]=ct.column-1,st++),it=void 0,nt!==null)for(ct=0;ct<nt.length;ct++){it=nt[ct];var dt=it.fromVertex;it.valid&&!it.rev&&dt.layer!==y&&(ut[st]=dt.column+it.portFromColOffset,st++)}if(ot!==null)for(nt=0;nt<ot.length;nt++)it=ot[nt],ct=it.toVertex,it.valid&&!it.rev&&ct.layer!==y&&(ut[st]=ct.column+it.portToColOffset,st++);st===0?z[tt]=-1:(ut.sort(function(vt,xt){return vt-xt}),ot=st>>1,z[tt]=st&1?ut[ot]:ut[ot-1]+ut[ot]>>1)}return ic(a,y,E),z}function yg(a,y,x,E,b,z){if(y.component===E){if(y.component=x,b)for(var tt=y.destinationEdges;tt.next();){var it=tt.value,nt=it.toVertex,ot=y.layer-nt.layer;it=a.linkMinLength(it),ot===it&&yg(a,nt,x,E,b,z)}if(z)for(tt=y.sourceEdges;tt.next();)it=tt.value,nt=it.fromVertex,ot=nt.layer-y.layer,it=a.linkMinLength(it),ot===it&&yg(a,nt,x,E,b,z)}}function my(a,y,x,E,b,z){if(y.component===E){if(y.component=x,b)for(var tt=y.destinationEdges;tt.next();)my(a,tt.value.toVertex,x,E,b,z);if(z)for(y=y.sourceEdges;y.next();)my(a,y.value.fromVertex,x,E,b,z)}}Er.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.Dk){default:case wy:a=this.network;var y=0,x=a.vertexes.count-1,E=[];E.length=x+1;for(var b=a.vertexes.iterator;b.next();)b.value.valid=!0;for(;Vw(a)!==null;){for(b=G1(a);b!==null;)E[x]=b,x--,b.valid=!1,b=G1(a);for(b=U1(a);b!==null;)E[y]=b,y++,b.valid=!1,b=U1(a);b=null;for(var z=0,tt=this.network.vertexes.iterator;tt.next();){var it=tt.value;if(it.valid){for(var nt=0,ot=it.destinationEdges;ot.next();)ot.value.toVertex.valid&&nt++;ot=0;for(var st=it.sourceEdges;st.next();)st.value.fromVertex.valid&&ot++;(b===null||z<nt-ot)&&(b=it,z=nt-ot)}}b!==null&&(E[y]=b,y++,b.valid=!1)}for(y=0;y<a.vertexes.count;y++)E[y].index=y;for(E=a.edges.iterator;E.next();)y=E.value,y.fromVertex.index>y.toVertex.index&&(a.gm(y),y.rev=!0);break;case Mm:for(E=this.network.vertexes.iterator;E.next();)a=E.value,a.Ll=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;for(this.Kn=0,E.reset();E.next();)y=E.value,y.sourceEdges.count===0&&yy(this,y);for(E.reset();E.next();)y=E.value,y.Ll===-1&&yy(this,y);for(a.reset();a.next();)E=a.value,E.forest||(y=E.fromVertex,x=y.finish,b=E.toVertex,z=b.finish,b.Ll<y.Ll&&x<z&&(this.network.gm(E),E.rev=!0));break;case xg:for(a=this.network,y=a.vertexes.iterator,E=1/0;y.next();)E=Math.min(E,y.value.layer);if(1/0>E){if(0>E)for(y.reset();y.next();)y.value.layer-=E;for(E=[],y.reset();y.next();)x=y.value,b=E[x.layer],b===void 0?E[x.layer]=[x]:b.push(x);for(x=y=0;x<E.length;x++)if(b=E[x],!b||b.length===0)y++;else if(0<x)for(z=0;z<b.length;z++)b[z].layer-=y;for(E=a.edges.iterator;E.next();)y=E.value,y.fromVertex.layer<y.toVertex.layer&&(a.gm(y),y.rev=!0)}}};function Vw(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid)return y}return null}function G1(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid){for(var x=!0,E=y.destinationEdges;E.next();)if(E.value.toVertex.valid){x=!1;break}if(x)return y}}return null}function U1(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid){for(var x=!0,E=y.sourceEdges;E.next();)if(E.value.fromVertex.valid){x=!1;break}if(x)return y}}return null}function yy(a,y){y.Ll=a.Kn,a.Kn++;for(var x=y.destinationEdges;x.next();){var E=x.value,b=E.toVertex;b.Ll===-1&&(E.forest=!0,yy(a,b))}y.finish=a.Kn,a.Kn++}Er.prototype.assignLayers=function(){switch(this.Zk){case Sy:Y1(this);break;case Cy:for(var a,y=this.network.vertexes.iterator;y.next();)a=J1(this,y.value),this.Ia=Math.max(a,this.Ia);for(y.reset();y.next();)a=y.value,a.layer=this.Ia-a.layer;break;default:case Em:for(Y1(this),y=this.network.vertexes.iterator;y.next();)y.value.valid=!1;for(y.reset();y.next();)a=y.value,a.sourceEdges.count===0&&Q1(this,a);for(a=1/0,y.reset();y.next();)a=Math.min(a,y.value.layer);for(this.Ia=-1,y.reset();y.next();){var x=y.value;x.layer-=a,this.Ia=Math.max(this.Ia,x.layer)}}};function Y1(a){for(var y=a.network.vertexes.iterator;y.next();){var x=X1(a,y.value);a.Ia=Math.max(x,a.Ia)}}function X1(a,y){var x=0;if(y.layer===-1){for(var E=y.destinationEdges;E.next();){var b=E.value,z=b.toVertex;b=a.linkMinLength(b),x=Math.max(x,X1(a,z)+b)}y.layer=x}else x=y.layer;return x}function J1(a,y){var x=0;if(y.layer===-1){for(var E=y.sourceEdges;E.next();){var b=E.value,z=b.fromVertex;b=a.linkMinLength(b),x=Math.max(x,J1(a,z)+b)}y.layer=x}else x=y.layer;return x}function Q1(a,y){if(!y.valid){y.valid=!0;for(var x=y.destinationEdges;x.next();)Q1(a,x.value.toVertex);for(x=a.network.vertexes.iterator;x.next();)x.value.component=-1;for(var E=y.sourceEdgesArrayAccess,b=E.length,z=0;z<b;z++){var tt=E[z],it=tt.fromVertex,nt=tt.toVertex;tt=a.linkMinLength(tt),it.layer-nt.layer>tt&&yg(a,it,0,-1,!0,!1)}for(yg(a,y,1,-1,!0,!0);y.component!==0;){for(z=0,E=1/0,it=0,nt=null,tt=a.network.vertexes.iterator;tt.next();){var ot=tt.value;if(ot.component===1){var st=0,ut=!1,ct=ot.sourceEdgesArrayAccess;b=ct.length;for(var dt=0;dt<b;dt++){var vt=ct[dt],xt=vt.fromVertex;st+=1,xt.component!==1&&(z+=1,xt=xt.layer-ot.layer,vt=a.linkMinLength(vt),E=Math.min(E,xt-vt))}for(ct=ot.destinationEdgesArrayAccess,b=ct.length,dt=0;dt<b;dt++)vt=ct[dt].toVertex,--st,vt.component!==1?--z:ut=!0;(nt===null||st<it)&&!ut&&(nt=ot,it=st)}}if(0<z){for(x.reset();x.next();)b=x.value,b.component===1&&(b.layer+=E);y.component=0}else nt.component=0}for(x=a.network.vertexes.iterator;x.next();)x.value.component=-1;for(yg(a,y,1,-1,!0,!1);y.component!==0;){for(E=0,b=1/0,z=0,it=null,nt=a.network.vertexes.iterator;nt.next();)if(tt=nt.value,tt.component===1){for(ot=0,st=!1,ct=tt.sourceEdgesArrayAccess,ut=ct.length,dt=0;dt<ut;dt++)vt=ct[dt].fromVertex,ot+=1,vt.component!==1?E+=1:st=!0;for(ct=tt.destinationEdgesArrayAccess,ut=ct.length,dt=0;dt<ut;dt++)vt=ct[dt],xt=vt.toVertex,--ot,xt.component!==1&&(--E,xt=tt.layer-xt.layer,vt=a.linkMinLength(vt),b=Math.min(b,xt-vt));(it===null||ot>z)&&!st&&(it=tt,z=ot)}if(0>E){for(x.reset();x.next();)E=x.value,E.component===1&&(E.layer-=b);y.component=0}else it.component=0}}}function $1(a,y,x){return a.K===90?x&&!y.rev||!x&&y.rev?270:90:a.K===180?x&&!y.rev||!x&&y.rev?0:180:a.K===270?x&&!y.rev||!x&&y.rev?90:270:x&&!y.rev||!x&&y.rev?180:0}Er.prototype.initializeIndices=function(){switch(this.Qk){default:case My:for(var a=this.network.vertexes.iterator;a.next();){var y=a.value,x=y.layer;y.index=this.tc[x],this.tc[x]++}break;case bm:for(a=this.network.vertexes.iterator,y=this.Ia;0<=y;y--)for(a.reset();a.next();)x=a.value,x.layer===y&&x.index===-1&&q1(this,x);break;case ky:for(a=this.network.vertexes.iterator,y=0;y<=this.Ia;y++)for(a.reset();a.next();)x=a.value,x.layer===y&&x.index===-1&&tw(this,x)}};function q1(a,y){var x=y.layer;for(y.index=a.tc[x],a.tc[x]++,y=y.destinationEdgesArrayAccess,x=!0;x;){x=!1;for(var E=0;E<y.length-1;E++){var b=y[E],z=y[E+1];b.portFromColOffset>z.portFromColOffset&&(x=!0,y[E]=z,y[E+1]=b)}}for(x=0;x<y.length;x++)E=y[x],E.valid&&(E=E.toVertex,E.index===-1&&q1(a,E))}function tw(a,y){var x=y.layer;y.index=a.tc[x],a.tc[x]++,y=y.sourceEdgesArrayAccess;for(var E=!0;E;)for(E=!1,x=0;x<y.length-1;x++){var b=y[x],z=y[x+1];b.portToColOffset>z.portToColOffset&&(E=!0,y[x]=z,y[x+1]=b)}for(x=0;x<y.length;x++)E=y[x],E.valid&&(E=E.fromVertex,E.index===-1&&tw(a,E))}Er.prototype.reduceCrossings=function(){var a=this.countCrossings(),y=qs(this),x,E;for(x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)Sm(this,E,1),ol(this,E,1);var b=this.countCrossings();for(b<a&&(a=b,y=qs(this)),E=this.Ia;0<=E;E--)Sm(this,E,-1),ol(this,E,-1);b=this.countCrossings(),b<a&&(a=b,y=qs(this))}for(Ua(this,y),x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)Sm(this,E,0),ol(this,E,0);for(b=this.countCrossings(),b<a&&(a=b,y=qs(this)),E=this.Ia;0<=E;E--)Sm(this,E,0),ol(this,E,0);b=this.countCrossings(),b<a&&(a=b,y=qs(this))}Ua(this,y);var z,tt,it;switch(this.rk){case Ey:break;case by:for(it=a+1;(E=this.countCrossings())<it;)for(it=E,x=this.Ia;0<=x;x--)for(tt=0;tt<=x;tt++){for(z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=ol(this,E,-1)||z;for(b=this.countCrossings(),b>=a?Ua(this,y):(a=b,y=qs(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=ol(this,E,1)||z;for(b=this.countCrossings(),b>=a?Ua(this,y):(a=b,y=qs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=ol(this,E,1)||z;for(b>=a?Ua(this,y):(a=b,y=qs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=ol(this,E,-1)||z;for(b>=a?Ua(this,y):(a=b,y=qs(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=ol(this,E,0)||z;for(b>=a?Ua(this,y):(a=b,y=qs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=ol(this,E,0)||z;b>=a?Ua(this,y):(a=b,y=qs(this))}break;default:case Pm:for(x=this.Ia,tt=0,it=a+1;(E=this.countCrossings())<it;){for(it=E,z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=ol(this,E,-1)||z;for(b=this.countCrossings(),b>=a?Ua(this,y):(a=b,y=qs(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=ol(this,E,1)||z;for(b=this.countCrossings(),b>=a?Ua(this,y):(a=b,y=qs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=ol(this,E,1)||z;for(b>=a?Ua(this,y):(a=b,y=qs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=ol(this,E,-1)||z;for(b>=a?Ua(this,y):(a=b,y=qs(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=ol(this,E,0)||z;for(b>=a?Ua(this,y):(a=b,y=qs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=ol(this,E,0)||z;b>=a?Ua(this,y):(a=b,y=qs(this))}}Ua(this,y)};function Sm(a,y,x){var E=ec(a,y),b=a.tc[y],z=V1(a,y,x),tt=vy(a,y,x);for(x=0;x<b;x++)tt[x]===-1&&(tt[x]=E[x].column),z[x]===-1&&(z[x]=E[x].column);for(var it=!0,nt;it;)for(it=!1,x=0;x<b-1;x++)(z[x+1]<z[x]||z[x+1]===z[x]&&tt[x+1]<tt[x])&&(it=!0,nt=z[x],z[x]=z[x+1],z[x+1]=nt,nt=tt[x],tt[x]=tt[x+1],tt[x+1]=nt,nt=E[x],E[x]=E[x+1],E[x+1]=nt);for(x=z=0;x<b;x++)nt=E[x],nt.index=x,z+=a.nodeMinColumnSpace(nt,!0),nt.column=z,z+=1,z+=a.nodeMinColumnSpace(nt,!1);ic(a,y,E)}function ol(a,y,x){var E=ec(a,y),b=a.tc[y];x=K1(a,y,x);var z,tt=[];for(z=0;z<b;z++)tt[z]=-1;var it=[];for(z=0;z<b;z++)it[z]=-1;for(var nt=!1,ot=!0;ot;)for(ot=!1,z=0;z<b-1;z++){var st=x[E[z].index*b+E[z+1].index],ut=x[E[z+1].index*b+E[z].index],ct=0,dt=0,vt=E[z].column,xt=E[z+1].column,Tt=a.nodeMinColumnSpace(E[z],!0),Et=a.nodeMinColumnSpace(E[z],!1),Ft=a.nodeMinColumnSpace(E[z+1],!0),Ot=a.nodeMinColumnSpace(E[z+1],!1);Tt=vt-Tt+Ft,Et=xt-Et+Ot;var Rt=E[z].sourceEdges.iterator;for(Rt.reset();Rt.next();)if(Ft=Rt.value,Ot=Ft.fromVertex,Ft.valid&&Ot.layer===y){for(Ft=0;E[Ft]!==Ot;)Ft++;Ft<z&&(ct+=2*(z-Ft),dt+=2*(z+1-Ft)),Ft===z+1&&(ct+=1),Ft>z+1&&(ct+=4*(Ft-z),dt+=4*(Ft-(z+1)))}for(Rt=E[z].destinationEdges.iterator,Rt.reset();Rt.next();)if(Ft=Rt.value,Ot=Ft.toVertex,Ft.valid&&Ot.layer===y){for(Ft=0;E[Ft]!==Ot;)Ft++;Ft===z+1&&(dt+=1)}for(Rt=E[z+1].sourceEdges.iterator,Rt.reset();Rt.next();)if(Ft=Rt.value,Ot=Ft.fromVertex,Ft.valid&&Ot.layer===y){for(Ft=0;E[Ft]!==Ot;)Ft++;Ft<z&&(ct+=2*(z+1-Ft),dt+=2*(z-Ft)),Ft===z&&(dt+=1),Ft>z+1&&(ct+=4*(Ft-(z+1)),dt+=4*(Ft-z))}for(Rt=E[z+1].destinationEdges.iterator,Rt.reset();Rt.next();)if(Ft=Rt.value,Ot=Ft.toVertex,Ft.valid&&Ot.layer===y){for(Ft=0;E[Ft]!==Ot;)Ft++;Ft===z&&(ct+=1)}Ft=Ot=0,Rt=tt[E[z].index];var Ht=it[E[z].index],ae=tt[E[z+1].index],wi=it[E[z+1].index];Rt!==-1&&(Ot+=Math.abs(Rt-vt),Ft+=Math.abs(Rt-Et)),Ht!==-1&&(Ot+=Math.abs(Ht-vt),Ft+=Math.abs(Ht-Et)),ae!==-1&&(Ot+=Math.abs(ae-xt),Ft+=Math.abs(ae-Tt)),wi!==-1&&(Ot+=Math.abs(wi-xt),Ft+=Math.abs(wi-Tt)),(dt<ct-.5||dt===ct&&ut<st-.5||dt===ct&&ut===st&&Ft<Ot-.5)&&(ot=nt=!0,E[z].column=Et,E[z+1].column=Tt,st=E[z],E[z]=E[z+1],E[z+1]=st)}for(z=0;z<b;z++)E[z].index=z;return ic(a,y,E),nt}Er.prototype.straightenAndPack=function(){if(this.ve===0){var a=(this.bg&1)!==0,y=(this.bg&qw)!==0;if(1e3<this.network.edges.count&&y&&(a=!1),a){var x=[];for(y=0;y<=this.Ia;y++)x[y]=0;for(var E,b=this.network.vertexes.iterator;b.next();){var z=b.value;y=z.layer,E=z.column,z=this.nodeMinColumnSpace(z,!1),x[y]=Math.max(x[y],E+z)}for(b.reset();b.next();)z=b.value,y=z.layer,E=z.column,z.column=(8*(this.Ra-x[y])>>1)+8*E;this.Ra*=8}if(this.bg&2)for(x=!0;x;){for(x=!1,y=this.Md+1;y<=this.Ia;y++)x=zd(this,y,1)||x;for(y=this.Md-1;0<=y;y--)x=zd(this,y,-1)||x;x=zd(this,this.Md,0)||x}if(this.bg&4){for(y=this.Md+1;y<=this.Ia;y++)xy(this,y,1);for(y=this.Md-1;0<=y;y--)xy(this,y,-1);xy(this,this.Md,0)}if(a&&(ew(this,-1),ew(this,1)),this.bg&2)for(x=!0;x;){for(x=!1,x=zd(this,this.Md,0)||x,y=this.Md+1;y<=this.Ia;y++)x=zd(this,y,0)||x;for(y=this.Md-1;0<=y;y--)x=zd(this,y,0)||x}}else Xw(this)};function zd(a,y,x){for(var E=!1;Gw(a,y,x);)E=!0;return E}function Gw(a,y,x){var E,b=ec(a,y),z=a.tc[y],tt=vy(a,y,-1);if(0<x)for(E=0;E<z;E++)tt[E]=-1;var it=vy(a,y,1);if(0>x)for(E=0;E<z;E++)it[E]=-1;for(var nt=!1,ot=!0;ot;)for(ot=!1,E=0;E<z;E++){var st=b[E].column,ut=a.nodeMinColumnSpace(b[E],!0),ct=a.nodeMinColumnSpace(b[E],!1),dt=0;0>E-1||st-b[E-1].column-1>ut+a.nodeMinColumnSpace(b[E-1],!1)?dt=st-1:dt=st,ut=E+1>=z||b[E+1].column-st-1>ct+a.nodeMinColumnSpace(b[E+1],!0)?st+1:st;var vt=ct=0,xt=0;if(0>=x)for(var Tt=b[E].sourceEdges.iterator;Tt.next();){var Et=Tt.value,Ft=Et.fromVertex;if(Et.valid&&Ft.layer!==y){var Ot=gy(Et),Rt=Et.portFromColOffset;Et=Et.portToColOffset,Ft=Ft.column,ct+=(Math.abs(st+Et-(Ft+Rt))+1)*Ot,vt+=(Math.abs(dt+Et-(Ft+Rt))+1)*Ot,xt+=(Math.abs(ut+Et-(Ft+Rt))+1)*Ot}}if(0<=x)for(Tt=b[E].destinationEdges.iterator;Tt.next();)Et=Tt.value,Ft=Et.toVertex,Et.valid&&Ft.layer!==y&&(Ot=gy(Et),Rt=Et.portFromColOffset,Et=Et.portToColOffset,Ft=Ft.column,ct+=(Math.abs(st+Rt-(Ft+Et))+1)*Ot,vt+=(Math.abs(dt+Rt-(Ft+Et))+1)*Ot,xt+=(Math.abs(ut+Rt-(Ft+Et))+1)*Ot);Et=Rt=Ot=0,Tt=tt[b[E].index],Ft=it[b[E].index],Tt!==-1&&(Ot+=Math.abs(Tt-st),Rt+=Math.abs(Tt-dt),Et+=Math.abs(Tt-ut)),Ft!==-1&&(Ot+=Math.abs(Ft-st),Rt+=Math.abs(Ft-dt),Et+=Math.abs(Ft-ut)),vt<ct||vt===ct&&Rt<Ot?(ot=nt=!0,b[E].column=dt):(xt<ct||xt===ct&&Et<Ot)&&(ot=nt=!0,b[E].column=ut)}return ic(a,y,b),a.normalize(),nt}function xy(a,y,x){var E=ec(a,y),b=a.tc[y],z=V1(a,y,x),tt=[];for(x=0;x<b;x++)tt[x]=z[x];for(z=!0;z;)for(z=!1,x=0;x<b;x++){var it=E[x].column,nt=a.nodeMinColumnSpace(E[x],!0),ot=a.nodeMinColumnSpace(E[x],!1),st=0;if(tt[x]===-1)if(x===0&&x===b-1)st=it;else if(x===0){var ut=E[x+1].column;ut-it===ot+a.nodeMinColumnSpace(E[x+1],!0)?st=it-1:st=it}else x===b-1?(ut=E[x-1].column,st=it-ut===nt+a.nodeMinColumnSpace(E[x-1],!1)?it+1:it):(ut=E[x-1].column,nt=ut+a.nodeMinColumnSpace(E[x-1],!1)+nt+1,ut=E[x+1].column,ot=ut-a.nodeMinColumnSpace(E[x+1],!0)-ot-1,st=(nt+ot)/2|0);else x===0&&x===b-1?st=tt[x]:x===0?(ut=E[x+1].column,ot=ut-a.nodeMinColumnSpace(E[x+1],!0)-ot-1,st=Math.min(tt[x],ot)):x===b-1?(ut=E[x-1].column,nt=ut+a.nodeMinColumnSpace(E[x-1],!1)+nt+1,st=Math.max(tt[x],nt)):(ut=E[x-1].column,nt=ut+a.nodeMinColumnSpace(E[x-1],!1)+nt+1,ut=E[x+1].column,ot=ut-a.nodeMinColumnSpace(E[x+1],!0)-ot-1,nt<tt[x]&&tt[x]<ot?st=tt[x]:nt>=tt[x]?st=nt:ot<=tt[x]&&(st=ot));st!==it&&(z=!0,E[x].column=st)}ic(a,y,E),a.normalize()}function Uw(a,y){for(var x=!0,E=a.network.vertexes.iterator;E.next();){var b=E.value,z=a.nodeMinColumnSpace(b,!0),tt=a.nodeMinColumnSpace(b,!1);if(b.column-z<=y&&b.column+tt>=y){x=!1;break}}if(a=!1,x)for(E.reset();E.next();)x=E.value,x.column>y&&(--x.column,a=!0);return a}function Yw(a,y){var x=y+1,E,b=[],z=[];for(E=0;E<=a.Ia;E++)b[E]=!1,z[E]=!1;for(var tt=a.network.vertexes.iterator;tt.next();){E=tt.value;var it=E.column-a.nodeMinColumnSpace(E,!0),nt=E.column+a.nodeMinColumnSpace(E,!1);it<=y&&nt>=y&&(b[E.layer]=!0),it<=x&&nt>=x&&(z[E.layer]=!0)}for(it=!0,x=!1,E=0;E<=a.Ia;E++)it=it&&!(b[E]&&z[E]);if(it)for(tt.reset();tt.next();)a=tt.value,a.column>y&&(--a.column,x=!0);return x}function ew(a,y){for(var x=0;x<=a.Ra;x++)for(;Uw(a,x););for(a.normalize(),x=0;x<a.Ra;x++)for(;Yw(a,x););a.normalize();var E;if(0<y)for(x=0;x<=a.Ra;x++){var b=qs(a),z=wm(a);for(E=z+1;z<E;){E=z,iw(a,x,1);var tt=wm(a);tt>z?Ua(a,b):tt<z&&(z=tt,b=qs(a))}}if(0>y)for(x=a.Ra;0<=x;x--)for(b=qs(a),z=wm(a),E=z+1;z<E;)E=z,iw(a,x,-1),tt=wm(a),tt>z?Ua(a,b):tt<z&&(z=tt,b=qs(a));a.normalize()}function iw(a,y,x){a.le=0;for(var E=a.network.vertexes.iterator;E.next();)E.value.component=-1;if(0<x)for(E.reset();E.next();){var b=E.value;b.column-a.nodeMinColumnSpace(b,!0)<=y&&(b.component=a.le)}if(0>x)for(E.reset();E.next();)b=E.value,b.column+a.nodeMinColumnSpace(b,!1)>=y&&(b.component=a.le);for(a.le++,E.reset();E.next();)y=E.value,y.component===-1&&(my(a,y,a.le,-1,!0,!0),a.le++);var z;for(y=[],z=0;z<a.le*a.le;z++)y[z]=!1;for(b=[],z=0;z<(a.Ia+1)*(a.Ra+1);z++)b[z]=-1;for(E.reset();E.next();){z=E.value;for(var tt=z.layer,it=Math.max(0,z.column-a.nodeMinColumnSpace(z,!0)),nt=Math.min(a.Ra,z.column+a.nodeMinColumnSpace(z,!1));it<=nt;it++)b[tt*(a.Ra+1)+it]=z.component}for(z=0;z<=a.Ia;z++){if(0<x)for(tt=0;tt<a.Ra;tt++)b[z*(a.Ra+1)+tt]!==-1&&b[z*(a.Ra+1)+tt+1]!==-1&&b[z*(a.Ra+1)+tt]!==b[z*(a.Ra+1)+tt+1]&&(y[b[z*(a.Ra+1)+tt]*a.le+b[z*(a.Ra+1)+tt+1]]=!0);if(0>x)for(tt=a.Ra;0<tt;tt--)b[z*(a.Ra+1)+tt]!==-1&&b[z*(a.Ra+1)+tt-1]!==-1&&b[z*(a.Ra+1)+tt]!==b[z*(a.Ra+1)+tt-1]&&(y[b[z*(a.Ra+1)+tt]*a.le+b[z*(a.Ra+1)+tt-1]]=!0)}for(b=[],z=0;z<a.le;z++)b[z]=!0;for(tt=[],tt.push(0);tt.length!==0;)if(nt=tt[tt.length-1],tt.pop(),b[nt])for(b[nt]=!1,z=0;z<a.le;z++)y[nt*a.le+z]&&tt.splice(0,0,z);if(0<x)for(E.reset();E.next();)a=E.value,b[a.component]&&--a.column;if(0>x)for(E.reset();E.next();)x=E.value,b[x.component]&&(x.column+=1)}function Xw(a){for(var y=ii(),x=a.fl.length,E=0;E<=x;E++)y[E]=[];for(E=a.network.vertexes.iterator;E.next();){var b=E.value;y[x-b.layer][b.index]=b}x=new _e,Jw(y,x);var z=null,tt=null,it=null,nt=null,ot=(a.ve&1)!==0,st=(a.ve&2)!==0,ut=(a.ve&4)!==0,ct=(a.ve&8)!==0;for(ot&&(a.verticalAlignment(y,x,!0),z=Cm(a,y,!0,!1)),y.reverse(),ut&&(a.verticalAlignment(y,x,!1),it=Cm(a,y,!1,!1)),E=on(y),b=E.next();!b.done;b=E.next())b.value.reverse();ct&&(a.verticalAlignment(y,x,!1),nt=Cm(a,y,!1,!0)),y.reverse(),st&&(a.verticalAlignment(y,x,!0),tt=Cm(a,y,!0,!0)),Hi(y),a.u(z,tt,it,nt),a.network.vertexes.each(function(dt){var vt=ii();ot&&vt.push(z.get(dt)),st&&vt.push(tt.get(dt)),ut&&vt.push(it.get(dt)),ct&&vt.push(nt.get(dt)),vt.sort(function(Tt,Et){return Tt-Et});var xt=vt.length;xt=(vt[Math.floor((xt-1)/2)]+vt[Math.ceil((xt-1)/2)])/2,Hi(vt),dt.zc=xt})}function Jw(a,y){for(var x=a.length,E=1;E<x-1;E++)for(var b=0,z=0,tt=a[E],it=a[E+1],nt=0;z<it.length;nt++){var ot=it[nt];t:{if(ot.node===null){var st=Py(ot);if(0<st.length){st=st[0].node===null;break t}}st=!1}var ut=st;if(nt===it.length-1||ut){for(st=tt.length-1,ut&&(st=Py(ot)[0].index);z<=nt;){if(ot=it[z],!ot.bo){ut=[];for(var ct=on(ot.sourceEdgesArrayAccess),dt=ct.next();!dt.done;dt=ct.next())dt=dt.value,dt.valid&&ut.push(dt);ot.bo=ut}for(ot=on(ot.bo),ut=ot.next();!ut.done;ut=ot.next())ut=ut.value,ct=ut.fromVertex.index,(ct<b||ct>st)&&y.add(ut);z++}b=st}}}Er.prototype.verticalAlignment=function(a,y,x){Qw(a),a=on(a);for(var E=a.next();!E.done;E=a.next()){var b=-1;E=on(E.value);for(var z=E.next();!z.done;z=E.next()){z=z.value;var tt=x?Py(z):tS(z),it=tt.length;if(0<it){tt.sort(function(ut,ct){return ut.vi-ct.vi});var nt=(it-1)/2;for(it=Math.floor(nt),nt=Math.ceil(nt);it<=nt;it++)if(z.align===z){var ot=tt[it],st=void 0;st=x?Nm(ot,z):Nm(z,ot),!y.contains(st)&&b<ot.vi&&(ot.align=z,z.root=ot.root,z.align=ot.root,b=ot.vi)}}}}};function Qw(a){for(var y=0;y<a.length;y++)for(var x=a[y],E=0;E<x.length;E++){var b=x[E];b.root=b,b.align=b,b.Tz=y,b.vi=E}}function Cm(a,y,x,E){for(var b=a.K===90||a.K===270,z=on(y),tt=z.next();!tt.done;tt=z.next()){var it=on(tt.value);for(tt=it.next();!tt.done;tt=it.next())tt=tt.value,tt.sd=tt,tt.shift=1/0,tt.zc=NaN,tt.qg=0}for(tt=a.K===90||a.K===270,z=on(y),it=z.next();!it.done;it=z.next()){it=on(it.value);for(var nt=it.next();!nt.done;nt=it.next())if(nt=nt.value,nt.root===nt){for(var ot=0,st=nt;st.align!==nt;){var ut=st.align,ct=tt?st.width:st.height,dt=tt?ut.width:ut.height;if(x){var vt=Nm(st,ut),xt=vt.portFromPos,Tt=vt.portToPos;vt.link!==null&&(st.node&&st.node!==vt.link.fromNode&&(xt=tt?st.focusX:st.focusY),ut.node&&ut.node!==vt.link.toNode&&(Tt=tt?ut.focusX:ut.focusY))}else vt=Nm(ut,st),xt=vt.portToPos,Tt=vt.portFromPos,vt.link!==null&&(st.node&&st.node!==vt.link.toNode&&(xt=tt?st.focusX:st.focusY),ut.node&&ut.node!==vt.link.fromNode&&(Tt=tt?ut.focusX:ut.focusY));ct=E?st.qg+(ct-xt)-(dt-Tt):st.qg+xt-Tt,ut.qg=ct,ot=Math.min(ot,ct),st=st.align}st=nt;do st.qg=st.qg-ot,st=st.align;while(st!==nt)}}for(x=on(y),tt=x.next();!tt.done;tt=x.next())for(z=on(tt.value),tt=z.next();!tt.done;tt=z.next())tt=tt.value,tt.root===tt&&nw(a,tt,y);for(x=0;x<y.length;x++)if(!(0>=y[x].length)&&(tt=y[x][0],tt.sd===tt)){tt.sd.shift===1/0&&(tt.sd.shift=0),tt=x,it=0;do{for(z=y[tt][it];z.align!==z.root;)z=z.align,tt++,0<z.vi&&(it=rw(z,y),it.sd.shift=Math.min(it.sd.shift,z.sd.shift+z.zc+z.qg-(it.zc+it.qg+(b?it.width:it.height)+a.columnSpacing)));it=z.vi+1}while(tt<y.length&&it<y[tt].length&&z.sd===y[tt][it].sd)}for(a=new ji,y=on(y),tt=y.next();!tt.done;tt=y.next())for(x=on(tt.value),tt=x.next();!tt.done;tt=x.next())tt=tt.value,tt.zc=tt.zc+tt.sd.shift+tt.qg,z=b?tt.width:tt.height,a.add(tt,E?-tt.zc-z:tt.zc);return a}function nw(a,y,x){if(isNaN(y.zc)){y.zc=0;var E=y;do{if(0<E.vi){var b=rw(E,x),z=b.root;nw(a,z,x),y.sd===y&&(y.sd=z.sd);var tt=a.K===90||a.K===270?b.width:b.height;y.sd===z.sd&&(y.zc=Math.max(y.zc,z.zc+b.qg+tt-E.qg+a.columnSpacing))}E=E.align}while(E!==y);for(;E.align!==y;)E=E.align,E.zc=y.zc,E.sd=y.sd}}function rw(a,y){var x=a.Tz;return a=a.vi,1>a&&It("Could not determine previous vertex in layer"),y[x][a-1]}Er.prototype.u=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];x=-1;for(var E=ii(),b=ii(),z=1/0,tt=0;4>tt;tt++)if(y[tt]){var it=$w(this,y[tt],E,b,tt);it<z&&(x=tt,z=it)}for(z={},tt=0;4>tt;z={delta:z.delta},tt++)y[tt]&&(z.delta=tt===0||tt===2?E[x]-E[tt]:b[x]-b[tt],z.delta!==0&&y[tt].each(function(nt){return function(ot){ot.value+=nt.delta}}(z)));Hi(E),Hi(b)};function $w(a,y,x,E,b){if(!y||y.count===0)return x[b]=0,E[b]=0,1/0;var z=1/0,tt=-1/0;return y.each(function(it){var nt=it.key;it=it.value,nt=a.K===90||a.K===270?nt.width:nt.height,it<z&&(z=it),it+nt>tt&&(tt=it+nt)}),x[b]=z,E[b]=tt,tt-z}Er.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=km(this,!0),y=km(this,!1),x=this.network.edges.iterator;x.next();){var E=x.value.link;E!==null&&(E.fromSpot=a,E.toSpot=y)}this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()};function km(a,y){return a.K===270?y?ro:Uo:a.K===90?y?Uo:ro:a.K===180?y?Ro:jo:y?jo:Ro}Er.prototype.commitNodes=function(){this.he=[],this.Ld=[],this.Kd=[],this.Ta=[];for(var a=0;a<=this.Ia;a++)this.he[a]=0,this.Ld[a]=0,this.Kd[a]=0,this.Ta[a]=0;for(a=this.network.vertexes.iterator;a.next();){var y=a.value,x=y.layer;this.he[x]=Math.max(this.he[x],this.nodeMinLayerSpace(y,!0)),this.Ld[x]=Math.max(this.Ld[x],this.nodeMinLayerSpace(y,!1))}y=0,x=this.ie;for(var E=0;E<=this.Ia;E++){var b=x;0>=this.he[E]+this.Ld[E]&&(b=0),0<E&&(y+=b/2),this.K===90||this.K===0?(y+=this.Ld[E],this.Kd[E]=y,y+=this.he[E]):(y+=this.he[E],this.Kd[E]=y,y+=this.Ld[E]),E<this.Ia&&(y+=b/2),this.Ta[E]=y}for(x=y,y=this.arrangementOrigin,E=0;E<=this.Ia;E++)this.K===270?this.Kd[E]=y.y+this.Kd[E]:this.K===90?(this.Kd[E]=y.y+x-this.Kd[E],this.Ta[E]=x-this.Ta[E]):this.K===180?this.Kd[E]=y.x+this.Kd[E]:(this.Kd[E]=y.x+x-this.Kd[E],this.Ta[E]=x-this.Ta[E]);x=this.ve!==0,a.reset(),E=this.K===270||this.K===90;for(var z=1/0,tt=b=1/0,it=-1/0;a.next();){var nt=a.value,ot=nt.layer,st=nt.column|0;E?(tt=y.x+this.kc*st,ot=this.Kd[ot]):(tt=this.Kd[ot],ot=y.y+this.kc*st),nt.centerX=tt,nt.centerY=ot,x&&isFinite(nt.zc)&&(E?nt.node?nt.x=y.x+nt.zc:nt.centerX=y.x+nt.zc:nt.node?nt.y=y.y+nt.zc:nt.centerY=y.y+nt.zc),z=Math.min(nt.x,z),b=Math.min(nt.y,b),E?(tt=z,it=Math.max(it,nt.bounds.right)):(tt=b,it=Math.max(it,nt.bounds.bottom))}for(this.xw=it-tt,z=y.x-z,y=y.y-b,this.Rf=new Pt(x&&E?0:z,x&&!E?0:y),a.reset();a.next();)x=a.value,x.x+=z,x.y+=y,x.commit()},Er.prototype.Gu=function(){for(var a=0,y=this.ie,x=0;x<=this.Ia;x++)a+=this.he[x],a+=this.Ld[x];a+=this.Ia*y,y=[],x=this.ve!==0?this.xw:this.kc*this.Ra;for(var E=this.maxLayer;0<=E;E--)this.K===270?E===0?y.push(new be(0,0,x,Math.abs(this.Ta[0]))):y.push(new be(0,this.Ta[E-1],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===90?E===0?y.push(new be(0,this.Ta[0],x,Math.abs(this.Ta[0]-a))):y.push(new be(0,this.Ta[E],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===180?E===0?y.push(new be(0,0,Math.abs(this.Ta[0]),x)):y.push(new be(this.Ta[E-1],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x)):E===0?y.push(new be(this.Ta[0],0,Math.abs(this.Ta[0]-a),x)):y.push(new be(this.Ta[E],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x));this.commitLayers(y,this.Rf)},Er.prototype.commitLayers=function(){},Er.prototype.commitLinks=function(){for(var a=this.network.edges.iterator,y;a.next();)y=a.value.link,y!==null&&(y.uh(),y.Fj(),y.zf());for(a.reset();a.next();)y=a.value.link,y!==null&&y.vg();for(a.reset();a.next();){var x=a.value;if(y=x.link,y!==null){y.uh();var E=y,b=E.fromNode,z=E.toNode,tt=E.fromPort,it=E.toPort;if(b!==null){var nt=b.findVisibleNode();nt!==null&&nt!==b&&(b=nt,tt=nt.port)}z!==null&&(nt=z.findVisibleNode(),nt!==null&&nt!==z&&(z=nt,it=nt.port));var ot=y.computeSpot(!0,tt);nt=y.computeSpot(!1,it);var st=x.fromVertex,ut=x.toVertex;if(x.valid)y.curve===Aa&&y.pointsCount===4&&(st.column===ut.column&&this.alignOption===0?(x=y.getLinkPoint(b,tt,ot,!0,!1,z,it),it=y.getLinkPoint(z,it,nt,!1,!1,b,tt),x.w()||x.set(b.actualBounds.center),it.w()||it.set(z.actualBounds.center),y.Fj(),y.yf(x.x,x.y),y.yf((2*x.x+it.x)/3,(2*x.y+it.y)/3),y.yf((x.x+2*it.x)/3,(x.y+2*it.y)/3),y.yf(it.x,it.y)):(x=E=!1,tt!==null&&ot===Jn&&(E=!0),it!==null&&nt===Jn&&(x=!0),(E||x)&&(nt=null,E&&(nt=y.getLinkPointFromPoint(b,tt,tt.ga(Hn),y.i(3),!0),nt.w()||nt.set(b.actualBounds.center),y.L(0,nt.x,nt.y)),b=null,x&&(b=y.getLinkPointFromPoint(z,it,it.ga(Hn),y.i(0),!1),b.w()||b.set(z.actualBounds.center),y.L(3,b.x,b.y)),nt&&(z=y.i(2),y.L(1,(2*nt.x+z.x)/3,(2*nt.y+z.y)/3)),b&&(z=y.i(1),y.L(2,(2*b.x+z.x)/3,(2*b.y+z.y)/3))))),y.zf();else if(st.layer===ut.layer)y.zf();else{var ct=!1,dt=!1,vt=this.ie,xt=y.firstPickIndex+1;if(y.isOrthogonal){dt=!0;var Tt=y.pointsCount;4<Tt&&y.points.removeRange(2,Tt-3)}else if(y.curve===Aa)ct=!0,Tt=y.pointsCount,4<Tt&&y.points.removeRange(2,Tt-3),Tt===4&&(xt=2);else{Tt=y.pointsCount;var Et=ot===Jn,Ft=nt===Jn;2<Tt&&Et&&Ft?y.points.removeRange(1,Tt-2):3<Tt&&Et&&!Ft?y.points.removeRange(1,Tt-3):3<Tt&&!Et&&Ft?y.points.removeRange(2,Tt-2):4<Tt&&!Et&&!Ft&&y.points.removeRange(2,Tt-3)}if(x.rev){for(;ut!==null&&st!==ut;){var Ot=Tt=null;for(Et=ut.sourceEdges.iterator;Et.next()&&(Ft=Et.value,Ft.link!==x.link||(Tt=Ft.fromVertex,Ot=Ft.toVertex,Tt.node!==null)););if(Tt===null)break;if(Tt!==st){Et=y.i(xt-1).x,Ft=y.i(xt-1).y;var Rt=Tt.centerX,Ht=Tt.centerY;if(dt)this.K===180||this.K===0?xt===y.firstPickIndex+1?(y.m(xt++,Et,Ft),y.m(xt++,Et,Ht)):(Ot!==null?Ot.centerY:Ft)!==Ht&&(Ot=this.Ta[Tt.layer-1]+this.Rf.x,y.m(xt++,Ot,Ft),y.m(xt++,Ot,Ht)):xt===y.firstPickIndex+1?(y.m(xt++,Et,Ft),y.m(xt++,Rt,Ft)):(Ot!==null?Ot.centerX:Et)!==Rt&&(Ot=this.Ta[Tt.layer-1]+this.Rf.y,y.m(xt++,Et,Ot),y.m(xt++,Rt,Ot));else if(xt===y.firstPickIndex+1){Ot=Math.max(10,this.he[ut.layer]);var ae=Math.max(10,this.Ld[ut.layer]);if(ct)this.K===180?Rt<=ut.bounds.x?(ut=ut.bounds.x,y.m(xt++,ut-Ot,Ht),y.m(xt++,ut,Ht),y.m(xt++,ut+ae,Ht)):(y.m(xt++,Rt-Ot,Ht),y.m(xt++,Rt,Ht),y.m(xt++,Rt+ae,Ht)):this.K===90?Ht>=ut.bounds.bottom?(ut=ut.bounds.y+ut.bounds.height,y.m(xt++,Rt,ut+ae),y.m(xt++,Rt,ut),y.m(xt++,Rt,ut-Ot)):(y.m(xt++,Rt,Ht+ae),y.m(xt++,Rt,Ht),y.m(xt++,Rt,Ht-Ot)):this.K===270?Ht<=ut.bounds.y?(ut=ut.bounds.y,y.m(xt++,Rt,ut-Ot),y.m(xt++,Rt,ut),y.m(xt++,Rt,ut+ae)):(y.m(xt++,Rt,Ht-Ot),y.m(xt++,Rt,Ht),y.m(xt++,Rt,Ht+ae)):this.K===0&&(Rt>=ut.bounds.right?(ut=ut.bounds.x+ut.bounds.width,y.m(xt++,ut+ae,Ht),y.m(xt++,ut,Ht),y.m(xt++,ut-Ot,Ht)):(y.m(xt++,Rt+ae,Ht),y.m(xt++,Rt,Ht),y.m(xt++,Rt-Ot,Ht)));else{y.m(xt++,Et,Ft);var wi=0;this.K===180||this.K===0?((this.K===180?Rt>=ut.bounds.right:Rt<=ut.bounds.x)&&(wi=(this.K===0?-Ot:ae)/2),y.m(xt++,Et+wi,Ht)):((this.K===270?Ht>=ut.bounds.bottom:Ht<=ut.bounds.y)&&(wi=(this.K===90?-Ot:ae)/2),y.m(xt++,Rt,Ft+wi)),y.m(xt++,Rt,Ht)}}else Ot=Math.max(10,this.he[Tt.layer]),ae=Math.max(10,this.Ld[Tt.layer]),ct?this.K===180?(y.m(xt++,Rt-Ot-vt,Ht),y.m(xt++,Math.min(Rt-Ot+vt/2,Rt),Ht),y.m(xt++,Rt,Ht),y.m(xt++,Rt,Ht),y.m(xt++,Math.max(Rt+ae-vt/2,Rt),Ht),y.m(xt++,Rt+ae+vt,Ht)):this.K===90?(y.m(xt++,Rt,Ht+ae+vt),y.m(xt++,Rt,Math.max(Ht+ae-vt/2,Ht)),y.m(xt++,Rt,Ht),y.m(xt++,Rt,Ht),y.m(xt++,Rt,Math.min(Ht-Ot+vt/2,Ht)),y.m(xt++,Rt,Ht-Ot-vt)):this.K===270?(y.m(xt++,Rt,Ht-Ot-vt),y.m(xt++,Rt,Math.min(Ht-Ot+vt/2,Ht)),y.m(xt++,Rt,Ht),y.m(xt++,Rt,Ht),y.m(xt++,Rt,Math.max(Ht+ae-vt/2,Ht)),y.m(xt++,Rt,Ht+ae+vt)):(y.m(xt++,Rt+ae+vt,Ht),y.m(xt++,Math.max(Rt+ae-vt/2,Rt),Ht),y.m(xt++,Rt,Ht),y.m(xt++,Rt,Ht),y.m(xt++,Math.min(Rt-Ot+vt/2,Rt),Ht),y.m(xt++,Rt-Ot-vt,Ht)):y.m(xt++,Rt,Ht)}ut=Tt}(it===null||ot!==Jn||dt)&&(Et=y.i(xt-1).x,Ft=y.i(xt-1).y,Rt=y.i(xt).x,Ht=y.i(xt).y,dt?(vt=this.Ld[st.layer],this.K===180||this.K===0?(dt=Ft,dt>=st.bounds.y&&dt<=st.bounds.bottom&&(this.K===180?Rt>=st.bounds.x:Rt<=st.bounds.right)&&(ut=st.centerX+(this.K===180?-vt:vt),dt<st.bounds.y+st.bounds.height/2?dt=st.bounds.y-this.kc/2:dt=st.bounds.bottom+this.kc/2,y.m(xt++,ut,Ft),y.m(xt++,ut,dt)),y.m(xt++,Rt,dt)):(dt=Et,dt>=st.bounds.x&&dt<=st.bounds.right&&(this.K===270?Ht>=st.bounds.y:Ht<=st.bounds.bottom)&&(ut=st.centerY+(this.K===270?-vt:vt),dt<st.bounds.x+st.bounds.width/2?dt=st.bounds.x-this.kc/2:dt=st.bounds.right+this.kc/2,y.m(xt++,Et,ut),y.m(xt++,dt,ut)),y.m(xt++,dt,Ht)),y.m(xt++,Rt,Ht)):ct?(Ot=Math.max(10,this.he[st.layer]),ae=Math.max(10,this.Ld[st.layer]),this.K===180&&Rt>=st.bounds.x?(ut=st.bounds.x+st.bounds.width,y.L(xt-2,ut,Ft),y.L(xt-1,ut+ae,Ft)):this.K===90&&Ht<=st.bounds.bottom?(ut=st.bounds.y,y.L(xt-2,Et,ut),y.L(xt-1,Et,ut-Ot)):this.K===270&&Ht>=st.bounds.y?(ut=st.bounds.y+st.bounds.height,y.L(xt-2,Et,ut),y.L(xt-1,Et,ut+ae)):this.K===0&&Rt<=st.bounds.right&&(ut=st.bounds.x,y.L(xt-2,ut,Ft),y.L(xt-1,ut-Ot,Ft))):(Ot=Math.max(10,this.he[st.layer]),ae=Math.max(10,this.Ld[st.layer]),dt=0,this.K===180||this.K===0?((this.K===180?Rt<=st.bounds.x:Rt>=st.bounds.right)&&(dt=(this.K===0?ae:-Ot)/2),y.m(xt++,Rt+dt,Ft)):((this.K===270?Ht<=st.bounds.y:Ht>=st.bounds.bottom)&&(dt=(this.K===90?ae:-Ot)/2),y.m(xt++,Et,Ht+dt)),y.m(xt++,Rt,Ht)))}else{for(;st!==null&&st!==ut;){for(Ot=Tt=null,st=st.destinationEdges.iterator;st.next()&&(Et=st.value,Et.link!==x.link||(Tt=Et.toVertex,Ot=Et.fromVertex,Ot.node!==null&&(Ot=null),Tt.node!==null)););if(Tt===null)break;Tt!==ut&&(Et=y.i(xt-1).x,Ft=y.i(xt-1).y,Rt=Tt.centerX,Ht=Tt.centerY,dt?this.K===180||this.K===0?(Ot!==null?Ot.centerY:Ft)!==Ht&&(Ot=this.Ta[Tt.layer]+this.Rf.x,xt===y.firstPickIndex+1&&(Ot=this.K===0?Math.max(Ot,Et):Math.min(Ot,Et)),y.m(xt++,Ot,Ft),y.m(xt++,Ot,Ht)):(Ot!==null?Ot.centerX:Et)!==Rt&&(Ot=this.Ta[Tt.layer]+this.Rf.y,xt===y.firstPickIndex+1&&(Ot=this.K===90?Math.max(Ot,Ft):Math.min(Ot,Ft)),y.m(xt++,Et,Ot),y.m(xt++,Rt,Ot)):(Ot=Math.max(10,this.he[Tt.layer]),ae=Math.max(10,this.Ld[Tt.layer]),ct?this.K===180?(y.m(xt++,Rt+ae+vt,Ht),y.m(xt++,Math.max(Rt+ae-vt/2,Rt),Ht),y.m(xt++,Rt,Ht),y.m(xt++,Rt,Ht),y.m(xt++,Math.min(Rt-Ot+vt/2,Rt),Ht),y.m(xt++,Rt-Ot-vt,Ht)):this.K===90?(y.m(xt++,Rt,Ht-Ot-vt),y.m(xt++,Rt,Math.min(Ht-Ot+vt/2,Ht)),y.m(xt++,Rt,Ht),y.m(xt++,Rt,Ht),y.m(xt++,Rt,Math.max(Ht+ae-vt/2,Ht)),y.m(xt++,Rt,Ht+ae+vt)):this.K===270?(y.m(xt++,Rt,Ht+ae+vt),y.m(xt++,Rt,Math.max(Ht+ae-vt/2,Ht)),y.m(xt++,Rt,Ht),y.m(xt++,Rt,Ht),y.m(xt++,Rt,Math.min(Ht-Ot+vt/2,Ht)),y.m(xt++,Rt,Ht-Ot-vt)):(y.m(xt++,Rt-Ot-vt,Ht),y.m(xt++,Math.min(Rt-Ot+vt/2,Rt),Ht),y.m(xt++,Rt,Ht),y.m(xt++,Rt,Ht),y.m(xt++,Math.max(Rt+ae-vt/2,Rt),Ht),y.m(xt++,Rt+ae+vt,Ht)):this.K===180?(y.m(xt++,Rt+ae,Ht),y.m(xt++,Rt-Ot,Ht)):this.K===90?(y.m(xt++,Rt,Ht-Ot),y.m(xt++,Rt,Ht+ae)):this.K===270?(y.m(xt++,Rt,Ht+ae),y.m(xt++,Rt,Ht-Ot)):(y.m(xt++,Rt-Ot,Ht),y.m(xt++,Rt+ae,Ht)))),st=Tt}dt&&(Et=y.i(xt-1).x,Ft=y.i(xt-1).y,Rt=y.i(xt).x,Ht=y.i(xt).y,this.K===180||this.K===0?Ft!==Ht&&(Ot=this.K===0?Math.min(Math.max((Rt+Et)/2,this.Ta[ut.layer]+this.Rf.x),Rt):Math.max(Math.min((Rt+Et)/2,this.Ta[ut.layer]+this.Rf.x),Rt),y.m(xt++,Ot,Ft),y.m(xt++,Ot,Ht)):Et!==Rt&&(Ot=this.K===90?Math.min(Math.max((Ht+Ft)/2,this.Ta[ut.layer]+this.Rf.y),Ht):Math.max(Math.min((Ht+Ft)/2,this.Ta[ut.layer]+this.Rf.y),Ht),y.m(xt++,Et,Ot),y.m(xt++,Rt,Ot)))}E!==null&&ct&&4<=y.pointsCount&&(tt!==null&&(tt=ot===Jn?y.getLinkPointFromPoint(b,tt,tt.ga(Hn),y.i(3),!0):y.i(0),ot===Jn&&(ot=y.i(2),E=y.i(3),this.direction===90||this.direction===270?(y.L(1,(tt.x+ot.x)/2,ot.y),y.L(2,E.x,(ot.y+E.y)/2)):(y.L(1,ot.x,(tt.y+ot.y)/2),y.L(2,(ot.x+E.x)/2,E.y))),tt.w()||tt.set(b.actualBounds.center),y.L(0,tt.x,tt.y)),it!==null&&(b=nt===Jn?y.getLinkPointFromPoint(z,it,it.ga(Hn),y.i(y.pointsCount-4),!1):y.i(y.pointsCount-1),nt===Jn&&(it=y.i(y.pointsCount-3),nt=y.i(y.pointsCount-4),this.direction===90||this.direction===270?(y.L(y.pointsCount-2,(b.x+it.x)/2,it.y),y.L(y.pointsCount-2,nt.x,(it.y+nt.y)/2)):(y.L(y.pointsCount-2,it.x,(b.y+it.y)/2),y.L(y.pointsCount-3,(it.x+nt.x)/2,nt.y))),b.w()||b.set(z.actualBounds.center),y.L(y.pointsCount-1,b.x,b.y))),y.zf(),x.commit()}}}this.avoidOrthogonalOverlaps()},Er.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new Me,y=this.network.edges.iterator;y.next();){var x=y.value.link;x!==null&&x.isOrthogonal&&!a.contains(x)&&a.add(x)}if(0<a.count)if(this.K===90||this.K===270){for(y=0,x=[],a=a.iterator;a.next();){var E=a.value;if(E!==null&&E.isOrthogonal)for(var b=2;b<E.pointsCount-3;b++){var z=E.i(b),tt=E.i(b+1);if(this.B(z.y,tt.y)&&!this.B(z.x,tt.x)){var it=new nc;it.layer=Math.floor(z.y/2);var nt=E.i(0),ot=E.i(E.pointsCount-1);if(it.first=nt.x*nt.x+nt.y,it.jc=ot.x*ot.x+ot.y,it.rd=Math.min(z.x,tt.x),it.Ic=Math.max(z.x,tt.x),it.index=b,it.link=E,b+2<E.pointsCount){nt=E.i(b-1),ot=E.i(b+2);var st=0;nt.y<z.y?st=ot.y<z.y?3:z.x<tt.x?2:1:nt.y>z.y&&(st=ot.y>z.y?0:tt.x<z.x?2:1),it.j=st}x.push(it)}}}if(1<x.length)for(x.sort(this.Vx),a=0;a<x.length;){for(z=x[a].layer,E=a+1;E<x.length&&x[E].layer===z;)E++;if(1<E-a)for(z=a;z<E;){for(tt=x[z].Ic,b=a+1;b<E&&x[b].rd<tt;)tt=Math.max(tt,x[b].Ic),b++;if(tt=b-z,1<tt){for(this.zi(x,this.Js,z,z+tt),st=1,it=x[z].jc,nt=z;nt<b;nt++)ot=x[nt],ot.jc!==it&&(st++,it=ot.jc);this.zi(x,this.Ux,z,z+tt);var ut=1;for(it=x[z].first,nt=z;nt<b;nt++)ot=x[nt],ot.first!==it&&(ut++,it=ot.first);for(nt=!0,ot=ut,st<ut?(nt=!1,ot=st,it=x[z].jc,this.zi(x,this.Js,z,z+tt)):it=x[z].first,st=0,ut=z;ut<b;ut++){var ct=x[ut];(nt?ct.first:ct.jc)!==it&&(st++,it=nt?ct.first:ct.jc);var dt=ct.link;z=dt.i(ct.index),tt=dt.i(ct.index+1);var vt=this.linkSpacing*(st-(ot-1)/2);y++,dt.uh(),dt.L(ct.index,z.x,z.y+vt),dt.L(ct.index+1,tt.x,tt.y+vt),dt.zf()}}z=b}a=E}}else{for(y=0,x=[],a=a.iterator;a.next();)if(E=a.value,E!==null&&E.isOrthogonal)for(b=2;b<E.pointsCount-3;b++)z=E.i(b),tt=E.i(b+1),this.B(z.x,tt.x)&&!this.B(z.y,tt.y)&&(it=new nc,it.layer=Math.floor(z.x/2),nt=E.i(0),ot=E.i(E.pointsCount-1),it.first=nt.x+nt.y*nt.y,it.jc=ot.x+ot.y*ot.y,it.rd=Math.min(z.y,tt.y),it.Ic=Math.max(z.y,tt.y),it.index=b,it.link=E,b+2<E.pointsCount&&(nt=E.i(b-1),ot=E.i(b+2),st=0,nt.x<z.x?st=ot.x<z.x?3:z.y<tt.y?2:1:nt.x>z.x&&(st=ot.x>z.x?0:tt.y<z.y?2:1),it.j=st),x.push(it));if(1<x.length)for(x.sort(this.Vx),a=0;a<x.length;){for(z=x[a].layer,E=a+1;E<x.length&&x[E].layer===z;)E++;if(1<E-a)for(z=a;z<E;){for(tt=x[z].Ic,b=a+1;b<E&&x[b].rd<tt;)tt=Math.max(tt,x[b].Ic),b++;if(tt=b-z,1<tt){for(this.zi(x,this.Js,z,z+tt),st=1,it=x[z].jc,nt=z;nt<b;nt++)ot=x[nt],ot.jc!==it&&(st++,it=ot.jc);for(this.zi(x,this.Ux,z,z+tt),ut=1,it=x[z].first,nt=z;nt<b;nt++)ot=x[nt],ot.first!==it&&(ut++,it=ot.first);for(nt=!0,ot=ut,st<ut?(nt=!1,ot=st,it=x[z].jc,this.zi(x,this.Js,z,z+tt)):it=x[z].first,st=0,ut=z;ut<b;ut++)ct=x[ut],(nt?ct.first:ct.jc)!==it&&(st++,it=nt?ct.first:ct.jc),dt=ct.link,z=dt.i(ct.index),tt=dt.i(ct.index+1),vt=this.linkSpacing*(st-(ot-1)/2),y++,dt.uh(),dt.L(ct.index,z.x+vt,z.y),dt.L(ct.index+1,tt.x+vt,tt.y),dt.zf()}z=b}a=E}}}},yt=Er.prototype,yt.Vx=function(a,y){return a instanceof nc&&y instanceof nc&&a!==y?a.layer<y.layer?-1:a.layer>y.layer?1:a.rd<y.rd?-1:a.rd>y.rd?1:a.Ic<y.Ic?-1:a.Ic>y.Ic?1:0:0},yt.Ux=function(a,y){return a instanceof nc&&y instanceof nc&&a!==y?a.first<y.first?-1:a.first>y.first||a.j<y.j?1:a.j>y.j||a.rd<y.rd?-1:a.rd>y.rd?1:a.Ic<y.Ic?-1:a.Ic>y.Ic?1:0:0},yt.Js=function(a,y){return a instanceof nc&&y instanceof nc&&a!==y?a.jc<y.jc?-1:a.jc>y.jc||a.j<y.j?1:a.j>y.j||a.rd<y.rd?-1:a.rd>y.rd?1:a.Ic<y.Ic?-1:a.Ic>y.Ic?1:0:0},yt.B=function(a,y){return a-=y,-1<a&&1>a},yt.zi=function(a,y,x,E){var b=a.length,z=E-x;if(!(1>=z))if((0>x||x>=b-1)&&It("not in range 0 <= from < length: "+x),z===2)E=a[x],b=a[x+1],0<y(E,b)&&(a[x]=b,a[x+1]=E);else if(x===0)if(E>=b)a.sort(y);else for(x=a.slice(0,E),x.sort(y),y=0;y<E;y++)a[y]=x[y];else if(E>=b)for(E=a.slice(x),E.sort(y),y=x;y<b;y++)a[y]=E[y-x];else for(b=a.slice(x,E),b.sort(y),y=x;y<E;y++)a[y]=b[y-x]};function ec(a,y){var x=a.tc[y];if(x>=a.He.length){for(var E=[],b=0;b<a.He.length;b++)E[b]=a.He[b];a.He=E}for(a.He[x]===void 0||a.He[x]===null?E=[]:(E=a.He[x],a.He[x]=null),a=a.fl[y],y=0;y<a.length;y++)x=a[y],E[x.index]=x;return E}function ic(a,y,x){a.He[a.tc[y]]=x}zi.Object.defineProperties(Er.prototype,{layerSpacing:{get:function(){return this.ie},set:function(a){this.ie!==a&&0<=a&&(this.ie=a,this.C())}},columnSpacing:{get:function(){return this.kc},set:function(a){this.kc!==a&&0<a&&(this.kc=a,this.C())}},direction:{get:function(){return this.K},set:function(a){this.K!==a&&(a===0||a===90||a===180||a===270?(this.K=a,this.C()):It("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}},cycleRemoveOption:{get:function(){return this.Dk},set:function(a){this.Dk===a||a!==wy&&a!==Mm&&a!==xg||(this.Dk=a,this.C())}},layeringOption:{get:function(){return this.Zk},set:function(a){this.Zk===a||a!==Em&&a!==Sy&&a!==Cy||(this.Zk=a,this.C())}},initializeOption:{get:function(){return this.Qk},set:function(a){this.Qk===a||a!==bm&&a!==ky&&a!==My||(this.Qk=a,this.C())}},iterations:{get:function(){return this.bj},set:function(a){this.bj!==a&&0<=a&&(this.bj=a,this.C())}},aggressiveOption:{get:function(){return this.rk},set:function(a){this.rk===a||a!==Ey&&a!==Pm&&a!==by||(this.rk=a,this.C())}},packOption:{get:function(){return this.bg},set:function(a){this.bg!==a&&0<=a&&8>a&&(this.bg=a,this.C())}},alignOption:{get:function(){return this.ve},set:function(a){this.ve!==a&&0<=a&&16>a&&(this.ve=a,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(a){this.sf!==a&&(this.sf=a,this.C())}},linkSpacing:{get:function(){return this.Cn},set:function(a){this.Cn!==a&&0<=a&&(this.Cn=a,this.C())}},maxLayer:{get:function(){return this.Ia}},maxIndex:{get:function(){return this.Iq}},maxColumn:{get:function(){return this.Ra}},minIndexLayer:{get:function(){return this.Hn}},maxIndexLayer:{get:function(){return this.Md}}});var Mm=new ze(Er,"CycleDepthFirst",0),wy=new ze(Er,"CycleGreedy",1),xg=new ze(Er,"CycleFromLayers",2),Em=new ze(Er,"LayerOptimalLinkLength",0),Sy=new ze(Er,"LayerLongestPathSink",1),Cy=new ze(Er,"LayerLongestPathSource",2),bm=new ze(Er,"InitDepthFirstOut",0),ky=new ze(Er,"InitDepthFirstIn",1),My=new ze(Er,"InitNaive",2),Ey=new ze(Er,"AggressiveNone",0),Pm=new ze(Er,"AggressiveLess",1),by=new ze(Er,"AggressiveMore",2),qw=8;Er.className="LayeredDigraphLayout",Er.CycleDepthFirst=Mm,Er.CycleGreedy=wy,Er.CycleFromLayers=xg,Er.LayerOptimalLinkLength=Em,Er.LayerLongestPathSink=Sy,Er.LayerLongestPathSource=Cy,Er.InitDepthFirstOut=bm,Er.InitDepthFirstIn=ky,Er.InitNaive=My,Er.AggressiveNone=Ey,Er.AggressiveLess=Pm,Er.AggressiveMore=by,Er.PackNone=0,Er.PackExpand=1,Er.PackStraighten=2,Er.PackMedian=4,Er.PackAll=15,Er.AlignNone=0,Er.AlignUpperLeft=1,Er.AlignUpperRight=2,Er.AlignLowerLeft=4,Er.AlignLowerRight=8,Er.AlignAll=15;function nc(){this.index=this.Ic=this.rd=this.jc=this.first=this.layer=0,this.link=null,this.j=0}nc.className="SegInfo";function _d(a){Ir.call(this,a)}Vi(_d,Ir),_d.prototype.createVertex=function(){return new Ya(this)},_d.prototype.createEdge=function(){return new wg(this)},_d.className="LayeredDigraphNetwork";function Ya(a){Fo.call(this,a),this.$n=this.bo=this.ao=this.co=null,this.Za=this.Ag=this.Ig=-1,this.u=NaN,this.F=null,this.valid=!1,this.finish=this.Ll=NaN,this.Dj=0,this.dv=this.ev=null}Vi(Ya,Fo);function ow(a,y){return a.index-y.index}function Nm(a,y){if(!a.$n){for(var x=[],E=on(a.destinationEdgesArrayAccess),b=E.next();!b.done;b=E.next())b=b.value,b.valid&&x.push(b);a.$n=x}for(a=on(a.$n),x=a.next();!x.done;x=a.next())if(x=x.value,x.toVertex===y)return x;It("Unable to find destination edge to given vertex")}function Py(a){if(!a.co){for(var y=[],x=on(a.sourceEdgesArrayAccess),E=x.next();!E.done;E=x.next())E=E.value,E.valid&&y.push(E.fromVertex);y.sort(ow),a.co=y}return a.co}function tS(a){if(!a.ao){for(var y=[],x=on(a.destinationEdgesArrayAccess),E=x.next();!E.done;E=x.next())E=E.value,E.valid&&y.push(E.toVertex);y.sort(ow),a.ao=y}return a.ao}Ya.prototype.Cl=function(a){Fo.prototype.Cl.call(this,a),this.bo=this.co=null},Ya.prototype.Kl=function(a){Fo.prototype.Kl.call(this,a),this.bo=this.co=null},Ya.prototype.zl=function(a){Fo.prototype.zl.call(this,a),this.$n=this.ao=null},Ya.prototype.Jl=function(a){Fo.prototype.Jl.call(this,a),this.$n=this.ao=null},zi.Object.defineProperties(Ya.prototype,{layer:{get:function(){return this.Ig},set:function(a){this.Ig!==a&&(this.Ig=a)}},column:{get:function(){return this.Ag},set:function(a){this.Ag!==a&&(this.Ag=a)}},index:{get:function(){return this.Za},set:function(a){this.Za!==a&&(this.Za=a)}},component:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},near:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}}}),Ya.prototype.deleteDestinationEdge=Ya.prototype.Jl,Ya.prototype.addDestinationEdge=Ya.prototype.zl,Ya.prototype.deleteSourceEdge=Ya.prototype.Kl,Ya.prototype.addSourceEdge=Ya.prototype.Cl,Ya.className="LayeredDigraphVertex";function wg(a){ma.call(this,a),this.j=this.ia=this.Ha=!1,this.V=this.u=NaN,this.F=this.o=0}Vi(wg,ma),zi.Object.defineProperties(wg.prototype,{fromVertex:{get:function(){return this.kd},set:function(a){this.kd!==a&&(this.kd=a)}},toVertex:{get:function(){return this.qd},set:function(a){this.qd!==a&&(this.qd=a)}},valid:{get:function(){return this.Ha},set:function(a){this.Ha!==a&&(this.Ha=a)}},rev:{get:function(){return this.ia},set:function(a){this.ia!==a&&(this.ia=a)}},forest:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a)}},portFromPos:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},portToPos:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}},portFromColOffset:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a)}},portToColOffset:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}}}),wg.className="LayeredDigraphEdge";function Xn(a){Gr.call(this),this.Ub=new _e,this.Wn=Dm,this.ud=pu,this.vo=Bm,this.Bq=jy,this.$v=[],this.td=!0,this.Rb=Om,this.$d=new li(10,10).freeze();var y=new Bf(this);this.W=new sl(y),this.Y=new sl(y),this.ru=[],a&&Object.assign(this,a)}Vi(Xn,Gr),Xn.prototype.cloneProtected=function(a){Gr.prototype.cloneProtected.call(this,a),a.Wn=this.Wn,a.vo=this.vo,a.Bq=this.Bq,a.td=this.td,a.Rb=this.Rb,a.$d.assign(this.$d),a.W.copyInheritedPropertiesFrom(this.W),a.Y.copyInheritedPropertiesFrom(this.Y)},Xn.prototype.qb=function(a){a.classType===Xn?a.name.indexOf("Alignment")===0?this.alignment=a:a.name.indexOf("Arrangement")===0?this.arrangement=a:a.name.indexOf("Compaction")===0?this.compaction=a:a.name.indexOf("Path")===0?this.path=a:a.name.indexOf("Sorting")===0?this.sorting=a:a.name.indexOf("Style")===0?this.treeStyle=a:It("Unknown enum value: "+a):Gr.prototype.qb.call(this,a)},Xn.prototype.createNetwork=function(){return new Bf(this)},Xn.prototype.makeNetwork=function(a){function y(E){if(E instanceof Ci)return!E.isLinkLabel&&E.category!=="Comment";if(E instanceof fi){var b=E.fromNode;return b===null||b.isLinkLabel||b.category==="Comment"?!1:(E=E.toNode,!(E===null||E.isLinkLabel||E.category==="Comment"))}return!1}var x=this.createNetwork();return a instanceof le?(x.lg(a.nodes,!0,y),x.lg(a.links,!0,y)):a instanceof An?x.lg(a.memberParts,!1,y):x.lg(a.iterator,!1,y),x},Xn.prototype.doLayout=function(a){this.network===null&&(this.network=this.makeNetwork(a)),this.arrangement!==Im&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var y=this.diagram;if(y===null&&a instanceof le&&(y=a),this.path===Dm&&y!==null?this.ud=y.isTreePathToChildren?pu:Df:this.ud=this.path===Dm?pu:this.path,0<this.network.vertexes.count){for(this.network.Ko(),a=this.network.vertexes.iterator;a.next();)y=a.value,y.initialized=!1,y.level=0,y.parent=null,y.children=[];if(0<this.Ub.count){for(a=new _e,y=this.Ub.iterator;y.next();){var x=y.value;x instanceof Ci?(x=this.network.ki(x),x!==null&&a.add(x)):x instanceof sl&&a.add(x)}this.Ub=a}for(this.Ub.count===0&&this.findRoots(),a=this.Ub.copy().iterator;a.next();)y=a.value,y.initialized||(y.initialized=!0,Ny(this,y));for(y=this.network.vertexes,a=null;a=eS(y),0<a.count;)y=sw(this,a),y!==null&&this.Ub.add(y),y.initialized=!0,Ny(this,y),y=a;for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof sl&&lw(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof sl&&uw(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof sl&&hw(this,y);if(this.Cu(),this.layerStyle===Rm){for(a=[],y=this.network.vertexes.iterator;y.next();){x=y.value;var E=x.parent;E===null&&(E=x),E=E.angle===0||E.angle===180;var b=a[x.level];b===void 0&&(b=0),a[x.level]=Math.max(b,E?x.width:x.height)}for(y=0;y<a.length;y++)a[y]===void 0&&(a[y]=0);for(this.$v=a,y=this.network.vertexes.iterator;y.next();)x=y.value,E=x.parent,E===null&&(E=x),E.angle===0||E.angle===180?(E.angle===180&&(x.focusX+=a[x.level]-x.width),x.width=a[x.level]):(E.angle===270&&(x.focusY+=a[x.level]-x.height),x.height=a[x.level])}else if(this.layerStyle===zy)for(a=this.network.vertexes.iterator;a.next();){for(y=a.value,x=y.angle===0||y.angle===180,E=-1,b=0;b<y.children.length;b++){var z=y.children[b];E=Math.max(E,x?z.width:z.height)}if(0<=E)for(b=0;b<y.children.length;b++)z=y.children[b],x?(y.angle===180&&(z.focusX+=E-z.width),z.width=E):(y.angle===270&&(z.focusY+=E-z.height),z.height=E)}for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof sl&&this.layoutTree(y);this.arrangeTrees(),this.updateParts()}this.network=null,this.Ub=new _e,this.isValidLayout=!0};function eS(a){var y=new _e;for(a=a.iterator;a.next();){var x=a.value;x.initialized||y.add(x)}return y}Xn.prototype.findRoots=function(){for(var a=this.network.vertexes,y=a.iterator;y.next();){var x=y.value;switch(this.ud){case pu:x.sourceEdges.count===0&&this.Ub.add(x);break;case Df:x.destinationEdges.count===0&&this.Ub.add(x);break;default:It("Unhandled path value "+this.ud.toString())}}this.Ub.count===0&&(a=sw(this,a),a!==null&&this.Ub.add(a))};function sw(a,y){var x=999999,E=null;for(y=y.iterator;y.next();){var b=y.value;switch(a.ud){case pu:b.sourceEdges.count<x&&(x=b.sourceEdges.count,E=b);break;case Df:b.destinationEdges.count<x&&(x=b.destinationEdges.count,E=b);break;default:It("Unhandled path value "+a.ud.toString())}}return E}function Ny(a,y){if(y!==null){switch(a.ud){case pu:if(0<y.destinationEdges.count){for(var x=new Me,E=y.destinationVertexes;E.next();){var b=E.value;aw(a,y,b)&&x.add(b)}0<x.count&&(y.children=x.Fa())}break;case Df:if(0<y.sourceEdges.count){for(x=new Me,E=y.sourceVertexes;E.next();)b=E.value,aw(a,y,b)&&x.add(b);0<x.count&&(y.children=x.Fa())}break;default:It("Unhandled path value"+a.ud.toString())}for(x=y.children,E=x.length,b=0;b<E;b++){var z=x[b];z.initialized=!0,z.level=y.level+1,z.parent=y,a.Ub.remove(z)}for(y=0;y<E;y++)Ny(a,x[y])}}function aw(a,y,x){if(x.initialized){if(y===null)var E=!1;else{for(E=y.parent;E!==null&&E!==x;)E=E.parent;E=E===x}if(E||x.level>y.level)return!1;a.removeChild(x.parent,x)}return!0}Xn.prototype.removeChild=function(a,y){if(a!==null&&y!==null){for(var x=a.children,E=0,b=0;b<x.length;b++)x[b]===y&&E++;if(0<E){E=Array(x.length-E);for(var z=b=0;z<x.length;z++)x[z]!==y&&(E[b++]=x[z]);a.children=E}}};function lw(a,y){if(y!==null){a.initializeTreeVertexValues(y),y.alignment===mu&&a.sortTreeVertexChildren(y);for(var x=0,E=y.childrenCount,b=0,z=y.children,tt=z.length,it=0;it<tt;it++){var nt=z[it];lw(a,nt),x+=nt.descendantCount+1,E=Math.max(E,nt.maxChildrenCount),b=Math.max(b,nt.maxGenerationCount)}y.descendantCount=x,y.maxChildrenCount=E,y.maxGenerationCount=0<E?b+1:0}}function iS(a,y){switch(a.vo){default:case Bm:return y.parent!==null?y.parent:a.W;case Iy:return y.parent===null?a.W:y.parent.parent===null?a.Y:y.parent;case Oy:return y.parent!==null?y.parent.parent!==null?y.parent.parent:a.Y:a.W;case By:var x=!0;if(y.childrenCount===0)x=!1;else for(var E=y.children,b=E.length,z=0;z<b;z++)if(0<E[z].childrenCount){x=!1;break}return x&&y.parent!==null?a.Y:y.parent!==null?y.parent:a.W}}Xn.prototype.initializeTreeVertexValues=function(a){if(a.copyInheritedPropertiesFrom(iS(this,a)),a.parent!==null&&a.parent.alignment===mu){for(var y=a.angle,x=a.parent.children,E=0;E<x.length&&a!==x[E];)E++;E%2===0?E!==x.length-1&&(y=y===90?180:y===180?270:y===270?180:270):y=y===90?0:y===180?90:y===270?0:90,a.angle=y}a.initialized=!0};function uw(a,y){if(y!==null){a.assignTreeVertexValues(y),y=y.children;for(var x=y.length,E=0;E<x;E++)uw(a,y[E])}}Xn.prototype.assignTreeVertexValues=function(){};function hw(a,y){if(y!==null){y.alignment!==mu&&a.sortTreeVertexChildren(y),y=y.children;for(var x=y.length,E=0;E<x;E++)hw(a,y[E])}}Xn.prototype.sortTreeVertexChildren=function(a){switch(a.sorting){case Hd:break;case Cg:a.children.reverse();break;case kg:a.children.sort(a.comparer);break;case Mg:a.children.sort(a.comparer),a.children.reverse();break;default:It("Unhandled sorting value "+a.sorting.toString())}},Xn.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},Xn.prototype.addComments=function(a){var y=a.angle,x=a.parent,E=0,b=!1;x!==null&&(E=x.angle,b=x.alignment,b=rc(b)),y=y===90||y===270,E=E===90||E===270,x=a.childrenCount===0;var z=0,tt=0,it=0,nt=a.commentSpacing;if(a.node!==null)for(var ot=a.node.Mu();ot.next();){var st=ot.value;st.category==="Comment"&&st.canLayout()&&(a.comments===null&&(a.comments=[]),a.comments.push(st),st.Va(),st=st.measuredBounds,y&&!x||!b&&!E&&x||b&&E&&x?(z=Math.max(z,st.width),tt+=st.height+Math.abs(it)):(z+=st.width+Math.abs(it),tt=Math.max(tt,st.height)),it=nt)}a.comments!==null&&(y&&!x||!b&&!E&&x||b&&E&&x?(z+=Math.abs(a.commentMargin),tt=Math.max(0,tt-a.height)):(tt+=Math.abs(a.commentMargin),z=Math.max(0,z-a.width)),b=be.allocAt(0,0,a.bounds.width+z,a.bounds.height+tt),a.bounds=b,be.free(b))};function rc(a){return a===gh||a===mu||a===vh||a===Bu}function Sg(a){return a===gh||a===mu}function Ty(a){var y=a.parent;if(y!==null){var x=y.alignment;if(rc(x)){if(Sg(x)){for(y=y.children,x=0;x<y.length&&a!==y[x];)x++;return x%2===0}if(x===vh)return!0}}return!1}Xn.prototype.layoutComments=function(a){if(a.comments!==null){var y=a.node.measuredBounds,x=a.parent,E=a.angle,b=0,z=!1;x!==null&&(b=x.angle,z=x.alignment,z=rc(z)),E=E===90||E===270,x=b===90||b===270;for(var tt=a.childrenCount===0,it=Ty(a),nt=0,ot=a.comments,st=ot.length,ut=Pt.alloc(),ct=0;ct<st;ct++){var dt=ot[ct],vt=dt.measuredBounds;if(E&&!tt||!z&&!x&&tt||z&&x&&tt){if(135<b&&!z||x&&it)if(0<=a.commentMargin)for(ut.h(a.bounds.x-a.commentMargin-vt.width,a.bounds.y+nt),dt.move(ut),dt=dt.Sd();dt.next();){var xt=dt.value;xt.fromSpot=Ro,xt.toSpot=jo}else for(ut.h(a.bounds.x+2*a.focus.x-a.commentMargin,a.bounds.y+nt),dt.move(ut),dt=dt.Sd();dt.next();)xt=dt.value,xt.fromSpot=jo,xt.toSpot=Ro;else if(0<=a.commentMargin)for(ut.h(a.bounds.x+2*a.focus.x+a.commentMargin,a.bounds.y+nt),dt.move(ut),dt=dt.Sd();dt.next();)xt=dt.value,xt.fromSpot=jo,xt.toSpot=Ro;else for(ut.h(a.bounds.x+a.commentMargin-vt.width,a.bounds.y+nt),dt.move(ut),dt=dt.Sd();dt.next();)xt=dt.value,xt.fromSpot=Ro,xt.toSpot=jo;nt=0<=a.commentSpacing?nt+(vt.height+a.commentSpacing):nt+(a.commentSpacing-vt.height)}else{if(135<b&&!z||!x&&it)if(0<=a.commentMargin)for(ut.h(a.bounds.x+nt,a.bounds.y-a.commentMargin-vt.height),dt.move(ut),dt=dt.Sd();dt.next();)xt=dt.value,xt.fromSpot=ro,xt.toSpot=Uo;else for(ut.h(a.bounds.x+nt,a.bounds.y+2*a.focus.y-a.commentMargin),dt.move(ut),dt=dt.Sd();dt.next();)xt=dt.value,xt.fromSpot=Uo,xt.toSpot=ro;else if(0<=a.commentMargin)for(ut.h(a.bounds.x+nt,a.bounds.y+2*a.focus.y+a.commentMargin),dt.move(ut),dt=dt.Sd();dt.next();)xt=dt.value,xt.fromSpot=Uo,xt.toSpot=ro;else for(ut.h(a.bounds.x+nt,a.bounds.y+a.commentMargin-vt.height),dt.move(ut),dt=dt.Sd();dt.next();)xt=dt.value,xt.fromSpot=ro,xt.toSpot=Uo;nt=0<=a.commentSpacing?nt+(vt.width+a.commentSpacing):nt+(a.commentSpacing-vt.width)}}if(Pt.free(ut),y=nt-a.commentSpacing-(E?y.height:y.width),this.ud===pu)for(a=a.destinationEdges;a.next();)b=a.value.link,b===null||b.isAvoiding||(b.fromEndSegmentLength=0<y?y:NaN);else for(a=a.sourceEdges;a.next();)b=a.value.link,b===null||b.isAvoiding||(b.toEndSegmentLength=0<y?y:NaN)}},Xn.prototype.layoutTree=function(a){if(a!==null){for(var y=a.children,x=y.length,E=0;E<x;E++)this.layoutTree(y[E]);switch(a.compaction){case Fm:cw(this,a);break;case Eg:if(a.alignment===mu)cw(this,a);else if(a.childrenCount===0)E=a.parent,x=!1,y=0,E!==null&&(y=E.angle,x=E.alignment,x=rc(x)),E=Ty(a),a.S.h(0,0),a.Da.h(a.width,a.height),a.parent===null||a.comments===null||(y!==180&&y!==270||x)&&!E?a.la.h(0,0):y===180&&!x||(y===90||y===270)&&E?a.la.h(a.width-2*a.focus.x,0):a.la.h(0,a.height-2*a.focus.y),a.Yo=null,a.kp=null;else{var b=Ml(a);y=b===90||b===270;var z=0,tt=a.children,it=tt.length;for(x=0;x<it;x++)E=tt[x],z=Math.max(z,y?E.Da.width:E.Da.height);var nt=a.alignment;E=nt===gu;var ot=nt===vu,st=rc(nt),ut=Math.max(0,a.breadthLimit);x=this.computeLayerSpacing(a);var ct=a.nodeSpacing,dt=this.computeNodeIndent(a),vt=a.rowSpacing,xt=0;(E||ot||a.hm||a.im&&a.maxGenerationCount===1)&&(xt=Math.max(0,a.rowIndent)),E=a.width;var Tt=a.height,Et=0,Ft=0,Ot=0,Rt=null,Ht=null,ae=0,wi=0,Ki=0,Ii=0,hi=0,Ue=0,Ln=0,wn=0;if(st&&!Sg(nt)&&135<b&&tt.reverse(),Sg(nt))if(1<it)for(var vr=0;vr<it;vr++)vr%2===0&&vr!==it-1&&(wn=Math.max(wn,y?tt[vr].Da.width:tt[vr].Da.height));else it===1&&(wn=y?tt[0].Da.width:tt[0].Da.height);if(st){switch(nt){case gh:Ft=135>b?fw(this,a,tt,wn,Et,Ft):dw(this,a,tt,wn,Et,Ft),wn=Ft.x,Et=Ft.width,Ft=Ft.height;break;case vh:for(Rt=0;Rt<it;Rt++)Ht=tt[Rt],ut=Ht.Da,Ot=Ue===0?0:vt,y?(Ht.S.h(z-ut.width,Ii+Ot),Et=Math.max(Et,ut.width),Ft=Math.max(Ft,Ii+Ot+ut.height),Ii+=Ot+ut.height):(Ht.S.h(Ki+Ot,z-ut.height),Et=Math.max(Et,Ki+Ot+ut.width),Ft=Math.max(Ft,ut.height),Ki+=Ot+ut.width),Ue++;break;case Bu:for(Rt=0;Rt<it;Rt++)Ht=tt[Rt],z=Ht.Da,ut=Ue===0?0:vt,y?(Ht.S.h(ct/2+a.focus.x,Ii+ut),Et=Math.max(Et,z.width),Ft=Math.max(Ft,Ii+ut+z.height),Ii+=ut+z.height):(Ht.S.h(Ki+ut,ct/2+a.focus.y),Et=Math.max(Et,Ki+ut+z.width),Ft=Math.max(Ft,z.height),Ki+=ut+z.width),Ue++}Rt=oa(this,2),Ht=oa(this,2),y?(Rt[0].h(0,0),Rt[1].h(0,Ft),Ht[0].h(Et,0)):(Rt[0].h(0,0),Rt[1].h(Et,0),Ht[0].h(0,Ft)),Ht[1].h(Et,Ft)}else for(vr=0;vr<it;vr++){var Br=tt[vr],Wo=Br.Da;if(y){0<ut&&0<Ue&&Ki+ct+Wo.width>ut&&(Ki<z&&Wc(a,nt,z-Ki,0,Ln,vr-1),hi++,Ue=0,Ln=vr,Ot=Ft,Ki=0,Ii=135<b?-Ft-vt:Ft+vt),Lm(this,Br,0,Ii);var Go=0;if(Ue===0)Rt=Br.Yo,Ht=Br.kp,ae=Wo.width,wi=Wo.height,(Rt===null||Ht===null||b!==Ml(Br))&&(Rt=oa(this,2),Ht=oa(this,2),Rt[0].h(0,0),Rt[1].h(0,wi),Ht[0].h(ae,0),Ht[1].h(ae,wi));else{var Ms=ii();wi=pw(this,a,Br,Rt,Ht,ae,wi,Ms),Go=wi.x,Rt=Ms[0],Ht=Ms[1],ae=wi.width,wi=wi.height,Hi(Ms),Ki<Wo.width&&0>Go&&(Af(a,-Go,0,Ln,vr-1),Am(Rt,-Go,0),Am(Ht,-Go,0),Go=0)}Br.S.h(Go,Ii),Et=Math.max(Et,ae),Ft=Math.max(Ft,Ot+(hi===0?0:vt)+Wo.height),Ki=ae}else 0<ut&&0<Ue&&Ii+ct+Wo.height>ut&&(Ii<z&&Wc(a,nt,0,z-Ii,Ln,vr-1),hi++,Ue=0,Ln=vr,Ot=Et,Ii=0,Ki=135<b?-Et-vt:Et+vt),Lm(this,Br,Ki,0),Go=0,Ue===0?(Rt=Br.Yo,Ht=Br.kp,ae=Wo.width,wi=Wo.height,(Rt===null||Ht===null||b!==Ml(Br))&&(Rt=oa(this,2),Ht=oa(this,2),Rt[0].h(0,0),Rt[1].h(ae,0),Ht[0].h(0,wi),Ht[1].h(ae,wi))):(Ms=ii(),wi=pw(this,a,Br,Rt,Ht,ae,wi,Ms),Go=wi.x,Rt=Ms[0],Ht=Ms[1],ae=wi.width,wi=wi.height,Hi(Ms),Ii<Wo.height&&0>Go&&(Af(a,0,-Go,Ln,vr-1),Am(Rt,0,-Go),Am(Ht,0,-Go),Go=0)),Br.S.h(Ki,Go),Ft=Math.max(Ft,wi),Et=Math.max(Et,Ot+(hi===0?0:vt)+Wo.width),Ii=wi;Ue++}switch(0<hi&&(y?(Ft+=Math.max(0,x),Ki<Et&&Wc(a,nt,Et-Ki,0,Ln,it-1),0<xt&&(ot||Af(a,xt,0,0,it-1),Et+=xt)):(Et+=Math.max(0,x),Ii<Ft&&Wc(a,nt,0,Ft-Ii,Ln,it-1),0<xt&&(ot||Af(a,0,xt,0,it-1),Ft+=xt))),xt=ot=0,nt){case Wd:y?ot+=Et/2-a.focus.x-dt/2:xt+=Ft/2-a.focus.y-dt/2;break;case Ff:0<hi?y?ot+=Et/2-a.focus.x-dt/2:xt+=Ft/2-a.focus.y-dt/2:y?(wn=tt[0].S.x+tt[0].la.x,ot+=wn+(tt[it-1].S.x+tt[it-1].la.x+2*tt[it-1].focus.x-wn)/2-a.focus.x-dt/2):(wn=tt[0].S.y+tt[0].la.y,xt+=wn+(tt[it-1].S.y+tt[it-1].la.y+2*tt[it-1].focus.y-wn)/2-a.focus.y-dt/2);break;case gu:y?(ot-=dt,Et+=dt):(xt-=dt,Ft+=dt);break;case vu:y?(ot+=Et-a.width+dt,Et+=dt):(xt+=Ft-a.height+dt,Ft+=dt);break;case gh:y?1<it?ot+=wn+ct/2-a.focus.x:ot+=tt[0].focus.x-a.focus.x+tt[0].la.x:1<it?xt+=wn+ct/2-a.focus.y:xt+=tt[0].focus.y-a.focus.y+tt[0].la.y;break;case vh:y?ot+=Et+ct/2-a.focus.x:xt+=Ft+ct/2-a.focus.y;break;case Bu:break;default:Ft=this.customAlignment(a,ot,xt,Et,Ft),ot=Ft[0],xt=Ft[1],Et=Ft[2],Ft=Ft[3]}for(dt=0;dt<it;dt++)wn=tt[dt],y?wn.S.h(wn.S.x+wn.la.x-ot,wn.S.y+(135<b?(st?-Ft:-wn.Da.height)+wn.la.y-x:Tt+x+wn.la.y)):wn.S.h(wn.S.x+(135<b?(st?-Et:-wn.Da.width)+wn.la.x-x:E+x+wn.la.x),wn.S.y+wn.la.y-xt);if(it=tt=0,st?y?(Et=Ly(a,Et,ot),0>ot&&(ot=0),135<b&&(xt+=Ft+x),Ft+=Tt+x,nt===Bu&&(tt+=ct/2+a.focus.x),it+=Tt+x):(135<b&&(ot+=Et+x),Et+=E+x,Ft=Ay(a,Ft,xt),0>xt&&(xt=0),nt===Bu&&(it+=ct/2+a.focus.y),tt+=E+x):y?(a.comments===null?E>Et&&(Et=Dy(nt,E-Et,0),tt=Et.x,it=Et.y,Et=E,ot=0):Et=Ly(a,Et,ot),0>ot&&(tt-=ot,ot=0),135<b&&(xt+=Ft+x),Ft=Math.max(Math.max(Ft,Tt),Ft+Tt+x),it+=Tt+x):(135<b&&(ot+=Et+x),Et=Math.max(Math.max(Et,E),Et+E+x),a.comments===null?Tt>Ft&&(Ft=Dy(nt,0,Tt-Ft),tt=Ft.x,it=Ft.y,Ft=Tt,xt=0):Ft=Ay(a,Ft,xt),0>xt&&(it-=xt,xt=0),tt+=E+x),0<hi)b=oa(this,4),hi=oa(this,4),y?(b[2].h(0,Tt+x),b[3].h(b[2].x,Ft),hi[2].h(Et,b[2].y),hi[3].h(hi[2].x,b[3].y)):(b[2].h(E+x,0),b[3].h(Et,b[2].y),hi[2].h(b[2].x,Ft),hi[3].h(b[3].x,hi[2].y));else{for(b=oa(this,Rt.length+2),hi=oa(this,Ht.length+2),nt=0;nt<Rt.length;nt++)st=Rt[nt],b[nt+2].h(st.x+tt,st.y+it);for(nt=0;nt<Ht.length;nt++)st=Ht[nt],hi[nt+2].h(st.x+tt,st.y+it)}y?(b[0].h(ot,0),b[1].h(b[0].x,Tt),b[2].y<b[1].y&&(b[2].x>b[0].x?b[2].assign(b[1]):b[1].assign(b[2])),b[3].y<b[2].y&&(b[3].x>b[0].x?b[3].assign(b[2]):b[2].assign(b[3])),hi[0].h(ot+E,0),hi[1].h(hi[0].x,Tt),hi[2].y<hi[1].y&&(hi[2].x<hi[0].x?hi[2].assign(hi[1]):hi[1].assign(hi[2])),hi[3].y<hi[2].y&&(hi[3].x<hi[0].x?hi[3].assign(hi[2]):hi[2].assign(hi[3])),b[2].y-=x/2,hi[2].y-=x/2):(b[0].h(0,xt),b[1].h(E,b[0].y),b[2].x<b[1].x&&(b[2].y>b[0].y?b[2].assign(b[1]):b[1].assign(b[2])),b[3].x<b[2].x&&(b[3].y>b[0].y?b[3].assign(b[2]):b[2].assign(b[3])),hi[0].h(0,xt+Tt),hi[1].h(E,hi[0].y),hi[2].x<hi[1].x&&(hi[2].y<hi[0].y?hi[2].assign(hi[1]):hi[1].assign(hi[2])),hi[3].x<hi[2].x&&(hi[3].y<hi[0].y?hi[3].assign(hi[2]):hi[2].assign(hi[3])),b[2].x-=x/2,hi[2].x-=x/2),Bl(this,Rt),Bl(this,Ht),a.Yo=b,a.kp=hi,a.la.h(ot,xt),a.Da.h(Et,Ft)}break;default:It("Unhandled compaction value "+a.compaction.toString())}}};function cw(a,y){if(y.childrenCount===0){var x=!1,E=0;y.parent!==null&&(E=y.parent.angle,x=y.parent.alignment,x=rc(x));var b=Ty(y);y.S.h(0,0),y.Da.h(y.width,y.height),y.parent===null||y.comments===null||(E!==180&&E!==270||x)&&!b?y.la.h(0,0):E===180&&!x||(E===90||E===270)&&b?y.la.h(y.width-2*y.focus.x,0):y.la.h(0,y.height-2*y.focus.y)}else{E=Ml(y),x=E===90||E===270;var z=0;b=y.children;for(var tt=b.length,it=0;it<tt;it++){var nt=b[it];z=Math.max(z,x?nt.Da.width:nt.Da.height)}var ot=y.alignment,st=ot===gu,ut=ot===vu;it=rc(ot);var ct=Math.max(0,y.breadthLimit);nt=a.computeLayerSpacing(y);var dt=y.nodeSpacing,vt=a.computeNodeIndent(y),xt=st||ut?0:vt/2,Tt=y.rowSpacing,Et=0;(st||ut||y.hm||y.im&&y.maxGenerationCount===1)&&(Et=Math.max(0,y.rowIndent)),st=y.width;var Ft=y.height,Ot=0,Rt=0,Ht=0,ae=0,wi=0,Ki=0,Ii=0,hi=0,Ue=0,Ln=0;if(it&&!Sg(ot)&&135<E&&b.reverse(),Sg(ot))if(1<tt)for(var wn=0;wn<tt;wn++){var vr=b[wn],Br=vr.Da;wn%2===0&&wn!==tt-1?Ue=Math.max(Ue,(x?Br.width:Br.height)+a.computeBusNodeSpacing(vr)-dt):wn%2!==0&&(Ln=Math.max(Ln,(x?Br.width:Br.height)+a.computeBusNodeSpacing(vr)-dt))}else tt===1&&(Ue=x?b[0].Da.width:b[0].Da.height);if(it)switch(ot){case gh:case mu:Rt=135>E?fw(a,y,b,Ue,Ot,Rt):dw(a,y,b,Ue,Ot,Rt),Ue=Rt.x,Ot=Rt.width,Rt=Rt.height;break;case vh:for(ct=0;ct<tt;ct++)xt=b[ct],Ht=xt.Da,Ln=Ii===0?0:Tt,x?(xt.S.h(z-Ht.width,wi+Ln),Ot=Math.max(Ot,Ht.width),Rt=Math.max(Rt,wi+Ln+Ht.height),wi+=Ln+Ht.height):(xt.S.h(ae+Ln,z-Ht.height),Ot=Math.max(Ot,ae+Ln+Ht.width),Rt=Math.max(Rt,Ht.height),ae+=Ln+Ht.width),Ii++;break;case Bu:for(z=0;z<tt;z++)ct=b[z],xt=ct.Da,Ht=Ii===0?0:Tt,x?(ct.S.h(dt/2+y.focus.x,wi+Ht),Ot=Math.max(Ot,xt.width),Rt=Math.max(Rt,wi+Ht+xt.height),wi+=Ht+xt.height):(ct.S.h(ae+Ht,dt/2+y.focus.y),Ot=Math.max(Ot,ae+Ht+xt.width),Rt=Math.max(Rt,xt.height),ae+=Ht+xt.width),Ii++}else for(Ln=0;Ln<tt;Ln++)wn=b[Ln],vr=wn.Da,x?(0<ct&&0<Ii&&ae+dt+vr.width>ct&&(ae<z&&Wc(y,ot,z-ae,0,hi,Ln-1),Ki++,Ii=0,hi=Ln,Ht=Rt,ae=0,wi=135<E?-Rt-Tt:Rt+Tt),Br=Ii===0?xt:dt,Lm(a,wn,0,wi),wn.S.h(ae+Br,wi),Ot=Math.max(Ot,ae+Br+vr.width),Rt=Math.max(Rt,Ht+(Ki===0?0:Tt)+vr.height),ae+=Br+vr.width):(0<ct&&0<Ii&&wi+dt+vr.height>ct&&(wi<z&&Wc(y,ot,0,z-wi,hi,Ln-1),Ki++,Ii=0,hi=Ln,Ht=Ot,wi=0,ae=135<E?-Ot-Tt:Ot+Tt),Br=Ii===0?xt:dt,Lm(a,wn,ae,0),wn.S.h(ae,wi+Br),Rt=Math.max(Rt,wi+Br+vr.height),Ot=Math.max(Ot,Ht+(Ki===0?0:Tt)+vr.width),wi+=Br+vr.height),Ii++;switch(0<Ki&&(x?(Rt+=Math.max(0,nt),ae<Ot&&Wc(y,ot,Ot-ae,0,hi,tt-1),0<Et&&(ut||Af(y,Et,0,0,tt-1),Ot+=Et)):(Ot+=Math.max(0,nt),wi<Rt&&Wc(y,ot,0,Rt-wi,hi,tt-1),0<Et&&(ut||Af(y,0,Et,0,tt-1),Rt+=Et))),Et=ut=0,ot){case Wd:x?ut+=Ot/2-y.focus.x-vt/2:Et+=Rt/2-y.focus.y-vt/2;break;case Ff:0<Ki?x?ut+=Ot/2-y.focus.x-vt/2:Et+=Rt/2-y.focus.y-vt/2:x?(a=b[0].S.x+b[0].la.x,ut+=a+(b[tt-1].S.x+b[tt-1].la.x+2*b[tt-1].focus.x-a)/2-y.focus.x-vt/2):(a=b[0].S.y+b[0].la.y,Et+=a+(b[tt-1].S.y+b[tt-1].la.y+2*b[tt-1].focus.y-a)/2-y.focus.y-vt/2);break;case gu:x?(ut-=vt,Ot+=vt):(Et-=vt,Rt+=vt);break;case vu:x?(ut+=Ot-y.width+vt,Ot+=vt):(Et+=Rt-y.height+vt,Rt+=vt);break;case gh:case mu:x?1<tt?ut+=Ue+dt/2-y.focus.x:ut+=b[0].focus.x-y.focus.x+b[0].la.x:1<tt?Et+=Ue+dt/2-y.focus.y:Et+=b[0].focus.y-y.focus.y+b[0].la.y;break;case vh:x?ut+=Ot+dt/2-y.focus.x:Et+=Rt+dt/2-y.focus.y;break;case Bu:break;default:a=a.customAlignment(y,ut,Et,Ot,Rt),ut=a[0],Et=a[1],Ot=a[2],Rt=a[3]}for(a=0;a<tt;a++)vt=b[a],x?vt.S.h(vt.S.x+vt.la.x-ut,vt.S.y+(135<E?(it?-Rt:-vt.Da.height)+vt.la.y-nt:Ft+nt+vt.la.y)):vt.S.h(vt.S.x+(135<E?(it?-Ot:-vt.Da.width)+vt.la.x-nt:st+nt+vt.la.x),vt.S.y+vt.la.y-Et);x?(Ot=Ly(y,Ot,ut),0>ut&&(ut=0),135<E&&(Et+=Rt+nt),Rt=Math.max(Math.max(Rt,Ft),Rt+Ft+nt)):(135<E&&(ut+=Ot+nt),Ot=Math.max(Math.max(Ot,st),Ot+st+nt),Rt=Ay(y,Rt,Et),0>Et&&(Et=0)),y.la.h(ut,Et),y.Da.h(Ot,Rt)}}Xn.prototype.customAlignment=function(a,y,x,E,b){return[y,x,E,b]};function fw(a,y,x,E,b,z){var tt=x.length;if(tt===0)return new be(E,0,b,z);if(tt===1)return y=x[0],b=y.Da.width,z=y.Da.height,new be(E,0,b,z);for(var it=y.nodeSpacing,nt=y.rowSpacing,ot=Ml(y)===90,st=0,ut=0,ct=0,dt=0;dt<tt;dt++)if(!(dt%2!==0||1<tt&&dt===tt-1)){var vt=x[dt],xt=vt.Da,Tt=st===0?0:nt;if(ot){var Et=a.computeBusNodeSpacing(vt)-it;vt.S.h(E-(xt.width+Et),ct+Tt),b=Math.max(b,xt.width+Et),z=Math.max(z,ct+Tt+xt.height),ct+=Tt+xt.height}else Et=a.computeBusNodeSpacing(vt)-it,vt.S.h(ut+Tt,E-(xt.height+Et)),z=Math.max(z,xt.height+Et),b=Math.max(b,ut+Tt+xt.width),ut+=Tt+xt.width;st++}for(st=0,vt=ut,dt=ct,ot?(ut=E+it,ct=0):(ut=0,ct=E+it),xt=0;xt<tt;xt++)if(xt%2!==0){Tt=x[xt],Et=Tt.Da;var Ft=st===0?0:nt;if(ot){var Ot=a.computeBusNodeSpacing(Tt)-it;Tt.S.h(ut+Ot,ct+Ft),b=Math.max(b,ut+Et.width+Ot),z=Math.max(z,ct+Ft+Et.height),ct+=Ft+Et.height}else Ot=a.computeBusNodeSpacing(Tt)-it,Tt.S.h(ut+Ft,ct+Ot),b=Math.max(b,ut+Ft+Et.width),z=Math.max(z,ct+Et.height+Ot),ut+=Ft+Et.width;st++}return 1<tt&&tt%2===1&&(x=x[tt-1],tt=x.Da,a=a.computeBusLastRowSpacing(x,ot?Math.max(Math.abs(dt),Math.abs(ct)):Math.max(Math.abs(vt),Math.abs(ut))),ot?(x.S.h(E+it/2-x.focus.x-x.la.x,z+a),ot=E+it/2-x.focus.x-x.la.x,b=Math.max(b,ot+tt.width),0>ot&&(b-=ot),z=Math.max(z,Math.max(dt,ct)+a+tt.height),0>x.S.x&&(E=Tm(y,x.S.x,!1,E,it))):(x.S.h(b+a,E+it/2-x.focus.y-x.la.y),b=Math.max(b,Math.max(vt,ut)+a+tt.width),ct=E+it/2-x.focus.y-x.la.y,z=Math.max(z,ct+tt.height),0>ct&&(z-=ct),0>x.S.y&&(E=Tm(y,x.S.y,!0,E,it)))),new be(E,0,b,z)}function dw(a,y,x,E,b,z){var tt=x.length;if(tt===0)return new be(E,0,b,z);if(tt===1)return x=x[0],b=x.Da.width,z=x.Da.height,new be(E,0,b,z);for(var it=y.nodeSpacing,nt=y.rowSpacing,ot=Ml(y)===270,st=0,ut=0,ct=0,dt=0;dt<tt;dt++)if(!(dt%2!==0||1<tt&&dt===tt-1)){var vt=x[dt],xt=vt.Da,Tt=st===0?0:nt;if(ot){var Et=a.computeBusNodeSpacing(vt)-it;ct-=Tt+xt.height,vt.S.h(E-(xt.width+Et),ct),b=Math.max(b,xt.width+Et),z=Math.max(z,Math.abs(ct))}else Et=a.computeBusNodeSpacing(vt)-it,ut-=Tt+xt.width,vt.S.h(ut,E-(xt.height+Et)),z=Math.max(z,xt.height+Et),b=Math.max(b,Math.abs(ut));st++}for(st=0,vt=ut,dt=ct,ot?(ut=E+it,ct=0):(ut=0,ct=E+it),xt=0;xt<tt;xt++)if(xt%2!==0){Tt=x[xt],Et=Tt.Da;var Ft=st===0?0:nt;if(ot){var Ot=a.computeBusNodeSpacing(Tt)-it;ct-=Ft+Et.height,Tt.S.h(ut+Ot,ct),b=Math.max(b,ut+Et.width+Ot),z=Math.max(z,Math.abs(ct))}else Ot=a.computeBusNodeSpacing(Tt)-it,ut-=Ft+Et.width,Tt.S.h(ut,ct+Ot),z=Math.max(z,ct+Et.height+Ot),b=Math.max(b,Math.abs(ut));st++}for(1<tt&&tt%2===1&&(nt=x[tt-1],st=nt.Da,a=a.computeBusLastRowSpacing(nt,ot?Math.max(Math.abs(dt),Math.abs(ct)):Math.max(Math.abs(vt),Math.abs(ut))),ot?(nt.S.h(E+it/2-nt.focus.x-nt.la.x,-z-st.height-a),ut=E+it/2-nt.focus.x-nt.la.x,b=Math.max(b,ut+st.width),0>ut&&(b-=ut),z=Math.max(z,Math.abs(Math.min(dt,ct))+a+st.height),0>nt.S.x&&(E=Tm(y,nt.S.x,!1,E,it))):(nt.S.h(-b-st.width-a,E+it/2-nt.focus.y-nt.la.y),b=Math.max(b,Math.abs(Math.min(vt,ut))+a+st.width),ct=E+it/2-nt.focus.y-nt.la.y,z=Math.max(z,ct+st.height),0>ct&&(z-=ct),0>nt.S.y&&(E=Tm(y,nt.S.y,!0,E,it)))),y=0;y<tt;y++)it=x[y],ot?it.S.h(it.S.x,it.S.y+z):it.S.h(it.S.x+b,it.S.y);return new be(E,0,b,z)}Xn.prototype.computeBusNodeSpacing=function(a){return a.parent===null?0:a.parent.nodeSpacing},Xn.prototype.computeBusLastRowSpacing=function(a){return a.parent===null?0:a.parent.rowSpacing};function Tm(a,y,x,E,b){a=a.children;for(var z=a.length,tt=0;tt<z;tt++)x?a[tt].S.h(a[tt].S.x,a[tt].S.y-y):a[tt].S.h(a[tt].S.x-y,a[tt].S.y);return y=a[z-1],Math.max(E,x?y.la.y+y.focus.y-b/2:y.la.x+y.focus.x-b/2)}function Ly(a,y,x){switch(a.alignment){case Ff:case Wd:return x+a.width>y&&(y=x+a.width),0>x&&(y-=x),y;case gu:return a.width>y?a.width:y;case vu:return 2*a.focus.x>y?a.width:y+a.width-2*a.focus.x;case gh:case mu:return Math.max(a.width,Math.max(y,x+a.width)-Math.min(0,x));case vh:return a.width-a.focus.x+a.nodeSpacing/2+y;case Bu:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+y);default:return y}}function Ay(a,y,x){switch(a.alignment){case Ff:case Wd:return x+a.height>y&&(y=x+a.height),0>x&&(y-=x),y;case gu:return a.height>y?a.height:y;case vu:return 2*a.focus.y>y?a.height:y+a.height-2*a.focus.y;case gh:case mu:return Math.max(a.height,Math.max(y,x+a.height)-Math.min(0,x));case vh:return a.height-a.focus.y+a.nodeSpacing/2+y;case Bu:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+y);default:return y}}function Dy(a,y,x){switch(a){case Wd:y/=2,x/=2;break;case Ff:y/=2,x/=2;break;case gu:x=y=0;break;case vu:break;default:It("Unhandled alignment value "+a.toString())}return new Pt(y,x)}function Wc(a,y,x,E,b,z){y=Dy(y,x,E),Af(a,y.x,y.y,b,z)}function Af(a,y,x,E,b){if(y!==0||x!==0)for(a=a.children;E<=b;E++){var z=a[E].S;z.x+=y,z.y+=x}}function Lm(a,y,x,E){var b=y.parent;switch(a.ud){case pu:for(a=y.sourceEdges;a.next();)y=a.value,y.fromVertex===b&&y.relativePoint.h(x,E);break;case Df:for(a=y.destinationEdges;a.next();)y=a.value,y.toVertex===b&&y.relativePoint.h(x,E);break;default:It("Unhandled path value "+a.ud.toString())}}function Am(a,y,x){for(var E=0;E<a.length;E++){var b=a[E];b.x+=y,b.y+=x}}function pw(a,y,x,E,b,z,tt,it){var nt=Ml(y),ot=nt===90||nt===270,st=y.nodeSpacing;y=E;var ut=b;E=z;var ct=tt,dt=x.Yo,vt=x.kp;tt=x.Da;var xt=ot?Math.max(ct,tt.height):Math.max(E,tt.width);if((dt===null||nt!==Ml(x))&&(dt=oa(a,2),vt=oa(a,2),ot?(dt[0].h(0,0),dt[1].h(0,tt.height),vt[0].h(tt.width,0),vt[1].h(vt[0].x,dt[1].y)):(dt[0].h(0,0),dt[1].h(tt.width,0),vt[0].h(0,tt.height),vt[1].h(dt[1].x,vt[0].y))),ot){if(ct=9999999,!(ut===null||2>ut.length||dt===null||2>dt.length))for(b=x=0;x<ut.length&&b<dt.length;){z=ut[x];var Tt=dt[b];nt=Tt.x,ot=Tt.y,nt+=E;var Et=z;x+1<ut.length&&(Et=ut[x+1]);var Ft=Tt;Tt=Ft.x,Ft=Ft.y,b+1<dt.length&&(Ft=dt[b+1],Tt=Ft.x,Ft=Ft.y,Tt+=E);var Ot=ct;z.y===ot?Ot=nt-z.x:z.y>ot&&z.y<Ft?Ot=nt+(z.y-ot)/(Ft-ot)*(Tt-nt)-z.x:ot>z.y&&ot<Et.y&&(Ot=nt-(z.x+(ot-z.y)/(Et.y-z.y)*(Et.x-z.x))),Ot<ct&&(ct=Ot),Et.y<=z.y?x++:Ft<=ot?b++:(Et.y<=Ft&&x++,Ft<=Et.y&&b++)}if(ct=E-ct,ct+=st,x=dt,b=ct,y===null||2>y.length||x===null||2>x.length)E=null;else{for(st=oa(a,y.length+x.length),E=z=nt=0;z<x.length&&x[z].y<y[0].y;)ot=x[z++],st[E++].h(ot.x+b,ot.y);for(;nt<y.length;)ot=y[nt++],st[E++].h(ot.x,ot.y);for(nt=y[y.length-1].y;z<x.length&&x[z].y<=nt;)z++;for(;z<x.length&&x[z].y>nt;)ot=x[z++],st[E++].h(ot.x+b,ot.y);for(x=oa(a,E),nt=0;nt<E;nt++)x[nt].assign(st[nt]);Bl(a,st),E=x}if(z=vt,nt=ct,ut===null||2>ut.length||z===null||2>z.length)b=null;else{for(st=oa(a,ut.length+z.length),b=ot=x=0;x<ut.length&&ut[x].y<z[0].y;)Et=ut[x++],st[b++].h(Et.x,Et.y);for(;ot<z.length;)Et=z[ot++],st[b++].h(Et.x+nt,Et.y);for(z=z[z.length-1].y;x<ut.length&&ut[x].y<=z;)x++;for(;x<ut.length&&ut[x].y>z;)nt=ut[x++],st[b++].h(nt.x,nt.y);for(z=oa(a,b),x=0;x<b;x++)z[x].assign(st[x]);Bl(a,st),b=z}return z=Math.max(0,ct)+tt.width,tt=xt,Bl(a,y),Bl(a,dt),Bl(a,ut),Bl(a,vt),it[0]=E,it[1]=b,new be(ct,0,z,tt)}if(E=9999999,!(ut===null||2>ut.length||dt===null||2>dt.length))for(b=x=0;x<ut.length&&b<dt.length;)z=ut[x],Tt=dt[b],nt=Tt.x,ot=Tt.y,ot+=ct,Et=z,x+1<ut.length&&(Et=ut[x+1]),Ft=Tt,Tt=Ft.x,Ft=Ft.y,b+1<dt.length&&(Ft=dt[b+1],Tt=Ft.x,Ft=Ft.y,Ft+=ct),Ot=E,z.x===nt?Ot=ot-z.y:z.x>nt&&z.x<Tt?Ot=ot+(z.x-nt)/(Tt-nt)*(Ft-ot)-z.y:nt>z.x&&nt<Et.x&&(Ot=ot-(z.y+(nt-z.x)/(Et.x-z.x)*(Et.y-z.y))),Ot<E&&(E=Ot),Et.x<=z.x?x++:Tt<=nt?b++:(Et.x<=Tt&&x++,Tt<=Et.x&&b++);if(ct-=E,ct+=st,x=dt,b=ct,y===null||2>y.length||x===null||2>x.length)E=null;else{for(st=oa(a,y.length+x.length),E=z=nt=0;z<x.length&&x[z].x<y[0].x;)ot=x[z++],st[E++].h(ot.x,ot.y+b);for(;nt<y.length;)ot=y[nt++],st[E++].h(ot.x,ot.y);for(nt=y[y.length-1].x;z<x.length&&x[z].x<=nt;)z++;for(;z<x.length&&x[z].x>nt;)ot=x[z++],st[E++].h(ot.x,ot.y+b);for(x=oa(a,E),nt=0;nt<E;nt++)x[nt].assign(st[nt]);Bl(a,st),E=x}if(z=vt,nt=ct,ut===null||2>ut.length||z===null||2>z.length)b=null;else{for(st=oa(a,ut.length+z.length),b=ot=x=0;x<ut.length&&ut[x].x<z[0].x;)Et=ut[x++],st[b++].h(Et.x,Et.y);for(;ot<z.length;)Et=z[ot++],st[b++].h(Et.x,Et.y+nt);for(z=z[z.length-1].x;x<ut.length&&ut[x].x<=z;)x++;for(;x<ut.length&&ut[x].x>z;)nt=ut[x++],st[b++].h(nt.x,nt.y);for(z=oa(a,b),x=0;x<b;x++)z[x].assign(st[x]);Bl(a,st),b=z}return z=xt,tt=Math.max(0,ct)+tt.height,Bl(a,y),Bl(a,dt),Bl(a,ut),Bl(a,vt),it[0]=E,it[1]=b,new be(ct,0,z,tt)}function oa(a,y){if(a=a.ru[y],a!==void 0&&(a=a.pop(),a!==void 0))return a;a=[];for(var x=0;x<y;x++)a[x]=new Pt;return a}function Bl(a,y){var x=y.length,E=a.ru[x];E===void 0&&(E=[],a.ru[x]=E),E.push(y)}Xn.prototype.arrangeTrees=function(){if(this.Rb===Im)for(var a=this.Ub.iterator;a.next();){var y=a.value;if(y instanceof sl){var x=y.node;if(x!==null){var E=x.position;x=E.x,E=E.y,isFinite(x)||(x=0),isFinite(E)||(E=0),Fy(this,y,x,E)}}}else{for(a=[],y=this.Ub.iterator;y.next();)x=y.value,x instanceof sl&&a.push(x);switch(this.sorting){case Hd:break;case Cg:a.reverse();break;case kg:a.sort(this.comparer);break;case Mg:a.sort(this.comparer),a.reverse();break;default:It("Unhandled sorting value "+this.sorting.toString())}for(x=this.arrangementOrigin,y=x.x,x=x.y,E=0;E<a.length;E++){var b=a[E];switch(Fy(this,b,y+b.la.x,x+b.la.y),this.Rb){case Om:x+=b.Da.height+this.$d.height;break;case Ry:y+=b.Da.width+this.$d.width;break;default:It("Unhandled arrangement value "+this.Rb.toString())}}}};function Fy(a,y,x,E){if(y!==null){y.x=x,y.y=E,y=y.children;for(var b=y.length,z=0;z<b;z++){var tt=y[z];Fy(a,tt,x+tt.S.x,E+tt.S.y)}}}Xn.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()},Xn.prototype.commitNodes=function(){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)},Xn.prototype.Gu=function(){if(this.layerStyle===Rm){for(var a=this.$v,y=[],x=null,E=this.network.vertexes.iterator;E.next();){var b=E.value;x===null?x=b.bounds.copy():x.ed(b.bounds);var z=y[b.level];z===void 0?z=this.computeLayerSpacing(b):z=Math.max(z,this.computeLayerSpacing(b)),y[b.level]=z}for(E=0;E<y.length;E++)y[E]===void 0&&(y[E]=0);if(this.angle===90||this.angle===270?(x.Bc(this.nodeSpacing/2,this.layerSpacing),E=new Pt(-this.nodeSpacing/2,-this.layerSpacing/2)):(x.Bc(this.layerSpacing,this.nodeSpacing/2),E=new Pt(-this.layerSpacing/2,-this.nodeSpacing/2)),b=[],x=this.angle===90||this.angle===270?x.width:x.height,z=0,this.angle===180||this.angle===270)for(var tt=0;tt<a.length;tt++)z+=a[tt]+y[tt];for(tt=0;tt<a.length;tt++){var it=a[tt]+y[tt];this.angle===270?(z-=it,b.push(new be(0,z,x,it))):this.angle===90?(b.push(new be(0,z,x,it)),z+=it):this.angle===180?(z-=it,b.push(new be(z,0,it,x))):(b.push(new be(z,0,it,x)),z+=it)}this.commitLayers(b,E)}},Xn.prototype.commitLayers=function(){},Xn.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},Xn.prototype.yv=function(){for(var a=this.Ub.iterator;a.next();){var y=a.value;y instanceof sl&&gw(this,y)}};function gw(a,y){if(y!==null){a.setPortSpots(y),y=y.children;for(var x=y.length,E=0;E<x;E++)gw(a,y[E])}}Xn.prototype.setPortSpots=function(a){var y=a.alignment;if(rc(y)){var x=this.ud===pu,E=Ml(a);switch(E){case 0:var b=jo;break;case 90:b=Uo;break;case 180:b=Ro;break;default:b=ro}var z=a.children,tt=z.length;switch(y){case gh:case mu:for(y=0;y<tt;y++){var it=z[y];if(it=(x?it.sourceEdges:it.destinationEdges).first(),it!==null&&(it=it.link,it!==null)){var nt=E===90||E===270?Ro:ro;if(tt===1||y===tt-1&&tt%2===1)switch(E){case 0:nt=Ro;break;case 90:nt=ro;break;case 180:nt=jo;break;default:nt=Uo}else y%2===0&&(nt=E===90||E===270?jo:Uo);x?(a.setsPortSpot&&(it.fromSpot=b),a.setsChildPortSpot&&(it.toSpot=nt)):(a.setsPortSpot&&(it.fromSpot=nt),a.setsChildPortSpot&&(it.toSpot=b))}}break;case vh:for(E=E===90||E===270?jo:Uo,z=x?a.destinationEdges:a.sourceEdges;z.next();)tt=z.value.link,tt!==null&&(x?(a.setsPortSpot&&(tt.fromSpot=b),a.setsChildPortSpot&&(tt.toSpot=E)):(a.setsPortSpot&&(tt.fromSpot=E),a.setsChildPortSpot&&(tt.toSpot=b)));break;case Bu:for(E=E===90||E===270?Ro:ro,z=x?a.destinationEdges:a.sourceEdges;z.next();)tt=z.value.link,tt!==null&&(x?(a.setsPortSpot&&(tt.fromSpot=b),a.setsChildPortSpot&&(tt.toSpot=E)):(a.setsPortSpot&&(tt.fromSpot=E),a.setsChildPortSpot&&(tt.toSpot=b)))}}else if(x=Ml(a),this.ud===pu){for(b=a.destinationEdges;b.next();)if(E=b.value.link,E!==null){if(a.setsPortSpot)if(a.portSpot.Xb())switch(x){case 0:E.fromSpot=jo;break;case 90:E.fromSpot=Uo;break;case 180:E.fromSpot=Ro;break;default:E.fromSpot=ro}else E.fromSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.toSpot=Ro;break;case 90:E.toSpot=ro;break;case 180:E.toSpot=jo;break;default:E.toSpot=Uo}else E.toSpot=a.childPortSpot}}else for(b=a.sourceEdges;b.next();)if(E=b.value.link,E!==null){if(a.setsPortSpot)if(a.portSpot.Xb())switch(x){case 0:E.toSpot=jo;break;case 90:E.toSpot=Uo;break;case 180:E.toSpot=Ro;break;default:E.toSpot=ro}else E.toSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.fromSpot=Ro;break;case 90:E.fromSpot=ro;break;case 180:E.fromSpot=jo;break;default:E.fromSpot=Uo}else E.fromSpot=a.childPortSpot}};function Ml(a){return a=a.angle,45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}Xn.prototype.computeLayerSpacing=function(a){var y=Ml(a);y=y===90||y===270;var x=a.layerSpacing;if(0<a.layerSpacingParentOverlap){var E=Math.min(1,a.layerSpacingParentOverlap);x-=y?a.height*E:a.width*E}return x<(y?-a.height:-a.width)&&(x=y?-a.height:-a.width),x},Xn.prototype.computeNodeIndent=function(a){var y=Ml(a),x=a.nodeIndent;if(0<a.nodeIndentPastParent){var E=Math.min(1,a.nodeIndentPastParent);x+=y===90||y===270?a.width*E:a.height*E}return x=Math.max(0,x)},zi.Object.defineProperties(Xn.prototype,{roots:{get:function(){return this.Ub},set:function(a){this.Ub!==a&&(this.Ub=a,this.C())}},path:{get:function(){return this.Wn},set:function(a){this.Wn!==a&&(this.Wn=a,this.C())}},treeStyle:{get:function(){return this.vo},set:function(a){this.Rb===a||a!==Bm&&a!==Oy&&a!==By&&a!==Iy||(this.vo=a,this.C())}},layerStyle:{get:function(){return this.Bq},set:function(a){this.Rb===a||a!==jy&&a!==zy&&a!==Rm||(this.Bq=a,this.C())}},comments:{get:function(){return this.td},set:function(a){this.td!==a&&(this.td=a,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==Om&&a!==Ry&&a!==Im||(this.Rb=a,this.C())}},arrangementSpacing:{get:function(){return this.$d},set:function(a){this.$d.D(a)||(this.$d.assign(a),this.C())}},rootDefaults:{get:function(){return this.W},set:function(a){this.W!==a&&(this.W=a,this.C())}},alternateDefaults:{get:function(){return this.Y},set:function(a){this.Y!==a&&(this.Y=a,this.C())}},sorting:{get:function(){return this.W.sorting},set:function(a){this.W.sorting===a||a!==Hd&&a!==Cg&&a!==kg&&!Mg||(this.W.sorting=a,this.C())}},comparer:{get:function(){return this.W.comparer},set:function(a){this.W.comparer!==a&&(this.W.comparer=a,this.C())}},angle:{get:function(){return this.W.angle},set:function(a){this.W.angle!==a&&(a===0||a===90||a===180||a===270?(this.W.angle=a,this.C()):It("TreeLayout.angle must be 0, 90, 180, or 270"))}},alignment:{get:function(){return this.W.alignment},set:function(a){this.W.alignment!==a&&(this.W.alignment=a,this.C())}},nodeIndent:{get:function(){return this.W.nodeIndent},set:function(a){this.W.nodeIndent!==a&&0<=a&&(this.W.nodeIndent=a,this.C())}},nodeIndentPastParent:{get:function(){return this.W.nodeIndentPastParent},set:function(a){this.W.nodeIndentPastParent!==a&&0<=a&&1>=a&&(this.W.nodeIndentPastParent=a,this.C())}},nodeSpacing:{get:function(){return this.W.nodeSpacing},set:function(a){this.W.nodeSpacing!==a&&(this.W.nodeSpacing=a,this.C())}},layerSpacing:{get:function(){return this.W.layerSpacing},set:function(a){this.W.layerSpacing!==a&&(this.W.layerSpacing=a,this.C())}},layerSpacingParentOverlap:{get:function(){return this.W.layerSpacingParentOverlap},set:function(a){this.W.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.W.layerSpacingParentOverlap=a,this.C())}},compaction:{get:function(){return this.W.compaction},set:function(a){this.W.compaction===a||a!==Fm&&a!==Eg||(this.W.compaction=a,this.C())}},breadthLimit:{get:function(){return this.W.breadthLimit},set:function(a){this.W.breadthLimit!==a&&0<=a&&(this.W.breadthLimit=a,this.C())}},rowSpacing:{get:function(){return this.W.rowSpacing},set:function(a){this.W.rowSpacing!==a&&(this.W.rowSpacing=a,this.C())}},rowIndent:{get:function(){return this.W.rowIndent},set:function(a){this.W.rowIndent!==a&&0<=a&&(this.W.rowIndent=a,this.C())}},commentSpacing:{get:function(){return this.W.commentSpacing},set:function(a){this.W.commentSpacing!==a&&(this.W.commentSpacing=a,this.C())}},commentMargin:{get:function(){return this.W.commentMargin},set:function(a){this.W.commentMargin!==a&&(this.W.commentMargin=a,this.C())}},setsPortSpot:{get:function(){return this.W.setsPortSpot},set:function(a){this.W.setsPortSpot!==a&&(this.W.setsPortSpot=a,this.C())}},portSpot:{get:function(){return this.W.portSpot},set:function(a){this.W.portSpot.D(a)||(this.W.portSpot=a,this.C())}},setsChildPortSpot:{get:function(){return this.W.setsChildPortSpot},set:function(a){this.W.setsChildPortSpot!==a&&(this.W.setsChildPortSpot=a,this.C())}},childPortSpot:{get:function(){return this.W.childPortSpot},set:function(a){this.W.childPortSpot.D(a)||(this.W.childPortSpot=a,this.C())}},alternateSorting:{get:function(){return this.Y.sorting},set:function(a){this.Y.sorting===a||a!==Hd&&a!==Cg&&a!==kg&&!Mg||(this.Y.sorting=a,this.C())}},alternateComparer:{get:function(){return this.Y.comparer},set:function(a){this.Y.comparer!==a&&(this.Y.comparer=a,this.C())}},alternateAngle:{get:function(){return this.Y.angle},set:function(a){this.Y.angle===a||a!==0&&a!==90&&a!==180&&a!==270||(this.Y.angle=a,this.C())}},alternateAlignment:{get:function(){return this.Y.alignment},set:function(a){this.Y.alignment!==a&&(this.Y.alignment=a,this.C())}},alternateNodeIndent:{get:function(){return this.Y.nodeIndent},set:function(a){this.Y.nodeIndent!==a&&0<=a&&(this.Y.nodeIndent=a,this.C())}},alternateNodeIndentPastParent:{get:function(){return this.Y.nodeIndentPastParent},set:function(a){this.Y.nodeIndentPastParent!==a&&0<=a&&1>=a&&(this.Y.nodeIndentPastParent=a,this.C())}},alternateNodeSpacing:{get:function(){return this.Y.nodeSpacing},set:function(a){this.Y.nodeSpacing!==a&&(this.Y.nodeSpacing=a,this.C())}},alternateLayerSpacing:{get:function(){return this.Y.layerSpacing},set:function(a){this.Y.layerSpacing!==a&&(this.Y.layerSpacing=a,this.C())}},alternateLayerSpacingParentOverlap:{get:function(){return this.Y.layerSpacingParentOverlap},set:function(a){this.Y.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.Y.layerSpacingParentOverlap=a,this.C())}},alternateCompaction:{get:function(){return this.Y.compaction},set:function(a){this.Y.compaction===a||a!==Fm&&a!==Eg||(this.Y.compaction=a,this.C())}},alternateBreadthLimit:{get:function(){return this.Y.breadthLimit},set:function(a){this.Y.breadthLimit!==a&&0<=a&&(this.Y.breadthLimit=a,this.C())}},alternateRowSpacing:{get:function(){return this.Y.rowSpacing},set:function(a){this.Y.rowSpacing!==a&&(this.Y.rowSpacing=a,this.C())}},alternateRowIndent:{get:function(){return this.Y.rowIndent},set:function(a){this.Y.rowIndent!==a&&0<=a&&(this.Y.rowIndent=a,this.C())}},alternateCommentSpacing:{get:function(){return this.Y.commentSpacing},set:function(a){this.Y.commentSpacing!==a&&(this.Y.commentSpacing=a,this.C())}},alternateCommentMargin:{get:function(){return this.Y.commentMargin},set:function(a){this.Y.commentMargin!==a&&(this.Y.commentMargin=a,this.C())}},alternateSetsPortSpot:{get:function(){return this.Y.setsPortSpot},set:function(a){this.Y.setsPortSpot!==a&&(this.Y.setsPortSpot=a,this.C())}},alternatePortSpot:{get:function(){return this.Y.portSpot},set:function(a){this.Y.portSpot.D(a)||(this.Y.portSpot=a,this.C())}},alternateSetsChildPortSpot:{get:function(){return this.Y.setsChildPortSpot},set:function(a){this.Y.setsChildPortSpot!==a&&(this.Y.setsChildPortSpot=a,this.C())}},alternateChildPortSpot:{get:function(){return this.Y.childPortSpot},set:function(a){this.Y.childPortSpot.D(a)||(this.Y.childPortSpot=a,this.C())}}});var Dm=new ze(Xn,"PathDefault",-1),pu=new ze(Xn,"PathDestination",0),Df=new ze(Xn,"PathSource",1),Hd=new ze(Xn,"SortingForwards",10),Cg=new ze(Xn,"SortingReverse",11),kg=new ze(Xn,"SortingAscending",12),Mg=new ze(Xn,"SortingDescending",13),Wd=new ze(Xn,"AlignmentCenterSubtrees",20),Ff=new ze(Xn,"AlignmentCenterChildren",21),gu=new ze(Xn,"AlignmentStart",22),vu=new ze(Xn,"AlignmentEnd",23),gh=new ze(Xn,"AlignmentBus",24),mu=new ze(Xn,"AlignmentBusBranching",25),vh=new ze(Xn,"AlignmentTopLeftBus",26),Bu=new ze(Xn,"AlignmentBottomRightBus",27),Fm=new ze(Xn,"CompactionNone",30),Eg=new ze(Xn,"CompactionBlock",31),Bm=new ze(Xn,"StyleLayered",40),By=new ze(Xn,"StyleLastParents",41),Oy=new ze(Xn,"StyleAlternating",42),Iy=new ze(Xn,"StyleRootOnly",43),Om=new ze(Xn,"ArrangementVertical",50),Ry=new ze(Xn,"ArrangementHorizontal",51),Im=new ze(Xn,"ArrangementFixedRoots",52),jy=new ze(Xn,"LayerIndividual",60),zy=new ze(Xn,"LayerSiblings",61),Rm=new ze(Xn,"LayerUniform",62);Xn.className="TreeLayout",Xn.PathDefault=Dm,Xn.PathDestination=pu,Xn.PathSource=Df,Xn.SortingForwards=Hd,Xn.SortingReverse=Cg,Xn.SortingAscending=kg,Xn.SortingDescending=Mg,Xn.AlignmentCenterSubtrees=Wd,Xn.AlignmentCenterChildren=Ff,Xn.AlignmentStart=gu,Xn.AlignmentEnd=vu,Xn.AlignmentBus=gh,Xn.AlignmentBusBranching=mu,Xn.AlignmentTopLeftBus=vh,Xn.AlignmentBottomRightBus=Bu,Xn.CompactionNone=Fm,Xn.CompactionBlock=Eg,Xn.StyleLayered=Bm,Xn.StyleLastParents=By,Xn.StyleAlternating=Oy,Xn.StyleRootOnly=Iy,Xn.ArrangementVertical=Om,Xn.ArrangementHorizontal=Ry,Xn.ArrangementFixedRoots=Im,Xn.LayerIndividual=jy,Xn.LayerSiblings=zy,Xn.LayerUniform=Rm;function Bf(a){Ir.call(this,a)}Vi(Bf,Ir),Bf.prototype.createVertex=function(){return new sl(this)},Bf.prototype.createEdge=function(){return new Zd(this)},Bf.className="TreeNetwork";function sl(a){Fo.call(this,a),this.V=!1,this.hb=null,this.u=[],this.nb=this.Ha=this.F=this.ia=0,this.td=null,this.S=new Pt(0,0),this.Da=new li(0,0),this.la=new Pt(0,0),this.im=this.hm=this.qA=!1,this.kp=this.Yo=null,this.nd=Hd,this.hd=oy,this.Kb=0,this.Jb=Ff,this.Vq=this.Uq=0,this.Wq=20,this.ie=50,this.Aq=0,this.Hp=Eg,this.Ap=0,this.nr=25,this.Gp=this.mr=10,this.Fp=20,this.xr=!0,this.dr=Fi,this.wr=!0,this.Dp=Fi}Vi(sl,Fo),sl.prototype.copyInheritedPropertiesFrom=function(a){a!==null&&(this.nd=a.sorting,this.hd=a.comparer,this.Kb=a.angle,this.Jb=a.alignment,this.Uq=a.nodeIndent,this.Vq=a.nodeIndentPastParent,this.Wq=a.nodeSpacing,this.ie=a.layerSpacing,this.Aq=a.layerSpacingParentOverlap,this.Hp=a.compaction,this.Ap=a.breadthLimit,this.nr=a.rowSpacing,this.mr=a.rowIndent,this.Gp=a.commentSpacing,this.Fp=a.commentMargin,this.xr=a.setsPortSpot,this.dr=a.portSpot,this.wr=a.setsChildPortSpot,this.Dp=a.childPortSpot)},zi.Object.defineProperties(sl.prototype,{initialized:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}},parent:{get:function(){return this.hb},set:function(a){this.hb!==a&&(this.hb=a)}},children:{get:function(){return this.u},set:function(a){if(this.u!==a){if(a!==null)for(var y=a.length,x=0;x<y;x++);this.u=a}}},level:{get:function(){return this.ia},set:function(a){this.ia!==a&&(this.ia=a)}},descendantCount:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}},maxChildrenCount:{get:function(){return this.Ha},set:function(a){this.Ha!==a&&(this.Ha=a)}},maxGenerationCount:{get:function(){return this.nb},set:function(a){this.nb!==a&&(this.nb=a)}},comments:{get:function(){return this.td},set:function(a){if(this.td!==a){if(a!==null)for(var y=a.length,x=0;x<y;x++);this.td=a}}},sorting:{get:function(){return this.nd},set:function(a){this.nd!==a&&(this.nd=a)}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a)}},angle:{get:function(){return this.Kb},set:function(a){this.Kb!==a&&(this.Kb=a)}},alignment:{get:function(){return this.Jb},set:function(a){this.Jb!==a&&(this.Jb=a)}},nodeIndent:{get:function(){return this.Uq},set:function(a){this.Uq!==a&&(this.Uq=a)}},nodeIndentPastParent:{get:function(){return this.Vq},set:function(a){this.Vq!==a&&(this.Vq=a)}},nodeSpacing:{get:function(){return this.Wq},set:function(a){this.Wq!==a&&(this.Wq=a)}},layerSpacing:{get:function(){return this.ie},set:function(a){this.ie!==a&&(this.ie=a)}},layerSpacingParentOverlap:{get:function(){return this.Aq},set:function(a){this.Aq!==a&&(this.Aq=a)}},compaction:{get:function(){return this.Hp},set:function(a){this.Hp!==a&&(this.Hp=a)}},breadthLimit:{get:function(){return this.Ap},set:function(a){this.Ap!==a&&(this.Ap=a)}},rowSpacing:{get:function(){return this.nr},set:function(a){this.nr!==a&&(this.nr=a)}},rowIndent:{get:function(){return this.mr},set:function(a){this.mr!==a&&(this.mr=a)}},commentSpacing:{get:function(){return this.Gp},set:function(a){this.Gp!==a&&(this.Gp=a)}},commentMargin:{get:function(){return this.Fp},set:function(a){this.Fp!==a&&(this.Fp=a)}},setsPortSpot:{get:function(){return this.xr},set:function(a){this.xr!==a&&(this.xr=a)}},portSpot:{get:function(){return this.dr},set:function(a){this.dr.D(a)||(this.dr=a)}},setsChildPortSpot:{get:function(){return this.wr},set:function(a){this.wr!==a&&(this.wr=a)}},childPortSpot:{get:function(){return this.Dp},set:function(a){this.Dp.D(a)||(this.Dp=a)}},childrenCount:{get:function(){return this.children.length}},relativePosition:{get:function(){return this.S},set:function(a){this.S.set(a)}},subtreeSize:{get:function(){return this.Da},set:function(a){this.Da.set(a)}},subtreeOffset:{get:function(){return this.la},set:function(a){this.la.set(a)}}}),sl.className="TreeVertex";function Zd(a){ma.call(this,a),this.$t=new Pt(0,0)}Vi(Zd,ma),Zd.prototype.commit=function(){var a=this.link;if(a!==null&&!a.isAvoiding){var y=this.network.layout,x=null,E=null;switch(y.ud){case pu:x=this.fromVertex,E=this.toVertex;break;case Df:x=this.toVertex,E=this.fromVertex;break;default:It("Unhandled path value "+y.ud.toString())}if(x!==null&&E!==null){var b=this.$t;if(b.x!==0||b.y!==0||x.qA){E=x.bounds;var z=Ml(x),tt=y.computeLayerSpacing(x),it=x.rowSpacing;a.vg();var nt=a.curve===Aa,ot=a.isOrthogonal,st;if(a.uh(),ot||nt){for(st=2;4<a.pointsCount;)a.pv(2);var ut=a.i(1),ct=a.i(2)}else{for(st=1;3<a.pointsCount;)a.pv(1);ut=a.i(0),ct=a.i(a.pointsCount-1)}var dt=a.i(a.pointsCount-1);z===0?(x.alignment===vu?(z=E.bottom+b.y,b.y===0&&ut.y>dt.y+x.rowIndent&&(z=Math.min(z,Math.max(ut.y,z-y.computeNodeIndent(x))))):x.alignment===gu?(z=E.top+b.y,b.y===0&&ut.y<dt.y-x.rowIndent&&(z=Math.max(z,Math.min(ut.y,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.top-x.la.y+b.y:E.y+E.height/2+b.y,nt?(a.m(st,ut.x,z),st++,a.m(st,E.right+tt,z),st++,a.m(st,E.right+tt+(b.x-it)/3,z),st++,a.m(st,E.right+tt+2*(b.x-it)/3,z),st++,a.m(st,E.right+tt+(b.x-it),z),st++,a.m(st,ct.x,z)):(ot&&(a.m(st,E.right+tt/2,ut.y),st++),a.m(st,E.right+tt/2,z),st++,a.m(st,E.right+tt+b.x-(ot?it/2:it),z),st++,ot&&a.m(st,a.i(st-1).x,ct.y))):z===90?(x.alignment===vu?(z=E.right+b.x,b.x===0&&ut.x>dt.x+x.rowIndent&&(z=Math.min(z,Math.max(ut.x,z-y.computeNodeIndent(x))))):x.alignment===gu?(z=E.left+b.x,b.x===0&&ut.x<dt.x-x.rowIndent&&(z=Math.max(z,Math.min(ut.x,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.left-x.la.x+b.x:E.x+E.width/2+b.x,nt?(a.m(st,z,ut.y),st++,a.m(st,z,E.bottom+tt),st++,a.m(st,z,E.bottom+tt+(b.y-it)/3),st++,a.m(st,z,E.bottom+tt+2*(b.y-it)/3),st++,a.m(st,z,E.bottom+tt+(b.y-it)),st++,a.m(st,z,ct.y)):(ot&&(a.m(st,ut.x,E.bottom+tt/2),st++),a.m(st,z,E.bottom+tt/2),st++,a.m(st,z,E.bottom+tt+b.y-(ot?it/2:it)),st++,ot&&a.m(st,ct.x,a.i(st-1).y))):z===180?(x.alignment===vu?(z=E.bottom+b.y,b.y===0&&ut.y>dt.y+x.rowIndent&&(z=Math.min(z,Math.max(ut.y,z-y.computeNodeIndent(x))))):x.alignment===gu?(z=E.top+b.y,b.y===0&&ut.y<dt.y-x.rowIndent&&(z=Math.max(z,Math.min(ut.y,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.top-x.la.y+b.y:E.y+E.height/2+b.y,nt?(a.m(st,ut.x,z),st++,a.m(st,E.left-tt,z),st++,a.m(st,E.left-tt+(b.x+it)/3,z),st++,a.m(st,E.left-tt+2*(b.x+it)/3,z),st++,a.m(st,E.left-tt+(b.x+it),z),st++,a.m(st,ct.x,z)):(ot&&(a.m(st,E.left-tt/2,ut.y),st++),a.m(st,E.left-tt/2,z),st++,a.m(st,E.left-tt+b.x+(ot?it/2:it),z),st++,ot&&a.m(st,a.i(st-1).x,ct.y))):z===270?(x.alignment===vu?(z=E.right+b.x,b.x===0&&ut.x>dt.x+x.rowIndent&&(z=Math.min(z,Math.max(ut.x,z-y.computeNodeIndent(x))))):x.alignment===gu?(z=E.left+b.x,b.x===0&&ut.x<dt.x-x.rowIndent&&(z=Math.max(z,Math.min(ut.x,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.left-x.la.x+b.x:E.x+E.width/2+b.x,nt?(a.m(st,z,ut.y),st++,a.m(st,z,E.top-tt),st++,a.m(st,z,E.top-tt+(b.y+it)/3),st++,a.m(st,z,E.top-tt+2*(b.y+it)/3),st++,a.m(st,z,E.top-tt+(b.y+it)),st++,a.m(st,z,ct.y)):(ot&&(a.m(st,ut.x,E.top-tt/2),st++),a.m(st,z,E.top-tt/2),st++,a.m(st,z,E.top-tt+b.y+(ot?it/2:it)),st++,ot&&a.m(st,ct.x,a.i(st-1).y))):It("Invalid angle "+z),a.zf()}else b=E,a=this.link,E=this.network.layout,y=Ml(x),y!==Ml(b)&&(tt=E.computeLayerSpacing(x),it=x.bounds,x=b.bounds,y===0&&x.left-it.right<tt+1||y===90&&x.top-it.bottom<tt+1||y===180&&it.left-x.right<tt+1||y===270&&it.top-x.bottom<tt+1||(a.vg(),x=a.curve===Aa,b=a.isOrthogonal,E=rc(this.fromVertex.alignment),a.uh(),y===0?(y=it.right+tt/2,x?a.pointsCount===4&&(x=a.i(3).y,a.L(1,y-20,a.i(1).y),a.m(2,y-20,x),a.m(3,y,x),a.m(4,y+20,x),a.L(5,a.i(5).x,x)):b?E?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,y,a.i(2).y),a.L(3,y,a.i(3).y)):a.pointsCount===4?a.m(2,y,a.i(2).y):a.pointsCount===3?a.L(1,y,a.i(2).y):a.pointsCount===2&&a.m(1,y,a.i(1).y)):y===90?(y=it.bottom+tt/2,x?a.pointsCount===4&&(x=a.i(3).x,a.L(1,a.i(1).x,y-20),a.m(2,x,y-20),a.m(3,x,y),a.m(4,x,y+20),a.L(5,x,a.i(5).y)):b?E?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,a.i(2).x,y),a.L(3,a.i(3).x,y)):a.pointsCount===4?a.m(2,a.i(2).x,y):a.pointsCount===3?a.L(1,a.i(2).x,y):a.pointsCount===2&&a.m(1,a.i(1).x,y)):y===180?(y=it.left-tt/2,x?a.pointsCount===4&&(x=a.i(3).y,a.L(1,y+20,a.i(1).y),a.m(2,y+20,x),a.m(3,y,x),a.m(4,y-20,x),a.L(5,a.i(5).x,x)):b?E?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,y,a.i(2).y),a.L(3,y,a.i(3).y)):a.pointsCount===4?a.m(2,y,a.i(2).y):a.pointsCount===3?a.L(1,y,a.i(2).y):a.pointsCount===2&&a.m(1,y,a.i(1).y)):y===270&&(y=it.top-tt/2,x?a.pointsCount===4&&(x=a.i(3).x,a.L(1,a.i(1).x,y+20),a.m(2,x,y+20),a.m(3,x,y),a.m(4,x,y-20),a.L(5,x,a.i(5).y)):b?E?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,a.i(2).x,y),a.L(3,a.i(3).x,y)):a.pointsCount===4?a.m(2,a.i(2).x,y):a.pointsCount===3?a.L(1,a.i(2).x,y):a.pointsCount===2&&a.m(1,a.i(1).x,y)),a.zf()))}}},zi.Object.defineProperties(Zd.prototype,{fromVertex:{get:function(){return this.kd},set:function(a){this.kd!==a&&(this.kd=a)}},toVertex:{get:function(){return this.qd},set:function(a){this.qd!==a&&(this.qd=a)}},relativePoint:{get:function(){return this.$t},set:function(a){this.$t.set(a)}}}),Zd.className="TreeEdge",Ur.prototype.initializeStandardTools=function(){this.gb("Action",new qa,this.mouseDownTools),this.gb("Relinking",new ba,this.mouseDownTools),this.gb("LinkReshaping",new wo,this.mouseDownTools),this.gb("Rotating",new Ds,this.mouseDownTools),this.gb("Resizing",new ds,this.mouseDownTools),this.gb("Linking",new As,this.mouseMoveTools),this.gb("Dragging",new to,this.mouseMoveTools),this.gb("DragSelecting",new ja,this.mouseMoveTools),this.gb("Panning",new ls,this.mouseMoveTools),this.gb("ContextMenu",new Fs,this.mouseUpTools),this.gb("TextEditing",new Wr,this.mouseUpTools),this.gb("ClickCreating",new Ju,this.mouseUpTools),this.gb("ClickSelecting",new Ah,this.mouseUpTools)},Ul("Horizontal",new fv),Ul("Spot",new pv),Ul("Table",new vv),Ul("Viewbox",new xv),Ul("TableRow",new mv),Ul("TableColumn",new yv),Ul("Graduated",new Hp),Ul("Grid",new _p),fd.add("GraphLinksModel",Vo),fd.add("TreeModel",Ga);var jm=Xe.go,_y={get licenseKey(){return le.licenseKey},set licenseKey(a){le.licenseKey=a},get version(){return le.version},Group:An,EnumValue:ze,List:Me,Set:_e,Map:ji,Point:Pt,Size:li,Rect:be,Margin:jn,Spot:nn,Geometry:ci,PathFigure:zo,PathSegment:pr,InputEvent:ws,DiagramEvent:Hu,ChangedEvent:Jr,Model:Ji,GraphLinksModel:sr,TreeModel:Hs,Binding:Co,Transaction:Ko,UndoManager:qr,CommandHandler:Nt,Tool:hr,DraggingTool:to,DraggingInfo:Nu,DraggingOptions:rt,LinkingBaseTool:co,LinkingTool:As,RelinkingTool:ba,LinkReshapingTool:wo,ResizingTool:ds,RotatingTool:Ds,ClickSelectingTool:Ah,ActionTool:qa,ClickCreatingTool:Ju,HTMLInfo:Wl,ContextMenuTool:Fs,DragSelectingTool:ja,PanningTool:ls,TextEditingTool:Wr,ToolManager:Ur,Animation:us,AnimationManager:pa,AnimationTrigger:vl,Layer:Yo,Diagram:le,Palette:lt,Overview:ht,Brush:kr,GraphObject:Kt,Panel:si,RowColumnDefinition:To,Shape:Rn,TextBlock:Or,Picture:Qs,Part:tn,Adornment:cr,Node:Ci,Link:fi,Placeholder:Rs,Layout:Gr,LayoutNetwork:Ir,LayoutVertex:Fo,LayoutEdge:ma,GridLayout:is,PanelLayout:Do,CircularLayout:eo,CircularNetwork:jd,CircularVertex:gg,CircularEdge:ym,ForceDirectedLayout:cs,ForceDirectedNetwork:Lf,ForceDirectedVertex:vg,ForceDirectedEdge:mg,LayeredDigraphLayout:Er,LayeredDigraphNetwork:_d,LayeredDigraphVertex:Ya,LayeredDigraphEdge:wg,TreeLayout:Xn,TreeNetwork:Bf,TreeVertex:sl,TreeEdge:Zd};typeof jm=="object"&&jm.version&&Di("WARNING: a `go` object on the root object is already defined. "+("Debug"in jm?"debug ":"")+"version: "+jm.version+", replaced with version: "+_y.version),le.prototype.go=_y,Xe.go=_y,typeof Li.exports=="object"&&(Li.exports=typeof Mt.g!="undefined"?Mt.g.go:self.go)}();var pt=typeof Mt.g!="undefined"?Mt.g.go:self.go;const _t=typeof Mt.g!="undefined"?Mt.g.go:self.go,ce=_t.Group,me=_t.EnumValue,Ut=_t.List,fe=_t.Set,$t=_t.Map,Ae=_t.Point,re=_t.Size,Dt=_t.Rect,de=_t.Margin,zt=_t.Spot,Ne=_t.Geometry,ue=_t.PathFigure,qt=_t.PathSegment,Qt=_t.InputEvent,Jt=_t.DiagramEvent,Pe=_t.ChangedEvent,je=_t.Model,De=_t.GraphLinksModel,Yt=_t.TreeModel,Vt=_t.Binding,pe=_t.Transaction,Xt=_t.UndoManager,Le=_t.CommandHandler,Wt=_t.Tool,Ce=_t.DraggingTool,Te=_t.DraggingInfo,ne=_t.LinkingBaseTool,Re=_t.LinkingTool,ye=_t.RelinkingTool,Ie=_t.LinkReshapingTool,Ai=_t.ResizingTool,yi=_t.RotatingTool,gi=_t.ClickSelectingTool,oi=_t.ActionTool,Bt=_t.ClickCreatingTool,bt=_t.HTMLInfo,ge=_t.ContextMenuTool,Ge=_t.DragSelectingTool,Ye=_t.PanningTool,oe=_t.TextEditingTool,Ve=_t.ToolManager,Ze=_t.Animation,Ni=_t.AnimationManager,Se=_t.AnimationTrigger,ie=_t.Layer,ee=_t.Diagram,ve=_t.Palette,ti=_t.Overview,he=_t.Brush,We=_t.GraphObject,He=_t.Panel,we=_t.RowColumnDefinition,ei=_t.Shape,Be=_t.TextBlock,Zt=_t.TextBlockMetrics,Je=_t.Picture,Ri=_t.Part,Pi=_t.Adornment,Ct=_t.Node,gt=_t.Link,ft=_t.Placeholder,St=_t.Layout,At=_t.LayoutNetwork,wt=_t.LayoutVertex,te=_t.LayoutEdge,ni=_t.GridLayout,ui=_t.PanelLayout,qe=_t.CircularLayout,xe=_t.CircularNetwork,Zi=_t.CircularVertex,Si=_t.CircularEdge,Oi=_t.ForceDirectedLayout,Qi=_t.ForceDirectedNetwork,Cn=_t.ForceDirectedVertex,_i=_t.ForceDirectedEdge,Mn=_t.LayeredDigraphLayout,er=_t.LayeredDigraphNetwork,ir=_t.LayeredDigraphVertex,fr=_t.LayeredDigraphEdge,ar=_t.TreeLayout,br=_t.TreeNetwork,Qn=_t.TreeVertex,Nn=_t.TreeEdge,yr=_t.version},66042:function(Li,ai,Mt){"use strict";Mt.d(ai,{Z:function(){return Re}});var pt=Mt(33885),_t=Mt(42978),ce=Mt(43403),me=Mt(34280),Ut=Mt(59301),fe=Ut.createContext(null),$t=Ut.createContext({}),Ae=fe,re=Mt(20068),Dt=Mt(54476),de=Mt(92310),zt=Mt.n(de),Ne=Mt(77900),ue=Mt(10228),qt=Mt(26112),Qt=Mt(75931),Jt=Mt(8654),Pe=["prefixCls","className","containerRef"],je=function(Ie){var Ai=Ie.prefixCls,yi=Ie.className,gi=Ie.containerRef,oi=(0,Qt.Z)(Ie,Pe),Bt=Ut.useContext($t),bt=Bt.panel,ge=(0,Jt.x1)(bt,gi);return Ut.createElement("div",(0,Dt.Z)({className:zt()("".concat(Ai,"-content"),yi),role:"dialog",ref:ge},(0,qt.Z)(Ie,{aria:!0}),{"aria-modal":"true"},oi))},De=je,Yt=Mt(48736);function Vt(ye){return typeof ye=="string"&&String(Number(ye))===ye?((0,Yt.ZP)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(ye)):ye}function pe(ye){warning(!("wrapperClassName"in ye),"'wrapperClassName' is removed. Please use 'rootClassName' instead."),warning(canUseDom()||!ye.open,"Drawer with 'open' in SSR is not work since no place to createPortal. Please move to 'useEffect' instead.")}var Xt={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function Le(ye,Ie){var Ai,yi,gi,oi=ye.prefixCls,Bt=ye.open,bt=ye.placement,ge=ye.inline,Ge=ye.push,Ye=ye.forceRender,oe=ye.autoFocus,Ve=ye.keyboard,Ze=ye.classNames,Ni=ye.rootClassName,Se=ye.rootStyle,ie=ye.zIndex,ee=ye.className,ve=ye.id,ti=ye.style,he=ye.motion,We=ye.width,He=ye.height,we=ye.children,ei=ye.mask,Be=ye.maskClosable,Zt=ye.maskMotion,Je=ye.maskClassName,Ri=ye.maskStyle,Pi=ye.afterOpenChange,Ct=ye.onClose,gt=ye.onMouseEnter,ft=ye.onMouseOver,St=ye.onMouseLeave,At=ye.onClick,wt=ye.onKeyDown,te=ye.onKeyUp,ni=ye.styles,ui=ye.drawerRender,qe=Ut.useRef(),xe=Ut.useRef(),Zi=Ut.useRef();Ut.useImperativeHandle(Ie,function(){return qe.current});var Si=function(on){var Ui=on.keyCode,an=on.shiftKey;switch(Ui){case ue.Z.TAB:{if(Ui===ue.Z.TAB){if(!an&&document.activeElement===Zi.current){var vi;(vi=xe.current)===null||vi===void 0||vi.focus({preventScroll:!0})}else if(an&&document.activeElement===xe.current){var di;(di=Zi.current)===null||di===void 0||di.focus({preventScroll:!0})}}break}case ue.Z.ESC:{Ct&&Ve&&(on.stopPropagation(),Ct(on));break}}};Ut.useEffect(function(){if(Bt&&oe){var Mi;(Mi=qe.current)===null||Mi===void 0||Mi.focus({preventScroll:!0})}},[Bt]);var Oi=Ut.useState(!1),Qi=(0,_t.Z)(Oi,2),Cn=Qi[0],_i=Qi[1],Mn=Ut.useContext(Ae),er;typeof Ge=="boolean"?er=Ge?{}:{distance:0}:er=Ge||{};var ir=(Ai=(yi=(gi=er)===null||gi===void 0?void 0:gi.distance)!==null&&yi!==void 0?yi:Mn==null?void 0:Mn.pushDistance)!==null&&Ai!==void 0?Ai:180,fr=Ut.useMemo(function(){return{pushDistance:ir,push:function(){_i(!0)},pull:function(){_i(!1)}}},[ir]);Ut.useEffect(function(){if(Bt){var Mi;Mn==null||(Mi=Mn.push)===null||Mi===void 0||Mi.call(Mn)}else{var on;Mn==null||(on=Mn.pull)===null||on===void 0||on.call(Mn)}},[Bt]),Ut.useEffect(function(){return function(){var Mi;Mn==null||(Mi=Mn.pull)===null||Mi===void 0||Mi.call(Mn)}},[]);var ar=ei&&Ut.createElement(Ne.default,(0,Dt.Z)({key:"mask"},Zt,{visible:Bt}),function(Mi,on){var Ui=Mi.className,an=Mi.style;return Ut.createElement("div",{className:zt()("".concat(oi,"-mask"),Ui,Ze==null?void 0:Ze.mask,Je),style:(0,pt.Z)((0,pt.Z)((0,pt.Z)({},an),Ri),ni==null?void 0:ni.mask),onClick:Be&&Bt?Ct:void 0,ref:on})}),br=typeof he=="function"?he(bt):he,Qn={};if(Cn&&ir)switch(bt){case"top":Qn.transform="translateY(".concat(ir,"px)");break;case"bottom":Qn.transform="translateY(".concat(-ir,"px)");break;case"left":Qn.transform="translateX(".concat(ir,"px)");break;default:Qn.transform="translateX(".concat(-ir,"px)");break}bt==="left"||bt==="right"?Qn.width=Vt(We):Qn.height=Vt(He);var Nn={onMouseEnter:gt,onMouseOver:ft,onMouseLeave:St,onClick:At,onKeyDown:wt,onKeyUp:te},yr=Ut.createElement(Ne.default,(0,Dt.Z)({key:"panel"},br,{visible:Bt,forceRender:Ye,onVisibleChanged:function(on){Pi==null||Pi(on)},removeOnLeave:!1,leavedClassName:"".concat(oi,"-content-wrapper-hidden")}),function(Mi,on){var Ui=Mi.className,an=Mi.style,vi=Ut.createElement(De,(0,Dt.Z)({id:ve,containerRef:on,prefixCls:oi,className:zt()(ee,Ze==null?void 0:Ze.content),style:(0,pt.Z)((0,pt.Z)({},ti),ni==null?void 0:ni.content)},(0,qt.Z)(ye,{aria:!0}),Nn),we);return Ut.createElement("div",(0,Dt.Z)({className:zt()("".concat(oi,"-content-wrapper"),Ze==null?void 0:Ze.wrapper,Ui),style:(0,pt.Z)((0,pt.Z)((0,pt.Z)({},Qn),an),ni==null?void 0:ni.wrapper)},(0,qt.Z)(ye,{data:!0})),ui?ui(vi):vi)}),yt=(0,pt.Z)({},Se);return ie&&(yt.zIndex=ie),Ut.createElement(Ae.Provider,{value:fr},Ut.createElement("div",{className:zt()(oi,"".concat(oi,"-").concat(bt),Ni,(0,re.Z)((0,re.Z)({},"".concat(oi,"-open"),Bt),"".concat(oi,"-inline"),ge)),style:yt,tabIndex:-1,ref:qe,onKeyDown:Si},ar,Ut.createElement("div",{tabIndex:0,ref:xe,style:Xt,"aria-hidden":"true","data-sentinel":"start"}),yr,Ut.createElement("div",{tabIndex:0,ref:Zi,style:Xt,"aria-hidden":"true","data-sentinel":"end"})))}var Wt=Ut.forwardRef(Le),Ce=Wt,Te=function(Ie){var Ai=Ie.open,yi=Ai===void 0?!1:Ai,gi=Ie.prefixCls,oi=gi===void 0?"rc-drawer":gi,Bt=Ie.placement,bt=Bt===void 0?"right":Bt,ge=Ie.autoFocus,Ge=ge===void 0?!0:ge,Ye=Ie.keyboard,oe=Ye===void 0?!0:Ye,Ve=Ie.width,Ze=Ve===void 0?378:Ve,Ni=Ie.mask,Se=Ni===void 0?!0:Ni,ie=Ie.maskClosable,ee=ie===void 0?!0:ie,ve=Ie.getContainer,ti=Ie.forceRender,he=Ie.afterOpenChange,We=Ie.destroyOnClose,He=Ie.onMouseEnter,we=Ie.onMouseOver,ei=Ie.onMouseLeave,Be=Ie.onClick,Zt=Ie.onKeyDown,Je=Ie.onKeyUp,Ri=Ie.panelRef,Pi=Ut.useState(!1),Ct=(0,_t.Z)(Pi,2),gt=Ct[0],ft=Ct[1],St=Ut.useState(!1),At=(0,_t.Z)(St,2),wt=At[0],te=At[1];(0,me.Z)(function(){te(!0)},[]);var ni=wt?yi:!1,ui=Ut.useRef(),qe=Ut.useRef();(0,me.Z)(function(){ni&&(qe.current=document.activeElement)},[ni]);var xe=function(Cn){var _i;if(ft(Cn),he==null||he(Cn),!Cn&&qe.current&&!((_i=ui.current)!==null&&_i!==void 0&&_i.contains(qe.current))){var Mn;(Mn=qe.current)===null||Mn===void 0||Mn.focus({preventScroll:!0})}},Zi=Ut.useMemo(function(){return{panel:Ri}},[Ri]);if(!ti&&!gt&&!ni&&We)return null;var Si={onMouseEnter:He,onMouseOver:we,onMouseLeave:ei,onClick:Be,onKeyDown:Zt,onKeyUp:Je},Oi=(0,pt.Z)((0,pt.Z)({},Ie),{},{open:ni,prefixCls:oi,placement:bt,autoFocus:Ge,keyboard:oe,width:Ze,mask:Se,maskClosable:ee,inline:ve===!1,afterOpenChange:xe,ref:ui},Si);return Ut.createElement($t.Provider,{value:Zi},Ut.createElement(ce.Z,{open:ni||ti||gt,autoDestroy:!1,getContainer:ve,autoLock:Se&&(ni||gt)},Ut.createElement(Ce,Oi)))},ne=Te,Re=ne},20922:function(Li,ai,Mt){"use strict";Mt.d(ai,{Z:function(){return Se}});var pt=Mt(54476),_t=Mt(20068),ce=Mt(76190),me=Mt(42978),Ut=Mt(75931),fe=Mt(67732),$t=Mt(83652);function Ae(){return typeof BigInt=="function"}function re(ie){return!ie&&ie!==0&&!Number.isNaN(ie)||!String(ie).trim()}function Dt(ie){var ee=ie.trim(),ve=ee.startsWith("-");ve&&(ee=ee.slice(1)),ee=ee.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),ee.startsWith(".")&&(ee="0".concat(ee));var ti=ee||"0",he=ti.split("."),We=he[0]||"0",He=he[1]||"0";We==="0"&&He==="0"&&(ve=!1);var we=ve?"-":"";return{negative:ve,negativeStr:we,trimStr:ti,integerStr:We,decimalStr:He,fullStr:"".concat(we).concat(ti)}}function de(ie){var ee=String(ie);return!Number.isNaN(Number(ee))&&ee.includes("e")}function zt(ie){var ee=String(ie);if(de(ie)){var ve=Number(ee.slice(ee.indexOf("e-")+2)),ti=ee.match(/\.(\d+)/);return ti!=null&&ti[1]&&(ve+=ti[1].length),ve}return ee.includes(".")&&ue(ee)?ee.length-ee.indexOf(".")-1:0}function Ne(ie){var ee=String(ie);if(de(ie)){if(ie>Number.MAX_SAFE_INTEGER)return String(Ae()?BigInt(ie).toString():Number.MAX_SAFE_INTEGER);if(ie<Number.MIN_SAFE_INTEGER)return String(Ae()?BigInt(ie).toString():Number.MIN_SAFE_INTEGER);ee=ie.toFixed(zt(ee))}return Dt(ee).fullStr}function ue(ie){return typeof ie=="number"?!Number.isNaN(ie):ie?/^\s*-?\d+(\.\d+)?\s*$/.test(ie)||/^\s*-?\d+\.\s*$/.test(ie)||/^\s*-?\.\d+\s*$/.test(ie):!1}var qt=function(){function ie(ee){if((0,fe.Z)(this,ie),(0,_t.Z)(this,"origin",""),(0,_t.Z)(this,"negative",void 0),(0,_t.Z)(this,"integer",void 0),(0,_t.Z)(this,"decimal",void 0),(0,_t.Z)(this,"decimalLen",void 0),(0,_t.Z)(this,"empty",void 0),(0,_t.Z)(this,"nan",void 0),re(ee)){this.empty=!0;return}if(this.origin=String(ee),ee==="-"||Number.isNaN(ee)){this.nan=!0;return}var ve=ee;if(de(ve)&&(ve=Number(ve)),ve=typeof ve=="string"?ve:Ne(ve),ue(ve)){var ti=Dt(ve);this.negative=ti.negative;var he=ti.trimStr.split(".");this.integer=BigInt(he[0]);var We=he[1]||"0";this.decimal=BigInt(We),this.decimalLen=We.length}else this.nan=!0}return(0,$t.Z)(ie,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(ve){var ti="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(ve,"0"));return BigInt(ti)}},{key:"negate",value:function(){var ve=new ie(this.toString());return ve.negative=!ve.negative,ve}},{key:"cal",value:function(ve,ti,he){var We=Math.max(this.getDecimalStr().length,ve.getDecimalStr().length),He=this.alignDecimal(We),we=ve.alignDecimal(We),ei=ti(He,we).toString(),Be=he(We),Zt=Dt(ei),Je=Zt.negativeStr,Ri=Zt.trimStr,Pi="".concat(Je).concat(Ri.padStart(Be+1,"0"));return new ie("".concat(Pi.slice(0,-Be),".").concat(Pi.slice(-Be)))}},{key:"add",value:function(ve){if(this.isInvalidate())return new ie(ve);var ti=new ie(ve);return ti.isInvalidate()?this:this.cal(ti,function(he,We){return he+We},function(he){return he})}},{key:"multi",value:function(ve){var ti=new ie(ve);return this.isInvalidate()||ti.isInvalidate()?new ie(NaN):this.cal(ti,function(he,We){return he*We},function(he){return he*2})}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(ve){return this.toString()===(ve==null?void 0:ve.toString())}},{key:"lessEquals",value:function(ve){return this.add(ve.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return ve?this.isInvalidate()?"":Dt("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),ie}(),Qt=function(){function ie(ee){if((0,fe.Z)(this,ie),(0,_t.Z)(this,"origin",""),(0,_t.Z)(this,"number",void 0),(0,_t.Z)(this,"empty",void 0),re(ee)){this.empty=!0;return}this.origin=String(ee),this.number=Number(ee)}return(0,$t.Z)(ie,[{key:"negate",value:function(){return new ie(-this.toNumber())}},{key:"add",value:function(ve){if(this.isInvalidate())return new ie(ve);var ti=Number(ve);if(Number.isNaN(ti))return this;var he=this.number+ti;if(he>Number.MAX_SAFE_INTEGER)return new ie(Number.MAX_SAFE_INTEGER);if(he<Number.MIN_SAFE_INTEGER)return new ie(Number.MIN_SAFE_INTEGER);var We=Math.max(zt(this.number),zt(ti));return new ie(he.toFixed(We))}},{key:"multi",value:function(ve){var ti=Number(ve);if(this.isInvalidate()||Number.isNaN(ti))return new ie(NaN);var he=this.number*ti;if(he>Number.MAX_SAFE_INTEGER)return new ie(Number.MAX_SAFE_INTEGER);if(he<Number.MIN_SAFE_INTEGER)return new ie(Number.MIN_SAFE_INTEGER);var We=Math.max(zt(this.number),zt(ti));return new ie(he.toFixed(We))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(ve){return this.toNumber()===(ve==null?void 0:ve.toNumber())}},{key:"lessEquals",value:function(ve){return this.add(ve.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return ve?this.isInvalidate()?"":Ne(this.number):this.origin}}]),ie}();function Jt(ie){return Ae()?new qt(ie):new Qt(ie)}function Pe(ie,ee,ve){var ti=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(ie==="")return"";var he=Dt(ie),We=he.negativeStr,He=he.integerStr,we=he.decimalStr,ei="".concat(ee).concat(we),Be="".concat(We).concat(He);if(ve>=0){var Zt=Number(we[ve]);if(Zt>=5&&!ti){var Je=Jt(ie).add("".concat(We,"0.").concat("0".repeat(ve)).concat(10-Zt));return Pe(Je.toString(),ee,ve,ti)}return ve===0?Be:"".concat(Be).concat(ee).concat(we.padEnd(ve,"0").slice(0,ve))}return ei===".0"?Be:"".concat(Be).concat(ei)}var je=Jt,De=Mt(92310),Yt=Mt.n(De),Vt=Mt(36901),pe=Mt(34280);function Xt(ie,ee){return typeof Proxy!="undefined"&&ie?new Proxy(ie,{get:function(ti,he){if(ee[he])return ee[he];var We=ti[he];return typeof We=="function"?We.bind(ti):We}}):ie}var Le=Mt(8654),Wt=Mt(59301),Ce=Mt(48736);function Te(ie,ee){var ve=(0,Wt.useRef)(null);function ti(){try{var We=ie.selectionStart,He=ie.selectionEnd,we=ie.value,ei=we.substring(0,We),Be=we.substring(He);ve.current={start:We,end:He,value:we,beforeTxt:ei,afterTxt:Be}}catch(Zt){}}function he(){if(ie&&ve.current&&ee)try{var We=ie.value,He=ve.current,we=He.beforeTxt,ei=He.afterTxt,Be=He.start,Zt=We.length;if(We.startsWith(we))Zt=we.length;else if(We.endsWith(ei))Zt=We.length-ve.current.afterTxt.length;else{var Je=we[Be-1],Ri=We.indexOf(Je,Be-1);Ri!==-1&&(Zt=Ri+1)}ie.setSelectionRange(Zt,Zt)}catch(Pi){(0,Ce.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(Pi.message))}}return[ti,he]}var ne=Mt(49658),Re=function(){var ee=(0,Wt.useState)(!1),ve=(0,me.Z)(ee,2),ti=ve[0],he=ve[1];return(0,pe.Z)(function(){he((0,ne.Z)())},[]),ti},ye=Re,Ie=Mt(16089),Ai=200,yi=600;function gi(ie){var ee=ie.prefixCls,ve=ie.upNode,ti=ie.downNode,he=ie.upDisabled,We=ie.downDisabled,He=ie.onStep,we=Wt.useRef(),ei=Wt.useRef([]),Be=Wt.useRef();Be.current=He;var Zt=function(){clearTimeout(we.current)},Je=function(wt,te){wt.preventDefault(),Zt(),Be.current(te);function ni(){Be.current(te),we.current=setTimeout(ni,Ai)}we.current=setTimeout(ni,yi)};Wt.useEffect(function(){return function(){Zt(),ei.current.forEach(function(At){return Ie.Z.cancel(At)})}},[]);var Ri=ye();if(Ri)return null;var Pi="".concat(ee,"-handler"),Ct=Yt()(Pi,"".concat(Pi,"-up"),(0,_t.Z)({},"".concat(Pi,"-up-disabled"),he)),gt=Yt()(Pi,"".concat(Pi,"-down"),(0,_t.Z)({},"".concat(Pi,"-down-disabled"),We)),ft=function(){return ei.current.push((0,Ie.Z)(Zt))},St={unselectable:"on",role:"button",onMouseUp:ft,onMouseLeave:ft};return Wt.createElement("div",{className:"".concat(Pi,"-wrap")},Wt.createElement("span",(0,pt.Z)({},St,{onMouseDown:function(wt){Je(wt,!0)},"aria-label":"Increase Value","aria-disabled":he,className:Ct}),ve||Wt.createElement("span",{unselectable:"on",className:"".concat(ee,"-handler-up-inner")})),Wt.createElement("span",(0,pt.Z)({},St,{onMouseDown:function(wt){Je(wt,!1)},"aria-label":"Decrease Value","aria-disabled":We,className:gt}),ti||Wt.createElement("span",{unselectable:"on",className:"".concat(ee,"-handler-down-inner")})))}function oi(ie){var ee=typeof ie=="number"?Ne(ie):Dt(ie).fullStr,ve=ee.includes(".");return ve?Dt(ee.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:ie+"0"}var Bt=Mt(30292),bt=function(){var ie=(0,Wt.useRef)(0),ee=function(){Ie.Z.cancel(ie.current)};return(0,Wt.useEffect)(function(){return ee},[]),function(ve){ee(),ie.current=(0,Ie.Z)(function(){ve()})}},ge=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","changeOnWheel","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","changeOnBlur","domRef"],Ge=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","className","classNames"],Ye=function(ee,ve){return ee||ve.isEmpty()?ve.toString():ve.toNumber()},oe=function(ee){var ve=je(ee);return ve.isInvalidate()?null:ve},Ve=Wt.forwardRef(function(ie,ee){var ve=ie.prefixCls,ti=ie.className,he=ie.style,We=ie.min,He=ie.max,we=ie.step,ei=we===void 0?1:we,Be=ie.defaultValue,Zt=ie.value,Je=ie.disabled,Ri=ie.readOnly,Pi=ie.upHandler,Ct=ie.downHandler,gt=ie.keyboard,ft=ie.changeOnWheel,St=ft===void 0?!1:ft,At=ie.controls,wt=At===void 0?!0:At,te=ie.classNames,ni=ie.stringMode,ui=ie.parser,qe=ie.formatter,xe=ie.precision,Zi=ie.decimalSeparator,Si=ie.onChange,Oi=ie.onInput,Qi=ie.onPressEnter,Cn=ie.onStep,_i=ie.changeOnBlur,Mn=_i===void 0?!0:_i,er=ie.domRef,ir=(0,Ut.Z)(ie,ge),fr="".concat(ve,"-input"),ar=Wt.useRef(null),br=Wt.useState(!1),Qn=(0,me.Z)(br,2),Nn=Qn[0],yr=Qn[1],yt=Wt.useRef(!1),Mi=Wt.useRef(!1),on=Wt.useRef(!1),Ui=Wt.useState(function(){return je(Zt!=null?Zt:Be)}),an=(0,me.Z)(Ui,2),vi=an[0],di=an[1];function xn(ze){Zt===void 0&&di(ze)}var en=Wt.useCallback(function(ze,gn){if(!gn)return xe>=0?xe:Math.max(zt(ze),zt(ei))},[xe,ei]),hn=Wt.useCallback(function(ze){var gn=String(ze);if(ui)return ui(gn);var nr=gn;return Zi&&(nr=nr.replace(Zi,".")),nr.replace(/[^\w.-]+/g,"")},[ui,Zi]),Vi=Wt.useRef(""),zi=Wt.useCallback(function(ze,gn){if(qe)return qe(ze,{userTyping:gn,input:String(Vi.current)});var nr=typeof ze=="number"?Ne(ze):ze;if(!gn){var Sn=en(nr,gn);if(ue(nr)&&(Zi||Sn>=0)){var Ke=Zi||".";nr=Pe(nr,Ke,Sn)}}return nr},[qe,en,Zi]),ur=Wt.useState(function(){var ze=Be!=null?Be:Zt;return vi.isInvalidate()&&["string","number"].includes((0,ce.Z)(ze))?Number.isNaN(ze)?"":ze:zi(vi.toString(),!1)}),Vn=(0,me.Z)(ur,2),$n=Vn[0],Xe=Vn[1];Vi.current=$n;function mi(ze,gn){Xe(zi(ze.isInvalidate()?ze.toString(!1):ze.toString(!gn),gn))}var fn=Wt.useMemo(function(){return oe(He)},[He,xe]),On=Wt.useMemo(function(){return oe(We)},[We,xe]),Gn=Wt.useMemo(function(){return!fn||!vi||vi.isInvalidate()?!1:fn.lessEquals(vi)},[fn,vi]),It=Wt.useMemo(function(){return!On||!vi||vi.isInvalidate()?!1:vi.lessEquals(On)},[On,vi]),se=Te(ar.current,Nn),xi=(0,me.Z)(se,2),Di=xi[0],Oe=xi[1],Ti=function(gn){return fn&&!gn.lessEquals(fn)?fn:On&&!On.lessEquals(gn)?On:null},rn=function(gn){return!Ti(gn)},ln=function(gn,nr){var Sn=gn,Ke=rn(Sn)||Sn.isEmpty();if(!Sn.isEmpty()&&!nr&&(Sn=Ti(Sn)||Sn,Ke=!0),!Ri&&!Je&&Ke){var Fe=Sn.toString(),ke=en(Fe,nr);return ke>=0&&(Sn=je(Pe(Fe,".",ke)),rn(Sn)||(Sn=je(Pe(Fe,".",ke,!0)))),Sn.equals(vi)||(xn(Sn),Si==null||Si(Sn.isEmpty()?null:Ye(ni,Sn)),Zt===void 0&&mi(Sn,nr)),Sn}return vi},yn=bt(),ii=function ze(gn){if(Di(),Vi.current=gn,Xe(gn),!Mi.current){var nr=hn(gn),Sn=je(nr);Sn.isNaN()||ln(Sn,!0)}Oi==null||Oi(gn),yn(function(){var Ke=gn;ui||(Ke=gn.replace(/。/g,".")),Ke!==gn&&ze(Ke)})},Hi=function(){Mi.current=!0},Xi=function(){Mi.current=!1,ii(ar.current.value)},ki=function(gn){ii(gn.target.value)},En=function(gn){var nr;if(!(gn&&Gn||!gn&&It)){yt.current=!1;var Sn=je(on.current?oi(ei):ei);gn||(Sn=Sn.negate());var Ke=(vi||je(0)).add(Sn.toString()),Fe=ln(Ke,!1);Cn==null||Cn(Ye(ni,Fe),{offset:on.current?oi(ei):ei,type:gn?"up":"down"}),(nr=ar.current)===null||nr===void 0||nr.focus()}},Fn=function(gn){var nr=je(hn($n)),Sn;nr.isNaN()?Sn=ln(vi,gn):Sn=ln(nr,gn),Zt!==void 0?mi(vi,!1):Sn.isNaN()||mi(Sn,!1)},qi=function(){yt.current=!0},rr=function(gn){var nr=gn.key,Sn=gn.shiftKey;yt.current=!0,on.current=Sn,nr==="Enter"&&(Mi.current||(yt.current=!1),Fn(!1),Qi==null||Qi(gn)),gt!==!1&&!Mi.current&&["Up","ArrowUp","Down","ArrowDown"].includes(nr)&&(En(nr==="Up"||nr==="ArrowUp"),gn.preventDefault())},Sr=function(){yt.current=!1,on.current=!1};Wt.useEffect(function(){if(St&&Nn){var ze=function(Sn){En(Sn.deltaY<0),Sn.preventDefault()},gn=ar.current;if(gn)return gn.addEventListener("wheel",ze,{passive:!1}),function(){return gn.removeEventListener("wheel",ze)}}});var Kr=function(){Mn&&Fn(!1),yr(!1),yt.current=!1};return(0,pe.o)(function(){vi.isInvalidate()||mi(vi,!1)},[xe,qe]),(0,pe.o)(function(){var ze=je(Zt);di(ze);var gn=je(hn($n));(!ze.equals(gn)||!yt.current||qe)&&mi(ze,yt.current)},[Zt]),(0,pe.o)(function(){qe&&Oe()},[$n]),Wt.createElement("div",{ref:er,className:Yt()(ve,ti,(0,_t.Z)((0,_t.Z)((0,_t.Z)((0,_t.Z)((0,_t.Z)({},"".concat(ve,"-focused"),Nn),"".concat(ve,"-disabled"),Je),"".concat(ve,"-readonly"),Ri),"".concat(ve,"-not-a-number"),vi.isNaN()),"".concat(ve,"-out-of-range"),!vi.isInvalidate()&&!rn(vi))),style:he,onFocus:function(){yr(!0)},onBlur:Kr,onKeyDown:rr,onKeyUp:Sr,onCompositionStart:Hi,onCompositionEnd:Xi,onBeforeInput:qi},wt&&Wt.createElement(gi,{prefixCls:ve,upNode:Pi,downNode:Ct,upDisabled:Gn,downDisabled:It,onStep:En}),Wt.createElement("div",{className:"".concat(fr,"-wrap")},Wt.createElement("input",(0,pt.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":We,"aria-valuemax":He,"aria-valuenow":vi.isInvalidate()?null:vi.toString(),step:ei},ir,{ref:(0,Le.sQ)(ar,ee),className:fr,value:$n,onChange:ki,disabled:Je,readOnly:Ri}))))}),Ze=Wt.forwardRef(function(ie,ee){var ve=ie.disabled,ti=ie.style,he=ie.prefixCls,We=he===void 0?"rc-input-number":he,He=ie.value,we=ie.prefix,ei=ie.suffix,Be=ie.addonBefore,Zt=ie.addonAfter,Je=ie.className,Ri=ie.classNames,Pi=(0,Ut.Z)(ie,Ge),Ct=Wt.useRef(null),gt=Wt.useRef(null),ft=Wt.useRef(null),St=function(wt){ft.current&&(0,Bt.nH)(ft.current,wt)};return Wt.useImperativeHandle(ee,function(){return Xt(ft.current,{focus:St,nativeElement:Ct.current.nativeElement||gt.current})}),Wt.createElement(Vt.BaseInput,{className:Je,triggerFocus:St,prefixCls:We,value:He,disabled:ve,style:ti,prefix:we,suffix:ei,addonAfter:Zt,addonBefore:Be,classNames:Ri,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"},ref:Ct},Wt.createElement(Ve,(0,pt.Z)({prefixCls:We,disabled:ve,ref:ft,domRef:gt,className:Ri==null?void 0:Ri.input},Pi)))}),Ni=Ze,Se=Ni},23425:function(Li,ai,Mt){"use strict";Mt.d(ai,{Z:function(){return Xt}});var pt=Mt(20068),_t=Mt(54476),ce=Mt(76190),me=Mt(33885),Ut=Mt(42978),fe=Mt(92310),$t=Mt.n(fe),Ae=Mt(18929),re=Mt(10228),Dt=Mt(26112),de=Mt(48736),zt=Mt(59301),Ne=Mt(17119),ue=[10,20,50,100],qt=function(Wt){var Ce=Wt.pageSizeOptions,Te=Ce===void 0?ue:Ce,ne=Wt.locale,Re=Wt.changeSize,ye=Wt.pageSize,Ie=Wt.goButton,Ai=Wt.quickGo,yi=Wt.rootPrefixCls,gi=Wt.disabled,oi=Wt.buildOptionText,Bt=Wt.showSizeChanger,bt=Wt.sizeChangerRender,ge=zt.useState(""),Ge=(0,Ut.Z)(ge,2),Ye=Ge[0],oe=Ge[1],Ve=function(){return!Ye||Number.isNaN(Ye)?void 0:Number(Ye)},Ze=typeof oi=="function"?oi:function(He){return"".concat(He," ").concat(ne.items_per_page)},Ni=function(we){oe(we.target.value)},Se=function(we){Ie||Ye===""||(oe(""),!(we.relatedTarget&&(we.relatedTarget.className.indexOf("".concat(yi,"-item-link"))>=0||we.relatedTarget.className.indexOf("".concat(yi,"-item"))>=0))&&(Ai==null||Ai(Ve())))},ie=function(we){Ye!==""&&(we.keyCode===re.Z.ENTER||we.type==="click")&&(oe(""),Ai==null||Ai(Ve()))},ee=function(){return Te.some(function(we){return we.toString()===ye.toString()})?Te:Te.concat([ye]).sort(function(we,ei){var Be=Number.isNaN(Number(we))?0:Number(we),Zt=Number.isNaN(Number(ei))?0:Number(ei);return Be-Zt})},ve="".concat(yi,"-options");if(!Bt&&!Ai)return null;var ti=null,he=null,We=null;return Bt&&bt&&(ti=bt({disabled:gi,size:ye,onSizeChange:function(we){Re==null||Re(Number(we))},"aria-label":ne.page_size,className:"".concat(ve,"-size-changer"),options:ee().map(function(He){return{label:Ze(He),value:He}})})),Ai&&(Ie&&(We=typeof Ie=="boolean"?zt.createElement("button",{type:"button",onClick:ie,onKeyUp:ie,disabled:gi,className:"".concat(ve,"-quick-jumper-button")},ne.jump_to_confirm):zt.createElement("span",{onClick:ie,onKeyUp:ie},Ie)),he=zt.createElement("div",{className:"".concat(ve,"-quick-jumper")},ne.jump_to,zt.createElement("input",{disabled:gi,type:"text",value:Ye,onChange:Ni,onKeyUp:ie,onBlur:Se,"aria-label":ne.page}),ne.page,We)),zt.createElement("li",{className:ve},ti,he)},Qt=qt,Jt=function(Wt){var Ce=Wt.rootPrefixCls,Te=Wt.page,ne=Wt.active,Re=Wt.className,ye=Wt.showTitle,Ie=Wt.onClick,Ai=Wt.onKeyPress,yi=Wt.itemRender,gi="".concat(Ce,"-item"),oi=$t()(gi,"".concat(gi,"-").concat(Te),(0,pt.Z)((0,pt.Z)({},"".concat(gi,"-active"),ne),"".concat(gi,"-disabled"),!Te),Re),Bt=function(){Ie(Te)},bt=function(Ye){Ai(Ye,Ie,Te)},ge=yi(Te,"page",zt.createElement("a",{rel:"nofollow"},Te));return ge?zt.createElement("li",{title:ye?String(Te):null,className:oi,onClick:Bt,onKeyDown:bt,tabIndex:0},ge):null},Pe=Jt,je=function(Wt,Ce,Te){return Te};function De(){}function Yt(Le){var Wt=Number(Le);return typeof Wt=="number"&&!Number.isNaN(Wt)&&isFinite(Wt)&&Math.floor(Wt)===Wt}function Vt(Le,Wt,Ce){var Te=typeof Le=="undefined"?Wt:Le;return Math.floor((Ce-1)/Te)+1}var pe=function(Wt){var Ce=Wt.prefixCls,Te=Ce===void 0?"rc-pagination":Ce,ne=Wt.selectPrefixCls,Re=ne===void 0?"rc-select":ne,ye=Wt.className,Ie=Wt.current,Ai=Wt.defaultCurrent,yi=Ai===void 0?1:Ai,gi=Wt.total,oi=gi===void 0?0:gi,Bt=Wt.pageSize,bt=Wt.defaultPageSize,ge=bt===void 0?10:bt,Ge=Wt.onChange,Ye=Ge===void 0?De:Ge,oe=Wt.hideOnSinglePage,Ve=Wt.align,Ze=Wt.showPrevNextJumpers,Ni=Ze===void 0?!0:Ze,Se=Wt.showQuickJumper,ie=Wt.showLessItems,ee=Wt.showTitle,ve=ee===void 0?!0:ee,ti=Wt.onShowSizeChange,he=ti===void 0?De:ti,We=Wt.locale,He=We===void 0?Ne.Z:We,we=Wt.style,ei=Wt.totalBoundaryShowSizeChanger,Be=ei===void 0?50:ei,Zt=Wt.disabled,Je=Wt.simple,Ri=Wt.showTotal,Pi=Wt.showSizeChanger,Ct=Pi===void 0?oi>Be:Pi,gt=Wt.sizeChangerRender,ft=Wt.pageSizeOptions,St=Wt.itemRender,At=St===void 0?je:St,wt=Wt.jumpPrevIcon,te=Wt.jumpNextIcon,ni=Wt.prevIcon,ui=Wt.nextIcon,qe=zt.useRef(null),xe=(0,Ae.Z)(10,{value:Bt,defaultValue:ge}),Zi=(0,Ut.Z)(xe,2),Si=Zi[0],Oi=Zi[1],Qi=(0,Ae.Z)(1,{value:Ie,defaultValue:yi,postState:function(pn){return Math.max(1,Math.min(pn,Vt(void 0,Si,oi)))}}),Cn=(0,Ut.Z)(Qi,2),_i=Cn[0],Mn=Cn[1],er=zt.useState(_i),ir=(0,Ut.Z)(er,2),fr=ir[0],ar=ir[1];(0,zt.useEffect)(function(){ar(_i)},[_i]);var br=Ye!==De,Qn="current"in Wt,Nn=Math.max(1,_i-(ie?3:5)),yr=Math.min(Vt(void 0,Si,oi),_i+(ie?3:5));function yt(bi,pn){var kn=bi||zt.createElement("button",{type:"button","aria-label":pn,className:"".concat(Te,"-item-link")});return typeof bi=="function"&&(kn=zt.createElement(bi,(0,me.Z)({},Wt))),kn}function Mi(bi){var pn=bi.target.value,kn=Vt(void 0,Si,oi),zn;return pn===""?zn=pn:Number.isNaN(Number(pn))?zn=fr:pn>=kn?zn=kn:zn=Number(pn),zn}function on(bi){return Yt(bi)&&bi!==_i&&Yt(oi)&&oi>0}var Ui=oi>Si?Se:!1;function an(bi){(bi.keyCode===re.Z.UP||bi.keyCode===re.Z.DOWN)&&bi.preventDefault()}function vi(bi){var pn=Mi(bi);switch(pn!==fr&&ar(pn),bi.keyCode){case re.Z.ENTER:en(pn);break;case re.Z.UP:en(pn-1);break;case re.Z.DOWN:en(pn+1);break;default:break}}function di(bi){en(Mi(bi))}function xn(bi){var pn=Vt(bi,Si,oi),kn=_i>pn&&pn!==0?pn:_i;Oi(bi),ar(kn),he==null||he(_i,bi),Mn(kn),Ye==null||Ye(kn,bi)}function en(bi){if(on(bi)&&!Zt){var pn=Vt(void 0,Si,oi),kn=bi;return bi>pn?kn=pn:bi<1&&(kn=1),kn!==fr&&ar(kn),Mn(kn),Ye==null||Ye(kn,Si),kn}return _i}var hn=_i>1,Vi=_i<Vt(void 0,Si,oi);function zi(){hn&&en(_i-1)}function ur(){Vi&&en(_i+1)}function Vn(){en(Nn)}function $n(){en(yr)}function Xe(bi,pn){if(bi.key==="Enter"||bi.charCode===re.Z.ENTER||bi.keyCode===re.Z.ENTER){for(var kn=arguments.length,zn=new Array(kn>2?kn-2:0),Bn=2;Bn<kn;Bn++)zn[Bn-2]=arguments[Bn];pn.apply(void 0,zn)}}function mi(bi){Xe(bi,zi)}function fn(bi){Xe(bi,ur)}function On(bi){Xe(bi,Vn)}function Gn(bi){Xe(bi,$n)}function It(bi){var pn=At(bi,"prev",yt(ni,"prev page"));return zt.isValidElement(pn)?zt.cloneElement(pn,{disabled:!hn}):pn}function se(bi){var pn=At(bi,"next",yt(ui,"next page"));return zt.isValidElement(pn)?zt.cloneElement(pn,{disabled:!Vi}):pn}function xi(bi){(bi.type==="click"||bi.keyCode===re.Z.ENTER)&&en(fr)}var Di=null,Oe=(0,Dt.Z)(Wt,{aria:!0,data:!0}),Ti=Ri&&zt.createElement("li",{className:"".concat(Te,"-total-text")},Ri(oi,[oi===0?0:(_i-1)*Si+1,_i*Si>oi?oi:_i*Si])),rn=null,ln=Vt(void 0,Si,oi);if(oe&&oi<=Si)return null;var yn=[],ii={rootPrefixCls:Te,onClick:en,onKeyPress:Xe,showTitle:ve,itemRender:At,page:-1},Hi=_i-1>0?_i-1:0,Xi=_i+1<ln?_i+1:ln,ki=Se&&Se.goButton,En=(0,ce.Z)(Je)==="object"?Je.readOnly:!Je,Fn=ki,qi=null;Je&&(ki&&(typeof ki=="boolean"?Fn=zt.createElement("button",{type:"button",onClick:xi,onKeyUp:xi},He.jump_to_confirm):Fn=zt.createElement("span",{onClick:xi,onKeyUp:xi},ki),Fn=zt.createElement("li",{title:ve?"".concat(He.jump_to).concat(_i,"/").concat(ln):null,className:"".concat(Te,"-simple-pager")},Fn)),qi=zt.createElement("li",{title:ve?"".concat(_i,"/").concat(ln):null,className:"".concat(Te,"-simple-pager")},En?fr:zt.createElement("input",{type:"text","aria-label":He.jump_to,value:fr,disabled:Zt,onKeyDown:an,onKeyUp:vi,onChange:vi,onBlur:di,size:3}),zt.createElement("span",{className:"".concat(Te,"-slash")},"/"),ln));var rr=ie?1:2;if(ln<=3+rr*2){ln||yn.push(zt.createElement(Pe,(0,_t.Z)({},ii,{key:"noPager",page:1,className:"".concat(Te,"-item-disabled")})));for(var Sr=1;Sr<=ln;Sr+=1)yn.push(zt.createElement(Pe,(0,_t.Z)({},ii,{key:Sr,page:Sr,active:_i===Sr})))}else{var Kr=ie?He.prev_3:He.prev_5,ze=ie?He.next_3:He.next_5,gn=At(Nn,"jump-prev",yt(wt,"prev page")),nr=At(yr,"jump-next",yt(te,"next page"));Ni&&(Di=gn?zt.createElement("li",{title:ve?Kr:null,key:"prev",onClick:Vn,tabIndex:0,onKeyDown:On,className:$t()("".concat(Te,"-jump-prev"),(0,pt.Z)({},"".concat(Te,"-jump-prev-custom-icon"),!!wt))},gn):null,rn=nr?zt.createElement("li",{title:ve?ze:null,key:"next",onClick:$n,tabIndex:0,onKeyDown:Gn,className:$t()("".concat(Te,"-jump-next"),(0,pt.Z)({},"".concat(Te,"-jump-next-custom-icon"),!!te))},nr):null);var Sn=Math.max(1,_i-rr),Ke=Math.min(_i+rr,ln);_i-1<=rr&&(Ke=1+rr*2),ln-_i<=rr&&(Sn=ln-rr*2);for(var Fe=Sn;Fe<=Ke;Fe+=1)yn.push(zt.createElement(Pe,(0,_t.Z)({},ii,{key:Fe,page:Fe,active:_i===Fe})));if(_i-1>=rr*2&&_i!==3&&(yn[0]=zt.cloneElement(yn[0],{className:$t()("".concat(Te,"-item-after-jump-prev"),yn[0].props.className)}),yn.unshift(Di)),ln-_i>=rr*2&&_i!==ln-2){var ke=yn[yn.length-1];yn[yn.length-1]=zt.cloneElement(ke,{className:$t()("".concat(Te,"-item-before-jump-next"),ke.props.className)}),yn.push(rn)}Sn!==1&&yn.unshift(zt.createElement(Pe,(0,_t.Z)({},ii,{key:1,page:1}))),Ke!==ln&&yn.push(zt.createElement(Pe,(0,_t.Z)({},ii,{key:ln,page:ln})))}var $e=It(Hi);if($e){var pi=!hn||!ln;$e=zt.createElement("li",{title:ve?He.prev_page:null,onClick:zi,tabIndex:pi?null:0,onKeyDown:mi,className:$t()("".concat(Te,"-prev"),(0,pt.Z)({},"".concat(Te,"-disabled"),pi)),"aria-disabled":pi},$e)}var Ei=se(Xi);if(Ei){var Me,cn;Je?(Me=!Vi,cn=hn?0:null):(Me=!Vi||!ln,cn=Me?null:0),Ei=zt.createElement("li",{title:ve?He.next_page:null,onClick:ur,tabIndex:cn,onKeyDown:fn,className:$t()("".concat(Te,"-next"),(0,pt.Z)({},"".concat(Te,"-disabled"),Me)),"aria-disabled":Me},Ei)}var _e=$t()(Te,ye,(0,pt.Z)((0,pt.Z)((0,pt.Z)((0,pt.Z)((0,pt.Z)({},"".concat(Te,"-start"),Ve==="start"),"".concat(Te,"-center"),Ve==="center"),"".concat(Te,"-end"),Ve==="end"),"".concat(Te,"-simple"),Je),"".concat(Te,"-disabled"),Zt));return zt.createElement("ul",(0,_t.Z)({className:_e,style:we,ref:qe},Oe),Ti,$e,Je?qi:yn,Ei,zt.createElement(Qt,{locale:He,rootPrefixCls:Te,disabled:Zt,selectPrefixCls:Re,changeSize:xn,pageSize:Si,pageSizeOptions:ft,quickGo:Ui?en:null,goButton:Fn,showSizeChanger:Ct,sizeChangerRender:gt}))},Xt=pe},25930:function(Li,ai,Mt){"use strict";Mt.d(ai,{Cd:function(){return Te}});var pt=Mt(54476),_t=Mt(33885),ce=Mt(75931),me=Mt(59301),Ut=Mt(92310),fe=Mt.n(Ut),$t={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},Ae=function(){var ye=(0,me.useRef)([]),Ie=(0,me.useRef)(null);return(0,me.useEffect)(function(){var Ai=Date.now(),yi=!1;ye.current.forEach(function(gi){if(gi){yi=!0;var oi=gi.style;oi.transitionDuration=".3s, .3s, .3s, .06s",Ie.current&&Ai-Ie.current<100&&(oi.transitionDuration="0s, 0s")}}),yi&&(Ie.current=Date.now())}),ye.current},re=["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"],Dt=function(ye){var Ie=(0,_t.Z)((0,_t.Z)({},$t),ye),Ai=Ie.className,yi=Ie.percent,gi=Ie.prefixCls,oi=Ie.strokeColor,Bt=Ie.strokeLinecap,bt=Ie.strokeWidth,ge=Ie.style,Ge=Ie.trailColor,Ye=Ie.trailWidth,oe=Ie.transition,Ve=(0,ce.Z)(Ie,re);delete Ve.gapPosition;var Ze=Array.isArray(yi)?yi:[yi],Ni=Array.isArray(oi)?oi:[oi],Se=Ae(),ie=bt/2,ee=100-bt/2,ve="M ".concat(Bt==="round"?ie:0,",").concat(ie,`
|
|
L `).concat(Bt==="round"?ee:100,",").concat(ie),ti="0 0 100 ".concat(bt),he=0;return me.createElement("svg",(0,pt.Z)({className:fe()("".concat(gi,"-line"),Ai),viewBox:ti,preserveAspectRatio:"none",style:ge},Ve),me.createElement("path",{className:"".concat(gi,"-line-trail"),d:ve,strokeLinecap:Bt,stroke:Ge,strokeWidth:Ye||bt,fillOpacity:"0"}),Ze.map(function(We,He){var we=1;switch(Bt){case"round":we=1-bt/100;break;case"square":we=1-bt/2/100;break;default:we=1;break}var ei={strokeDasharray:"".concat(We*we,"px, 100px"),strokeDashoffset:"-".concat(he,"px"),transition:oe||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Be=Ni[He]||Ni[Ni.length-1];return he+=We,me.createElement("path",{key:He,className:"".concat(gi,"-line-path"),d:ve,strokeLinecap:Bt,stroke:Be,strokeWidth:bt,fillOpacity:"0",ref:function(Je){Se[He]=Je},style:ei})}))},de=Dt,zt=Mt(76190),Ne=Mt(42978),ue=Mt(47273),qt=0,Qt=(0,ue.Z)();function Jt(){var Re;return Qt?(Re=qt,qt+=1):Re="TEST_OR_SSR",Re}var Pe=function(Re){var ye=me.useState(),Ie=(0,Ne.Z)(ye,2),Ai=Ie[0],yi=Ie[1];return me.useEffect(function(){yi("rc_progress_".concat(Jt()))},[]),Re||Ai},je=function(ye){var Ie=ye.bg,Ai=ye.children;return me.createElement("div",{style:{width:"100%",height:"100%",background:Ie}},Ai)};function De(Re,ye){return Object.keys(Re).map(function(Ie){var Ai=parseFloat(Ie),yi="".concat(Math.floor(Ai*ye),"%");return"".concat(Re[Ie]," ").concat(yi)})}var Yt=me.forwardRef(function(Re,ye){var Ie=Re.prefixCls,Ai=Re.color,yi=Re.gradientId,gi=Re.radius,oi=Re.style,Bt=Re.ptg,bt=Re.strokeLinecap,ge=Re.strokeWidth,Ge=Re.size,Ye=Re.gapDegree,oe=Ai&&(0,zt.Z)(Ai)==="object",Ve=oe?"#FFF":void 0,Ze=Ge/2,Ni=me.createElement("circle",{className:"".concat(Ie,"-circle-path"),r:gi,cx:Ze,cy:Ze,stroke:Ve,strokeLinecap:bt,strokeWidth:ge,opacity:Bt===0?0:1,style:oi,ref:ye});if(!oe)return Ni;var Se="".concat(yi,"-conic"),ie=Ye?"".concat(180+Ye/2,"deg"):"0deg",ee=De(Ai,(360-Ye)/360),ve=De(Ai,1),ti="conic-gradient(from ".concat(ie,", ").concat(ee.join(", "),")"),he="linear-gradient(to ".concat(Ye?"bottom":"top",", ").concat(ve.join(", "),")");return me.createElement(me.Fragment,null,me.createElement("mask",{id:Se},Ni),me.createElement("foreignObject",{x:0,y:0,width:Ge,height:Ge,mask:"url(#".concat(Se,")")},me.createElement(je,{bg:he},me.createElement(je,{bg:ti}))))}),Vt=Yt,pe=100,Xt=function(ye,Ie,Ai,yi,gi,oi,Bt,bt,ge,Ge){var Ye=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,oe=Ai/100*360*((360-oi)/360),Ve=oi===0?0:{bottom:0,top:180,left:90,right:-90}[Bt],Ze=(100-yi)/100*Ie;ge==="round"&&yi!==100&&(Ze+=Ge/2,Ze>=Ie&&(Ze=Ie-.01));var Ni=pe/2;return{stroke:typeof bt=="string"?bt:void 0,strokeDasharray:"".concat(Ie,"px ").concat(ye),strokeDashoffset:Ze+Ye,transform:"rotate(".concat(gi+oe+Ve,"deg)"),transformOrigin:"".concat(Ni,"px ").concat(Ni,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},Le=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function Wt(Re){var ye=Re!=null?Re:[];return Array.isArray(ye)?ye:[ye]}var Ce=function(ye){var Ie=(0,_t.Z)((0,_t.Z)({},$t),ye),Ai=Ie.id,yi=Ie.prefixCls,gi=Ie.steps,oi=Ie.strokeWidth,Bt=Ie.trailWidth,bt=Ie.gapDegree,ge=bt===void 0?0:bt,Ge=Ie.gapPosition,Ye=Ie.trailColor,oe=Ie.strokeLinecap,Ve=Ie.style,Ze=Ie.className,Ni=Ie.strokeColor,Se=Ie.percent,ie=(0,ce.Z)(Ie,Le),ee=pe/2,ve=Pe(Ai),ti="".concat(ve,"-gradient"),he=ee-oi/2,We=Math.PI*2*he,He=ge>0?90+ge/2:-90,we=We*((360-ge)/360),ei=(0,zt.Z)(gi)==="object"?gi:{count:gi,gap:2},Be=ei.count,Zt=ei.gap,Je=Wt(Se),Ri=Wt(Ni),Pi=Ri.find(function(te){return te&&(0,zt.Z)(te)==="object"}),Ct=Pi&&(0,zt.Z)(Pi)==="object",gt=Ct?"butt":oe,ft=Xt(We,we,0,100,He,ge,Ge,Ye,gt,oi),St=Ae(),At=function(){var ni=0;return Je.map(function(ui,qe){var xe=Ri[qe]||Ri[Ri.length-1],Zi=Xt(We,we,ni,ui,He,ge,Ge,xe,gt,oi);return ni+=ui,me.createElement(Vt,{key:qe,color:xe,ptg:ui,radius:he,prefixCls:yi,gradientId:ti,style:Zi,strokeLinecap:gt,strokeWidth:oi,gapDegree:ge,ref:function(Oi){St[qe]=Oi},size:pe})}).reverse()},wt=function(){var ni=Math.round(Be*(Je[0]/100)),ui=100/Be,qe=0;return new Array(Be).fill(null).map(function(xe,Zi){var Si=Zi<=ni-1?Ri[0]:Ye,Oi=Si&&(0,zt.Z)(Si)==="object"?"url(#".concat(ti,")"):void 0,Qi=Xt(We,we,qe,ui,He,ge,Ge,Si,"butt",oi,Zt);return qe+=(we-Qi.strokeDashoffset+Zt)*100/we,me.createElement("circle",{key:Zi,className:"".concat(yi,"-circle-path"),r:he,cx:ee,cy:ee,stroke:Oi,strokeWidth:oi,opacity:1,style:Qi,ref:function(_i){St[Zi]=_i}})})};return me.createElement("svg",(0,pt.Z)({className:fe()("".concat(yi,"-circle"),Ze),viewBox:"0 0 ".concat(pe," ").concat(pe),style:Ve,id:Ai,role:"presentation"},ie),!Be&&me.createElement("circle",{className:"".concat(yi,"-circle-trail"),r:he,cx:ee,cy:ee,stroke:Ye,strokeLinecap:gt,strokeWidth:Bt||oi,style:ft}),Be?wt():At())},Te=Ce,ne={Line:de,Circle:Te}},738:function(Li,ai,Mt){"use strict";Mt.d(ai,{Z:function(){return De}});var pt=Mt(54476),_t=Mt(20068),ce=Mt(42978),me=Mt(75931),Ut=Mt(92310),fe=Mt.n(Ut),$t=Mt(18929),Ae=Mt(10228),re=Mt(26112),Dt=Mt(59301);function de(Yt,Vt){var pe=Yt.disabled,Xt=Yt.prefixCls,Le=Yt.character,Wt=Yt.characterRender,Ce=Yt.index,Te=Yt.count,ne=Yt.value,Re=Yt.allowHalf,ye=Yt.focused,Ie=Yt.onHover,Ai=Yt.onClick,yi=function(oe){Ie(oe,Ce)},gi=function(oe){Ai(oe,Ce)},oi=function(oe){oe.keyCode===Ae.Z.ENTER&&Ai(oe,Ce)},Bt=Ce+1,bt=new Set([Xt]);ne===0&&Ce===0&&ye?bt.add("".concat(Xt,"-focused")):Re&&ne+.5>=Bt&&ne<Bt?(bt.add("".concat(Xt,"-half")),bt.add("".concat(Xt,"-active")),ye&&bt.add("".concat(Xt,"-focused"))):(Bt<=ne?bt.add("".concat(Xt,"-full")):bt.add("".concat(Xt,"-zero")),Bt===ne&&ye&&bt.add("".concat(Xt,"-focused")));var ge=typeof Le=="function"?Le(Yt):Le,Ge=Dt.createElement("li",{className:fe()(Array.from(bt)),ref:Vt},Dt.createElement("div",{onClick:pe?null:gi,onKeyDown:pe?null:oi,onMouseMove:pe?null:yi,role:"radio","aria-checked":ne>Ce?"true":"false","aria-posinset":Ce+1,"aria-setsize":Te,tabIndex:pe?-1:0},Dt.createElement("div",{className:"".concat(Xt,"-first")},ge),Dt.createElement("div",{className:"".concat(Xt,"-second")},ge)));return Wt&&(Ge=Wt(Ge,Yt)),Ge}var zt=Dt.forwardRef(de);function Ne(){var Yt=Dt.useRef({});function Vt(Xt){return Yt.current[Xt]}function pe(Xt){return function(Le){Yt.current[Xt]=Le}}return[Vt,pe]}function ue(Yt){var Vt=Yt.pageXOffset,pe="scrollLeft";if(typeof Vt!="number"){var Xt=Yt.document;Vt=Xt.documentElement[pe],typeof Vt!="number"&&(Vt=Xt.body[pe])}return Vt}function qt(Yt){var Vt,pe,Xt=Yt.ownerDocument,Le=Xt.body,Wt=Xt&&Xt.documentElement,Ce=Yt.getBoundingClientRect();return Vt=Ce.left,pe=Ce.top,Vt-=Wt.clientLeft||Le.clientLeft||0,pe-=Wt.clientTop||Le.clientTop||0,{left:Vt,top:pe}}function Qt(Yt){var Vt=qt(Yt),pe=Yt.ownerDocument,Xt=pe.defaultView||pe.parentWindow;return Vt.left+=ue(Xt),Vt.left}var Jt=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","keyboard","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function Pe(Yt,Vt){var pe=Yt.prefixCls,Xt=pe===void 0?"rc-rate":pe,Le=Yt.className,Wt=Yt.defaultValue,Ce=Yt.value,Te=Yt.count,ne=Te===void 0?5:Te,Re=Yt.allowHalf,ye=Re===void 0?!1:Re,Ie=Yt.allowClear,Ai=Ie===void 0?!0:Ie,yi=Yt.keyboard,gi=yi===void 0?!0:yi,oi=Yt.character,Bt=oi===void 0?"\u2605":oi,bt=Yt.characterRender,ge=Yt.disabled,Ge=Yt.direction,Ye=Ge===void 0?"ltr":Ge,oe=Yt.tabIndex,Ve=oe===void 0?0:oe,Ze=Yt.autoFocus,Ni=Yt.onHoverChange,Se=Yt.onChange,ie=Yt.onFocus,ee=Yt.onBlur,ve=Yt.onKeyDown,ti=Yt.onMouseLeave,he=(0,me.Z)(Yt,Jt),We=Ne(),He=(0,ce.Z)(We,2),we=He[0],ei=He[1],Be=Dt.useRef(null),Zt=function(){if(!ge){var Nn;(Nn=Be.current)===null||Nn===void 0||Nn.focus()}};Dt.useImperativeHandle(Vt,function(){return{focus:Zt,blur:function(){if(!ge){var Nn;(Nn=Be.current)===null||Nn===void 0||Nn.blur()}}}});var Je=(0,$t.Z)(Wt||0,{value:Ce}),Ri=(0,ce.Z)(Je,2),Pi=Ri[0],Ct=Ri[1],gt=(0,$t.Z)(null),ft=(0,ce.Z)(gt,2),St=ft[0],At=ft[1],wt=function(Nn,yr){var yt=Ye==="rtl",Mi=Nn+1;if(ye){var on=we(Nn),Ui=Qt(on),an=on.clientWidth;(yt&&yr-Ui>an/2||!yt&&yr-Ui<an/2)&&(Mi-=.5)}return Mi},te=function(Nn){Ct(Nn),Se==null||Se(Nn)},ni=Dt.useState(!1),ui=(0,ce.Z)(ni,2),qe=ui[0],xe=ui[1],Zi=function(){xe(!0),ie==null||ie()},Si=function(){xe(!1),ee==null||ee()},Oi=Dt.useState(null),Qi=(0,ce.Z)(Oi,2),Cn=Qi[0],_i=Qi[1],Mn=function(Nn,yr){var yt=wt(yr,Nn.pageX);yt!==St&&(_i(yt),At(null)),Ni==null||Ni(yt)},er=function(Nn){ge||(_i(null),At(null),Ni==null||Ni(void 0)),Nn&&(ti==null||ti(Nn))},ir=function(Nn,yr){var yt=wt(yr,Nn.pageX),Mi=!1;Ai&&(Mi=yt===Pi),er(),te(Mi?0:yt),At(Mi?yt:null)},fr=function(Nn){var yr=Nn.keyCode,yt=Ye==="rtl",Mi=ye?.5:1;gi&&(yr===Ae.Z.RIGHT&&Pi<ne&&!yt?(te(Pi+Mi),Nn.preventDefault()):yr===Ae.Z.LEFT&&Pi>0&&!yt||yr===Ae.Z.RIGHT&&Pi>0&&yt?(te(Pi-Mi),Nn.preventDefault()):yr===Ae.Z.LEFT&&Pi<ne&&yt&&(te(Pi+Mi),Nn.preventDefault())),ve==null||ve(Nn)};Dt.useEffect(function(){Ze&&!ge&&Zt()},[]);var ar=new Array(ne).fill(0).map(function(Qn,Nn){return Dt.createElement(zt,{ref:ei(Nn),index:Nn,count:ne,disabled:ge,prefixCls:"".concat(Xt,"-star"),allowHalf:ye,value:Cn===null?Pi:Cn,onClick:ir,onHover:Mn,key:Qn||Nn,character:Bt,characterRender:bt,focused:qe})}),br=fe()(Xt,Le,(0,_t.Z)((0,_t.Z)({},"".concat(Xt,"-disabled"),ge),"".concat(Xt,"-rtl"),Ye==="rtl"));return Dt.createElement("ul",(0,pt.Z)({className:br,onMouseLeave:er,tabIndex:ge?-1:Ve,onFocus:ge?null:Zi,onBlur:ge?null:Si,onKeyDown:ge?null:fr,ref:Be},(0,re.Z)(he,{aria:!0,data:!0,attr:!0})),ar)}var je=Dt.forwardRef(Pe),De=je},6551:function(Li,ai,Mt){"use strict";Mt.d(ai,{ZP:function(){return $t}});var pt=Mt(42978),_t=Mt(59301),ce=Mt(47273),me=0,Ut=(0,ce.Z)();function fe(){var Ae;return Ut?(Ae=me,me+=1):Ae="TEST_OR_SSR",Ae}function $t(Ae){var re=_t.useState(),Dt=(0,pt.Z)(re,2),de=Dt[0],zt=Dt[1];return _t.useEffect(function(){zt("rc_select_".concat(fe()))},[]),Ae||de}},37463:function(Li,ai,Mt){"use strict";Mt.d(ai,{Ac:function(){return xe},Xo:function(){return Si},Wx:function(){return Qi},ZP:function(){return Gn},lk:function(){return De}});var pt=Mt(54476),_t=Mt(94480),ce=Mt(20068),me=Mt(33885),Ut=Mt(42978),fe=Mt(75931),$t=Mt(76190),Ae=Mt(18929),re=Mt(48736),Dt=Mt(59301),de=Mt(92310),zt=Mt.n(de),Ne=Mt(34280),ue=Mt(49658),qt=Mt(8654),Qt=function(se){var xi=se.className,Di=se.customizeIcon,Oe=se.customizeIconProps,Ti=se.children,rn=se.onMouseDown,ln=se.onClick,yn=typeof Di=="function"?Di(Oe):Di;return Dt.createElement("span",{className:xi,onMouseDown:function(Hi){Hi.preventDefault(),rn==null||rn(Hi)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:ln,"aria-hidden":!0},yn!==void 0?yn:Dt.createElement("span",{className:zt()(xi.split(/\s+/).map(function(ii){return"".concat(ii,"-icon")}))},Ti))},Jt=Qt,Pe=function(se,xi,Di,Oe,Ti){var rn=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,ln=arguments.length>6?arguments[6]:void 0,yn=arguments.length>7?arguments[7]:void 0,ii=Dt.useMemo(function(){if((0,$t.Z)(Oe)==="object")return Oe.clearIcon;if(Ti)return Ti},[Oe,Ti]),Hi=Dt.useMemo(function(){return!!(!rn&&Oe&&(Di.length||ln)&&!(yn==="combobox"&&ln===""))},[Oe,rn,Di.length,ln,yn]);return{allowClear:Hi,clearIcon:Dt.createElement(Jt,{className:"".concat(se,"-clear"),onMouseDown:xi,customizeIcon:ii},"\xD7")}},je=Dt.createContext(null);function De(){return Dt.useContext(je)}function Yt(){var It=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,se=Dt.useState(!1),xi=(0,Ut.Z)(se,2),Di=xi[0],Oe=xi[1],Ti=Dt.useRef(null),rn=function(){window.clearTimeout(Ti.current)};Dt.useEffect(function(){return rn},[]);var ln=function(ii,Hi){rn(),Ti.current=window.setTimeout(function(){Oe(ii),Hi&&Hi()},It)};return[Di,ln,rn]}function Vt(){var It=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,se=Dt.useRef(null),xi=Dt.useRef(null);Dt.useEffect(function(){return function(){window.clearTimeout(xi.current)}},[]);function Di(Oe){(Oe||se.current===null)&&(se.current=Oe),window.clearTimeout(xi.current),xi.current=window.setTimeout(function(){se.current=null},It)}return[function(){return se.current},Di]}function pe(It,se,xi,Di){var Oe=Dt.useRef(null);Oe.current={open:se,triggerOpen:xi,customizedTrigger:Di},Dt.useEffect(function(){function Ti(rn){var ln;if(!((ln=Oe.current)!==null&&ln!==void 0&&ln.customizedTrigger)){var yn=rn.target;yn.shadowRoot&&rn.composed&&(yn=rn.composedPath()[0]||yn),Oe.current.open&&It().filter(function(ii){return ii}).every(function(ii){return!ii.contains(yn)&&ii!==yn})&&Oe.current.triggerOpen(!1)}}return window.addEventListener("mousedown",Ti),function(){return window.removeEventListener("mousedown",Ti)}},[])}var Xt=Mt(10228);function Le(It){return It&&![Xt.Z.ESC,Xt.Z.SHIFT,Xt.Z.BACKSPACE,Xt.Z.TAB,Xt.Z.WIN_KEY,Xt.Z.ALT,Xt.Z.META,Xt.Z.WIN_KEY_RIGHT,Xt.Z.CTRL,Xt.Z.SEMICOLON,Xt.Z.EQUALS,Xt.Z.CAPS_LOCK,Xt.Z.CONTEXT_MENU,Xt.Z.F1,Xt.Z.F2,Xt.Z.F3,Xt.Z.F4,Xt.Z.F5,Xt.Z.F6,Xt.Z.F7,Xt.Z.F8,Xt.Z.F9,Xt.Z.F10,Xt.Z.F11,Xt.Z.F12].includes(It)}var Wt=Mt(26112),Ce=Mt(11780);function Te(It,se,xi){var Di=(0,me.Z)((0,me.Z)({},It),xi?se:{});return Object.keys(se).forEach(function(Oe){var Ti=se[Oe];typeof Ti=="function"&&(Di[Oe]=function(){for(var rn,ln=arguments.length,yn=new Array(ln),ii=0;ii<ln;ii++)yn[ii]=arguments[ii];return Ti.apply(void 0,yn),(rn=It[Oe])===null||rn===void 0?void 0:rn.call.apply(rn,[It].concat(yn))})}),Di}var ne=Te,Re=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],ye=function(se,xi){var Di=se.prefixCls,Oe=se.id,Ti=se.inputElement,rn=se.autoFocus,ln=se.autoComplete,yn=se.editable,ii=se.activeDescendantId,Hi=se.value,Xi=se.open,ki=se.attrs,En=(0,fe.Z)(se,Re),Fn=Ti||Dt.createElement("input",null),qi=Fn,rr=qi.ref,Sr=qi.props;return(0,re.Kp)(!("maxLength"in Fn.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),Fn=Dt.cloneElement(Fn,(0,me.Z)((0,me.Z)((0,me.Z)({type:"search"},ne(En,Sr,!0)),{},{id:Oe,ref:(0,qt.sQ)(xi,rr),autoComplete:ln||"off",autoFocus:rn,className:zt()("".concat(Di,"-selection-search-input"),Sr==null?void 0:Sr.className),role:"combobox","aria-expanded":Xi||!1,"aria-haspopup":"listbox","aria-owns":"".concat(Oe,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(Oe,"_list"),"aria-activedescendant":Xi?ii:void 0},ki),{},{value:yn?Hi:"",readOnly:!yn,unselectable:yn?null:"on",style:(0,me.Z)((0,me.Z)({},Sr.style),{},{opacity:yn?null:0})})),Fn},Ie=Dt.forwardRef(ye),Ai=Ie;function yi(It){return Array.isArray(It)?It:It!==void 0?[It]:[]}var gi=typeof window!="undefined"&&window.document&&window.document.documentElement,oi=gi;function Bt(It){return It!=null}function bt(It){return!It&&It!==0}function ge(It){return["string","number"].includes((0,$t.Z)(It))}function Ge(It){var se=void 0;return It&&(ge(It.title)?se=It.title.toString():ge(It.label)&&(se=It.label.toString())),se}function Ye(It,se){oi?Dt.useLayoutEffect(It,se):Dt.useEffect(It,se)}function oe(It){var se;return(se=It.key)!==null&&se!==void 0?se:It.value}var Ve=function(se){se.preventDefault(),se.stopPropagation()},Ze=function(se){var xi=se.id,Di=se.prefixCls,Oe=se.values,Ti=se.open,rn=se.searchValue,ln=se.autoClearSearchValue,yn=se.inputRef,ii=se.placeholder,Hi=se.disabled,Xi=se.mode,ki=se.showSearch,En=se.autoFocus,Fn=se.autoComplete,qi=se.activeDescendantId,rr=se.tabIndex,Sr=se.removeIcon,Kr=se.maxTagCount,ze=se.maxTagTextLength,gn=se.maxTagPlaceholder,nr=gn===void 0?function(Yn){return"+ ".concat(Yn.length," ...")}:gn,Sn=se.tagRender,Ke=se.onToggleOpen,Fe=se.onRemove,ke=se.onInputChange,$e=se.onInputPaste,pi=se.onInputKeyDown,Ei=se.onInputMouseDown,Me=se.onInputCompositionStart,cn=se.onInputCompositionEnd,_e=se.onInputBlur,bi=Dt.useRef(null),pn=(0,Dt.useState)(0),kn=(0,Ut.Z)(pn,2),zn=kn[0],Bn=kn[1],Tn=(0,Dt.useState)(!1),or=(0,Ut.Z)(Tn,2),Fr=or[0],Zn=or[1],ji="".concat(Di,"-selection"),Pt=Ti||Xi==="multiple"&&ln===!1||Xi==="tags"?rn:"",gr=Xi==="tags"||Xi==="multiple"&&ln===!1||ki&&(Ti||Fr);Ye(function(){Bn(bi.current.scrollWidth)},[Pt]);var Un=function(Gi,mn,Kn,un,Wi){return Dt.createElement("span",{title:Ge(Gi),className:zt()("".concat(ji,"-item"),(0,ce.Z)({},"".concat(ji,"-item-disabled"),Kn))},Dt.createElement("span",{className:"".concat(ji,"-item-content")},mn),un&&Dt.createElement(Jt,{className:"".concat(ji,"-item-remove"),onMouseDown:Ve,onClick:Wi,customizeIcon:Sr},"\xD7"))},Ar=function(Gi,mn,Kn,un,Wi,li){var Pn=function(Tr){Ve(Tr),Ke(!Ti)};return Dt.createElement("span",{onMouseDown:Pn},Sn({label:mn,value:Gi,disabled:Kn,closable:un,onClose:Wi,isMaxTag:!!li}))},Dr=function(Gi){var mn=Gi.disabled,Kn=Gi.label,un=Gi.value,Wi=!Hi&&!mn,li=Kn;if(typeof ze=="number"&&(typeof Kn=="string"||typeof Kn=="number")){var Pn=String(li);Pn.length>ze&&(li="".concat(Pn.slice(0,ze),"..."))}var wr=function(Lr){Lr&&Lr.stopPropagation(),Fe(Gi)};return typeof Sn=="function"?Ar(un,li,mn,Wi,wr):Un(Gi,li,mn,Wi,wr)},Cr=function(Gi){if(!Oe.length)return null;var mn=typeof nr=="function"?nr(Gi):nr;return typeof Sn=="function"?Ar(void 0,mn,!1,!1,void 0,!0):Un({title:mn},mn,!1)},sn=Dt.createElement("div",{className:"".concat(ji,"-search"),style:{width:zn},onFocus:function(){Zn(!0)},onBlur:function(){Zn(!1)}},Dt.createElement(Ai,{ref:yn,open:Ti,prefixCls:Di,id:xi,inputElement:null,disabled:Hi,autoFocus:En,autoComplete:Fn,editable:gr,activeDescendantId:qi,value:Pt,onKeyDown:pi,onMouseDown:Ei,onChange:ke,onPaste:$e,onCompositionStart:Me,onCompositionEnd:cn,onBlur:_e,tabIndex:rr,attrs:(0,Wt.Z)(se,!0)}),Dt.createElement("span",{ref:bi,className:"".concat(ji,"-search-mirror"),"aria-hidden":!0},Pt,"\xA0")),vn=Dt.createElement(Ce.Z,{prefixCls:"".concat(ji,"-overflow"),data:Oe,renderItem:Dr,renderRest:Cr,suffix:sn,itemKey:oe,maxCount:Kr});return Dt.createElement("span",{className:"".concat(ji,"-wrap")},vn,!Oe.length&&!Pt&&Dt.createElement("span",{className:"".concat(ji,"-placeholder")},ii))},Ni=Ze,Se=function(se){var xi=se.inputElement,Di=se.prefixCls,Oe=se.id,Ti=se.inputRef,rn=se.disabled,ln=se.autoFocus,yn=se.autoComplete,ii=se.activeDescendantId,Hi=se.mode,Xi=se.open,ki=se.values,En=se.placeholder,Fn=se.tabIndex,qi=se.showSearch,rr=se.searchValue,Sr=se.activeValue,Kr=se.maxLength,ze=se.onInputKeyDown,gn=se.onInputMouseDown,nr=se.onInputChange,Sn=se.onInputPaste,Ke=se.onInputCompositionStart,Fe=se.onInputCompositionEnd,ke=se.onInputBlur,$e=se.title,pi=Dt.useState(!1),Ei=(0,Ut.Z)(pi,2),Me=Ei[0],cn=Ei[1],_e=Hi==="combobox",bi=_e||qi,pn=ki[0],kn=rr||"";_e&&Sr&&!Me&&(kn=Sr),Dt.useEffect(function(){_e&&cn(!1)},[_e,Sr]);var zn=Hi!=="combobox"&&!Xi&&!qi?!1:!!kn,Bn=$e===void 0?Ge(pn):$e,Tn=Dt.useMemo(function(){return pn?null:Dt.createElement("span",{className:"".concat(Di,"-selection-placeholder"),style:zn?{visibility:"hidden"}:void 0},En)},[pn,zn,En,Di]);return Dt.createElement("span",{className:"".concat(Di,"-selection-wrap")},Dt.createElement("span",{className:"".concat(Di,"-selection-search")},Dt.createElement(Ai,{ref:Ti,prefixCls:Di,id:Oe,open:Xi,inputElement:xi,disabled:rn,autoFocus:ln,autoComplete:yn,editable:bi,activeDescendantId:ii,value:kn,onKeyDown:ze,onMouseDown:gn,onChange:function(Fr){cn(!0),nr(Fr)},onPaste:Sn,onCompositionStart:Ke,onCompositionEnd:Fe,onBlur:ke,tabIndex:Fn,attrs:(0,Wt.Z)(se,!0),maxLength:_e?Kr:void 0})),!_e&&pn?Dt.createElement("span",{className:"".concat(Di,"-selection-item"),title:Bn,style:zn?{visibility:"hidden"}:void 0},pn.label):null,Tn)},ie=Se,ee=function(se,xi){var Di=(0,Dt.useRef)(null),Oe=(0,Dt.useRef)(!1),Ti=se.prefixCls,rn=se.open,ln=se.mode,yn=se.showSearch,ii=se.tokenWithEnter,Hi=se.disabled,Xi=se.prefix,ki=se.autoClearSearchValue,En=se.onSearch,Fn=se.onSearchSubmit,qi=se.onToggleOpen,rr=se.onInputKeyDown,Sr=se.onInputBlur,Kr=se.domRef;Dt.useImperativeHandle(xi,function(){return{focus:function(Bn){Di.current.focus(Bn)},blur:function(){Di.current.blur()}}});var ze=Vt(0),gn=(0,Ut.Z)(ze,2),nr=gn[0],Sn=gn[1],Ke=function(Bn){var Tn=Bn.which,or=Di.current instanceof HTMLTextAreaElement;!or&&rn&&(Tn===Xt.Z.UP||Tn===Xt.Z.DOWN)&&Bn.preventDefault(),rr&&rr(Bn),Tn===Xt.Z.ENTER&&ln==="tags"&&!Oe.current&&!rn&&(Fn==null||Fn(Bn.target.value)),!(or&&!rn&&~[Xt.Z.UP,Xt.Z.DOWN,Xt.Z.LEFT,Xt.Z.RIGHT].indexOf(Tn))&&Le(Tn)&&qi(!0)},Fe=function(){Sn(!0)},ke=(0,Dt.useRef)(null),$e=function(Bn){En(Bn,!0,Oe.current)!==!1&&qi(!0)},pi=function(){Oe.current=!0},Ei=function(Bn){Oe.current=!1,ln!=="combobox"&&$e(Bn.target.value)},Me=function(Bn){var Tn=Bn.target.value;if(ii&&ke.current&&/[\r\n]/.test(ke.current)){var or=ke.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");Tn=Tn.replace(or,ke.current)}ke.current=null,$e(Tn)},cn=function(Bn){var Tn=Bn.clipboardData,or=Tn==null?void 0:Tn.getData("text");ke.current=or||""},_e=function(Bn){var Tn=Bn.target;if(Tn!==Di.current){var or=document.body.style.msTouchAction!==void 0;or?setTimeout(function(){Di.current.focus()}):Di.current.focus()}},bi=function(Bn){var Tn=nr();Bn.target!==Di.current&&!Tn&&!(ln==="combobox"&&Hi)&&Bn.preventDefault(),(ln!=="combobox"&&(!yn||!Tn)||!rn)&&(rn&&ki!==!1&&En("",!0,!1),qi())},pn={inputRef:Di,onInputKeyDown:Ke,onInputMouseDown:Fe,onInputChange:Me,onInputPaste:cn,onInputCompositionStart:pi,onInputCompositionEnd:Ei,onInputBlur:Sr},kn=ln==="multiple"||ln==="tags"?Dt.createElement(Ni,(0,pt.Z)({},se,pn)):Dt.createElement(ie,(0,pt.Z)({},se,pn));return Dt.createElement("div",{ref:Kr,className:"".concat(Ti,"-selector"),onClick:_e,onMouseDown:bi},Xi&&Dt.createElement("div",{className:"".concat(Ti,"-prefix")},Xi),kn)},ve=Dt.forwardRef(ee),ti=ve,he=Mt(65030),We=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],He=function(se){var xi=se===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:xi,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:xi,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:xi,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:xi,adjustY:1},htmlRegion:"scroll"}}},we=function(se,xi){var Di=se.prefixCls,Oe=se.disabled,Ti=se.visible,rn=se.children,ln=se.popupElement,yn=se.animation,ii=se.transitionName,Hi=se.dropdownStyle,Xi=se.dropdownClassName,ki=se.direction,En=ki===void 0?"ltr":ki,Fn=se.placement,qi=se.builtinPlacements,rr=se.dropdownMatchSelectWidth,Sr=se.dropdownRender,Kr=se.dropdownAlign,ze=se.getPopupContainer,gn=se.empty,nr=se.getTriggerDOMNode,Sn=se.onPopupVisibleChange,Ke=se.onPopupMouseEnter,Fe=(0,fe.Z)(se,We),ke="".concat(Di,"-dropdown"),$e=ln;Sr&&($e=Sr(ln));var pi=Dt.useMemo(function(){return qi||He(rr)},[qi,rr]),Ei=yn?"".concat(ke,"-").concat(yn):ii,Me=typeof rr=="number",cn=Dt.useMemo(function(){return Me?null:rr===!1?"minWidth":"width"},[rr,Me]),_e=Hi;Me&&(_e=(0,me.Z)((0,me.Z)({},_e),{},{width:rr}));var bi=Dt.useRef(null);return Dt.useImperativeHandle(xi,function(){return{getPopupElement:function(){var kn;return(kn=bi.current)===null||kn===void 0?void 0:kn.popupElement}}}),Dt.createElement(he.Z,(0,pt.Z)({},Fe,{showAction:Sn?["click"]:[],hideAction:Sn?["click"]:[],popupPlacement:Fn||(En==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:pi,prefixCls:ke,popupTransitionName:Ei,popup:Dt.createElement("div",{onMouseEnter:Ke},$e),ref:bi,stretch:cn,popupAlign:Kr,popupVisible:Ti,getPopupContainer:ze,popupClassName:zt()(Xi,(0,ce.Z)({},"".concat(ke,"-empty"),gn)),popupStyle:_e,getTriggerDOMNode:nr,onPopupVisibleChange:Sn}),rn)},ei=Dt.forwardRef(we),Be=ei,Zt=Mt(66712);function Je(It,se){var xi=It.key,Di;return"value"in It&&(Di=It.value),xi!=null?xi:Di!==void 0?Di:"rc-index-key-".concat(se)}function Ri(It){return typeof It!="undefined"&&!Number.isNaN(It)}function Pi(It,se){var xi=It||{},Di=xi.label,Oe=xi.value,Ti=xi.options,rn=xi.groupLabel,ln=Di||(se?"children":"label");return{label:ln,value:Oe||"value",options:Ti||"options",groupLabel:rn||ln}}function Ct(It){var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},xi=se.fieldNames,Di=se.childrenAsData,Oe=[],Ti=Pi(xi,!1),rn=Ti.label,ln=Ti.value,yn=Ti.options,ii=Ti.groupLabel;function Hi(Xi,ki){Array.isArray(Xi)&&Xi.forEach(function(En){if(ki||!(yn in En)){var Fn=En[ln];Oe.push({key:Je(En,Oe.length),groupOption:ki,data:En,label:En[rn],value:Fn})}else{var qi=En[ii];qi===void 0&&Di&&(qi=En.label),Oe.push({key:Je(En,Oe.length),group:!0,data:En,label:qi}),Hi(En[yn],!0)}})}return Hi(It,!1),Oe}function gt(It){var se=(0,me.Z)({},It);return"props"in se||Object.defineProperty(se,"props",{get:function(){return(0,re.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),se}}),se}var ft=function(se,xi,Di){if(!xi||!xi.length)return null;var Oe=!1,Ti=function ln(yn,ii){var Hi=(0,Zt.Z)(ii),Xi=Hi[0],ki=Hi.slice(1);if(!Xi)return[yn];var En=yn.split(Xi);return Oe=Oe||En.length>1,En.reduce(function(Fn,qi){return[].concat((0,_t.Z)(Fn),(0,_t.Z)(ln(qi,ki)))},[]).filter(Boolean)},rn=Ti(se,xi);return Oe?typeof Di!="undefined"?rn.slice(0,Di):rn:null},St=Dt.createContext(null),At=St;function wt(It){var se=It.visible,xi=It.values;if(!se)return null;var Di=50;return Dt.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(xi.slice(0,Di).map(function(Oe){var Ti=Oe.label,rn=Oe.value;return["number","string"].includes((0,$t.Z)(Ti))?Ti:rn}).join(", ")),xi.length>Di?", ...":null)}var te=["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"],ni=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],ui=function(se){return se==="tags"||se==="multiple"},qe=Dt.forwardRef(function(It,se){var xi,Di=It.id,Oe=It.prefixCls,Ti=It.className,rn=It.showSearch,ln=It.tagRender,yn=It.direction,ii=It.omitDomProps,Hi=It.displayValues,Xi=It.onDisplayValuesChange,ki=It.emptyOptions,En=It.notFoundContent,Fn=En===void 0?"Not Found":En,qi=It.onClear,rr=It.mode,Sr=It.disabled,Kr=It.loading,ze=It.getInputElement,gn=It.getRawInputElement,nr=It.open,Sn=It.defaultOpen,Ke=It.onDropdownVisibleChange,Fe=It.activeValue,ke=It.onActiveValueChange,$e=It.activeDescendantId,pi=It.searchValue,Ei=It.autoClearSearchValue,Me=It.onSearch,cn=It.onSearchSplit,_e=It.tokenSeparators,bi=It.allowClear,pn=It.prefix,kn=It.suffixIcon,zn=It.clearIcon,Bn=It.OptionList,Tn=It.animation,or=It.transitionName,Fr=It.dropdownStyle,Zn=It.dropdownClassName,ji=It.dropdownMatchSelectWidth,Pt=It.dropdownRender,gr=It.dropdownAlign,Un=It.placement,Ar=It.builtinPlacements,Dr=It.getPopupContainer,Cr=It.showAction,sn=Cr===void 0?[]:Cr,vn=It.onFocus,Yn=It.onBlur,Gi=It.onKeyUp,mn=It.onKeyDown,Kn=It.onMouseDown,un=(0,fe.Z)(It,te),Wi=ui(rr),li=(rn!==void 0?rn:Wi)||rr==="combobox",Pn=(0,me.Z)({},un);ni.forEach(function($r){delete Pn[$r]}),ii==null||ii.forEach(function($r){delete Pn[$r]});var wr=Dt.useState(!1),Tr=(0,Ut.Z)(wr,2),Lr=Tr[0],Xr=Tr[1];Dt.useEffect(function(){Xr((0,ue.Z)())},[]);var oo=Dt.useRef(null),so=Dt.useRef(null),bo=Dt.useRef(null),io=Dt.useRef(null),go=Dt.useRef(null),be=Dt.useRef(!1),Oo=Yt(),rs=(0,Ut.Z)(Oo,3),po=rs[0],Qr=rs[1],ps=rs[2];Dt.useImperativeHandle(se,function(){var $r,zr;return{focus:($r=io.current)===null||$r===void 0?void 0:$r.focus,blur:(zr=io.current)===null||zr===void 0?void 0:zr.blur,scrollTo:function(bn){var qo;return(qo=go.current)===null||qo===void 0?void 0:qo.scrollTo(bn)},nativeElement:oo.current||so.current}});var ao=Dt.useMemo(function(){var $r;if(rr!=="combobox")return pi;var zr=($r=Hi[0])===null||$r===void 0?void 0:$r.value;return typeof zr=="string"||typeof zr=="number"?String(zr):""},[pi,rr,Hi]),Pl=rr==="combobox"&&typeof ze=="function"&&ze()||null,jr=typeof gn=="function"&&gn(),Io=(0,qt.x1)(so,jr==null||(xi=jr.props)===null||xi===void 0?void 0:xi.ref),hl=Dt.useState(!1),Bo=(0,Ut.Z)(hl,2),ho=Bo[0],ta=Bo[1];(0,Ne.Z)(function(){ta(!0)},[]);var jn=(0,Ae.Z)(!1,{defaultValue:Sn,value:nr}),Ba=(0,Ut.Z)(jn,2),Oa=Ba[0],Vs=Ba[1],Qo=ho?Oa:!1,Gs=!Fn&&ki;(Sr||Gs&&Qo&&rr==="combobox")&&(Qo=!1);var nn=Gs?!1:Qo,Jn=Dt.useCallback(function($r){var zr=$r!==void 0?$r:!Qo;Sr||(Vs(zr),Qo!==zr&&(Ke==null||Ke(zr)))},[Sr,Qo,Vs,Ke]),qn=Dt.useMemo(function(){return(_e||[]).some(function($r){return[`
|
|
`,`\r
|
|
`].includes($r)})},[_e]),mr=Dt.useContext(At)||{},Nr=mr.maxCount,no=mr.rawValues,Hn=function(zr,fs,bn){if(!(Wi&&Ri(Nr)&&(no==null?void 0:no.size)>=Nr)){var qo=!0,Gt=zr;ke==null||ke(null);var ci=ft(zr,_e,Ri(Nr)?Nr-no.size:void 0),dl=bn?null:ci;return rr!=="combobox"&&dl&&(Gt="",cn==null||cn(dl),Jn(!1),qo=!1),Me&&ao!==Gt&&Me(Gt,{source:fs?"typing":"effect"}),qo}},ea=function(zr){!zr||!zr.trim()||Me(zr,{source:"submit"})};Dt.useEffect(function(){!Qo&&!Wi&&rr!=="combobox"&&Hn("",!1,!1)},[Qo]),Dt.useEffect(function(){Oa&&Sr&&Vs(!1),Sr&&!be.current&&Qr(!1)},[Sr]);var os=Vt(),$o=(0,Ut.Z)(os,2),vo=$o[0],Ps=$o[1],ha=Dt.useRef(!1),Ns=function(zr){var fs=vo(),bn=zr.key,qo=bn==="Enter";if(qo&&(rr!=="combobox"&&zr.preventDefault(),Qo||Jn(!0)),Ps(!!ao),bn==="Backspace"&&!fs&&Wi&&!ao&&Hi.length){for(var Gt=(0,_t.Z)(Hi),ci=null,dl=Gt.length-1;dl>=0;dl-=1){var eu=Gt[dl];if(!eu.disabled){Gt.splice(dl,1),ci=eu;break}}ci&&Xi(Gt,{type:"remove",values:[ci]})}for(var Ma=arguments.length,ca=new Array(Ma>1?Ma-1:0),Nl=1;Nl<Ma;Nl++)ca[Nl-1]=arguments[Nl];if(Qo&&(!qo||!ha.current)){var Su;qo&&(ha.current=!0),(Su=go.current)===null||Su===void 0||Su.onKeyDown.apply(Su,[zr].concat(ca))}mn==null||mn.apply(void 0,[zr].concat(ca))},ia=function(zr){for(var fs=arguments.length,bn=new Array(fs>1?fs-1:0),qo=1;qo<fs;qo++)bn[qo-1]=arguments[qo];if(Qo){var Gt;(Gt=go.current)===null||Gt===void 0||Gt.onKeyUp.apply(Gt,[zr].concat(bn))}zr.key==="Enter"&&(ha.current=!1),Gi==null||Gi.apply(void 0,[zr].concat(bn))},cl=function(zr){var fs=Hi.filter(function(bn){return bn!==zr});Xi(fs,{type:"remove",values:[zr]})},Ia=function(){ha.current=!1},_l=Dt.useRef(!1),bh=function(){Qr(!0),Sr||(vn&&!_l.current&&vn.apply(void 0,arguments),sn.includes("focus")&&Jn(!0)),_l.current=!0},gs=function(){be.current=!0,Qr(!1,function(){_l.current=!1,be.current=!1,Jn(!1)}),!Sr&&(ao&&(rr==="tags"?Me(ao,{source:"submit"}):rr==="multiple"&&Me("",{source:"blur"})),Yn&&Yn.apply(void 0,arguments))},Ja=[];Dt.useEffect(function(){return function(){Ja.forEach(function($r){return clearTimeout($r)}),Ja.splice(0,Ja.length)}},[]);var fl=function(zr){var fs,bn=zr.target,qo=(fs=bo.current)===null||fs===void 0?void 0:fs.getPopupElement();if(qo&&qo.contains(bn)){var Gt=setTimeout(function(){var Ma=Ja.indexOf(Gt);if(Ma!==-1&&Ja.splice(Ma,1),ps(),!Lr&&!qo.contains(document.activeElement)){var ca;(ca=io.current)===null||ca===void 0||ca.focus()}});Ja.push(Gt)}for(var ci=arguments.length,dl=new Array(ci>1?ci-1:0),eu=1;eu<ci;eu++)dl[eu-1]=arguments[eu];Kn==null||Kn.apply(void 0,[zr].concat(dl))},Ca=Dt.useState({}),ql=(0,Ut.Z)(Ca,2),tu=ql[1];function Bi(){tu({})}var Fi;jr&&(Fi=function(zr){Jn(zr)}),pe(function(){var $r;return[oo.current,($r=bo.current)===null||$r===void 0?void 0:$r.getPopupElement()]},nn,Jn,!!jr);var In=Dt.useMemo(function(){return(0,me.Z)((0,me.Z)({},It),{},{notFoundContent:Fn,open:Qo,triggerOpen:nn,id:Di,showSearch:li,multiple:Wi,toggleOpen:Jn})},[It,Fn,nn,Qo,Di,li,Wi,Jn]),dr=!!kn||Kr,xr;dr&&(xr=Dt.createElement(Jt,{className:zt()("".concat(Oe,"-arrow"),(0,ce.Z)({},"".concat(Oe,"-arrow-loading"),Kr)),customizeIcon:kn,customizeIconProps:{loading:Kr,searchValue:ao,open:Qo,focused:po,showSearch:li}}));var Hr=function(){var zr;qi==null||qi(),(zr=io.current)===null||zr===void 0||zr.focus(),Xi([],{type:"clear",values:Hi}),Hn("",!1,!1)},ro=Pe(Oe,Hr,Hi,bi,zn,Sr,ao,rr),Ro=ro.allowClear,jo=ro.clearIcon,Uo=Dt.createElement(Bn,{ref:go}),Qa=zt()(Oe,Ti,(0,ce.Z)((0,ce.Z)((0,ce.Z)((0,ce.Z)((0,ce.Z)((0,ce.Z)((0,ce.Z)((0,ce.Z)((0,ce.Z)((0,ce.Z)({},"".concat(Oe,"-focused"),po),"".concat(Oe,"-multiple"),Wi),"".concat(Oe,"-single"),!Wi),"".concat(Oe,"-allow-clear"),bi),"".concat(Oe,"-show-arrow"),dr),"".concat(Oe,"-disabled"),Sr),"".concat(Oe,"-loading"),Kr),"".concat(Oe,"-open"),Qo),"".concat(Oe,"-customize-input"),Pl),"".concat(Oe,"-show-search"),li)),ka=Dt.createElement(Be,{ref:bo,disabled:Sr,prefixCls:Oe,visible:nn,popupElement:Uo,animation:Tn,transitionName:or,dropdownStyle:Fr,dropdownClassName:Zn,direction:yn,dropdownMatchSelectWidth:ji,dropdownRender:Pt,dropdownAlign:gr,placement:Un,builtinPlacements:Ar,getPopupContainer:Dr,empty:ki,getTriggerDOMNode:function(zr){return so.current||zr},onPopupVisibleChange:Fi,onPopupMouseEnter:Bi},jr?Dt.cloneElement(jr,{ref:Io}):Dt.createElement(ti,(0,pt.Z)({},It,{domRef:so,prefixCls:Oe,inputElement:Pl,ref:io,id:Di,prefix:pn,showSearch:li,autoClearSearchValue:Ei,mode:rr,activeDescendantId:$e,tagRender:ln,values:Hi,open:Qo,onToggleOpen:Jn,activeValue:Fe,searchValue:ao,onSearch:Hn,onSearchSubmit:ea,onRemove:cl,tokenWithEnter:qn,onInputBlur:Ia}))),yo;return jr?yo=ka:yo=Dt.createElement("div",(0,pt.Z)({className:Qa},Pn,{ref:oo,onMouseDown:fl,onKeyDown:Ns,onKeyUp:ia,onFocus:bh,onBlur:gs}),Dt.createElement(wt,{visible:po&&!Qo,values:Hi}),ka,xr,Ro&&jo),Dt.createElement(je.Provider,{value:In},yo)}),xe=qe,Zi=function(){return null};Zi.isSelectOptGroup=!0;var Si=Zi,Oi=function(){return null};Oi.isSelectOption=!0;var Qi=Oi,Cn=Mt(80547),_i=Mt(2738),Mn=Mt(48911);function er(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var ir=["disabled","title","children","style","className"];function fr(It){return typeof It=="string"||typeof It=="number"}var ar=function(se,xi){var Di=De(),Oe=Di.prefixCls,Ti=Di.id,rn=Di.open,ln=Di.multiple,yn=Di.mode,ii=Di.searchValue,Hi=Di.toggleOpen,Xi=Di.notFoundContent,ki=Di.onPopupScroll,En=Dt.useContext(At),Fn=En.maxCount,qi=En.flattenOptions,rr=En.onActiveValue,Sr=En.defaultActiveFirstOption,Kr=En.onSelect,ze=En.menuItemSelectedIcon,gn=En.rawValues,nr=En.fieldNames,Sn=En.virtual,Ke=En.direction,Fe=En.listHeight,ke=En.listItemHeight,$e=En.optionRender,pi="".concat(Oe,"-item"),Ei=(0,Cn.Z)(function(){return qi},[rn,qi],function(Cr,sn){return sn[0]&&Cr[1]!==sn[1]}),Me=Dt.useRef(null),cn=Dt.useMemo(function(){return ln&&Ri(Fn)&&(gn==null?void 0:gn.size)>=Fn},[ln,Fn,gn==null?void 0:gn.size]),_e=function(sn){sn.preventDefault()},bi=function(sn){var vn;(vn=Me.current)===null||vn===void 0||vn.scrollTo(typeof sn=="number"?{index:sn}:sn)},pn=Dt.useCallback(function(Cr){return yn==="combobox"?!1:gn.has(Cr)},[yn,(0,_t.Z)(gn).toString(),gn.size]),kn=function(sn){for(var vn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Yn=Ei.length,Gi=0;Gi<Yn;Gi+=1){var mn=(sn+Gi*vn+Yn)%Yn,Kn=Ei[mn]||{},un=Kn.group,Wi=Kn.data;if(!un&&!(Wi!=null&&Wi.disabled)&&(pn(Wi.value)||!cn))return mn}return-1},zn=Dt.useState(function(){return kn(0)}),Bn=(0,Ut.Z)(zn,2),Tn=Bn[0],or=Bn[1],Fr=function(sn){var vn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;or(sn);var Yn={source:vn?"keyboard":"mouse"},Gi=Ei[sn];if(!Gi){rr(null,-1,Yn);return}rr(Gi.value,sn,Yn)};(0,Dt.useEffect)(function(){Fr(Sr!==!1?kn(0):-1)},[Ei.length,ii]);var Zn=Dt.useCallback(function(Cr){return yn==="combobox"?String(Cr).toLowerCase()===ii.toLowerCase():gn.has(Cr)},[yn,ii,(0,_t.Z)(gn).toString(),gn.size]);(0,Dt.useEffect)(function(){var Cr=setTimeout(function(){if(!ln&&rn&&gn.size===1){var vn=Array.from(gn)[0],Yn=Ei.findIndex(function(Gi){var mn=Gi.data;return ii?String(mn.value).startsWith(ii):mn.value===vn});Yn!==-1&&(Fr(Yn),bi(Yn))}});if(rn){var sn;(sn=Me.current)===null||sn===void 0||sn.scrollTo(void 0)}return function(){return clearTimeout(Cr)}},[rn,ii]);var ji=function(sn){sn!==void 0&&Kr(sn,{selected:!gn.has(sn)}),ln||Hi(!1)};if(Dt.useImperativeHandle(xi,function(){return{onKeyDown:function(sn){var vn=sn.which,Yn=sn.ctrlKey;switch(vn){case Xt.Z.N:case Xt.Z.P:case Xt.Z.UP:case Xt.Z.DOWN:{var Gi=0;if(vn===Xt.Z.UP?Gi=-1:vn===Xt.Z.DOWN?Gi=1:er()&&Yn&&(vn===Xt.Z.N?Gi=1:vn===Xt.Z.P&&(Gi=-1)),Gi!==0){var mn=kn(Tn+Gi,Gi);bi(mn),Fr(mn,!0)}break}case Xt.Z.TAB:case Xt.Z.ENTER:{var Kn,un=Ei[Tn];un&&!(un!=null&&(Kn=un.data)!==null&&Kn!==void 0&&Kn.disabled)&&!cn?ji(un.value):ji(void 0),rn&&sn.preventDefault();break}case Xt.Z.ESC:Hi(!1),rn&&sn.stopPropagation()}},onKeyUp:function(){},scrollTo:function(sn){bi(sn)}}}),Ei.length===0)return Dt.createElement("div",{role:"listbox",id:"".concat(Ti,"_list"),className:"".concat(pi,"-empty"),onMouseDown:_e},Xi);var Pt=Object.keys(nr).map(function(Cr){return nr[Cr]}),gr=function(sn){return sn.label};function Un(Cr,sn){var vn=Cr.group;return{role:vn?"presentation":"option",id:"".concat(Ti,"_list_").concat(sn)}}var Ar=function(sn){var vn=Ei[sn];if(!vn)return null;var Yn=vn.data||{},Gi=Yn.value,mn=vn.group,Kn=(0,Wt.Z)(Yn,!0),un=gr(vn);return vn?Dt.createElement("div",(0,pt.Z)({"aria-label":typeof un=="string"&&!mn?un:null},Kn,{key:sn},Un(vn,sn),{"aria-selected":Zn(Gi)}),Gi):null},Dr={role:"listbox",id:"".concat(Ti,"_list")};return Dt.createElement(Dt.Fragment,null,Sn&&Dt.createElement("div",(0,pt.Z)({},Dr,{style:{height:0,width:0,overflow:"hidden"}}),Ar(Tn-1),Ar(Tn),Ar(Tn+1)),Dt.createElement(Mn.Z,{itemKey:"key",ref:Me,data:Ei,height:Fe,itemHeight:ke,fullHeight:!1,onMouseDown:_e,onScroll:ki,virtual:Sn,direction:Ke,innerProps:Sn?null:Dr},function(Cr,sn){var vn=Cr.group,Yn=Cr.groupOption,Gi=Cr.data,mn=Cr.label,Kn=Cr.value,un=Gi.key;if(vn){var Wi,li=(Wi=Gi.title)!==null&&Wi!==void 0?Wi:fr(mn)?mn.toString():void 0;return Dt.createElement("div",{className:zt()(pi,"".concat(pi,"-group"),Gi.className),title:li},mn!==void 0?mn:un)}var Pn=Gi.disabled,wr=Gi.title,Tr=Gi.children,Lr=Gi.style,Xr=Gi.className,oo=(0,fe.Z)(Gi,ir),so=(0,_i.Z)(oo,Pt),bo=pn(Kn),io=Pn||!bo&&cn,go="".concat(pi,"-option"),be=zt()(pi,go,Xr,(0,ce.Z)((0,ce.Z)((0,ce.Z)((0,ce.Z)({},"".concat(go,"-grouped"),Yn),"".concat(go,"-active"),Tn===sn&&!io),"".concat(go,"-disabled"),io),"".concat(go,"-selected"),bo)),Oo=gr(Cr),rs=!ze||typeof ze=="function"||bo,po=typeof Oo=="number"?Oo:Oo||Kn,Qr=fr(po)?po.toString():void 0;return wr!==void 0&&(Qr=wr),Dt.createElement("div",(0,pt.Z)({},(0,Wt.Z)(so),Sn?{}:Un(Cr,sn),{"aria-selected":Zn(Kn),className:be,title:Qr,onMouseMove:function(){Tn===sn||io||Fr(sn)},onClick:function(){io||ji(Kn)},style:Lr}),Dt.createElement("div",{className:"".concat(go,"-content")},typeof $e=="function"?$e(Cr,{index:sn}):po),Dt.isValidElement(ze)||bo,rs&&Dt.createElement(Jt,{className:"".concat(pi,"-option-state"),customizeIcon:ze,customizeIconProps:{value:Kn,disabled:io,isSelected:bo}},bo?"\u2713":null))}))},br=Dt.forwardRef(ar),Qn=br,Nn=function(It,se){var xi=Dt.useRef({values:new Map,options:new Map}),Di=Dt.useMemo(function(){var Ti=xi.current,rn=Ti.values,ln=Ti.options,yn=It.map(function(Xi){if(Xi.label===void 0){var ki;return(0,me.Z)((0,me.Z)({},Xi),{},{label:(ki=rn.get(Xi.value))===null||ki===void 0?void 0:ki.label})}return Xi}),ii=new Map,Hi=new Map;return yn.forEach(function(Xi){ii.set(Xi.value,Xi),Hi.set(Xi.value,se.get(Xi.value)||ln.get(Xi.value))}),xi.current.values=ii,xi.current.options=Hi,yn},[It,se]),Oe=Dt.useCallback(function(Ti){return se.get(Ti)||xi.current.options.get(Ti)},[se]);return[Di,Oe]};function yr(It,se){return yi(It).join("").toUpperCase().includes(se)}var yt=function(It,se,xi,Di,Oe){return Dt.useMemo(function(){if(!xi||Di===!1)return It;var Ti=se.options,rn=se.label,ln=se.value,yn=[],ii=typeof Di=="function",Hi=xi.toUpperCase(),Xi=ii?Di:function(En,Fn){return Oe?yr(Fn[Oe],Hi):Fn[Ti]?yr(Fn[rn!=="children"?rn:"label"],Hi):yr(Fn[ln],Hi)},ki=ii?function(En){return gt(En)}:function(En){return En};return It.forEach(function(En){if(En[Ti]){var Fn=Xi(xi,ki(En));if(Fn)yn.push(En);else{var qi=En[Ti].filter(function(rr){return Xi(xi,ki(rr))});qi.length&&yn.push((0,me.Z)((0,me.Z)({},En),{},(0,ce.Z)({},Ti,qi)))}return}Xi(xi,ki(En))&&yn.push(En)}),yn},[It,Di,Oe,xi,se])},Mi=Mt(6551),on=Mt(11592),Ui=["children","value"],an=["children"];function vi(It){var se=It,xi=se.key,Di=se.props,Oe=Di.children,Ti=Di.value,rn=(0,fe.Z)(Di,Ui);return(0,me.Z)({key:xi,value:Ti!==void 0?Ti:xi,children:Oe},rn)}function di(It){var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,on.Z)(It).map(function(xi,Di){if(!Dt.isValidElement(xi)||!xi.type)return null;var Oe=xi,Ti=Oe.type.isSelectOptGroup,rn=Oe.key,ln=Oe.props,yn=ln.children,ii=(0,fe.Z)(ln,an);return se||!Ti?vi(xi):(0,me.Z)((0,me.Z)({key:"__RC_SELECT_GRP__".concat(rn===null?Di:rn,"__"),label:rn},ii),{},{options:di(yn)})}).filter(function(xi){return xi})}var xn=function(se,xi,Di,Oe,Ti){return Dt.useMemo(function(){var rn=se,ln=!se;ln&&(rn=di(xi));var yn=new Map,ii=new Map,Hi=function(En,Fn,qi){qi&&typeof qi=="string"&&En.set(Fn[qi],Fn)},Xi=function ki(En){for(var Fn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,qi=0;qi<En.length;qi+=1){var rr=En[qi];!rr[Di.options]||Fn?(yn.set(rr[Di.value],rr),Hi(ii,rr,Di.label),Hi(ii,rr,Oe),Hi(ii,rr,Ti)):ki(rr[Di.options],!0)}};return Xi(rn),{options:rn,valueOptions:yn,labelOptions:ii}},[se,xi,Di,Oe,Ti])},en=xn;function hn(It){var se=Dt.useRef();se.current=It;var xi=Dt.useCallback(function(){return se.current.apply(se,arguments)},[]);return xi}function Vi(It){var se=It.mode,xi=It.options,Di=It.children,Oe=It.backfill,Ti=It.allowClear,rn=It.placeholder,ln=It.getInputElement,yn=It.showSearch,ii=It.onSearch,Hi=It.defaultOpen,Xi=It.autoFocus,ki=It.labelInValue,En=It.value,Fn=It.inputValue,qi=It.optionLabelProp,rr=isMultiple(se),Sr=yn!==void 0?yn:rr||se==="combobox",Kr=xi||convertChildrenToData(Di);if(warning(se!=="tags"||Kr.every(function(Sn){return!Sn.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),se==="tags"||se==="combobox"){var ze=Kr.some(function(Sn){return Sn.options?Sn.options.some(function(Ke){return typeof("value"in Ke?Ke.value:Ke.key)=="number"}):typeof("value"in Sn?Sn.value:Sn.key)=="number"});warning(!ze,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(se!=="combobox"||!qi,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(se==="combobox"||!Oe,"`backfill` only works with `combobox` mode."),warning(se==="combobox"||!ln,"`getInputElement` only work with `combobox` mode."),noteOnce(se!=="combobox"||!ln||!Ti||!rn,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ii&&!Sr&&se!=="combobox"&&se!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Hi||Xi,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),En!=null){var gn=toArray(En);warning(!ki||gn.every(function(Sn){return _typeof(Sn)==="object"&&("key"in Sn||"value"in Sn)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!rr||Array.isArray(En),"`value` should be array when `mode` is `multiple` or `tags`")}if(Di){var nr=null;toNodeArray(Di).some(function(Sn){if(!React.isValidElement(Sn)||!Sn.type)return!1;var Ke=Sn,Fe=Ke.type;if(Fe.isSelectOption)return!1;if(Fe.isSelectOptGroup){var ke=toNodeArray(Sn.props.children).every(function($e){return!React.isValidElement($e)||!Sn.type||$e.type.isSelectOption?!0:(nr=$e.type,!1)});return!ke}return nr=Fe,!0}),nr&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(nr.displayName||nr.name||nr,"`.")),warning(Fn===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function zi(It,se){if(It){var xi=function Di(Oe){for(var Ti=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,rn=0;rn<Oe.length;rn++){var ln=Oe[rn];if(ln[se==null?void 0:se.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!Ti&&Array.isArray(ln[se==null?void 0:se.options])&&Di(ln[se==null?void 0:se.options],!0))break}};xi(It)}}var ur=null,Vn=["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"],$n=["inputValue"];function Xe(It){return!It||(0,$t.Z)(It)!=="object"}var mi=Dt.forwardRef(function(It,se){var xi=It.id,Di=It.mode,Oe=It.prefixCls,Ti=Oe===void 0?"rc-select":Oe,rn=It.backfill,ln=It.fieldNames,yn=It.inputValue,ii=It.searchValue,Hi=It.onSearch,Xi=It.autoClearSearchValue,ki=Xi===void 0?!0:Xi,En=It.onSelect,Fn=It.onDeselect,qi=It.dropdownMatchSelectWidth,rr=qi===void 0?!0:qi,Sr=It.filterOption,Kr=It.filterSort,ze=It.optionFilterProp,gn=It.optionLabelProp,nr=It.options,Sn=It.optionRender,Ke=It.children,Fe=It.defaultActiveFirstOption,ke=It.menuItemSelectedIcon,$e=It.virtual,pi=It.direction,Ei=It.listHeight,Me=Ei===void 0?200:Ei,cn=It.listItemHeight,_e=cn===void 0?20:cn,bi=It.labelRender,pn=It.value,kn=It.defaultValue,zn=It.labelInValue,Bn=It.onChange,Tn=It.maxCount,or=(0,fe.Z)(It,Vn),Fr=(0,Mi.ZP)(xi),Zn=ui(Di),ji=!!(!nr&&Ke),Pt=Dt.useMemo(function(){return Sr===void 0&&Di==="combobox"?!1:Sr},[Sr,Di]),gr=Dt.useMemo(function(){return Pi(ln,ji)},[JSON.stringify(ln),ji]),Un=(0,Ae.Z)("",{value:ii!==void 0?ii:yn,postState:function(qn){return qn||""}}),Ar=(0,Ut.Z)(Un,2),Dr=Ar[0],Cr=Ar[1],sn=en(nr,Ke,gr,ze,gn),vn=sn.valueOptions,Yn=sn.labelOptions,Gi=sn.options,mn=Dt.useCallback(function(Jn){var qn=yi(Jn);return qn.map(function(mr){var Nr,no,Hn,ea,os;if(Xe(mr))Nr=mr;else{var $o;Hn=mr.key,no=mr.label,Nr=($o=mr.value)!==null&&$o!==void 0?$o:Hn}var vo=vn.get(Nr);if(vo){var Ps;if(no===void 0&&(no=vo==null?void 0:vo[gn||gr.label]),Hn===void 0&&(Hn=(Ps=vo==null?void 0:vo.key)!==null&&Ps!==void 0?Ps:Nr),ea=vo==null?void 0:vo.disabled,os=vo==null?void 0:vo.title,0)var ha}return{label:no,value:Nr,key:Hn,disabled:ea,title:os}})},[gr,gn,vn]),Kn=(0,Ae.Z)(kn,{value:pn}),un=(0,Ut.Z)(Kn,2),Wi=un[0],li=un[1],Pn=Dt.useMemo(function(){var Jn,qn=Zn&&Wi===null?[]:Wi,mr=mn(qn);return Di==="combobox"&&bt((Jn=mr[0])===null||Jn===void 0?void 0:Jn.value)?[]:mr},[Wi,mn,Di,Zn]),wr=Nn(Pn,vn),Tr=(0,Ut.Z)(wr,2),Lr=Tr[0],Xr=Tr[1],oo=Dt.useMemo(function(){if(!Di&&Lr.length===1){var Jn=Lr[0];if(Jn.value===null&&(Jn.label===null||Jn.label===void 0))return[]}return Lr.map(function(qn){var mr;return(0,me.Z)((0,me.Z)({},qn),{},{label:(mr=typeof bi=="function"?bi(qn):qn.label)!==null&&mr!==void 0?mr:qn.value})})},[Di,Lr,bi]),so=Dt.useMemo(function(){return new Set(Lr.map(function(Jn){return Jn.value}))},[Lr]);Dt.useEffect(function(){if(Di==="combobox"){var Jn,qn=(Jn=Lr[0])===null||Jn===void 0?void 0:Jn.value;Cr(Bt(qn)?String(qn):"")}},[Lr]);var bo=hn(function(Jn,qn){var mr=qn!=null?qn:Jn;return(0,ce.Z)((0,ce.Z)({},gr.value,Jn),gr.label,mr)}),io=Dt.useMemo(function(){if(Di!=="tags")return Gi;var Jn=(0,_t.Z)(Gi),qn=function(Nr){return vn.has(Nr)};return(0,_t.Z)(Lr).sort(function(mr,Nr){return mr.value<Nr.value?-1:1}).forEach(function(mr){var Nr=mr.value;qn(Nr)||Jn.push(bo(Nr,mr.label))}),Jn},[bo,Gi,vn,Lr,Di]),go=yt(io,gr,Dr,Pt,ze),be=Dt.useMemo(function(){return Di!=="tags"||!Dr||go.some(function(Jn){return Jn[ze||"value"]===Dr})||go.some(function(Jn){return Jn[gr.value]===Dr})?go:[bo(Dr)].concat((0,_t.Z)(go))},[bo,ze,Di,go,Dr,gr]),Oo=function Jn(qn){var mr=(0,_t.Z)(qn).sort(function(Nr,no){return Kr(Nr,no,{searchValue:Dr})});return mr.map(function(Nr){return Array.isArray(Nr.options)?(0,me.Z)((0,me.Z)({},Nr),{},{options:Nr.options.length>0?Jn(Nr.options):Nr.options}):Nr})},rs=Dt.useMemo(function(){return Kr?Oo(be):be},[be,Kr,Dr]),po=Dt.useMemo(function(){return Ct(rs,{fieldNames:gr,childrenAsData:ji})},[rs,gr,ji]),Qr=function(qn){var mr=mn(qn);if(li(mr),Bn&&(mr.length!==Lr.length||mr.some(function(Hn,ea){var os;return((os=Lr[ea])===null||os===void 0?void 0:os.value)!==(Hn==null?void 0:Hn.value)}))){var Nr=zn?mr:mr.map(function(Hn){return Hn.value}),no=mr.map(function(Hn){return gt(Xr(Hn.value))});Bn(Zn?Nr:Nr[0],Zn?no:no[0])}},ps=Dt.useState(null),ao=(0,Ut.Z)(ps,2),Pl=ao[0],jr=ao[1],Io=Dt.useState(0),hl=(0,Ut.Z)(Io,2),Bo=hl[0],ho=hl[1],ta=Fe!==void 0?Fe:Di!=="combobox",jn=Dt.useCallback(function(Jn,qn){var mr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Nr=mr.source,no=Nr===void 0?"keyboard":Nr;ho(qn),rn&&Di==="combobox"&&Jn!==null&&no==="keyboard"&&jr(String(Jn))},[rn,Di]),Ba=function(qn,mr,Nr){var no=function(){var cl,Ia=Xr(qn);return[zn?{label:Ia==null?void 0:Ia[gr.label],value:qn,key:(cl=Ia==null?void 0:Ia.key)!==null&&cl!==void 0?cl:qn}:qn,gt(Ia)]};if(mr&&En){var Hn=no(),ea=(0,Ut.Z)(Hn,2),os=ea[0],$o=ea[1];En(os,$o)}else if(!mr&&Fn&&Nr!=="clear"){var vo=no(),Ps=(0,Ut.Z)(vo,2),ha=Ps[0],Ns=Ps[1];Fn(ha,Ns)}},Oa=hn(function(Jn,qn){var mr,Nr=Zn?qn.selected:!0;Nr?mr=Zn?[].concat((0,_t.Z)(Lr),[Jn]):[Jn]:mr=Lr.filter(function(no){return no.value!==Jn}),Qr(mr),Ba(Jn,Nr),Di==="combobox"?jr(""):(!ui||ki)&&(Cr(""),jr(""))}),Vs=function(qn,mr){Qr(qn);var Nr=mr.type,no=mr.values;(Nr==="remove"||Nr==="clear")&&no.forEach(function(Hn){Ba(Hn.value,!1,Nr)})},Qo=function(qn,mr){if(Cr(qn),jr(null),mr.source==="submit"){var Nr=(qn||"").trim();if(Nr){var no=Array.from(new Set([].concat((0,_t.Z)(so),[Nr])));Qr(no),Ba(Nr,!0),Cr("")}return}mr.source!=="blur"&&(Di==="combobox"&&Qr(qn),Hi==null||Hi(qn))},Gs=function(qn){var mr=qn;Di!=="tags"&&(mr=qn.map(function(no){var Hn=Yn.get(no);return Hn==null?void 0:Hn.value}).filter(function(no){return no!==void 0}));var Nr=Array.from(new Set([].concat((0,_t.Z)(so),(0,_t.Z)(mr))));Qr(Nr),Nr.forEach(function(no){Ba(no,!0)})},nn=Dt.useMemo(function(){var Jn=$e!==!1&&rr!==!1;return(0,me.Z)((0,me.Z)({},sn),{},{flattenOptions:po,onActiveValue:jn,defaultActiveFirstOption:ta,onSelect:Oa,menuItemSelectedIcon:ke,rawValues:so,fieldNames:gr,virtual:Jn,direction:pi,listHeight:Me,listItemHeight:_e,childrenAsData:ji,maxCount:Tn,optionRender:Sn})},[Tn,sn,po,jn,ta,Oa,ke,so,gr,$e,rr,pi,Me,_e,ji,Sn]);return Dt.createElement(At.Provider,{value:nn},Dt.createElement(xe,(0,pt.Z)({},or,{id:Fr,prefixCls:Ti,ref:se,omitDomProps:$n,mode:Di,displayValues:oo,onDisplayValuesChange:Vs,direction:pi,searchValue:Dr,onSearch:Qo,autoClearSearchValue:ki,onSearchSplit:Gs,dropdownMatchSelectWidth:rr,OptionList:Qn,emptyOptions:!po.length,activeValue:Pl,activeDescendantId:"".concat(Fr,"_list_").concat(Bo)})))}),fn=mi;fn.Option=Qi,fn.OptGroup=Si;var On=fn,Gn=On},63158:function(Li,ai,Mt){"use strict";var pt=Mt(54476),_t=Mt(20068),ce=Mt(42978),me=Mt(75931),Ut=Mt(59301),fe=Mt(92310),$t=Mt.n(fe),Ae=Mt(18929),re=Mt(10228),Dt=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],de=Ut.forwardRef(function(zt,Ne){var ue,qt=zt.prefixCls,Qt=qt===void 0?"rc-switch":qt,Jt=zt.className,Pe=zt.checked,je=zt.defaultChecked,De=zt.disabled,Yt=zt.loadingIcon,Vt=zt.checkedChildren,pe=zt.unCheckedChildren,Xt=zt.onClick,Le=zt.onChange,Wt=zt.onKeyDown,Ce=(0,me.Z)(zt,Dt),Te=(0,Ae.Z)(!1,{value:Pe,defaultValue:je}),ne=(0,ce.Z)(Te,2),Re=ne[0],ye=ne[1];function Ie(oi,Bt){var bt=Re;return De||(bt=oi,ye(bt),Le==null||Le(bt,Bt)),bt}function Ai(oi){oi.which===re.Z.LEFT?Ie(!1,oi):oi.which===re.Z.RIGHT&&Ie(!0,oi),Wt==null||Wt(oi)}function yi(oi){var Bt=Ie(!Re,oi);Xt==null||Xt(Bt,oi)}var gi=$t()(Qt,Jt,(ue={},(0,_t.Z)(ue,"".concat(Qt,"-checked"),Re),(0,_t.Z)(ue,"".concat(Qt,"-disabled"),De),ue));return Ut.createElement("button",(0,pt.Z)({},Ce,{type:"button",role:"switch","aria-checked":Re,disabled:De,className:gi,ref:Ne,onKeyDown:Ai,onClick:yi}),Yt,Ut.createElement("span",{className:"".concat(Qt,"-inner")},Ut.createElement("span",{className:"".concat(Qt,"-inner-checked")},Vt),Ut.createElement("span",{className:"".concat(Qt,"-inner-unchecked")},pe)))});de.displayName="Switch",ai.Z=de},22711:function(Li,ai,Mt){"use strict";Mt.r(ai),Mt.d(ai,{ResizableTextArea:function(){return ne},default:function(){return Ai}});var pt=Mt(54476),_t=Mt(20068),ce=Mt(33885),me=Mt(94480),Ut=Mt(42978),fe=Mt(75931),$t=Mt(92310),Ae=Mt.n($t),re=Mt(36901),Dt=Mt(66003),de=Mt(30292),zt=Mt(18929),Ne=Mt(59301),ue=Mt(76190),qt=Mt(29301),Qt=Mt(34280),Jt=Mt(16089),Pe=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important;
|
|
pointer-events: none !important;
|
|
`,je=["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"],De={},Yt;function Vt(yi){var gi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,oi=yi.getAttribute("id")||yi.getAttribute("data-reactid")||yi.getAttribute("name");if(gi&&De[oi])return De[oi];var Bt=window.getComputedStyle(yi),bt=Bt.getPropertyValue("box-sizing")||Bt.getPropertyValue("-moz-box-sizing")||Bt.getPropertyValue("-webkit-box-sizing"),ge=parseFloat(Bt.getPropertyValue("padding-bottom"))+parseFloat(Bt.getPropertyValue("padding-top")),Ge=parseFloat(Bt.getPropertyValue("border-bottom-width"))+parseFloat(Bt.getPropertyValue("border-top-width")),Ye=je.map(function(Ve){return"".concat(Ve,":").concat(Bt.getPropertyValue(Ve))}).join(";"),oe={sizingStyle:Ye,paddingSize:ge,borderSize:Ge,boxSizing:bt};return gi&&oi&&(De[oi]=oe),oe}function pe(yi){var gi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,oi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Bt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Yt||(Yt=document.createElement("textarea"),Yt.setAttribute("tab-index","-1"),Yt.setAttribute("aria-hidden","true"),Yt.setAttribute("name","hiddenTextarea"),document.body.appendChild(Yt)),yi.getAttribute("wrap")?Yt.setAttribute("wrap",yi.getAttribute("wrap")):Yt.removeAttribute("wrap");var bt=Vt(yi,gi),ge=bt.paddingSize,Ge=bt.borderSize,Ye=bt.boxSizing,oe=bt.sizingStyle;Yt.setAttribute("style","".concat(oe,";").concat(Pe)),Yt.value=yi.value||yi.placeholder||"";var Ve=void 0,Ze=void 0,Ni,Se=Yt.scrollHeight;if(Ye==="border-box"?Se+=Ge:Ye==="content-box"&&(Se-=ge),oi!==null||Bt!==null){Yt.value=" ";var ie=Yt.scrollHeight-ge;oi!==null&&(Ve=ie*oi,Ye==="border-box"&&(Ve=Ve+ge+Ge),Se=Math.max(Ve,Se)),Bt!==null&&(Ze=ie*Bt,Ye==="border-box"&&(Ze=Ze+ge+Ge),Ni=Se>Ze?"":"hidden",Se=Math.min(Ze,Se))}var ee={height:Se,overflowY:Ni,resize:"none"};return Ve&&(ee.minHeight=Ve),Ze&&(ee.maxHeight=Ze),ee}var Xt=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Le=0,Wt=1,Ce=2,Te=Ne.forwardRef(function(yi,gi){var oi=yi,Bt=oi.prefixCls,bt=oi.defaultValue,ge=oi.value,Ge=oi.autoSize,Ye=oi.onResize,oe=oi.className,Ve=oi.style,Ze=oi.disabled,Ni=oi.onChange,Se=oi.onInternalAutoSize,ie=(0,fe.Z)(oi,Xt),ee=(0,zt.Z)(bt,{value:ge,postState:function(Qi){return Qi!=null?Qi:""}}),ve=(0,Ut.Z)(ee,2),ti=ve[0],he=ve[1],We=function(Qi){he(Qi.target.value),Ni==null||Ni(Qi)},He=Ne.useRef();Ne.useImperativeHandle(gi,function(){return{textArea:He.current}});var we=Ne.useMemo(function(){return Ge&&(0,ue.Z)(Ge)==="object"?[Ge.minRows,Ge.maxRows]:[]},[Ge]),ei=(0,Ut.Z)(we,2),Be=ei[0],Zt=ei[1],Je=!!Ge,Ri=function(){try{if(document.activeElement===He.current){var Qi=He.current,Cn=Qi.selectionStart,_i=Qi.selectionEnd,Mn=Qi.scrollTop;He.current.setSelectionRange(Cn,_i),He.current.scrollTop=Mn}}catch(er){}},Pi=Ne.useState(Ce),Ct=(0,Ut.Z)(Pi,2),gt=Ct[0],ft=Ct[1],St=Ne.useState(),At=(0,Ut.Z)(St,2),wt=At[0],te=At[1],ni=function(){ft(Le)};(0,Qt.Z)(function(){Je&&ni()},[ge,Be,Zt,Je]),(0,Qt.Z)(function(){if(gt===Le)ft(Wt);else if(gt===Wt){var Oi=pe(He.current,!1,Be,Zt);ft(Ce),te(Oi)}else Ri()},[gt]);var ui=Ne.useRef(),qe=function(){Jt.Z.cancel(ui.current)},xe=function(Qi){gt===Ce&&(Ye==null||Ye(Qi),Ge&&(qe(),ui.current=(0,Jt.Z)(function(){ni()})))};Ne.useEffect(function(){return qe},[]);var Zi=Je?wt:null,Si=(0,ce.Z)((0,ce.Z)({},Ve),Zi);return(gt===Le||gt===Wt)&&(Si.overflowY="hidden",Si.overflowX="hidden"),Ne.createElement(qt.Z,{onResize:xe,disabled:!(Ge||Ye)},Ne.createElement("textarea",(0,pt.Z)({},ie,{ref:He,style:Si,className:Ae()(Bt,oe,(0,_t.Z)({},"".concat(Bt,"-disabled"),Ze)),disabled:Ze,value:ti,onChange:We})))}),ne=Te,Re=["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"],ye=Ne.forwardRef(function(yi,gi){var oi,Bt=yi.defaultValue,bt=yi.value,ge=yi.onFocus,Ge=yi.onBlur,Ye=yi.onChange,oe=yi.allowClear,Ve=yi.maxLength,Ze=yi.onCompositionStart,Ni=yi.onCompositionEnd,Se=yi.suffix,ie=yi.prefixCls,ee=ie===void 0?"rc-textarea":ie,ve=yi.showCount,ti=yi.count,he=yi.className,We=yi.style,He=yi.disabled,we=yi.hidden,ei=yi.classNames,Be=yi.styles,Zt=yi.onResize,Je=yi.onClear,Ri=yi.onPressEnter,Pi=yi.readOnly,Ct=yi.autoSize,gt=yi.onKeyDown,ft=(0,fe.Z)(yi,Re),St=(0,zt.Z)(Bt,{value:bt,defaultValue:Bt}),At=(0,Ut.Z)(St,2),wt=At[0],te=At[1],ni=wt==null?"":String(wt),ui=Ne.useState(!1),qe=(0,Ut.Z)(ui,2),xe=qe[0],Zi=qe[1],Si=Ne.useRef(!1),Oi=Ne.useState(null),Qi=(0,Ut.Z)(Oi,2),Cn=Qi[0],_i=Qi[1],Mn=(0,Ne.useRef)(null),er=(0,Ne.useRef)(null),ir=function(){var fn;return(fn=er.current)===null||fn===void 0?void 0:fn.textArea},fr=function(){ir().focus()};(0,Ne.useImperativeHandle)(gi,function(){var mi;return{resizableTextArea:er.current,focus:fr,blur:function(){ir().blur()},nativeElement:((mi=Mn.current)===null||mi===void 0?void 0:mi.nativeElement)||ir()}}),(0,Ne.useEffect)(function(){Zi(function(mi){return!He&&mi})},[He]);var ar=Ne.useState(null),br=(0,Ut.Z)(ar,2),Qn=br[0],Nn=br[1];Ne.useEffect(function(){if(Qn){var mi;(mi=ir()).setSelectionRange.apply(mi,(0,me.Z)(Qn))}},[Qn]);var yr=(0,Dt.Z)(ti,ve),yt=(oi=yr.max)!==null&&oi!==void 0?oi:Ve,Mi=Number(yt)>0,on=yr.strategy(ni),Ui=!!yt&&on>yt,an=function(fn,On){var Gn=On;!Si.current&&yr.exceedFormatter&&yr.max&&yr.strategy(On)>yr.max&&(Gn=yr.exceedFormatter(On,{max:yr.max}),On!==Gn&&Nn([ir().selectionStart||0,ir().selectionEnd||0])),te(Gn),(0,de.rJ)(fn.currentTarget,fn,Ye,Gn)},vi=function(fn){Si.current=!0,Ze==null||Ze(fn)},di=function(fn){Si.current=!1,an(fn,fn.currentTarget.value),Ni==null||Ni(fn)},xn=function(fn){an(fn,fn.target.value)},en=function(fn){fn.key==="Enter"&&Ri&&Ri(fn),gt==null||gt(fn)},hn=function(fn){Zi(!0),ge==null||ge(fn)},Vi=function(fn){Zi(!1),Ge==null||Ge(fn)},zi=function(fn){te(""),fr(),(0,de.rJ)(ir(),fn,Ye)},ur=Se,Vn;yr.show&&(yr.showFormatter?Vn=yr.showFormatter({value:ni,count:on,maxLength:yt}):Vn="".concat(on).concat(Mi?" / ".concat(yt):""),ur=Ne.createElement(Ne.Fragment,null,ur,Ne.createElement("span",{className:Ae()("".concat(ee,"-data-count"),ei==null?void 0:ei.count),style:Be==null?void 0:Be.count},Vn)));var $n=function(fn){var On;Zt==null||Zt(fn),(On=ir())!==null&&On!==void 0&&On.style.height&&_i(!0)},Xe=!Ct&&!ve&&!oe;return Ne.createElement(re.BaseInput,{ref:Mn,value:ni,allowClear:oe,handleReset:zi,suffix:ur,prefixCls:ee,classNames:(0,ce.Z)((0,ce.Z)({},ei),{},{affixWrapper:Ae()(ei==null?void 0:ei.affixWrapper,(0,_t.Z)((0,_t.Z)({},"".concat(ee,"-show-count"),ve),"".concat(ee,"-textarea-allow-clear"),oe))}),disabled:He,focused:xe,className:Ae()(he,Ui&&"".concat(ee,"-out-of-range")),style:(0,ce.Z)((0,ce.Z)({},We),Cn&&!Xe?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Vn=="string"?Vn:void 0}},hidden:we,readOnly:Pi,onClear:Je},Ne.createElement(ne,(0,pt.Z)({},ft,{autoSize:Ct,maxLength:Ve,onKeyDown:en,onChange:xn,onFocus:hn,onBlur:Vi,onCompositionStart:vi,onCompositionEnd:di,className:Ae()(ei==null?void 0:ei.textarea),style:(0,ce.Z)((0,ce.Z)({},Be==null?void 0:Be.textarea),{},{resize:We==null?void 0:We.resize}),disabled:He,prefixCls:ee,onResize:$n,ref:er,readOnly:Pi})))}),Ie=ye,Ai=Ie},639:function(Li,ai,Mt){"use strict";Mt.d(ai,{Z:function(){return De}});var pt=Mt(54476),_t=Mt(20068),ce=Mt(33885),me=Mt(42978),Ut=Mt(75931),fe=Mt(59301),$t=Mt(92310),Ae=Mt.n($t),re=Mt(26112),Dt=Mt(30699),de=function(Vt){for(var pe=Vt.prefixCls,Xt=Vt.level,Le=Vt.isStart,Wt=Vt.isEnd,Ce="".concat(pe,"-indent-unit"),Te=[],ne=0;ne<Xt;ne+=1)Te.push(fe.createElement("span",{key:ne,className:Ae()(Ce,(0,_t.Z)((0,_t.Z)({},"".concat(Ce,"-start"),Le[ne]),"".concat(Ce,"-end"),Wt[ne]))}));return fe.createElement("span",{"aria-hidden":"true",className:"".concat(pe,"-indent")},Te)},zt=fe.memo(de),Ne=Mt(65065),ue=Mt(34061),qt=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],Qt="open",Jt="close",Pe="---",je=function(Vt){var pe,Xt,Le,Wt=Vt.eventKey,Ce=Vt.className,Te=Vt.style,ne=Vt.dragOver,Re=Vt.dragOverGapTop,ye=Vt.dragOverGapBottom,Ie=Vt.isLeaf,Ai=Vt.isStart,yi=Vt.isEnd,gi=Vt.expanded,oi=Vt.selected,Bt=Vt.checked,bt=Vt.halfChecked,ge=Vt.loading,Ge=Vt.domRef,Ye=Vt.active,oe=Vt.data,Ve=Vt.onMouseMove,Ze=Vt.selectable,Ni=(0,Ut.Z)(Vt,qt),Se=fe.useContext(Dt.k),ie=fe.useContext(Dt.y),ee=fe.useRef(null),ve=fe.useState(!1),ti=(0,me.Z)(ve,2),he=ti[0],We=ti[1],He=!!(Se.disabled||Vt.disabled||(pe=ie.nodeDisabled)!==null&&pe!==void 0&&pe.call(ie,oe)),we=fe.useMemo(function(){return!Se.checkable||Vt.checkable===!1?!1:Se.checkable},[Se.checkable,Vt.checkable]),ei=function(on){He||Se.onNodeSelect(on,(0,ue.F)(Vt))},Be=function(on){He||!we||Vt.disableCheckbox||Se.onNodeCheck(on,(0,ue.F)(Vt),!Bt)},Zt=fe.useMemo(function(){return typeof Ze=="boolean"?Ze:Se.selectable},[Ze,Se.selectable]),Je=function(on){Se.onNodeClick(on,(0,ue.F)(Vt)),Zt?ei(on):Be(on)},Ri=function(on){Se.onNodeDoubleClick(on,(0,ue.F)(Vt))},Pi=function(on){Se.onNodeMouseEnter(on,(0,ue.F)(Vt))},Ct=function(on){Se.onNodeMouseLeave(on,(0,ue.F)(Vt))},gt=function(on){Se.onNodeContextMenu(on,(0,ue.F)(Vt))},ft=fe.useMemo(function(){return!!(Se.draggable&&(!Se.draggable.nodeDraggable||Se.draggable.nodeDraggable(oe)))},[Se.draggable,oe]),St=function(on){on.stopPropagation(),We(!0),Se.onNodeDragStart(on,Vt);try{on.dataTransfer.setData("text/plain","")}catch(Ui){}},At=function(on){on.preventDefault(),on.stopPropagation(),Se.onNodeDragEnter(on,Vt)},wt=function(on){on.preventDefault(),on.stopPropagation(),Se.onNodeDragOver(on,Vt)},te=function(on){on.stopPropagation(),Se.onNodeDragLeave(on,Vt)},ni=function(on){on.stopPropagation(),We(!1),Se.onNodeDragEnd(on,Vt)},ui=function(on){on.preventDefault(),on.stopPropagation(),We(!1),Se.onNodeDrop(on,Vt)},qe=function(on){ge||Se.onNodeExpand(on,(0,ue.F)(Vt))},xe=fe.useMemo(function(){var Mi=(0,Ne.Z)(Se.keyEntities,Wt)||{},on=Mi.children;return!!(on||[]).length},[Se.keyEntities,Wt]),Zi=fe.useMemo(function(){return Ie===!1?!1:Ie||!Se.loadData&&!xe||Se.loadData&&Vt.loaded&&!xe},[Ie,Se.loadData,xe,Vt.loaded]);fe.useEffect(function(){ge||typeof Se.loadData=="function"&&gi&&!Zi&&!Vt.loaded&&Se.onNodeLoad((0,ue.F)(Vt))},[ge,Se.loadData,Se.onNodeLoad,gi,Zi,Vt]);var Si=fe.useMemo(function(){var Mi;return(Mi=Se.draggable)!==null&&Mi!==void 0&&Mi.icon?fe.createElement("span",{className:"".concat(Se.prefixCls,"-draggable-icon")},Se.draggable.icon):null},[Se.draggable]),Oi=function(on){var Ui=Vt.switcherIcon||Se.switcherIcon;return typeof Ui=="function"?Ui((0,ce.Z)((0,ce.Z)({},Vt),{},{isLeaf:on})):Ui},Qi=function(){if(Zi){var on=Oi(!0);return on!==!1?fe.createElement("span",{className:Ae()("".concat(Se.prefixCls,"-switcher"),"".concat(Se.prefixCls,"-switcher-noop"))},on):null}var Ui=Oi(!1);return Ui!==!1?fe.createElement("span",{onClick:qe,className:Ae()("".concat(Se.prefixCls,"-switcher"),"".concat(Se.prefixCls,"-switcher_").concat(gi?Qt:Jt))},Ui):null},Cn=fe.useMemo(function(){if(!we)return null;var Mi=typeof we!="boolean"?we:null;return fe.createElement("span",{className:Ae()("".concat(Se.prefixCls,"-checkbox"),(0,_t.Z)((0,_t.Z)((0,_t.Z)({},"".concat(Se.prefixCls,"-checkbox-checked"),Bt),"".concat(Se.prefixCls,"-checkbox-indeterminate"),!Bt&&bt),"".concat(Se.prefixCls,"-checkbox-disabled"),He||Vt.disableCheckbox)),onClick:Be,role:"checkbox","aria-checked":bt?"mixed":Bt,"aria-disabled":He||Vt.disableCheckbox,"aria-label":"Select ".concat(typeof Vt.title=="string"?Vt.title:"tree node")},Mi)},[we,Bt,bt,He,Vt.disableCheckbox,Vt.title]),_i=fe.useMemo(function(){return Zi?null:gi?Qt:Jt},[Zi,gi]),Mn=fe.useMemo(function(){return fe.createElement("span",{className:Ae()("".concat(Se.prefixCls,"-iconEle"),"".concat(Se.prefixCls,"-icon__").concat(_i||"docu"),(0,_t.Z)({},"".concat(Se.prefixCls,"-icon_loading"),ge))})},[Se.prefixCls,_i,ge]),er=fe.useMemo(function(){var Mi=!!Se.draggable,on=!Vt.disabled&&Mi&&Se.dragOverNodeKey===Wt;return on?Se.dropIndicatorRender({dropPosition:Se.dropPosition,dropLevelOffset:Se.dropLevelOffset,indent:Se.indent,prefixCls:Se.prefixCls,direction:Se.direction}):null},[Se.dropPosition,Se.dropLevelOffset,Se.indent,Se.prefixCls,Se.direction,Se.draggable,Se.dragOverNodeKey,Se.dropIndicatorRender]),ir=fe.useMemo(function(){var Mi=Vt.title,on=Mi===void 0?Pe:Mi,Ui="".concat(Se.prefixCls,"-node-content-wrapper"),an;if(Se.showIcon){var vi=Vt.icon||Se.icon;an=vi?fe.createElement("span",{className:Ae()("".concat(Se.prefixCls,"-iconEle"),"".concat(Se.prefixCls,"-icon__customize"))},typeof vi=="function"?vi(Vt):vi):Mn}else Se.loadData&&ge&&(an=Mn);var di;return typeof on=="function"?di=on(oe):Se.titleRender?di=Se.titleRender(oe):di=on,fe.createElement("span",{ref:ee,title:typeof on=="string"?on:"",className:Ae()(Ui,"".concat(Ui,"-").concat(_i||"normal"),(0,_t.Z)({},"".concat(Se.prefixCls,"-node-selected"),!He&&(oi||he))),onMouseEnter:Pi,onMouseLeave:Ct,onContextMenu:gt,onClick:Je,onDoubleClick:Ri},an,fe.createElement("span",{className:"".concat(Se.prefixCls,"-title")},di),er)},[Se.prefixCls,Se.showIcon,Vt,Se.icon,Mn,Se.titleRender,oe,_i,Pi,Ct,gt,Je,Ri]),fr=(0,re.Z)(Ni,{aria:!0,data:!0}),ar=(0,Ne.Z)(Se.keyEntities,Wt)||{},br=ar.level,Qn=yi[yi.length-1],Nn=!He&&ft,yr=Se.draggingNodeKey===Wt,yt=Ze!==void 0?{"aria-selected":!!Ze}:void 0;return fe.createElement("div",(0,pt.Z)({ref:Ge,role:"treeitem","aria-expanded":Ie?void 0:gi,className:Ae()(Ce,"".concat(Se.prefixCls,"-treenode"),(Le={},(0,_t.Z)((0,_t.Z)((0,_t.Z)((0,_t.Z)((0,_t.Z)((0,_t.Z)((0,_t.Z)((0,_t.Z)((0,_t.Z)((0,_t.Z)(Le,"".concat(Se.prefixCls,"-treenode-disabled"),He),"".concat(Se.prefixCls,"-treenode-switcher-").concat(gi?"open":"close"),!Ie),"".concat(Se.prefixCls,"-treenode-checkbox-checked"),Bt),"".concat(Se.prefixCls,"-treenode-checkbox-indeterminate"),bt),"".concat(Se.prefixCls,"-treenode-selected"),oi),"".concat(Se.prefixCls,"-treenode-loading"),ge),"".concat(Se.prefixCls,"-treenode-active"),Ye),"".concat(Se.prefixCls,"-treenode-leaf-last"),Qn),"".concat(Se.prefixCls,"-treenode-draggable"),ft),"dragging",yr),(0,_t.Z)((0,_t.Z)((0,_t.Z)((0,_t.Z)((0,_t.Z)((0,_t.Z)((0,_t.Z)(Le,"drop-target",Se.dropTargetKey===Wt),"drop-container",Se.dropContainerKey===Wt),"drag-over",!He&&ne),"drag-over-gap-top",!He&&Re),"drag-over-gap-bottom",!He&&ye),"filter-node",(Xt=Se.filterTreeNode)===null||Xt===void 0?void 0:Xt.call(Se,(0,ue.F)(Vt))),"".concat(Se.prefixCls,"-treenode-leaf"),Zi))),style:Te,draggable:Nn,onDragStart:Nn?St:void 0,onDragEnter:ft?At:void 0,onDragOver:ft?wt:void 0,onDragLeave:ft?te:void 0,onDrop:ft?ui:void 0,onDragEnd:ft?ni:void 0,onMouseMove:Ve},yt,fr),fe.createElement(zt,{prefixCls:Se.prefixCls,level:br,isStart:Ai,isEnd:yi}),Si,Qi(),Cn,ir)};je.isTreeNode=1;var De=je},30699:function(Li,ai,Mt){"use strict";Mt.d(ai,{k:function(){return _t},y:function(){return ce}});var pt=Mt(59301),_t=pt.createContext(null),ce=pt.createContext({})},3741:function(Li,ai,Mt){"use strict";Mt.d(ai,{OF:function(){return Wt.Z},y6:function(){return Jt.y},ZP:function(){return He}});var pt=Mt(54476),_t=Mt(76190),ce=Mt(33885),me=Mt(94480),Ut=Mt(67732),fe=Mt(83652),$t=Mt(31226),Ae=Mt(42403),re=Mt(158),Dt=Mt(20068),de=Mt(92310),zt=Mt.n(de),Ne=Mt(10228),ue=Mt(26112),qt=Mt(48736),Qt=Mt(59301),Jt=Mt(30699),Pe=function(ei){var Be=ei.dropPosition,Zt=ei.dropLevelOffset,Je=ei.indent,Ri={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(Be){case-1:Ri.top=0,Ri.left=-Zt*Je;break;case 1:Ri.bottom=0,Ri.left=-Zt*Je;break;case 0:Ri.bottom=0,Ri.left=Je;break}return Qt.createElement("div",{style:Ri})},je=Pe;function De(we){if(we==null)throw new TypeError("Cannot destructure "+we)}var Yt=Mt(42978),Vt=Mt(75931),pe=Mt(34280),Xt=Mt(48911),Le=Mt(77900),Wt=Mt(639);function Ce(we,ei){var Be=Qt.useState(!1),Zt=(0,Yt.Z)(Be,2),Je=Zt[0],Ri=Zt[1];(0,pe.Z)(function(){if(Je)return we(),function(){ei()}},[Je]),(0,pe.Z)(function(){return Ri(!0),function(){Ri(!1)}},[])}var Te=Ce,ne=Mt(34061),Re=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],ye=Qt.forwardRef(function(we,ei){var Be=we.className,Zt=we.style,Je=we.motion,Ri=we.motionNodes,Pi=we.motionType,Ct=we.onMotionStart,gt=we.onMotionEnd,ft=we.active,St=we.treeNodeRequiredProps,At=(0,Vt.Z)(we,Re),wt=Qt.useState(!0),te=(0,Yt.Z)(wt,2),ni=te[0],ui=te[1],qe=Qt.useContext(Jt.k),xe=qe.prefixCls,Zi=Ri&&Pi!=="hide";(0,pe.Z)(function(){Ri&&Zi!==ni&&ui(Zi)},[Ri]);var Si=function(){Ri&&Ct()},Oi=Qt.useRef(!1),Qi=function(){Ri&&!Oi.current&&(Oi.current=!0,gt())};Te(Si,Qi);var Cn=function(Mn){Zi===Mn&&Qi()};return Ri?Qt.createElement(Le.default,(0,pt.Z)({ref:ei,visible:ni},Je,{motionAppear:Pi==="show",onVisibleChanged:Cn}),function(_i,Mn){var er=_i.className,ir=_i.style;return Qt.createElement("div",{ref:Mn,className:zt()("".concat(xe,"-treenode-motion"),er),style:ir},Ri.map(function(fr){var ar=Object.assign({},(De(fr.data),fr.data)),br=fr.title,Qn=fr.key,Nn=fr.isStart,yr=fr.isEnd;delete ar.children;var yt=(0,ne.H8)(Qn,St);return Qt.createElement(Wt.Z,(0,pt.Z)({},ar,yt,{title:br,active:ft,data:fr.data,key:Qn,isStart:Nn,isEnd:yr}))}))}):Qt.createElement(Wt.Z,(0,pt.Z)({domRef:ei,className:Be,style:Zt},At,{active:ft}))}),Ie=ye;function Ai(){var we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ei=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Be=we.length,Zt=ei.length;if(Math.abs(Be-Zt)!==1)return{add:!1,key:null};function Je(Ri,Pi){var Ct=new Map;Ri.forEach(function(ft){Ct.set(ft,!0)});var gt=Pi.filter(function(ft){return!Ct.has(ft)});return gt.length===1?gt[0]:null}return Be<Zt?{add:!0,key:Je(we,ei)}:{add:!1,key:Je(ei,we)}}function yi(we,ei,Be){var Zt=we.findIndex(function(Ct){return Ct.key===Be}),Je=we[Zt+1],Ri=ei.findIndex(function(Ct){return Ct.key===Be});if(Je){var Pi=ei.findIndex(function(Ct){return Ct.key===Je.key});return ei.slice(Ri+1,Pi)}return ei.slice(Ri+1)}var gi=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","scrollWidth","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],oi={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},Bt=function(){},bt="RC_TREE_MOTION_".concat(Math.random()),ge={key:bt},Ge={key:bt,level:0,index:0,pos:"0",node:ge,nodes:[ge]},Ye={parent:null,children:[],pos:Ge.pos,data:ge,title:null,key:bt,isStart:[],isEnd:[]};function oe(we,ei,Be,Zt){return ei===!1||!Be?we:we.slice(0,Math.ceil(Be/Zt)+1)}function Ve(we){var ei=we.key,Be=we.pos;return(0,ne.km)(ei,Be)}function Ze(we){for(var ei=String(we.data.key),Be=we;Be.parent;)Be=Be.parent,ei="".concat(Be.data.key," > ").concat(ei);return ei}var Ni=Qt.forwardRef(function(we,ei){var Be=we.prefixCls,Zt=we.data,Je=we.selectable,Ri=we.checkable,Pi=we.expandedKeys,Ct=we.selectedKeys,gt=we.checkedKeys,ft=we.loadedKeys,St=we.loadingKeys,At=we.halfCheckedKeys,wt=we.keyEntities,te=we.disabled,ni=we.dragging,ui=we.dragOverNodeKey,qe=we.dropPosition,xe=we.motion,Zi=we.height,Si=we.itemHeight,Oi=we.virtual,Qi=we.scrollWidth,Cn=we.focusable,_i=we.activeItem,Mn=we.focused,er=we.tabIndex,ir=we.onKeyDown,fr=we.onFocus,ar=we.onBlur,br=we.onActiveChange,Qn=we.onListChangeStart,Nn=we.onListChangeEnd,yr=(0,Vt.Z)(we,gi),yt=Qt.useRef(null),Mi=Qt.useRef(null);Qt.useImperativeHandle(ei,function(){return{scrollTo:function(ln){yt.current.scrollTo(ln)},getIndentWidth:function(){return Mi.current.offsetWidth}}});var on=Qt.useState(Pi),Ui=(0,Yt.Z)(on,2),an=Ui[0],vi=Ui[1],di=Qt.useState(Zt),xn=(0,Yt.Z)(di,2),en=xn[0],hn=xn[1],Vi=Qt.useState(Zt),zi=(0,Yt.Z)(Vi,2),ur=zi[0],Vn=zi[1],$n=Qt.useState([]),Xe=(0,Yt.Z)($n,2),mi=Xe[0],fn=Xe[1],On=Qt.useState(null),Gn=(0,Yt.Z)(On,2),It=Gn[0],se=Gn[1],xi=Qt.useRef(Zt);xi.current=Zt;function Di(){var rn=xi.current;hn(rn),Vn(rn),fn([]),se(null),Nn()}(0,pe.Z)(function(){vi(Pi);var rn=Ai(an,Pi);if(rn.key!==null)if(rn.add){var ln=en.findIndex(function(En){var Fn=En.key;return Fn===rn.key}),yn=oe(yi(en,Zt,rn.key),Oi,Zi,Si),ii=en.slice();ii.splice(ln+1,0,Ye),Vn(ii),fn(yn),se("show")}else{var Hi=Zt.findIndex(function(En){var Fn=En.key;return Fn===rn.key}),Xi=oe(yi(Zt,en,rn.key),Oi,Zi,Si),ki=Zt.slice();ki.splice(Hi+1,0,Ye),Vn(ki),fn(Xi),se("hide")}else en!==Zt&&(hn(Zt),Vn(Zt))},[Pi,Zt]),Qt.useEffect(function(){ni||Di()},[ni]);var Oe=xe?ur:Zt,Ti={expandedKeys:Pi,selectedKeys:Ct,loadedKeys:ft,loadingKeys:St,checkedKeys:gt,halfCheckedKeys:At,dragOverNodeKey:ui,dropPosition:qe,keyEntities:wt};return Qt.createElement(Qt.Fragment,null,Mn&&_i&&Qt.createElement("span",{style:oi,"aria-live":"assertive"},Ze(_i)),Qt.createElement("div",null,Qt.createElement("input",{style:oi,disabled:Cn===!1||te,tabIndex:Cn!==!1?er:null,onKeyDown:ir,onFocus:fr,onBlur:ar,value:"",onChange:Bt,"aria-label":"for screen reader"})),Qt.createElement("div",{className:"".concat(Be,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},Qt.createElement("div",{className:"".concat(Be,"-indent")},Qt.createElement("div",{ref:Mi,className:"".concat(Be,"-indent-unit")}))),Qt.createElement(Xt.Z,(0,pt.Z)({},yr,{data:Oe,itemKey:Ve,height:Zi,fullHeight:!1,virtual:Oi,itemHeight:Si,scrollWidth:Qi,prefixCls:"".concat(Be,"-list"),ref:yt,role:"tree",onVisibleChange:function(ln){ln.every(function(yn){return Ve(yn)!==bt})&&Di()}}),function(rn){var ln=rn.pos,yn=Object.assign({},(De(rn.data),rn.data)),ii=rn.title,Hi=rn.key,Xi=rn.isStart,ki=rn.isEnd,En=(0,ne.km)(Hi,ln);delete yn.key,delete yn.children;var Fn=(0,ne.H8)(En,Ti);return Qt.createElement(Ie,(0,pt.Z)({},yn,Fn,{title:ii,active:!!_i&&Hi===_i.key,pos:ln,data:rn.data,isStart:Xi,isEnd:ki,motion:xe,motionNodes:Hi===bt?mi:null,motionType:It,onMotionStart:Qn,onMotionEnd:Di,treeNodeRequiredProps:Ti,onMouseMove:function(){br(null)}}))}))}),Se=Ni,ie=Mt(82661),ee=Mt(34643),ve=Mt(65065),ti=10,he=function(we){(0,Ae.Z)(Be,we);var ei=(0,re.Z)(Be);function Be(){var Zt;(0,Ut.Z)(this,Be);for(var Je=arguments.length,Ri=new Array(Je),Pi=0;Pi<Je;Pi++)Ri[Pi]=arguments[Pi];return Zt=ei.call.apply(ei,[this].concat(Ri)),(0,Dt.Z)((0,$t.Z)(Zt),"destroyed",!1),(0,Dt.Z)((0,$t.Z)(Zt),"delayedDragEnterLogic",void 0),(0,Dt.Z)((0,$t.Z)(Zt),"loadingRetryTimes",{}),(0,Dt.Z)((0,$t.Z)(Zt),"state",{keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:(0,ne.w$)()}),(0,Dt.Z)((0,$t.Z)(Zt),"dragStartMousePosition",null),(0,Dt.Z)((0,$t.Z)(Zt),"dragNodeProps",null),(0,Dt.Z)((0,$t.Z)(Zt),"currentMouseOverDroppableNodeKey",null),(0,Dt.Z)((0,$t.Z)(Zt),"listRef",Qt.createRef()),(0,Dt.Z)((0,$t.Z)(Zt),"onNodeDragStart",function(Ct,gt){var ft=Zt.state,St=ft.expandedKeys,At=ft.keyEntities,wt=Zt.props.onDragStart,te=gt.eventKey;Zt.dragNodeProps=gt,Zt.dragStartMousePosition={x:Ct.clientX,y:Ct.clientY};var ni=(0,ie._5)(St,te);Zt.setState({draggingNodeKey:te,dragChildrenKeys:(0,ie.wA)(te,At),indent:Zt.listRef.current.getIndentWidth()}),Zt.setExpandedKeys(ni),window.addEventListener("dragend",Zt.onWindowDragEnd),wt==null||wt({event:Ct,node:(0,ne.F)(gt)})}),(0,Dt.Z)((0,$t.Z)(Zt),"onNodeDragEnter",function(Ct,gt){var ft=Zt.state,St=ft.expandedKeys,At=ft.keyEntities,wt=ft.dragChildrenKeys,te=ft.flattenNodes,ni=ft.indent,ui=Zt.props,qe=ui.onDragEnter,xe=ui.onExpand,Zi=ui.allowDrop,Si=ui.direction,Oi=gt.pos,Qi=gt.eventKey;if(Zt.currentMouseOverDroppableNodeKey!==Qi&&(Zt.currentMouseOverDroppableNodeKey=Qi),!Zt.dragNodeProps){Zt.resetDragState();return}var Cn=(0,ie.OM)(Ct,Zt.dragNodeProps,gt,ni,Zt.dragStartMousePosition,Zi,te,At,St,Si),_i=Cn.dropPosition,Mn=Cn.dropLevelOffset,er=Cn.dropTargetKey,ir=Cn.dropContainerKey,fr=Cn.dropTargetPos,ar=Cn.dropAllowed,br=Cn.dragOverNodeKey;if(wt.includes(er)||!ar){Zt.resetDragState();return}if(Zt.delayedDragEnterLogic||(Zt.delayedDragEnterLogic={}),Object.keys(Zt.delayedDragEnterLogic).forEach(function(Qn){clearTimeout(Zt.delayedDragEnterLogic[Qn])}),Zt.dragNodeProps.eventKey!==gt.eventKey&&(Ct.persist(),Zt.delayedDragEnterLogic[Oi]=window.setTimeout(function(){if(Zt.state.draggingNodeKey!==null){var Qn=(0,me.Z)(St),Nn=(0,ve.Z)(At,gt.eventKey);Nn&&(Nn.children||[]).length&&(Qn=(0,ie.L0)(St,gt.eventKey)),Zt.props.hasOwnProperty("expandedKeys")||Zt.setExpandedKeys(Qn),xe==null||xe(Qn,{node:(0,ne.F)(gt),expanded:!0,nativeEvent:Ct.nativeEvent})}},800)),Zt.dragNodeProps.eventKey===er&&Mn===0){Zt.resetDragState();return}Zt.setState({dragOverNodeKey:br,dropPosition:_i,dropLevelOffset:Mn,dropTargetKey:er,dropContainerKey:ir,dropTargetPos:fr,dropAllowed:ar}),qe==null||qe({event:Ct,node:(0,ne.F)(gt),expandedKeys:St})}),(0,Dt.Z)((0,$t.Z)(Zt),"onNodeDragOver",function(Ct,gt){var ft=Zt.state,St=ft.dragChildrenKeys,At=ft.flattenNodes,wt=ft.keyEntities,te=ft.expandedKeys,ni=ft.indent,ui=Zt.props,qe=ui.onDragOver,xe=ui.allowDrop,Zi=ui.direction;if(Zt.dragNodeProps){var Si=(0,ie.OM)(Ct,Zt.dragNodeProps,gt,ni,Zt.dragStartMousePosition,xe,At,wt,te,Zi),Oi=Si.dropPosition,Qi=Si.dropLevelOffset,Cn=Si.dropTargetKey,_i=Si.dropContainerKey,Mn=Si.dropTargetPos,er=Si.dropAllowed,ir=Si.dragOverNodeKey;St.includes(Cn)||!er||(Zt.dragNodeProps.eventKey===Cn&&Qi===0?Zt.state.dropPosition===null&&Zt.state.dropLevelOffset===null&&Zt.state.dropTargetKey===null&&Zt.state.dropContainerKey===null&&Zt.state.dropTargetPos===null&&Zt.state.dropAllowed===!1&&Zt.state.dragOverNodeKey===null||Zt.resetDragState():Oi===Zt.state.dropPosition&&Qi===Zt.state.dropLevelOffset&&Cn===Zt.state.dropTargetKey&&_i===Zt.state.dropContainerKey&&Mn===Zt.state.dropTargetPos&&er===Zt.state.dropAllowed&&ir===Zt.state.dragOverNodeKey||Zt.setState({dropPosition:Oi,dropLevelOffset:Qi,dropTargetKey:Cn,dropContainerKey:_i,dropTargetPos:Mn,dropAllowed:er,dragOverNodeKey:ir}),qe==null||qe({event:Ct,node:(0,ne.F)(gt)}))}}),(0,Dt.Z)((0,$t.Z)(Zt),"onNodeDragLeave",function(Ct,gt){Zt.currentMouseOverDroppableNodeKey===gt.eventKey&&!Ct.currentTarget.contains(Ct.relatedTarget)&&(Zt.resetDragState(),Zt.currentMouseOverDroppableNodeKey=null);var ft=Zt.props.onDragLeave;ft==null||ft({event:Ct,node:(0,ne.F)(gt)})}),(0,Dt.Z)((0,$t.Z)(Zt),"onWindowDragEnd",function(Ct){Zt.onNodeDragEnd(Ct,null,!0),window.removeEventListener("dragend",Zt.onWindowDragEnd)}),(0,Dt.Z)((0,$t.Z)(Zt),"onNodeDragEnd",function(Ct,gt){var ft=Zt.props.onDragEnd;Zt.setState({dragOverNodeKey:null}),Zt.cleanDragState(),ft==null||ft({event:Ct,node:(0,ne.F)(gt)}),Zt.dragNodeProps=null,window.removeEventListener("dragend",Zt.onWindowDragEnd)}),(0,Dt.Z)((0,$t.Z)(Zt),"onNodeDrop",function(Ct,gt){var ft,St=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,At=Zt.state,wt=At.dragChildrenKeys,te=At.dropPosition,ni=At.dropTargetKey,ui=At.dropTargetPos,qe=At.dropAllowed;if(qe){var xe=Zt.props.onDrop;if(Zt.setState({dragOverNodeKey:null}),Zt.cleanDragState(),ni!==null){var Zi=(0,ce.Z)((0,ce.Z)({},(0,ne.H8)(ni,Zt.getTreeNodeRequiredProps())),{},{active:((ft=Zt.getActiveItem())===null||ft===void 0?void 0:ft.key)===ni,data:(0,ve.Z)(Zt.state.keyEntities,ni).node}),Si=wt.includes(ni);(0,qt.ZP)(!Si,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var Oi=(0,ie.yx)(ui),Qi={event:Ct,node:(0,ne.F)(Zi),dragNode:Zt.dragNodeProps?(0,ne.F)(Zt.dragNodeProps):null,dragNodesKeys:[Zt.dragNodeProps.eventKey].concat(wt),dropToGap:te!==0,dropPosition:te+Number(Oi[Oi.length-1])};St||xe==null||xe(Qi),Zt.dragNodeProps=null}}}),(0,Dt.Z)((0,$t.Z)(Zt),"cleanDragState",function(){var Ct=Zt.state.draggingNodeKey;Ct!==null&&Zt.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),Zt.dragStartMousePosition=null,Zt.currentMouseOverDroppableNodeKey=null}),(0,Dt.Z)((0,$t.Z)(Zt),"triggerExpandActionExpand",function(Ct,gt){var ft=Zt.state,St=ft.expandedKeys,At=ft.flattenNodes,wt=gt.expanded,te=gt.key,ni=gt.isLeaf;if(!(ni||Ct.shiftKey||Ct.metaKey||Ct.ctrlKey)){var ui=At.filter(function(xe){return xe.key===te})[0],qe=(0,ne.F)((0,ce.Z)((0,ce.Z)({},(0,ne.H8)(te,Zt.getTreeNodeRequiredProps())),{},{data:ui.data}));Zt.setExpandedKeys(wt?(0,ie._5)(St,te):(0,ie.L0)(St,te)),Zt.onNodeExpand(Ct,qe)}}),(0,Dt.Z)((0,$t.Z)(Zt),"onNodeClick",function(Ct,gt){var ft=Zt.props,St=ft.onClick,At=ft.expandAction;At==="click"&&Zt.triggerExpandActionExpand(Ct,gt),St==null||St(Ct,gt)}),(0,Dt.Z)((0,$t.Z)(Zt),"onNodeDoubleClick",function(Ct,gt){var ft=Zt.props,St=ft.onDoubleClick,At=ft.expandAction;At==="doubleClick"&&Zt.triggerExpandActionExpand(Ct,gt),St==null||St(Ct,gt)}),(0,Dt.Z)((0,$t.Z)(Zt),"onNodeSelect",function(Ct,gt){var ft=Zt.state.selectedKeys,St=Zt.state,At=St.keyEntities,wt=St.fieldNames,te=Zt.props,ni=te.onSelect,ui=te.multiple,qe=gt.selected,xe=gt[wt.key],Zi=!qe;Zi?ui?ft=(0,ie.L0)(ft,xe):ft=[xe]:ft=(0,ie._5)(ft,xe);var Si=ft.map(function(Oi){var Qi=(0,ve.Z)(At,Oi);return Qi?Qi.node:null}).filter(Boolean);Zt.setUncontrolledState({selectedKeys:ft}),ni==null||ni(ft,{event:"select",selected:Zi,node:gt,selectedNodes:Si,nativeEvent:Ct.nativeEvent})}),(0,Dt.Z)((0,$t.Z)(Zt),"onNodeCheck",function(Ct,gt,ft){var St=Zt.state,At=St.keyEntities,wt=St.checkedKeys,te=St.halfCheckedKeys,ni=Zt.props,ui=ni.checkStrictly,qe=ni.onCheck,xe=gt.key,Zi,Si={event:"check",node:gt,checked:ft,nativeEvent:Ct.nativeEvent};if(ui){var Oi=ft?(0,ie.L0)(wt,xe):(0,ie._5)(wt,xe),Qi=(0,ie._5)(te,xe);Zi={checked:Oi,halfChecked:Qi},Si.checkedNodes=Oi.map(function(fr){return(0,ve.Z)(At,fr)}).filter(Boolean).map(function(fr){return fr.node}),Zt.setUncontrolledState({checkedKeys:Oi})}else{var Cn=(0,ee.S)([].concat((0,me.Z)(wt),[xe]),!0,At),_i=Cn.checkedKeys,Mn=Cn.halfCheckedKeys;if(!ft){var er=new Set(_i);er.delete(xe);var ir=(0,ee.S)(Array.from(er),{checked:!1,halfCheckedKeys:Mn},At);_i=ir.checkedKeys,Mn=ir.halfCheckedKeys}Zi=_i,Si.checkedNodes=[],Si.checkedNodesPositions=[],Si.halfCheckedKeys=Mn,_i.forEach(function(fr){var ar=(0,ve.Z)(At,fr);if(ar){var br=ar.node,Qn=ar.pos;Si.checkedNodes.push(br),Si.checkedNodesPositions.push({node:br,pos:Qn})}}),Zt.setUncontrolledState({checkedKeys:_i},!1,{halfCheckedKeys:Mn})}qe==null||qe(Zi,Si)}),(0,Dt.Z)((0,$t.Z)(Zt),"onNodeLoad",function(Ct){var gt,ft=Ct.key,St=Zt.state.keyEntities,At=(0,ve.Z)(St,ft);if(!(At!=null&&(gt=At.children)!==null&>!==void 0&>.length)){var wt=new Promise(function(te,ni){Zt.setState(function(ui){var qe=ui.loadedKeys,xe=qe===void 0?[]:qe,Zi=ui.loadingKeys,Si=Zi===void 0?[]:Zi,Oi=Zt.props,Qi=Oi.loadData,Cn=Oi.onLoad;if(!Qi||xe.includes(ft)||Si.includes(ft))return null;var _i=Qi(Ct);return _i.then(function(){var Mn=Zt.state.loadedKeys,er=(0,ie.L0)(Mn,ft);Cn==null||Cn(er,{event:"load",node:Ct}),Zt.setUncontrolledState({loadedKeys:er}),Zt.setState(function(ir){return{loadingKeys:(0,ie._5)(ir.loadingKeys,ft)}}),te()}).catch(function(Mn){if(Zt.setState(function(ir){return{loadingKeys:(0,ie._5)(ir.loadingKeys,ft)}}),Zt.loadingRetryTimes[ft]=(Zt.loadingRetryTimes[ft]||0)+1,Zt.loadingRetryTimes[ft]>=ti){var er=Zt.state.loadedKeys;(0,qt.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),Zt.setUncontrolledState({loadedKeys:(0,ie.L0)(er,ft)}),te()}ni(Mn)}),{loadingKeys:(0,ie.L0)(Si,ft)}})});return wt.catch(function(){}),wt}}),(0,Dt.Z)((0,$t.Z)(Zt),"onNodeMouseEnter",function(Ct,gt){var ft=Zt.props.onMouseEnter;ft==null||ft({event:Ct,node:gt})}),(0,Dt.Z)((0,$t.Z)(Zt),"onNodeMouseLeave",function(Ct,gt){var ft=Zt.props.onMouseLeave;ft==null||ft({event:Ct,node:gt})}),(0,Dt.Z)((0,$t.Z)(Zt),"onNodeContextMenu",function(Ct,gt){var ft=Zt.props.onRightClick;ft&&(Ct.preventDefault(),ft({event:Ct,node:gt}))}),(0,Dt.Z)((0,$t.Z)(Zt),"onFocus",function(){var Ct=Zt.props.onFocus;Zt.setState({focused:!0});for(var gt=arguments.length,ft=new Array(gt),St=0;St<gt;St++)ft[St]=arguments[St];Ct==null||Ct.apply(void 0,ft)}),(0,Dt.Z)((0,$t.Z)(Zt),"onBlur",function(){var Ct=Zt.props.onBlur;Zt.setState({focused:!1}),Zt.onActiveChange(null);for(var gt=arguments.length,ft=new Array(gt),St=0;St<gt;St++)ft[St]=arguments[St];Ct==null||Ct.apply(void 0,ft)}),(0,Dt.Z)((0,$t.Z)(Zt),"getTreeNodeRequiredProps",function(){var Ct=Zt.state,gt=Ct.expandedKeys,ft=Ct.selectedKeys,St=Ct.loadedKeys,At=Ct.loadingKeys,wt=Ct.checkedKeys,te=Ct.halfCheckedKeys,ni=Ct.dragOverNodeKey,ui=Ct.dropPosition,qe=Ct.keyEntities;return{expandedKeys:gt||[],selectedKeys:ft||[],loadedKeys:St||[],loadingKeys:At||[],checkedKeys:wt||[],halfCheckedKeys:te||[],dragOverNodeKey:ni,dropPosition:ui,keyEntities:qe}}),(0,Dt.Z)((0,$t.Z)(Zt),"setExpandedKeys",function(Ct){var gt=Zt.state,ft=gt.treeData,St=gt.fieldNames,At=(0,ne.oH)(ft,Ct,St);Zt.setUncontrolledState({expandedKeys:Ct,flattenNodes:At},!0)}),(0,Dt.Z)((0,$t.Z)(Zt),"onNodeExpand",function(Ct,gt){var ft=Zt.state.expandedKeys,St=Zt.state,At=St.listChanging,wt=St.fieldNames,te=Zt.props,ni=te.onExpand,ui=te.loadData,qe=gt.expanded,xe=gt[wt.key];if(!At){var Zi=ft.includes(xe),Si=!qe;if((0,qt.ZP)(qe&&Zi||!qe&&!Zi,"Expand state not sync with index check"),ft=Si?(0,ie.L0)(ft,xe):(0,ie._5)(ft,xe),Zt.setExpandedKeys(ft),ni==null||ni(ft,{node:gt,expanded:Si,nativeEvent:Ct.nativeEvent}),Si&&ui){var Oi=Zt.onNodeLoad(gt);Oi&&Oi.then(function(){var Qi=(0,ne.oH)(Zt.state.treeData,ft,wt);Zt.setUncontrolledState({flattenNodes:Qi})}).catch(function(){var Qi=Zt.state.expandedKeys,Cn=(0,ie._5)(Qi,xe);Zt.setExpandedKeys(Cn)})}}}),(0,Dt.Z)((0,$t.Z)(Zt),"onListChangeStart",function(){Zt.setUncontrolledState({listChanging:!0})}),(0,Dt.Z)((0,$t.Z)(Zt),"onListChangeEnd",function(){setTimeout(function(){Zt.setUncontrolledState({listChanging:!1})})}),(0,Dt.Z)((0,$t.Z)(Zt),"onActiveChange",function(Ct){var gt=Zt.state.activeKey,ft=Zt.props,St=ft.onActiveChange,At=ft.itemScrollOffset,wt=At===void 0?0:At;gt!==Ct&&(Zt.setState({activeKey:Ct}),Ct!==null&&Zt.scrollTo({key:Ct,offset:wt}),St==null||St(Ct))}),(0,Dt.Z)((0,$t.Z)(Zt),"getActiveItem",function(){var Ct=Zt.state,gt=Ct.activeKey,ft=Ct.flattenNodes;return gt===null?null:ft.find(function(St){var At=St.key;return At===gt})||null}),(0,Dt.Z)((0,$t.Z)(Zt),"offsetActiveKey",function(Ct){var gt=Zt.state,ft=gt.flattenNodes,St=gt.activeKey,At=ft.findIndex(function(ni){var ui=ni.key;return ui===St});At===-1&&Ct<0&&(At=ft.length),At=(At+Ct+ft.length)%ft.length;var wt=ft[At];if(wt){var te=wt.key;Zt.onActiveChange(te)}else Zt.onActiveChange(null)}),(0,Dt.Z)((0,$t.Z)(Zt),"onKeyDown",function(Ct){var gt=Zt.state,ft=gt.activeKey,St=gt.expandedKeys,At=gt.checkedKeys,wt=gt.fieldNames,te=Zt.props,ni=te.onKeyDown,ui=te.checkable,qe=te.selectable;switch(Ct.which){case Ne.Z.UP:{Zt.offsetActiveKey(-1),Ct.preventDefault();break}case Ne.Z.DOWN:{Zt.offsetActiveKey(1),Ct.preventDefault();break}}var xe=Zt.getActiveItem();if(xe&&xe.data){var Zi=Zt.getTreeNodeRequiredProps(),Si=xe.data.isLeaf===!1||!!(xe.data[wt.children]||[]).length,Oi=(0,ne.F)((0,ce.Z)((0,ce.Z)({},(0,ne.H8)(ft,Zi)),{},{data:xe.data,active:!0}));switch(Ct.which){case Ne.Z.LEFT:{Si&&St.includes(ft)?Zt.onNodeExpand({},Oi):xe.parent&&Zt.onActiveChange(xe.parent.key),Ct.preventDefault();break}case Ne.Z.RIGHT:{Si&&!St.includes(ft)?Zt.onNodeExpand({},Oi):xe.children&&xe.children.length&&Zt.onActiveChange(xe.children[0].key),Ct.preventDefault();break}case Ne.Z.ENTER:case Ne.Z.SPACE:{ui&&!Oi.disabled&&Oi.checkable!==!1&&!Oi.disableCheckbox?Zt.onNodeCheck({},Oi,!At.includes(ft)):!ui&&qe&&!Oi.disabled&&Oi.selectable!==!1&&Zt.onNodeSelect({},Oi);break}}}ni==null||ni(Ct)}),(0,Dt.Z)((0,$t.Z)(Zt),"setUncontrolledState",function(Ct){var gt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ft=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!Zt.destroyed){var St=!1,At=!0,wt={};Object.keys(Ct).forEach(function(te){if(Zt.props.hasOwnProperty(te)){At=!1;return}St=!0,wt[te]=Ct[te]}),St&&(!gt||At)&&Zt.setState((0,ce.Z)((0,ce.Z)({},wt),ft))}}),(0,Dt.Z)((0,$t.Z)(Zt),"scrollTo",function(Ct){Zt.listRef.current.scrollTo(Ct)}),Zt}return(0,fe.Z)(Be,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var Je=this.props,Ri=Je.activeKey,Pi=Je.itemScrollOffset,Ct=Pi===void 0?0:Pi;Ri!==void 0&&Ri!==this.state.activeKey&&(this.setState({activeKey:Ri}),Ri!==null&&this.scrollTo({key:Ri,offset:Ct}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var Je=this.state,Ri=Je.focused,Pi=Je.flattenNodes,Ct=Je.keyEntities,gt=Je.draggingNodeKey,ft=Je.activeKey,St=Je.dropLevelOffset,At=Je.dropContainerKey,wt=Je.dropTargetKey,te=Je.dropPosition,ni=Je.dragOverNodeKey,ui=Je.indent,qe=this.props,xe=qe.prefixCls,Zi=qe.className,Si=qe.style,Oi=qe.showLine,Qi=qe.focusable,Cn=qe.tabIndex,_i=Cn===void 0?0:Cn,Mn=qe.selectable,er=qe.showIcon,ir=qe.icon,fr=qe.switcherIcon,ar=qe.draggable,br=qe.checkable,Qn=qe.checkStrictly,Nn=qe.disabled,yr=qe.motion,yt=qe.loadData,Mi=qe.filterTreeNode,on=qe.height,Ui=qe.itemHeight,an=qe.scrollWidth,vi=qe.virtual,di=qe.titleRender,xn=qe.dropIndicatorRender,en=qe.onContextMenu,hn=qe.onScroll,Vi=qe.direction,zi=qe.rootClassName,ur=qe.rootStyle,Vn=(0,ue.Z)(this.props,{aria:!0,data:!0}),$n;ar&&((0,_t.Z)(ar)==="object"?$n=ar:typeof ar=="function"?$n={nodeDraggable:ar}:$n={});var Xe={prefixCls:xe,selectable:Mn,showIcon:er,icon:ir,switcherIcon:fr,draggable:$n,draggingNodeKey:gt,checkable:br,checkStrictly:Qn,disabled:Nn,keyEntities:Ct,dropLevelOffset:St,dropContainerKey:At,dropTargetKey:wt,dropPosition:te,dragOverNodeKey:ni,indent:ui,direction:Vi,dropIndicatorRender:xn,loadData:yt,filterTreeNode:Mi,titleRender:di,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop};return Qt.createElement(Jt.k.Provider,{value:Xe},Qt.createElement("div",{className:zt()(xe,Zi,zi,(0,Dt.Z)((0,Dt.Z)((0,Dt.Z)({},"".concat(xe,"-show-line"),Oi),"".concat(xe,"-focused"),Ri),"".concat(xe,"-active-focused"),ft!==null)),style:ur},Qt.createElement(Se,(0,pt.Z)({ref:this.listRef,prefixCls:xe,style:Si,data:Pi,disabled:Nn,selectable:Mn,checkable:!!br,motion:yr,dragging:gt!==null,height:on,itemHeight:Ui,virtual:vi,focusable:Qi,focused:Ri,tabIndex:_i,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:en,onScroll:hn,scrollWidth:an},this.getTreeNodeRequiredProps(),Vn))))}}],[{key:"getDerivedStateFromProps",value:function(Je,Ri){var Pi=Ri.prevProps,Ct={prevProps:Je};function gt(_i){return!Pi&&Je.hasOwnProperty(_i)||Pi&&Pi[_i]!==Je[_i]}var ft,St=Ri.fieldNames;if(gt("fieldNames")&&(St=(0,ne.w$)(Je.fieldNames),Ct.fieldNames=St),gt("treeData")?ft=Je.treeData:gt("children")&&((0,qt.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),ft=(0,ne.zn)(Je.children)),ft){Ct.treeData=ft;var At=(0,ne.I8)(ft,{fieldNames:St});Ct.keyEntities=(0,ce.Z)((0,Dt.Z)({},bt,Ge),At.keyEntities)}var wt=Ct.keyEntities||Ri.keyEntities;if(gt("expandedKeys")||Pi&>("autoExpandParent"))Ct.expandedKeys=Je.autoExpandParent||!Pi&&Je.defaultExpandParent?(0,ie.r7)(Je.expandedKeys,wt):Je.expandedKeys;else if(!Pi&&Je.defaultExpandAll){var te=(0,ce.Z)({},wt);delete te[bt];var ni=[];Object.keys(te).forEach(function(_i){var Mn=te[_i];Mn.children&&Mn.children.length&&ni.push(Mn.key)}),Ct.expandedKeys=ni}else!Pi&&Je.defaultExpandedKeys&&(Ct.expandedKeys=Je.autoExpandParent||Je.defaultExpandParent?(0,ie.r7)(Je.defaultExpandedKeys,wt):Je.defaultExpandedKeys);if(Ct.expandedKeys||delete Ct.expandedKeys,ft||Ct.expandedKeys){var ui=(0,ne.oH)(ft||Ri.treeData,Ct.expandedKeys||Ri.expandedKeys,St);Ct.flattenNodes=ui}if(Je.selectable&&(gt("selectedKeys")?Ct.selectedKeys=(0,ie.BT)(Je.selectedKeys,Je):!Pi&&Je.defaultSelectedKeys&&(Ct.selectedKeys=(0,ie.BT)(Je.defaultSelectedKeys,Je))),Je.checkable){var qe;if(gt("checkedKeys")?qe=(0,ie.E6)(Je.checkedKeys)||{}:!Pi&&Je.defaultCheckedKeys?qe=(0,ie.E6)(Je.defaultCheckedKeys)||{}:ft&&(qe=(0,ie.E6)(Je.checkedKeys)||{checkedKeys:Ri.checkedKeys,halfCheckedKeys:Ri.halfCheckedKeys}),qe){var xe=qe,Zi=xe.checkedKeys,Si=Zi===void 0?[]:Zi,Oi=xe.halfCheckedKeys,Qi=Oi===void 0?[]:Oi;if(!Je.checkStrictly){var Cn=(0,ee.S)(Si,!0,wt);Si=Cn.checkedKeys,Qi=Cn.halfCheckedKeys}Ct.checkedKeys=Si,Ct.halfCheckedKeys=Qi}}return gt("loadedKeys")&&(Ct.loadedKeys=Je.loadedKeys),Ct}}]),Be}(Qt.Component);(0,Dt.Z)(he,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:je,allowDrop:function(){return!0},expandAction:!1}),(0,Dt.Z)(he,"TreeNode",Wt.Z);var We=he,He=We},82661:function(Li,ai,Mt){"use strict";Mt.d(ai,{BT:function(){return Qt},E6:function(){return je},L0:function(){return Dt},OM:function(){return qt},_5:function(){return re},r7:function(){return De},wA:function(){return zt},yx:function(){return de}});var pt=Mt(94480),_t=Mt(76190),ce=Mt(48736),me=Mt(59301),Ut=Mt(639),fe=Mt(65065),$t=Mt(34061),Ae=null;function re(Yt,Vt){if(!Yt)return[];var pe=Yt.slice(),Xt=pe.indexOf(Vt);return Xt>=0&&pe.splice(Xt,1),pe}function Dt(Yt,Vt){var pe=(Yt||[]).slice();return pe.indexOf(Vt)===-1&&pe.push(Vt),pe}function de(Yt){return Yt.split("-")}function zt(Yt,Vt){var pe=[],Xt=(0,fe.Z)(Vt,Yt);function Le(){var Wt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Wt.forEach(function(Ce){var Te=Ce.key,ne=Ce.children;pe.push(Te),Le(ne)})}return Le(Xt.children),pe}function Ne(Yt){if(Yt.parent){var Vt=de(Yt.pos);return Number(Vt[Vt.length-1])===Yt.parent.children.length-1}return!1}function ue(Yt){var Vt=de(Yt.pos);return Number(Vt[Vt.length-1])===0}function qt(Yt,Vt,pe,Xt,Le,Wt,Ce,Te,ne,Re){var ye,Ie=Yt.clientX,Ai=Yt.clientY,yi=Yt.target.getBoundingClientRect(),gi=yi.top,oi=yi.height,Bt=(Re==="rtl"?-1:1)*(((Le==null?void 0:Le.x)||0)-Ie),bt=(Bt-12)/Xt,ge=ne.filter(function(He){var we;return(we=Te[He])===null||we===void 0||(we=we.children)===null||we===void 0?void 0:we.length}),Ge=(0,fe.Z)(Te,pe.eventKey);if(Ai<gi+oi/2){var Ye=Ce.findIndex(function(He){return He.key===Ge.key}),oe=Ye<=0?0:Ye-1,Ve=Ce[oe].key;Ge=(0,fe.Z)(Te,Ve)}var Ze=Ge.key,Ni=Ge,Se=Ge.key,ie=0,ee=0;if(!ge.includes(Ze))for(var ve=0;ve<bt&&Ne(Ge);ve+=1)Ge=Ge.parent,ee+=1;var ti=Vt.data,he=Ge.node,We=!0;return ue(Ge)&&Ge.level===0&&Ai<gi+oi/2&&Wt({dragNode:ti,dropNode:he,dropPosition:-1})&&Ge.key===pe.eventKey?ie=-1:(Ni.children||[]).length&&ge.includes(Se)?Wt({dragNode:ti,dropNode:he,dropPosition:0})?ie=0:We=!1:ee===0?bt>-1.5?Wt({dragNode:ti,dropNode:he,dropPosition:1})?ie=1:We=!1:Wt({dragNode:ti,dropNode:he,dropPosition:0})?ie=0:Wt({dragNode:ti,dropNode:he,dropPosition:1})?ie=1:We=!1:Wt({dragNode:ti,dropNode:he,dropPosition:1})?ie=1:We=!1,{dropPosition:ie,dropLevelOffset:ee,dropTargetKey:Ge.key,dropTargetPos:Ge.pos,dragOverNodeKey:Se,dropContainerKey:ie===0?null:((ye=Ge.parent)===null||ye===void 0?void 0:ye.key)||null,dropAllowed:We}}function Qt(Yt,Vt){if(Yt){var pe=Vt.multiple;return pe?Yt.slice():Yt.length?[Yt[0]]:Yt}}var Jt=function(Vt){return Vt};function Pe(Yt,Vt){if(!Yt)return[];var pe=Vt||{},Xt=pe.processProps,Le=Xt===void 0?Jt:Xt,Wt=Array.isArray(Yt)?Yt:[Yt];return Wt.map(function(Ce){var Te=Ce.children,ne=_objectWithoutProperties(Ce,Ae),Re=Pe(Te,Vt);return React.createElement(TreeNode,_extends({key:ne.key},Le(ne)),Re)})}function je(Yt){if(!Yt)return null;var Vt;if(Array.isArray(Yt))Vt={checkedKeys:Yt,halfCheckedKeys:void 0};else if((0,_t.Z)(Yt)==="object")Vt={checkedKeys:Yt.checked||void 0,halfCheckedKeys:Yt.halfChecked||void 0};else return(0,ce.ZP)(!1,"`checkedKeys` is not an array or an object"),null;return Vt}function De(Yt,Vt){var pe=new Set;function Xt(Le){if(!pe.has(Le)){var Wt=(0,fe.Z)(Vt,Le);if(Wt){pe.add(Le);var Ce=Wt.parent,Te=Wt.node;Te.disabled||Ce&&Xt(Ce.key)}}}return(Yt||[]).forEach(function(Le){Xt(Le)}),(0,pt.Z)(pe)}},34643:function(Li,ai,Mt){"use strict";Mt.d(ai,{S:function(){return $t}});var pt=Mt(48736),_t=Mt(65065);function ce(Ae,re){var Dt=new Set;return Ae.forEach(function(de){re.has(de)||Dt.add(de)}),Dt}function me(Ae){var re=Ae||{},Dt=re.disabled,de=re.disableCheckbox,zt=re.checkable;return!!(Dt||de)||zt===!1}function Ut(Ae,re,Dt,de){for(var zt=new Set(Ae),Ne=new Set,ue=0;ue<=Dt;ue+=1){var qt=re.get(ue)||new Set;qt.forEach(function(je){var De=je.key,Yt=je.node,Vt=je.children,pe=Vt===void 0?[]:Vt;zt.has(De)&&!de(Yt)&&pe.filter(function(Xt){return!de(Xt.node)}).forEach(function(Xt){zt.add(Xt.key)})})}for(var Qt=new Set,Jt=Dt;Jt>=0;Jt-=1){var Pe=re.get(Jt)||new Set;Pe.forEach(function(je){var De=je.parent,Yt=je.node;if(!(de(Yt)||!je.parent||Qt.has(je.parent.key))){if(de(je.parent.node)){Qt.add(De.key);return}var Vt=!0,pe=!1;(De.children||[]).filter(function(Xt){return!de(Xt.node)}).forEach(function(Xt){var Le=Xt.key,Wt=zt.has(Le);Vt&&!Wt&&(Vt=!1),!pe&&(Wt||Ne.has(Le))&&(pe=!0)}),Vt&&zt.add(De.key),pe&&Ne.add(De.key),Qt.add(De.key)}})}return{checkedKeys:Array.from(zt),halfCheckedKeys:Array.from(ce(Ne,zt))}}function fe(Ae,re,Dt,de,zt){for(var Ne=new Set(Ae),ue=new Set(re),qt=0;qt<=de;qt+=1){var Qt=Dt.get(qt)||new Set;Qt.forEach(function(De){var Yt=De.key,Vt=De.node,pe=De.children,Xt=pe===void 0?[]:pe;!Ne.has(Yt)&&!ue.has(Yt)&&!zt(Vt)&&Xt.filter(function(Le){return!zt(Le.node)}).forEach(function(Le){Ne.delete(Le.key)})})}ue=new Set;for(var Jt=new Set,Pe=de;Pe>=0;Pe-=1){var je=Dt.get(Pe)||new Set;je.forEach(function(De){var Yt=De.parent,Vt=De.node;if(!(zt(Vt)||!De.parent||Jt.has(De.parent.key))){if(zt(De.parent.node)){Jt.add(Yt.key);return}var pe=!0,Xt=!1;(Yt.children||[]).filter(function(Le){return!zt(Le.node)}).forEach(function(Le){var Wt=Le.key,Ce=Ne.has(Wt);pe&&!Ce&&(pe=!1),!Xt&&(Ce||ue.has(Wt))&&(Xt=!0)}),pe||Ne.delete(Yt.key),Xt&&ue.add(Yt.key),Jt.add(Yt.key)}})}return{checkedKeys:Array.from(Ne),halfCheckedKeys:Array.from(ce(ue,Ne))}}function $t(Ae,re,Dt,de){var zt=[],Ne;de?Ne=de:Ne=me;var ue=new Set(Ae.filter(function(Pe){var je=!!(0,_t.Z)(Dt,Pe);return je||zt.push(Pe),je})),qt=new Map,Qt=0;Object.keys(Dt).forEach(function(Pe){var je=Dt[Pe],De=je.level,Yt=qt.get(De);Yt||(Yt=new Set,qt.set(De,Yt)),Yt.add(je),Qt=Math.max(Qt,De)}),(0,pt.ZP)(!zt.length,"Tree missing follow keys: ".concat(zt.slice(0,100).map(function(Pe){return"'".concat(Pe,"'")}).join(", ")));var Jt;return re===!0?Jt=Ut(ue,qt,Qt,Ne):Jt=fe(ue,re.halfCheckedKeys,qt,Qt,Ne),Jt}},65065:function(Li,ai,Mt){"use strict";Mt.d(ai,{Z:function(){return pt}});function pt(_t,ce){return _t[ce]}},34061:function(Li,ai,Mt){"use strict";Mt.d(ai,{F:function(){return De},H8:function(){return je},I8:function(){return Pe},km:function(){return zt},oH:function(){return Qt},w$:function(){return Ne},zn:function(){return qt}});var pt=Mt(76190),_t=Mt(94480),ce=Mt(33885),me=Mt(75931),Ut=Mt(11592),fe=Mt(2738),$t=Mt(48736),Ae=Mt(65065),re=["children"];function Dt(Yt,Vt){return"".concat(Yt,"-").concat(Vt)}function de(Yt){return Yt&&Yt.type&&Yt.type.isTreeNode}function zt(Yt,Vt){return Yt!=null?Yt:Vt}function Ne(Yt){var Vt=Yt||{},pe=Vt.title,Xt=Vt._title,Le=Vt.key,Wt=Vt.children,Ce=pe||"title";return{title:Ce,_title:Xt||[Ce],key:Le||"key",children:Wt||"children"}}function ue(Yt,Vt){var pe=new Map;function Xt(Le){var Wt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(Le||[]).forEach(function(Ce){var Te=Ce[Vt.key],ne=Ce[Vt.children];warning(Te!=null,"Tree node must have a certain key: [".concat(Wt).concat(Te,"]"));var Re=String(Te);warning(!pe.has(Re)||Te===null||Te===void 0,"Same 'key' exist in the Tree: ".concat(Re)),pe.set(Re,!0),Xt(ne,"".concat(Wt).concat(Re," > "))})}Xt(Yt)}function qt(Yt){function Vt(pe){var Xt=(0,Ut.Z)(pe);return Xt.map(function(Le){if(!de(Le))return(0,$t.ZP)(!Le,"Tree/TreeNode can only accept TreeNode as children."),null;var Wt=Le.key,Ce=Le.props,Te=Ce.children,ne=(0,me.Z)(Ce,re),Re=(0,ce.Z)({key:Wt},ne),ye=Vt(Te);return ye.length&&(Re.children=ye),Re}).filter(function(Le){return Le})}return Vt(Yt)}function Qt(Yt,Vt,pe){var Xt=Ne(pe),Le=Xt._title,Wt=Xt.key,Ce=Xt.children,Te=new Set(Vt===!0?[]:Vt),ne=[];function Re(ye){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return ye.map(function(Ai,yi){for(var gi=Dt(Ie?Ie.pos:"0",yi),oi=zt(Ai[Wt],gi),Bt,bt=0;bt<Le.length;bt+=1){var ge=Le[bt];if(Ai[ge]!==void 0){Bt=Ai[ge];break}}var Ge=Object.assign((0,fe.Z)(Ai,[].concat((0,_t.Z)(Le),[Wt,Ce])),{title:Bt,key:oi,parent:Ie,pos:gi,children:null,data:Ai,isStart:[].concat((0,_t.Z)(Ie?Ie.isStart:[]),[yi===0]),isEnd:[].concat((0,_t.Z)(Ie?Ie.isEnd:[]),[yi===ye.length-1])});return ne.push(Ge),Vt===!0||Te.has(oi)?Ge.children=Re(Ai[Ce]||[],Ge):Ge.children=[],Ge})}return Re(Yt),ne}function Jt(Yt,Vt,pe){var Xt={};(0,pt.Z)(pe)==="object"?Xt=pe:Xt={externalGetKey:pe},Xt=Xt||{};var Le=Xt,Wt=Le.childrenPropName,Ce=Le.externalGetKey,Te=Le.fieldNames,ne=Ne(Te),Re=ne.key,ye=ne.children,Ie=Wt||ye,Ai;Ce?typeof Ce=="string"?Ai=function(oi){return oi[Ce]}:typeof Ce=="function"&&(Ai=function(oi){return Ce(oi)}):Ai=function(oi,Bt){return zt(oi[Re],Bt)};function yi(gi,oi,Bt,bt){var ge=gi?gi[Ie]:Yt,Ge=gi?Dt(Bt.pos,oi):"0",Ye=gi?[].concat((0,_t.Z)(bt),[gi]):[];if(gi){var oe=Ai(gi,Ge),Ve={node:gi,index:oi,pos:Ge,key:oe,parentPos:Bt.node?Bt.pos:null,level:Bt.level+1,nodes:Ye};Vt(Ve)}ge&&ge.forEach(function(Ze,Ni){yi(Ze,Ni,{node:gi,pos:Ge,level:Bt?Bt.level+1:-1},Ye)})}yi(null)}function Pe(Yt){var Vt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},pe=Vt.initWrapper,Xt=Vt.processEntity,Le=Vt.onProcessFinished,Wt=Vt.externalGetKey,Ce=Vt.childrenPropName,Te=Vt.fieldNames,ne=arguments.length>2?arguments[2]:void 0,Re=Wt||ne,ye={},Ie={},Ai={posEntities:ye,keyEntities:Ie};return pe&&(Ai=pe(Ai)||Ai),Jt(Yt,function(yi){var gi=yi.node,oi=yi.index,Bt=yi.pos,bt=yi.key,ge=yi.parentPos,Ge=yi.level,Ye=yi.nodes,oe={node:gi,nodes:Ye,index:oi,key:bt,pos:Bt,level:Ge},Ve=zt(bt,Bt);ye[Bt]=oe,Ie[Ve]=oe,oe.parent=ye[ge],oe.parent&&(oe.parent.children=oe.parent.children||[],oe.parent.children.push(oe)),Xt&&Xt(oe,Ai)},{externalGetKey:Re,childrenPropName:Ce,fieldNames:Te}),Le&&Le(Ai),Ai}function je(Yt,Vt){var pe=Vt.expandedKeys,Xt=Vt.selectedKeys,Le=Vt.loadedKeys,Wt=Vt.loadingKeys,Ce=Vt.checkedKeys,Te=Vt.halfCheckedKeys,ne=Vt.dragOverNodeKey,Re=Vt.dropPosition,ye=Vt.keyEntities,Ie=(0,Ae.Z)(ye,Yt),Ai={eventKey:Yt,expanded:pe.indexOf(Yt)!==-1,selected:Xt.indexOf(Yt)!==-1,loaded:Le.indexOf(Yt)!==-1,loading:Wt.indexOf(Yt)!==-1,checked:Ce.indexOf(Yt)!==-1,halfChecked:Te.indexOf(Yt)!==-1,pos:String(Ie?Ie.pos:""),dragOver:ne===Yt&&Re===0,dragOverGapTop:ne===Yt&&Re===-1,dragOverGapBottom:ne===Yt&&Re===1};return Ai}function De(Yt){var Vt=Yt.data,pe=Yt.expanded,Xt=Yt.selected,Le=Yt.checked,Wt=Yt.loaded,Ce=Yt.loading,Te=Yt.halfChecked,ne=Yt.dragOver,Re=Yt.dragOverGapTop,ye=Yt.dragOverGapBottom,Ie=Yt.pos,Ai=Yt.active,yi=Yt.eventKey,gi=(0,ce.Z)((0,ce.Z)({},Vt),{},{expanded:pe,selected:Xt,checked:Le,loaded:Wt,loading:Ce,halfChecked:Te,dragOver:ne,dragOverGapTop:Re,dragOverGapBottom:ye,pos:Ie,active:Ai,key:yi});return"props"in gi||Object.defineProperty(gi,"props",{get:function(){return(0,$t.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),Yt}}),gi}},90472:function(Li,ai,Mt){"use strict";Mt.d(ai,{Z:function(){return yi}});var pt=Mt(54476),_t=Mt(67732),ce=Mt(83652),me=Mt(31226),Ut=Mt(42403),fe=Mt(158),$t=Mt(20068),Ae=Mt(59301),re=Mt(33885),Dt=Mt(75931),de=Mt(76190),zt=Mt(75044),Ne=Mt(3202),ue=Mt(94480),qt=Mt(92310),Qt=Mt.n(qt),Jt=Mt(26112),Pe=Mt(48736),je=function(gi,oi){if(gi&&oi){var Bt=Array.isArray(oi)?oi:oi.split(","),bt=gi.name||"",ge=gi.type||"",Ge=ge.replace(/\/.*$/,"");return Bt.some(function(Ye){var oe=Ye.trim();if(/^\*(\/\*)?$/.test(Ye))return!0;if(oe.charAt(0)==="."){var Ve=bt.toLowerCase(),Ze=oe.toLowerCase(),Ni=[Ze];return(Ze===".jpg"||Ze===".jpeg")&&(Ni=[".jpg",".jpeg"]),Ni.some(function(Se){return Ve.endsWith(Se)})}return/\/\*$/.test(oe)?Ge===oe.replace(/\/.*$/,""):ge===oe?!0:/^\w+$/.test(oe)?((0,Pe.ZP)(!1,"Upload takes an invalidate 'accept' type '".concat(oe,"'.Skip for check.")),!0):!1})}return!0};function De(gi,oi){var Bt="cannot ".concat(gi.method," ").concat(gi.action," ").concat(oi.status,"'"),bt=new Error(Bt);return bt.status=oi.status,bt.method=gi.method,bt.url=gi.action,bt}function Yt(gi){var oi=gi.responseText||gi.response;if(!oi)return oi;try{return JSON.parse(oi)}catch(Bt){return oi}}function Vt(gi){var oi=new XMLHttpRequest;gi.onProgress&&oi.upload&&(oi.upload.onprogress=function(Ge){Ge.total>0&&(Ge.percent=Ge.loaded/Ge.total*100),gi.onProgress(Ge)});var Bt=new FormData;gi.data&&Object.keys(gi.data).forEach(function(ge){var Ge=gi.data[ge];if(Array.isArray(Ge)){Ge.forEach(function(Ye){Bt.append("".concat(ge,"[]"),Ye)});return}Bt.append(ge,Ge)}),gi.file instanceof Blob?Bt.append(gi.filename,gi.file,gi.file.name):Bt.append(gi.filename,gi.file),oi.onerror=function(Ge){gi.onError(Ge)},oi.onload=function(){return oi.status<200||oi.status>=300?gi.onError(De(gi,oi),Yt(oi)):gi.onSuccess(Yt(oi),oi)},oi.open(gi.method,gi.action,!0),gi.withCredentials&&"withCredentials"in oi&&(oi.withCredentials=!0);var bt=gi.headers||{};return bt["X-Requested-With"]!==null&&oi.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(bt).forEach(function(ge){bt[ge]!==null&&oi.setRequestHeader(ge,bt[ge])}),oi.send(Bt),{abort:function(){oi.abort()}}}var pe=function(){var gi=(0,Ne.Z)((0,zt.Z)().mark(function oi(Bt,bt){var ge,Ge,Ye,oe,Ve,Ze,Ni,Se;return(0,zt.Z)().wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:Ze=function(){return Ze=(0,Ne.Z)((0,zt.Z)().mark(function ti(he){return(0,zt.Z)().wrap(function(He){for(;;)switch(He.prev=He.next){case 0:return He.abrupt("return",new Promise(function(we){he.file(function(ei){bt(ei)?(he.fullPath&&!ei.webkitRelativePath&&(Object.defineProperties(ei,{webkitRelativePath:{writable:!0}}),ei.webkitRelativePath=he.fullPath.replace(/^\//,""),Object.defineProperties(ei,{webkitRelativePath:{writable:!1}})),we(ei)):we(null)})}));case 1:case"end":return He.stop()}},ti)})),Ze.apply(this,arguments)},Ve=function(ti){return Ze.apply(this,arguments)},oe=function(){return oe=(0,Ne.Z)((0,zt.Z)().mark(function ti(he){var We,He,we,ei,Be;return(0,zt.Z)().wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:We=he.createReader(),He=[];case 2:return Je.next=5,new Promise(function(Ri){We.readEntries(Ri,function(){return Ri([])})});case 5:if(we=Je.sent,ei=we.length,ei){Je.next=9;break}return Je.abrupt("break",12);case 9:for(Be=0;Be<ei;Be++)He.push(we[Be]);Je.next=2;break;case 12:return Je.abrupt("return",He);case 13:case"end":return Je.stop()}},ti)})),oe.apply(this,arguments)},Ye=function(ti){return oe.apply(this,arguments)},ge=[],Ge=[],Bt.forEach(function(ve){return Ge.push(ve.webkitGetAsEntry())}),Ni=function(){var ve=(0,Ne.Z)((0,zt.Z)().mark(function ti(he,We){var He,we;return(0,zt.Z)().wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:if(he){Be.next=2;break}return Be.abrupt("return");case 2:if(he.path=We||"",!he.isFile){Be.next=10;break}return Be.next=6,Ve(he);case 6:He=Be.sent,He&&ge.push(He),Be.next=15;break;case 10:if(!he.isDirectory){Be.next=15;break}return Be.next=13,Ye(he);case 13:we=Be.sent,Ge.push.apply(Ge,(0,ue.Z)(we));case 15:case"end":return Be.stop()}},ti)}));return function(he,We){return ve.apply(this,arguments)}}(),Se=0;case 9:if(!(Se<Ge.length)){ee.next=15;break}return ee.next=12,Ni(Ge[Se]);case 12:Se++,ee.next=9;break;case 15:return ee.abrupt("return",ge);case 16:case"end":return ee.stop()}},oi)}));return function(Bt,bt){return gi.apply(this,arguments)}}(),Xt=pe,Le=+new Date,Wt=0;function Ce(){return"rc-upload-".concat(Le,"-").concat(++Wt)}var Te=["component","prefixCls","className","classNames","disabled","id","name","style","styles","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave","hasControlInside"],ne=function(gi){(0,Ut.Z)(Bt,gi);var oi=(0,fe.Z)(Bt);function Bt(){var bt;(0,_t.Z)(this,Bt);for(var ge=arguments.length,Ge=new Array(ge),Ye=0;Ye<ge;Ye++)Ge[Ye]=arguments[Ye];return bt=oi.call.apply(oi,[this].concat(Ge)),(0,$t.Z)((0,me.Z)(bt),"state",{uid:Ce()}),(0,$t.Z)((0,me.Z)(bt),"reqs",{}),(0,$t.Z)((0,me.Z)(bt),"fileInput",void 0),(0,$t.Z)((0,me.Z)(bt),"_isMounted",void 0),(0,$t.Z)((0,me.Z)(bt),"onChange",function(oe){var Ve=bt.props,Ze=Ve.accept,Ni=Ve.directory,Se=oe.target.files,ie=(0,ue.Z)(Se).filter(function(ee){return!Ni||je(ee,Ze)});bt.uploadFiles(ie),bt.reset()}),(0,$t.Z)((0,me.Z)(bt),"onClick",function(oe){var Ve=bt.fileInput;if(Ve){var Ze=oe.target,Ni=bt.props.onClick;if(Ze&&Ze.tagName==="BUTTON"){var Se=Ve.parentNode;Se.focus(),Ze.blur()}Ve.click(),Ni&&Ni(oe)}}),(0,$t.Z)((0,me.Z)(bt),"onKeyDown",function(oe){oe.key==="Enter"&&bt.onClick(oe)}),(0,$t.Z)((0,me.Z)(bt),"onFileDrop",function(){var oe=(0,Ne.Z)((0,zt.Z)().mark(function Ve(Ze){var Ni,Se,ie;return(0,zt.Z)().wrap(function(ve){for(;;)switch(ve.prev=ve.next){case 0:if(Ni=bt.props.multiple,Ze.preventDefault(),Ze.type!=="dragover"){ve.next=4;break}return ve.abrupt("return");case 4:if(!bt.props.directory){ve.next=11;break}return ve.next=7,Xt(Array.prototype.slice.call(Ze.dataTransfer.items),function(ti){return je(ti,bt.props.accept)});case 7:Se=ve.sent,bt.uploadFiles(Se),ve.next=14;break;case 11:ie=(0,ue.Z)(Ze.dataTransfer.files).filter(function(ti){return je(ti,bt.props.accept)}),Ni===!1&&(ie=ie.slice(0,1)),bt.uploadFiles(ie);case 14:case"end":return ve.stop()}},Ve)}));return function(Ve){return oe.apply(this,arguments)}}()),(0,$t.Z)((0,me.Z)(bt),"uploadFiles",function(oe){var Ve=(0,ue.Z)(oe),Ze=Ve.map(function(Ni){return Ni.uid=Ce(),bt.processFile(Ni,Ve)});Promise.all(Ze).then(function(Ni){var Se=bt.props.onBatchStart;Se==null||Se(Ni.map(function(ie){var ee=ie.origin,ve=ie.parsedFile;return{file:ee,parsedFile:ve}})),Ni.filter(function(ie){return ie.parsedFile!==null}).forEach(function(ie){bt.post(ie)})})}),(0,$t.Z)((0,me.Z)(bt),"processFile",function(){var oe=(0,Ne.Z)((0,zt.Z)().mark(function Ve(Ze,Ni){var Se,ie,ee,ve,ti,he,We,He,we;return(0,zt.Z)().wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:if(Se=bt.props.beforeUpload,ie=Ze,!Se){Be.next=14;break}return Be.prev=3,Be.next=6,Se(Ze,Ni);case 6:ie=Be.sent,Be.next=12;break;case 9:Be.prev=9,Be.t0=Be.catch(3),ie=!1;case 12:if(ie!==!1){Be.next=14;break}return Be.abrupt("return",{origin:Ze,parsedFile:null,action:null,data:null});case 14:if(ee=bt.props.action,typeof ee!="function"){Be.next=21;break}return Be.next=18,ee(Ze);case 18:ve=Be.sent,Be.next=22;break;case 21:ve=ee;case 22:if(ti=bt.props.data,typeof ti!="function"){Be.next=29;break}return Be.next=26,ti(Ze);case 26:he=Be.sent,Be.next=30;break;case 29:he=ti;case 30:return We=((0,de.Z)(ie)==="object"||typeof ie=="string")&&ie?ie:Ze,We instanceof File?He=We:He=new File([We],Ze.name,{type:Ze.type}),we=He,we.uid=Ze.uid,Be.abrupt("return",{origin:Ze,data:he,parsedFile:we,action:ve});case 35:case"end":return Be.stop()}},Ve,null,[[3,9]])}));return function(Ve,Ze){return oe.apply(this,arguments)}}()),(0,$t.Z)((0,me.Z)(bt),"saveFileInput",function(oe){bt.fileInput=oe}),bt}return(0,ce.Z)(Bt,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(ge){var Ge=this,Ye=ge.data,oe=ge.origin,Ve=ge.action,Ze=ge.parsedFile;if(this._isMounted){var Ni=this.props,Se=Ni.onStart,ie=Ni.customRequest,ee=Ni.name,ve=Ni.headers,ti=Ni.withCredentials,he=Ni.method,We=oe.uid,He=ie||Vt,we={action:Ve,filename:ee,data:Ye,file:Ze,headers:ve,withCredentials:ti,method:he||"post",onProgress:function(Be){var Zt=Ge.props.onProgress;Zt==null||Zt(Be,Ze)},onSuccess:function(Be,Zt){var Je=Ge.props.onSuccess;Je==null||Je(Be,Ze,Zt),delete Ge.reqs[We]},onError:function(Be,Zt){var Je=Ge.props.onError;Je==null||Je(Be,Zt,Ze),delete Ge.reqs[We]}};Se(oe),this.reqs[We]=He(we)}}},{key:"reset",value:function(){this.setState({uid:Ce()})}},{key:"abort",value:function(ge){var Ge=this.reqs;if(ge){var Ye=ge.uid?ge.uid:ge;Ge[Ye]&&Ge[Ye].abort&&Ge[Ye].abort(),delete Ge[Ye]}else Object.keys(Ge).forEach(function(oe){Ge[oe]&&Ge[oe].abort&&Ge[oe].abort(),delete Ge[oe]})}},{key:"render",value:function(){var ge=this.props,Ge=ge.component,Ye=ge.prefixCls,oe=ge.className,Ve=ge.classNames,Ze=Ve===void 0?{}:Ve,Ni=ge.disabled,Se=ge.id,ie=ge.name,ee=ge.style,ve=ge.styles,ti=ve===void 0?{}:ve,he=ge.multiple,We=ge.accept,He=ge.capture,we=ge.children,ei=ge.directory,Be=ge.openFileDialogOnClick,Zt=ge.onMouseEnter,Je=ge.onMouseLeave,Ri=ge.hasControlInside,Pi=(0,Dt.Z)(ge,Te),Ct=Qt()((0,$t.Z)((0,$t.Z)((0,$t.Z)({},Ye,!0),"".concat(Ye,"-disabled"),Ni),oe,oe)),gt=ei?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},ft=Ni?{}:{onClick:Be?this.onClick:function(){},onKeyDown:Be?this.onKeyDown:function(){},onMouseEnter:Zt,onMouseLeave:Je,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:Ri?void 0:"0"};return Ae.createElement(Ge,(0,pt.Z)({},ft,{className:Ct,role:Ri?void 0:"button",style:ee}),Ae.createElement("input",(0,pt.Z)({},(0,Jt.Z)(Pi,{aria:!0,data:!0}),{id:Se,name:ie,disabled:Ni,type:"file",ref:this.saveFileInput,onClick:function(At){return At.stopPropagation()},key:this.state.uid,style:(0,re.Z)({display:"none"},ti.input),className:Ze.input,accept:We},gt,{multiple:he,onChange:this.onChange},He!=null?{capture:He}:{})),we)}}]),Bt}(Ae.Component),Re=ne;function ye(){}var Ie=function(gi){(0,Ut.Z)(Bt,gi);var oi=(0,fe.Z)(Bt);function Bt(){var bt;(0,_t.Z)(this,Bt);for(var ge=arguments.length,Ge=new Array(ge),Ye=0;Ye<ge;Ye++)Ge[Ye]=arguments[Ye];return bt=oi.call.apply(oi,[this].concat(Ge)),(0,$t.Z)((0,me.Z)(bt),"uploader",void 0),(0,$t.Z)((0,me.Z)(bt),"saveUploader",function(oe){bt.uploader=oe}),bt}return(0,ce.Z)(Bt,[{key:"abort",value:function(ge){this.uploader.abort(ge)}},{key:"render",value:function(){return Ae.createElement(Re,(0,pt.Z)({},this.props,{ref:this.saveUploader}))}}]),Bt}(Ae.Component);(0,$t.Z)(Ie,"defaultProps",{component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:ye,onError:ye,onSuccess:ye,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0,hasControlInside:!1});var Ai=Ie,yi=Ai},48911:function(Li,ai,Mt){"use strict";Mt.d(ai,{Z:function(){return ti}});var pt=Mt(54476),_t=Mt(76190),ce=Mt(33885),me=Mt(20068),Ut=Mt(42978),fe=Mt(75931),$t=Mt(92310),Ae=Mt.n($t),re=Mt(29301),Dt=Mt(70425),de=Mt(34280),zt=Mt(59301),Ne=Mt(4676),ue=zt.forwardRef(function(he,We){var He=he.height,we=he.offsetY,ei=he.offsetX,Be=he.children,Zt=he.prefixCls,Je=he.onInnerResize,Ri=he.innerProps,Pi=he.rtl,Ct=he.extra,gt={},ft={display:"flex",flexDirection:"column"};return we!==void 0&&(gt={height:He,position:"relative",overflow:"hidden"},ft=(0,ce.Z)((0,ce.Z)({},ft),{},(0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)({transform:"translateY(".concat(we,"px)")},Pi?"marginRight":"marginLeft",-ei),"position","absolute"),"left",0),"right",0),"top",0))),zt.createElement("div",{style:gt},zt.createElement(re.Z,{onResize:function(At){var wt=At.offsetHeight;wt&&Je&&Je()}},zt.createElement("div",(0,pt.Z)({style:ft,className:Ae()((0,me.Z)({},"".concat(Zt,"-holder-inner"),Zt)),ref:We},Ri),Be,Ct)))});ue.displayName="Filler";var qt=ue;function Qt(he){var We=he.children,He=he.setRef,we=zt.useCallback(function(ei){He(ei)},[]);return zt.cloneElement(We,{ref:we})}function Jt(he,We,He,we,ei,Be,Zt,Je){var Ri=Je.getKey;return he.slice(We,He+1).map(function(Pi,Ct){var gt=We+Ct,ft=Zt(Pi,gt,{style:{width:we},offsetX:ei}),St=Ri(Pi);return zt.createElement(Qt,{key:St,setRef:function(wt){return Be(Pi,wt)}},ft)})}function Pe(he,We,He,we){var ei=He-he,Be=We-He,Zt=Math.min(ei,Be)*2;if(we<=Zt){var Je=Math.floor(we/2);return we%2?He+Je+1:He-Je}return ei>Be?He-(we-Be):He+(we-ei)}function je(he,We,He){var we=he.length,ei=We.length,Be,Zt;if(we===0&&ei===0)return null;we<ei?(Be=he,Zt=We):(Be=We,Zt=he);var Je={__EMPTY_ITEM__:!0};function Ri(At){return At!==void 0?He(At):Je}for(var Pi=null,Ct=Math.abs(we-ei)!==1,gt=0;gt<Zt.length;gt+=1){var ft=Ri(Be[gt]),St=Ri(Zt[gt]);if(ft!==St){Pi=gt,Ct=Ct||ft!==Ri(Zt[gt+1]);break}}return Pi===null?null:{index:Pi,multiple:Ct}}function De(he,We,He){var we=zt.useState(he),ei=(0,Ut.Z)(we,2),Be=ei[0],Zt=ei[1],Je=zt.useState(null),Ri=(0,Ut.Z)(Je,2),Pi=Ri[0],Ct=Ri[1];return zt.useEffect(function(){var gt=je(Be||[],he||[],We);(gt==null?void 0:gt.index)!==void 0&&(He==null||He(gt.index),Ct(he[gt.index])),Zt(he)},[he]),[Pi]}var Yt=Mt(16089),Vt=(typeof navigator=="undefined"?"undefined":(0,_t.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),pe=Vt,Xt=function(he,We,He,we){var ei=(0,zt.useRef)(!1),Be=(0,zt.useRef)(null);function Zt(){clearTimeout(Be.current),ei.current=!0,Be.current=setTimeout(function(){ei.current=!1},50)}var Je=(0,zt.useRef)({top:he,bottom:We,left:He,right:we});return Je.current.top=he,Je.current.bottom=We,Je.current.left=He,Je.current.right=we,function(Ri,Pi){var Ct=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,gt=Ri?Pi<0&&Je.current.left||Pi>0&&Je.current.right:Pi<0&&Je.current.top||Pi>0&&Je.current.bottom;return Ct&>?(clearTimeout(Be.current),ei.current=!1):(!gt||ei.current)&&Zt(),!ei.current&>}};function Le(he,We,He,we,ei,Be,Zt){var Je=(0,zt.useRef)(0),Ri=(0,zt.useRef)(null),Pi=(0,zt.useRef)(null),Ct=(0,zt.useRef)(!1),gt=Xt(We,He,we,ei);function ft(ui,qe){if(Yt.Z.cancel(Ri.current),!gt(!1,qe)){var xe=ui;if(!xe._virtualHandled)xe._virtualHandled=!0;else return;Je.current+=qe,Pi.current=qe,pe||xe.preventDefault(),Ri.current=(0,Yt.Z)(function(){var Zi=Ct.current?10:1;Zt(Je.current*Zi,!1),Je.current=0})}}function St(ui,qe){Zt(qe,!0),pe||ui.preventDefault()}var At=(0,zt.useRef)(null),wt=(0,zt.useRef)(null);function te(ui){if(he){Yt.Z.cancel(wt.current),wt.current=(0,Yt.Z)(function(){At.current=null},2);var qe=ui.deltaX,xe=ui.deltaY,Zi=ui.shiftKey,Si=qe,Oi=xe;(At.current==="sx"||!At.current&&Zi&&xe&&!qe)&&(Si=xe,Oi=0,At.current="sx");var Qi=Math.abs(Si),Cn=Math.abs(Oi);At.current===null&&(At.current=Be&&Qi>Cn?"x":"y"),At.current==="y"?ft(ui,Oi):St(ui,Si)}}function ni(ui){he&&(Ct.current=ui.detail===Pi.current)}return[te,ni]}function Wt(he,We,He,we){var ei=zt.useMemo(function(){return[new Map,[]]},[he,He.id,we]),Be=(0,Ut.Z)(ei,2),Zt=Be[0],Je=Be[1],Ri=function(Ct){var gt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ct,ft=Zt.get(Ct),St=Zt.get(gt);if(ft===void 0||St===void 0)for(var At=he.length,wt=Je.length;wt<At;wt+=1){var te,ni=he[wt],ui=We(ni);Zt.set(ui,wt);var qe=(te=He.get(ui))!==null&&te!==void 0?te:we;if(Je[wt]=(Je[wt-1]||0)+qe,ui===Ct&&(ft=wt),ui===gt&&(St=wt),ft!==void 0&&St!==void 0)break}return{top:Je[ft-1]||0,bottom:Je[St]}};return Ri}var Ce=Mt(67732),Te=Mt(83652),ne=function(){function he(){(0,Ce.Z)(this,he),(0,me.Z)(this,"maps",void 0),(0,me.Z)(this,"id",0),(0,me.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,Te.Z)(he,[{key:"set",value:function(He,we){this.diffRecords.set(He,this.maps[He]),this.maps[He]=we,this.id+=1}},{key:"get",value:function(He){return this.maps[He]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),he}(),Re=ne;function ye(he){var We=parseFloat(he);return isNaN(We)?0:We}function Ie(he,We,He){var we=zt.useState(0),ei=(0,Ut.Z)(we,2),Be=ei[0],Zt=ei[1],Je=(0,zt.useRef)(new Map),Ri=(0,zt.useRef)(new Re),Pi=(0,zt.useRef)(0);function Ct(){Pi.current+=1}function gt(){var St=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Ct();var At=function(){var ni=!1;Je.current.forEach(function(ui,qe){if(ui&&ui.offsetParent){var xe=ui.offsetHeight,Zi=getComputedStyle(ui),Si=Zi.marginTop,Oi=Zi.marginBottom,Qi=ye(Si),Cn=ye(Oi),_i=xe+Qi+Cn;Ri.current.get(qe)!==_i&&(Ri.current.set(qe,_i),ni=!0)}}),ni&&Zt(function(ui){return ui+1})};if(St)At();else{Pi.current+=1;var wt=Pi.current;Promise.resolve().then(function(){wt===Pi.current&&At()})}}function ft(St,At){var wt=he(St),te=Je.current.get(wt);At?(Je.current.set(wt,At),gt()):Je.current.delete(wt),!te!=!At&&(At?We==null||We(St):He==null||He(St))}return(0,zt.useEffect)(function(){return Ct},[]),[ft,gt,Ri.current,Be]}var Ai=14/15;function yi(he,We,He){var we=(0,zt.useRef)(!1),ei=(0,zt.useRef)(0),Be=(0,zt.useRef)(0),Zt=(0,zt.useRef)(null),Je=(0,zt.useRef)(null),Ri,Pi=function(St){if(we.current){var At=Math.ceil(St.touches[0].pageX),wt=Math.ceil(St.touches[0].pageY),te=ei.current-At,ni=Be.current-wt,ui=Math.abs(te)>Math.abs(ni);ui?ei.current=At:Be.current=wt;var qe=He(ui,ui?te:ni,!1,St);qe&&St.preventDefault(),clearInterval(Je.current),qe&&(Je.current=setInterval(function(){ui?te*=Ai:ni*=Ai;var xe=Math.floor(ui?te:ni);(!He(ui,xe,!0)||Math.abs(xe)<=.1)&&clearInterval(Je.current)},16))}},Ct=function(){we.current=!1,Ri()},gt=function(St){Ri(),St.touches.length===1&&!we.current&&(we.current=!0,ei.current=Math.ceil(St.touches[0].pageX),Be.current=Math.ceil(St.touches[0].pageY),Zt.current=St.target,Zt.current.addEventListener("touchmove",Pi,{passive:!1}),Zt.current.addEventListener("touchend",Ct,{passive:!0}))};Ri=function(){Zt.current&&(Zt.current.removeEventListener("touchmove",Pi),Zt.current.removeEventListener("touchend",Ct))},(0,de.Z)(function(){return he&&We.current.addEventListener("touchstart",gt,{passive:!0}),function(){var ft;(ft=We.current)===null||ft===void 0||ft.removeEventListener("touchstart",gt),Ri(),clearInterval(Je.current)}},[he])}function gi(he){return Math.floor(Math.pow(he,.5))}function oi(he,We){var He="touches"in he?he.touches[0]:he;return He[We?"pageX":"pageY"]-window[We?"scrollX":"scrollY"]}function Bt(he,We,He){zt.useEffect(function(){var we=We.current;if(he&&we){var ei=!1,Be,Zt,Je=function(){Yt.Z.cancel(Be)},Ri=function ft(){Je(),Be=(0,Yt.Z)(function(){He(Zt),ft()})},Pi=function(){ei=!1,Je()},Ct=function(St){if(!(St.target.draggable||St.button!==0)){var At=St;At._virtualHandled||(At._virtualHandled=!0,ei=!0)}},gt=function(St){if(ei){var At=oi(St,!1),wt=we.getBoundingClientRect(),te=wt.top,ni=wt.bottom;if(At<=te){var ui=te-At;Zt=-gi(ui),Ri()}else if(At>=ni){var qe=At-ni;Zt=gi(qe),Ri()}else Je()}};return we.addEventListener("mousedown",Ct),we.ownerDocument.addEventListener("mouseup",Pi),we.ownerDocument.addEventListener("mousemove",gt),we.ownerDocument.addEventListener("dragend",Pi),function(){we.removeEventListener("mousedown",Ct),we.ownerDocument.removeEventListener("mouseup",Pi),we.ownerDocument.removeEventListener("mousemove",gt),we.ownerDocument.removeEventListener("dragend",Pi),Je()}}},[he])}var bt=10;function ge(he,We,He,we,ei,Be,Zt,Je){var Ri=zt.useRef(),Pi=zt.useState(null),Ct=(0,Ut.Z)(Pi,2),gt=Ct[0],ft=Ct[1];return(0,de.Z)(function(){if(gt&>.times<bt){if(!he.current){ft(function(yr){return(0,ce.Z)({},yr)});return}Be();var St=gt.targetAlign,At=gt.originAlign,wt=gt.index,te=gt.offset,ni=he.current.clientHeight,ui=!1,qe=St,xe=null;if(ni){for(var Zi=St||At,Si=0,Oi=0,Qi=0,Cn=Math.min(We.length-1,wt),_i=0;_i<=Cn;_i+=1){var Mn=ei(We[_i]);Oi=Si;var er=He.get(Mn);Qi=Oi+(er===void 0?we:er),Si=Qi}for(var ir=Zi==="top"?te:ni-te,fr=Cn;fr>=0;fr-=1){var ar=ei(We[fr]),br=He.get(ar);if(br===void 0){ui=!0;break}if(ir-=br,ir<=0)break}switch(Zi){case"top":xe=Oi-te;break;case"bottom":xe=Qi-ni+te;break;default:{var Qn=he.current.scrollTop,Nn=Qn+ni;Oi<Qn?qe="top":Qi>Nn&&(qe="bottom")}}xe!==null&&Zt(xe),xe!==gt.lastTop&&(ui=!0)}ui&&ft((0,ce.Z)((0,ce.Z)({},gt),{},{times:gt.times+1,targetAlign:qe,lastTop:xe}))}},[gt,he.current]),function(St){if(St==null){Je();return}if(Yt.Z.cancel(Ri.current),typeof St=="number")Zt(St);else if(St&&(0,_t.Z)(St)==="object"){var At,wt=St.align;"index"in St?At=St.index:At=We.findIndex(function(ui){return ei(ui)===St.key});var te=St.offset,ni=te===void 0?0:te;ft({times:0,index:At,offset:ni,originAlign:wt})}}}var Ge=zt.forwardRef(function(he,We){var He=he.prefixCls,we=he.rtl,ei=he.scrollOffset,Be=he.scrollRange,Zt=he.onStartMove,Je=he.onStopMove,Ri=he.onScroll,Pi=he.horizontal,Ct=he.spinSize,gt=he.containerSize,ft=he.style,St=he.thumbStyle,At=he.showScrollBar,wt=zt.useState(!1),te=(0,Ut.Z)(wt,2),ni=te[0],ui=te[1],qe=zt.useState(null),xe=(0,Ut.Z)(qe,2),Zi=xe[0],Si=xe[1],Oi=zt.useState(null),Qi=(0,Ut.Z)(Oi,2),Cn=Qi[0],_i=Qi[1],Mn=!we,er=zt.useRef(),ir=zt.useRef(),fr=zt.useState(At),ar=(0,Ut.Z)(fr,2),br=ar[0],Qn=ar[1],Nn=zt.useRef(),yr=function(){At===!0||At===!1||(clearTimeout(Nn.current),Qn(!0),Nn.current=setTimeout(function(){Qn(!1)},3e3))},yt=Be-gt||0,Mi=gt-Ct||0,on=zt.useMemo(function(){if(ei===0||yt===0)return 0;var zi=ei/yt;return zi*Mi},[ei,yt,Mi]),Ui=function(ur){ur.stopPropagation(),ur.preventDefault()},an=zt.useRef({top:on,dragging:ni,pageY:Zi,startTop:Cn});an.current={top:on,dragging:ni,pageY:Zi,startTop:Cn};var vi=function(ur){ui(!0),Si(oi(ur,Pi)),_i(an.current.top),Zt(),ur.stopPropagation(),ur.preventDefault()};zt.useEffect(function(){var zi=function(Xe){Xe.preventDefault()},ur=er.current,Vn=ir.current;return ur.addEventListener("touchstart",zi,{passive:!1}),Vn.addEventListener("touchstart",vi,{passive:!1}),function(){ur.removeEventListener("touchstart",zi),Vn.removeEventListener("touchstart",vi)}},[]);var di=zt.useRef();di.current=yt;var xn=zt.useRef();xn.current=Mi,zt.useEffect(function(){if(ni){var zi,ur=function(Xe){var mi=an.current,fn=mi.dragging,On=mi.pageY,Gn=mi.startTop;Yt.Z.cancel(zi);var It=er.current.getBoundingClientRect(),se=gt/(Pi?It.width:It.height);if(fn){var xi=(oi(Xe,Pi)-On)*se,Di=Gn;!Mn&&Pi?Di-=xi:Di+=xi;var Oe=di.current,Ti=xn.current,rn=Ti?Di/Ti:0,ln=Math.ceil(rn*Oe);ln=Math.max(ln,0),ln=Math.min(ln,Oe),zi=(0,Yt.Z)(function(){Ri(ln,Pi)})}},Vn=function(){ui(!1),Je()};return window.addEventListener("mousemove",ur,{passive:!0}),window.addEventListener("touchmove",ur,{passive:!0}),window.addEventListener("mouseup",Vn,{passive:!0}),window.addEventListener("touchend",Vn,{passive:!0}),function(){window.removeEventListener("mousemove",ur),window.removeEventListener("touchmove",ur),window.removeEventListener("mouseup",Vn),window.removeEventListener("touchend",Vn),Yt.Z.cancel(zi)}}},[ni]),zt.useEffect(function(){return yr(),function(){clearTimeout(Nn.current)}},[ei]),zt.useImperativeHandle(We,function(){return{delayHidden:yr}});var en="".concat(He,"-scrollbar"),hn={position:"absolute",visibility:br?null:"hidden"},Vi={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return Pi?(Object.assign(hn,{height:8,left:0,right:0,bottom:0}),Object.assign(Vi,(0,me.Z)({height:"100%",width:Ct},Mn?"left":"right",on))):(Object.assign(hn,(0,me.Z)({width:8,top:0,bottom:0},Mn?"right":"left",0)),Object.assign(Vi,{width:"100%",height:Ct,top:on})),zt.createElement("div",{ref:er,className:Ae()(en,(0,me.Z)((0,me.Z)((0,me.Z)({},"".concat(en,"-horizontal"),Pi),"".concat(en,"-vertical"),!Pi),"".concat(en,"-visible"),br)),style:(0,ce.Z)((0,ce.Z)({},hn),ft),onMouseDown:Ui,onMouseMove:yr},zt.createElement("div",{ref:ir,className:Ae()("".concat(en,"-thumb"),(0,me.Z)({},"".concat(en,"-thumb-moving"),ni)),style:(0,ce.Z)((0,ce.Z)({},Vi),St),onMouseDown:vi}))}),Ye=Ge,oe=20;function Ve(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,He=he/We*he;return isNaN(He)&&(He=0),He=Math.max(He,oe),Math.floor(He)}var Ze=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],Ni=[],Se={overflowY:"auto",overflowAnchor:"none"};function ie(he,We){var He=he.prefixCls,we=He===void 0?"rc-virtual-list":He,ei=he.className,Be=he.height,Zt=he.itemHeight,Je=he.fullHeight,Ri=Je===void 0?!0:Je,Pi=he.style,Ct=he.data,gt=he.children,ft=he.itemKey,St=he.virtual,At=he.direction,wt=he.scrollWidth,te=he.component,ni=te===void 0?"div":te,ui=he.onScroll,qe=he.onVirtualScroll,xe=he.onVisibleChange,Zi=he.innerProps,Si=he.extraRender,Oi=he.styles,Qi=he.showScrollBar,Cn=Qi===void 0?"optional":Qi,_i=(0,fe.Z)(he,Ze),Mn=zt.useCallback(function(sn){return typeof ft=="function"?ft(sn):sn==null?void 0:sn[ft]},[ft]),er=Ie(Mn,null,null),ir=(0,Ut.Z)(er,4),fr=ir[0],ar=ir[1],br=ir[2],Qn=ir[3],Nn=!!(St!==!1&&Be&&Zt),yr=zt.useMemo(function(){return Object.values(br.maps).reduce(function(sn,vn){return sn+vn},0)},[br.id,br.maps]),yt=Nn&&Ct&&(Math.max(Zt*Ct.length,yr)>Be||!!wt),Mi=At==="rtl",on=Ae()(we,(0,me.Z)({},"".concat(we,"-rtl"),Mi),ei),Ui=Ct||Ni,an=(0,zt.useRef)(),vi=(0,zt.useRef)(),di=(0,zt.useRef)(),xn=(0,zt.useState)(0),en=(0,Ut.Z)(xn,2),hn=en[0],Vi=en[1],zi=(0,zt.useState)(0),ur=(0,Ut.Z)(zi,2),Vn=ur[0],$n=ur[1],Xe=(0,zt.useState)(!1),mi=(0,Ut.Z)(Xe,2),fn=mi[0],On=mi[1],Gn=function(){On(!0)},It=function(){On(!1)},se={getKey:Mn};function xi(sn){Vi(function(vn){var Yn;typeof sn=="function"?Yn=sn(vn):Yn=sn;var Gi=Fe(Yn);return an.current.scrollTop=Gi,Gi})}var Di=(0,zt.useRef)({start:0,end:Ui.length}),Oe=(0,zt.useRef)(),Ti=De(Ui,Mn),rn=(0,Ut.Z)(Ti,1),ln=rn[0];Oe.current=ln;var yn=zt.useMemo(function(){if(!Nn)return{scrollHeight:void 0,start:0,end:Ui.length-1,offset:void 0};if(!yt){var sn;return{scrollHeight:((sn=vi.current)===null||sn===void 0?void 0:sn.offsetHeight)||0,start:0,end:Ui.length-1,offset:void 0}}for(var vn=0,Yn,Gi,mn,Kn=Ui.length,un=0;un<Kn;un+=1){var Wi=Ui[un],li=Mn(Wi),Pn=br.get(li),wr=vn+(Pn===void 0?Zt:Pn);wr>=hn&&Yn===void 0&&(Yn=un,Gi=vn),wr>hn+Be&&mn===void 0&&(mn=un),vn=wr}return Yn===void 0&&(Yn=0,Gi=0,mn=Math.ceil(Be/Zt)),mn===void 0&&(mn=Ui.length-1),mn=Math.min(mn+1,Ui.length-1),{scrollHeight:vn,start:Yn,end:mn,offset:Gi}},[yt,Nn,hn,Ui,Qn,Be]),ii=yn.scrollHeight,Hi=yn.start,Xi=yn.end,ki=yn.offset;Di.current.start=Hi,Di.current.end=Xi,zt.useLayoutEffect(function(){var sn=br.getRecord();if(sn.size===1){var vn=Array.from(sn.keys())[0],Yn=sn.get(vn),Gi=Ui[Hi];if(Gi&&Yn===void 0){var mn=Mn(Gi);if(mn===vn){var Kn=br.get(vn),un=Kn-Zt;xi(function(Wi){return Wi+un})}}}br.resetRecord()},[ii]);var En=zt.useState({width:0,height:Be}),Fn=(0,Ut.Z)(En,2),qi=Fn[0],rr=Fn[1],Sr=function(vn){rr({width:vn.offsetWidth,height:vn.offsetHeight})},Kr=(0,zt.useRef)(),ze=(0,zt.useRef)(),gn=zt.useMemo(function(){return Ve(qi.width,wt)},[qi.width,wt]),nr=zt.useMemo(function(){return Ve(qi.height,ii)},[qi.height,ii]),Sn=ii-Be,Ke=(0,zt.useRef)(Sn);Ke.current=Sn;function Fe(sn){var vn=sn;return Number.isNaN(Ke.current)||(vn=Math.min(vn,Ke.current)),vn=Math.max(vn,0),vn}var ke=hn<=0,$e=hn>=Sn,pi=Vn<=0,Ei=Vn>=wt,Me=Xt(ke,$e,pi,Ei),cn=function(){return{x:Mi?-Vn:Vn,y:hn}},_e=(0,zt.useRef)(cn()),bi=(0,Dt.zX)(function(sn){if(qe){var vn=(0,ce.Z)((0,ce.Z)({},cn()),sn);(_e.current.x!==vn.x||_e.current.y!==vn.y)&&(qe(vn),_e.current=vn)}});function pn(sn,vn){var Yn=sn;vn?((0,Ne.flushSync)(function(){$n(Yn)}),bi()):xi(Yn)}function kn(sn){var vn=sn.currentTarget.scrollTop;vn!==hn&&xi(vn),ui==null||ui(sn),bi()}var zn=function(vn){var Yn=vn,Gi=wt?wt-qi.width:0;return Yn=Math.max(Yn,0),Yn=Math.min(Yn,Gi),Yn},Bn=(0,Dt.zX)(function(sn,vn){vn?((0,Ne.flushSync)(function(){$n(function(Yn){var Gi=Yn+(Mi?-sn:sn);return zn(Gi)})}),bi()):xi(function(Yn){var Gi=Yn+sn;return Gi})}),Tn=Le(Nn,ke,$e,pi,Ei,!!wt,Bn),or=(0,Ut.Z)(Tn,2),Fr=or[0],Zn=or[1];yi(Nn,an,function(sn,vn,Yn,Gi){var mn=Gi;return Me(sn,vn,Yn)?!1:!mn||!mn._virtualHandled?(mn&&(mn._virtualHandled=!0),Fr({preventDefault:function(){},deltaX:sn?vn:0,deltaY:sn?0:vn}),!0):!1}),Bt(yt,an,function(sn){xi(function(vn){return vn+sn})}),(0,de.Z)(function(){function sn(Yn){var Gi=ke&&Yn.detail<0,mn=$e&&Yn.detail>0;Nn&&!Gi&&!mn&&Yn.preventDefault()}var vn=an.current;return vn.addEventListener("wheel",Fr,{passive:!1}),vn.addEventListener("DOMMouseScroll",Zn,{passive:!0}),vn.addEventListener("MozMousePixelScroll",sn,{passive:!1}),function(){vn.removeEventListener("wheel",Fr),vn.removeEventListener("DOMMouseScroll",Zn),vn.removeEventListener("MozMousePixelScroll",sn)}},[Nn,ke,$e]),(0,de.Z)(function(){if(wt){var sn=zn(Vn);$n(sn),bi({x:sn})}},[qi.width,wt]);var ji=function(){var vn,Yn;(vn=Kr.current)===null||vn===void 0||vn.delayHidden(),(Yn=ze.current)===null||Yn===void 0||Yn.delayHidden()},Pt=ge(an,Ui,br,Zt,Mn,function(){return ar(!0)},xi,ji);zt.useImperativeHandle(We,function(){return{nativeElement:di.current,getScrollInfo:cn,scrollTo:function(vn){function Yn(Gi){return Gi&&(0,_t.Z)(Gi)==="object"&&("left"in Gi||"top"in Gi)}Yn(vn)?(vn.left!==void 0&&$n(zn(vn.left)),Pt(vn.top)):Pt(vn)}}}),(0,de.Z)(function(){if(xe){var sn=Ui.slice(Hi,Xi+1);xe(sn,Ui)}},[Hi,Xi,Ui]);var gr=Wt(Ui,Mn,br,Zt),Un=Si==null?void 0:Si({start:Hi,end:Xi,virtual:yt,offsetX:Vn,offsetY:ki,rtl:Mi,getSize:gr}),Ar=Jt(Ui,Hi,Xi,wt,Vn,fr,gt,se),Dr=null;Be&&(Dr=(0,ce.Z)((0,me.Z)({},Ri?"height":"maxHeight",Be),Se),Nn&&(Dr.overflowY="hidden",wt&&(Dr.overflowX="hidden"),fn&&(Dr.pointerEvents="none")));var Cr={};return Mi&&(Cr.dir="rtl"),zt.createElement("div",(0,pt.Z)({ref:di,style:(0,ce.Z)((0,ce.Z)({},Pi),{},{position:"relative"}),className:on},Cr,_i),zt.createElement(re.Z,{onResize:Sr},zt.createElement(ni,{className:"".concat(we,"-holder"),style:Dr,ref:an,onScroll:kn,onMouseEnter:ji},zt.createElement(qt,{prefixCls:we,height:ii,offsetX:Vn,offsetY:ki,scrollWidth:wt,onInnerResize:ar,ref:vi,innerProps:Zi,rtl:Mi,extra:Un},Ar))),yt&&ii>Be&&zt.createElement(Ye,{ref:Kr,prefixCls:we,scrollOffset:hn,scrollRange:ii,rtl:Mi,onScroll:pn,onStartMove:Gn,onStopMove:It,spinSize:nr,containerSize:qi.height,style:Oi==null?void 0:Oi.verticalScrollBar,thumbStyle:Oi==null?void 0:Oi.verticalScrollBarThumb,showScrollBar:Cn}),yt&&wt>qi.width&&zt.createElement(Ye,{ref:ze,prefixCls:we,scrollOffset:Vn,scrollRange:wt,rtl:Mi,onScroll:pn,onStartMove:Gn,onStopMove:It,spinSize:gn,containerSize:qi.width,horizontal:!0,style:Oi==null?void 0:Oi.horizontalScrollBar,thumbStyle:Oi==null?void 0:Oi.horizontalScrollBarThumb,showScrollBar:Cn}))}var ee=zt.forwardRef(ie);ee.displayName="List";var ve=ee,ti=ve},51353:function(Li,ai,Mt){"use strict";Object.defineProperty(ai,"__esModule",{value:!0}),Object.defineProperty(ai,"DraggableCore",{enumerable:!0,get:function(){return Ae.default}}),ai.default=void 0;var pt=de(Mt(59301)),_t=Dt(Mt(12708)),ce=Dt(Mt(4676)),me=Mt(14625),Ut=Mt(77026),fe=Mt(22013),$t=Mt(80217),Ae=Dt(Mt(68555)),re=Dt(Mt(97510));function Dt(Jt){return Jt&&Jt.__esModule?Jt:{default:Jt}}function de(Jt,Pe){if(typeof WeakMap=="function")var je=new WeakMap,De=new WeakMap;return(de=function(Yt,Vt){if(!Vt&&Yt&&Yt.__esModule)return Yt;var pe,Xt,Le={__proto__:null,default:Yt};if(Yt===null||typeof Yt!="object"&&typeof Yt!="function")return Le;if(pe=Vt?De:je){if(pe.has(Yt))return pe.get(Yt);pe.set(Yt,Le)}for(const Wt in Yt)Wt!=="default"&&{}.hasOwnProperty.call(Yt,Wt)&&((Xt=(pe=Object.defineProperty)&&Object.getOwnPropertyDescriptor(Yt,Wt))&&(Xt.get||Xt.set)?pe(Le,Wt,Xt):Le[Wt]=Yt[Wt]);return Le})(Jt,Pe)}function zt(){return zt=Object.assign?Object.assign.bind():function(Jt){for(var Pe=1;Pe<arguments.length;Pe++){var je=arguments[Pe];for(var De in je)({}).hasOwnProperty.call(je,De)&&(Jt[De]=je[De])}return Jt},zt.apply(null,arguments)}function Ne(Jt,Pe,je){return(Pe=ue(Pe))in Jt?Object.defineProperty(Jt,Pe,{value:je,enumerable:!0,configurable:!0,writable:!0}):Jt[Pe]=je,Jt}function ue(Jt){var Pe=qt(Jt,"string");return typeof Pe=="symbol"?Pe:Pe+""}function qt(Jt,Pe){if(typeof Jt!="object"||!Jt)return Jt;var je=Jt[Symbol.toPrimitive];if(je!==void 0){var De=je.call(Jt,Pe||"default");if(typeof De!="object")return De;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Pe==="string"?String:Number)(Jt)}class Qt extends pt.Component{static getDerivedStateFromProps(Pe,je){let{position:De}=Pe,{prevPropsPosition:Yt}=je;return De&&(!Yt||De.x!==Yt.x||De.y!==Yt.y)?((0,re.default)("Draggable: getDerivedStateFromProps %j",{position:De,prevPropsPosition:Yt}),{x:De.x,y:De.y,prevPropsPosition:dc({},De)}):null}constructor(Pe){super(Pe),Ne(this,"onDragStart",(je,De)=>{if((0,re.default)("Draggable: onDragStart: %j",De),this.props.onStart(je,(0,fe.createDraggableData)(this,De))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),Ne(this,"onDrag",(je,De)=>{if(!this.state.dragging)return!1;(0,re.default)("Draggable: onDrag: %j",De);const Yt=(0,fe.createDraggableData)(this,De),Vt={x:Yt.x,y:Yt.y,slackX:0,slackY:0};if(this.props.bounds){const{x:Xt,y:Le}=Vt;Vt.x+=this.state.slackX,Vt.y+=this.state.slackY;const[Wt,Ce]=(0,fe.getBoundPosition)(this,Vt.x,Vt.y);Vt.x=Wt,Vt.y=Ce,Vt.slackX=this.state.slackX+(Xt-Vt.x),Vt.slackY=this.state.slackY+(Le-Vt.y),Yt.x=Vt.x,Yt.y=Vt.y,Yt.deltaX=Vt.x-this.state.x,Yt.deltaY=Vt.y-this.state.y}if(this.props.onDrag(je,Yt)===!1)return!1;this.setState(Vt)}),Ne(this,"onDragStop",(je,De)=>{if(!this.state.dragging||this.props.onStop(je,(0,fe.createDraggableData)(this,De))===!1)return!1;(0,re.default)("Draggable: onDragStop: %j",De);const Vt={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:Xt,y:Le}=this.props.position;Vt.x=Xt,Vt.y=Le}this.setState(Vt)}),this.state={dragging:!1,dragged:!1,x:Pe.position?Pe.position.x:Pe.defaultPosition.x,y:Pe.position?Pe.position.y:Pe.defaultPosition.y,prevPropsPosition:dc({},Pe.position),slackX:0,slackY:0,isElementSVG:!1},Pe.position&&!(Pe.onDrag||Pe.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement!="undefined"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var Pe,je,De;return(De=(je=(Pe=this.props)==null?void 0:Pe.nodeRef)==null?void 0:je.current)!=null?De:ce.default.findDOMNode(this)}render(){const oi=this.props,{axis:Pe,bounds:je,children:De,defaultPosition:Yt,defaultClassName:Vt,defaultClassNameDragging:pe,defaultClassNameDragged:Xt,position:Le,positionOffset:Wt,scale:Ce}=oi,Te=ww(oi,["axis","bounds","children","defaultPosition","defaultClassName","defaultClassNameDragging","defaultClassNameDragged","position","positionOffset","scale"]);let ne={},Re=null;const Ie=!!!Le||this.state.dragging,Ai=Le||Yt,yi={x:(0,fe.canDragX)(this)&&Ie?this.state.x:Ai.x,y:(0,fe.canDragY)(this)&&Ie?this.state.y:Ai.y};this.state.isElementSVG?Re=(0,Ut.createSVGTransform)(yi,Wt):ne=(0,Ut.createCSSTransform)(yi,Wt);const gi=(0,me.clsx)(De.props.className||"",Vt,{[pe]:this.state.dragging,[Xt]:this.state.dragged});return pt.createElement(Ae.default,zt({},Te,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),pt.cloneElement(pt.Children.only(De),{className:gi,style:dc(dc({},De.props.style),ne),transform:Re}))}}ai.default=Qt,Ne(Qt,"displayName","Draggable"),Ne(Qt,"propTypes",Yy(dc({},Ae.default.propTypes),{axis:_t.default.oneOf(["both","x","y","none"]),bounds:_t.default.oneOfType([_t.default.shape({left:_t.default.number,right:_t.default.number,top:_t.default.number,bottom:_t.default.number}),_t.default.string,_t.default.oneOf([!1])]),defaultClassName:_t.default.string,defaultClassNameDragging:_t.default.string,defaultClassNameDragged:_t.default.string,defaultPosition:_t.default.shape({x:_t.default.number,y:_t.default.number}),positionOffset:_t.default.shape({x:_t.default.oneOfType([_t.default.number,_t.default.string]),y:_t.default.oneOfType([_t.default.number,_t.default.string])}),position:_t.default.shape({x:_t.default.number,y:_t.default.number}),className:$t.dontSetMe,style:$t.dontSetMe,transform:$t.dontSetMe})),Ne(Qt,"defaultProps",Yy(dc({},Ae.default.defaultProps),{axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1}))},68555:function(Li,ai,Mt){"use strict";Object.defineProperty(ai,"__esModule",{value:!0}),ai.default=void 0;var pt=re(Mt(59301)),_t=Ae(Mt(12708)),ce=Ae(Mt(4676)),me=Mt(77026),Ut=Mt(22013),fe=Mt(80217),$t=Ae(Mt(97510));function Ae(Qt){return Qt&&Qt.__esModule?Qt:{default:Qt}}function re(Qt,Jt){if(typeof WeakMap=="function")var Pe=new WeakMap,je=new WeakMap;return(re=function(De,Yt){if(!Yt&&De&&De.__esModule)return De;var Vt,pe,Xt={__proto__:null,default:De};if(De===null||typeof De!="object"&&typeof De!="function")return Xt;if(Vt=Yt?je:Pe){if(Vt.has(De))return Vt.get(De);Vt.set(De,Xt)}for(const Le in De)Le!=="default"&&{}.hasOwnProperty.call(De,Le)&&((pe=(Vt=Object.defineProperty)&&Object.getOwnPropertyDescriptor(De,Le))&&(pe.get||pe.set)?Vt(Xt,Le,pe):Xt[Le]=De[Le]);return Xt})(Qt,Jt)}function Dt(Qt,Jt,Pe){return(Jt=de(Jt))in Qt?Object.defineProperty(Qt,Jt,{value:Pe,enumerable:!0,configurable:!0,writable:!0}):Qt[Jt]=Pe,Qt}function de(Qt){var Jt=zt(Qt,"string");return typeof Jt=="symbol"?Jt:Jt+""}function zt(Qt,Jt){if(typeof Qt!="object"||!Qt)return Qt;var Pe=Qt[Symbol.toPrimitive];if(Pe!==void 0){var je=Pe.call(Qt,Jt||"default");if(typeof je!="object")return je;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Jt==="string"?String:Number)(Qt)}const Ne={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let ue=Ne.mouse;class qt extends pt.Component{constructor(){super(...arguments),Dt(this,"dragging",!1),Dt(this,"lastX",NaN),Dt(this,"lastY",NaN),Dt(this,"touchIdentifier",null),Dt(this,"mounted",!1),Dt(this,"handleDragStart",Jt=>{if(this.props.onMouseDown(Jt),!this.props.allowAnyClick&&typeof Jt.button=="number"&&Jt.button!==0)return!1;const Pe=this.findDOMNode();if(!Pe||!Pe.ownerDocument||!Pe.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:je}=Pe;if(this.props.disabled||!(Jt.target instanceof je.defaultView.Node)||this.props.handle&&!(0,me.matchesSelectorAndParentsTo)(Jt.target,this.props.handle,Pe)||this.props.cancel&&(0,me.matchesSelectorAndParentsTo)(Jt.target,this.props.cancel,Pe))return;Jt.type==="touchstart"&&!this.props.allowMobileScroll&&Jt.preventDefault();const De=(0,me.getTouchIdentifier)(Jt);this.touchIdentifier=De;const Yt=(0,Ut.getControlPosition)(Jt,De,this);if(Yt==null)return;const{x:Vt,y:pe}=Yt,Xt=(0,Ut.createCoreData)(this,Vt,pe);(0,$t.default)("DraggableCore: handleDragStart: %j",Xt),(0,$t.default)("calling",this.props.onStart),!(this.props.onStart(Jt,Xt)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,me.addUserSelectStyles)(je),this.dragging=!0,this.lastX=Vt,this.lastY=pe,(0,me.addEvent)(je,ue.move,this.handleDrag),(0,me.addEvent)(je,ue.stop,this.handleDragStop))}),Dt(this,"handleDrag",Jt=>{const Pe=(0,Ut.getControlPosition)(Jt,this.touchIdentifier,this);if(Pe==null)return;let{x:je,y:De}=Pe;if(Array.isArray(this.props.grid)){let pe=je-this.lastX,Xt=De-this.lastY;if([pe,Xt]=(0,Ut.snapToGrid)(this.props.grid,pe,Xt),!pe&&!Xt)return;je=this.lastX+pe,De=this.lastY+Xt}const Yt=(0,Ut.createCoreData)(this,je,De);if((0,$t.default)("DraggableCore: handleDrag: %j",Yt),this.props.onDrag(Jt,Yt)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch(pe){const Xt=document.createEvent("MouseEvents");Xt.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(Xt)}return}this.lastX=je,this.lastY=De}),Dt(this,"handleDragStop",Jt=>{if(!this.dragging)return;const Pe=(0,Ut.getControlPosition)(Jt,this.touchIdentifier,this);if(Pe==null)return;let{x:je,y:De}=Pe;if(Array.isArray(this.props.grid)){let Xt=je-this.lastX||0,Le=De-this.lastY||0;[Xt,Le]=(0,Ut.snapToGrid)(this.props.grid,Xt,Le),je=this.lastX+Xt,De=this.lastY+Le}const Yt=(0,Ut.createCoreData)(this,je,De);if(this.props.onStop(Jt,Yt)===!1||this.mounted===!1)return!1;const pe=this.findDOMNode();pe&&this.props.enableUserSelectHack&&(0,me.scheduleRemoveUserSelectStyles)(pe.ownerDocument),(0,$t.default)("DraggableCore: handleDragStop: %j",Yt),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,pe&&((0,$t.default)("DraggableCore: Removing handlers"),(0,me.removeEvent)(pe.ownerDocument,ue.move,this.handleDrag),(0,me.removeEvent)(pe.ownerDocument,ue.stop,this.handleDragStop))}),Dt(this,"onMouseDown",Jt=>(ue=Ne.mouse,this.handleDragStart(Jt))),Dt(this,"onMouseUp",Jt=>(ue=Ne.mouse,this.handleDragStop(Jt))),Dt(this,"onTouchStart",Jt=>(ue=Ne.touch,this.handleDragStart(Jt))),Dt(this,"onTouchEnd",Jt=>(ue=Ne.touch,this.handleDragStop(Jt)))}componentDidMount(){this.mounted=!0;const Jt=this.findDOMNode();Jt&&(0,me.addEvent)(Jt,Ne.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const Jt=this.findDOMNode();if(Jt){const{ownerDocument:Pe}=Jt;(0,me.removeEvent)(Pe,Ne.mouse.move,this.handleDrag),(0,me.removeEvent)(Pe,Ne.touch.move,this.handleDrag),(0,me.removeEvent)(Pe,Ne.mouse.stop,this.handleDragStop),(0,me.removeEvent)(Pe,Ne.touch.stop,this.handleDragStop),(0,me.removeEvent)(Jt,Ne.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,me.scheduleRemoveUserSelectStyles)(Pe)}}findDOMNode(){var Jt,Pe,je;return(Jt=this.props)!=null&&Jt.nodeRef?(je=(Pe=this.props)==null?void 0:Pe.nodeRef)==null?void 0:je.current:ce.default.findDOMNode(this)}render(){return pt.cloneElement(pt.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}ai.default=qt,Dt(qt,"displayName","DraggableCore"),Dt(qt,"propTypes",{allowAnyClick:_t.default.bool,allowMobileScroll:_t.default.bool,children:_t.default.node.isRequired,disabled:_t.default.bool,enableUserSelectHack:_t.default.bool,offsetParent:function(Qt,Jt){if(Qt[Jt]&&Qt[Jt].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:_t.default.arrayOf(_t.default.number),handle:_t.default.string,cancel:_t.default.string,nodeRef:_t.default.object,onStart:_t.default.func,onDrag:_t.default.func,onStop:_t.default.func,onMouseDown:_t.default.func,scale:_t.default.number,className:fe.dontSetMe,style:fe.dontSetMe,transform:fe.dontSetMe}),Dt(qt,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})},96249:function(Li,ai,Mt){"use strict";const{default:pt,DraggableCore:_t}=Mt(51353);Li.exports=pt,Li.exports.default=pt,Li.exports.DraggableCore=_t},77026:function(Li,ai,Mt){"use strict";Object.defineProperty(ai,"__esModule",{value:!0}),ai.addClassName=Vt,ai.addEvent=$t,ai.addUserSelectStyles=je,ai.createCSSTransform=ue,ai.createSVGTransform=qt,ai.getTouch=Jt,ai.getTouchIdentifier=Pe,ai.getTranslation=Qt,ai.innerHeight=de,ai.innerWidth=zt,ai.matchesSelector=Ut,ai.matchesSelectorAndParentsTo=fe,ai.offsetXYFromParent=Ne,ai.outerHeight=re,ai.outerWidth=Dt,ai.removeClassName=pe,ai.removeEvent=Ae,ai.scheduleRemoveUserSelectStyles=De;var pt=Mt(80217),_t=ce(Mt(76172));function ce(Xt,Le){if(typeof WeakMap=="function")var Wt=new WeakMap,Ce=new WeakMap;return(ce=function(Te,ne){if(!ne&&Te&&Te.__esModule)return Te;var Re,ye,Ie={__proto__:null,default:Te};if(Te===null||typeof Te!="object"&&typeof Te!="function")return Ie;if(Re=ne?Ce:Wt){if(Re.has(Te))return Re.get(Te);Re.set(Te,Ie)}for(const Ai in Te)Ai!=="default"&&{}.hasOwnProperty.call(Te,Ai)&&((ye=(Re=Object.defineProperty)&&Object.getOwnPropertyDescriptor(Te,Ai))&&(ye.get||ye.set)?Re(Ie,Ai,ye):Ie[Ai]=Te[Ai]);return Ie})(Xt,Le)}let me="";function Ut(Xt,Le){return me||(me=(0,pt.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(Wt){return(0,pt.isFunction)(Xt[Wt])})),(0,pt.isFunction)(Xt[me])?Xt[me](Le):!1}function fe(Xt,Le,Wt){let Ce=Xt;do{if(Ut(Ce,Le))return!0;if(Ce===Wt)return!1;Ce=Ce.parentNode}while(Ce);return!1}function $t(Xt,Le,Wt,Ce){if(!Xt)return;const Te=dc({capture:!0},Ce);Xt.addEventListener?Xt.addEventListener(Le,Wt,Te):Xt.attachEvent?Xt.attachEvent("on"+Le,Wt):Xt["on"+Le]=Wt}function Ae(Xt,Le,Wt,Ce){if(!Xt)return;const Te=dc({capture:!0},Ce);Xt.removeEventListener?Xt.removeEventListener(Le,Wt,Te):Xt.detachEvent?Xt.detachEvent("on"+Le,Wt):Xt["on"+Le]=null}function re(Xt){let Le=Xt.clientHeight;const Wt=Xt.ownerDocument.defaultView.getComputedStyle(Xt);return Le+=(0,pt.int)(Wt.borderTopWidth),Le+=(0,pt.int)(Wt.borderBottomWidth),Le}function Dt(Xt){let Le=Xt.clientWidth;const Wt=Xt.ownerDocument.defaultView.getComputedStyle(Xt);return Le+=(0,pt.int)(Wt.borderLeftWidth),Le+=(0,pt.int)(Wt.borderRightWidth),Le}function de(Xt){let Le=Xt.clientHeight;const Wt=Xt.ownerDocument.defaultView.getComputedStyle(Xt);return Le-=(0,pt.int)(Wt.paddingTop),Le-=(0,pt.int)(Wt.paddingBottom),Le}function zt(Xt){let Le=Xt.clientWidth;const Wt=Xt.ownerDocument.defaultView.getComputedStyle(Xt);return Le-=(0,pt.int)(Wt.paddingLeft),Le-=(0,pt.int)(Wt.paddingRight),Le}function Ne(Xt,Le,Wt){const Te=Le===Le.ownerDocument.body?{left:0,top:0}:Le.getBoundingClientRect(),ne=(Xt.clientX+Le.scrollLeft-Te.left)/Wt,Re=(Xt.clientY+Le.scrollTop-Te.top)/Wt;return{x:ne,y:Re}}function ue(Xt,Le){const Wt=Qt(Xt,Le,"px");return{[(0,_t.browserPrefixToKey)("transform",_t.default)]:Wt}}function qt(Xt,Le){return Qt(Xt,Le,"")}function Qt(Xt,Le,Wt){let{x:Ce,y:Te}=Xt,ne=`translate(${Ce}${Wt},${Te}${Wt})`;if(Le){const Re=`${typeof Le.x=="string"?Le.x:Le.x+Wt}`,ye=`${typeof Le.y=="string"?Le.y:Le.y+Wt}`;ne=`translate(${Re}, ${ye})`+ne}return ne}function Jt(Xt,Le){return Xt.targetTouches&&(0,pt.findInArray)(Xt.targetTouches,Wt=>Le===Wt.identifier)||Xt.changedTouches&&(0,pt.findInArray)(Xt.changedTouches,Wt=>Le===Wt.identifier)}function Pe(Xt){if(Xt.targetTouches&&Xt.targetTouches[0])return Xt.targetTouches[0].identifier;if(Xt.changedTouches&&Xt.changedTouches[0])return Xt.changedTouches[0].identifier}function je(Xt){if(!Xt)return;let Le=Xt.getElementById("react-draggable-style-el");Le||(Le=Xt.createElement("style"),Le.type="text/css",Le.id="react-draggable-style-el",Le.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
`,Le.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
`,Xt.getElementsByTagName("head")[0].appendChild(Le)),Xt.body&&Vt(Xt.body,"react-draggable-transparent-selection")}function De(Xt){window.requestAnimationFrame?window.requestAnimationFrame(()=>{Yt(Xt)}):Yt(Xt)}function Yt(Xt){if(Xt)try{if(Xt.body&&pe(Xt.body,"react-draggable-transparent-selection"),Xt.selection)Xt.selection.empty();else{const Le=(Xt.defaultView||window).getSelection();Le&&Le.type!=="Caret"&&Le.removeAllRanges()}}catch(Le){}}function Vt(Xt,Le){Xt.classList?Xt.classList.add(Le):Xt.className.match(new RegExp(`(?:^|\\s)${Le}(?!\\S)`))||(Xt.className+=` ${Le}`)}function pe(Xt,Le){Xt.classList?Xt.classList.remove(Le):Xt.className=Xt.className.replace(new RegExp(`(?:^|\\s)${Le}(?!\\S)`,"g"),"")}},76172:function(Li,ai){"use strict";Object.defineProperty(ai,"__esModule",{value:!0}),ai.browserPrefixToKey=_t,ai.browserPrefixToStyle=ce,ai.default=void 0,ai.getPrefix=pt;const Mt=["Moz","Webkit","O","ms"];function pt(){var Ae,re;let fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window=="undefined")return"";const $t=(re=(Ae=window.document)==null?void 0:Ae.documentElement)==null?void 0:re.style;if(!$t||fe in $t)return"";for(let Dt=0;Dt<Mt.length;Dt++)if(_t(fe,Mt[Dt])in $t)return Mt[Dt];return""}function _t(fe,$t){return $t?`${$t}${me(fe)}`:fe}function ce(fe,$t){return $t?`-${$t.toLowerCase()}-${fe}`:fe}function me(fe){let $t="",Ae=!0;for(let re=0;re<fe.length;re++)Ae?($t+=fe[re].toUpperCase(),Ae=!1):fe[re]==="-"?Ae=!0:$t+=fe[re];return $t}var Ut=ai.default=pt()},97510:function(Li,ai){"use strict";Object.defineProperty(ai,"__esModule",{value:!0}),ai.default=Mt;function Mt(){}},22013:function(Li,ai,Mt){"use strict";Object.defineProperty(ai,"__esModule",{value:!0}),ai.canDragX=Ut,ai.canDragY=fe,ai.createCoreData=Ae,ai.createDraggableData=re,ai.getBoundPosition=ce,ai.getControlPosition=$t,ai.snapToGrid=me;var pt=Mt(80217),_t=Mt(77026);function ce(zt,Ne,ue){if(!zt.props.bounds)return[Ne,ue];let{bounds:qt}=zt.props;qt=typeof qt=="string"?qt:Dt(qt);const Qt=de(zt);if(typeof qt=="string"){const{ownerDocument:Jt}=Qt,Pe=Jt.defaultView;let je;if(qt==="parent"?je=Qt.parentNode:je=Qt.getRootNode().querySelector(qt),!(je instanceof Pe.HTMLElement))throw new Error('Bounds selector "'+qt+'" could not find an element.');const De=je,Yt=Pe.getComputedStyle(Qt),Vt=Pe.getComputedStyle(De);qt={left:-Qt.offsetLeft+(0,pt.int)(Vt.paddingLeft)+(0,pt.int)(Yt.marginLeft),top:-Qt.offsetTop+(0,pt.int)(Vt.paddingTop)+(0,pt.int)(Yt.marginTop),right:(0,_t.innerWidth)(De)-(0,_t.outerWidth)(Qt)-Qt.offsetLeft+(0,pt.int)(Vt.paddingRight)-(0,pt.int)(Yt.marginRight),bottom:(0,_t.innerHeight)(De)-(0,_t.outerHeight)(Qt)-Qt.offsetTop+(0,pt.int)(Vt.paddingBottom)-(0,pt.int)(Yt.marginBottom)}}return(0,pt.isNum)(qt.right)&&(Ne=Math.min(Ne,qt.right)),(0,pt.isNum)(qt.bottom)&&(ue=Math.min(ue,qt.bottom)),(0,pt.isNum)(qt.left)&&(Ne=Math.max(Ne,qt.left)),(0,pt.isNum)(qt.top)&&(ue=Math.max(ue,qt.top)),[Ne,ue]}function me(zt,Ne,ue){const qt=Math.round(Ne/zt[0])*zt[0],Qt=Math.round(ue/zt[1])*zt[1];return[qt,Qt]}function Ut(zt){return zt.props.axis==="both"||zt.props.axis==="x"}function fe(zt){return zt.props.axis==="both"||zt.props.axis==="y"}function $t(zt,Ne,ue){const qt=typeof Ne=="number"?(0,_t.getTouch)(zt,Ne):null;if(typeof Ne=="number"&&!qt)return null;const Qt=de(ue),Jt=ue.props.offsetParent||Qt.offsetParent||Qt.ownerDocument.body;return(0,_t.offsetXYFromParent)(qt||zt,Jt,ue.props.scale)}function Ae(zt,Ne,ue){const qt=!(0,pt.isNum)(zt.lastX),Qt=de(zt);return qt?{node:Qt,deltaX:0,deltaY:0,lastX:Ne,lastY:ue,x:Ne,y:ue}:{node:Qt,deltaX:Ne-zt.lastX,deltaY:ue-zt.lastY,lastX:zt.lastX,lastY:zt.lastY,x:Ne,y:ue}}function re(zt,Ne){const ue=zt.props.scale;return{node:Ne.node,x:zt.state.x+Ne.deltaX/ue,y:zt.state.y+Ne.deltaY/ue,deltaX:Ne.deltaX/ue,deltaY:Ne.deltaY/ue,lastX:zt.state.x,lastY:zt.state.y}}function Dt(zt){return{left:zt.left,top:zt.top,right:zt.right,bottom:zt.bottom}}function de(zt){const Ne=zt.findDOMNode();if(!Ne)throw new Error("<DraggableCore>: Unmounted during event!");return Ne}},80217:function(Li,ai){"use strict";Object.defineProperty(ai,"__esModule",{value:!0}),ai.dontSetMe=me,ai.findInArray=Mt,ai.int=ce,ai.isFunction=pt,ai.isNum=_t;function Mt(Ut,fe){for(let $t=0,Ae=Ut.length;$t<Ae;$t++)if(fe.apply(fe,[Ut[$t],$t,Ut]))return Ut[$t]}function pt(Ut){return typeof Ut=="function"||Object.prototype.toString.call(Ut)==="[object Function]"}function _t(Ut){return typeof Ut=="number"&&!isNaN(Ut)}function ce(Ut){return parseInt(Ut,10)}function me(Ut,fe,$t){if(Ut[fe])return new Error(`Invalid prop ${fe} passed to ${$t} - do not set this, set it on the child.`)}},51581:function(Li,ai,Mt){"use strict";Object.defineProperty(ai,"__esModule",{value:!0});var pt=function(){function zt(Ne,ue){for(var qt=0;qt<ue.length;qt++){var Qt=ue[qt];Qt.enumerable=Qt.enumerable||!1,Qt.configurable=!0,"value"in Qt&&(Qt.writable=!0),Object.defineProperty(Ne,Qt.key,Qt)}}return function(Ne,ue,qt){return ue&&zt(Ne.prototype,ue),qt&&zt(Ne,qt),Ne}}(),_t=Mt(59301),ce=fe(_t),me=Mt(12708),Ut=fe(me);function fe(zt){return zt&&zt.__esModule?zt:{default:zt}}function $t(zt,Ne){var ue={};for(var qt in zt)Ne.indexOf(qt)>=0||Object.prototype.hasOwnProperty.call(zt,qt)&&(ue[qt]=zt[qt]);return ue}function Ae(zt,Ne){if(!(zt instanceof Ne))throw new TypeError("Cannot call a class as a function")}function re(zt,Ne){if(!zt)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ne&&(typeof Ne=="object"||typeof Ne=="function")?Ne:zt}function Dt(zt,Ne){if(typeof Ne!="function"&&Ne!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Ne);zt.prototype=Object.create(Ne&&Ne.prototype,{constructor:{value:zt,enumerable:!1,writable:!0,configurable:!0}}),Ne&&(Object.setPrototypeOf?Object.setPrototypeOf(zt,Ne):zt.__proto__=Ne)}var de=function(zt){Dt(Ne,zt);function Ne(ue){Ae(this,Ne);var qt=re(this,(Ne.__proto__||Object.getPrototypeOf(Ne)).call(this,ue));return qt.scrollListener=qt.scrollListener.bind(qt),qt.eventListenerOptions=qt.eventListenerOptions.bind(qt),qt.mousewheelListener=qt.mousewheelListener.bind(qt),qt}return pt(Ne,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var qt=this.getParentElement(this.scrollComponent);qt.scrollTop=qt.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var qt=!1,Qt={get passive(){qt=!0}};try{document.addEventListener("test",null,Qt),document.removeEventListener("test",null,Qt)}catch(Jt){}return qt}},{key:"eventListenerOptions",value:function(){var qt=this.props.useCapture;return this.isPassiveSupported()&&(qt={useCapture:this.props.useCapture,passive:!0}),qt}},{key:"setDefaultLoader",value:function(qt){this.defaultLoader=qt}},{key:"detachMousewheelListener",value:function(){var qt=window;this.props.useWindow===!1&&(qt=this.scrollComponent.parentNode),qt.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var qt=window;this.props.useWindow===!1&&(qt=this.getParentElement(this.scrollComponent)),qt.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),qt.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(qt){var Qt=this.props.getScrollParent&&this.props.getScrollParent();return Qt!=null?Qt:qt&&qt.parentNode}},{key:"filterProps",value:function(qt){return qt}},{key:"attachScrollListener",value:function(){var qt=this.getParentElement(this.scrollComponent);if(!(!this.props.hasMore||!qt)){var Qt=window;this.props.useWindow===!1&&(Qt=qt),Qt.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),Qt.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),Qt.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(qt){qt.deltaY===1&&!this.isPassiveSupported()&&qt.preventDefault()}},{key:"scrollListener",value:function(){var qt=this.scrollComponent,Qt=window,Jt=this.getParentElement(qt),Pe=void 0;if(this.props.useWindow){var je=document.documentElement||document.body.parentNode||document.body,De=Qt.pageYOffset!==void 0?Qt.pageYOffset:je.scrollTop;this.props.isReverse?Pe=De:Pe=this.calculateOffset(qt,De)}else this.props.isReverse?Pe=Jt.scrollTop:Pe=qt.scrollHeight-Jt.scrollTop-Jt.clientHeight;Pe<Number(this.props.threshold)&&qt&&qt.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=Jt.scrollHeight,this.beforeScrollTop=Jt.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(qt,Qt){return qt?this.calculateTopPosition(qt)+(qt.offsetHeight-Qt-window.innerHeight):0}},{key:"calculateTopPosition",value:function(qt){return qt?qt.offsetTop+this.calculateTopPosition(qt.offsetParent):0}},{key:"render",value:function(){var qt=this,Qt=this.filterProps(this.props),Jt=Qt.children,Pe=Qt.element,je=Qt.hasMore,De=Qt.initialLoad,Yt=Qt.isReverse,Vt=Qt.loader,pe=Qt.loadMore,Xt=Qt.pageStart,Le=Qt.ref,Wt=Qt.threshold,Ce=Qt.useCapture,Te=Qt.useWindow,ne=Qt.getScrollParent,Re=$t(Qt,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);Re.ref=function(Ie){qt.scrollComponent=Ie,Le&&Le(Ie)};var ye=[Jt];return je&&(Vt?Yt?ye.unshift(Vt):ye.push(Vt):this.defaultLoader&&(Yt?ye.unshift(this.defaultLoader):ye.push(this.defaultLoader))),ce.default.createElement(Pe,Re,ye)}}]),Ne}(_t.Component);de.propTypes={children:Ut.default.node.isRequired,element:Ut.default.node,hasMore:Ut.default.bool,initialLoad:Ut.default.bool,isReverse:Ut.default.bool,loader:Ut.default.node,loadMore:Ut.default.func.isRequired,pageStart:Ut.default.number,ref:Ut.default.func,getScrollParent:Ut.default.func,threshold:Ut.default.number,useCapture:Ut.default.bool,useWindow:Ut.default.bool},de.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},ai.default=de,Li.exports=ai.default},26724:function(Li,ai,Mt){Li.exports=Mt(51581)},93314:function(Li){"use strict";Li.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=="},96908:function(Li){"use strict";Li.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKQAAAA8CAYAAADogBFvAAAAAXNSR0IArs4c6QAADzxJREFUeF7tnQl4VcUVx3/3JSEBARFEFllcQAMJuKDUD7FqtVbFtUqtS6ufS1soxaW1Si0KBaFVWy2ittqqdQ9xpYq4tLgVFWUThYQlJIEkkJXs63u333lzL+/mrfeF9/KSeM/35Xv3zZw5c+bM/83MOTN3ouGQY4EuZAGtC+niqOJYAAeQDgi6lAU0fUayHqCR5gJXEriS/T6TICkZNOMzIN/gFx7/8vvLiFxDtpfP4G2Xb5Ej6SaPKddav6mPtb5g9e/PF9nSvmTVlpD1S36Sr63WOj1ukD/d+PR+b1NpAekmj5Gve8Dd5lc2ivK4G2lzV4K7Eo/8eSrQ3ZW424rw6J/ST1utTb2jtkuhLAplwgDS7BDj09txdgFqgsjCbwVOKMCYAPH+IAzABIDf8qPYz+OygMus0+8HFQDmYDpaypj1mp+m/qKbgMoKQO+zxwIyCzhNPhOIQQFrAas/uK3l5dlt/SEY9bbn0ZsrS1obynfXNJQXFTeUbPugua5utQZrM7PZHgU2EsIaHJAJUcWp1JYFklKgVx/fX0oqpPSBgw6BASOh/xAlxgC+u6WJqh0bqdi2nrb66gI0sjQXL2W8xHpb9XUykwPITjZ43KuTpcnBw2HA4TBwFBw81Dt66+42aoq2U7FjAw0Ve8R52KxpLB6v86KWjTvuetmswAGkTUN1W7aDBsHIieiHjkVDlhpuavbkU7ThE9wtjQLMbTosyFzGc5pGoD/RyQ13ANnJBk9YdSm9YVg6+tB0NC2ZtqZ6dn/1P+rKirwqaRqrknVuSM9mZ8J0FD2CetmJ1MipO74WkPXn0VOg72CvY1ZRuJU9uRvQPW4ZLes0jdszlvG3+CoRWroDyERZPtH1Dk1HH56B5vHQWFvJzrUf42lrUaMlPJ4BMxOxtnQAmWhgJLL+3gPQR5+E1qsPDdXl5G9YjUdipIreGpzGFUOfpb4zVXQA2ZnW7op1paSiH30qWlIqdVWlFGz6Al1ipmqkXH0wnD0ym8bOUt0BZGdZuivXk9IH/ajJaK4Uasr3UJizUQX/Fb2WOZ7LtfniosefHEDG38bdo4bUvuijJqG5XFQU5VOSv22/3hr8NTObWzqjIQ4gO8PK3aWO3v3RR57gHR13blpHQ121FZTTM7N5Od5NcQAZbwt3N/mDjvDu8jQ11rHj6/XoskevqKxXMuOPfZHyeDbJAWQ8rdsdZct2zYjj0VJS2bu7gLLiXdZRMiszmx/Hs1kOIONp3e4qO60/+rBx6O5WdmzeRHOTz8lO0pg2fhkr4tU0B5Dxsmx3lytTd99B1FZVUZC31dqanMzxTNDmsz9gGcumOoCMpTV7kixXEvrwCV4HZ1vuZlqamqytu2VCNn+NR3MdQMbDqj1Epj5wBFqfgVSU7qWkWB3CENKgEhibme39jCklBpCysf/H3aohrY1w64CYNqrLCJOziRJg1hN+qqtjJklJQx88xrudmJuzBY+cVveBcmlmNr/qmODQpRIHyPuKlVYtjXBL/1i3K7HyDh4Gp94IU2+Ee0+A+pgPJJ3WPn3QEWgpvSkpKaaiosJabxsuJk7IYksslXEAGUtrmrIW5sHAkerb7UO6NSBJ6wcDhnvXkFu354HlDK8GKzOzOS+WJnQAGUtrmrIW5atXCHoCIDXwDDwSlyuJvIICGhran7OIdRjIAaQDyIgW0PsNRkvtR2l5OaXlAcuPmIaBuh4gp1wP/QYrI338ODRUBRpM0+Cc36p0OVT6nwd9PIcdAydcqr7nroL8NXDi5TBmKoyepPgL16n0dS+3dzgGjoaTjY0If7n+Wow+GdK/p1Jr9sC+Ihg1SX0X3Xob6+K3F0FLg0r/egUUbWovSRy8SdNh5PEw4jho2Ae71sOuDbDhVaWvP1nbWLIZvvo3TLwQvjtDvdQlaf+eB2Uxeuu1V2/oP4yGhnryCn3etqmWS+PmjGUsiYhsGwxdD5C/WwsjJirV7xkX3KjyPvZSY+poqoXbBvqaetzF8HPjDMAbc2HIWDjlp8FNsfldePIaH+iTU2FxIRxkyHvgu5D3afCyM5dDprF8emuBN4jM6TPDm/zZG+HTf/l4xpwG1z/nXaMFpYIv4fHpUGVEJEwmaxu/eBFyP4Br/t5exMPnwZb3bUDADouGPmiU9+3FnLxC3BZvW0rHMgzUswEpI5O8Q9LaDAVroHgzDE2H0SdB6kGqJyryYdFJ0GicbLnsfjjLOGn1yT/ghRmBPSajmgBXLg+Qwwd3j4WzboXTDV4J95jkPZxghH2e+xl89ozKEVDdlKVu8RAq/lqNikm91Eg++GiVXlsGD52tRr1ggCz+BgaPAXk/20oxBSTo/YagJfdiV8lequuMEd9SnwYxCQP1bECKwerK4ZELQUYbk2RbbNZbMOQYlbJyMSy/Wz3LdDjvG/XcWAN3Hg6t7XYp4IxZ8CNjmSCj7NJp7cEQyamRH8m8zT7H54WZ8MkTPhlyO4ZM+xcvUGkb3oDHLw8OSDP1m3fgw0ehtlSBWUb2ysL2eh3It7T+iMddVV1LUVnQMFZMwkA9H5CPXQqb3gzsChlVBBSyHm2uh7ljFHiFbn4Pjj1DPT/1U5Bp0Uq/XQ1HnKxSnrgC1r8aHSAvnAfn3aXKfPYsPHN9cKiYywIJrC+a5Ft/WqfsSDIOBITWsnJjRr/DaG1pIbewJKjUWISBejYgZTqeOzZ0l9zyPhxzusp/7BLY9JZ6FifjhhfUc85/YckPfDKsI6iMRnNGq3t+rBRphJyzBuQgrNBD34etHwTXcfLVcN3TKu/d++H136lnKyDlx3TXkcGdv1iB0ZTT7zDv0/aiMppaWoNKP9AwUM8G5Fdvwt8MjzuY+ab/Bc40dr+yfw2rDEdRRgMBlXSArAFl9KwyzgVaR7f3HoDX5gRKjgTIh6rV2lZow+uBSwJTojhX489R32QUltHYH5A7P4P7T4s19ILLk2k7JY3SqhpK99WFqvOAwkA9G5Af/R1emhW6s865HS5ZpPJXLYXsW328Fy+EH9yhvi+/B1YafH/YCoceqdLnZUBpu6NZKj0cICVgLvnRkoSCFk8OBOSXy+DJq6OV1jH+5F6Q1p/G5mZ2lAQJxxlSDyQMFHtATpgGR56iVNvyHmz7KLDxstcrXqpQUx3cdoiPJ5ZhnzUvwNPXhjb+tLth2lyV/86f4I3f+3jF8Zmfq+6SLNsB96TDUVPgNx8qHmnXg2cFlx0OkDIyPrhPrV2FJNbqe8MvtK4S3go2Zcv6Vta5nUGicp9B3vuBcooraXMHfxHxQMJAsQfkRQvg3DuVeazeq9Vgo06EOz9XKXu3wvwMX651fbXgeCgxPF5reQlgLzSCvuHikOJpSiwxFF3zBEy5TuU+exN8aqzXTP5fvgkZxvrxz2fC5CvhtJ+p3KevgzXPRw9IKWHd6w41yoYDmH8csrMAKTql9vWGqoqr6qisaw6pZUfDQLEH5Hd+Atc+qRRdmw3/vCpQaStPzn9gybk+nl+8BhMvUN+XXgCb3wksf+1T8J1rVHo4QMoux7xxwcMfElwXUJt7zg+cDnmr29clux+/MDxoGW0zzlVBc9lNmTMy9Nov0hpy1goY/31Vl3/Ix6rB8ZfACT9UKRJe+vw59ZxIQMq0nZJGbUMzBRVhL7XoUBgo9oCUoPMdxu6GBKQXTIByy4VaKWnwm4/VVpnQf5fAy7/2dcP0B+FMY90XbMo9fCLM+UJNpZEAKflfZqndGH8SZ0acGiEJSC82wjhWPokH3pvnA62ZJ/G+rJsDZZop1nWmePni7VvpuIvg56+oFNlynJ8JzX5OgswCd63zbUH+5Xuw/ePEA1KWGvIOt9vNlr21eDyhz3p2JAwUe0CKyWavhHRjfVVXoUAni38x8ik/geHGFC33yMgIZu2wcWfDr972dZ/slnz+PNTuhaNPhUvuVd6vSeFGSPGQBbjrXoH3/gxl22BIOpz0I593LXIevQi+ttRpBc/5c+ECI2hupt8rMcGvQgPSGk6SsFHO+2rPXLxyk2a8DrLeFirdrtaHEryXy0ZlmTD5Kt9uzTcrVXDfpESOkKKD7G3rOruqmqhuCv9qjcvF+RlZhDBuoAnjA0iJ1ckoaR4wCNV1794HrxsBYivPze/CsWcGLyUgWz5XAVMoHCAFiEInXhZcloBkxQKQvehQJFP6wh2+Lb78L+C+KaH5JUeWE7Ks8KdZaeqqZaFDRsCMN3z79qEk7t4IMjo21XQdQLpSvP8QoKaxlcJ9odeRorCmsSVjHBPtvhQWH0CKJtKRVz3mO4BgNXhFgQrHyC8/GMmhUNlTPvWG9rnVJarcphX2DleIByrOxxVL1Mhsxv5EqkyVWbNh4/Lw4JLc2e/4TvbI3raM2pFo6k1wxkwYPNa3z2wFpJSXeOf5v1d751bdJE/WqfJDkeWBf+A90SOkTNtJvdA9bWwpa8ET4RWNaMJA8QOk2WF9DlEHGmS6FhDszVX7rXao76EwdJy6yF2OjJXLieUIFKqzpPMlHCWjdsFadWTMDglQFhVAnwFqi/HOEYHrPTtywvFIBx96FAzPVODbk6PW3XbCQQdad0fLiz11D7urW9nXHP4eqmjCQPEHZEcb3NFysR49JMxz5SNKm9VPgZzYcQjE4ZOzKy1u8qtt3Jmv8fCEZcyOZDoHkJEsNHcjDBuvuO6bCvlG/DRSuW9Dvly74tHZUumOOG3LUWo7L4U5gAwHHHGsxMESkvOKC40DEd8GsEXRxqI6D1VNka+P1ODtzGzOD7t66XGX3sdyypaguATHhbJvg1UPR9FN3x7WxjbYsc/ezSqRwkA9b4QclqE8aiEJeH/5UseQITs5F81X/+tQSPa6g73f0zHpPaqUhMa3VrppDRMkNxscKQzU8wDZo7q6+zSmtFGntN6GcwOECwM5gOw+fd6lNW31QG6lADLytTHhwkAOILt0N3cv5XZWe6gXZNqhEGEgB5B2jOfw2LLAvmad3bX2pu1QYSAHkLZM7TDZsYD4NDn2YpJeccHCQA4g7Vja4bFtgeJ6D5WNNqdtcXD8TgM5gLRtaofRjgWa3LC9yl5M0jtK+p0GcgBpx8oOT1QWyKt209Aa2ds2hbpczM7Iwrvr4AAyKlM7zHYsEKVz0+5uIAeQdizs8Ni2gIyL8icxSbeNnZv9go0wkANI26Z2GKOxwJ56D+VRODdmGMgBZDRWdnhtW6C6WWeX/Zjk/jDQ/wHkSLPJ/mcrgQAAAABJRU5ErkJggg=="},57177:function(Li){"use strict";Li.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANQAAAA8CAYAAAAeyZT3AAAAAXNSR0IArs4c6QAAEpJJREFUeF7tXQeYFdUV/mcbS1F6UUEsoLC7IGKNJWpERbEgSoxGo7HEQFDRWCAGgdASNBbEhglqsC1rAxVBNGg0qNgLsJRddmFhe3vby3uT7393ZmfeezOv7M57W3LP9/EtM3Pn3DPn3n/uvf85c58CKdID0gOOeUBxTJNUJD0gPQAJKNkJpAcc9EALoNRpCaqt3rh4QIkDvH/jxV/zuZZjrVy8uRzvSzDdrx3HxWnnEnz1eevhOf/79HpNdrAs6wrQr9VvtiMc+/kc0HSan9Nrq8Uzt9hquuZjv8kPev26r8x16X5VPYDHDYT7Vy/L8vo94d7P8u5mcV+w+1U34GEZ7a+5Tg/vV31tbrmu36ff23JcB9VdBo9a5v2rekq14/1wN30GNXGzctPKKgf7eExVKUGBpJsSEkgWYPMHXEuH0sHlB5iW8jrAtE6sd9AW8GidVD9mR/fvxDrAzJ3Yp/ObAGL3srC1XweJnf0awHUQWgGJ52i3P+D9OyOP/QHSAjYT8Lwd3gRGH3Bp5dza34D7LUDsD04vmPzuN9cZGkSAF3xm4JttNoFWdasNlRVNta4SV21l6YHakvyPGurrNivA12kZ2B1TdLSisvAA1QrF8hbpAUsP8EWVkAwkdgMSugHxiUB8EpDcC+g1AOjeG+BciSBWPXA3NaA8Pxel+7LRXF+bCwXpShxeTX0V33ZED0tAdcRW+X+2iaN3j35Ar/7iX/e+XnCpbg9cZfkozctBrauci/9tioIlKSpeUTLg7iguk4DqKC0h7bD2QPJBQP/hUHsNhsIVv+qBq7QI+7O2w93USGDtUoEFaavxoqJ4x7Z2FQmodnW/rDxsD3Ba2PcwqL0PhaLEobmxAXnZmaiuKPOqUBRsSlBx06gM7AlbZxQKSkBFwalSZRQ9kJAEDD4GSD7Yyz6WFu5HQV4uVI+Ho1W1ouCe1NV4OooWBFUtAdVenpf1ts0DfQ6F2mcoOMurq6nCnp2Z8DAMwNEKWJEKTG+PtZUEVNuaVd7dnh5I6gF1wFFQEpJQW+1CTtYueBgeEPLuwGRcNWQVamJpogRULL0t63LeA/GJUAeNhBKXgOpqF3Kzs6Ey3iVGqs29gQnDMlDnfMXWGiWgYuVpWU/0PBCfBHXQ0VCUeLgqK7B3b67I4BDyZloKrlTmQ6AsyiIBFWUHS/Ux8kBCMtT+w70MYGlJMfILCloqVoDH0jIwMxaWSEDFwsuyjth4IKk71D7DGKzCnj05qK0zZnoKMDUtA69F2xAJqGh7WOqPrQeYvtSjL+rr65C1JxeqMfUrTkpAyrGvoCSaBklARdO7UnfsPaAAat/DocTFo7C4FMWlIvBLUYD0tAz8KppGSUBF07tSd/t4ILE71N5DoHrcyMrJQ0NjY4sd8QompazGumgZJgEVLc9Kve3rgZ79gW49UVVdg9wDhWZbMtNSMEaZDxEFdlgkoBx2qFTXQTygxHnz/gAPdu3NR2Njk9mwmWMy8Fg0LJWAioZXpU7DA/0OB479hTguyQZ2/Sdm3lF79IWS2B2llVXILylvqVcBuLAamZbh/euotA+geg0E/ponHqSpDrizj6MP1WGU8WM671eq7fhVweTFwIQ/Cpe8PRfY8NfYuue4y4BbNbb6y1eA534Tu/rjEqEeNAAejxs7cgvg4VfGmijA8rQM3Oa0Me0HqKUHxLM01gEzD3b6udpXX+9DgNNvBs64GVh0PFDj+Isw/Oe7fAlw3t2i/NoHgPVLwr/XiZLtCShGpHr29zJ++aWVKHX5pPU1Iw5jx6RjuxOP2QLUsPaUcLJG6uII1ZUBtTAb6McAI4B7BktAtdcIRf/zM/vkg9HY3IydeQxBGbMFBVifloELnezecoRy0pu6rsU5QJ/DJKDogXYeoWiCp2c/7mWF7MJy1Nb7kBNwmkaXgJKAioYHDJ0dAFBqt55Q4ruhyFWDooqArzkcpdE7HqBOuxE4aKBokE9WALUGO9PSStxc4Px7xWFzI/DhI0YDDjoGOP5ycbxjE5CzBRh/JTDiDGD4CaL83m/E+W9e8yUM+g0HTtIC6f56/bvd8JOAURp75SoAKvYDh58gStG27tq68L3FQGOtOP/TOmD/j76aOP09YSowbBww9DigtgLY9y2w7zvguzeEvf5ifsb8bcAPbwNjLwF+Pg3oPQTgubfnAcW7ASfXUAOOBH52PTB0nKiHn6UXZwFFu4DPVwEFFssRK0BRz7gpwn/0U+7XQM6XwFfpYrsxpyUhEUjqhdqGJmQXVgRoj1NwR+pqLHOi2o4HqD99DQwdK55t7mjRKfyF++4t1xIf66uAu/oZJcwNuGYOMHgkcKoNs7TtfWDltQZoOd9eshfoqel76OdA9mfWfp6+FkjTpt/vLhA79Jw1PXibrLoZ+OwFo8yIM4EbXwT6MF5iIblfASumAuUaI6oX8e+kOz4Crn3GV8HjFwLbP3AOUJfMBybO9m7eYCnuJmDjQ4L4MIu/rR8+Bty2zvCxuezuT4AVVwHVxU70bR8dao8+XsY1c38F3Ca2j4WcpNG7NqA4MiT1AJoagNwtwIFtwJBRwPATvVF0r5TmAItPBOoqxfEVDwLnapn+n/4DeHlaYONyVCHw4hPErqoPjATOvRM4Syvr3RVWE2/jaQvhF38HfP4vcYEd7ZZ0sWsu5cBPYlTiW58j6cCjxfmqYuDRCWLU0cXcSQ9sBQaOEPvcmcVJQF08F7joz4b2sr3iRcOX2eHjxT9dVl4HfPWqta0cnRmX4r58WZ8CRbsD24Mvj8UnOE7kqN16eT/t2FdWjcrawFHfKRq9awOKzVpdAjxxCcC3vS79jwBmvCs2+6CQStbfrJxOzdsqzte5gFmHAU31vp317BnAL7VpJke55ZN8r4ciJQjyedsM4uLl6cCnzxo6uDcdp42XLRDnvlsDrLjSupPqZ7duAD5+EqgqEmBkh2fHb+uUjy+eJXliI0rK6/f6TrF5ji+TK5aK65wCzh1lbyvb48nJQM4XRpkBRwHT3gIOGS3Obfw78OYsX5+29YgvnLgklNc0YH+FNgX31ekIjd71AfXU5cCP7wQ2B9/q7NScwjTUAHNGCPBR7tgIHHu2+D8DkQxImuXezcARJ4kzz14FfPuG7/VQgLpkHnDh/eIerj3+daN1d9GnlQwM862tr7/MI1QoHW0FFNdLE+8ToQ6uFTlFtpJFe4C+Q8WVmb2NdaO/rS/cCHyxyro95m4Ve9ozNsn24MvBKeHW10nd0dTsxo5C663TnaDRuzagOJ2bM9K+SWZ+ABxzlrj+1GTgx3fF/0kS3PSy+H/mv4FlFxg6zCMYG3z28MCFdChAzd4CDDte6Hz0PGDnR9Y2nvxr4IbnxbX3HwTe+pP4v7mT8mVw/5HW5A3LthVQ4XboO94Hjj1HlF403hr8ZfsEULQ9HwJUz1gHpJwnTj89RZAtTgpHW9WD3cU1qG+y/iK+rTR61wbUD+8AT2uMn1XDTH0YOEfLPsn4I7BJI3q43zZBcdAgsUZiJyjfJzSYRxcuwt+cHag5FKAerRRrO8p3bwVOKXWNJEdSzhdHHAU5GvoDas/nwINn2nc7JwHF2NrxUwCydP2PFEQMiRzulcdjfV1Ke2iXv61b14vpt52Y169v3Ad88LCTcBJ2KvEoqmpAUbUFeypqaxON3rUB9Z9ngFdn2DfK+fcAzHWjbFoOZNxplL1sIXDBfeJ47VxgvVbuLztFh6LMSwWKdgbqDwYodkpej1RIpS85ObCTfrUaWPnr6AKKDNlVy4DxUwURE0rsABWqPZhzOEXLNfz4KSD99lA1RXbd+1NCiahrdCOrzH4jpLbQ6M4Daswk4MhTxYNu32idXcxcN7JklPpq4K6+hmOcpM23vAw8f7290yc9AEyaI65v+BuwxsRkkbiYv0PM6fWF9lGnAXd/LMoza/qRc611BwMUR6ZHKgz6mbE2uymQWTsZNaspX6iE07aOUInJwO0bgKNPM9qL8bHCXUBVoRhdmxuAibOMaawdoL54EXjht/btYR791y0E3pkfGWBClSbjH0c21IPM4no0e6yTlttCozsPqEsXCOdSzOyZ+WFJs87SWJ7CncD8VOOqeX2xYByQrzFu5vsZgF2oxaeCxaHIdDGWZCfXPgucdoO4uuoW4DNtvaKX/8M7QKq2fvr7OcDJVwNn/k5cff4GYMtLkQOKd5hz/exGuWCdI5Lsg7YCimzj5EXCmrzvBYXP4LO/zPrcCGzbASrYS4j6rvuHCBxT7MiLUKAJdZ3Teag44GpCWZ39j3a0lkZ3HlCnXAdcv1I81tcZwD+vCXxEc5nMD4FlE40yv38TGHuxOF5+MbBtQ+D91z8HnKKxTcEAxSyDeaMFfewvDA4TlHrO3UNnAdmbfUsx++D3GoPH0S51oghIskPNHma/9gm1hjIvvv0pc7MF4yaLNQuF9Dzf8JRYAop0NmcdlGeuBL5fE+hL/qbT0gJjOmgHKLbHn48CXD5f0Ap9bA/67eDB4njp6SKbxWnRfjmzqr4ZuZVBszJaRaM7DygGTe/TsgsYUF0wBigx/SACpxB3fyJSbSj/Xga8pn2vw+OpjwDnaOseqynbYWOB2V+KqRglGKB4neksVlQvyQiSEhQGVJdoNLi5ARkPWpRtgE6/xnhP+h32TW1eZ5FlJNtoluMuBW59XZxhytL8NKCh2rcMR+H7vzFSmB7+BcBMAkosAWWegvPlyJekv5hBx2t2gOK1/64EXro1UMeEu4ApfxPnmYa0VJti2nu59Vfi4r27y24vaYYnyLdqraHRnQcUH/P29cAobX1RXSpAw8U7O8mp1wGHalM8bu7OEcTc4UZPAG57z3AWsxW+eEnM148+XUw/yL7pEgxQZOgIvG9eF8HC4l3A4FHAib802D3qefJS4CdTneamumgOcLFfOs0ixoR+sG9QMx1P2j3zA5EzSFZQF3MnZMYA10cMPvOzbU4zT77GyJbwZ8daCyjq58sjHPlhrfDJb1aKNqMU7gBemgZk/VdkeHCtfPliY82s6w0GKJYhkULSgdN5Zq4wTKGzrbzOGQtnLtES9gmPB/uqPKhsCL6hbFwcLkpNh03nCDQwOoBirIajlJ4gaueY95cCb2kBTnMZc0zD/16CZO0cY14fDFAEEmX8FdYWsJOvWwAwF89OOCVcmGWkCIXz9uR0lNNSf5mRLH6rlsIg6LQ1Rt6iXf1ct3B0qncZJVoLqEg6qM5sWrUlM0hIruiM386PBdj09aUdoLZtFOSGTq8HtK1bZKywX0RVvL/cBlejir2u4D9+qCjYnjoaY8Pd1CU6gKIz2BGvecpIIDU7qDRX0Nl881oJf7WOMYnTb/K9Wpkv7vtxXXjJsWTASB6Q8uVbVo/9UCunWqRlv18buunIcumZ5czt46gZSs64BTh7OjBwpJFnZwYU7+cCmTlyzB0028ZrXKcR6Jxe+mdgxxJQtOWIU4CrHzdYPP3Z2Y7fvi5GV+b7MXmWYgcopi0xiM2g+aARvh7kfhP0LUf0GAk5vu2l7qDTPpoSCY0ePUDpTunRVwzrnO6xE/NNFm5KCXcBHTJaLFT5yQWdHkrsOhs7L6co+ucCTKMJR9jRF+cCjMUwK2HW0MD1Tjh6gpVh+hPz2Q5NE+ApyBTrznDo9LbWHe79tHFIigACaXJOH/VUrXB1mMuxTbne1j+nqSltjZY235NX5UFFiGlfJDR69AHV5keOUEEkb+9wVHMac/UTouTm5wBmjEvpMh6oblKRUxnGb14reHzMaoSMNEtAheoac74HDkkRpZae4ZslHepeeb3De4DL6O1load9/JQ1nE1dJKCCNTmTPUmQUPi90kItobXDdxNpYCQe2F/tQXl96J+PUoD30jJwUdDZe7vsehTJ00Za1skpH4O6DO5SMu4CNj0eqTWyfCfwQF0zkFUR3qf3oWj0rjdCHZJqxE0YczF/PRpJ4zJyf+l8b3ayV5jrZ7W/RSQ6ZdkO6QGyfTvL3Giyye0zGx2KRu96gOqQTSaN6ugeKKpTUVQTBjkRgkaXgOroLS3ti4kH+L3hjjICKvS22cFodAmomDSXrKQzeGBPpQc1Nl/yBthvQ6NLQHWGlpY2xsQDFQ0q8qrCm/bZ0egSUDFpKllJZ/AAOYnM8GJS3sexotEloDpDS0sbY+aBAzUelNWFjknpBvnT6BJQMWsqWVFn8EC9G9hdHl5MyjtK+WWjS0B1hlaWNsbUA9mVbtQ2hWb7TKPU7anp8Eb9JaBi2lSyss7ggQjJCZ+90SWgOkMLSxtj5gGOS/zHmJQ7jMyJFsM0Gl0CKmZNJSvqTB4oqPGgJAJyQqfRJaA6UytLW2PmgcoGFfvCj0m10Oj/A9jGm+feuyEMAAAAAElFTkSuQmCC"},81378:function(Li){"use strict";Li.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALAAAAA8CAYAAADGxTD9AAAAAXNSR0IArs4c6QAAFoFJREFUeF7tXQl4k1W6fv8sTbqvlJa2tJSy74ugsiMqq4AKIlDUueNwR2dGHR0XdLwixW3uuF6Xq3O9o15nxuUiIIsCsijK1pa20NJ937eke5tmmec7f/40TfInaUNK6+R7nj5Jk7Of93z/t55w8JBnBYbwCnBDeOyeoXtWAB4Ae0AwpFeA+1SWbbA1A07KQSID6JWT0ivAyThIpBwgBSQy4+fCq0T4jANnrEdlWFkpjK/0ndAetd/znpMaTO0LZcz74tsxti0xjqVXfeNYZcZyxvHSuK3GbDYX03iMbbLy5nOz+pzGbGDrwpfj52DQG2DQAwad8Gcwvudf9ToDQN/pDdBrDYBFWfqMry/UAytP9fjPjJ/rYVHf2L7Qph4GaA0tOj1UnBYqvd6gMugMKr0OKoOOq+UMhhQ5DGfHPRNWMaSRaxy8bQBzPGAZAI3AFMAoAIJtnBnA2WaagdlU39iOAKKeje85FKY2TYDkwWh+APi2ebD0AJ8HMn/AzAHFA4x9Jxwss7bN5yXUpbnwB4SvY3Nu9LmwLr36NIKWAEhA1BlMgOUBCAZYBtJe761Byx+A3vV54Av1efDrtUawm4G+N+D5MfUcHH5s7H890KnqNjRWNGkaqlXqhgp1VV1JwxkOSJUAqUB0xk4s0Q4FgIty4KEweM8Yba+ARCmBzBuQeksgVXKQKugVkAdIoRwhhU+EHJycg0GrNz01Whs6UJhegtLsCmi7tI0GYC8H7osYTPhuO2Z3D9a19gB4sO6Mm8flFSKBd4QcyuFS+MbKIfOWMM6v69KjIq8WhVlFaKpvAQeuFsCr/gh45wmsbXHzsPrcvAfAfV6yn18FjgN8YmUInKiAd4TMJObUlNQj42wWutq7SNtXA9zrIVC88nts7Bgsq+AB8GDZiUEyDrm/BAFj5PBLUAASniNnpeSgvLCSjZADl8dBev8ubD41GIbsAfBg2IVBOAaSnUNnK6GM5DlyQ5UKmSlZ6GjvJBiT5epdGRSP7MRGzbUcvgfA13L1h0DfPtFyBE9VMKuMVqNH2rl0NNapBG78vQ98b9+B2xuu1VQ8AL5WKz+E+pV6cQiaqoAyXAp9tx5pyZfQUNdoBDEKAG5VEhJzrsWUPAC+Fqs+RPsMnOgF3xg5dBod0i9eRmM9D2IAFYB03m5sKRnoqXkAPNArPsT7CxingE+UFDqdHpfSMtHYYJIecn2hnL8DG+sGcooeAA/kav9M+gpIkEMZJYdBq0PqxXS0NDcLMvEFKRTzB1Kx8wD4ZwKqgZ6G/2g5vCPlaGttR+rFZMaRiSSQvLILW58YqPF4ADxQK/1z64cDs05IlByqqiqRX5gvKHV6gLspCYknB2LKHgAPxCr/TPuQ+XAImOQFzsDh0pVLUDcJ5jWUSaGcuBMbW9099WsOYDKYU8Qbi5zqshnZ6e41uGrtSxScU3NQhErR1UBhae4hstkaBiiWzDtSykSJri4NLmYmQ6s1dfz6bmx7xD0z7Gn1mgN4bX48CyapP9eBI/NLXZ5v3JYAzHlnOGvnyMJSqNO7TG36xMjYe41KB22r+GGR+nC48aNIVrb4780o2+OYkYTOVWLRnijk/JcKee+qoVHzMqE5zXlvOGLW+0MRIsXBGUVouuweJ9bys7HwjpJBldaJk2vcH/brP9aLRb1V11aisLzAKEpwWimks3Zic4bLm2qngUED4K5GHWpOttuda+U3bSj83ya7ZeLvCcD1f+HBd3hOMVQXeQDL/DhsVI1l71MerUXOm/zjzhYRV1lfmsC+Sn28FtmviZcV6t/wUSRGbQ5g/575RRWKPuE1c3Ma8+sgXPcmf7gynqvH5d3OO7DkARIowigzwDEtPxcLryApmrK7cGqtYwB31evQ3Wx94Bz3xJcgOThwrBd0Wj1Ssi6gW8sfTA44swuJ8zje9ewWGjQAdmZ2OW+rkPIwRfeJ09UAsH+CHGuuxLNOzj9Yjfz37R8axTAp1hWPBnmsOuu02BtXCL3Ges8IhOvLRkPmI0FjSie+ud55u//YB4Iw+w0e/Febkh+qQe47apea9Y2VQeYrQXlNGcpqeubFQfKrJGz9wKXG7VQeNADuqNKi6FNrrmU+9rqfOlDxtf3HudMAfkuFmPV+iN0QgMyXG6BK6xE1gqYpsDI5jnX9071VKHYwrklPhWDa88NY+csvNiDj2XrRJZ/7fgRG3xfIvv8qrgAdFc4Jq4MdwHQoCcQkA6fmXIBOz8v4HNAog2zcc9gsviguoNutAKZHsdRHYnd4y76LgU+UHKr0TvxwFx+y54iIu7WX9Ww8SwGS8/mp8YkBmPNuBHv/7fwSHph6A0jBshQhVqbGIWiKAgUfqnFue42p22HzvHHzyZHs/+83VKB8r/ihoRQjkuMp6IVShvYlFGLyjlCEzVXanIZXiJS5Y4laizSij+78/2lisrRA8kAJCz53RKO2BLL+ic5tr0btaftiGZXrrNGhu6n/IoQwJt+RMrbOJTVFqG4030vJX3dj632Oxt6f790K4CWHohF5s29/xmW3DoH98Oyex9TY3wRh9mvij1f15S4cWVBiBWCBW2vb9fhqZIFpEyNv9sGSQzFsDCdWlqHqqDgIiIsv+DyKlS39/xac3lSJpd9EI+Im1+Z9+YUGZPyHbaYVMlOB0DneNtdo5J3+GL7Ih31HcraYtYPmXPSx/SdeXzeORAifETJ0dnYivTgFBoMgRpEMLF24G5tP97VNR+WHJIBL97TgtBm37i+AJV4c1hbEsywEc8XOHJRHl5Si7rTtBASZLwfi4n7xXmydT60rR8XBNkx/IQwhM3s4cMgsJVOqCDT1Z5xLZij6W7MowMxFFkcbLPZ9R7UWX8XwFoOrSd4jOUilMuRWZkHdZq78cpdliJ5xtZNFBwTAxAW+u7nMap1uOhbDTEo1p9qR8oh95Ywe9YJp68fESpT8oyc9K+x6JUas8GPtB09TIGoV/55Eg45qHTprtSj8qMmmFWLKs6GY8scwNOdqcGBSEas3KjEAN3xotGRcV9xLPjafBJnFEv4tyPTRsZtKUfu9NUBJTApf6NOrD1dAYw7gikOt0Hc7r+SHTFcys6W7AOwVLIFXoBQ16iqU1BdaTvOJ3dj2iitzt6w7IADuqNHiq2jr0357xWgow2UoP9CK8/9eDZ8YOXxjZPAZaXyNkcN7uBRHF5dh7gcRGH1vIHQaA/ZE5ovKjk4rcUYzmt9oOW7L5i0Ox28tQ/Xxdkz+YyimPhvGPvsyPA8albV8GLXaF4u+iu61nqIAPhGD8Pk+aM7R4MBk/pC4QuYA3juqAJo+yK/XvRUOkpPdBWB6qpHuo9F0I73sgsU0uTYZFOShc93gb2x5wAD89YQiDLteyUBKDgVSZGI3+bOUb0e0L6EAEx8PRfQaP6gyOnFytbhts68Apr5vOT0SYXO9Uba3BT9sqMSNn0QiblMAOuu12BNpffDIbLYqLY4dPnMSA/CKlFgET1UyRdVcdnc0b7HvB7MIQWP2jiJlk8OVqgy0a6wU4H27sW1df+d+zTjwiRXlTF60R6TFd1Rq0VbSjbYyLdpLu9FW2s2UoxG3+qK1RIumzC67GnN/AEwmqmlJw5D3ngppO+pBjgCSYet+bGfc35IW7olih4mIQK4M44EsBuC1hfHswDYkd+LECuv2zNunC0wcORXMAaxR060nzsNB6ith9mp3cWAaiVewFBQnUaEqRVVzudXgOEjWJGHrAedHLV5ywDjw/rGFWF86Gu2lWrSV8cCM3xbIjPoElB+3VjHw0gbaIsHlXPyPZvyUWCU6I0sAtxV3Y/QvApH332pRTxx56TgJZwLOBtUYyP0kKPhrE87dX92rL6k3hzvrEtiTgwBZ+HGTybsmBuCN6jHMyO8M0eElU5w9MgfwF2F5fTKBCXZodwKY3MoE4rauVmTX2vQkF4dCOfFqpOcPGIBtycArLsQieLoS3a16ZL/WaFOWkyo4hN3gjejVPMdLe7oOWa+YUlms9tkcwAR2Uuh0HXrsH1folCuZYgjWF4/m+9pRh6w/Wfe1+EAUgiYp8M0NJezJILiubQGYAmvu7hjnDHZZmeY8DQ5MtC8nmwOY5Gq6b81Z8o6UMYuIOwFM3gvv4TLGjDJqkqHVWcd8SICXdmHbU86OW6zcNQWwI/OX5aAJ6IdnFqO1yPZNR8RJJz8dhomPhfSqShz/4NQipwAcscwHSw/zNuDv76hA+X5rJwYFDJFtmQKFzA+MLQCbx1VUHmlD9bE2m3sx/qFg5tBRZ3bh0PRipzlwfwHgVgADkAdL2F1zZc1FqG/v/RQzjrmbg9e0JGy60t85UD23AniZUfsmj9P+sdZchTRWAgxxMb943jtli7Tt5HnrRsnnLWg4T/cS9KaEXwZi5EZ/pulLjB45KkHyYe7bauS8pWIXdDgTzDPrtXCM+00w62BPTD46q+2HPToCcNQqXyzay1srLM1/5rNYkRyL4GlKNKZ24pu59mMkzDnwoZnF0DQ5H5o546VhzH3ubgBLlRLI/Tk0dzQjX51pc185cCeTkLhk0AL4ttxR8BvlxdyZx5bwygu5Q8l1KRDJpxTk0pKnYU4Aoti7/EEu1/Zyba/YB3Kn2nJ5Lvh8BAtTtKRvbyxBwwUe8M5Go60rjudd2xmdODzLcbCNIwBPfT4Mk5/iXbv2QihXpsUxsaTuTAeOLrRvZTIHcOmXLcy06CyRJYgcL+4GMF1XJQ+RsvvWLjcmQ0fXadogCbh7diHxY2fHb1nOrRz4rtYxTNkp+byZhQ7OejUc4Yt9cHBKEVryeDFAUM7MvWurMuIQOEGB6hNtOH4Lr8WS6eq23HhUHm5F+tP1vcSIcb8NwqQdoaDNNHQD437Lc1BnwinZ3b7G8xS+0BvLvuNjILLfaETqY44TbB0BeOmRaEQs8WXOhs8CckUDzVdfHoWAcV6oOtYGstjYo8FuRhPGToyJ4lRKW4rQ2NUTa2I+N7o8UAq/cTuxvl/hcG4DMGUd3FHNx9ReebWRKV7ktiVtPPcdFZIf4j1vzgJ4WlIYJj0RCl0nKWRFzGIhELl0dZ383bt9MaORy3j6i8NwfHk5yFohgI3abS3U4OCMYuja7XM3ewCmw3Fn3RjQfWP15ztwZJ44Z70tLx5+cXKTLdpZAP90TxW0rc4H4ox9MAgRS33dzoFp/BTYQ0p4i6YZha1Z9qb03m5s+3V/uLDbAEw3uaxM4e2+KY/VIucNFWb+aRjGPxzCrA57YwuY2coZAFMg9205o9j9tln/2Yi0p8Q5oxiAzZUpciuTB45kZqLkR2qgvtSFZcd47isQZVc4cnHbA/DIDf6Y/7cRrDlH1hMyMZKFoOj/mnDmvt5KD3FmWk+BYtb5IXYjHzx/9pdVIB3BWRqzPYgF+5B+cP6BHq6ozuhinsKrSSRGyPwl7B7izJZU6ETynDhAL4X0hp3Ycr6v/bsNwObKy+m7K9njnUxUxIVJO039Qy2yX1c5BeDrP4xAfGIgU1b2jym06doVJi4GYOK0ltYJqlN9vA2Xkhow+9VwZtKjCKqa4+0smozeH1taJhrMQ/XtAfjmUyMx7EY+auzriYUmscnWJt1Zn8BiCLLfVCH10d5xIRMeDcaMl8L7urd9Kn/xyVpc+bPjzJM+NUpc2FsCCQeUdRRA1S3OeDjg4lQor9uIjc5rpO60Qlz39nCM+RUf6GKuTC3aH4WoFX4sFpZEgbV5fE6cmAx8OanBJJemP1uHzBfFbcCWgBJkYP8xcqzJ4uMdiAiYFBif+VIjU/JINhfk5rz31YzDr8kZxTxsZJc9NKNYNFlTDMAhsxRYfpZ/AjnjQt7UOZYd7LRn6pD1cu85DmUAc3L6SQgJ2rXNKOiwK0ZQbu9Du7Dtzb4cErdwYDLe316eAJKDyQa7L77HsxS9zg8Lv4hC7Q/tOL25EreejrULYJKdKZWGLBDkzeuLTGquxJFiSMmHJZ+1IOvlBjRl8Y9LYTz0XrAXU8KneQaEvYMjBmDzWGjhCSS2MaSg3lHJ6wskEhR+ZB2nS8qQJUUs8wVF01Ecx8Wn6pD9qu3DPeU53hJCQVXkkcx/X42uut6MTswD2hcwiZUlzxz9NkduZxq6DeJiCgeu2RsY/zTsuFotOnELgEes9MXifbzt0zLFhsBNFgaSOYmckYFJGfIf44XmbMcy2vTdYSzwh+jgtCITUClIvTmvmylrAo1Y7osFX45glhLiyidXlZuC16nPVem8ZYBk9q8nFNq0CdsCsLmVwBnuO/EPIZj+Ap+SRFkkDeesbd3CmAkMI1b4ghwfw+bxMjwRJcSeWF1u/aTggDlvDwc5X8htT0Q28eK/tzD7OMm+7ibBNl+tKUO9zn7WDQd8loRtm5wdk1sALERz0SBI9qOYh/GP8KYtSxKi0djPTxnjWsnBwXEcA5Wt5Ehq48y91UyuJgpf5I15n4xgSiEBjoiSK/dEFYgGukTe4ouFe3rAe+GBGuT/pXfyprkcbysugvqxBDB9tvRIDBMHaPxkEqv+js/oGLbAGzNfCYeuXQ9dFz9fUlDDjNkVFAdB4ZZkUbEkGi/FKUet9mNxGgK1FGhw8ck6u2lPVJZMWgRicvpQZJwJ+KfaWYZ2OeUaOq8LOosvVo7iTCgxuVuvQW53msO6UnC3PI/Eow4LuksGnvnncIz/XTDqz3bgyIJSZqqypUA5M0CxMj9urWTiABFpuhvqE/iFMpKjDGaSUZedGMnuM7jwYA3yP7CdeXzT0RgMX+xjU7myBWAy7y0+EA3/0V649Hw9Lu3qSZ2nQKA7ahLYD6pYEkXiHVtSivqztrmv5RqSKzv/AzX70/fxN4ToYFL0XdBk3rJBThvy/rnzMhT62TNyahTpMtFhsO1OF9aEfsYgHKFTfoeVDh8PbuHANJCJj4ewC0QIGOQgEMvh6i+IKw609hIpxv8+mAWp0O0+ZftanLo0hOKRyUYrBl4aG5mvKOWo6ojtRY+72x+z3+Lz8egOhrofOxhXpUd8+h+tc9oS7g9EAF0EYvwJLNJc6n/qQOW3bb0SVS3XhTyYK5LjUL6vlUXJNSaLixlOrSnHZ55MeSaU5fE1pjrEilPNOiqkMtSiSmc/1oNxbXDPJSFxp6P23AZgRx17vu/HCtAD5mo/5t3Rpp2p6aFHji4VBgdaIwd0SsFN2YlE/tZAEfIAuB848lRxbQUq9Plo0ts3hxp7+HY3ti33ANi19fbUvsor0GFoRZHOvk1Y6FIC7q5dSPzcw4Gv8iZ4mnNtBQp0l9BlcHzFAAeu0h8B48V+JdQjQri2D57a/VyBBkMNanSOw1WNCt0bSUh82FZXHgD3cwM81VxbAT10yNWlQm+6vceupKuTQTJ7J7ZYGZE9AHZtHzy1XViBSn0B1Hpnr5jlziZh642WV7V6AOzCBniqurYCnWhDodZ2upGtliXA9l3Y9r75dx4Au7YHntourkChLhOdDjxzPV1wKl8oxpn/Fp0HwC5ugKe6ayvQbGhAuc75SwY5cB8lIfFeoVcPgF1bf09tl1fAgDxdut0wS+supIt2Y8v3zELxqSz7ajsnXZ6Sp4F/rRVoMFShRmf/yq3eK8JljcSE6dsxu9sD4H8trAzK2eqgQ54uDXohPdyJUXLgnkxC4sseADuxWJ4i7l+Ban0JGvW2U+9t9c4B7QZIJ3oA7P698fTgxAo0GepRobN/qaFlMxy4/f8E90wA8RE2tUgAAAAASUVORK5CYII="},16722:function(Li,ai,Mt){"use strict";Mt.d(ai,{Z:function(){return Ae}});const pt=re=>typeof re=="object"&&re!=null&&re.nodeType===1,_t=(re,Dt)=>(!Dt||re!=="hidden")&&re!=="visible"&&re!=="clip",ce=(re,Dt)=>{if(re.clientHeight<re.scrollHeight||re.clientWidth<re.scrollWidth){const de=getComputedStyle(re,null);return _t(de.overflowY,Dt)||_t(de.overflowX,Dt)||(zt=>{const Ne=(ue=>{if(!ue.ownerDocument||!ue.ownerDocument.defaultView)return null;try{return ue.ownerDocument.defaultView.frameElement}catch(qt){return null}})(zt);return!!Ne&&(Ne.clientHeight<zt.scrollHeight||Ne.clientWidth<zt.scrollWidth)})(re)}return!1},me=(re,Dt,de,zt,Ne,ue,qt,Qt)=>ue<re&&qt>Dt||ue>re&&qt<Dt?0:ue<=re&&Qt<=de||qt>=Dt&&Qt>=de?ue-re-zt:qt>Dt&&Qt<de||ue<re&&Qt>de?qt-Dt+Ne:0,Ut=re=>{const Dt=re.parentElement;return Dt==null?re.getRootNode().host||null:Dt},fe=(re,Dt)=>{var de,zt,Ne,ue;if(typeof document=="undefined")return[];const{scrollMode:qt,block:Qt,inline:Jt,boundary:Pe,skipOverflowHiddenElements:je}=Dt,De=typeof Pe=="function"?Pe:Ye=>Ye!==Pe;if(!pt(re))throw new TypeError("Invalid target");const Yt=document.scrollingElement||document.documentElement,Vt=[];let pe=re;for(;pt(pe)&&De(pe);){if(pe=Ut(pe),pe===Yt){Vt.push(pe);break}pe!=null&&pe===document.body&&ce(pe)&&!ce(document.documentElement)||pe!=null&&ce(pe,je)&&Vt.push(pe)}const Xt=(zt=(de=window.visualViewport)==null?void 0:de.width)!=null?zt:innerWidth,Le=(ue=(Ne=window.visualViewport)==null?void 0:Ne.height)!=null?ue:innerHeight,{scrollX:Wt,scrollY:Ce}=window,{height:Te,width:ne,top:Re,right:ye,bottom:Ie,left:Ai}=re.getBoundingClientRect(),{top:yi,right:gi,bottom:oi,left:Bt}=(Ye=>{const oe=window.getComputedStyle(Ye);return{top:parseFloat(oe.scrollMarginTop)||0,right:parseFloat(oe.scrollMarginRight)||0,bottom:parseFloat(oe.scrollMarginBottom)||0,left:parseFloat(oe.scrollMarginLeft)||0}})(re);let bt=Qt==="start"||Qt==="nearest"?Re-yi:Qt==="end"?Ie+oi:Re+Te/2-yi+oi,ge=Jt==="center"?Ai+ne/2-Bt+gi:Jt==="end"?ye+gi:Ai-Bt;const Ge=[];for(let Ye=0;Ye<Vt.length;Ye++){const oe=Vt[Ye],{height:Ve,width:Ze,top:Ni,right:Se,bottom:ie,left:ee}=oe.getBoundingClientRect();if(qt==="if-needed"&&Re>=0&&Ai>=0&&Ie<=Le&&ye<=Xt&&(oe===Yt&&!ce(oe)||Re>=Ni&&Ie<=ie&&Ai>=ee&&ye<=Se))return Ge;const ve=getComputedStyle(oe),ti=parseInt(ve.borderLeftWidth,10),he=parseInt(ve.borderTopWidth,10),We=parseInt(ve.borderRightWidth,10),He=parseInt(ve.borderBottomWidth,10);let we=0,ei=0;const Be="offsetWidth"in oe?oe.offsetWidth-oe.clientWidth-ti-We:0,Zt="offsetHeight"in oe?oe.offsetHeight-oe.clientHeight-he-He:0,Je="offsetWidth"in oe?oe.offsetWidth===0?0:Ze/oe.offsetWidth:0,Ri="offsetHeight"in oe?oe.offsetHeight===0?0:Ve/oe.offsetHeight:0;if(Yt===oe)we=Qt==="start"?bt:Qt==="end"?bt-Le:Qt==="nearest"?me(Ce,Ce+Le,Le,he,He,Ce+bt,Ce+bt+Te,Te):bt-Le/2,ei=Jt==="start"?ge:Jt==="center"?ge-Xt/2:Jt==="end"?ge-Xt:me(Wt,Wt+Xt,Xt,ti,We,Wt+ge,Wt+ge+ne,ne),we=Math.max(0,we+Ce),ei=Math.max(0,ei+Wt);else{we=Qt==="start"?bt-Ni-he:Qt==="end"?bt-ie+He+Zt:Qt==="nearest"?me(Ni,ie,Ve,he,He+Zt,bt,bt+Te,Te):bt-(Ni+Ve/2)+Zt/2,ei=Jt==="start"?ge-ee-ti:Jt==="center"?ge-(ee+Ze/2)+Be/2:Jt==="end"?ge-Se+We+Be:me(ee,Se,Ze,ti,We+Be,ge,ge+ne,ne);const{scrollLeft:Pi,scrollTop:Ct}=oe;we=Ri===0?0:Math.max(0,Math.min(Ct+we/Ri,oe.scrollHeight-Ve/Ri+Zt)),ei=Je===0?0:Math.max(0,Math.min(Pi+ei/Je,oe.scrollWidth-Ze/Je+Be)),bt+=Ct-we,ge+=Pi-ei}Ge.push({el:oe,top:we,left:ei})}return Ge},$t=re=>re===!1?{block:"end",inline:"nearest"}:(Dt=>Dt===Object(Dt)&&Object.keys(Dt).length!==0)(re)?re:{block:"start",inline:"nearest"};function Ae(re,Dt){if(!re.isConnected||!(Ne=>{let ue=Ne;for(;ue&&ue.parentNode;){if(ue.parentNode===document)return!0;ue=ue.parentNode instanceof ShadowRoot?ue.parentNode.host:ue.parentNode}return!1})(re))return;const de=(Ne=>{const ue=window.getComputedStyle(Ne);return{top:parseFloat(ue.scrollMarginTop)||0,right:parseFloat(ue.scrollMarginRight)||0,bottom:parseFloat(ue.scrollMarginBottom)||0,left:parseFloat(ue.scrollMarginLeft)||0}})(re);if((Ne=>typeof Ne=="object"&&typeof Ne.behavior=="function")(Dt))return Dt.behavior(fe(re,Dt));const zt=typeof Dt=="boolean"||Dt==null?void 0:Dt.behavior;for(const{el:Ne,top:ue,left:qt}of fe(re,$t(Dt))){const Qt=ue-de.top+de.bottom,Jt=qt-de.left+de.right;Ne.scroll({top:Qt,left:Jt,behavior:zt})}}}}]);
|
|
}()); |