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

33 lines
86 KiB

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