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.
33 lines
87 KiB
33 lines
87 KiB
(self.webpackChunk=self.webpackChunk||[]).push([[9403],{39517: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 ae={},De="5.0",z={},y=null,Fe=!1,Me=!1,Ce=null,te=!1,fe=null,Ee=null,Se=0;Se<arguments.length;Se++){var we=arguments[Se];if(we!==null)switch(typeof we){case"number":De=we.toFixed(1);break;case"string":we.match(new RegExp("^[0-9]\\.[0-9]+$"))?De=we:Ce=we;break;case"object":typeof we.is3D!="undefined"?y=we:z=we;break;case"boolean":Fe=we,Me=!0;break}}y===null&&(y={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},z.material_id!==void 0&&!Me&&(Fe=!0)),Ce!==null&&z.id===void 0&&(z.id=Ce);var _e="",Oe="",ke=!1,be=null,Te=null,Qe=null,Ze=!1,qe=null,tt=null,nt=null,Ge=null,Ue=null;z.height!==void 0&&(z.height=Math.round(z.height)),z.width!==void 0&&(z.width=Math.round(z.width));var Ie=function(ee){return parseFloat(ee)>4?parseFloat(ee):5};ae.setHTML5Codebase=function(ee,ie){Ee=ee,Wt(ee,ie)},ae.setJavaCodebase=ae.setJavaCodebaseVersion=ae.isCompiledInstalled=ae.setPreCompiledScriptPath=ae.setPreCompiledResourcePath=function(){},ae.setHTML5CodebaseVersion=function(ee,ie){var ue=parseFloat(ee);if(ue!==NaN&&ue<5){console.log("The GeoGebra HTML5 codebase version "+ue+" is deprecated. Using version latest instead.");return}fe=ee,on(ee,ie)},ae.getHTML5CodebaseVersion=function(){return Te},ae.getParameters=function(){return z},ae.setFontsCSSURL=function(ee){Ge=ee},ae.setGiacJSURL=function(ee){},ae.setJNLPFile=function(ee){_e=ee},ae.setJNLPBaseDir=function(ee){},ae.inject=function(){function ee(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var ie="auto",ue=z.id,Ne,ce=!1,Ae=0;Ae<arguments.length;Ae++){var a=arguments[Ae];typeof a=="string"?(a=a.toLowerCase(),a.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?ie=a:ue=arguments[Ae]):typeof a=="boolean"?ce=a:a instanceof HTMLElement&&(Ne=a)}de();function de(){if(!te){setTimeout(de,200);return}ie=mn(ie);var We=Ne||document.getElementById(ue);if(!We){console.log("possibly bug on ajax loading? ");return}if(ae.removeExistingApplet(We,!1),z.width===void 0&&We.clientWidth&&(z.width=We.clientWidth),z.height===void 0&&We.clientHeight&&(z.height=We.clientHeight),!(z.width&&z.height)&&ie==="html5"&&(delete z.width,delete z.height),be=ie,ie==="screenshot")Et(We,z);else{var dt=!1;z.hasOwnProperty("playButton")&&z.playButton||z.hasOwnProperty("clickToLoad")&&z.clickToLoad?dt=!0:z.hasOwnProperty("playButtonAutoDecide")&&z.playButtonAutoDecide&&(dt=(!Pe()||ee())&&xe()),dt?(be="screenshot",St(We,z,ce,ie)):ct(We,z,ce)}}};function Pe(){try{return window.self!==window.top}catch(ee){return!0}}function xe(){return z.hasOwnProperty("screenshotGenerator")&&z.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}ae.getViews=function(){return y},ae.isJavaInstalled=function(){return!1};var je=function(ee){var ie=function(Ae){var a=JSON.parse(Ae),de=function(Ke){return Ke.type=="G"||Ke.type=="E"},We=a.elements?a.elements.filter(de)[0]:a;if(!We||!We.url){ue();return}z.fileName=We.url,it(We.settings||{}),y.is3D=!0;var dt="https://www.geogebra.org/images/";ae.setPreviewImage(qe||We.previewUrl,dt+"GeoGebra_loading.png",dt+"applet_play.png"),ee()},ue=function(){z.onError&&z.onError(),rn("Error: Fetching material (id "+z.material_id+") failed.",z)},Ne=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",ce="/materials/"+z.material_id+"?scope=basic";Re("https://"+Ne+"/api/proxy.php?path="+encodeURIComponent(ce),ie,ue)};function it(ee){var ie=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(ue){ee[ue]=!!ee[ue]}),ie.forEach(function(ue){z[ue]===void 0&&ee[ue]!==void 0&&(z[ue]=ee[ue])}),z.showToolBarHelp===void 0&&(z.showToolBarHelp=z.showToolBar)}function Re(ee,ie,ue){var Ne=new XMLHttpRequest;Ne.open("GET",ee),Ne.onload=function(){ie(Ne.responseText)},Ne.onerror=ue,Ne.send()}ae.isHTML5Installed=function(){return!0},ae.getLoadedAppletType=function(){return be},ae.setPreviewImage=function(ee,ie,ue){qe=ee,tt=ie,nt=ue},ae.removeExistingApplet=function(ee,ie){var ue;typeof ee=="string"&&(ee=document.getElementById(ee)),be=null;var Ne=null;for(ue=0;ue<ee.childNodes.length;ue++){var ce=ee.childNodes[ue],Ae=ce.className;Ae==="applet_screenshot"?ie?(ce.style.display="block",be="screenshot"):ce.style.display="none":Ae!=="applet_scaler prerender"&&(ee.removeChild(ce),Ne=Ae&&Ae.indexOf("appletParameters")!=-1?ce.id:null,ue--)}var a=z.id!==void 0?z.id:Ne,de=window[a];de&&typeof de.getBase64=="function"&&(de.remove(),window[a]=null)},ae.refreshHitPoints=function(){if(Ie(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var ee=ae.getAppletObject();return ee&&typeof ee.recalculateEnvironments=="function"?(ee.recalculateEnvironments(),!0):!1},ae.startAnimation=function(){var ee=ae.getAppletObject();return ee&&typeof ee.startAnimation=="function"?(ee.startAnimation(),!0):!1},ae.stopAnimation=function(){var ee=ae.getAppletObject();return ee&&typeof ee.stopAnimation=="function"?(ee.stopAnimation(),!0):!1},ae.getAppletObject=function(){var ee=z.id!==void 0?z.id:"ggbApplet";return window[ee]},ae.resize=function(){};var st=function(ee,ie,ue){var Ne=document.createElement("param");Ne.setAttribute("name",ie),Ne.setAttribute("value",ue),ee.appendChild(Ne)},Ye=function(ee){return ee&&ee!=="false"},ct=function(ee,ie,ue){Ie(Te)<=4.2&&(ue=!0);var Ne=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==Te||ggbHTML5LoadedCodebaseIsWebSimple&&!Ze)&&(Ne=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var ce=document.createElement("div");ce.classList.add("appletParameters","notranslate");var Ae=ie.width,a=ie.height;if(ie.disableAutoScale=ie.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():ie.disableAutoScale,ie.width!==void 0)if(Ie(Te)<=4.4)Ye(ie.showToolBar)&&(ie.height-=7),Ye(ie.showAlgebraInput)&&(ie.height-=37),ie.width<605&&Ye(ie.showToolBar)&&(ie.width=605,Ae=605);else{var de=100;(Ye(ie.showToolBar)||Ye(ie.showMenuBar))&&(ie.hasOwnProperty("customToolBar")&&(ie.customToolbar=ie.customToolBar),de=Ye(ie.showMenuBar)?245:155),Ae<de&&(ie.width=de,Ae=de)}ce.style.border="none",ce.style.display="inline-block";for(var We in ie)ie.hasOwnProperty(We)&&We!=="appletOnLoad"&&ce.setAttribute("data-param-"+We,ie[We]);Ge&&ce.setAttribute("data-param-fontscssurl",Ge),ae.resize=function(){GGBAppletUtils.responsiveResize(ee,ie)},window.addEventListener("resize",function(vt){ae.resize()});var dt=typeof ie.appletOnLoad=="function"?ie.appletOnLoad:function(){};if(!ue&&ie.width!==void 0){ie.hasOwnProperty("showSplash")||ce.setAttribute("data-param-showSplash","false");var Ke=ee.querySelector(".applet_scaler.prerender"),jt=Ke!==null;if(jt)var zt=Ke.querySelector(".ggb_preview");else{var zt=Ht(Ae,a,ie.borderColor,!1);Ke=document.createElement("div"),Ke.className="applet_scaler",Ke.style.position="relative",Ke.style.display="block",Ke.style.width=Ae+"px",Ke.style.height=a+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Ke,"66%"),Ie(Te)>=5?(ie.appletOnLoad=function(vt){var Bt=ee.querySelector(".ggb_preview");Bt&&Bt.parentNode.removeChild(Bt),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(Ke),window.GGBT_wsf_view&&$(window).trigger("resize"),dt(vt)},jt||Ke.appendChild(zt)):ce.appendChild(zt),Ke.appendChild(ce),jt||ee.appendChild(Ke),setTimeout(function(){ae.resize()},1)}else{var ot=document.createElement("div");ot.className="applet_scaler",ot.style.position="relative",ot.style.display="block",ot.appendChild(ce),ee.appendChild(ot),ie.appletOnLoad=function(vt){ae.resize(),dt(vt)}}function pn(vt,Bt){Bt&&typeof Bt.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(vt,Bt.appletOnLoad):renderGGBElement(vt),rn("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",Bt)}function hn(vt,Bt){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:vt,params:Bt}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(vn){pn(vn.article,vn.params)}),html5AppletsToProcess=null)},Ie(Te)<5&&(vt.className+=" geogebraweb")):pn(vt,Bt)}if(Ne){scriptLoadStarted=!0;for(var Nt=0;Nt<ce.childNodes.length;Nt++){var $t=ce.childNodes[Nt].tagName;$t==="TABLE"&&(ce.removeChild(ce.childNodes[Nt]),Nt--)}if(ggbHTML5LoadedScript!==null){var Ut=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');Ut!=null&&Ut.parentNode.removeChild(Ut)}var Kt=document.createElement("script"),Gt=function(){hn(ce,ie)};Kt.src=Oe+Qe,ggbHTML5LoadedCodebaseIsWebSimple=Ze,ggbHTML5LoadedCodebaseVersion=Te,ggbHTML5LoadedScript=Kt.src,rn("GeoGebra HTML5 codebase loaded: '"+Oe+"'.",ie),!Ee&&(!fe||fe=="5.0")?(Ze?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),Gt()):Oe.requirejs?__webpack_require__.e(7023).then(function(){var vt=[__webpack_require__(97023)];Gt.apply(null,vt)}.bind(this)).catch(__webpack_require__.oe):(Kt.onload=Gt,ee.appendChild(Kt))}else hn(ce,ie);ie.height=a,ie.width=Ae},Et=function(ee,ie,ue){var Ne=Ht(ie.width,ie.height,ie.borderColor,ue),ce=document.createElement("div");ce.style.position="relative",ce.style.display="block",ce.style.width=ie.width+"px",ce.style.height=ie.height+"px",ce.className="applet_screenshot applet_scaler"+(ue?" applet_screenshot_play":""),ce.appendChild(Ne);var Ae=GGBAppletUtils.getScale(ie,ee,ue);ue?(ee.appendChild(Rt()),window.GGBT_wsf_view||(ee.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(ce,"66%"),ee.appendChild(ce),Ae!==1&&!isNaN(Ae)&&(GGBAppletUtils.scaleElement(ce,Ae),ce.style.width=ie.width+"px",ce.style.height=ie.height+"px",ce.parentNode.style.width=ie.width*Ae+"px",ce.parentNode.style.height=ie.height*Ae+"px"),ae.resize=function(){kt(ee,Ne,ce,ue)},window.addEventListener("resize",function(a){ae.resize()}),ae.resize()};function kt(ee,ie,ue,Ne){if(ee.contains(ie)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(ee.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(ee)}var ce=GGBAppletUtils.getScale(z,ee,Ne);ue.parentNode!==null&&(!isNaN(ce)&&ce!==1?(GGBAppletUtils.scaleElement(ue,ce),ue.parentNode.style.width=z.width*ce+"px",ue.parentNode.style.height=z.height*ce+"px"):(GGBAppletUtils.scaleElement(ue,1),ue.parentNode.style.width=z.width+"px",ue.parentNode.style.height=z.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(ee),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}ae.onExitFullscreen=function(ee,ie){ie.appendChild(ee)};var St=function(ee,ie,ue,Ne){Et(ee,ie,!0);for(var ce=function(){var de=[];for(a=0;a<ee.childNodes.length;a++)de.push(ee.childNodes[a]);if(window.GGBT_wsf_view){var We=window.GGBT_wsf_view.renderFullScreen(ee,ie.id),dt=document.getElementById("fullscreencontainer"),Ke=jQuery(ee).find(".fullscreencontent");Ke.length>0?(We.remove(),Ke.attr("id","fullscreencontent").show(),jQuery(dt).append(Ke),window.dispatchEvent(new Event("resize"))):ct(We,ie,!1),window.GGBT_wsf_view.launchFullScreen(dt)}else be=Ne,ct(ee,ie,!1);if(!window.GGBT_wsf_view)for(a=0;a<de.length;a++)ee.removeChild(de[a])},Ae=ee.getElementsByClassName("ggb_preview_play"),a=0;a<Ae.length;a++)Ae[a].addEventListener("click",ce,!1),Ae[a].addEventListener("ontouchstart",ce,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(ee),xe()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},Rt=function(){var ee=document.createElement("div");if(ee.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var ie='.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");}',ue=document.createElement("style");ue.styleSheet?ue.styleSheet.cssText=ie:ue.appendChild(document.createTextNode(ie)),document.getElementsByTagName("head")[0].appendChild(ue)}return ee},Ht=function(ee,ie,ue,Ne){var ce=document.createElement("div");ce.className="ggb_preview",ce.style.position="absolute",ce.style.zIndex="90",ce.style.width=ee-2+"px",ce.style.height=ie-2+"px",ce.style.top="0px",ce.style.left="0px",ce.style.overflow="hidden",ce.style.backgroundColor="white";var Ae="lightgrey";ue!==void 0&&(ue==="none"?Ae="transparent":Ae=ue),ce.style.border="1px solid "+Ae;var a=document.createElement("img");if(a.style.position="relative",a.style.zIndex="1000",a.style.top="-1px",a.style.left="-1px",qe!==null&&a.setAttribute("src",qe),a.style.opacity=.7,tt!==null){var de,We,dt;if(!Ne){de=document.createElement("img"),de.style.position="absolute",de.style.zIndex="1001",de.style.opacity=1,a.style.opacity=.3,We=360,We>ee/4*3&&(We=ee/4*3),dt=We/5.8,de.setAttribute("src",tt),de.setAttribute("width",We),de.setAttribute("height",dt);var Ke=(ee-We)/2,jt=(ie-dt)/2;de.style.left=Ke+"px",de.style.top=jt+"px",ce.appendChild(de)}}return ce.appendChild(a),ce},mn=function(ee){return ee=ee.toLowerCase(),ee==="html5"||ee==="screenshot"?ee:"html5"},Ot=["web","webSimple","web3d","tablet","tablet3d","phone"],on=function(ee,ie){if(Te=ee,ie){Wt(Te,!0);return}var ue=!Fe;if(ue){var Ne=Ie(Te);!isNaN(Ne)&&Ne<4.4&&(ue=!1)}var ce,Ae;window.location.protocol.substr(0,4)==="http"?ce=window.location.protocol:ce="http:";var a=Te.indexOf("//");a>0?Ae=Te:a===0?Ae=ce+Te:Ae="https://www.geogebra.org/apps/5.2.814.0/";for(var de in Ot)if(Te.slice(Ot[de].length*-1)===Ot[de]||Te.slice((Ot[de].length+1)*-1)===Ot[de]+"/"){Wt(Ae,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&ue&&!y.is3D&&!y.AV&&!y.SV&&!y.CV&&!y.EV2&&!y.CP&&!y.PC&&!y.DA&&!y.FI&&!y.PV&&!Ye(z.showToolBar)&&!Ye(z.showMenuBar)&&!Ye(z.showAlgebraInput)&&!Ye(z.enableRightClick)&&(!z.appName||z.appName=="classic")?Ae+="webSimple/":Ae+="web3d/",Wt(Ae,!1)},Wt=function(ee,ie){if(ee.requirejs){Oe=ee;return}ee.slice(-1)!=="/"&&(ee+="/"),Oe=ee,ie===null&&(ie=ee.indexOf("http")===-1),ke=ie,Qe="web.nocache.js",Ze=!1;var ue=Oe.split("/");ue.length>1&&(!ie&&ue[ue.length-2]==="webSimple"?(Qe="webSimple.nocache.js",Ze=!0):Ot.indexOf(ue[ue.length-2])>=0&&(Qe=ue[ue.length-2]+".nocache.js")),ue=ee.split("/"),Te=ue[ue.length-3],Te.substr(0,4)==="test"?Te=Te.substr(4,1)+"."+Te.substr(5,1):(Te.substr(0,3)==="war"||Te.substr(0,4)==="beta")&&(Te="5.0");var Ne=parseFloat(Te);Ne!==NaN&&Ne<5&&ee.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+Ne+" is deprecated. Using version latest instead."),on("5.0",ie))},rn=function(ee,ie){window.console&&window.console.log&&(!ie||typeof ie.showLogging=="undefined"||ie.showLogging&&ie.showLogging!=="false")&&console.log(ee)};z.material_id!==void 0?je(gn):gn();function gn(){var ee=De;fe!==null?ee=fe:parseFloat(ee)<5&&(ee="5.0"),on(ee,!1),Ee!==null&&Wt(Ee,ke),te=!0}return ae},GGBAppletUtils=function(){"use strict";function ae(){return window.GGBT_wsf_edit!==void 0}function De(te,fe){fe!=1?(te.style.transformOrigin="0% 0% 0px",te.style.webkitTransformOrigin="0% 0% 0px",te.style.transform="scale("+fe+","+fe+")",te.style.webkitTransform="scale("+fe+","+fe+")",te.style.maxWidth="initial",te.querySelector(".ggb_preview")!==null&&(te.querySelector(".ggb_preview").style.maxWidth="initial"),te.querySelectorAll(".ggb_preview img")[0]!==void 0&&(te.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),te.querySelectorAll(".ggb_preview img")[1]!==void 0&&(te.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(te.style.transform="none",te.style.webkitTransform="none")}function z(te,fe,Ee,Se,we,_e){var Oe=null;if(_e!=null&&_e!="")for(var ke=te.parentNode;ke!=null;)if((" "+ke.className+" ").indexOf(" "+_e+" ")>-1){Oe=ke;break}else ke=ke.parentNode;var be=0,Te=0,Qe=0,Ze=0,qe=0,tt=0,nt=0;if(Oe)be=Oe.offsetWidth,Te=Math.max(Se?Oe.offsetWidth:0,Oe.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(be=Math.min(window.innerWidth,document.documentElement.clientWidth),Te=Math.min(window.innerHeight,document.documentElement.clientHeight),Qe=be):(be=window.innerWidth,Te=window.innerHeight,Qe=window.innerWidth),te){var Ge=te.getBoundingClientRect();Ge.left>0&&Ge.left<=be&&(we===void 0||!we)&&(document.dir==="rtl"?(qe=be-Ge.width-Ge.left,tt=Qe<=480?10:30):(tt=Ge.left,qe=Qe<=480?10:30),Ze=tt+qe)}if(te&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var Ue=te.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(Ze=40,nt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Ze=0,nt=40)}}return te&&((Ee===void 0||!Ee)&&fe>0&&fe+Ze<be?be=fe:be-=Ze,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Ee===void 0||!Ee)&&(Te-=nt)),{width:be,height:Te}}function y(te,fe,Ee,Se,we){if(te.isScreenshoGenerator)return 1;var _e=Se!==void 0&&Se,Oe=te.noScaleMargin!=null&&te.noScaleMargin,ke=function(Ue){return Ue&&Ue!=="false"},be=ke(te.autoHeight),Te=z(fe,te.width,Ee,be,_e&&window.GGBT_wsf_view||Oe,we),Qe=parseInt(Te.width),Ze=te.width,qe=te.height;if(Ze===void 0){var tt=fe.querySelector(".appletParameters");tt&&(Ze=tt.offsetWidth,qe=tt.offsetHeight)}var nt=Qe/Ze,Ge=_e?1:Te.height/qe;return Ee!==void 0&&!Ee&&(nt=Math.min(1,nt),Ge=Math.min(1,Ge)),Math.min(nt,Ge)}function Fe(te,fe,Ee){var Se=1,we,_e=!1;if(te.hasOwnProperty("allowUpscale")&&(_e=te.allowUpscale),te.hasOwnProperty("scale")&&(Se=parseFloat(te.scale),(isNaN(Se)||Se===null||Se===0)&&(Se=1),Se>1&&(_e=!0)),fe&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(_e=!0),!(te.hasOwnProperty("disableAutoScale")&&te.disableAutoScale))we=y(te,fe,_e,Ee,te.scaleContainerClass);else return Se;return _e&&(!te.hasOwnProperty("scale")||Se===1)?we:Math.min(Se,we)}function Me(te){var fe=Math.min(window.innerWidth,document.documentElement.clientWidth),Ee=Math.min(window.innerHeight,document.documentElement.clientHeight),Se=te.getBoundingClientRect(),we=(fe-Se.width)/2,_e=(Ee-Se.height)/2;_e<0&&(_e=0),te.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(we<40?te.style.left="40px":te.style.left=we+"px",te.style.top=_e+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(_e<40?te.style.top="40px":te.style.top=_e+"px",te.style.left=we+"px")}function Ce(te,fe){var Ee=te.querySelector(".appletParameters");if(Ee){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(fe.id!==Ee.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(te)}if(Ee.parentElement&&/fullscreen/.test(Ee.parentElement.className))return;var Se=Fe(fe,te);ae()&&Ee.setAttribute("data-param-scale",Se);for(var we=null,_e=0;_e<te.childNodes.length;_e++)if(te.childNodes[_e].className!==void 0&&te.childNodes[_e].className.match(/^applet_scaler/)){we=te.childNodes[_e];break}if(we!==null&&we.querySelector(".noscale")!==null)return;var Oe=fe.id!==void 0?fe.id:"ggbApplet",ke=window[Oe];(ke==null||!ke.recalculateEnvironments)&&we!==null&&!we.className.match(/fullscreen/)&&(we.parentNode.style.transform="",!isNaN(Se)&&Se!==1?(we.parentNode.style.width=fe.width*Se+"px",we.parentNode.style.height=fe.height*Se+"px",De(we,Se)):(De(we,1),we.parentNode.style.width=fe.width+"px",we.parentNode.style.height=fe.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&Me(te),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(Ee).parents(".content-added-content"))}}return{responsiveResize:Ce,isFlexibleWorksheetEditor:ae,positionCenter:Me,getScale:Fe,scaleElement:De}}();__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 ae=n.location.search;return ae.indexOf(J)!=-1||ae.indexOf(K)!=-1}function q(ae,De){}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(ae){var De=s[L].bindings;s[L].bindings=function(){for(var z=De?De():{},y=ae[webModule.__softPermutationId],Fe=O;Fe<y.length;Fe++){var Me=y[Fe];z[Me[O]]=Me[P]}return z}};var t;function u(){return v(),t}function v(){if(!t){var ae=o.createElement(Q);if(ae.id=L,ae.style.cssText=R+S,ae.tabIndex=-1,o.body.appendChild(ae),t=ae.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var De=document.compatMode==U?V:W;t.write(De+X),t.close()}}}function w(ae){function De(y){function Fe(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var Me=Fe();if(Me){y();return}function Ce(){if(!Me){if(!Fe())return;Me=!0,y(),o.removeEventListener&&o.removeEventListener(Z,Ce,!1),te&&clearInterval(te)}}o.addEventListener&&o.addEventListener(Z,Ce,!1);var te=setInterval(function(){Ce()},$)}function z(y){var Fe=u(),Me=Fe.body,Ce=Fe.createElement(_);Ce.language=ab,Ce.crossOrigin=W,Ce.src=y,webModule.__errFn&&(Ce.onerror=function(){webModule.__errFn(L,new Error(bb+y))}),Me.appendChild(Ce)}De(function(){z(ae)})}webModule.__startLoadingFragment=function(ae){return C(ae)},webModule.__installRunAsyncCode=function(ae){var De=u(),z=De.body,y=De.createElement(_);y.language=ab,y.text=ae,z.appendChild(y),z.removeChild(y)};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(ae){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(ae){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(ae){var De=c[ae];return De==null?null:De},r=d,webModule.__errFn=e}function B(){function ae(te){var fe=te.lastIndexOf(rb);fe==-1&&(fe=te.length);var Ee=te.indexOf(sb);Ee==-1&&(Ee=te.length);var Se=te.lastIndexOf(tb,Math.min(Ee,fe));return Se>=O?te.substring(O,Se+P):W}function De(te){if(!te.match(/^\w+:\/\//)){var fe=o.createElement(ub);fe.src=te+vb,te=ae(fe.src)}return te}function z(){var te=__gwt_getMetaProperty(wb);return te!=null?te:W}function y(){for(var te=o.getElementsByTagName(_),fe=O;fe<te.length;++fe)if(te[fe].src.indexOf(xb)!=-1)return ae(te[fe].src);return W}function Fe(){var te=o.getElementsByTagName(yb);return te.length>O?te[te.length-P].href:W}function Me(){var te=o.location;return te.href==te.protocol+zb+te.host+te.pathname+te.search+te.hash}var Ce=z();return Ce==W&&(Ce=y()),Ce==W&&(Ce=Fe()),Ce==W&&Me()&&(Ce=ae(o.location.href)),Ce=De(Ce),Ce}function C(ae){return ae.match(/^\//)||ae.match(/^[a-zA-Z]+:\/\//)?ae:webModule.__moduleBase+ae}function D(){var ae=[],De=O,z=[],y=[];function Fe(te){var fe=y[te](),Ee=z[te];if(fe in Ee)return fe;var Se=[];for(var we in Ee)Se[Ee[we]]=we;throw r&&r(te,Se,fe),null}if(__gwt_isKnownPropertyValue=function(te,fe){return fe in z[te]},webModule.__getPropMap=function(){var te={};for(var fe in z)z.hasOwnProperty(fe)&&(te[fe]=Fe(fe));return te},webModule.__computePropValue=Fe,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var Me;try{Me=Cb;var Ce=Me.indexOf(Db);Ce!=-1&&(De=parseInt(Me.substring(Ce+P),$),Me=Me.substring(O,Ce))}catch(te){}return webModule.__softPermutationId=De,C(Me+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})()},23333:function(ae,De,z){"use strict";z.d(De,{Ax:function(){return Ce},Ds:function(){return te},KI:function(){return Ee},SI:function(){return Me},f1:function(){return Fe}});var y=z(40607);function Fe(Se){let we=!0;if(Se.length>0){for(let _e=0;_e<Se.length;_e++)if(Se[_e].compile_success==0||!Se[_e].compile_success){we=!1;break}}else we=!1;return we}function Me(Se,we=""){let _e=[];for(let Oe=0;Oe<Se.length;Oe++){let ke=Se[Oe],be=we?`${we}/${ke.name}`:`${ke.name}`;_e.push({title:ke.name,type:ke.type,isLeaf:ke.type!=="tree",key:be})}return _e}function Ce(Se,we,_e){for(let Oe=0;Oe<Se.length;Oe++){let ke=Se[Oe];if(ke.key===we){ke.children=_e;break}ke.children&&Ce(ke.children,we,_e)}return Se}function te(Se,we,_e){let Oe;return function(){let ke=this,be=arguments,Te=function(){Oe=null,_e||Se.apply(ke,be)},Qe=_e&&!Oe;clearTimeout(Oe),Oe=setTimeout(Te,we),Qe&&Se.apply(ke,be)}}const fe=!0,Ee=y.Z.API_SERVER},43349:function(ae,De,z){"use strict";z.d(De,{Z:function(){return Oe}});var y=z(59301),Fe={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},Me=z(92310),Ce=z.n(Me),te=z(71418),fe=z(2859),Ee=z(58253),Se=z(93520),we=(ke,be,Te)=>new Promise((Qe,Ze)=>{var qe=Ge=>{try{nt(Te.next(Ge))}catch(Ue){Ze(Ue)}},tt=Ge=>{try{nt(Te.throw(Ge))}catch(Ue){Ze(Ue)}},nt=Ge=>Ge.done?Qe(Ge.value):Promise.resolve(Ge.value).then(qe,tt);nt((Te=Te.apply(ke,be)).next())}),Oe=({data:ke,className:be,fullWidth:Te,style:Qe={},onClose:Ze,onOk:qe,showFullTools:tt,noAssociationId:nt})=>{const Ge=(0,y.useRef)(null),Ue=(0,y.useRef)(null),Ie=(0,y.useRef)(null),Pe=(0,y.useRef)(null),[xe,je]=(0,y.useState)(!1),[it,Re]=(0,y.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,y.useEffect)(()=>{Ie.current||(Ie.current=document.createElement("style"),document.head.appendChild(Ie.current)),ke!=null&&ke.visible?(document.body.setAttribute("data-custom","y-hidden"),Ie.current.innerHTML=" html { overflow-y: hidden; }",ke!=null&&ke.src&&st()):(document.body.removeAttribute("data-custom"),Ie.current&&(document.head.removeChild(Ie.current),Ie.current=null))},[ke==null?void 0:ke.visible]);const st=()=>we(void 0,null,function*(){je(!0),Re("\u6B63\u5728\u52A0\u8F7D\u4E2D");const kt=yield(0,Se.ZJ)(ke==null?void 0:ke.src);Ge.current.src="",Ge.current.src=kt,Ge.current.onload=function(){Et()},je(!1),Re("")}),Ye=kt=>we(void 0,null,function*(){je(!0),Re("\u6B63\u5728\u4FDD\u5B58\u4E2D");const St=yield(0,Ee.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:ke.title,file:kt.dataUrl}});St!=null&&St.id&&!nt?(yield(0,Ee.ZP)(`/api/attachments/${ke.id}/add_subitem.json`,{method:"post",body:{subitem_id:St==null?void 0:St.id,settings:JSON.stringify(kt.state)}})).status===0&&qe():St!=null&&St.id&&qe(St),je(!1),Re("")}),ct=()=>{const kt=document.querySelector('a[href="https://markerjs.com/"]');kt&&kt.parentNode&&(kt.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(Rt=>{const Ht=document.querySelector(Rt.name);Ht&&Ht.setAttribute("title",Rt.title)})},Et=()=>{Ue.current=new fe.hP(Ge.current),Ue.current.targetRoot=Pe.current,Ue.current.addEventListener("render",Ye),Ue.current.addEventListener("beforeclose",Ze),tt&&(Ue.current.availableMarkerTypes=Ue.current.ALL_MARKER_TYPES,Ue.current.uiStyleSettings.redoButtonVisible=!0,Ue.current.uiStyleSettings.notesButtonVisible=!0,Ue.current.uiStyleSettings.zoomButtonVisible=!0,Ue.current.uiStyleSettings.zoomOutButtonVisible=!0,Ue.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=Ue.current.uiStyleSettings,Ue.current.show(),ke!=null&&ke.snapshotData&&Ue.current.restoreState(ke.snapshotData),setTimeout(()=>{window.scrollTo(0,0),ct()},300)};return y.createElement(y.Fragment,null,(ke==null?void 0:ke.visible)&&y.createElement(te.Z,{spinning:xe,tip:it,style:{position:"absolute"}},y.createElement("div",{ref:Pe,className:Ce()(Fe.imageDimensions,be,Te?Fe.fullWidth:""),style:Qe},y.createElement("img",{className:Fe.img,ref:Ge}))))}},30681:function(ae,De,z){"use strict";z.d(De,{h:function(){return Ue}});var y=z(59301),Fe=z(57809),Me=z(78700),Ce=z(3113),te=z(89780),fe=z.n(te),Ee=z(98337),Se=z(47820),we=Object.defineProperty,_e=Object.defineProperties,Oe=Object.getOwnPropertyDescriptors,ke=Object.getOwnPropertySymbols,be=Object.prototype.hasOwnProperty,Te=Object.prototype.propertyIsEnumerable,Qe=(Ie,Pe,xe)=>Pe in Ie?we(Ie,Pe,{enumerable:!0,configurable:!0,writable:!0,value:xe}):Ie[Pe]=xe,Ze=(Ie,Pe)=>{for(var xe in Pe||(Pe={}))be.call(Pe,xe)&&Qe(Ie,xe,Pe[xe]);if(ke)for(var xe of ke(Pe))Te.call(Pe,xe)&&Qe(Ie,xe,Pe[xe]);return Ie},qe=(Ie,Pe)=>_e(Ie,Oe(Pe));const tt=Fe.default.Option,nt={labelCol:{span:4},wrapperCol:{span:20}},Ge={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"]};De.Z=({callback:Ie,onCancel:Pe})=>{const[xe,je]=(0,y.useState)("python");function it(st){je(Ge[st][1])}function Re(st){Ie(st)}return y.createElement(Me.default,qe(Ze({},nt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Re,style:{width:500}}),y.createElement(Me.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.createElement(Fe.default,{getPopupContainer:st=>st.parentNode,onChange:it},Object.keys(Ge).map(st=>y.createElement(tt,{key:st,value:st},Ge[st][0])))),y.createElement(Me.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.createElement(Ue,{mode:xe})),y.createElement("div",{className:"flex-container flex-end"},y.createElement(Ce.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.createElement(Ce.ZP,{type:"ghost",onClick:Pe},"\u53D6\u6D88")))};function Ue({value:Ie,onChange:Pe,mode:xe,options:je={}}){const it=(0,y.useRef)(),[Re,st]=(0,y.useState)();return(0,y.useEffect)(()=>{if(Re){let Ye=function(ct){const Et=ct.getValue();Pe&&Pe(Et)};return Re.on("change",Ye),()=>{Re.off("change",Ye)}}},[Re,Pe]),(0,y.useEffect)(()=>{Re&&Re.setOption("mode",xe)},[Re,xe]),(0,y.useEffect)(()=>{Re&&(Ie!==Re.getValue()||Ie==="")&&setTimeout(()=>{Re.setValue(Ie||"")},300)},[Re,Ie]),(0,y.useEffect)(()=>{if(it.current&&!Re){const Ye=fe().fromTextArea(it.current,Ze({mode:xe,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},je));st(Ye)}},[it.current,Re]),y.createElement("div",{className:"my-codemirror-container"},y.createElement("textarea",{ref:it}))}},71278:function(ae,De,z){"use strict";z.d(De,{Z:function(){return ii}});var y=z(59301),Fe=z(89780),Me=z.n(Fe),Ce=z(76374),te=z(98337),fe=z(6313),Ee=z(25717),Se=z(99498),we=z(25419),_e=z(67549),Oe=z(47530),ke=({value:b="",className:x,showTextOnly:E,showLines:le,style:Be={}})=>{const ye=(0,y.useMemo)(()=>"",[b]);return y.createElement(y.Fragment,null,y.createElement("div",{dangerouslySetInnerHTML:{__html:ye}}))},be=z(59301),Te=Object.defineProperty,Qe=Object.defineProperties,Ze=Object.getOwnPropertyDescriptors,qe=Object.getOwnPropertySymbols,tt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,Ge=(b,x,E)=>x in b?Te(b,x,{enumerable:!0,configurable:!0,writable:!0,value:E}):b[x]=E,Ue=(b,x)=>{for(var E in x||(x={}))tt.call(x,E)&&Ge(b,E,x[E]);if(qe)for(var E of qe(x))nt.call(x,E)&&Ge(b,E,x[E]);return b},Ie=(b,x)=>Qe(b,Ze(x));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\u56FE\u50CF",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"\u63D2\u5165\u753B\u56FE",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"\u63D2\u5165\u6D41\u7A0B\u56FE",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"\u8868\u683C",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function xe({onActionCallback:b,title:x,icon:E,actionName:le,className:Be="",children:ye}){function Ve(){b(le)}return be.createElement("a",{title:x,className:Be,onClick:Ve},be.createElement("i",{className:`${E}`}),ye)}var je=({watch:b,showNullButton:x,showNullProgramButton:E,onActionCallback:le,fullScreen:Be,insertTemp:ye,hidetoolBar:Ve,extraUse:He})=>{const Je=[...Pe,{title:`${b?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${b?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return be.createElement("ul",{className:"markdown-toolbar-container"},!Ve&&Je.map((rt,_t)=>be.createElement("li",{key:_t},rt.actionName?be.createElement(xe,Ie(Ue({},rt),{onActionCallback:le})):be.createElement("span",{className:"v-line"}))),x?be.createElement("li",null,be.createElement(xe,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:le},be.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,E?be.createElement(be.Fragment,null,be.createElement("li",null,be.createElement(xe,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:le},be.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),be.createElement("li",null,be.createElement(xe,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:le},be.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,ye&&be.createElement("li",null,be.createElement(xe,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${ye}`,onActionCallback:le},be.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),He&&be.createElement("li",null,He),be.createElement("li",{className:"btn-full-screen"},be.createElement(xe,{icon:`${Be?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:Be?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:le})))},it=z(78780),Re=z(78700),st=z(92832),Ye=z(3113),ct=Object.defineProperty,Et=Object.defineProperties,kt=Object.getOwnPropertyDescriptors,St=Object.getOwnPropertySymbols,Rt=Object.prototype.hasOwnProperty,Ht=Object.prototype.propertyIsEnumerable,mn=(b,x,E)=>x in b?ct(b,x,{enumerable:!0,configurable:!0,writable:!0,value:E}):b[x]=E,Ot=(b,x)=>{for(var E in x||(x={}))Rt.call(x,E)&&mn(b,E,x[E]);if(St)for(var E of St(x))Ht.call(x,E)&&mn(b,E,x[E]);return b},on=(b,x)=>Et(b,kt(x));const Wt={labelCol:{span:4},wrapperCol:{span:20}};var rn=({callback:b,onCancel:x})=>{function E(le){b(le)}return y.createElement(Re.default,on(Ot({},Wt),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:E,style:{width:500}}),y.createElement(Re.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},y.createElement(st.default,null)),y.createElement(Re.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},y.createElement(st.default,null)),y.createElement("div",{className:"flex-container flex-end"},y.createElement(Ye.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.createElement(Ye.ZP,{type:"ghost",onClick:x},"\u53D6\u6D88")))},gn=z(30681),ee=z(11901),ie=z(43418),ue=z(95237),Ne=z(43349),ce=z(59301),Ae=({callback:b,onCancel:x})=>{const E=document.createElement("canvas"),le=E.getContext("2d");E.width=1e3,E.height=800,le.fillStyle="#ffffff",le.fillRect(0,0,E.width,E.height);const Be=E.toDataURL("image/png");return ce.createElement(ie.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},ce.createElement(ue.Z,{style:{height:"100vh"}},ce.createElement(Ne.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:Be,visible:!0,title:String(Date.now())},onOk:ye=>{b({src:ye.url})},onClose:x})))},a=z(12378);function de(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(de,go.CommandHandler),de.prototype.canAlignSelection=function(){var b=this.diagram;return!(b===null||b.isReadOnly||b.isModelReadOnly||b.selection.count<2)},de.prototype.alignLeft=function(){var b=this.diagram;b.startTransaction("aligning left");var x=1/0;b.selection.each(function(E){E instanceof go.Link||(x=Math.min(E.position.x,x))}),b.selection.each(function(E){E instanceof go.Link||E.move(new go.Point(x,E.position.y))}),b.commitTransaction("aligning left")},de.prototype.alignRight=function(){var b=this.diagram;b.startTransaction("aligning right");var x=-1/0;b.selection.each(function(E){if(!(E instanceof go.Link)){var le=E.actualBounds.x+E.actualBounds.width;x=Math.max(le,x)}}),b.selection.each(function(E){E instanceof go.Link||E.move(new go.Point(x-E.actualBounds.width,E.position.y))}),b.commitTransaction("aligning right")},de.prototype.alignTop=function(){var b=this.diagram;b.startTransaction("alignTop");var x=1/0;b.selection.each(function(E){E instanceof go.Link||(x=Math.min(E.position.y,x))}),b.selection.each(function(E){E instanceof go.Link||E.move(new go.Point(E.position.x,x))}),b.commitTransaction("alignTop")},de.prototype.alignBottom=function(){var b=this.diagram;b.startTransaction("aligning bottom");var x=-1/0;b.selection.each(function(E){if(!(E instanceof go.Link)){var le=E.actualBounds.y+E.actualBounds.height;x=Math.max(le,x)}}),b.selection.each(function(E){E instanceof go.Link||E.move(new go.Point(E.actualBounds.x,x-E.actualBounds.height))}),b.commitTransaction("aligning bottom")},de.prototype.alignCenterX=function(){var b=this.diagram,x=b.selection.first();if(x){b.startTransaction("aligning Center X");var E=x.actualBounds.x+x.actualBounds.width/2;b.selection.each(function(le){le instanceof go.Link||le.move(new go.Point(E-le.actualBounds.width/2,le.actualBounds.y))}),b.commitTransaction("aligning Center X")}},de.prototype.alignCenterY=function(){var b=this.diagram,x=b.selection.first();if(x){b.startTransaction("aligning Center Y");var E=x.actualBounds.y+x.actualBounds.height/2;b.selection.each(function(le){le instanceof go.Link||le.move(new go.Point(le.actualBounds.x,E-le.actualBounds.height/2))}),b.commitTransaction("aligning Center Y")}},de.prototype.alignColumn=function(b){var x=this.diagram;x.startTransaction("align Column"),b===void 0&&(b=0),b=parseFloat(b);var E=new Array;x.selection.each(function(He){He instanceof go.Link||E.push(He)});for(var le=0;le<E.length-1;le++){var Be=E[le],ye=Be.actualBounds.y+Be.actualBounds.height+b,Ve=E[le+1];Ve.move(new go.Point(Be.actualBounds.x,ye))}x.commitTransaction("align Column")},de.prototype.alignRow=function(b){b===void 0&&(b=0),b=parseFloat(b);var x=this.diagram;x.startTransaction("align Row");var E=new Array;x.selection.each(function(He){He instanceof go.Link||E.push(He)});for(var le=0;le<E.length-1;le++){var Be=E[le],ye=Be.actualBounds.x+Be.actualBounds.width+b,Ve=E[le+1];Ve.move(new go.Point(ye,Be.actualBounds.y))}x.commitTransaction("align Row")},de.prototype.canRotate=function(b){var x=this.diagram;return!(x===null||x.isReadOnly||x.isModelReadOnly||x.selection.count<1)},de.prototype.rotate=function(b){b===void 0&&(b=90);var x=this.diagram;x.startTransaction("rotate "+b.toString());var x=this.diagram;x.selection.each(function(E){E instanceof go.Link||E instanceof go.Group||(E.angle+=b)}),x.commitTransaction("rotate "+b.toString())},de.prototype.pullToFront=function(){var b=this.diagram;b.startTransaction("pullToFront");var x=new go.Map;b.selection.each(function(E){x.set(E.layer,0)}),x.iteratorKeys.each(function(E){var le=0;E.parts.each(function(Be){if(!Be.isSelected){var ye=Be.zOrder;isNaN(ye)?Be.zOrder=0:le=Math.max(le,ye)}}),x.set(E,le)}),b.selection.each(function(E){de._assignZOrder(E,x.get(E.layer)+1)}),b.commitTransaction("pullToFront")},de.prototype.pushToBack=function(){var b=this.diagram;b.startTransaction("pushToBack");var x=new go.Map;b.selection.each(function(E){x.set(E.layer,0)}),x.iteratorKeys.each(function(E){var le=0;E.parts.each(function(Be){if(!Be.isSelected){var ye=Be.zOrder;isNaN(ye)?Be.zOrder=0:le=Math.min(le,ye)}}),x.set(E,le)}),b.selection.each(function(E){de._assignZOrder(E,x.get(E.layer)-1-de._findGroupDepth(E))}),b.commitTransaction("pushToBack")},de._assignZOrder=function(b,x,E){E===void 0&&(E=b),b.layer===E.layer&&(b.zOrder=x),b instanceof go.Group&&b.memberParts.each(function(le){de._assignZOrder(le,x+1,E)})},de._findGroupDepth=function(b){if(b instanceof go.Group){var x=0;return b.memberParts.each(function(E){x=Math.max(x,de._findGroupDepth(E))}),x+1}else return 0},de.prototype.doKeyDown=function(){var b=this.diagram;if(b!==null){var x=b.lastInput;if(x.key==="Up"||x.key==="Down"||x.key==="Left"||x.key==="Right"){var E=this.arrowKeyBehavior;if(E==="none")return;if(E==="select"){this._arrowKeySelect();return}else if(E==="move"){this._arrowKeyMove();return}else if(E==="tree"){this._arrowKeyTree();return}}go.CommandHandler.prototype.doKeyDown.call(this)}},de.prototype._getAllParts=function(){var b=new Array;return this.diagram.nodes.each(function(x){b.push(x)}),this.diagram.parts.each(function(x){b.push(x)}),b},de.prototype._arrowKeyMove=function(){var b=this.diagram,x=b.lastInput,E=0,le=0;if(x.control||x.meta)E=1,le=1;else if(b.grid!==null){var Be=b.grid.gridCellSize;le=Be.width,E=Be.height}b.startTransaction("arrowKeyMove"),b.selection.each(function(ye){x.key==="Up"?ye.move(new go.Point(ye.actualBounds.x,ye.actualBounds.y-E)):x.key==="Down"?ye.move(new go.Point(ye.actualBounds.x,ye.actualBounds.y+E)):x.key==="Left"?ye.move(new go.Point(ye.actualBounds.x-le,ye.actualBounds.y)):x.key==="Right"&&ye.move(new go.Point(ye.actualBounds.x+le,ye.actualBounds.y))}),b.commitTransaction("arrowKeyMove")},de.prototype._arrowKeySelect=function(){var b=this.diagram,x=b.lastInput,E=null;x.key==="Up"?E=this._findNearestPartTowards(270):x.key==="Down"?E=this._findNearestPartTowards(90):x.key==="Left"?E=this._findNearestPartTowards(180):x.key==="Right"&&(E=this._findNearestPartTowards(0)),E!==null&&(x.shift?E.isSelected=!0:x.control||x.meta?E.isSelected=!E.isSelected:b.select(E))},de.prototype._findNearestPartTowards=function(b){var x=this.diagram.selection.first();if(x===null)return null;for(var E=x.actualBounds.center,le=this._getAllParts(),Be=1/0,ye=x,Ve=0;Ve<le.length;Ve++){var He=le[Ve];if(He!==x&&He.canSelect()){var Je=He.actualBounds.center,rt=E.directionPoint(Je),_t=this._angleCloseness(rt,b);if(_t<=45){var oe=E.distanceSquaredPoint(Je);oe*=1+Math.sin(_t*Math.PI/180),oe<Be&&(Be=oe,ye=He)}}}return ye},de.prototype._angleCloseness=function(b,x){return Math.min(Math.abs(x-b),Math.min(Math.abs(x+360-b),Math.abs(x-360-b)))},de.prototype._arrowKeyTree=function(){var b=this.diagram,x=b.selection.first();if(x instanceof go.Node){var E=b.lastInput;if(E.key==="Right"){if(!x.isTreeLeaf)if(!x.isTreeExpanded)b.commandHandler.canExpandTree(x)&&b.commandHandler.expandTree(x);else{var le=this._sortTreeChildrenByY(x).first();le!==null&&b.select(le)}}else if(E.key==="Left")if(!x.isTreeLeaf&&x.isTreeExpanded)b.commandHandler.canCollapseTree(x)&&b.commandHandler.collapseTree(x);else{var Be=x.findTreeParentNode();Be!==null&&b.select(Be)}else if(E.key==="Up"){var Be=x.findTreeParentNode();if(Be!==null){var ye=this._sortTreeChildrenByY(Be),Ve=ye.indexOf(x);if(Ve>0){for(var He=ye.elt(Ve-1);He!==null&&He.isTreeExpanded&&!He.isTreeLeaf;){var Je=this._sortTreeChildrenByY(He);He=Je.last()}He!==null&&b.select(He)}else b.select(Be)}}else if(E.key==="Down")if(x.isTreeExpanded&&!x.isTreeLeaf){var le=this._sortTreeChildrenByY(x).first();le!==null&&b.select(le)}else for(;x!==null;){var Be=x.findTreeParentNode();if(Be===null)break;var ye=this._sortTreeChildrenByY(Be),Ve=ye.indexOf(x);if(Ve<ye.length-1){b.select(ye.elt(Ve+1));break}else x=Be}var rt=b.selection.first();rt!==null&&b.scrollToRect(rt.actualBounds)}},de.prototype._sortTreeChildrenByY=function(b){var x=new go.List().addAll(b.findTreeChildrenNodes());return x.sort(function(E,le){var Be=E.location,ye=le.location;return Be.y<ye.y?-1:Be.y>ye.y?1:Be.x<ye.x?-1:Be.x>ye.x?1:0}),x},de.prototype.copyToClipboard=function(b){go.CommandHandler.prototype.copyToClipboard.call(this,b),this._lastPasteOffset.set(this.pasteOffset)},de.prototype.pasteFromClipboard=function(){var b=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(b,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),b},Object.defineProperty(de.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(b){if(b!=="move"&&b!=="select"&&b!=="scroll"&&b!=="tree"&&b!=="none")throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+b);this._arrowKeyBehavior=b}}),Object.defineProperty(de.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(b){if(!(b instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+b);this._pasteOffset.set(b)}});var We=de,dt=z(39183),Ke=z(43604),jt=z(58253),zt={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},ot=z(59301),pn=(b,x,E)=>new Promise((le,Be)=>{var ye=Je=>{try{He(E.next(Je))}catch(rt){Be(rt)}},Ve=Je=>{try{He(E.throw(Je))}catch(rt){Be(rt)}},He=Je=>Je.done?le(Je.value):Promise.resolve(Je.value).then(ye,Ve);He((E=E.apply(b,x)).next())});function hn({onCancel:b,callback:x}){let E=(0,y.useRef)(),le=(0,y.useRef)(),Be=(0,y.useRef)(),ye=(0,y.useRef)(!1);const Ve=(0,y.useRef)(!1),[He,Je]=(0,y.useState)(0);function rt(){const oe=a.GraphObject.make,ze={red:"#ff3333",blue:"#3358ff",green:"#25ad23",magenta:"#d533ff",purple:"#7d33ff",orange:"#ff6233",brown:"#8e571e",white:"#ffffff",black:"#000000",beige:"#fffcd5",extralightblue:"#d5ebff",extralightred:"#f2dfe0",lightblue:"#a5d2fa",lightgray:"#cccccc",lightgreen:"#b3e6b3",lightred:"#fcbbbd"};E.current=new a.Diagram(le.current,{padding:20,grid:oe(a.Panel,"Grid",oe(a.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),oe(a.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:re=>{var ge=re.diagram.commandHandler.addTopLevelParts(re.diagram.selection,!0);ge||re.diagram.currentTool.doCancel()},commandHandler:oe(We),"clickCreatingTool.archetypeNodeData":{text:"\u672A\u547D\u540D",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:re=>{var ge=re.subject;ge.location=ge.location.copy().snapToGridPoint(re.diagram.grid.gridOrigin,re.diagram.grid.gridCellSize),setTimeout(()=>{re.diagram.commandHandler.editTextBlock()},20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:re=>{var ge=re.subject;setTimeout(()=>{re.diagram.commandHandler.editTextBlock()})},LinkRelinked:re=>{var ge=re.parameter.part;ge.invalidateConnectedLinks();var Le=re.subject;re.diagram.toolManager.linkingTool.isForwards?Le.toNode.invalidateConnectedLinks():Le.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),E.current.nodeTemplate=oe(a.Node,"Auto",{locationSpot:a.Spot.Center,locationObjectName:"SHAPE",desiredSize:new a.Size(120,60),minSize:new a.Size(40,40),resizable:!0,resizeCellSize:new a.Size(10,10),rotatable:!0},new a.Binding("location","loc",a.Point.parse).makeTwoWay(a.Point.stringify),new a.Binding("desiredSize","size",a.Size.parse).makeTwoWay(a.Size.stringify),oe(a.Shape,{name:"SHAPE",fill:ze.white,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:a.Spot.AllSides,toSpot:a.Spot.AllSides},new a.Binding("figure"),new a.Binding("fill"),new a.Binding("stroke","borderColor"),new a.Binding("strokeWidth","thickness"),new a.Binding("strokeDashArray","dash")),oe(a.Shape,{width:100,height:20,strokeWidth:0,fill:"transparent"}),oe(a.TextBlock,{margin:1,textAlign:"center",overflow:a.TextBlock.OverflowEllipsis,editable:!0},new a.Binding("text").makeTwoWay(),new a.Binding("stroke","color"))),E.current.nodeTemplate.toolTip=oe("ToolTip",oe(a.Panel,"Vertical",{maxSize:new a.Size(200,NaN)},oe(a.TextBlock,{font:"bold 10pt sans-serif",textAlign:"center"},new a.Binding("text")),oe(a.TextBlock,{font:"10pt sans-serif",textAlign:"center"},new a.Binding("text","details"))));function Tt(re,ge){var Le=(pe,Xe)=>{pe.handled=!0,pe.diagram.model.commit(at=>{var pt=Xe.part.adornedPart,yt=new a.Point().setRectSpot(pt.actualBounds,re);yt.subtract(pt.location),yt.scale(2,2),yt.x+=Math.sign(yt.x)*130,yt.y+=Math.sign(yt.y)*130,yt.add(pt.location),yt.snapToGridPoint(pe.diagram.grid.gridOrigin,pe.diagram.grid.gridCellSize);var xt=at.copyNodeData(pt.data);at.setGroupKeyForNodeData(xt,at.getGroupKeyForNodeData(pt.data)),at.addNodeData(xt);var Nn={from:pt.key,to:at.getKeyForNodeData(xt)};at.addLinkData(Nn);var en=pe.diagram.findNodeForData(xt);en.location=yt,pe.diagram.select(en),setTimeout(()=>{pe.diagram.commandHandler.editTextBlock()},20)})};return oe(a.Shape,{figure:ge,alignment:re,alignmentFocus:re.opposite(),width:re.equals(a.Spot.Top)||re.equals(a.Spot.Bottom)?25:18,height:re.equals(a.Spot.Top)||re.equals(a.Spot.Bottom)?18:25,fill:"orange",stroke:ze.white,strokeWidth:4,mouseEnter:(pe,Xe)=>Xe.fill="dodgerblue",mouseLeave:(pe,Xe)=>Xe.fill="orange",isActionable:!0,click:Le,contextClick:Le})}function Lt(re){return oe(a.Shape,{fill:"orange",stroke:"rgba(0, 0, 0, 0)",strokeWidth:15,background:"transparent",geometryString:"F1 M0 0 b 0 360 -4 0 4 z M10 0 b 0 360 -4 0 4 z M20 0 b 0 360 -4 0 4",isActionable:!0,cursor:"context-menu",mouseEnter:(ge,Le)=>Le.fill="dodgerblue",mouseLeave:(ge,Le)=>Le.fill="orange",click:(ge,Le)=>{ge.diagram.commandHandler.showContextMenu(Le.part.adornedPart)}},re||{})}E.current.nodeTemplate.selectionAdornmentTemplate=oe(a.Adornment,"Spot",oe(a.Placeholder,{padding:10}),Tt(a.Spot.Top,"TriangleUp"),Tt(a.Spot.Left,"TriangleLeft"),Tt(a.Spot.Right,"TriangleRight"),Tt(a.Spot.Bottom,"TriangleDown"),Lt({alignment:new a.Spot(.75,0)}));function ft(re,ge){return(Le,pe)=>{Le.handled=!0,Le.diagram.model.commit(Xe=>{Xe.set(pe.part.adornedPart.data,re,ge)})}}function lt(re,ge){return ge||(ge="color"),oe(a.Shape,{width:16,height:16,stroke:"lightgray",fill:re,margin:1,background:"transparent",mouseEnter:(Le,pe)=>pe.stroke="dodgerblue",mouseLeave:(Le,pe)=>pe.stroke="lightgray",click:ft(ge,re),contextClick:ft(ge,re)})}function Yt(){return[oe("ContextMenuButton",oe(a.Panel,"Horizontal",lt(ze.white,"fill"),lt(ze.beige,"fill"),lt(ze.extralightblue,"fill"),lt(ze.extralightred,"fill"))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",lt(ze.lightgray,"fill"),lt(ze.lightgreen,"fill"),lt(ze.lightblue,"fill"),lt(ze.lightred,"fill")))]}function Jt(){return[oe("ContextMenuButton",oe(a.Panel,"Horizontal",lt(ze.black),lt(ze.green),lt(ze.blue),lt(ze.red))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",lt(ze.white),lt(ze.magenta),lt(ze.purple),lt(ze.orange)))]}function Xt(re,ge){return ge||(ge="thickness"),oe(a.Shape,"LineH",{width:16,height:16,strokeWidth:re,margin:1,background:"transparent",mouseEnter:(Le,pe)=>pe.background="dodgerblue",mouseLeave:(Le,pe)=>pe.background="transparent",click:ft(ge,re),contextClick:ft(ge,re)})}function cn(re,ge){return ge||(ge="dash"),oe(a.Shape,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:re,margin:1,background:"transparent",mouseEnter:(Le,pe)=>pe.background="dodgerblue",mouseLeave:(Le,pe)=>pe.background="transparent",click:ft(ge,re),contextClick:ft(ge,re)})}function Qt(){return[oe("ContextMenuButton",oe(a.Panel,"Horizontal",Xt(1),Xt(2),Xt(3),Xt(4))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",cn(null),cn([2,4]),cn([4,4])))]}function wt(re,ge){return ge||(ge="figure"),oe(a.Shape,{width:32,height:32,scale:.5,fill:"lightgray",figure:re,margin:1,background:"transparent",mouseEnter:(Le,pe)=>pe.fill="dodgerblue",mouseLeave:(Le,pe)=>pe.fill="lightgray",click:ft(ge,re),contextClick:ft(ge,re)})}E.current.nodeTemplate.contextMenu=oe("ContextMenu",oe("ContextMenuButton",oe(a.Panel,"Horizontal",wt("Rectangle"),wt("RoundedRectangle"),wt("Ellipse"),wt("Diamond"))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",wt("Parallelogram2"),wt("ManualOperation"),wt("Procedure"),wt("Cylinder1"))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",wt("Terminator"),wt("CreateRequest"),wt("Document"),wt("TriangleDown"))),Yt(),Jt(),Qt()),E.current.groupTemplate=oe(a.Group,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:a.Spot.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:(re,ge)=>{var Le=ge.addMembers(ge.diagram.selection,!0);Le||ge.diagram.currentTool.doCancel()},avoidable:!1},new a.Binding("location","loc",a.Point.parse).makeTwoWay(a.Point.stringify),oe(a.Panel,"Auto",{name:"BODY"},oe(a.Shape,{parameter1:10,fill:ze.white,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:a.Spot.AllSides,toSpot:a.Spot.AllSides},new a.Binding("fill"),new a.Binding("stroke","color"),new a.Binding("strokeWidth","thickness"),new a.Binding("strokeDashArray","dash")),oe(a.Placeholder,{background:"transparent",margin:20})),oe(a.TextBlock,{alignment:a.Spot.Top,alignmentFocus:a.Spot.Bottom,font:"bold 12pt sans-serif",editable:!0},new a.Binding("text"),new a.Binding("stroke","color"))),E.current.groupTemplate.selectionAdornmentTemplate=oe(a.Adornment,"Spot",oe(a.Panel,"Auto",oe(a.Shape,{fill:null,stroke:"dodgerblue",strokeWidth:3}),oe(a.Placeholder,{margin:1.5})),Lt({alignment:a.Spot.TopRight,alignmentFocus:a.Spot.BottomRight})),E.current.groupTemplate.contextMenu=oe("ContextMenu",Yt(),Jt(),Qt()),E.current.linkTemplate=oe(a.Link,{layerName:"Foreground",routing:a.Link.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new a.Binding("fromSpot","fromSpot",a.Spot.parse),new a.Binding("toSpot","toSpot",a.Spot.parse),new a.Binding("fromShortLength","dir",re=>re>=1?10:0),new a.Binding("toShortLength","dir",re=>re>=1?10:0),new a.Binding("points").makeTwoWay(),oe(a.Shape,{strokeWidth:2},new a.Binding("stroke","color"),new a.Binding("strokeWidth","thickness"),new a.Binding("strokeDashArray","dash")),oe(a.Shape,{segmentIndex:0,segmentOffset:new a.Point(15,0),segmentOrientation:a.Link.OrientAlong,alignmentFocus:a.Spot.Right,figure:"circle",width:10,strokeWidth:0},new a.Binding("fill","color"),new a.Binding("visible","dir",re=>re===1)),oe(a.Shape,{segmentIndex:-1,segmentOffset:new a.Point(-10,6),segmentOrientation:a.Link.OrientPlus90,alignmentFocus:a.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new a.Binding("fill","color"),new a.Binding("visible","dir",re=>re>=1),new a.Binding("width","thickness",re=>7+3*re),new a.Binding("height","thickness",re=>7+3*re),new a.Binding("segmentOffset","thickness",re=>new a.Point(-15,4+1.5*re))),oe(a.Shape,{segmentIndex:0,segmentOffset:new a.Point(15,-6),segmentOrientation:a.Link.OrientMinus90,alignmentFocus:a.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new a.Binding("fill","color"),new a.Binding("visible","dir",re=>re===2),new a.Binding("width","thickness",re=>7+3*re),new a.Binding("height","thickness",re=>7+3*re),new a.Binding("segmentOffset","thickness",re=>new a.Point(-15,4+1.5*re))),oe(a.TextBlock,{alignmentFocus:new a.Spot(0,1,-4,0),editable:!0},new a.Binding("text").makeTwoWay(),new a.Binding("stroke","color"))),E.current.linkTemplate.selectionAdornmentTemplate=oe(a.Adornment,oe(a.Shape,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:dn(2)},new a.Binding("pathPattern","thickness",dn)),Lt({alignmentFocus:new a.Spot(0,0,-6,-4)}));function dn(re){return oe(a.Shape,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(re+4).toString()+" H3"})}function Zt(re){var ge="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return re===0?ge="M0 0 M16 16 M0 8 L16 8":re===2&&(ge="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),oe(a.Shape,{geometryString:ge,margin:2,background:"transparent",mouseEnter:(Le,pe)=>pe.background="dodgerblue",mouseLeave:(Le,pe)=>pe.background="transparent",click:ft("dir",re),contextClick:ft("dir",re)})}function yn(re){var ge=(Le,pe)=>{Le.handled=!0,Le.diagram.model.commit(Xe=>{var at=pe.part.adornedPart;Xe.set(at.data,re?"toSpot":"fromSpot",a.Spot.stringify(a.Spot.AllSides)),(re?at.toNode:at.fromNode).invalidateConnectedLinks()})};return oe(a.Shape,{width:12,height:12,fill:"transparent",mouseEnter:(Le,pe)=>pe.background="dodgerblue",mouseLeave:(Le,pe)=>pe.background="transparent",click:ge,contextClick:ge})}function ne(re,ge){var Le=0,pe=a.Spot.RightSide;re.equals(a.Spot.Top)?(Le=270,pe=a.Spot.TopSide):re.equals(a.Spot.Left)?(Le=180,pe=a.Spot.LeftSide):re.equals(a.Spot.Bottom)&&(Le=90,pe=a.Spot.BottomSide),ge||(Le-=180);var Xe=(at,pt)=>{at.handled=!0,at.diagram.model.commit(yt=>{var xt=pt.part.adornedPart;yt.set(xt.data,ge?"toSpot":"fromSpot",a.Spot.stringify(pe)),(ge?xt.toNode:xt.fromNode).invalidateConnectedLinks()})};return oe(a.Shape,{alignment:re,alignmentFocus:re.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:Le,background:"transparent",mouseEnter:(at,pt)=>pt.background="dodgerblue",mouseLeave:(at,pt)=>pt.background="transparent",click:Xe,contextClick:Xe})}E.current.linkTemplate.contextMenu=oe("ContextMenu",Jt(),Qt(),oe("ContextMenuButton",oe(a.Panel,"Horizontal",Zt(0),Zt(1),Zt(2))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",oe(a.Panel,"Spot",yn(!1),ne(a.Spot.Top,!1),ne(a.Spot.Left,!1),ne(a.Spot.Right,!1),ne(a.Spot.Bottom,!1)),oe(a.Panel,"Spot",{margin:new a.Margin(0,0,0,2)},yn(!0),ne(a.Spot.Top,!0),ne(a.Spot.Left,!0),ne(a.Spot.Right,!0),ne(a.Spot.Bottom,!0)))));const On=`{ "class": "GraphLinksModel",
|
|
"nodeDataArray": [
|
|
{"text":"Find Problem","key":-9,"loc":"-20 -140","color":"#3358ff","fill":"white","figure":"Procedure","thickness":3},
|
|
{"text":"What do we want?","key":-10,"loc":"-65 -324.305","group":-16,"figure":"Ellipse","fill":"white"},
|
|
{"text":"What do our users want?","key":-11,"loc":"105 -334.305","group":-20,"figure":"Ellipse","fill":"#ffffff","color":"black"},
|
|
{"text":"Meetings","key":-12,"loc":"-65 -444.305","group":-16,"figure":"TriangleDown","fill":"#ffffff"},
|
|
{"text":"Reviews","key":-13,"loc":"105 -454.305","group":-20,"figure":"TriangleDown","fill":"#ffffff","color":"black"},
|
|
{"text":"Can we solve it?","key":-14,"loc":"190 -140","color":"#7d33ff","fill":"#ffffff","figure":"Diamond","size":"140 80","thickness":3},
|
|
{"isGroup":true,"text":"Internal","key":-16,"loc":"-65 -384.305","fill":"#d5ebff","dash":null,"thickness":1,"group":-22},
|
|
{"isGroup":true,"text":"External","key":-20,"loc":"105 -394.305","fill":"#d5ebff","dash":null,"thickness":1,"group":-22},
|
|
{"isGroup":true,"text":"Sources","key":-22,"loc":"20 -400","fill":"#a5d2fa","dash":[4,4],"color":"#3358ff"}
|
|
],
|
|
"linkDataArray": [
|
|
{"from":-12,"to":-10,"points":[-65,-414.305,-65,-404.305,-65,-384.305,-65,-384.305,-65,-364.305,-65,-354.305],"dash":null,"dir":1},
|
|
{"from":-13,"to":-11,"points":[105,-424.305,105,-414.305,105,-394.305,105,-394.305,105,-374.305,105,-364.305],"dash":null,"color":"#000000","dir":1},
|
|
{"from":-10,"to":-9,"points":[-65,-294.305,-65,-284.305,-65,-232.1525,-40,-232.1525,-40,-180,-40,-170],"dir":2,"dash":[4,4]},
|
|
{"from":-11,"to":-9,"points":[105,-304.305,105,-294.305,105,-237.1525,0,-237.1525,0,-180,0,-170],"dash":[4,4],"dir":2},
|
|
{"from":-9,"to":-14,"points":[40,-150,58,-150,80,-150,80,-153.33333333333331,102,-153.33333333333331,120,-153.33333333333331],"dir":1,"color":"#3358ff"},
|
|
{"from":-14,"to":-9,"points":[190,-100,190,-90,-20,-90,-20,-95,-20,-100,-20,-110],"fromSpot":"BottomSide","toSpot":"BottomSide","text":"No","color":"#ff3333","thickness":2,"dir":1},
|
|
{"from":-9,"to":-14,"points":[40,-130,58,-130,80,-130,80,-126.66666666666666,102,-126.66666666666666,120,-126.66666666666666]}
|
|
]}`;var qt=["Rectangle","Square","RoundedRectangle","Border","Ellipse","Circle","TriangleRight","TriangleDown","TriangleLeft","TriangleUp","Triangle","Diamond","LineH","LineV","None","BarH","BarV","MinusLine","PlusLine","XLine","LineRight","LineDown","LineLeft","LineUp"];function fn(re){return console.log("shapeName:",re),qt.indexOf(re)>=0}var Dt=new a.Palette(Be.current,{maxSelectionCount:1,linkTemplate:oe(a.Link,{locationSpot:a.Spot.Center,selectionAdornmentTemplate:oe(a.Adornment,"Link",{locationSpot:a.Spot.Center},oe(a.Shape,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),oe(a.Shape,{toArrow:"Standard",stroke:null}))},{routing:a.Link.AvoidsNodes,curve:a.Link.JumpOver,corner:5,toShortLength:4},new a.Binding("points"),oe(a.Shape,{isPanelMain:!0,strokeWidth:2}),oe(a.Shape,{toArrow:"Standard",stroke:null})),model:new a.GraphLinksModel([{text:"\u672A\u547D\u540D",size:"100 100",fill:null,stroke:"#000"},...a.Shape.getFigureGenerators().toArray().map(re=>({text:"\u672A\u547D\u540D",size:"100 100",figure:re.key,fill:"white",stroke:"#666",borderColor:"#000"}))])});return E.current.addDiagramListener("TextEdited",function(re){var ge;const Le=re.subject.part;var pe=(ge=document.activeElement)==null?void 0:ge.value;typeof pe=="string"&&pe.trim()===""&&E.current.model.commit(function(Xe){Xe.set(Le.data,"text","\u672A\u547D\u540D"),E.current.commandHandler.stopCommand()},"increment")}),Dt.nodeTemplate=oe(a.Node,"Auto",{locationSpot:a.Spot.Center},new a.Binding("location","location",a.Point.parse).makeTwoWay(a.Point.stringify),oe(a.Shape,"Circle",{fill:"white",stroke:"gray",strokeWidth:2,width:20,height:20,portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromLinkableSelfNode:!0,toLinkableSelfNode:!0},new a.Binding("stroke").makeTwoWay(),new a.Binding("fill").makeTwoWay(),new a.Binding("figure")),oe(a.TextBlock,{margin:new a.Margin(5,5,3,5),font:"10pt sans-serif",minSize:new a.Size(16,16),maxSize:new a.Size(10,NaN),textAlign:"center",editable:!0},new a.Binding("key").makeTwoWay())),setTimeout(()=>{E.current.grid=oe(a.Panel,"Grid",oe(a.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),oe(a.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),E.current.grid.visible=!0,E.current.grid.gridCellStroke="darkgray",E.current.grid.gridCellStrokeWidth=1},300),window.myDiagrams=E.current,E.current}const _t=()=>pn(this,null,function*(){var oe=E.current.makeImage();const ze=yield(0,jt.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:oe.src}});x({src:ze.url})});return(0,y.useEffect)(()=>(setTimeout(()=>{rt()},500),Je(He+1),()=>{E.current=null}),[]),ot.createElement("div",{ref:Ve,className:ye.current?`${zt.maxH60} body-overflow-initial`:"body-overflow-initial"},ot.createElement(ie.default,{width:1200,icon:null,footer:null,closable:!0,visible:!!He,destroyOnClose:!0,maskClosable:!1,rootClassName:"zIndex-9999",title:ot.createElement(ue.Z,null,ot.createElement(Ke.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),ot.createElement(Ke.Z,{onClick:()=>{var oe,ze,Tt=E.current.selection.first();if(ye.current=!ye.current,document.activeElement&&Tt){let Lt=(ze=(oe=document.activeElement)==null?void 0:oe.value)==null?void 0:ze.trim();typeof Lt=="string"&&E.current.model.commit(function(ft){ft.set(Tt.data,"text",Lt||"\u672A\u547D\u540D"),E.current.commandHandler.stopCommand()},"increment")}Je(He+1)}},ot.createElement("span",{className:"current c-blue mr30",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77"))),onCancel:b},ot.createElement("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative"},className:zt.flowChartWrp},ot.createElement("div",{style:{display:"flex",height:"100%"}},ot.createElement("div",{style:{width:"300px",height:"100%"}},ot.createElement("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"}},"\u56FE\u5F62\u5E93"),ot.createElement("div",{style:{height:"calc(100% - 50px)"},className:zt.myPaletteDiv,ref:Be})),ot.createElement("div",{style:{flex:1,position:"relative"}},ot.createElement("div",{ref:le,style:{height:"80vh"}}))),ot.createElement("div",{className:"tr"},ot.createElement(Ye.ZP,{size:"large",onClick:_t,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))))}var Nt=hn,$t=z(98554),Ut=z(17741);const Kt=$t.ZP.Group,Gt={margin:"0 8px"};var vt=({callback:b,onCancel:x})=>{function E(le){b(le)}return y.createElement(Re.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:E},y.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},y.createElement("span",{style:Gt},"\u5355\u5143\u683C\u6570\uFF1A"),y.createElement("span",{style:Gt},"\u884C\u6570"),y.createElement(Re.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},y.createElement(Ut.Z,null)),y.createElement("span",{style:Gt},"\u5217\u6570"),y.createElement(Re.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},y.createElement(Ut.Z,null))),y.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},y.createElement("span",{style:Gt},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),y.createElement(Re.default.Item,{name:"align"},y.createElement(Kt,null,y.createElement($t.ZP,{value:"default"},y.createElement("i",{className:"fa fa-align-justify"})),y.createElement($t.ZP,{value:"left"},y.createElement("i",{className:"fa fa-align-left"})),y.createElement($t.ZP,{value:"center"},y.createElement("i",{className:"fa fa-align-center"})),y.createElement($t.ZP,{value:"right"},y.createElement("i",{className:"fa fa-align-right"}))))),y.createElement("div",{className:"flex-container flex-end"},y.createElement(Ye.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.createElement(Ye.ZP,{type:"ghost",onClick:x},"\u53D6\u6D88")))},Bt=z(78673),vn=z(39517),Zn=z.n(vn),Kn=(0,y.forwardRef)(({use3d:b,width:x,height:E,callback:le,showSaveButton:Be},ye)=>{const Ve=(0,y.useRef)(),He=(0,y.useRef)(),[Je,rt]=(0,y.useState)(!1),_t=(0,y.useRef)({id:Ve,appName:"graphing",width:x||1e3,height:E||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,y.useEffect)(()=>{He.current=new(Zn())(_t.current,!0),window.onload=function(){He.current.inject("applet_container")}},[]);const oe=()=>{var ze=window.ggbApplet.getPNGBase64(1,!0,72);return le&&le(ze),ze};return(0,y.useEffect)(()=>{_t.current.appName=Je?"3D":"graphing",He.current.inject("applet_container")},[Je]),(0,y.useEffect)(()=>{rt(b)},[b]),(0,y.useImperativeHandle)(ye,()=>({getImgData:oe})),y.createElement(y.Fragment,null,y.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:Ve}),y.createElement(ue.Z,{align:"middle"},y.createElement(Ke.Z,{flex:1},y.createElement(Bt.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Je,onChange:ze=>rt(ze)})),y.createElement(Ke.Z,null,y.createElement(Ye.ZP,{size:"large",onClick:oe,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),Yn=z(87144),Jn=z(8591);const an="link",ln="upload-image",At="add-flowchart",Vt="draw-image",Xn="add-flowchart",sn="code-block",un="add-table",wn="------------",Qn={default:wn,left:`:${wn}`,center:`:${wn}:`,right:`${wn}:`};var qn=z(94598);function vi(){}let wi=0;const Pn=1e4,ei="\u2581",An="@\u2581\u2581@",Ln="@\u2581@",ti=`
|
|
**\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`,Dn=["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 Mn(b){return/^\d+$/.test(b)?`${b}px`:b}const Fn=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",ni={[Fn+"-B"]:"bold",[Fn+"-I"]:"italic"},Tn={[an]:"\u6DFB\u52A0\u94FE\u63A5",[sn]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[ln]:"\u6DFB\u52A0\u56FE\u7247",[Vt]:"\u6DFB\u52A0\u753B\u56FE",[At]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[un]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var ii=({defaultValue:b="",onChange:x,width:E="100%",height:le=400,miniToolbar:Be=!1,isFocus:ye=!1,watch:Ve,insertTemp:He,mode:Je="markdown",id:rt="markdown-editor-id",showResizeBar:_t=!1,noStorage:oe=!1,showNullButton:ze=!1,showNullProgramButton:Tt=!1,hidetoolBar:Lt=!1,fullScreen:ft=!1,onBlur:lt,onCMBeforeChange:Yt,onFullScreen:Jt,className:Xt="",disablePaste:cn=!1,disabled:Qt=!1,disabledFill:wt=!1,placeholder:dn="",values:Zt="",extraUse:yn})=>{const[ne,On]=(0,y.useState)(null),[qt,fn]=(0,y.useState)(b),[Dt,re]=(0,y.useState)(Ve),[ge,Le]=(0,y.useState)(ft),[pe,Xe]=(0,y.useState)(""),[at,pt]=(0,y.useState)(0),[yt,xt]=(0,y.useState)(le),[Nn,en]=(0,y.useState)(!1),[Gn,In]=(0,y.useState)(0),[Rn,Hn]=(0,y.useState)(0),tn=(0,y.useRef)(),Cn=(0,y.useRef)(),bn=(0,y.useRef)(),En=(0,y.useRef)();(0,y.useEffect)(()=>{const he=window.scrollY||window.pageYOffset;fn(Zt),ne==null||ne.setValue(Zt),window.scrollTo(0,he)},[Zt]),(0,y.useEffect)(()=>{Jt==null||Jt(ge)},[ge]),(0,y.useEffect)(()=>{if(tn.current){let he=function(ve,me){var $e;if(cn){me.preventDefault();return}const et=me.clipboardData;if(et){const ht=et.types.toString(),ut=et.items;if(ht==="Files"||et.types.indexOf("Files")>-1){if(me.preventDefault(),Je=="stex")return;try{let mt=ut[1];(($e=ut[0])==null?void 0:$e.kind)==="file"&&(mt=ut[0]);const gt=mt.getAsFile(),Ft=gt.name.split(".").pop();(0,ee.I)(gt,Ct=>{var Sn,Bn,kn;Ct.id?((Sn=gt==null?void 0:gt.type)==null?void 0:Sn.indexOf("image"))>-1?se.replaceSelection(``):((Bn=gt==null?void 0:gt.type)==null?void 0:Bn.indexOf("video"))>-1?se.replaceSelection(`<video width="100%" controls src="/api/attachments/${Ct.id}"></video>`):((kn=gt==null?void 0:gt.type)==null?void 0:kn.indexOf("pdf"))>-1?se.replaceSelection(`<a href="/api/attachments/${Ct.id}?type=${gt.type}&disposition=inline" target="_blank">${gt.name}</a>`):Dn.includes(Ft)?se.replaceSelection(`<a href="/api/attachments/${Ct.id}?type=office&disposition=inline" target="_blank">${gt.name}</a>`):se.replaceSelection(`[${gt.name}](/api/attachments/${Ct.id}?type=${Ct.content_type})`):(Ct==null?void 0:Ct.status)===401&&(document.location.href="/user/login")})}catch(mt){Jn.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const se=Me().fromTextArea(tn.current,{mode:Je,lineNumbers:!Be,lineWrapping:!0,value:b,autoCloseTags:!0,autoCloseBrackets:!0});return se.on("keyup",function(ve,me){me.keyCode===8&&(ve.getValue()==""?se.setOption("placeholder",dn):se.setOption("placeholder",null))}),se.on("keydown",function(ve,me){if(me.keyCode===8){var $e=oi(ve);$e&&me.preventDefault()}}),ye&&se.focus(),se.on("paste",he),Qt&&se.on("beforeChange",function(ve,me){(me.origin==="paste"||me.origin==="+input")&&me.cancel()}),On(se),()=>{se.off("paste",he)}}},[]);const Wn=(0,y.useCallback)(()=>{if(Cn.current)try{}catch(he){console.log(he,"---- to set md editor body height")}},[yt,Cn,ge]);(0,y.useEffect)(()=>{function he(){let se=new Ce.Z(ve=>{for(let me of ve)(me.target.offsetHeight>0||me.target.offsetWidth>0)&&(Wn(),ne.setSize("100%","100%"),ne.refresh())});return se.observe(tn.current.parentElement),se}if(ne){const se=he();return()=>{var ve,me;(ve=tn.current)!=null&&ve.parentElement&&se.unobserve((me=tn.current)==null?void 0:me.parentElement)}}},[ne,Wn]),(0,y.useEffect)(()=>{if(ne){let he=[];for(const[se,ve]of Object.entries(ni)){let me={[se]:()=>{jn(ve)}};he.push(me),ne.addKeyMap(me)}return()=>{for(let se of he)ne.removeKeyMap(se)}}},[ne]),(0,y.useEffect)(()=>{ft!==ge&&Le(ft)},[ft]),(0,qn.Z)(()=>{if(!oe&&at>0){let he=new Date().getTime(),se=window.sessionStorage.getItem(rt);he>=at+Pn&&(!se||se!==qt)&&(window.sessionStorage.setItem(rt,qt),en(!0))}},Pn),(0,y.useEffect)(()=>{re(Ve)},[ne,Ve]),(0,y.useEffect)(()=>{ne&&ye&&ne.focus()},[ne,ye]),(0,y.useEffect)(()=>{if(Dt&&ne){let he=function(ve){let me=ve.target;if(En.current){let $e=me.scrollTop/me.scrollHeight;En.current.scrollTop=En.current.scrollHeight*$e}};const se=ne.getScrollerElement();return se.addEventListener("scroll",he),()=>{se.removeEventListener("scroll",he)}}},[ne,Dt]),(0,y.useEffect)(()=>{if(ne&&Yt){let he=function(se,ve){Yt(se,ve)};return ne.on("beforeChange",he),()=>{ne.off("beforeChange",he)}}},[ne,Yt]),(0,y.useEffect)(()=>{if(ne&<){let he=function(){lt(ne.getValue())};return ne.on("blur",he),()=>{ne.off("blur",he)}}},[ne,lt]);function oi(he,se){var ve=he.getDoc(),me=ve.getCursor(),$e=ve.getLine(me.line),et=$e.charAt(me.ch-1),ht=$e.lastIndexOf("@\u2581@",me.ch),ut=$e.lastIndexOf("@\u2581\u2581@",me.ch),mt=ht>ut?ht:ut,gt=ht>ut?3:4;if(An.indexOf(et)===-1)return null;if(console.log("change1:",se,he,$e,me,mt,ht,ut,et),mt>=0&&me.ch-mt<5){var Ft=mt+gt;return ve.replaceRange("",{line:me.line,ch:mt},{line:me.line,ch:Ft}),{line:me.line,ch:Ft}}return null}(0,y.useEffect)(()=>{if(ne){let he=function(se,ve){const me=se.getValue();fn(me),pt(new Date().getTime()),se.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),x&&(Tt?x(me,ui(me)):x(me))};return ne.on("change",he),()=>{ne.off("change",he)}}},[ne,x]),(0,y.useEffect)(()=>{if(ne)if(b==null)ne.setValue(""),fn("");else{const he=window.scrollY||window.pageYOffset;b!==ne.getValue()&&(ne.setValue(b),fn(b),ne.setCursor(Qt?1:ne.lineCount(),0),window.scrollTo(0,he))}},[ne,b]);const jn=(0,y.useCallback)(he=>{const se=ne.getCursor(),ve=ne.getSelection();let me=ve.split(`
|
|
`);switch(he){case"bold":return ne.replaceSelection("**"+ve+"**"),ve===""&&ne.setCursor(se.line,se.ch+2),ne.focus();case"italic":return ne.replaceSelection("*"+ve+"*"),ve===""&&ne.setCursor(se.line,se.ch+1),ne.focus();case"code":return ne.replaceSelection("`"+ve+"`"),ve===""&&ne.setCursor(se.line,se.ch+1),ne.focus();case"inline-latex":return Xe("inline-latex"),ne.focus();case"latex":return ne.replaceSelection("```latex\n"+ve+"\n```"),ne.setCursor(se.line+1,ve.length+1),ne.focus();case"line-break":return ne.replaceSelection(`<br/>
|
|
`),ne.focus();case"list-ul":return ve===""?ne.replaceSelection("- "+ve):ne.replaceSelection(me.map($e=>$e===""?"":`- ${$e}`).join(`
|
|
`)),ne.focus();case"list-ol":return ve===""?ne.replaceSelection("1. "+ve):ne.replaceSelection(me.map(($e,et)=>$e===""?"":`${et+1}. ${$e}`).join(`
|
|
`)),ne.focus();case"add-null-ch":return ve===""&&ne.setCursor(se.line,se.ch),ne.replaceSelection(ei),ne.focus();case"add-signal":return ve===""&&ne.setCursor(se.line,se.ch),ne.replaceSelection(Ln),ne.focus();case"add-multiple":return ve===""&&ne.setCursor(se.line,se.ch),ne.replaceSelection(An),ne.focus();case"inster-template-1":return ve===""&&ne.setCursor(se.line,se.ch),ne.replaceSelection(ti),ne.focus();case"eraser":return ne.setValue(""),ne.focus();case"trigger-watch":return re(!Dt),ne.focus();case"trigger-full-screen":return Le(!ge),ne.focus();case an:Xe(an);return;case sn:Xe(sn);return;case ln:Xe(ln);return;case Vt:Xe(Vt);return;case"maths-latex":Xe("maths-latex");return;case At:Xe(At);return;case un:Xe(un);return;default:throw new Error}},[ne,Dt,ge]),Mt=(0,y.useCallback)((he,se)=>{var ve,me,$e,et,ht,ut;switch(Xe(""),pe){case an:const{title:Sn,link:Bn}=he;return ne.replaceSelection(`[${Sn}](${Bn})`),ne.focus();case sn:const{language:kn,content:fi}=he;return ne.replaceSelection(["```"+kn,fi,"```"].join(`
|
|
`)),ne.focus();case"maths-latex":for(var mt=atob(he),gt=new Uint8Array(mt.length),Ft=0;Ft<mt.length;Ft++)gt[Ft]=mt.charCodeAt(Ft);var Ct=new Blob([gt],{type:"image/png"});(0,ee.I)(Ct,Pt=>{Pt.id?ne.replaceSelection(``):(Pt==null?void 0:Pt.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":ne.replaceSelection("`$$"+he+"$$`");break;case ln:case Vt:case Xn:const{src:nn,alt:_n}=he,bt=se,mi=($e=(me=(ve=bt==null?void 0:bt.name)==null?void 0:ve.split("."))==null?void 0:me.pop)==null?void 0:$e.call(me);return((et=bt==null?void 0:bt.type)==null?void 0:et.indexOf("image"))>-1||!(bt!=null&&bt.type)?_n?ne.replaceSelection(``):ne.replaceSelection(``):((ht=bt==null?void 0:bt.type)==null?void 0:ht.indexOf("video"))>-1?ne.replaceSelection(`<video width="100%" controls src="${nn}"></video>`):((ut=bt==null?void 0:bt.type)==null?void 0:ut.indexOf("pdf"))>-1?ne.replaceSelection(`<a href="${nn}?type=${bt.type}&disposition=inline" target="_blank">${bt.name}</a>`):Dn.includes(mi)?ne.replaceSelection(`<a href="${nn}?type=office&disposition=inline" target="_blank">${bt.name}</a>`):ne.replaceSelection(`[${bt.name}](${nn})`),ne.focus();case un:const{row:gi,col:zn,align:pi}=he;let xn=`
|
|
`;for(let Pt=0;Pt<gi;Pt++){let $n=[],Un=[];for(let Vn=0;Vn<zn;Vn++)Pt===1&&Un.push(Qn[pi]),$n.push(" ");Pt===1&&(xn+=`| ${Un.join(" | ")} |
|
|
`),xn+=`| ${$n.join(zn===1?"":" | ")} |
|
|
`}return ne.replaceSelection(xn+`
|
|
`),ne.focus();default:throw new Error}},[ne,pe]),ri=(0,y.useMemo)(()=>{switch(pe){case an:return y.createElement(rn,{callback:Mt,onCancel:It});case sn:return y.createElement(gn.Z,{callback:Mt,onCancel:It});case ln:return y.createElement(ee.Z,{callback:Mt,onCancel:It});case At:return y.createElement(Nt,{callback:Mt,onCancel:It});case un:return y.createElement(vt,{callback:Mt,onCancel:It});case"maths-latex":return y.createElement(Kn,{showSaveButton:!0,callback:Mt});case"inline-latex":return y.createElement(Yn.Z,{showSaveButton:!0,callback:Mt});default:return null}},[pe]);function It(){Xe("")}(0,y.useEffect)(()=>{if(bn.current){let he=function(ht){$e=!0,et=ht.pageY},se=function(){$e=!1},ve=function(ht){if($e){let ut=ht.pageY-et;ut<0&&(ut=0),ut>300&&(ut=300);let mt=le+ut+"px";xt(mt)}},me=bn.current,$e=!1,et=0;return me.addEventListener("mousedown",he),document.addEventListener("mousemove",ve),document.addEventListener("mouseup",se),()=>{me.removeEventListener("mousedown",he),document.removeEventListener("mousemove",ve),document.removeEventListener("mouseup",se)}}},[ne,bn]),(0,y.useEffect)(()=>{xt(le)},[le]);const ai=Mn(E),li=Mn(yt),si={width:ai,height:li},bi=(0,y.useMemo)(()=>{if(at){let he=new Date(at),se=he.getHours(),ve=he.getMinutes(),me=he.getSeconds();return se=se<10?"0"+se:se,ve=ve<10?"0"+ve:ve,me=me<10?"0"+me:me,`${se}:${ve}:${me}`}return 0},[at]),ui=he=>{const se=[];if(Tt){let ve=-1;he=he.replace(/(@▁▁@|@▁@)/g,function(me,$e,et){se.push({multiLine:me!==Ln})})}return se};function Ei(){window.sessionStorage.removeItem(rt),en(!1),pt(0)}function Si(){en(!1),pt(0),ne.setValue(window.sessionStorage.getItem(rt))}(0,y.useEffect)(()=>{Tn[pe]&&pe!==Vt&&pe!==At&&setTimeout(()=>{const he=document.getElementsByClassName("markdown-popup-form")[0],se=window.innerWidth/2-he.offsetWidth/2,ve=window.innerHeight/2-he.offsetHeight/2;In(se),Hn(ve)},0)},[pe]);const ci=he=>{he.preventDefault();const se=he.clientX-Gn,ve=he.clientY-Rn;document.body.onmousemove=me=>{let $e=me.clientX-se,et=me.clientY-ve;const ht=document.getElementsByClassName("markdown-popup-form")[0],ut=window.innerWidth-ht.offsetWidth,mt=window.innerHeight-ht.offsetHeight;$e=Math.max(0,Math.min($e,ut)),et=Math.max(0,Math.min(et,mt)),di(me.clientX,me.clientY,se,ve)&&(In($e),Hn(et))},document.body.onmouseup=function(){document.body.onmousemove=null}},di=(he,se,ve,me)=>{const $e=document.body.clientHeight,et=document.body.clientWidth;return he<20&&ve>he||he>et-20&&ve<he||se<20&&me>se||se>$e-20&&me<se?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return y.createElement(y.Fragment,null,y.createElement("div",{className:"markdown-editor-wrapper",ref:Cn},y.createElement("div",{className:`markdown-editor-container ${Xt} ${Dt?"on-preview":""} ${Be?"mini":""} ${ge?"full-screen":""}`,style:si},y.createElement(je,{insertTemp:He,watch:Dt,fullScreen:ge,showNullButton:ze,showNullProgramButton:Tt,onActionCallback:jn,hidetoolBar:Lt,extraUse:yn}),y.createElement("div",{className:"markdown-editor-body"},y.createElement("div",{className:"codemirror-container"},y.createElement("textarea",{ref:tn,placeholder:dn})),Dt?y.createElement("div",{ref:En,className:"preview-container"},Je==="stex"&&y.createElement(ke,{value:qt}),Je!=="stex"&&y.createElement(Oe.Z,{disabledFill:wt,showProgramFill:Tt,value:qt})):null))),_t?y.createElement("a",{ref:bn,className:"editor-resize"}):null,pe===Vt&&y.createElement(Ae,{callback:Mt,onCancel:It}),pe===At&&y.createElement(Nt,{callback:Mt,onCancel:It}),y.createElement(it.Z,null,Tn[pe]&&pe!==Vt&&pe!==At?y.createElement(ie.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Gn,top:Rn},title:y.createElement("div",{style:{cursor:"move"},onMouseDown:ci},Tn[pe]),open:!0,onCancel:It,footer:null,destroyOnClose:!0,width:pe===At?"1200px":null,height:pe===At?"80vh":null,className:"markdown-popup-form"},ri):null))}},11901:function(ae,De,z){"use strict";z.d(De,{Z:function(){return Ge},I:function(){return Ie}});var y=z(78700),Fe=z(8591),Me=z(92832),Ce=z(3113),te=z(23333),fe=z(59301),Ee=z(59301),Se=Object.defineProperty,we=Object.defineProperties,_e=Object.getOwnPropertyDescriptors,Oe=Object.getOwnPropertySymbols,ke=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,Te=(Pe,xe,je)=>xe in Pe?Se(Pe,xe,{enumerable:!0,configurable:!0,writable:!0,value:je}):Pe[xe]=je,Qe=(Pe,xe)=>{for(var je in xe||(xe={}))ke.call(xe,je)&&Te(Pe,je,xe[je]);if(Oe)for(var je of Oe(xe))be.call(xe,je)&&Te(Pe,je,xe[je]);return Pe},Ze=(Pe,xe)=>we(Pe,_e(xe));const{useForm:qe}=y.default,tt={width:280,marginRight:10},nt={labelCol:{span:5},wrapperCol:{span:19}};var Ge=({callback:Pe,onCancel:xe})=>{const[je]=qe();let it=(0,fe.useRef)();function Re(ct){Pe(ct,it.current)}function st(ct,Et){if(ct.status===-1){Fe.ZP.error(ct.message);return}je.setFieldsValue({src:`/api/attachments/${ct.id}`,type:Et.type})}function Ye(ct){let Et=ct.target.files[0];it.current=Et,Ie(Et,st)}return Ee.createElement(y.default,Ze(Qe({form:je},nt),{className:"upload-image-panel",onFinish:Re,style:{width:470,overflow:"hidden"}}),Ee.createElement(y.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},Ee.createElement("div",{className:"flex-container"},Ee.createElement(y.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},Ee.createElement(Me.default,{style:tt})),Ee.createElement(Ue,{onFileChange:Ye}))),Ee.createElement(y.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},Ee.createElement(Me.default,{style:{width:264}})),Ee.createElement(y.default.Item,{style:{textAlign:"right"}},Ee.createElement(Ce.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),Ee.createElement(Ce.ZP,{type:"default",onClick:xe},"\u53D6\u6D88")))};function Ue({onFileChange:Pe}){return Ee.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",Ee.createElement("input",{type:"file",onChange:Pe}))}function Ie(Pe,xe){if(!Pe)throw new String("\u6CA1\u6709\u6587\u4EF6");let je=new FormData;je.append("editormd-image-file",Pe),je.append("file_param_name","editormd-image-file"),je.append("byxhr","true");var it=new window.XMLHttpRequest;it.withCredentials=!0,it.addEventListener("load",function(Re){xe(JSON.parse(Re.target.responseText),Pe)},!1),it.addEventListener("error",function(Re){console.error(Re)},!1),it.open("POST",`${te.KI}/api/attachments.json`),it.send(je)}},78780:function(ae,De,z){"use strict";z.d(De,{Z:function(){return Me}});var y=z(59301),Fe=z(4676);class Me extends y.Component{constructor(te){super(te);const fe=window.document;this.node=fe.createElement("div"),fe.body.appendChild(this.node)}render(){const{children:te}=this.props;return(0,Fe.createPortal)(te,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},94598:function(ae,De,z){"use strict";z.d(De,{Z:function(){return Fe}});var y=z(59301);function Fe(Me,Ce){const te=(0,y.useRef)();(0,y.useEffect)(()=>{te.current=Me}),(0,y.useEffect)(()=>{function fe(){te.current()}if(Ce!==null){let Ee=setInterval(fe,Ce);return()=>clearInterval(Ee)}},[Ce])}}}]);
|