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

1 line
121 KiB

This file contains ambiguous Unicode characters!

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

(self.webpackChunk=self.webpackChunk||[]).push([[94498,98772],{38229:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof=__webpack_require__(31468).default;(function(){if("function"!=typeof window.GGBApplet){var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var e={},t="5.0",n={},i=null,o=!1,a=!1,r=null,l=!1,s=null,c=null,u=0;u<arguments.length;u++){var d=arguments[u];if(null!==d)switch(_typeof(d)){case"number":t=d.toFixed(1);break;case"string":d.match(new RegExp("^[0-9]\\.[0-9]+$"))?t=d:r=d;break;case"object":void 0!==d.is3D?i=d:n=d;break;case"boolean":o=d,a=!0}}null===i&&(i={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},void 0===n.material_id||a||(o=!0)),null!==r&&void 0===n.id&&(n.id=r);var f="",p=!1,h=null,m=null,g=null,v=!1,w=null,b=null,x=null;void 0!==n.height&&(n.height=Math.round(n.height)),void 0!==n.width&&(n.width=Math.round(n.width));var y=function(e){return parseFloat(e)>4?parseFloat(e):5};function _(){try{return window.self!==window.top}catch(e){return!0}}function S(){return(!n.hasOwnProperty("screenshotGenerator")||!n.screenshotGenerator)&&Math.max(screen.width,screen.height)<800}e.setHTML5Codebase=function(e,t){c=e,Z(e,t)},e.setJavaCodebase=e.setJavaCodebaseVersion=e.isCompiledInstalled=e.setPreCompiledScriptPath=e.setPreCompiledResourcePath=function(){},e.setHTML5CodebaseVersion=function(e,t){var n=parseFloat(e);NaN!==n&&n<5?console.log("The GeoGebra HTML5 codebase version "+n+" is deprecated. Using version latest instead."):(s=e,O(e,t))},e.getHTML5CodebaseVersion=function(){return m},e.getParameters=function(){return n},e.setFontsCSSURL=function(e){x=e},e.setGiacJSURL=function(e){},e.setJNLPFile=function(e){e},e.setJNLPBaseDir=function(e){},e.inject=function(){function t(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var i,o="auto",a=n.id,r=!1,s=0;s<arguments.length;s++){var c=arguments[s];"string"==typeof c?(c=c.toLowerCase()).match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?o=c:a=arguments[s]:"boolean"==typeof c?r=c:c instanceof HTMLElement&&(i=c)}function u(){if(l){o=M(o);var s=i||document.getElementById(a);if(s)if(e.removeExistingApplet(s,!1),void 0===n.width&&s.clientWidth&&(n.width=s.clientWidth),void 0===n.height&&s.clientHeight&&(n.height=s.clientHeight),n.width&&n.height||"html5"!==o||(delete n.width,delete n.height),h=o,"screenshot"===o)A(s,n);else{var c=!1;n.hasOwnProperty("playButton")&&n.playButton||n.hasOwnProperty("clickToLoad")&&n.clickToLoad?c=!0:n.hasOwnProperty("playButtonAutoDecide")&&n.playButtonAutoDecide&&(c=(!_()||t())&&S()),c?(h="screenshot",P(s,n,r,o)):T(s,n,r)}else console.log("possibly bug on ajax loading? ")}else setTimeout(u,200)}u()},e.getViews=function(){return i},e.isJavaInstalled=function(){return!1};var k=function(t){var o=function(){n.onError&&n.onError(),I("Error: Fetching material (id "+n.material_id+") failed.",n)},a=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",r="/materials/"+n.material_id+"?scope=basic";j("https://"+a+"/api/proxy.php?path="+encodeURIComponent(r),(function(a){var r=JSON.parse(a),l=r.elements?r.elements.filter((function(e){return"G"==e.type||"E"==e.type}))[0]:r;if(l&&l.url){n.fileName=l.url,C(l.settings||{}),i.is3D=!0;var s="https://www.geogebra.org/images/";e.setPreviewImage(w||l.previewUrl,s+"GeoGebra_loading.png",s+"applet_play.png"),t()}else o()}),o)};function C(e){["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach((function(t){e[t]=!!e[t]})),["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"].forEach((function(t){void 0===n[t]&&void 0!==e[t]&&(n[t]=e[t])})),void 0===n.showToolBarHelp&&(n.showToolBarHelp=n.showToolBar)}function j(e,t,n){var i=new XMLHttpRequest;i.open("GET",e),i.onload=function(){t(i.responseText)},i.onerror=n,i.send()}e.isHTML5Installed=function(){return!0},e.getLoadedAppletType=function(){return h},e.setPreviewImage=function(e,t,n){w=e,b=t,n},e.removeExistingApplet=function(e,t){var i;"string"==typeof e&&(e=document.getElementById(e)),h=null;var o=null;for(i=0;i<e.childNodes.length;i++){var a=e.childNodes[i],r=a.className;"applet_screenshot"===r?t?(a.style.display="block",h="screenshot"):a.style.display="none":"applet_scaler prerender"!==r&&(e.removeChild(a),o=r&&-1!=r.indexOf("appletParameters")?a.id:null,i--)}var l=void 0!==n.id?n.id:o,s=window[l];s&&"function"==typeof s.getBase64&&(s.remove(),window[l]=null)},e.refreshHitPoints=function(){if(y(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var t=e.getAppletObject();return!(!t||"function"!=typeof t.recalculateEnvironments)&&(t.recalculateEnvironments(),!0)},e.startAnimation=function(){var t=e.getAppletObject();return!(!t||"function"!=typeof t.startAnimation)&&(t.startAnimation(),!0)},e.stopAnimation=function(){var t=e.getAppletObject();return!(!t||"function"!=typeof t.stopAnimation)&&(t.stopAnimation(),!0)},e.getAppletObject=function(){var e=void 0!==n.id?n.id:"ggbApplet";return window[e]},e.resize=function(){};var B=function(e){return e&&"false"!==e},T=function(t,n,i){y(m)<=4.2&&(i=!0);var o=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==m||ggbHTML5LoadedCodebaseIsWebSimple&&!v)&&(o=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var a=document.createElement("div");a.classList.add("appletParameters","notranslate");var r=n.width,l=n.height;if(n.disableAutoScale=void 0===n.disableAutoScale?GGBAppletUtils.isFlexibleWorksheetEditor():n.disableAutoScale,void 0!==n.width)if(y(m)<=4.4)B(n.showToolBar)&&(n.height-=7),B(n.showAlgebraInput)&&(n.height-=37),n.width<605&&B(n.showToolBar)&&(n.width=605,r=605);else{var u=100;(B(n.showToolBar)||B(n.showMenuBar))&&(n.hasOwnProperty("customToolBar")&&(n.customToolbar=n.customToolBar),u=B(n.showMenuBar)?245:155),r<u&&(n.width=u,r=u)}for(var d in a.style.border="none",a.style.display="inline-block",n)n.hasOwnProperty(d)&&"appletOnLoad"!==d&&a.setAttribute("data-param-"+d,n[d]);x&&a.setAttribute("data-param-fontscssurl",x),e.resize=function(){GGBAppletUtils.responsiveResize(t,n)},window.addEventListener("resize",(function(t){e.resize()}));var p="function"==typeof n.appletOnLoad?n.appletOnLoad:function(){};if(i||void 0===n.width){var h=document.createElement("div");h.className="applet_scaler",h.style.position="relative",h.style.display="block",h.appendChild(a),t.appendChild(h),n.appletOnLoad=function(t){e.resize(),p(t)}}else{n.hasOwnProperty("showSplash")||a.setAttribute("data-param-showSplash","false");var w=t.querySelector(".applet_scaler.prerender"),b=null!==w;if(b)_=w.querySelector(".ggb_preview");else{var _=L(r,l,n.borderColor,!1);(w=document.createElement("div")).className="applet_scaler",w.style.position="relative",w.style.display="block",w.style.width=r+"px",w.style.height=l+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(w,"66%"),y(m)>=5?(n.appletOnLoad=function(e){var n=t.querySelector(".ggb_preview");n&&n.parentNode.removeChild(n),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(w),window.GGBT_wsf_view&&$(window).trigger("resize"),p(e)},b||w.appendChild(_)):a.appendChild(_),w.appendChild(a),b||t.appendChild(w),setTimeout((function(){e.resize()}),1)}function S(e,t){t&&"function"==typeof t.appletOnLoad&&"function"==typeof renderGGBElement?renderGGBElement(e,t.appletOnLoad):renderGGBElement(e),I("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",t)}function k(e,t){"undefined"==typeof renderGGBElement?(null===html5AppletsToProcess&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:e,params:t}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,null!==html5AppletsToProcess&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach((function(e){S(e.article,e.params)})),html5AppletsToProcess=null)},y(m)<5&&(e.className+=" geogebraweb")):S(e,t)}if(o){scriptLoadStarted=!0;for(var C=0;C<a.childNodes.length;C++){"TABLE"===a.childNodes[C].tagName&&(a.removeChild(a.childNodes[C]),C--)}if(null!==ggbHTML5LoadedScript){var j=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');null!=j&&j.parentNode.removeChild(j)}var T=document.createElement("script"),A=function(){k(a,n)};T.src=f+g,ggbHTML5LoadedCodebaseIsWebSimple=v,ggbHTML5LoadedCodebaseVersion=m,ggbHTML5LoadedScript=T.src,I("GeoGebra HTML5 codebase loaded: '"+f+"'.",n),c||s&&"5.0"!=s?f.requirejs?__webpack_require__.e(43547).then(function(){var e=[__webpack_require__(43547)];A.apply(null,e)}.bind(this)).catch(__webpack_require__.oe):(T.onload=A,t.appendChild(T)):(v?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),A())}else k(a,n);n.height=l,n.width=r},A=function(t,n,i){var o=L(n.width,n.height,n.borderColor,i),a=document.createElement("div");a.style.position="relative",a.style.display="block",a.style.width=n.width+"px",a.style.height=n.height+"px",a.className="applet_screenshot applet_scaler"+(i?" applet_screenshot_play":""),a.appendChild(o);var r=GGBAppletUtils.getScale(n,t,i);i?(t.appendChild(E()),window.GGBT_wsf_view||(t.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(a,"66%"),t.appendChild(a),1===r||isNaN(r)||(GGBAppletUtils.scaleElement(a,r),a.style.width=n.width+"px",a.style.height=n.height+"px",a.parentNode.style.width=n.width*r+"px",a.parentNode.style.height=n.height*r+"px"),e.resize=function(){N(t,o,a,i)},window.addEventListener("resize",(function(t){e.resize()})),e.resize()};function N(e,t,i,o){if(e.contains(t)){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if("fullscreencontent"!==e.id)return;window.GGBT_wsf_view.setCloseBtnPosition(e)}var a=GGBAppletUtils.getScale(n,e,o);null!==i.parentNode&&(isNaN(a)||1===a?(GGBAppletUtils.scaleElement(i,1),i.parentNode.style.width=n.width+"px",i.parentNode.style.height=n.height+"px"):(GGBAppletUtils.scaleElement(i,a),i.parentNode.style.width=n.width*a+"px",i.parentNode.style.height=n.height*a+"px")),"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(e),"object"===_typeof(window.GGBT_ws_header_footer)&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}e.onExitFullscreen=function(e,t){t.appendChild(e)};var P=function(e,t,n,i){A(e,t,!0);for(var o=function(){var n=[];for(r=0;r<e.childNodes.length;r++)n.push(e.childNodes[r]);if(window.GGBT_wsf_view){var o=window.GGBT_wsf_view.renderFullScreen(e,t.id),a=document.getElementById("fullscreencontainer"),l=jQuery(e).find(".fullscreencontent");l.length>0?(o.remove(),l.attr("id","fullscreencontent").show(),jQuery(a).append(l),window.dispatchEvent(new Event("resize"))):T(o,t,!1),window.GGBT_wsf_view.launchFullScreen(a)}else h=i,T(e,t,!1);if(!window.GGBT_wsf_view)for(r=0;r<n.length;r++)e.removeChild(n[r])},a=e.getElementsByClassName("ggb_preview_play"),r=0;r<a.length;r++)a[r].addEventListener("click",o,!1),a[r].addEventListener("ontouchstart",o,!1);"function"==typeof window.ggbAppletPlayerOnload&&window.ggbAppletPlayerOnload(e),S()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},E=function(){var e=document.createElement("div");if(e.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var t='.icon-applet-play { width: 100%; height: 100%;box-sizing: border-box;position: absolute;z-index: 1001;cursor: pointer;border-width: 0px; background-color: transparent;background-repeat: no-repeat;left: 0;top: 0;background-position: center center; background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet.png");}.icon-applet-play:hover {background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet-hover.png");}',n=document.createElement("style");n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(n)}return e},L=function(e,t,n,i){var o=document.createElement("div");o.className="ggb_preview",o.style.position="absolute",o.style.zIndex="90",o.style.width=e-2+"px",o.style.height=t-2+"px",o.style.top="0px",o.style.left="0px",o.style.overflow="hidden",o.style.backgroundColor="white";var a="lightgrey";void 0!==n&&(a="none"===n?"transparent":n),o.style.border="1px solid "+a;var r,l,s,c=document.createElement("img");if((c.style.position="relative",c.style.zIndex="1000",c.style.top="-1px",c.style.left="-1px",null!==w&&c.setAttribute("src",w),c.style.opacity=.7,null!==b)&&!i){(r=document.createElement("img")).style.position="absolute",r.style.zIndex="1001",r.style.opacity=1,c.style.opacity=.3,(l=360)>e/4*3&&(l=e/4*3),s=l/5.8,r.setAttribute("src",b),r.setAttribute("width",l),r.setAttribute("height",s);var u=(e-l)/2,d=(t-s)/2;r.style.left=u+"px",r.style.top=d+"px",o.appendChild(r)}return o.appendChild(c),o},M=function(e){return"html5"===(e=e.toLowerCase())||"screenshot"===e?e:"html5"},G=["web","webSimple","web3d","tablet","tablet3d","phone"],O=function(e,t){if(m=e,t)Z(m,!0);else{var a,r,l=!o;if(l){var s=y(m);!isNaN(s)&&s<4.4&&(l=!1)}a="http"===window.location.protocol.substr(0,4)?window.location.protocol:"http:";var c=m.indexOf("//");for(var u in r=c>0?m:0===c?a+m:"https://www.geogebra.org/apps/5.2.814.0/",G)if(m.slice(-1*G[u].length)===G[u]||m.slice(-1*(G[u].length+1))===G[u]+"/")return void Z(r,!1);GGBAppletUtils.isFlexibleWorksheetEditor()||!l||i.is3D||i.AV||i.SV||i.CV||i.EV2||i.CP||i.PC||i.DA||i.FI||i.PV||B(n.showToolBar)||B(n.showMenuBar)||B(n.showAlgebraInput)||B(n.enableRightClick)||n.appName&&"classic"!=n.appName?r+="web3d/":r+="webSimple/",Z(r,!1)}},Z=function(e,t){if(e.requirejs)f=e;else{"/"!==e.slice(-1)&&(e+="/"),f=e,null===t&&(t=-1===e.indexOf("http")),p=t,g="web.nocache.js",v=!1;var n=f.split("/");n.length>1&&(t||"webSimple"!==n[n.length-2]?G.indexOf(n[n.length-2])>=0&&(g=n[n.length-2]+".nocache.js"):(g="webSimple.nocache.js",v=!0)),n=e.split("/"),"test"===(m=n[n.length-3]).substr(0,4)?m=m.substr(4,1)+"."+m.substr(5,1):"war"!==m.substr(0,3)&&"beta"!==m.substr(0,4)||(m="5.0");var i=parseFloat(m);NaN!==i&&i<5&&e.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+i+" is deprecated. Using version latest instead."),O("5.0",t))}},I=function(e,t){window.console&&window.console.log&&(!t||void 0===t.showLogging||t.showLogging&&"false"!==t.showLogging)&&console.log(e)};function R(){var e=t;null!==s?e=s:parseFloat(e)<5&&(e="5.0"),O(e,!1),null!==c&&Z(c,p),l=!0}return void 0!==n.material_id?k(R):R(),e},GGBAppletUtils=function(){"use strict";function e(){return void 0!==window.GGBT_wsf_edit}function t(e,t){1!=t?(e.style.transformOrigin="0% 0% 0px",e.style.webkitTransformOrigin="0% 0% 0px",e.style.transform="scale("+t+","+t+")",e.style.webkitTransform="scale("+t+","+t+")",e.style.maxWidth="initial",null!==e.querySelector(".ggb_preview")&&(e.querySelector(".ggb_preview").style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[0]&&(e.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[1]&&(e.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(e.style.transform="none",e.style.webkitTransform="none")}function n(e,t,n,i,o){if(e.isScreenshoGenerator)return 1;var a,r=void 0!==i&&i,l=null!=e.noScaleMargin&&e.noScaleMargin,s=(a=e.autoHeight)&&"false"!==a,c=function(e,t,n,i,o,a){var r=null;if(null!=a&&""!=a)for(var l=e.parentNode;null!=l;){if((" "+l.className+" ").indexOf(" "+a+" ")>-1){r=l;break}l=l.parentNode}var s=0,c=0,u=0,d=0,f=0,p=0,h=0;if(r)s=r.offsetWidth,c=Math.max(i?r.offsetWidth:0,r.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(s=Math.min(window.innerWidth,document.documentElement.clientWidth),c=Math.min(window.innerHeight,document.documentElement.clientHeight),u=s):(s=window.innerWidth,c=window.innerHeight,u=window.innerWidth),e){var m=e.getBoundingClientRect();m.left>0&&m.left<=s&&(void 0===o||!o)&&("rtl"===document.dir?(f=s-m.width-m.left,p=u<=480?10:30):(p=m.left,f=u<=480?10:30),d=p+f)}e&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(e.getBoundingClientRect(),"closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(d=40,h=0):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(d=0,h=40))}return e&&((void 0===n||!n)&&t>0&&t+d<s?s=t:s-=d,"object"!==_typeof(window.GGBT_wsf_view)||!window.GGBT_wsf_view.isFullscreen()||void 0!==n&&n||(c-=h)),{width:s,height:c}}(t,e.width,n,s,r&&window.GGBT_wsf_view||l,o),u=parseInt(c.width),d=e.width,f=e.height;if(void 0===d){var p=t.querySelector(".appletParameters");p&&(d=p.offsetWidth,f=p.offsetHeight)}var h=u/d,m=r?1:c.height/f;return void 0===n||n||(h=Math.min(1,h),m=Math.min(1,m)),Math.min(h,m)}function i(e,t,i){var o,a=1,r=!1;return e.hasOwnProperty("allowUpscale")&&(r=e.allowUpscale),e.hasOwnProperty("scale")&&(a=parseFloat(e.scale),(isNaN(a)||null===a||0===a)&&(a=1),a>1&&(r=!0)),t&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(r=!0),e.hasOwnProperty("disableAutoScale")&&e.disableAutoScale?a:(o=n(e,t,r,i,e.scaleContainerClass),!r||e.hasOwnProperty("scale")&&1!==a?Math.min(a,o):o)}function o(e){var t=Math.min(window.innerWidth,document.documentElement.clientWidth),n=Math.min(window.innerHeight,document.documentElement.clientHeight),i=e.getBoundingClientRect(),o=(t-i.width)/2,a=(n-i.height)/2;a<0&&(a=0),e.style.position="relative","closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(e.style.left=o<40?"40px":o+"px",e.style.top=a+"px"):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(e.style.top=a<40?"40px":a+"px",e.style.left=o+"px")}return{responsiveResize:function(n,a){var r=n.querySelector(".appletParameters");if(r){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if(a.id!==r.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(n)}if(r.parentElement&&/fullscreen/.test(r.parentElement.className))return;var l=i(a,n);e()&&r.setAttribute("data-param-scale",l);for(var s=null,c=0;c<n.childNodes.length;c++)if(void 0!==n.childNodes[c].className&&n.childNodes[c].className.match(/^applet_scaler/)){s=n.childNodes[c];break}if(null!==s&&null!==s.querySelector(".noscale"))return;var u=void 0!==a.id?a.id:"ggbApplet",d=window[u];null!=d&&d.recalculateEnvironments||null===s||s.className.match(/fullscreen/)||(s.parentNode.style.transform="",isNaN(l)||1===l?(t(s,1),s.parentNode.style.width=a.width+"px",s.parentNode.style.height=a.height+"px"):(s.parentNode.style.width=a.width*l+"px",s.parentNode.style.height=a.height*l+"px",t(s,l))),"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&o(n),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(r).parents(".content-added-content"))}},isFlexibleWorksheetEditor:e,positionCenter:o,getScale:i,scaleElement:t}}();__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return GGBApplet}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__),GGBAppletUtils.makeModule=function(name,permutation){function webModule(){var H="bootstrap",I="begin",J="gwt.codesvr."+name+"=",K="gwt.codesvr=",L=name,M="startup",N="DUMMY",O=0,P=1,Q="iframe",R="position:absolute; width:0; height:0; border:none; left: -1000px;",S=" top: -1000px;",T="Chrome",U="CSS1Compat",V="<!doctype html>",W="",X="<html><head></head><body></body></html>",Y="undefined",Z="readystatechange",$=10,_="script",ab="javascript",bb="Failed to load ",cb="moduleStartup",db="scriptTagAdded",eb="moduleRequested",fb="meta",gb="name",hb=name+"::",ib="::",jb="gwt:property",kb="content",lb="=",mb="gwt:onPropertyErrorFn",nb='Bad handler "',ob='" for "gwt:onPropertyErrorFn"',pb="gwt:onLoadErrorFn",qb='" for "gwt:onLoadErrorFn"',rb="#",sb="?",tb="/",ub="img",vb="clear.cache.gif",wb="baseUrl",xb=name+".nocache.js",yb="base",zb="//",Ab="selectingPermutation",Bb=name+".devmode.js",Cb=permutation,Db=":",Eb=".cache.js",Fb="loadExternalRefs",Gb="end",n=window,o=document;function p(){var e=n.location.search;return-1!=e.indexOf(J)||-1!=e.indexOf(K)}function q(e,t){}q(H,I),webModule.__sendStats=q,webModule.__moduleName=L,webModule.__errFn=null,webModule.__moduleBase=N,webModule.__softPermutationId=O,webModule.__computePropValue=null,webModule.__getPropMap=null,webModule.__installRunAsyncCode=function(){},webModule.__gwtStartLoadingFragment=function(){return null},webModule.__gwt_isKnownPropertyValue=function(){return!1},webModule.__gwt_getMetaProperty=function(){return null};var r=null,s=n.__gwt_activeModules=n.__gwt_activeModules||{},t;function u(){return v(),t}function v(){if(!t){var e=o.createElement(Q);if(e.id=L,e.style.cssText=R+S,e.tabIndex=-1,o.body.appendChild(e),t=e.contentWindow.document,-1==navigator.userAgent.indexOf(T)){t.open();var n=document.compatMode==U?V:W;t.write(n+X),t.close()}}}function w(e){q(cb,eb),function(e){function t(){return _typeof(o.readyState)==Y?_typeof(o.body)!=Y&&null!=o.body:/loaded|complete/.test(o.readyState)}var n=t();if(n)e();else{o.addEventListener&&o.addEventListener(Z,a,!1);var i=setInterval((function(){a()}),$)}function a(){if(!n){if(!t())return;n=!0,e(),o.removeEventListener&&o.removeEventListener(Z,a,!1),i&&clearInterval(i)}}}((function(){var t,n,i,o;t=e,n=u(),i=n.body,(o=n.createElement(_)).language=ab,o.crossOrigin=W,o.src=t,webModule.__errFn&&(o.onerror=function(){webModule.__errFn(L,new Error(bb+t))}),i.appendChild(o),q(cb,db)}))}function A(){for(var c={},d,e,f=o.getElementsByTagName(fb),g=O,h=f.length;g<h;++g){var i=f[g],j=i.getAttribute(gb),k;if(j){if(j=j.replace(hb,W),j.indexOf(ib)>=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(e){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(e){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(e){var t=c[e];return null==t?null:t},r=d,webModule.__errFn=e}function B(){function e(e){var t=e.lastIndexOf(rb);-1==t&&(t=e.length);var n=e.indexOf(sb);-1==n&&(n=e.length);var i=e.lastIndexOf(tb,Math.min(n,t));return i>=O?e.substring(O,i+P):W}var t,n=null!=(t=__gwt_getMetaProperty(wb))?t:W;return n==W&&(n=function(){for(var t=o.getElementsByTagName(_),n=O;n<t.length;++n)if(-1!=t[n].src.indexOf(xb))return e(t[n].src);return W}()),n==W&&(n=function(){var e=o.getElementsByTagName(yb);return e.length>O?e[e.length-P].href:W}()),n==W&&function(){var e=o.location;return e.href==e.protocol+zb+e.host+e.pathname+e.search+e.hash}()&&(n=e(o.location.href)),n=function(t){if(t.match(/^\w+:\/\//));else{var n=o.createElement(ub);n.src=t+vb,t=e(n.src)}return t}(n),n}function C(e){return e.match(/^\//)||e.match(/^[a-zA-Z]+:\/\//)?e:webModule.__moduleBase+e}function D(){var e,t=O,i=[],o=[];function a(e){var t=o[e](),n=i[e];if(t in n)return t;var a=[];for(var l in n)a[n[l]]=l;throw r&&r(e,a,t),null}if(__gwt_isKnownPropertyValue=function(e,t){return t in i[e]},webModule.__getPropMap=function(){var e={};for(var t in i)i.hasOwnProperty(t)&&(e[t]=a(t));return e},webModule.__computePropValue=a,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);try{var l=(e=Cb).indexOf(Db);-1!=l&&(t=parseInt(e.substring(l+P),$),e=e.substring(O,l))}catch(e){}return webModule.__softPermutationId=t,C(e+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}s[L]={moduleName:L},webModule.__moduleStartupDone=function(e){var t=s[L].bindings;s[L].bindings=function(){for(var n=t?t():{},i=e[webModule.__softPermutationId],o=O;o<i.length;o++){var a=i[o];n[a[O]]=a[P]}return n}},webModule.__startLoadingFragment=function(e){return C(e)},webModule.__installRunAsyncCode=function(e){var t=u(),n=t.body,i=t.createElement(_);i.language=ab,i.text=e,n.appendChild(i),n.removeChild(i)},A(),webModule.__moduleBase="/js/mathematicalGraphics/"+name+"/",s[L].moduleBase=webModule.__moduleBase;var G=D();return F(),w(G),!0}return webModule},"function"!=typeof window.web3d&&(window.web3d=GGBAppletUtils.makeModule("web3d","A18F540516513B1292CA7CEF2F6AFC7E")),"function"!=typeof window.webSimple&&(window.webSimple=GGBAppletUtils.makeModule("webSimple","96B09BF1B436BF53F0DF54116700F16A")),window.GGBApplet=GGBApplet}else console.warn("deployggb.js was loaded twice")})()},44177:function(e,t,n){"use strict";function i(e){var t=!0;if(e.length>0){for(var n=0;n<e.length;n++)if(0==e[n].compile_success||!e[n].compile_success){t=!1;break}}else t=!1;return t}function o(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=[],i=0;i<e.length;i++){var o=e[i],a=t?"".concat(t,"/").concat(o.name):"".concat(o.name);n.push({title:o.name,type:o.type,isLeaf:"tree"!==o.type,key:a})}return n}function a(e,t,n){for(var i=0;i<e.length;i++){var o=e[i];if(o.key===t){o.children=n;break}o.children&&a(o.children,t,n)}return e}function r(e,t,n){var i;return function(){var o=this,a=arguments,r=function(){i=null,n||e.apply(o,a)},l=n&&!i;clearTimeout(i),i=setTimeout(r,t),l&&e.apply(o,a)}}n.d(t,{Ax:function(){return a},Ds:function(){return r},KI:function(){return l},SI:function(){return o},f1:function(){return i}});var l=n(20817).Z.API_SERVER},32524:function(e,t,n){"use strict";n.d(t,{Z:function(){return H}});var i=n(7557),o=n.n(i),a=n(82242),r=n.n(a),l=n(41498),s=n.n(l),c=n(37205),u=n.n(c),d=n(79800),f=n.n(d),p=n(59301),h=n(8591),m=n(53326),g=n(43428),v=n(95237),w=n(3113),b=n(92832),x=n(32007),y=n(39647),_=n.n(y),S=n(91336),k=n(50457),C=n(59455),j=n(56102),B="wrp___H70W8",T="file-list___S5XYJ",A="ExtraEdit___K6Xf2",N="btn___Yiu8q",P=n(43604),E=n(63217),L=n(37712),M=["node","inline","className","children"],G=function(e){var t=e.onCallback,n=e.scrollBox,i=e.Data,a=e.extraEdit,l=i.allowCopy,c=void 0!==l&&l,u=i.fileList,d=i.hideTextEffect,m=void 0!==d&&d,g=i.text,w=void 0===g?"":g,b=(0,p.useState)(""),x=f()(b,2),y=x[0],G=x[1],O=(0,p.useState)(!0),Z=f()(O,2),I=Z[0],R=Z[1];(0,p.useEffect)((function(){if(w){R(!0);var e=function(){var e=s()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0;case 1:if(!(n<w.length)){e.next=8;break}return G(w.substring(0,n+1)+(w.length-1>n?" __":"")),e.next=5,new Promise((function(e){return setTimeout(e,30)}));case 5:n++,e.next=1;break;case 8:R(!1),null==t||t(i);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return m?G(w):e(),function(){return G("")}}}),[]),(0,p.useEffect)((function(){n.current&&n.current.scrollTo({top:n.current.scrollHeight,behavior:"smooth"})}),[y]);return(0,L.jsxs)("div",{className:"".concat(B," fadeIn animated"),children:[(0,L.jsx)(S.U,{components:{code:function(e){e.node;var t=e.inline,n=e.className,i=e.children,o=_()(e,M),a=/language-(\w+)/.exec(n||"");return!t&&a?(0,L.jsxs)("div",{style:{position:"relative"},children:[(0,L.jsx)(j.CopyToClipboard,{text:String(i).replace(/\n$/,""),onCopy:function(){return h.ZP.success({content:"复制成功",key:"copy"})},children:(0,L.jsx)("button",{style:{position:"absolute",top:0,right:0,padding:"4px 8px",borderRadius:"0 0 0 5px",border:"none",backgroundColor:"#007bff",color:"#fff",cursor:"pointer",fontSize:"12px"},children:"复制"})}),(0,L.jsx)(k.Z,r()(r()({style:C.Z,language:a[1],PreTag:"div",showLineNumbers:!0,lineNumberStyle:{minWidth:"40px"}},o),{},{children:String(i||"").replace(/\n$/,"")}))]}):(0,L.jsx)("code",r()(r()({className:n},o),{},{children:i}))}},children:y}),u&&!I&&(0,L.jsxs)(v.Z,{className:"".concat(T," animated fadeIn"),children:[(0,L.jsx)(P.Z,{children:(0,L.jsx)(E.Z,{className:"font20 mr10"})}),(0,L.jsxs)(P.Z,{children:[null==u?void 0:u.name,(0,L.jsx)("br",{}),function(e){if(0===e)return"0 B";var t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["B","KB","MB","GB","TB","PB","EB","ZB","YB"][t]}(null==u?void 0:u.size)]})]}),!I&&(0,L.jsxs)("div",{className:A,children:[null==a?void 0:a(i),c&&(0,L.jsx)(j.CopyToClipboard,{text:String(y).replace(/\n$/,""),onCopy:function(){return h.ZP.success({content:"复制成功",key:"copy"})},children:(0,L.jsxs)("div",{className:N,children:[(0,L.jsx)("i",{className:"iconfont icon-fuzhi3 mr5"}),"复制"]})})]})]})},O={flex_box_center:"flex_box_center___GmElr",flex_space_between:"flex_space_between____pbWi",flex_box_vertical_center:"flex_box_vertical_center___COMWd",flex_box_center_end:"flex_box_center_end___lmAQf",flex_box_column:"flex_box_column___OJb7M","ai-wrp":"ai-wrp___AEGoS","loading-wanx":"loading-wanx___GtiUv","dot-flashing":"dot-flashing___xJNVn","dot-fade":"dot-fade___KWn1a","footer-container":"footer-container___HTy33","input-container":"input-container___M88BT","upload-btn":"upload-btn___fKRCG","send-btn":"send-btn___yOKG5","chat-container":"chat-container___pNTrU","chat-message":"chat-message___isXl8",title:"title___hXSVA",answerWrp:"answerWrp___COjAb",li:"li___PjMV3",img:"img___wZqEA",content:"content___OlYYG",user:"user___rbSU1",container:"container___hZAxN",item:"item___Z9j46"},Z=n(85750),I=n(89260),R=n(66621),D=function(e){var t=e.src,n=e.onClick,i=(0,p.useRef)(null),o=(0,p.useState)(!1),a=f()(o,2),r=a[0],l=a[1],s=(0,p.useState)({x:20,y:.62*window.innerHeight}),c=f()(s,2),u=c[0],d=c[1],h=(0,p.useState)({x:20,y:.62*window.innerHeight}),m=f()(h,2),g=m[0],v=m[1],w=(0,p.useState)({x:20,y:.62*window.innerHeight}),b=f()(w,2),x=b[0],y=b[1],_=(0,p.useState)(!1),S=f()(_,2),k=S[0],C=S[1];(0,p.useEffect)((function(){var e=function(e){if(r){var t,n=e.clientY-x.y,o=g.y+n,a=window.innerHeight-((null===(t=i.current)||void 0===t?void 0:t.offsetHeight)||0)-50;o<50&&(o=50),o>a&&(o=a),requestAnimationFrame((function(){d({x:20,y:o})})),C(!0)}},t=function(){l(!1)};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}}),[r,x,g]);return(0,L.jsx)("div",{style:{position:"fixed",top:u.y,right:u.x,zIndex:100,cursor:r?"grabbing":"grab"},onMouseDown:function(e){l(!0),y({x:e.clientX,y:e.clientY}),v(u),C(!1)},onMouseUp:function(e){l(!1),!k&&n&&n(e)},ref:i,children:(0,L.jsx)("img",{src:t||"/images/ai_teacher.png",width:60,draggable:"false"})})},F=n(20817),H=(0,x.connect)((function(e){return{globalSetting:e.globalSetting}}))((function(e){var t,n,i,a,l,c,d=e.title,y=e.description,_=e.placeholder,S=e.hideUpload,k=e.hideInputBox,C=e.aiIcon,j=e.userIcon,B=e.children,T=e.taskData,A=e.name,N=e.code,P=e.globalSetting,E=e.authority,M=e.isShowComponent,H=void 0===M||M,W=e.DrawerProps,z=void 0===W?{}:W,V=e.FetchUrl,q=void 0===V?"https://ai-data.educoder.net/v1/chat-messages":V,U=e.FetchData,Y=void 0===U?{}:U,J=e.defaultGetData,K=void 0!==J&&J,X=e.extraEdit,Q=void 0===X?function(){return null}:X,$=e.isShowDefuatTips,ee=void 0===$||$,te=e.isReview,ne=e.onOpen,ie=e.loadingOption,oe=(0,p.useState)(["daiao","pu428f3pz","wangwei10061","pucmnw7fs","mlty7uhjf","pyf8v9u3c","a411763600"]),ae=f()(oe,2),re=ae[0],le=ae[1],se=(0,p.useState)(null),ce=f()(se,2),ue=ce[0],de=ce[1],fe=(0,p.useState)(!1),pe=f()(fe,2),he=pe[0],me=pe[1],ge=(0,p.useState)([]),ve=f()(ge,2),we=ve[0],be=ve[1],xe=(0,p.useState)(!1),ye=f()(xe,2),_e=ye[0],Se=ye[1],ke=(0,p.useState)([]),Ce=f()(ke,2),je=Ce[0],Be=Ce[1],Te=(0,p.useRef)(je),Ae=(0,p.useRef)(),Ne=(0,p.useRef)(),Pe=(0,p.useState)(""),Ee=f()(Pe,2),Le=Ee[0],Me=Ee[1],Ge=(0,p.useState)(["".concat(null==T||null===(t=T.challenge)||void 0===t?void 0:t.task_pass,",请给出答题思考方向。\\n\\n不要给出学生正确答案不要给出任何代码")]),Oe=f()(Ge,2),Ze=Oe[0],Ie=Oe[1],Re=!!T,De=[{img:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAYCAYAAAD+vg1LAAAAAXNSR0IArs4c6QAAA1FJREFUSEuVlctvVVUYxX/f7UNCkYdMHDA0caCJMcaQXB4VLX2IRJCgRtGg+EpMHJOIiQ8mxqF/AQOdmKJNqy0EJVrkWLWi8piYQIxNHAAhaINy4XxLzzl737t7uTV4Jvve7HPWXt/61re2vXJaHwi24ZgAORSrq1pVrKr+F48X++XGwv3wTi7x9uh6e89ePq2rcnrjhxEoXctDAnA8JIJ7JBMOQhwf3WDr7KVTasjpaTKKIAnTWEnJONmPv2NlZRVGdnC91e3Fk2pI9DTLDWUvYJ5I0qmiVDIg+3ij1e2Fn9XwAFxK6PyKKkmb+obfBaNS44J6YC7R5+L25oGQjfVb3fb8pIZ7xVjGJwfute1Vm27u2Tqupd0ruVT0KfQhG3vA6vbcjy0pwqkXSymjJJF5YHqDFLBEzq0p4/FNBfCJwLhdxwSwo2PCftnAwhqt77OJh6xuu39oafxfjalET1wRHBK1TiyZfVoAPztbSRE/7OSG1GILfJzYL5VicsDq9sz3bcBwXoUrFpu8fEHZBeE+d5YlA5RNbra67fqu1Txg4sO1tvXm/FC9NXJUayznt+YQGdlUAfz0t4nGhYpizhPGiV8X5kj0MSyXsyqpMDs8ZHV7qgCOPo7lL26t5tAs1mhEdnjY6vbkN4mPU8t1Am+3pHFJOUfcmMNZ7WIQce7ISAC+gXFrXFuRmTQzjPy7XSvZf+Es6lvFHbpGfmWec0uX0//5sE3ZE1nQOOSsxHwzwFo6opxewS3Blq9Nbrb3Bw9pL7BXYkWZIcYZOc8f3WIztvN4KzYNJkY3dHbF0JRu6+rmgmB6csD6Bw9pH+KdZnRWWTMv53dyHradX1fNC2Obu/ilzO54S8RKKPNgDcauv7oY621w3p0l0Q2IP2rG0HXnVYm/bcexinG8jtKxTaapOc44d8tY7c6XgnGJR1zM18SwGyOes0/ipD023Zq8jhZqm8A85y7VWGbOjBvDOHdizEoMeM6boYJjtn1aV71oTIfLsUNEYsaeFZc5cLGPuaJpVmNHfp37Jd6Kl4PVeN0e/Uof4WxzqOHhNk7s1uG2PvPFDPc8uJYt7hyU6G4LrhM9DTba/8mF9nc3faZ1+TXe+Ffr+wR/mhi90mD/7ON2+R9W5V2x0b6OvQAAAABJRU5ErkJggg==",name:"智能审题",des:"快速智能拆解任务,提供解题思路",Authorization:"Bearer app-Z8HFAfducmnrr3zO9961jqgB",inputs:""},{img:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAYCAYAAAD6S912AAAAAXNSR0IArs4c6QAAA6VJREFUSEuVlVtoXGUUhdc6SbQmRFPb2pDLdCaN0D6oIFpSiAgqUkWhbxbEWiQ+iA8iFCWQUoo22mCxL4JUYkJBSalWEHshXqLRqSYiSkHQJp2ZtEKrpMVC0Gb+y9IzZ850TpwUHJiHc/k/1t5r7X2I6/zeaNPqunrsdcBWKzU58lTRY2DPb5xe7hiXezC8Ws0LjZg20gZHwABwACy4aIEHXzvHbK2zywLfTKnfSYMhzJZA5T8BD07tm2PP/wLu79QJS22JQSV1FTh1mWgcLfDqUmhJ4W4o2AP66of7Un7SAvdFZVbDouuAXHmgwD/jMzGDI2mtKDp95MmvnjvH1+MXBlP61FK95b7BQgmwCdh6MMcr4fvb2tSpG3Vc4k6+s04Z4/G1gdo9OPDiee59ZZ02SrjXEs3lki8UgYIHNofmeMIZIteZx2e5LnQYrwlLdHlqqFTyWx3qXiQmLNVhwW8d0GMhxj1zYLZIHAtNCu/FbTDADw681UIZT+0/mq/bWXF5qFPrHXHKQLct7VsINCEQGqx2PE6AI4eO5vhyKK4CFMRXU7hsoZZrbkYG1AJWu+48H/h4jhMJ4GC7Vi3Waf5amVXZC5g1ihTWct2JzxwvcCQJ7Naav4z+SIS4HBkXMGuJY9aXS64KezkFfeN5DieA/d1aoypgtRLHSKEt93Dp9Diw7/MYuDullywQeKLJQANRz5JhjoGOocs876BZI7RacIOl6MW+L2PgQMpbS9RVIDWmwpPZIjAi4vcPcvwkDv9DXbrDAu/+C387GwP7U3rMABTQUqQO1TIlVHg4z94QtGW9tjn5hx2DBUOM+jrMWIO7pnL8JtHDFzJaa7wuJiJTCTGzH+bZ+2jGjTngCUuWRtGB1pLPfneWo7HqSg5D4N/SxaUuRwaUSj7goSPRpIRzHUEtuRA0MD39Cy8lFG5v16r6Bs3X3C5k1gI/OfjnK6DEfgweOX2WJxPA8OLptL9ggdbqsssTkXXiF4baFVUQbZ44Pl7Bpp9z/D6pMKNNDhq3wi3/yRmZdcKThjht4G9OLtvSrnx/ZjbYDjA8CuxIq8dAJx3R7KD3DLjVory6ImOyE7mgd3O37rdeI5bIRKYEJxy01kB3uwBjczPBU9yRVhjOKSs2OaDvSIGjj7ep0d+EjYsOzbY+/IbgyuQsf4ycVHBnBrdfbcClM2c4n0ppJW7QuIXuccAww9X9awYHBUwezvPQ9T6ryz1rSatlRb3GTMBd/wBBRVUxXeSVgwAAAABJRU5ErkJggg==",name:"代码诊断",des:"系统智能代码分析,提供修正建议",Authorization:"Bearer app-Z8HFAfducmnrr3zO9961jqgB",inputs:null==T||null===(n=T.challenge)||void 0===n?void 0:n.task_pass},{img:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAYCAYAAAARfGZ1AAAAAXNSR0IArs4c6QAABD9JREFUSEvNlG1MU2cUx/+3hVJKoZQCKTIGTBw6ZB1CNmg/MHkNoqAJe9fhDMvWkhZcjG4fMdnMkm2Ei4Diy8IyEUPUGCNDjSxx2XgHCxN0sooI0spLQ2lpe1vuXe5d1oFNVkj8sPPlSe4553fOc87/PgTWYIcPnwl2OJzfi8WiXJvN0cvjMaXV1eopX6mErwDWr9PVf5Wfr/xcpVIQIyMGpqXlxgWSVL/nK3eN8LpWtfrtkqiocNjtThw7drafJDVpzwVeUVH3Tmxs9HmlUkEMDT1g7t4d+6KmRvP1c4H/PZoTOwC6EcBRktSwp0/zGsvBg98Fut3BMn9/ysvncuESn4+PeTzMrSS7XALG6aTnGxs/WVr53QM4cuSkxG5frpdIxG+Fh4f4E2vaxr+omRmLy2KxXuLxHJrq6s/mWY8HodM13NyzR5mdmZlMUJQbLpfb57WfDbh16w7T0aH/hSTVmR54ZeXJbQkJ8v7y8iKYzVZYrXaYTGZYLEuIiAhFaGiQVyHWx8aIxYGQy8PA3pTNu3q1C1NTsyqSLP+N61yna3g3NzflfE5OCqan59HW1oPxBQoCaQgo0yxSN2+ASpXkKdDbex+d+kcQyCPgtlgRFQDs2pUOilpGZ+cIo9cbPiJJTRMH12obPigoSP1RqXwF16714J6DhzBVKnh+fqCdFIxtHcjbFodNm6IxMfEUV26PImpnDvgiIRj3Msx9Q4ilFpGevgXd3aPMwIChrLZWfdYL/s23FxG+twQZchGmKWCSAmwPHyPoziCKijJw/Xo/ZuMToEhJgJsBJpzgGpg81Yz9+7J9wyPL3kdYgB8cDEAzwMKkEcLuHhQXZ6C9vQ/mLUmIS3yR85ndwDLD4HH9D9i/N2s1vLKy7jWGIXbk56d9yY6FXYhBGAqZMpWbMZ9NvHIDb74cgc2JMRgfN6Gt7yGiSwpB8HkIIABT/++QmyahVCZx8MHBsaM0TV8kKirqW2ga8QUFaa+z8Lm5Ra6AkfFDQIQM9okpJMdIkZn5qmehXV2j6PvDiMDYF0CZFyCjbCguVsLlWkZXFwfvJwhi2GvmrMRYe/JkDgsLS4iMlEAmC/GSIitZo9GM4GAhoqPDQRAErFbHf8/8H/i6/yCwOv8/wfX6P5GYGAOhUICBgTFs3RoHgcCPnS2n65W27s5bW28jLy8VEkkQmpt/xu7dGRCJhDh9+ieUlRWsgrMj7e29/+xPdKIkKyu5dft2BfeerLTLl39FdnYKQkJEYAsVFr4BkSgATU03UVqa6wmlaRqzsxb2dszw8KN9tbXqc5xaDh06FS+Vih8cOJDHdzpdKx/LNeyV4SS4uLjEne3tffTMjDnp+HHtPc+Tq9XW1WzcuEGrULxEBAUJ1wBdHWKzOTA0ZGAMBmNjTY3601XvOduuTlevAfAhQRByVrfrMZqmTQBzTip9WltVVUWzuX8BL+8z38bSCP4AAAAASUVORK5CYII=",name:"AI辅导",des:"为学生提供个性化智能学习辅导",Authorization:"Bearer app-Z8HFAfducmnrr3zO9961jqgB",inputs:null==T||null===(i=T.challenge)||void 0===i?void 0:i.task_pass}],Fe={action:"https://ai-data.educoder.net/v1/datasets/dc9e6c03-a629-4e9e-bd81-06fb93c29aa1/document/create_by_file",fileList:u()(we),maxCount:1,onChange:function(e){var t=e.fileList;console.log(":newFileList:",t),be(t)},showUploadList:!1,accept:".doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",beforeUpload:function(e){var t=["application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation"].includes(e.type);return t||(Le.error("只能上传Office文档"),Promise.reject())},headers:{Authorization:"Bearer dataset-xBnNgFqcMjLGAXz7pFgXzGwY"},data:{data:JSON.stringify({indexing_technique:"high_quality",process_rule:{rules:{pre_processing_rules:[{id:"remove_extra_spaces",enabled:!0},{id:"remove_urls_emails",enabled:!0}],segmentation:{separator:"###",max_tokens:500}},mode:"custom"}})}},He={maxCount:1,showUploadList:!1,accept:".doc,.docx,.md,.txt,.pdf",beforeUpload:function(e){var t,n=null==e||null===(t=e.name)||void 0===t||null===(t=t.split("."))||void 0===t||null===(t=t.slice(-1))||void 0===t||null===(t=t[0])||void 0===t?void 0:t.toLowerCase(),i=["doc","docx","md","pdf","txt"].includes(n);return 0==e.size?(h.ZP.warning("文件内容不能为空"),m.Z.LIST_IGNORE):i||(h.ZP.warning("目前支持txt、md、doc、docx、pdf文件"),m.Z.LIST_IGNORE)},onChange:function(e){var t=e.fileList;be((null==t?void 0:t.filter((function(e){return"done"===(null==e?void 0:e.status)})))||[])},action:"".concat(null===F.Z||void 0===F.Z?void 0:F.Z.API_SERVER,"/api/attachments.json")};(0,p.useEffect)((function(){Te.current=je}),[je]),(0,p.useEffect)((function(){var e;null!=P&&P.setting&&le([].concat(u()(re),u()((null==P||null===(e=P.setting)||void 0===e?void 0:e.big_model_users)||[])))}),[null==P?void 0:P.setting]),(0,p.useEffect)((function(){var e;Ie(["".concat(null==T||null===(e=T.challenge)||void 0===e?void 0:e.task_pass),"".concat(N),"".concat(N)])}),[N]),(0,p.useEffect)((function(){if(K&&(null!=z&&z.open||he)&&null!=Y&&Y.student_work_id){if(ue!==(null==Y?void 0:Y.student_work_id))Be([{text:"",done:!1,loading:!0,key:Date.now(),sender:"AI",allowCopy:!0}]);else{if(je.length)return;Be([].concat(u()(je),[{text:"",done:!1,loading:!0,key:Date.now(),sender:"AI",allowCopy:!0}]))}Ve(),de(null==Y?void 0:Y.student_work_id)}}),[K,he,je,null==z?void 0:z.open,null==Y?void 0:Y.student_work_id]);var We,ze=function(){me(!0)},Ve=function(){var e=s()(o()().mark((function e(){var t,n,i,a=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>0&&void 0!==a[0]?a[0]:"",e.next=3,(0,Z.ZP)(q,{method:"post",body:r()({inputs:{description:"",name:A},query:n,response_mode:"blocking",conversation_id:Ae.current||"",user:"abc",files:(null==we||null===(t=we.filter((function(e){return"done"==(null==e?void 0:e.status)})))||void 0===t?void 0:t.map((function(e){var t;return null==e||null===(t=e.response)||void 0===t?void 0:t.id})))||[]},Y),mode:"cors",headers:{"Content-Type":"application/json",Authorization:"Bearer app-Z8HFAfducmnrr3zO9961jqgB"}});case 3:i=e.sent,Se(!1),Te.current[Te.current.length-1].text=null==i?void 0:i.answer,Te.current[Te.current.length-1].loading=!1,Te.current[Te.current.length-1].response=i,Ae.current=null==i?void 0:i.conversation_id,Be(u()(Te.current));case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),qe=function(){var e=s()(o()().mark((function e(t,n){var i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!_e){e.next=2;break}return e.abrupt("return");case 2:return Se(!0),Be([].concat(u()(je),[{text:Le,done:!1,loading:!0,key:Date.now(),sender:"AI",allowCopy:!0,name:null==t?void 0:t.name}])),setTimeout((function(){Ne.current.scrollTo({top:Ne.current.scrollHeight,behavior:"smooth"})})),e.next=7,(0,Z.ZP)(q,{method:"post",body:{inputs:{description:null==t?void 0:t.inputs,name:null==t?void 0:t.name},query:Ze[n],response_mode:"blocking",user:"abc",files:[]},mode:"cors",headers:{"Content-Type":"application/json",Authorization:null==t?void 0:t.Authorization}});case 7:null!=(i=e.sent)&&i.answer&&(Se(!1),Te.current[Te.current.length-1].text=null==i?void 0:i.answer,Te.current[Te.current.length-1].loading=!1,Te.current[Te.current.length-1].response=i,Ae.current=null==i?void 0:i.conversation_id,Be(u()(Te.current)));case 9:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Ue=function(){""!==Le.trim()&&(Me(""),be([]),Be([].concat(u()(je),[{text:Le,done:!1,key:Date.now(),sender:"user",fileList:we[0]},{text:Le,done:!1,loading:!0,key:Date.now(),sender:"AI",allowCopy:!0}])),Se(!0),setTimeout((function(){return Ve(Le)}),300))};if(Re){if(null==T||!T.chatgpt)return(0,L.jsx)(L.Fragment,{})}else if(!H||!E&&!re.includes(null===(We=(0,I.eY)())||void 0===We?void 0:We.login))return(0,L.jsx)(L.Fragment,{});return(0,L.jsxs)("div",{children:[B?(0,L.jsxs)("div",{onClick:ne||ze,children:[(0,L.jsx)(x.Outlet,{}),B]}):(0,L.jsx)(D,{onClick:ne||ze}),(0,L.jsx)(g.Z,{className:"".concat(null!=z&&z.open||he?"body-overflow-hidden":""," ").concat(O.answerWrp),width:(null==z?void 0:z.width)||860,title:(0,L.jsx)("span",{className:O.title,children:d||"头歌AI"}),onClose:(null==z?void 0:z.onClose)||function(){me(!1)},open:(null==z?void 0:z.open)||he,children:(0,L.jsxs)("div",{className:O["ai-wrp"],children:[(0,L.jsxs)("div",{ref:Ne,className:O["chat-container"],children:[ee&&(0,L.jsxs)("div",{className:O.li,children:[(0,L.jsx)("img",{className:O.img,src:C||"/images/ai_icon.png"}),(0,L.jsxs)("div",{className:O.content,children:[(0,L.jsxs)("div",{className:"c-grey-333 font22",children:[(0,L.jsx)("span",{className:"mr5",children:"👋"}),"嗨,我是头歌",Re?d:"智能助教",",您的教学好帮手。"]}),(0,L.jsx)("div",{className:"font16 mt20",style:{color:"#434D6C"},children:y||"我可以阅读您上传的教案,书籍等教学资料,并根据您的要求为您自动生成任务要求。"}),(0,L.jsx)("div",{className:"font16 mt20",style:{color:"#434D6C"},children:"快来试一下吧~"}),Re&&(0,L.jsx)("div",{className:O.container,children:De.map((function(e,t){return(0,L.jsxs)("div",{onClick:function(){return qe(e,t)},className:O.item,children:[(0,L.jsxs)(v.Z,{align:"middle",children:[(0,L.jsx)("img",{className:"mr10",src:e.img}),(0,L.jsx)("span",{style:{color:"#232B40",fontSize:16,fontWeight:600},children:e.name})]}),(0,L.jsx)("div",{className:"mt10",style:{color:"#434D6C"},children:e.des})]},t)}))})]})]}),null==je?void 0:je.map((function(e,t){var n;return(0,L.jsxs)("div",{className:O.li,style:"AI"===e.sender&&"user"!==(null===(n=je[t+1])||void 0===n?void 0:n.sender)?{marginBottom:50}:{},children:[(0,L.jsx)("img",{className:O.img,src:"AI"===e.sender?C||"/images/ai_icon.png":j||"/images/ai_user.png"}),(0,L.jsx)("div",{className:"".concat(O.content," ").concat("AI"===e.sender?"":O.user),children:e.loading?(0,L.jsxs)("div",{children:[(0,L.jsxs)("div",{className:O["loading-wanx"],children:[(0,L.jsx)("div",{className:O["dot-flashing"]}),(0,L.jsx)("div",{className:O["dot-flashing"]}),(0,L.jsx)("div",{className:O["dot-flashing"]})]}),(0,L.jsx)("div",{style:{marginTop:10,color:"#9096A3"},children:(null==ie?void 0:ie.text)||"请耐心等待,目前高峰期体验人数过多,我们已记录下您的需求,稍后将自动为您生成答案。"})]}):(0,L.jsxs)(L.Fragment,{children:[!!e.name&&(0,L.jsx)("div",{className:"mb10 font18",style:{color:"#232B40",fontWeight:600},children:null==e?void 0:e.name}),(0,L.jsx)(G,{scrollBox:Ne,Data:e,extraEdit:Q})]})})]},t)}))]}),!k&&(0,L.jsxs)("div",{className:"".concat(O["footer-container"]," ").concat(we.length>=1&&O["has-file"]),children:[!!we.length&&(0,L.jsxs)(v.Z,{align:"middle",className:"pb5 pt5",children:[(0,L.jsx)("span",{title:null==we||null===(a=we[0])||void 0===a?void 0:a.name,className:"mr10",children:(0,R.tP)(null==we||null===(l=we[0])||void 0===l?void 0:l.name,40)}),(0,L.jsx)("i",{onClick:function(){return be([])},className:"iconfont current icon-shanchu15 delete-hover c-red-ee4 font14"})]}),(0,L.jsxs)("div",{style:we.length?{paddingLeft:0}:{},className:O["input-container"],children:[!S&&(0,L.jsx)("div",{className:O["footer-container-upload"],children:(0,L.jsx)(m.Z,r()(r()({},te?He:Fe),{},{children:null!=we&&we.length?null:(0,L.jsx)(w.ZP,{className:O["upload-btn"],icon:(0,L.jsx)("i",{className:"iconfont icon-shangchuan4 c-white"})})}))}),(0,L.jsx)(b.Z.TextArea,{rows:1,placeholder:_||"在这里输入你问题吧~",value:Le,bordered:!1,onChange:function(e){Me(e.target.value)},onKeyPress:function(e){if("Enter"===e.key){var t;if(e.preventDefault(),null!=we&&we.length&&"done"!==(null==we||null===(t=we[0])||void 0===t?void 0:t.status)||_e)return;Ue()}}}),(0,L.jsx)(w.ZP,{className:O["send-btn"],icon:(0,L.jsx)("i",{className:"iconfont icon-fasong2 c-white"}),disabled:!(null==we||!we.length)&&"done"!==(null==we||null===(c=we[0])||void 0===c?void 0:c.status)||_e,onClick:Ue})]})]})]})})]})}))},93524:function(e,t,n){"use strict";n.d(t,{t:function(){return f}});var i=n(82242),o=n.n(i),a=(n(59301),n(3113)),r="buttonFixed___vyq30",l="button___hxmYv",s="buttonWrap___uK8dl",c=n(92310),u=n.n(c),d=n(37712),f=function(e){var t=e.cancelText,n=void 0===t?"取消":t,i=e.okText,c=void 0===i?"确定":i,f=e.loading,p=void 0!==f&&f,h=e.hasOkBtn,m=void 0===h||h,g=e.hasCancelBtn,v=void 0===g||g,w=e.okButtonProps,b=void 0===w?{}:w,x=e.onCancel,y=void 0===x?function(){}:x,_=e.onOk,S=void 0===_?function(){}:_,k=e.className,C=void 0===k?"":k;return(0,d.jsx)("div",{className:u()(r,C),children:(0,d.jsxs)("div",{className:s,children:[v&&(0,d.jsx)(a.ZP,{size:"middle",className:"".concat(l," mr20"),onClick:y,children:n}),m&&(0,d.jsx)(a.ZP,o()(o()({size:"middle",type:"primary",className:"".concat(l," mr20"),loading:p,onClick:S},b),{},{children:c}))]})})}},18433:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var i=n(7557),o=n.n(i),a=n(41498),r=n.n(a),l=n(79800),s=n.n(l),c=n(59301),u="imageDimensions___a7crR",d="img___Kroat",f="fullWidth___c492T",p=n(92310),h=n.n(p),m=n(71418),g=n(2859),v=n(85750),w=n(66621),b=n(37712),x=function(e){var t=e.data,n=e.className,i=e.fullWidth,a=e.style,l=void 0===a?{}:a,p=e.onClose,x=e.onOk,y=e.showFullTools,_=e.noAssociationId,S=(0,c.useRef)(null),k=(0,c.useRef)(null),C=(0,c.useRef)(null),j=(0,c.useRef)(null),B=(0,c.useState)(!1),T=s()(B,2),A=T[0],N=T[1],P=(0,c.useState)("正在加载中"),E=s()(P,2),L=E[0],M=E[1];(0,c.useEffect)((function(){C.current||(C.current=document.createElement("style"),document.head.appendChild(C.current)),null!=t&&t.visible?(document.body.setAttribute("data-custom","y-hidden"),C.current.innerHTML=" html { overflow-y: hidden; }",null!=t&&t.src&&G()):(document.body.removeAttribute("data-custom"),C.current&&(document.head.removeChild(C.current),C.current=null))}),[null==t?void 0:t.visible]);var G=function(){var e=r()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N(!0),M("正在加载中"),e.next=4,(0,w.ZJ)(null==t?void 0:t.src);case 4:n=e.sent,S.current.src="",S.current.src=n,S.current.onload=function(){Z()},N(!1),M("");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),O=function(){var e=r()(o()().mark((function e(n){var i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N(!0),M("正在保存中"),e.next=4,(0,v.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:t.title,file:n.dataUrl}});case 4:if(null==(i=e.sent)||!i.id||_){e.next=12;break}return e.next=8,(0,v.ZP)("/api/attachments/".concat(t.id,"/add_subitem.json"),{method:"post",body:{subitem_id:null==i?void 0:i.id,settings:JSON.stringify(n.state)}});case 8:0===e.sent.status&&x(),e.next=13;break;case 12:null!=i&&i.id&&x(i);case 13:N(!1),M("");case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Z=function(){k.current=new g.hP(S.current),k.current.targetRoot=j.current,k.current.addEventListener("render",O),k.current.addEventListener("beforeclose",p),y&&(k.current.availableMarkerTypes=k.current.ALL_MARKER_TYPES,k.current.uiStyleSettings.redoButtonVisible=!0,k.current.uiStyleSettings.notesButtonVisible=!0,k.current.uiStyleSettings.zoomButtonVisible=!0,k.current.uiStyleSettings.zoomOutButtonVisible=!0,k.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=k.current.uiStyleSettings,k.current.show(),null!=t&&t.snapshotData&&k.current.restoreState(t.snapshotData),setTimeout((function(){var e;window.scrollTo(0,0),(e=document.querySelector('a[href="https://markerjs.com/"]'))&&e.parentNode&&(e.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"选择"},{name:'[data-action="delete"]',title:"删除元素"},{name:'[data-action="undo"]',title:"撤销"},{name:'[data-type-name="FrameMarker"]',title:"矩形"},{name:'[data-type-name="FreehandMarker"]',title:"画线"},{name:'[data-type-name="ArrowMarker"]',title:"箭头"},{name:'[data-type-name="TextMarker"]',title:"文本"},{name:'[data-type-name="EllipseMarker"]',title:"椭圆"},{name:'[data-type-name="HighlightMarker"]',title:"方块"},{name:'[data-type-name="CalloutMarker"]',title:"注释"},{name:'[data-action="render"]',title:"保存"},{name:'[data-action="close"]',title:"退出"}].forEach((function(e){var t=document.querySelector(e.name);t&&t.setAttribute("title",e.title)}))}),300)};return(0,b.jsx)(c.Fragment,{children:(null==t?void 0:t.visible)&&(0,b.jsx)(m.Z,{spinning:A,tip:L,style:{position:"absolute"},children:(0,b.jsx)("div",{ref:j,className:h()(u,n,i?f:""),style:l,children:(0,b.jsx)("img",{className:d,ref:S})})})})}},4469:function(e,t,n){"use strict";n.d(t,{h:function(){return v}});var i=n(82242),o=n.n(i),a=n(79800),r=n.n(a),l=n(59301),s=n(57809),c=n(78241),u=n(3113),d=n(89780),f=n.n(d),p=(n(24147),n(74794),n(37712)),h=s.default.Option,m={labelCol:{span:4},wrapperCol:{span:20}},g={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function v(e){var t=e.value,n=e.onChange,i=e.mode,a=e.options,s=void 0===a?{}:a,c=(0,l.useRef)(),u=(0,l.useState)(),d=r()(u,2),h=d[0],m=d[1];return(0,l.useEffect)((function(){if(h){var e=function(e){var t=e.getValue();n&&n(t)};return h.on("change",e),function(){h.off("change",e)}}}),[h,n]),(0,l.useEffect)((function(){h&&h.setOption("mode",i)}),[h,i]),(0,l.useEffect)((function(){h&&(t===h.getValue()&&""!==t||setTimeout((function(){h.setValue(t||"")}),300))}),[h,t]),(0,l.useEffect)((function(){if(c.current&&!h){var e=f().fromTextArea(c.current,o()({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},s));m(e)}}),[c.current,h]),(0,p.jsx)("div",{className:"my-codemirror-container",children:(0,p.jsx)("textarea",{ref:c})})}t.Z=function(e){var t=e.callback,n=e.onCancel,i=(0,l.useState)("python"),a=r()(i,2),d=a[0],f=a[1];return(0,p.jsxs)(c.Z,o()(o()({},m),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)},style:{width:500},children:[(0,p.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,p.jsx)(s.default,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){f(g[e][1])},children:Object.keys(g).map((function(e){return(0,p.jsx)(h,{value:e,children:g[e][0]},e)}))})}),(0,p.jsx)(c.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,p.jsx)(v,{mode:d})}),(0,p.jsxs)("div",{className:"flex-container flex-end",children:[(0,p.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,p.jsx)(u.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))}},95992:function(e,t,n){"use strict";n.d(t,{Z:function(){return ye}});var i=n(91232),o=n.n(i),a=n(79800),r=n.n(a),l=n(85573),s=n.n(l),c=n(59301),u=n(89780),d=n.n(u),f=n(76374),p=(n(24147),n(6313),n(25717),n(99498),n(25419),n(67549),n(51150)),h=n(37712),m=function(e){var t=e.value,n=void 0===t?"":t,i=(e.className,e.showTextOnly,e.showLines,e.style,(0,c.useMemo)((function(){return""}),[n]));return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:i}})})},g=n(82242),v=n.n(g),w=[{title:"粗体",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"斜体",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"md-iconfont icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"链接",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"行内公式",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"数学图像",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"多行公式",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"添加图片",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"插入画图",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"插入流程图",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"表格",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"换行",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"清空",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function b(e){var t=e.onActionCallback,n=e.title,i=e.icon,o=e.actionName,a=e.className,r=void 0===a?"":a,l=e.children;return(0,h.jsxs)("a",{title:n,className:r,onClick:function(){t(o)},children:[(0,h.jsx)("i",{className:"".concat(i)}),l]})}var x=function(e){var t=e.watch,n=e.showNullButton,i=e.showNullProgramButton,o=e.onActionCallback,a=e.fullScreen,r=e.insertTemp,l=e.hidetoolBar,s=e.extraUse,c=[].concat(w,[{title:"".concat(t?"关闭实时预览":"开启实时预览"),icon:"".concat(t?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"),actionName:"trigger-watch"}]);return(0,h.jsxs)("ul",{className:"markdown-toolbar-container",children:[!l&&c.map((function(e,t){return(0,h.jsx)("li",{children:e.actionName?(0,h.jsx)(b,v()(v()({},e),{},{onActionCallback:o})):(0,h.jsx)("span",{className:"v-line"})},t)})),n?(0,h.jsx)("li",{children:(0,h.jsx)(b,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:o,children:(0,h.jsx)("span",{className:"fill-tip",children:"点击插入\b填空项"})})}):null,i?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("li",{children:(0,h.jsx)(b,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-signal",onActionCallback:o,children:(0,h.jsx)("span",{className:"fill-tip",children:"+单行填空项"})})}),(0,h.jsx)("li",{children:(0,h.jsx)(b,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"增加填空",actionName:"add-multiple",onActionCallback:o,children:(0,h.jsx)("span",{className:"fill-tip",children:"+多行填空项"})})})]}):null,r&&(0,h.jsx)("li",{children:(0,h.jsx)(b,{icon:"md-iconfont icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(r),onActionCallback:o,children:(0,h.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),s&&(0,h.jsx)("li",{children:s}),(0,h.jsx)("li",{className:"btn-full-screen",children:(0,h.jsx)(b,{icon:"".concat(a?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"),title:a?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:o})})]})},y=n(81074),_=n(78241),S=n(92832),k=n(3113),C={labelCol:{span:4},wrapperCol:{span:20}},j=function(e){var t=e.callback,n=e.onCancel;return(0,h.jsxs)(_.Z,v()(v()({},C),{},{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){t(e)},style:{width:500},children:[(0,h.jsx)(_.Z.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}],children:(0,h.jsx)(S.Z,{})}),(0,h.jsx)(_.Z.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}],children:(0,h.jsx)(S.Z,{})}),(0,h.jsxs)("div",{className:"flex-container flex-end",children:[(0,h.jsx)(k.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(k.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))},B=n(4469),T=n(72952),A=n(95237),N=n(18433),P=function(e){var t=e.callback,n=e.onCancel,i=document.createElement("canvas"),o=i.getContext("2d");i.width=1e3,i.height=800,o.fillStyle="#ffffff",o.fillRect(0,0,i.width,i.height);var a=i.toDataURL("image/png");return(0,h.jsx)(A.Z,{style:{height:"100vh"},children:(0,h.jsx)(N.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:a,visible:!0,title:String(Date.now())},onOk:function(e){t({src:e.url})},onClose:n})})},E=n(7557),L=n.n(E),M=n(41498),G=n.n(M),O=n(37205),Z=n.n(O),I=n(12378);function R(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(R,go.CommandHandler),R.prototype.canAlignSelection=function(){var e=this.diagram;return null!==e&&!e.isReadOnly&&!e.isModelReadOnly&&!(e.selection.count<2)},R.prototype.alignLeft=function(){var e=this.diagram;e.startTransaction("aligning left");var t=1/0;e.selection.each((function(e){e instanceof go.Link||(t=Math.min(e.position.x,t))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t,e.position.y))})),e.commitTransaction("aligning left")},R.prototype.alignRight=function(){var e=this.diagram;e.startTransaction("aligning right");var t=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var n=e.actualBounds.x+e.actualBounds.width;t=Math.max(n,t)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t-e.actualBounds.width,e.position.y))})),e.commitTransaction("aligning right")},R.prototype.alignTop=function(){var e=this.diagram;e.startTransaction("alignTop");var t=1/0;e.selection.each((function(e){e instanceof go.Link||(t=Math.min(e.position.y,t))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.position.x,t))})),e.commitTransaction("alignTop")},R.prototype.alignBottom=function(){var e=this.diagram;e.startTransaction("aligning bottom");var t=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var n=e.actualBounds.y+e.actualBounds.height;t=Math.max(n,t)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,t-e.actualBounds.height))})),e.commitTransaction("aligning bottom")},R.prototype.alignCenterX=function(){var e=this.diagram,t=e.selection.first();if(t){e.startTransaction("aligning Center X");var n=t.actualBounds.x+t.actualBounds.width/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n-e.actualBounds.width/2,e.actualBounds.y))})),e.commitTransaction("aligning Center X")}},R.prototype.alignCenterY=function(){var e=this.diagram,t=e.selection.first();if(t){e.startTransaction("aligning Center Y");var n=t.actualBounds.y+t.actualBounds.height/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,n-e.actualBounds.height/2))})),e.commitTransaction("aligning Center Y")}},R.prototype.alignColumn=function(e){var t=this.diagram;t.startTransaction("align Column"),void 0===e&&(e=0),e=parseFloat(e);var n=new Array;t.selection.each((function(e){e instanceof go.Link||n.push(e)}));for(var i=0;i<n.length-1;i++){var o=n[i],a=o.actualBounds.y+o.actualBounds.height+e;n[i+1].move(new go.Point(o.actualBounds.x,a))}t.commitTransaction("align Column")},R.prototype.alignRow=function(e){void 0===e&&(e=0),e=parseFloat(e);var t=this.diagram;t.startTransaction("align Row");var n=new Array;t.selection.each((function(e){e instanceof go.Link||n.push(e)}));for(var i=0;i<n.length-1;i++){var o=n[i],a=o.actualBounds.x+o.actualBounds.width+e;n[i+1].move(new go.Point(a,o.actualBounds.y))}t.commitTransaction("align Row")},R.prototype.canRotate=function(e){var t=this.diagram;return null!==t&&!t.isReadOnly&&!t.isModelReadOnly&&!(t.selection.count<1)},R.prototype.rotate=function(e){var t;void 0===e&&(e=90),(t=this.diagram).startTransaction("rotate "+e.toString()),(t=this.diagram).selection.each((function(t){t instanceof go.Link||t instanceof go.Group||(t.angle+=e)})),t.commitTransaction("rotate "+e.toString())},R.prototype.pullToFront=function(){var e=this.diagram;e.startTransaction("pullToFront");var t=new go.Map;e.selection.each((function(e){t.set(e.layer,0)})),t.iteratorKeys.each((function(e){var n=0;e.parts.each((function(e){if(!e.isSelected){var t=e.zOrder;isNaN(t)?e.zOrder=0:n=Math.max(n,t)}})),t.set(e,n)})),e.selection.each((function(e){R._assignZOrder(e,t.get(e.layer)+1)})),e.commitTransaction("pullToFront")},R.prototype.pushToBack=function(){var e=this.diagram;e.startTransaction("pushToBack");var t=new go.Map;e.selection.each((function(e){t.set(e.layer,0)})),t.iteratorKeys.each((function(e){var n=0;e.parts.each((function(e){if(!e.isSelected){var t=e.zOrder;isNaN(t)?e.zOrder=0:n=Math.min(n,t)}})),t.set(e,n)})),e.selection.each((function(e){R._assignZOrder(e,t.get(e.layer)-1-R._findGroupDepth(e))})),e.commitTransaction("pushToBack")},R._assignZOrder=function(e,t,n){void 0===n&&(n=e),e.layer===n.layer&&(e.zOrder=t),e instanceof go.Group&&e.memberParts.each((function(e){R._assignZOrder(e,t+1,n)}))},R._findGroupDepth=function(e){if(e instanceof go.Group){var t=0;return e.memberParts.each((function(e){t=Math.max(t,R._findGroupDepth(e))})),t+1}return 0},R.prototype.doKeyDown=function(){var e=this.diagram;if(null!==e){var t=e.lastInput;if("Up"===t.key||"Down"===t.key||"Left"===t.key||"Right"===t.key){var n=this.arrowKeyBehavior;if("none"===n)return;if("select"===n)return void this._arrowKeySelect();if("move"===n)return void this._arrowKeyMove();if("tree"===n)return void this._arrowKeyTree()}go.CommandHandler.prototype.doKeyDown.call(this)}},R.prototype._getAllParts=function(){var e=new Array;return this.diagram.nodes.each((function(t){e.push(t)})),this.diagram.parts.each((function(t){e.push(t)})),e},R.prototype._arrowKeyMove=function(){var e=this.diagram,t=e.lastInput,n=0,i=0;if(t.control||t.meta)n=1,i=1;else if(null!==e.grid){var o=e.grid.gridCellSize;i=o.width,n=o.height}e.startTransaction("arrowKeyMove"),e.selection.each((function(e){"Up"===t.key?e.move(new go.Point(e.actualBounds.x,e.actualBounds.y-n)):"Down"===t.key?e.move(new go.Point(e.actualBounds.x,e.actualBounds.y+n)):"Left"===t.key?e.move(new go.Point(e.actualBounds.x-i,e.actualBounds.y)):"Right"===t.key&&e.move(new go.Point(e.actualBounds.x+i,e.actualBounds.y))})),e.commitTransaction("arrowKeyMove")},R.prototype._arrowKeySelect=function(){var e=this.diagram,t=e.lastInput,n=null;"Up"===t.key?n=this._findNearestPartTowards(270):"Down"===t.key?n=this._findNearestPartTowards(90):"Left"===t.key?n=this._findNearestPartTowards(180):"Right"===t.key&&(n=this._findNearestPartTowards(0)),null!==n&&(t.shift?n.isSelected=!0:t.control||t.meta?n.isSelected=!n.isSelected:e.select(n))},R.prototype._findNearestPartTowards=function(e){var t=this.diagram.selection.first();if(null===t)return null;for(var n=t.actualBounds.center,i=this._getAllParts(),o=1/0,a=t,r=0;r<i.length;r++){var l=i[r];if(l!==t&&l.canSelect()){var s=l.actualBounds.center,c=n.directionPoint(s),u=this._angleCloseness(c,e);if(u<=45){var d=n.distanceSquaredPoint(s);(d*=1+Math.sin(u*Math.PI/180))<o&&(o=d,a=l)}}}return a},R.prototype._angleCloseness=function(e,t){return Math.min(Math.abs(t-e),Math.min(Math.abs(t+360-e),Math.abs(t-360-e)))},R.prototype._arrowKeyTree=function(){var e=this.diagram,t=e.selection.first();if(t instanceof go.Node){var n=e.lastInput;if("Right"===n.key)if(t.isTreeLeaf);else if(t.isTreeExpanded){null!==(o=this._sortTreeChildrenByY(t).first())&&e.select(o)}else e.commandHandler.canExpandTree(t)&&e.commandHandler.expandTree(t);else if("Left"===n.key){if(!t.isTreeLeaf&&t.isTreeExpanded)e.commandHandler.canCollapseTree(t)&&e.commandHandler.collapseTree(t);else null!==(a=t.findTreeParentNode())&&e.select(a)}else if("Up"===n.key){if(null!==(a=t.findTreeParentNode()))if((l=(r=this._sortTreeChildrenByY(a)).indexOf(t))>0){for(var i=r.elt(l-1);null!==i&&i.isTreeExpanded&&!i.isTreeLeaf;){i=this._sortTreeChildrenByY(i).last()}null!==i&&e.select(i)}else e.select(a)}else if("Down"===n.key){var o;if(t.isTreeExpanded&&!t.isTreeLeaf)null!==(o=this._sortTreeChildrenByY(t).first())&&e.select(o);else for(;null!==t;){var a,r,l;if(null===(a=t.findTreeParentNode()))break;if((l=(r=this._sortTreeChildrenByY(a)).indexOf(t))<r.length-1){e.select(r.elt(l+1));break}t=a}}var s=e.selection.first();null!==s&&e.scrollToRect(s.actualBounds)}},R.prototype._sortTreeChildrenByY=function(e){var t=(new go.List).addAll(e.findTreeChildrenNodes());return t.sort((function(e,t){var n=e.location,i=t.location;return n.y<i.y?-1:n.y>i.y?1:n.x<i.x?-1:n.x>i.x?1:0})),t},R.prototype.copyToClipboard=function(e){go.CommandHandler.prototype.copyToClipboard.call(this,e),this._lastPasteOffset.set(this.pasteOffset)},R.prototype.pasteFromClipboard=function(){var e=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(e,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),e},Object.defineProperty(R.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(e){if("move"!==e&&"select"!==e&&"scroll"!==e&&"tree"!==e&&"none"!==e)throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+e);this._arrowKeyBehavior=e}}),Object.defineProperty(R.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(e){if(!(e instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+e);this._pasteOffset.set(e)}});var D=R,F=(n(57193),n(85160)),H=n(43418),W=n(43604),z=n(85750),V="myPaletteDiv___Xjz2I",q="maxH60___Pd4Re";window.go=I;var U=function(e){var t=e.onCancel,n=e.callback,i=(0,c.useRef)(),o=(0,c.useRef)(),a=(0,c.useRef)(),l=(0,c.useRef)(!1),s=(0,c.useRef)(!1),u=(0,c.useState)(0),d=r()(u,2),f=d[0],p=d[1],m=function(){var e=G()(L()().mark((function e(){var t,o;return L()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.current.makeImage(),e.next=3,(0,z.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:t.src}});case 3:o=e.sent,n({src:o.url});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){p(f+1)}),[]),(0,h.jsx)("div",{ref:s,className:l.current?"".concat(q," body-overflow-initial"):"body-overflow-initial",children:(0,h.jsx)(H.Z,{width:1200,icon:null,footer:null,closable:!0,visible:!!f,destroyOnClose:!0,maskClosable:!1,getContainer:s.current,rootClassName:"zIndex-9999",title:(0,h.jsxs)(A.Z,{children:[(0,h.jsx)(W.Z,{flex:1,children:"插入流程图"}),(0,h.jsx)(W.Z,{onClick:function(){l.current=!l.current,p(f+1)},children:(0,h.jsx)("span",{className:"current c-blue mr30",style:{fontWeight:400},children:"展开/收起"})})]}),onCancel:t,children:(0,h.jsxs)("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative"},children:[(0,h.jsxs)("div",{style:{display:"flex",height:"100%"},children:[(0,h.jsxs)("div",{style:{width:"300px",height:"100%"},children:[(0,h.jsx)("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"},children:"图形库"}),(0,h.jsx)("div",{style:{height:"calc(100% - 50px)"},className:V,ref:a})]}),(0,h.jsxs)("div",{style:{flex:1,position:"relative"},children:[(0,h.jsx)(F.FI,{initDiagram:function(){var e=I.GraphObject.make,t="#ff3333",n="#3358ff",r="#25ad23",l="#d533ff",s="#7d33ff",c="#ff6233",u="#ffffff",d="#000000",f="#fffcd5",p="#d5ebff",h="#f2dfe0",m="#a5d2fa",g="#cccccc",v="#b3e6b3",w="#fcbbbd";function b(t,n){var i=function(e,n){e.handled=!0,e.diagram.model.commit((function(i){var o=n.part.adornedPart,a=(new I.Point).setRectSpot(o.actualBounds,t);a.subtract(o.location),a.scale(2,2),a.x+=130*Math.sign(a.x),a.y+=130*Math.sign(a.y),a.add(o.location),a.snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize);var r=i.copyNodeData(o.data);i.setGroupKeyForNodeData(r,i.getGroupKeyForNodeData(o.data)),i.addNodeData(r);var l={from:o.key,to:i.getKeyForNodeData(r)};i.addLinkData(l);var s=e.diagram.findNodeForData(r);s.location=a,e.diagram.select(s),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)}))};return e(I.Shape,{figure:n,alignment:t,alignmentFocus:t.opposite(),width:t.equals(I.Spot.Top)||t.equals(I.Spot.Bottom)?25:18,height:t.equals(I.Spot.Top)||t.equals(I.Spot.Bottom)?18:25,fill:"orange",stroke:u,strokeWidth:4,mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="orange"},isActionable:!0,click:i,contextClick:i})}function x(t){return e(I.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:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="orange"},click:function(e,t){e.diagram.commandHandler.showContextMenu(t.part.adornedPart)}},t||{})}function y(e,t){return function(n,i){n.handled=!0,n.diagram.model.commit((function(n){n.set(i.part.adornedPart.data,e,t)}))}}function _(t,n){return n||(n="color"),e(I.Shape,{width:16,height:16,stroke:"lightgray",fill:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.stroke="dodgerblue"},mouseLeave:function(e,t){return t.stroke="lightgray"},click:y(n,t),contextClick:y(n,t)})}function S(){return[e("ContextMenuButton",e(I.Panel,"Horizontal",_(u,"fill"),_(f,"fill"),_(p,"fill"),_(h,"fill"))),e("ContextMenuButton",e(I.Panel,"Horizontal",_(g,"fill"),_(v,"fill"),_(m,"fill"),_(w,"fill")))]}function k(){return[e("ContextMenuButton",e(I.Panel,"Horizontal",_(d),_(r),_(n),_(t))),e("ContextMenuButton",e(I.Panel,"Horizontal",_(u),_(l),_(s),_(c)))]}function C(t,n){return n||(n="thickness"),e(I.Shape,"LineH",{width:16,height:16,strokeWidth:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:y(n,t),contextClick:y(n,t)})}function j(t,n){return n||(n="dash"),e(I.Shape,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:y(n,t),contextClick:y(n,t)})}function B(){return[e("ContextMenuButton",e(I.Panel,"Horizontal",C(1),C(2),C(3),C(4))),e("ContextMenuButton",e(I.Panel,"Horizontal",j(null),j([2,4]),j([4,4])))]}function T(t,n){return n||(n="figure"),e(I.Shape,{width:32,height:32,scale:.5,fill:"lightgray",figure:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="lightgray"},click:y(n,t),contextClick:y(n,t)})}function A(t){return e(I.Shape,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(t+4).toString()+" H3"})}function N(t){var n="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return 0===t?n="M0 0 M16 16 M0 8 L16 8":2===t&&(n="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),e(I.Shape,{geometryString:n,margin:2,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:y("dir",t),contextClick:y("dir",t)})}function P(t){var n=function(e,n){e.handled=!0,e.diagram.model.commit((function(e){var i=n.part.adornedPart;e.set(i.data,t?"toSpot":"fromSpot",I.Spot.stringify(I.Spot.AllSides)),(t?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(I.Shape,{width:12,height:12,fill:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:n,contextClick:n})}function E(t,n){var i=0,o=I.Spot.RightSide;t.equals(I.Spot.Top)?(i=270,o=I.Spot.TopSide):t.equals(I.Spot.Left)?(i=180,o=I.Spot.LeftSide):t.equals(I.Spot.Bottom)&&(i=90,o=I.Spot.BottomSide),n||(i-=180);var a=function(e,t){e.handled=!0,e.diagram.model.commit((function(e){var i=t.part.adornedPart;e.set(i.data,n?"toSpot":"fromSpot",I.Spot.stringify(o)),(n?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(I.Shape,{alignment:t,alignmentFocus:t.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:i,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:a,contextClick:a})}return i.current=new I.Diagram(o.current,{padding:20,grid:e(I.Panel,"Grid",e(I.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(I.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:function(e){e.diagram.commandHandler.addTopLevelParts(e.diagram.selection,!0)||e.diagram.currentTool.doCancel()},commandHandler:e(D),"clickCreatingTool.archetypeNodeData":{text:"未命名",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:function(e){var t=e.subject;t.location=t.location.copy().snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:function(e){e.subject;setTimeout((function(){e.diagram.commandHandler.editTextBlock()}))},LinkRelinked:function(e){e.parameter.part.invalidateConnectedLinks();var t=e.subject;e.diagram.toolManager.linkingTool.isForwards?t.toNode.invalidateConnectedLinks():t.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),i.current.nodeTemplate=e(I.Node,"Auto",{locationSpot:I.Spot.Center,locationObjectName:"SHAPE",desiredSize:new I.Size(120,60),minSize:new I.Size(40,40),resizable:!0,resizeCellSize:new I.Size(10,10),rotatable:!0},new I.Binding("location","loc",I.Point.parse).makeTwoWay(I.Point.stringify),new I.Binding("desiredSize","size",I.Size.parse).makeTwoWay(I.Size.stringify),e(I.Shape,{name:"SHAPE",fill:u,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:I.Spot.AllSides,toSpot:I.Spot.AllSides},new I.Binding("figure"),new I.Binding("fill"),new I.Binding("stroke","borderColor"),new I.Binding("strokeWidth","thickness"),new I.Binding("strokeDashArray","dash")),e(I.Shape,{width:100,height:20,strokeWidth:0,fill:"transparent"}),e(I.TextBlock,{margin:1,textAlign:"center",overflow:I.TextBlock.OverflowEllipsis,editable:!0},new I.Binding("text").makeTwoWay(),new I.Binding("stroke","color"))),i.current.nodeTemplate.toolTip=e("ToolTip",e(I.Panel,"Vertical",{maxSize:new I.Size(200,NaN)},e(I.TextBlock,{font:"bold 10pt sans-serif",textAlign:"center"},new I.Binding("text")),e(I.TextBlock,{font:"10pt sans-serif",textAlign:"center"},new I.Binding("text","details")))),i.current.nodeTemplate.selectionAdornmentTemplate=e(I.Adornment,"Spot",e(I.Placeholder,{padding:10}),b(I.Spot.Top,"TriangleUp"),b(I.Spot.Left,"TriangleLeft"),b(I.Spot.Right,"TriangleRight"),b(I.Spot.Bottom,"TriangleDown"),x({alignment:new I.Spot(.75,0)})),i.current.nodeTemplate.contextMenu=e("ContextMenu",e("ContextMenuButton",e(I.Panel,"Horizontal",T("Rectangle"),T("RoundedRectangle"),T("Ellipse"),T("Diamond"))),e("ContextMenuButton",e(I.Panel,"Horizontal",T("Parallelogram2"),T("ManualOperation"),T("Procedure"),T("Cylinder1"))),e("ContextMenuButton",e(I.Panel,"Horizontal",T("Terminator"),T("CreateRequest"),T("Document"),T("TriangleDown"))),S(),k(),B()),i.current.groupTemplate=e(I.Group,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:I.Spot.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:function(e,t){t.addMembers(t.diagram.selection,!0)||t.diagram.currentTool.doCancel()},avoidable:!1},new I.Binding("location","loc",I.Point.parse).makeTwoWay(I.Point.stringify),e(I.Panel,"Auto",{name:"BODY"},e(I.Shape,{parameter1:10,fill:u,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:I.Spot.AllSides,toSpot:I.Spot.AllSides},new I.Binding("fill"),new I.Binding("stroke","color"),new I.Binding("strokeWidth","thickness"),new I.Binding("strokeDashArray","dash")),e(I.Placeholder,{background:"transparent",margin:20})),e(I.TextBlock,{alignment:I.Spot.Top,alignmentFocus:I.Spot.Bottom,font:"bold 12pt sans-serif",editable:!0},new I.Binding("text"),new I.Binding("stroke","color"))),i.current.groupTemplate.selectionAdornmentTemplate=e(I.Adornment,"Spot",e(I.Panel,"Auto",e(I.Shape,{fill:null,stroke:"dodgerblue",strokeWidth:3}),e(I.Placeholder,{margin:1.5})),x({alignment:I.Spot.TopRight,alignmentFocus:I.Spot.BottomRight})),i.current.groupTemplate.contextMenu=e("ContextMenu",S(),k(),B()),i.current.linkTemplate=e(I.Link,{layerName:"Foreground",routing:I.Link.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new I.Binding("fromSpot","fromSpot",I.Spot.parse),new I.Binding("toSpot","toSpot",I.Spot.parse),new I.Binding("fromShortLength","dir",(function(e){return e>=1?10:0})),new I.Binding("toShortLength","dir",(function(e){return e>=1?10:0})),new I.Binding("points").makeTwoWay(),e(I.Shape,{strokeWidth:2},new I.Binding("stroke","color"),new I.Binding("strokeWidth","thickness"),new I.Binding("strokeDashArray","dash")),e(I.Shape,{segmentIndex:0,segmentOffset:new I.Point(15,0),segmentOrientation:I.Link.OrientAlong,alignmentFocus:I.Spot.Right,figure:"circle",width:10,strokeWidth:0},new I.Binding("fill","color"),new I.Binding("visible","dir",(function(e){return 1===e}))),e(I.Shape,{segmentIndex:-1,segmentOffset:new I.Point(-10,6),segmentOrientation:I.Link.OrientPlus90,alignmentFocus:I.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new I.Binding("fill","color"),new I.Binding("visible","dir",(function(e){return e>=1})),new I.Binding("width","thickness",(function(e){return 7+3*e})),new I.Binding("height","thickness",(function(e){return 7+3*e})),new I.Binding("segmentOffset","thickness",(function(e){return new I.Point(-15,4+1.5*e)}))),e(I.Shape,{segmentIndex:0,segmentOffset:new I.Point(15,-6),segmentOrientation:I.Link.OrientMinus90,alignmentFocus:I.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new I.Binding("fill","color"),new I.Binding("visible","dir",(function(e){return 2===e})),new I.Binding("width","thickness",(function(e){return 7+3*e})),new I.Binding("height","thickness",(function(e){return 7+3*e})),new I.Binding("segmentOffset","thickness",(function(e){return new I.Point(-15,4+1.5*e)}))),e(I.TextBlock,{alignmentFocus:new I.Spot(0,1,-4,0),editable:!0},new I.Binding("text").makeTwoWay(),new I.Binding("stroke","color"))),i.current.linkTemplate.selectionAdornmentTemplate=e(I.Adornment,e(I.Shape,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:A(2)},new I.Binding("pathPattern","thickness",A)),x({alignmentFocus:new I.Spot(0,0,-6,-4)})),i.current.linkTemplate.contextMenu=e("ContextMenu",k(),B(),e("ContextMenuButton",e(I.Panel,"Horizontal",N(0),N(1),N(2))),e("ContextMenuButton",e(I.Panel,"Horizontal",e(I.Panel,"Spot",P(!1),E(I.Spot.Top,!1),E(I.Spot.Left,!1),E(I.Spot.Right,!1),E(I.Spot.Bottom,!1)),e(I.Panel,"Spot",{margin:new I.Margin(0,0,0,2)},P(!0),E(I.Spot.Top,!0),E(I.Spot.Left,!0),E(I.Spot.Right,!0),E(I.Spot.Bottom,!0))))),new I.Palette(a.current,{maxSelectionCount:1,linkTemplate:e(I.Link,{locationSpot:I.Spot.Center,selectionAdornmentTemplate:e(I.Adornment,"Link",{locationSpot:I.Spot.Center},e(I.Shape,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),e(I.Shape,{toArrow:"Standard",stroke:null}))},{routing:I.Link.AvoidsNodes,curve:I.Link.JumpOver,corner:5,toShortLength:4},new I.Binding("points"),e(I.Shape,{isPanelMain:!0,strokeWidth:2}),e(I.Shape,{toArrow:"Standard",stroke:null})),model:new I.GraphLinksModel([{text:"未命名",size:"100 100",fill:null,stroke:"#000"}].concat(Z()(I.Shape.getFigureGenerators().toArray().map((function(e){return{text:"未命名",size:"100 100",figure:e.key,fill:"white",stroke:"#666",borderColor:"#000"}})))))}).nodeTemplate=e(I.Node,"Auto",{locationSpot:I.Spot.Center},new I.Binding("location","location",I.Point.parse).makeTwoWay(I.Point.stringify),e(I.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 I.Binding("stroke").makeTwoWay(),new I.Binding("fill").makeTwoWay(),new I.Binding("figure")),e(I.TextBlock,{margin:new I.Margin(5,5,3,5),font:"10pt sans-serif",minSize:new I.Size(16,16),maxSize:new I.Size(10,NaN),textAlign:"center",editable:!0},new I.Binding("key").makeTwoWay())),setTimeout((function(){i.current.grid=e(I.Panel,"Grid",e(I.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(I.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),i.current.grid.visible=!0,i.current.grid.gridCellStroke="darkgray",i.current.grid.gridCellStrokeWidth=1}),300),window.myDiagrams=i.current,i.current},divClassName:"diagram-component",style:{height:"80vh"}}),(0,h.jsx)("div",{ref:o})]})]}),(0,h.jsx)("div",{className:"tr",children:(0,h.jsx)(k.ZP,{size:"large",onClick:m,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary",children:"保存到编辑器"})})]})})})},Y=n(5112),J=n(94001),K=Y.ZP.Group,X={margin:"0 8px"},Q=function(e){var t=e.callback,n=e.onCancel;return(0,h.jsxs)(_.Z,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){t(e)},children:[(0,h.jsxs)("div",{className:"flex-container",style:{alignItems:"baseline"},children:[(0,h.jsx)("span",{style:X,children:"单元格数:"}),(0,h.jsx)("span",{style:X,children:"行数"}),(0,h.jsx)(_.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,h.jsx)(J.Z,{})}),(0,h.jsx)("span",{style:X,children:"列数"}),(0,h.jsx)(_.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,h.jsx)(J.Z,{})})]}),(0,h.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,h.jsx)("span",{style:X,children:"对齐方式:"}),(0,h.jsx)(_.Z.Item,{name:"align",children:(0,h.jsxs)(K,{children:[(0,h.jsx)(Y.ZP,{value:"default",children:(0,h.jsx)("i",{className:"fa fa-align-justify"})}),(0,h.jsx)(Y.ZP,{value:"left",children:(0,h.jsx)("i",{className:"fa fa-align-left"})}),(0,h.jsx)(Y.ZP,{value:"center",children:(0,h.jsx)("i",{className:"fa fa-align-center"})}),(0,h.jsx)(Y.ZP,{value:"right",children:(0,h.jsx)("i",{className:"fa fa-align-right"})})]})})]}),(0,h.jsxs)("div",{className:"flex-container flex-end",children:[(0,h.jsx)(k.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(k.ZP,{type:"ghost",onClick:n,children:"取消"})]})]})},$=n(78673),ee=n(38229),te=n.n(ee),ne=(0,c.forwardRef)((function(e,t){var n=e.use3d,i=e.width,o=e.height,a=e.callback,l=(e.showSaveButton,(0,c.useRef)()),s=(0,c.useRef)(),u=(0,c.useState)(!1),d=r()(u,2),f=d[0],p=d[1],m=(0,c.useRef)({id:l,appName:"graphing",width:i||1e3,height:o||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,c.useEffect)((function(){s.current=new(te())(m.current,!0),window.onload=function(){s.current.inject("applet_container")}}),[]);var g=function(){var e=window.ggbApplet.getPNGBase64(1,!0,72);return a&&a(e),e};return(0,c.useEffect)((function(){m.current.appName=f?"3D":"graphing",s.current.inject("applet_container")}),[f]),(0,c.useEffect)((function(){p(n)}),[n]),(0,c.useImperativeHandle)(t,(function(){return{getImgData:g}})),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:l}),(0,h.jsxs)(A.Z,{align:"middle",children:[(0,h.jsx)(W.Z,{flex:1,children:(0,h.jsx)($.Z,{size:"default",checkedChildren:"关闭3D图像",unCheckedChildren:"开启3D图像",checked:f,onChange:function(e){return p(e)}})}),(0,h.jsx)(W.Z,{children:(0,h.jsx)(k.ZP,{size:"large",onClick:g,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})]})})),ie=n(97488),oe=n(20817),ae=n(8591),re="link",le="upload-image",se="add-flowchart",ce="draw-image",ue="code-block",de="add-table",fe="------------",pe={default:fe,left:":".concat(fe),center:":".concat(fe,":"),right:"".concat(fe,":")},he=n(12066);var me="@▁▁@",ge=["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 ve(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var we=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",be=s()(s()({},we+"-B","bold"),we+"-I","italic"),xe=s()(s()(s()(s()(s()(s()(s()(s()({},re,"添加链接"),ue,"添加代码块"),le,"添加图片"),ce,"添加画图"),se,"插入流程图"),de,"添加表格"),"maths-latex","数学图像"),"inline-latex","LATEX公式"),ye=function(e){var t=e.defaultValue,n=void 0===t?"":t,i=e.onChange,a=e.width,l=void 0===a?"100%":a,u=e.height,g=void 0===u?400:u,v=e.miniToolbar,w=void 0!==v&&v,b=e.isFocus,_=void 0!==b&&b,S=e.watch,k=e.insertTemp,C=e.mode,A=void 0===C?"markdown":C,N=e.id,E=void 0===N?"markdown-editor-id":N,L=e.showResizeBar,M=void 0!==L&&L,G=e.noStorage,O=void 0!==G&&G,Z=e.showNullButton,I=void 0!==Z&&Z,R=e.showNullProgramButton,D=void 0!==R&&R,F=e.hidetoolBar,W=void 0!==F&&F,z=e.fullScreen,V=void 0!==z&&z,q=e.onBlur,Y=e.onCMBeforeChange,J=e.onFullScreen,K=e.className,X=void 0===K?"":K,$=e.disablePaste,ee=void 0!==$&&$,te=e.disabled,fe=void 0!==te&&te,we=e.disabledFill,ye=void 0!==we&&we,_e=e.placeholder,Se=void 0===_e?"":_e,ke=e.values,Ce=void 0===ke?"":ke,je=e.extraUse,Be=(0,c.useState)(null),Te=r()(Be,2),Ae=Te[0],Ne=Te[1],Pe=(0,c.useState)(n),Ee=r()(Pe,2),Le=Ee[0],Me=Ee[1],Ge=(0,c.useState)(S),Oe=r()(Ge,2),Ze=Oe[0],Ie=Oe[1],Re=(0,c.useState)(V),De=r()(Re,2),Fe=De[0],He=De[1],We=(0,c.useState)(""),ze=r()(We,2),Ve=ze[0],qe=ze[1],Ue=(0,c.useState)(0),Ye=r()(Ue,2),Je=Ye[0],Ke=Ye[1],Xe=(0,c.useState)(g),Qe=r()(Xe,2),$e=Qe[0],et=Qe[1],tt=(0,c.useState)(!1),nt=r()(tt,2),it=(nt[0],nt[1]),ot=(0,c.useState)(0),at=r()(ot,2),rt=at[0],lt=at[1],st=(0,c.useState)(0),ct=r()(st,2),ut=ct[0],dt=ct[1],ft=(0,c.useRef)(),pt=(0,c.useRef)(),ht=(0,c.useRef)(),mt=(0,c.useRef)();(0,c.useEffect)((function(){var e=window.scrollY||window.pageYOffset;Me(Ce),null==Ae||Ae.setValue(Ce),window.scrollTo(0,e)}),[Ce]),(0,c.useEffect)((function(){null==J||J(Fe)}),[Fe]),(0,c.useEffect)((function(){if(ft.current){var e=function(e,n){if(!ee){var i=n.clipboardData;if(i){var o=i.types.toString(),a=i.items;if("Files"===o||i.types.indexOf("Files")>-1){if(n.preventDefault(),"stex"==A)return;try{var r,l=a[1];"file"===(null===(r=a[0])||void 0===r?void 0:r.kind)&&(l=a[0]);var s=l.getAsFile(),c=s.name.split(".").pop();(0,T.I)(s,(function(e){var n,i,o;e.id?(null==s||null===(n=s.type)||void 0===n?void 0:n.indexOf("image"))>-1?t.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):(null==s||null===(i=s.type)||void 0===i?void 0:i.indexOf("video"))>-1?t.replaceSelection('<video width="100%" controls src="'.concat(oe.Z.API_SERVER,"/api/attachments/").concat(e.id,'"></video>')):(null==s||null===(o=s.type)||void 0===o?void 0:o.indexOf("pdf"))>-1?t.replaceSelection('<a href="'.concat(oe.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(s.type,'&disposition=inline" target="_blank">').concat(s.name,"</a>")):ge.includes(c)?t.replaceSelection('<a href="'.concat(oe.Z.API_SERVER,"/api/attachments/").concat(e.id,'?type=office&disposition=inline" target="_blank">').concat(s.name,"</a>")):t.replaceSelection("[".concat(s.name,"](").concat(oe.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))}catch(n){ae.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}n.preventDefault()},t=d().fromTextArea(ft.current,{mode:A,lineNumbers:!w,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});return t.on("keyup",(function(e,n){8===n.keyCode&&(""==e.getValue()?t.setOption("placeholder",Se):t.setOption("placeholder",null))})),t.on("keydown",(function(e,t){if(8===t.keyCode){var n=function(e,t){var n=e.getDoc(),i=n.getCursor(),o=n.getLine(i.line),a=o.charAt(i.ch-1),r=o.lastIndexOf("@▁@",i.ch),l=o.lastIndexOf("@▁▁@",i.ch),s=r>l?r:l,c=r>l?3:4;if(-1===me.indexOf(a))return null;if(console.log("change1:",t,e,o,i,s,r,l,a),s>=0&&i.ch-s<5){var u=s+c;return n.replaceRange("",{line:i.line,ch:s},{line:i.line,ch:u}),{line:i.line,ch:u}}return null}(e);n&&t.preventDefault()}})),_&&t.focus(),t.on("paste",e),fe&&t.on("beforeChange",(function(e,t){"paste"!==t.origin&&"+input"!==t.origin||t.cancel()})),Ne(t),function(){t.off("paste",e)}}}),[]);var gt=(0,c.useCallback)((function(){pt.current}),[$e,pt,Fe]);(0,c.useEffect)((function(){if(Ae){var e=function(){var e=new f.Z((function(e){var t,n=o()(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(gt(),Ae.setSize("100%","100%"),Ae.refresh())}}catch(e){n.e(e)}finally{n.f()}}));return e.observe(ft.current.parentElement),e}();return function(){var t,n;null!==(t=ft.current)&&void 0!==t&&t.parentElement&&e.unobserve(null===(n=ft.current)||void 0===n?void 0:n.parentElement)}}}),[Ae,gt]),(0,c.useEffect)((function(){if(Ae){for(var e=[],t=function(){var t=r()(i[n],2),o=t[0],a=t[1],l=s()({},o,(function(){vt(a)}));e.push(l),Ae.addKeyMap(l)},n=0,i=Object.entries(be);n<i.length;n++)t();return function(){for(var t=0,n=e;t<n.length;t++){var i=n[t];Ae.removeKeyMap(i)}}}}),[Ae]),(0,c.useEffect)((function(){V!==Fe&&He(V)}),[V]),(0,he.Z)((function(){if(!O&&Je>0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(E);e>=Je+1e4&&(!t||t!==Le)&&(window.sessionStorage.setItem(E,Le),it(!0))}}),1e4),(0,c.useEffect)((function(){Ie(S)}),[Ae,S]),(0,c.useEffect)((function(){Ae&&_&&Ae.focus()}),[Ae,_]),(0,c.useEffect)((function(){if(Ze&&Ae){var e=function(e){var t=e.target;if(mt.current){var n=t.scrollTop/t.scrollHeight;mt.current.scrollTop=mt.current.scrollHeight*n}},t=Ae.getScrollerElement();return t.addEventListener("scroll",e),function(){t.removeEventListener("scroll",e)}}}),[Ae,Ze]),(0,c.useEffect)((function(){if(Ae&&Y){var e=function(e,t){Y(e,t)};return Ae.on("beforeChange",e),function(){Ae.off("beforeChange",e)}}}),[Ae,Y]),(0,c.useEffect)((function(){if(Ae&&q){var e=function(){q(Ae.getValue())};return Ae.on("blur",e),function(){Ae.off("blur",e)}}}),[Ae,q]),(0,c.useEffect)((function(){if(Ae){var e=function(e,t){var n=e.getValue();Me(n),Ke((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),i&&(D?i(n,_t(n)):i(n))};return Ae.on("change",e),function(){Ae.off("change",e)}}}),[Ae,i]),(0,c.useEffect)((function(){if(Ae)if(null==n)Ae.setValue(""),Me("");else{var e=window.scrollY||window.pageYOffset;n!==Ae.getValue()&&(Ae.setValue(n),Me(n),Ae.setCursor(fe?1:Ae.lineCount(),0),window.scrollTo(0,e))}}),[Ae,n]);var vt=(0,c.useCallback)((function(e){var t=Ae.getCursor(),n=Ae.getSelection(),i=n.split("\n");switch(e){case"bold":return Ae.replaceSelection("**"+n+"**"),""===n&&Ae.setCursor(t.line,t.ch+2),Ae.focus();case"italic":return Ae.replaceSelection("*"+n+"*"),""===n&&Ae.setCursor(t.line,t.ch+1),Ae.focus();case"code":return Ae.replaceSelection("`"+n+"`"),""===n&&Ae.setCursor(t.line,t.ch+1),Ae.focus();case"inline-latex":return qe("inline-latex"),Ae.focus();case"latex":return Ae.replaceSelection("```latex\n"+n+"\n```"),Ae.setCursor(t.line+1,n.length+1),Ae.focus();case"line-break":return Ae.replaceSelection("<br/>\n"),Ae.focus();case"list-ul":return""===n?Ae.replaceSelection("- "+n):Ae.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),Ae.focus();case"list-ol":return""===n?Ae.replaceSelection("1. "+n):Ae.replaceSelection(i.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),Ae.focus();case"add-null-ch":return""===n&&Ae.setCursor(t.line,t.ch),Ae.replaceSelection("▁"),Ae.focus();case"add-signal":return""===n&&Ae.setCursor(t.line,t.ch),Ae.replaceSelection("@▁@"),Ae.focus();case"add-multiple":return""===n&&Ae.setCursor(t.line,t.ch),Ae.replaceSelection(me),Ae.focus();case"inster-template-1":return""===n&&Ae.setCursor(t.line,t.ch),Ae.replaceSelection("\n**模板标题**\n模板正文内容可输入文本内容和粘贴图片等操作"),Ae.focus();case"eraser":return Ae.setValue(""),Ae.focus();case"trigger-watch":return Ie(!Ze),Ae.focus();case"trigger-full-screen":return He(!Fe),Ae.focus();case re:return void qe(re);case ue:return void qe(ue);case le:return void qe(le);case ce:return void qe(ce);case"maths-latex":return void qe("maths-latex");case se:return void qe(se);case de:return void qe(de);default:throw new Error}}),[Ae,Ze,Fe]),wt=(0,c.useCallback)((function(e,t){var n,i,o,a,r;switch(qe(""),Ve){case re:var l=e.title,s=e.link;return Ae.replaceSelection("[".concat(l,"](").concat(s,")")),Ae.focus();case ue:var c=e.language,u=e.content;return Ae.replaceSelection(["```"+c,u,"```"].join("\n")),Ae.focus();case"maths-latex":for(var d=atob(e),f=new Uint8Array(d.length),p=0;p<d.length;p++)f[p]=d.charCodeAt(p);var h=new Blob([f],{type:"image/png"});(0,T.I)(h,(function(e){e.id?Ae.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}));break;case"inline-latex":Ae.replaceSelection("`$$"+e+"$$`");break;case le:case ce:case"add-flowchart":var m=e.src,g=e.alt,v=t,w=null==v||null===(n=v.name)||void 0===n||null===(n=n.split("."))||void 0===n||null===(i=n.pop)||void 0===i?void 0:i.call(n);return(null==v||null===(o=v.type)||void 0===o?void 0:o.indexOf("image"))>-1||null==v||!v.type?g?Ae.replaceSelection("![ ".concat(g," ]( ").concat(m,' "').concat(g,'" )')):Ae.replaceSelection("![,](".concat(m,")")):(null==v||null===(a=v.type)||void 0===a?void 0:a.indexOf("video"))>-1?Ae.replaceSelection('<video width="100%" controls src="'.concat(oe.Z.API_SERVER).concat(m,'"></video>')):(null==v||null===(r=v.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?Ae.replaceSelection('<a href="'.concat(oe.Z.API_SERVER).concat(m,"?type=").concat(v.type,'&disposition=inline" target="_blank">').concat(v.name,"</a>")):ge.includes(w)?Ae.replaceSelection('<a href="'.concat(oe.Z.API_SERVER).concat(m,'?type=office&disposition=inline" target="_blank">').concat(v.name,"</a>")):Ae.replaceSelection("[".concat(v.name,"](").concat(oe.Z.API_SERVER).concat(m,")")),Ae.focus();case de:for(var b=e.row,x=e.col,y=e.align,_="\n",S=0;S<b;S++){for(var k=[],C=[],j=0;j<x;j++)1===S&&C.push(pe[y]),k.push(" ");1===S&&(_+="| ".concat(C.join(" | ")," |\n")),_+="| ".concat(k.join(1===x?"":" | ")," |\n")}return Ae.replaceSelection(_+"\n"),Ae.focus();default:throw new Error}}),[Ae,Ve]),bt=(0,c.useMemo)((function(){switch(Ve){case re:return(0,h.jsx)(j,{callback:wt,onCancel:xt});case ue:return(0,h.jsx)(B.Z,{callback:wt,onCancel:xt});case le:return(0,h.jsx)(T.Z,{callback:wt,onCancel:xt});case se:return(0,h.jsx)(U,{callback:wt,onCancel:xt});case de:return(0,h.jsx)(Q,{callback:wt,onCancel:xt});case"maths-latex":return(0,h.jsx)(ne,{showSaveButton:!0,callback:wt});case"inline-latex":return(0,h.jsx)(ie.Z,{showSaveButton:!0,callback:wt});default:return null}}),[Ve]);function xt(){qe("")}(0,c.useEffect)((function(){if(ht.current){var e=function(e){o=!0,a=e.pageY},t=function(){o=!1},n=function(e){if(o){var t=e.pageY-a;t<0&&(t=0),t>300&&(t=300),et(g+t+"px")}},i=ht.current,o=!1,a=0;return i.addEventListener("mousedown",e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",t),function(){i.removeEventListener("mousedown",e),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",t)}}}),[Ae,ht]),(0,c.useEffect)((function(){et(g)}),[g]);var yt={width:ve(l),height:ve($e)},_t=((0,c.useMemo)((function(){if(Je){var e=new Date(Je),t=e.getHours(),n=e.getMinutes(),i=e.getSeconds();return n=n<10?"0"+n:n,i=i<10?"0"+i:i,"".concat(t=t<10?"0"+t:t,":").concat(n,":").concat(i)}return 0}),[Je]),function(e){var t=[];if(D){e=e.replace(/(@▁▁@|@▁@)/g,(function(e,n,i){t.push({multiLine:!("@▁@"===e)})}))}return t});(0,c.useEffect)((function(){xe[Ve]&&Ve!==ce&&Ve!==se&&setTimeout((function(){var e=document.getElementsByClassName("markdown-popup-form")[0],t=window.innerWidth/2-e.offsetWidth/2,n=window.innerHeight/2-e.offsetHeight/2;lt(t),dt(n)}),0)}),[Ve]);var St=function(e,t,n,i){var o=document.body.clientHeight,a=document.body.clientWidth;return!(e<20&&n>e||e>a-20&&n<e||t<20&&i>t||t>o-20&&i<t)||(document.body.onmousemove=null,document.body.onmouseup=null,!1)};return(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)("div",{className:"markdown-editor-wrapper",ref:pt,children:(0,h.jsxs)("div",{className:"markdown-editor-container ".concat(X," ").concat(Ze?"on-preview":""," ").concat(w?"mini":""," ").concat(Fe?"full-screen":""),style:yt,children:[(0,h.jsx)(x,{insertTemp:k,watch:Ze,fullScreen:Fe,showNullButton:I,showNullProgramButton:D,onActionCallback:vt,hidetoolBar:W,extraUse:je}),(0,h.jsxs)("div",{className:"markdown-editor-body",children:[(0,h.jsx)("div",{className:"codemirror-container",children:(0,h.jsx)("textarea",{ref:ft,placeholder:Se})}),Ze?(0,h.jsxs)("div",{ref:mt,className:"preview-container",children:["stex"===A&&(0,h.jsx)(m,{value:Le}),"stex"!==A&&(0,h.jsx)(p.Z,{disabledFill:ye,showProgramFill:D,value:Le})]}):null]})]})}),M?(0,h.jsx)("a",{ref:ht,className:"editor-resize"}):null,Ve===ce&&(0,h.jsx)(P,{callback:wt,onCancel:xt}),Ve===se&&(0,h.jsx)(U,{callback:wt,onCancel:xt}),(0,h.jsx)(y.Z,{children:xe[Ve]&&Ve!==ce&&Ve!==se?(0,h.jsx)(H.Z,{maskClosable:!1,centered:!0,style:{position:"absolute",left:rt,top:ut},title:(0,h.jsx)("div",{style:{cursor:"move"},onMouseDown:function(e){e.preventDefault();var t=e.clientX-rt,n=e.clientY-ut;document.body.onmousemove=function(e){var i=e.clientX-t,o=e.clientY-n,a=document.getElementsByClassName("markdown-popup-form")[0],r=window.innerWidth-a.offsetWidth,l=window.innerHeight-a.offsetHeight;i=Math.max(0,Math.min(i,r)),o=Math.max(0,Math.min(o,l)),St(e.clientX,e.clientY,t,n)&&(lt(i),dt(o))},document.body.onmouseup=function(){document.body.onmousemove=null}},children:xe[Ve]}),open:!0,onCancel:xt,footer:null,destroyOnClose:!0,width:Ve===se?"1200px":null,height:Ve===se?"80vh":null,className:"markdown-popup-form",children:bt}):null})]})}},72952:function(e,t,n){"use strict";n.d(t,{Z:function(){return v},I:function(){return b}});var i=n(82242),o=n.n(i),a=n(79800),r=n.n(a),l=n(78241),s=n(8591),c=n(92832),u=n(3113),d=n(44177),f=n(59301),p=n(37712),h=l.Z.useForm,m={width:280,marginRight:10},g={labelCol:{span:5},wrapperCol:{span:19}},v=function(e){var t=e.callback,n=e.onCancel,i=h(),a=r()(i,1)[0],d=(0,f.useRef)();function v(e,t){-1!==e.status?a.setFieldsValue({src:"/api/attachments/".concat(e.id),type:t.type}):s.ZP.error(e.message)}return(0,p.jsxs)(l.Z,o()(o()({form:a},g),{},{className:"upload-image-panel",onFinish:function(e){t(e,d.current)},style:{width:470,overflow:"hidden"},children:[(0,p.jsx)(l.Z.Item,{label:"图片地址",required:!0,children:(0,p.jsxs)("div",{className:"flex-container",children:[(0,p.jsx)(l.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,p.jsx)(c.Z,{style:m})}),(0,p.jsx)(w,{onFileChange:function(e){var t=e.target.files[0];d.current=t,b(t,v)}})]})}),(0,p.jsx)(l.Z.Item,{label:"图片描述",name:"alt",children:(0,p.jsx)(c.Z,{style:{width:264}})}),(0,p.jsxs)(l.Z.Item,{style:{textAlign:"right"},children:[(0,p.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,p.jsx)(u.ZP,{type:"default",onClick:n,children:"取消"})]})]}))};function w(e){var t=e.onFileChange;return(0,p.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,p.jsx)("input",{type:"file",onChange:t})]})}function b(e,t){if(!e)throw new String("没有文件");var n=new FormData;n.append("editormd-image-file",e),n.append("file_param_name","editormd-image-file"),n.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(n){t(JSON.parse(n.target.responseText),e)}),!1),i.addEventListener("error",(function(e){console.error(e)}),!1),i.open("POST","".concat(d.KI,"/api/attachments.json")),i.send(n)}},81074:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var i=n(82100),o=n.n(i),a=n(29186),r=n.n(a),l=n(80619),s=n.n(l),c=n(47074),u=n.n(c),d=n(59301),f=n(4676),p=function(e){s()(n,e);var t=u()(n);function n(e){var i;o()(this,n),i=t.call(this,e);var a=window.document;return i.node=a.createElement("div"),a.body.appendChild(i.node),i}return r()(n,[{key:"render",value:function(){var e=this.props.children;return(0,f.createPortal)(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),n}(d.Component)},12066:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var i=n(59301);function o(e,t){var n=(0,i.useRef)();(0,i.useEffect)((function(){n.current=e})),(0,i.useEffect)((function(){if(null!==t){var e=setInterval((function(){n.current()}),t);return function(){return clearInterval(e)}}}),[t])}},26632:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return F}});var i=n(7557),o=n.n(i),a=n(41498),r=n.n(a),l=n(82242),s=n.n(l),c=n(79800),u=n.n(c),d=n(59301),f=n(32007),p=n(78241),h=n(43418),m=n(8591),g=n(92832),v=n(95237),w=n(43604),b=n(3113),x=n(5112),y=n(57809),_=n(95992),S=n(16896),k="bg___Y4VEx",C="formWrap___JY9de",j=n(89392),B=n(93524),T=n(78721),A=n(4942),N=n(84431),P=n(37205),E=n.n(P),L=n(39647),M=n.n(L),G=n(49127),O=n(37712),Z=["InputRight","value","onChange"],I=function(e){var t=e.InputRight,n=e.value,i=void 0===n?[]:n,o=e.onChange,a=void 0===o?function(){}:o,r=M()(e,Z),l=(0,d.useState)(),c=u()(l,2),f=c[0],p=c[1],h=function(e){e.preventDefault(),f&&(a([].concat(E()(i),[f])),p(null))};return(0,O.jsxs)("div",{children:[(0,O.jsx)(g.Z,s()(s()({},r),{},{value:f,onChange:function(e){return p(e.target.value)},onPressEnter:h,onBlur:h})),t,(0,O.jsx)("div",{className:"mt20",children:null==i?void 0:i.map((function(e,t){return(0,O.jsx)(G.Z,{className:"ml10 mr10",count:"x",onClick:function(){return function(e){var t=i.filter((function(t,n){return n!==e}));a(t)}(t)},children:(0,O.jsx)(b.ZP,{type:"primary",ghost:!0,children:e})})}))})]})},R=n(32524),D={1:[100,200],2:[300,400,500,600],3:[700,800,900,1e3]},F=(0,f.connect)((function(e){return{shixunsDetail:e.shixunsDetail,newCourse:e.newCourse,globalSetting:e.globalSetting,practiceSetting:e.practiceSetting}}))((function(e){var t,n,i,a,l,c,P=e.shixunsDetail,E=e.dispatch,L=e.practiceSetting,M=(0,f.useParams)(),G=p.Z.useForm(),Z=u()(G,1)[0],F=(0,d.useState)({}),H=u()(F,2),W=H[0],z=H[1],V=(0,d.useState)([100,200]),q=u()(V,2),U=q[0],Y=q[1],J=P.challengesNew,K=(0,d.useState)(),X=u()(K,2),Q=X[0],$=X[1],ee=(0,d.useState)(),te=u()(ee,2),ne=te[0],ie=te[1],oe=(0,d.useState)(!0),ae=u()(oe,2),re=ae[0],le=ae[1],se=(0,d.useState)(1),ce=u()(se,2),ue=ce[0],de=(ce[1],(0,d.useRef)({subject:"",difficulty:1,hide_task_pass:!1,score:100,hide_width_rate:40,task_pass:(0,N.S)(J.task_pass_default),has_relation:!1})),fe=(0,d.useRef)(null),pe=(L.selectQuestionParams,L.id),he=L.newQuestion;(0,d.useEffect)((function(){M.challengesId?(ie(!0),me()):(le(!0),ie(!1),E({type:"shixunsDetail/getChallengesNew",payload:s()({},M)}),le(!1)),setTimeout((function(){var e;null===(e=document.getElementById("practice-scroll"))||void 0===e||e.scrollTo(0,0)}),300)}),[M]),(0,d.useEffect)((function(){return we(),function(){clearTimeout(fe.current)}}),[W]);var me=function(){var e=r()(o()().mark((function e(){var t,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return le(!0),e.next=3,(0,S.ii)({id:M.id,challengeId:M.challengesId,tab:0});case 3:(t=e.sent)&&(n=s()(s()({},t),{},{task_pass:(0,N.S)(t.task_pass)}),$(n),ge(n),le(!1),de.current={subject:n.subject,difficulty:n.difficulty,score:n.score,task_pass:n.task_pass,hide_task_pass:n.hide_task_pass,hide_width_rate:n.hide_width_rate,has_relation:null==n?void 0:n.has_relation});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ge=function(e){var t={subject:e.name,difficulty:e.difficulty,score:e.score,challenge_tag:e.tags,task_pass:e.task_pass,hide_task_pass:e.hide_task_pass,hide_width_rate:e.hide_width_rate,has_relation:null==e?void 0:e.has_relation},n=D[e.difficulty];Y(n),Z.setFieldsValue(s()({},t)),z(s()({},t))},ve=function(){var e=r()(o()().mark((function e(){var t,n,i,a,r,l,c,u=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:{},n=u.length>1&&void 0!==u[1]&&u[1],i=u.length>2&&void 0!==u[2]?u[2]:1,!ne){e.next=9;break}return e.next=6,(0,S.Rs)(s()(s()({},M),{},{tab:0,challenge:s()({},t),challenge_tag:t.challenge_tag,sync_origin_shixun:n}));case 6:return e.sent&&(E({type:"practiceSetting/setUpdateIndex"}),null!=P&&null!==(a=P.detail)&&void 0!==a&&a.copy_for_exercise&&(0,N.m)(E,P,M.id,i),f.history.replace("/shixuns/".concat(M.id,"/edit/").concat(M.challengesId,"/tab=2"))),e.abrupt("return");case 9:return(r=s()({},W)).identifier=M.id,r.st=0,r.sync_origin_shixun=n,e.next=15,(0,S.al)(s()({},r));case 15:1===(l=e.sent).status&&(null!=P&&null!==(c=P.detail)&&void 0!==c&&c.copy_for_exercise&&(0,N.m)(E,P,M.id,i),f.history.replace("/shixuns/".concat(M.id,"/edit/").concat(l.challenge_id,"/tab=2")),setTimeout((function(){E({type:"practiceSetting/setParams",payload:{newQuestion:null}}),E({type:"practiceSetting/setUpdateIndex"})}),200));case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),we=function(){clearTimeout(fe.current),fe.current=setTimeout(be,500)},be=function(){"subject"in W&&he&&E({type:"practiceSetting/setParams",payload:{newQuestion:{st:0,name:null==W?void 0:W.subject}}});var e=["subject","difficulty","score","task_pass"].some((function(e){var t=(0,j.isNumber)(W[e])?String(W[e]):W[e],n=(0,j.isNumber)(de.current[e])?String(de.current[e]):de.current[e];return!(0,j.isEqual)(t,n)}));E(e?{type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}}:{type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})},xe=function(){var e,t=function(){f.history.push("/shixuns/".concat(pe,"/challenges")),E({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};null!=L&&null!==(e=L.sideBar)&&void 0!==e&&e.confirmLeave?h.Z.confirm({title:"离开此页提示",content:"系统可能不会保存您所做的更改。",okText:"离开",cancelText:"取消",onOk:function(){t()}}):t()};return(0,O.jsxs)(d.Fragment,{children:[(0,O.jsx)("section",{className:k,id:"practice-scroll",children:(0,O.jsxs)(p.Z,{form:Z,className:C,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(e,t){var n,i,o;z(s()({},Z.getFieldsValue())),"difficulty"in e&&(n=e.difficulty,o=null==(i=D[n])?void 0:i[0],Y(i),Z.setFieldsValue({score:o}),z(s()(s()({},Z.getFieldsValue()),{score:o})))},onFinish:function(e){var t,n,i;ne||2!==(null===(t=P.detail)||void 0===t?void 0:t.shixun_status)?null!=P&&null!==(n=P.detail)&&void 0!==n&&n.is_fork_from_creator&&null!=P&&null!==(i=P.detail)&&void 0!==i&&i.copy_for_exercise&&de.current.has_relation?E({type:"classroomList/setActionTabs",payload:{key:"同步修改",value:e,type:"taskLevel",fn:function(e,t,n){ve(e,t,n)}}}):ve(e):m.ZP.info("该实训已经发布不能新建")},children:[(0,O.jsx)(A.Z,{activeIndex:0,isEdit:ne}),(0,O.jsx)(p.Z.Item,{initialValue:"",name:"subject",label:"任务名称:",rules:[{required:!0,message:"请输入任务名称"}],children:(0,O.jsx)(g.Z,{bordered:!1,maxLength:60,suffix:"".concat((null===(t=W.subject)||void 0===t?void 0:t.length)||0,"/60"),placeholder:"例如从Python程序设计-入门精通"})}),(0,O.jsx)(p.Z.Item,{name:"task_pass",label:(0,O.jsxs)(v.Z,{align:"middle",children:[(0,O.jsx)(w.Z,{className:"mr10",children:"任务要求:"}),(0,O.jsx)(w.Z,{children:(null==P||null===(n=P.detail)||void 0===n?void 0:n.id)&&(0,O.jsx)(R.Z,{title:"AI生成",name:"AI生成",children:(0,O.jsx)(b.ZP,{type:"primary",children:"AI生成"})})})]}),rules:[{required:!0,message:"请输入作业的简介"},{max:35e3,message:"过关任务简介最大限制35000个字符"}],children:(0,O.jsx)(_.Z,{watch:!0,defaultValue:ne?null==Q?void 0:Q.task_pass:J.task_pass_default},M.challengesId||"3")}),(0,O.jsx)(p.Z.Item,{initialValue:40,name:"hide_width_rate",label:"任务要求默认展示宽度:",children:(0,O.jsxs)(x.ZP.Group,{children:[(0,O.jsx)(x.ZP,{value:0,children:"0%"}),(0,O.jsx)(x.ZP,{style:{marginLeft:70},value:30,children:"30%"}),(0,O.jsx)(x.ZP,{style:{marginLeft:70},value:40,children:"40%"}),(0,O.jsx)(x.ZP,{style:{marginLeft:70},value:50,children:"50%"})]})}),W.unity_3d&&(null===(i=P.detail)||void 0===i?void 0:i.identity)<3&&(0,O.jsx)(p.Z.Item,{name:"unity_3d_routes",label:"路径:",rules:[{required:!0,message:"必填项:不能为空"}],children:(0,O.jsx)(g.Z,{bordered:!1,disabled:2===(null===(a=P.detail)||void 0===a?void 0:a.shixun_status),placeholder:"请选择版本库中的代码文件。例: src/step1/HelloWorld.java"})}),(0,O.jsx)(p.Z.Item,{initialValue:1,name:"difficulty",label:"难度系数:",rules:[{required:!0,message:"请选择难度系数"}],children:(0,O.jsxs)(x.ZP.Group,{disabled:2===(null===(l=P.detail)||void 0===l?void 0:l.shixun_status),children:[(0,O.jsx)(x.ZP,{value:1,children:"简单"}),(0,O.jsx)(x.ZP,{style:{marginLeft:70},value:2,children:"中等"}),(0,O.jsx)(x.ZP,{style:{marginLeft:70},value:3,children:"困难"})]})}),(0,O.jsx)(p.Z.Item,{name:"challenge_tag",label:(0,O.jsxs)("div",{children:["技能标签 ",(0,O.jsx)("span",{className:"pl20 font12 c-light-black",children:"学员答题正确将获得技能,否则不能获得技能(回车添加标签)"})]}),rules:[{required:!0,message:"请输入技能标签"}],children:(0,O.jsx)(I,{placeholder:"添加标签",style:{width:"260px"},InputRight:(0,O.jsx)("span",{className:"ml5",children:"(回车添加标签)"})})}),(0,O.jsxs)(v.Z,{className:"customItemSelect",children:[(0,O.jsx)(w.Z,{children:(0,O.jsx)(p.Z.Item,{name:"score",initialValue:100,label:"奖励金币:",rules:[{required:!0,message:"请选择奖励经验值"}],children:(0,O.jsx)(y.default,{disabled:2===(null===(c=P.detail)||void 0===c?void 0:c.shixun_status),bordered:!1,getPopupContainer:function(e){return e.parentNode},style:{width:260},children:null==U?void 0:U.map((function(e,t){return(0,O.jsx)(y.default.Option,{value:e,children:e},t)}))})})}),(0,O.jsx)(w.Z,{flex:1,children:(0,O.jsx)("div",{style:{marginTop:88},className:"font12 c-light-black ml10",children:" 学员正确答题时获得金币,并且获得等量的经验值。如:+100金币、+100经验值"})})]})]},ue)},1),(0,O.jsx)(B.t,{onOk:function(){return Z.submit()},className:"customFixedButton",onCancel:function(){xe()}},2),(0,O.jsx)(T.Z,{loading:re})]})}))},4942:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(59301),o=n(43418),a=n(32007),r=n(37712),l=(0,a.connect)((function(e){return{globalSetting:e.globalSetting,practiceSetting:e.practiceSetting}}))((function(e){var t=e.activeIndex,n=e.isEdit,l=void 0===n||n,s=e.dispatch,c=e.practiceSetting,u=(0,a.useParams)(),d=u.id,f=u.challengesId,p=(0,i.useMemo)((function(){return[{name:"本关任务",url:"/shixuns/".concat(d,"/edit/").concat(f,"/editcheckpoint")},{name:"评测设置",url:"/shixuns/".concat(d,"/edit/").concat(f,"/tab=2")},{name:"参考答案",url:"/shixuns/".concat(d,"/edit/").concat(f,"/tab=3")},{name:"关卡排行榜",url:"/shixuns/".concat(d,"/edit/").concat(f,"/tab=4")}]}),[d,f]);return(0,r.jsx)("ul",{className:"challenge-nav",children:l?p.map((function(e,n){return t===n?(0,r.jsxs)("li",{children:[" ",(0,r.jsx)("a",{className:"active",children:e.name})," "]},e.url):(0,r.jsxs)("li",{children:[" ",(0,r.jsx)("a",{onClick:function(){return t=e.url,i=function(){a.history.push(t),s({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})},void(null!=c&&null!==(n=c.sideBar)&&void 0!==n&&n.confirmLeave?o.Z.confirm({title:"离开此页提示",content:"系统可能不会保存您所做的更改。",okText:"离开",cancelText:"取消",onOk:function(){i()}}):i());var t,n,i},children:e.name})," "]},e.url)})):(0,r.jsxs)("li",{children:[" ",(0,r.jsx)("a",{className:"active",children:p[0].name})," "]},p[0].url)})}))},78721:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});n(59301);var i=n(71418),o="loading___lueiN",a=n(37712),r=function(e){return e.loading?(0,a.jsx)("div",{className:o,children:(0,a.jsx)(i.Z,{})}):(0,a.jsx)(a.Fragment,{})}},84431:function(e,t,n){"use strict";n.d(t,{S:function(){return d},m:function(){return f}});var i=n(7557),o=n.n(i),a=n(41498),r=n.n(a),l=n(66621),s=n(8591),c=n(43418),u=n(37712),d=function(e){var t=document.createElement("textarea");return t.value=e,t.value},f=function(){var e=r()(o()().mark((function e(t,n,i,a,r){var d,f,p;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t({type:"shixunsDetail/saveCopyForExercise",payload:{id:i,save_type:a}});case 2:d=e.sent,1===a?(0==(null==d?void 0:d.status)&&s.ZP.success("保存成功"),null!=d&&null!==(f=d.data)&&void 0!==f&&f.exists_same_shixun_name?t({type:"classroomList/setActionTabs",payload:{key:"重名修改",name:null==d||null===(p=d.data)||void 0===p?void 0:p.shixun_name}}):t({type:"classroomList/setActionTabs",payload:{}})):(t({type:"classroomList/setActionTabs",payload:{}}),0===(null==d?void 0:d.status)&&c.Z.info({title:"提示",width:460,icon:null,centered:!0,content:(0,u.jsx)("div",{children:(0,u.jsx)("div",{children:"实训同步修改完成,请验证实训是否可以正常使用。"})}),okText:"前往原实训",onOk:function(){var e;(0,l.xg)("/shixuns/".concat(null==n||null===(e=n.detail)||void 0===e||null===(e=e.fork_from)||void 0===e?void 0:e.fork_identifier,"/challenges"))}}));case 4:case"end":return e.stop()}}),e)})));return function(t,n,i,o,a){return e.apply(this,arguments)}}()},56762:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var i=n(59301);function o(){const[,e]=i.useReducer((e=>e+1),0);return e}},57809:function(e,t,n){"use strict";var i=n(92310),o=n.n(i),a=n(77861),r=n(55405),l=n(59301),s=n(53487),c=n(62892),u=n(19080),d=n(36355),f=n(1684),p=n(93891),h=n(19716),m=n(32441),g=n(33234),v=n(14154),w=n(58582),b=n(84443),x=n(66339),y=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n};const _="SECRET_COMBOBOX_MODE_DO_NOT_USE",S=(e,t)=>{var n,{prefixCls:i,bordered:s=!0,className:S,rootClassName:k,getPopupContainer:C,popupClassName:j,dropdownClassName:B,listHeight:T=256,placement:A,listItemHeight:N=24,size:P,disabled:E,notFoundContent:L,status:M,builtinPlacements:G,dropdownMatchSelectWidth:O,popupMatchSelectWidth:Z,direction:I,style:R,allowClear:D}=e,F=y(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:H,getPrefixCls:W,renderEmpty:z,direction:V,virtual:q,popupMatchSelectWidth:U,popupOverflow:Y,select:J}=l.useContext(d.E_),K=W("select",i),X=W(),Q=null!=I?I:V,{compactSize:$,compactItemClassnames:ee}=(0,g.ri)(K,Q),[te,ne]=(0,v.Z)(K),ie=l.useMemo((()=>{const{mode:e}=F;if("combobox"!==e)return e===_?"combobox":e}),[F.mode]),oe="multiple"===ie||"tags"===ie,ae=(0,b.Z)(F.suffixIcon,F.showArrow),re=null!==(n=null!=Z?Z:O)&&void 0!==n?n:U,{status:le,hasFeedback:se,isFormItemInput:ce,feedbackIcon:ue}=l.useContext(m.aM),de=(0,u.F)(le,M);let fe;fe=void 0!==L?L:"combobox"===ie?null:(null==z?void 0:z("Select"))||l.createElement(p.Z,{componentName:"Select"});const{suffixIcon:pe,itemIcon:he,removeIcon:me,clearIcon:ge}=(0,x.Z)(Object.assign(Object.assign({},F),{multiple:oe,hasFeedback:se,feedbackIcon:ue,showSuffixIcon:ae,prefixCls:K,showArrow:F.showArrow,componentName:"Select"})),ve=!0===D?{clearIcon:ge}:D,we=(0,r.Z)(F,["suffixIcon","itemIcon"]),be=o()(j||B,{[`${K}-dropdown-${Q}`]:"rtl"===Q},k,ne),xe=(0,h.Z)((e=>{var t;return null!==(t=null!=P?P:$)&&void 0!==t?t:e})),ye=l.useContext(f.Z),_e=null!=E?E:ye,Se=o()({[`${K}-lg`]:"large"===xe,[`${K}-sm`]:"small"===xe,[`${K}-rtl`]:"rtl"===Q,[`${K}-borderless`]:!s,[`${K}-in-form-item`]:ce},(0,u.Z)(K,de,se),ee,null==J?void 0:J.className,S,k,ne),ke=l.useMemo((()=>void 0!==A?A:"rtl"===Q?"bottomRight":"bottomLeft"),[A,Q]),Ce=(0,w.Z)(G,Y);return te(l.createElement(a.ZP,Object.assign({ref:t,virtual:q,showSearch:null==J?void 0:J.showSearch},we,{style:Object.assign(Object.assign({},null==J?void 0:J.style),R),dropdownMatchSelectWidth:re,builtinPlacements:Ce,transitionName:(0,c.m)(X,"slide-up",F.transitionName),listHeight:T,listItemHeight:N,mode:ie,prefixCls:K,placement:ke,direction:Q,suffixIcon:pe,menuItemSelectedIcon:he,removeIcon:me,allowClear:ve,notFoundContent:fe,className:Se,getPopupContainer:C||H,dropdownClassName:be,disabled:_e})))};const k=l.forwardRef(S),C=(0,s.Z)(k);k.SECRET_COMBOBOX_MODE_DO_NOT_USE=_,k.Option=a.Wx,k.OptGroup=a.Xo,k._InternalPanelDoNotUseOrYouWillBeFired=C,t.default=k},8378:function(e,t){"use strict";t.Z=e=>({[e.componentCls]:{[`${e.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},\n opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},\n opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}})},31561:function(e,t,n){"use strict";n.d(t,{Z:function(){return _}});var i=n(33614),o=n(24018),a=n(54099),r=n(63011),l=n(35593),s=n(92310),c=n.n(s),u=n(25629),d=n(59301),f=n(20287),p=n(71783),h=f.Z.ESC,m=f.Z.TAB;var g=(0,d.forwardRef)((function(e,t){var n=e.overlay,i=e.arrow,o=e.prefixCls,a=(0,d.useMemo)((function(){return"function"==typeof n?n():n}),[n]),r=(0,u.sQ)(t,null==a?void 0:a.ref);return d.createElement(d.Fragment,null,i&&d.createElement("div",{className:"".concat(o,"-arrow")}),d.cloneElement(a,{ref:(0,u.Yr)(a)?r:void 0}))})),v={adjustX:1,adjustY:1},w=[0,0],b={topLeft:{points:["bl","tl"],overflow:v,offset:[0,-4],targetOffset:w},top:{points:["bc","tc"],overflow:v,offset:[0,-4],targetOffset:w},topRight:{points:["br","tr"],overflow:v,offset:[0,-4],targetOffset:w},bottomLeft:{points:["tl","bl"],overflow:v,offset:[0,4],targetOffset:w},bottom:{points:["tc","bc"],overflow:v,offset:[0,4],targetOffset:w},bottomRight:{points:["tr","br"],overflow:v,offset:[0,4],targetOffset:w}},x=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function y(e,t){var n,s=e.arrow,f=void 0!==s&&s,v=e.prefixCls,w=void 0===v?"rc-dropdown":v,y=e.transitionName,_=e.animation,S=e.align,k=e.placement,C=void 0===k?"bottomLeft":k,j=e.placements,B=void 0===j?b:j,T=e.getPopupContainer,A=e.showAction,N=e.hideAction,P=e.overlayClassName,E=e.overlayStyle,L=e.visible,M=e.trigger,G=void 0===M?["hover"]:M,O=e.autoFocus,Z=e.overlay,I=e.children,R=e.onVisibleChange,D=(0,r.Z)(e,x),F=d.useState(),H=(0,a.Z)(F,2),W=H[0],z=H[1],V="visible"in e?L:W,q=d.useRef(null),U=d.useRef(null),Y=d.useRef(null);d.useImperativeHandle(t,(function(){return q.current}));var J=function(e){z(e),null==R||R(e)};!function(e){var t=e.visible,n=e.triggerRef,i=e.onVisibleChange,o=e.autoFocus,a=e.overlayRef,r=d.useRef(!1),l=function(){var e,o;t&&(null===(e=n.current)||void 0===e||null===(o=e.focus)||void 0===o||o.call(e),null==i||i(!1))},s=function(){var e;return!(null===(e=a.current)||void 0===e||!e.focus||(a.current.focus(),r.current=!0,0))},c=function(e){switch(e.keyCode){case h:l();break;case m:var t=!1;r.current||(t=s()),t?e.preventDefault():l()}};d.useEffect((function(){return t?(window.addEventListener("keydown",c),o&&(0,p.Z)(s,3),function(){window.removeEventListener("keydown",c),r.current=!1}):function(){r.current=!1}}),[t])}({visible:V,triggerRef:Y,onVisibleChange:J,autoFocus:O,overlayRef:U});var K,X,Q,$=function(){return d.createElement(g,{ref:U,overlay:Z,prefixCls:w,arrow:f})},ee=d.cloneElement(I,{className:c()(null===(n=I.props)||void 0===n?void 0:n.className,V&&(K=e.openClassName,void 0!==K?K:"".concat(w,"-open"))),ref:(0,u.Yr)(I)?(0,u.sQ)(Y,I.ref):void 0}),te=N;return te||-1===G.indexOf("contextMenu")||(te=["click"]),d.createElement(l.Z,(0,i.Z)({builtinPlacements:B},D,{prefixCls:w,ref:q,popupClassName:c()(P,(0,o.Z)({},"".concat(w,"-show-arrow"),f)),popupStyle:E,action:G,showAction:A,hideAction:te,popupPlacement:C,popupAlign:S,popupTransitionName:y,popupAnimation:_,popupVisible:V,stretch:(X=e.minOverlayWidthMatchTrigger,Q=e.alignPoint,("minOverlayWidthMatchTrigger"in e?X:!Q)?"minWidth":""),popup:"function"==typeof Z?$:$(),onPopupVisibleChange:J,onPopupClick:function(t){var n=e.onOverlayClick;z(!1),n&&n(t)},getPopupContainer:T}),ee)}var _=d.forwardRef(y)}}]);