|
|
(self.webpackChunk=self.webpackChunk||[]).push([[20700],{7406:function(e,t,n){"use strict";var r=n(82242),i=n.n(r),s=(n(59301),n(93314)),o=n(3113),a=n(37712);t.Z=function(e){var t=e.img,n=e.buttonProps,r=void 0===n?{}:n,c=e.styles,l=void 0===c?{}:c,u=e.customText,d=e.ButtonText,p=e.ButtonClick,f=e.Buttonclass,m=e.ButtonTwo,h=e.imgStyles,v=e.loading,_=void 0!==v&&v;return(0,a.jsxs)("section",{className:"tc animated fadeIn",style:i()(i()({},{color:"#999",margin:"100px auto",visibility:_?"hidden":"visible"}),l),children:[(0,a.jsx)("img",{src:t||s,style:i()(i()({},h),{},{pointerEvents:"none",userSelect:"none"})}),(0,a.jsx)("p",{className:"mt20 font14",children:u||"暂时还没有相关数据哦!"}),d&&(0,a.jsx)(o.ZP,i()(i()({className:f,onClick:p},r),{},{children:d})),m&&m]})}},84143:function(e,t,n){"use strict";n.d(t,{Z:function(){return b}});var r=n(82242),i=n.n(r),s=n(7557),o=n.n(s),a=n(41498),c=n.n(a),l=n(79800),u=n.n(l),d=n(59301),p={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},f=n(3113),m=n(74516),h=n(94049),v=n(6848),_=n(6457),x=n(83),g=n(7406),y=n(27065),w=n(6288),j=n(37712),b=function(e){var t,n,r,s,a,l,b=e.editOffice,k=void 0===b?"view":b,S=e.data,E=(e.theme,e.type),N=e.filename,C=e.monacoEditor,L=e.className,I=e.style,P=e.close,T=e.onClose,Z=e.hasMask,M=e.disabledDownload,R=e.onImgDimensions,F=e.showNodata,O=e.recordInfo,A=(0,d.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),D=u()(A,2),H=(D[0],D[1],(0,d.useState)("")),W=u()(H,2),z=(W[0],W[1]),B=(0,d.useState)(),U=u()(B,2),G=U[0],V=U[1],X="build"===window.ENV?"/react/build":"",q=location.host.startsWith("localhost")?y.Z.PROXY_SERVER:y.Z.API_SERVER,J=(0,d.useRef)();null!==(t=S)&&void 0!==t&&t.startsWith("/api")&&"txt"!==E&&(S=y.Z.API_SERVER+S);N&&(C.filename=N),(0,d.useEffect)((function(){var e,t=null===(e=document.cookie)||void 0===e||null===(e=e.replace(/\s/g,""))||void 0===e?void 0:e.split(";");null==t||t.map((function(e){var t=e.split("=");"_educoder_session"===t[0]&&z(t[1])}))}),[]),(0,d.useEffect)((function(){var e;"office"===E&&(S.indexOf("bigfilescdn.")>-1||S.indexOf("bigfiles1")>-1?V({url:S,fileType:(e=S,e.substring(e.lastIndexOf("/")+1).split(".").pop()),model:S.indexOf("model=edit")?"edit":"view"}):Y())}),[E,S]);var Y=function(){var e=c()(o()().mark((function e(){var t,n,r;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("data:",S),t=S,S.startsWith("http")||(t=location.origin+t),n=new URL(t).pathname.split("/").pop(),e.next=6,(0,x.gJ)({attachment_id:n});case 6:(r=e.sent).url=q+r.url,V(r);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Q=function(){S.startsWith("http")||S.startsWith("blob:")?K():(0,_.Sv)(N||"educoder",S,N)},K=function(){O&&(0,w.fc)({id:null==O?void 0:O.id,watch_type:1,course_id:null==O?void 0:O.course_id}),(0,_.Nd)(N||"educoder",decodeURIComponent(S))};return(0,j.jsxs)("div",{style:i()({},I||{}),className:"".concat(Z&&p.bgBlack," ").concat(E?p.wrp:"hide"),children:[P&&(0,j.jsxs)("div",{className:p.close,ref:J,children:[!!R&&(0,j.jsx)(v.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return J.current},children:(0,j.jsx)("span",{onClick:function(){T(),R()},children:(0,j.jsx)("i",{className:"icon-yulanpizhu"})})}),!M&&(0,j.jsx)(v.Z,{title:"点击下载此文件",getPopupContainer:function(){return J.current},children:(0,j.jsx)("span",{onClick:K,children:(0,j.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,j.jsx)(v.Z,{title:"关闭",getPopupContainer:function(){return J.current},children:(0,j.jsx)("span",{className:"",onClick:T,children:(0,j.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,j.jsx)("div",{className:"".concat(p[L]," ").concat(L," ").concat(p.monaco," ").concat("txt"===E?"show":"hide"),children:"txt"===E&&(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(h.ZP,i()({},C))})}),"audio"===E&&(0,j.jsx)("audio",{src:"".concat((null===(n=S)||void 0===n?void 0:n.indexOf("http://"))>-1||(null===(r=S)||void 0===r?void 0:r.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(S),autoPlay:!0}),"video"===E&&(0,j.jsx)(j.Fragment,{children:(null===(s=S)||void 0===s?void 0:s.indexOf("http"))>-1?(0,j.jsx)("video",{controls:!0,src:"".concat(S),autoPlay:!0}):(0,j.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(S),autoPlay:!0})}),"office"===E&&G&&(0,j.jsx)("iframe",{src:"".concat(X,"/office.html?key=").concat(G.key,"&url=").concat(btoa(G.url),"&callbackUrl=").concat(q+G.callbackUrl,"&fileType=").concat(G.fileType,"&title=").concat(G.title,"&model=").concat(k,"&officeServer=").concat(y.Z.ONLYOFFICE,"&disabledDownload=").concat(!!M)}),"html"===E&&(0,j.jsx)("iframe",{src:S+"&disposition=inline"}),"pdf"===E&&(0,j.jsx)("iframe",{src:"".concat(X,"/js/pdfview/index.html?url=").concat(S,"&disabledDownload=").concat(!!M)}),"image"===E&&(0,j.jsx)("img",{src:"".concat((null===(a=S)||void 0===a?void 0:a.indexOf("http://"))>-1||(null===(l=S)||void 0===l?void 0:l.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(S)}),("other"===E||"download"===E)&&(0,j.jsx)(j.Fragment,{children:F?(0,j.jsx)(g.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,j.jsx)(f.ZP,{icon:(0,j.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Q,children:"下载"})}):(0,j.jsxs)(f.ZP,{type:"primary",size:"middle",onClick:Q,children:[(0,j.jsx)(m.Z,{}),"点击下载"]})})]})}},42783:function(e,t,n){"use strict";var r=n(82242),i=n.n(r),s=n(37205),o=n.n(s),a=n(91232),c=n.n(a),l=n(79800),u=n.n(l),d=n(59301),p=(n(98253),n(55369)),f=(n(64018),n(63824)),m=n(27065),h=n(15342),v=n(1012),_=n(84143),x=n(37712),g="@▁@",y=/<pre[^>]*>/g;t.Z=function(e){var t=e.value,n=void 0===t?"":t,r=e.className,s=e.showTextOnly,a=e.showLines,l=e.style,w=void 0===l?{}:l,j=e.stylesPrev,b=void 0===j?{}:j,k=e.highlightKeywords,S=e.showProgramFill,E=(e.isProgramFill,e.disabledFill),N=void 0!==E&&E,C=e.programFillValue,L=e.onFillChange,I=void 0===L?function(e){}:L,P=e.onFillBlur,T=void 0===P?function(){}:P,Z=String(n),M=(0,d.useState)(""),R=u()(M,2),F=R[0],O=R[1],A=(0,d.useState)("office"),D=u()(A,2),H=D[0],W=D[1],z=(0,d.useState)([]),B=u()(z,2),U=B[0],G=B[1],V=(0,d.useRef)("a"+(0,v.Z)()),X={},q=function(e){return e.replace(/<style.*?>([\s\S]+?)<\/style>/gim,(function(e,t){var n=t.replace(/(\n|\r)/g,"").split("}"),r=[];return n.map((function(e){""!=e&&r.push(".".concat(V.current," ").concat(e))})),"<style>".concat(r.join("}"),"</style>")}))},J=(0,d.useMemo)((function(){try{Z=Z.replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,"("+m.Z.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+m.Z.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+m.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,"\n")}catch(e){}if(S){var e=-1;return Z=Z.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,(function(t,n,r){var i;return function(e,t,n){var r=document.createElement(e===g?"input":"textarea");r.style.width="100%",r.style.height=e===g?"40px":"151px",r.rows=5,r.spellcheck=!1,r.name="edu-program-fill",r.placeholder="请输入",r.dataset.id=t;var i=Object.keys(X).length;return X[i]=r,'<span class="edu-program-fill-wrap '.concat(e===g?"":"show",'" style="width:').concat(e===g?"400px":"100%",'" title=').concat(n||"","><span>").concat(r.outerHTML,'<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>')}(t,++e,null==C||null===(i=C[e])||void 0===i?void 0:i.value)})),'<pre style="background:#fff;padding:4px">'.concat(q(Z||""),"</pre>")}var t=q(Z);t=(0,p.ZP)(t);var n=(0,p.ez)();Z.match(/\[TOC\]/)&&(t=t.replace("<p>[TOC]</p>",(0,p.Qv)()),(0,p.Iy)()),t=t.replace(/(__special_katext_id_\d+__)/g,(function(e,t){var r=n[t],i=r.type,s=r.expression;return(0,h.renderToString)(function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}(s)||"",{displayMode:"block"===i,throwOnError:!1,output:"html"})})),t=t.replace(/▁/g,"▁▁▁▁▁"),(0,p.AL)();var r=document.createElement("div");return r.innerHTML=t,k?(K(r,k.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),r.innerHTML):s?r.innerText:(setTimeout((function(){return te()}),500),r.innerHTML)}),[Z,k]);(0,d.useEffect)((function(){$.current&&$.current.querySelectorAll(["input","textarea"]).forEach((function(e){e.oninput=Y,e.onblur=Q}))}),[U]),(0,d.useEffect)((function(){if(null!=C&&C.length)try{var e,t=$.current.querySelectorAll(".edu-program-fill-score"),n=$.current.querySelectorAll('[name="edu-program-fill"]'),r=c()(n.entries());try{for(r.s();!(e=r.n()).done;){var i,s,o,a=u()(e.value,2),l=a[0],d=a[1];d.value=(null==C||null===(i=C[l])||void 0===i?void 0:i.value)||"","warning"===(null==C||null===(s=C[l])||void 0===s?void 0:s.type)?d.className="program-fill-warning":"success"===(null==C||null===(o=C[l])||void 0===o?void 0:o.type)?d.className="program-fill-success":d.className=""}}catch(e){r.e(e)}finally{r.f()}var p,f=c()(t.entries());try{for(f.s();!(p=f.n()).done;){var m,h,v=u()(p.value,2),_=v[0];v[1].innerHTML=null!=C&&null!==(m=C[_])&&void 0!==m&&m.score?"".concat(null==C||null===(h=C[_])||void 0===h?void 0:h.score,"分"):""}}catch(e){f.e(e)}finally{f.f()}G(C)}catch(e){console.log(e,"error")}}),[C]);var Y=function(e){U[e.target.dataset.id]=U[e.target.dataset.id]||{},U[e.target.dataset.id].value=e.target.value,G(o()(U)),I(U,e.target.dataset.id)},Q=function(e){U[e.target.dataset.id]=U[e.target.dataset.id]||{},U[e.target.dataset.id].value=e.target.value,G(o()(U)),T(U,e.target.dataset.id)};function K(e,t){return e.childNodes.forEach((function(e){if(e.childNodes.length>0)K(e,t);else if("IMG"!==e.nodeName)if(e.innerHTML){var n;e.innerHTML=null===(n=e.innerHTML)||void 0===n?void 0:n.replace(new RegExp(t,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>')}else{var r=document.createElement("span");r.innerHTML=e.textContent.replace(new RegExp(t,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),e.replaceWith(r)}}))}var $=(0,d.useRef)();function ee(e){var t=e.target;if("A"===t.tagName.toUpperCase()){var n=t.getAttribute("href");if(n.indexOf("office")>-1)e.preventDefault(),O(n),W("office");else if(n.indexOf("application/pdf")>-1)e.preventDefault(),O(n),W("pdf");else if(n.indexOf("text/html")>-1)e.preventDefault(),O(n),W("html");else if(n.startsWith("#")){e.preventDefault();var r=document.getElementById(n.replace("#",""));r&&r.scrollIntoView(!0)}}}p.jb.WebkitLineClamp=a,a&&(w=i()(i()({},w),p.jb));var te=function(){var e,t=null===(e=$.current)||void 0===e?void 0:e.querySelectorAll("video");null==t||t.forEach((function(e){if(e.oncontextmenu=function(){return!1},e.src.indexOf(".m3u8")>-1)if(e.canPlayType("application/vnd.apple.mpegurl"));else if(f.ZP.isSupported()){var t=new f.ZP;t.loadSource(e.src),t.attachMedia(e)}}))};return(0,d.useEffect)((function(){if($.current&&J&&J.match(y)&&window.PR.prettyPrint(),$.current)return $.current.addEventListener("click",ee),function(){var e;null===(e=$.current)||void 0===e||e.removeEventListener("click",ee),(0,p.AL)(),(0,p.Iy)()}}),[J,$.current,ee]),(0,x.jsxs)(x.Fragment,{children:[s&&(0,x.jsx)("div",{ref:$,children:J}),!s&&(0,x.jsx)("div",{ref:$,style:i()({},w),className:"".concat(r||""," ").concat(N?"disabled-fill":""," markdown-body ").concat(V.current),dangerouslySetInnerHTML:{__html:J}}),(0,x.jsx)(_.Z,{close:!0,data:F,type:null!=F&&F.length?H:"",style:i()({},b),onClose:function(){return O("")}})]})}},27308:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(82100),i=n.n(r),s=n(29186),o=n.n(s),a=n(80619),c=n.n(a),l=n(47074),u=n.n(l),d=n(59301),p=n(4676),f=function(e){c()(n,e);var t=u()(n);function n(e){var r;i()(this,n),r=t.call(this,e);var s=window.document;return r.node=s.createElement("div"),s.body.appendChild(r.node),r}return o()(n,[{key:"render",value:function(){var e=this.props.children;return(0,p.createPortal)(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),n}(d.Component)},47097:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Je}});var r=n(82242),i=n.n(r),s=n(31468),o=n.n(s),a=n(7557),c=n.n(a),l=n(41498),u=n.n(l),d=n(79800),p=n.n(d),f=n(39647),m=n.n(f),h=n(59301),v=n(7880),_=n(27065),x=n(31797),g=n(8591),y=n(43418),w=n(24905),j=n(71418),b=n(3113),k=n(43428),S=n(18285),E=n(84078),N={bg:"bg___yy2b4",header:"header___TfSCG",dragingMask:"dragingMask___i_1VX",content:"content___b8rIE",leftContainer:"leftContainer___BJcma",tabNav:"tabNav___uSNI4",mdContent:"mdContent___F9FMQ",resizeBar:"resizeBar___WbCV9","has-unity-3d":"has-unity-3d___BFusq","btn-resize":"btn-resize___Zfl7O",rightCotainer:"rightCotainer___iorUm",user:"user___I7MqL",titleWrap:"titleWrap___rJVb0",title:"title___jJ_Uz",endTimeWrap:"endTimeWrap___CSA6g",colorGray:"colorGray___oa4MJ",main:"main___LPfvU",loadFail:"loadFail___CrCok",reload:"reload___dIu1q",failIcon:"failIcon___g2eIS",failWrap:"failWrap___nbGWb",failReload:"failReload___nOEAI",dataSetButton:"dataSetButton___Oe8Wq",ac:"ac___XyH5r",dataSetText:"dataSetText___ltceD",dataSetOpen:"dataSetOpen___YeOkS",footer:"footer____7Qyw",start:"start___mqFxv",liWarp:"liWarp___MZgVd",li:"li___Pwqoe",disabled:"disabled___shXs_"},C=n(50153),L="drawerWrap___usUlu",I="drawer___o0tZt",P="title___N0L4E",T="disableTips___fbeqZ",Z=n(42783),M=n(56102),R=n(37712),F=function(){var e=(0,h.useState)(!1),t=p()(e,2),n=t[0],r=t[1],i=(0,h.useRef)(),s=(0,h.useRef)();return[n,function(){clearTimeout(i.current),i.current=window.setTimeout((function(){r(!0),clearTimeout(s.current),s.current=window.setTimeout((function(){r(!1)}),1500)}),500)}]},O=function(e){var t=e.visible,n=e.x,r=e.y;return(0,R.jsx)("div",{className:T,style:t?{top:r,left:n}:{display:"none"},children:"禁止复制参考答案"})},A=(0,v.connect)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t}}))((function(e){var t,n=e.visible,r=e.cancel,i=e.answerData,s=F(),o=p()(s,2),a=o[0],c=o[1],l=(0,h.useState)({x:0,y:0}),u=p()(l,2),d=u[0],f=u[1];return(0,R.jsx)(k.Z,{placement:"right",closable:!1,mask:!0,zIndex:998,onClose:r,width:600,open:2===n,rootClassName:L,children:(0,R.jsxs)("div",{className:I,children:[(0,R.jsxs)("h2",{className:P,style:{display:"flex",paddingRight:20,justifyContent:"space-between"},children:["参考答案 ",!(null!=i&&i.disable_copy)&&(0,R.jsx)(M.CopyToClipboard,{text:null==i||null===(t=i.standard_answer)||void 0===t?void 0:t.substring(3,(null==i?void 0:i.standard_answer.length)-3),onCopy:function(){return g.ZP.success("复制成功")},children:(0,R.jsx)("a",{style:{fontSize:16,fontWeight:400},children:"复制"})})]}),(0,R.jsx)("div",{className:"pl20 pr20",children:(0,R.jsxs)("div",{style:{userSelect:null!=i&&i.disable_copy?"none":"auto"},onMouseOver:function(e){f({x:e.clientX,y:e.clientY}),c()},children:[(null==i?void 0:i.disable_copy)&&(0,R.jsx)(O,{visible:a,x:d.x,y:d.y}),(0,R.jsx)(Z.Z,{value:null==i?void 0:i.standard_answer})]})})]})})})),D=n(57391),H=n(14834),W=n(1565),z={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},B=n(68475),U=function(e,t){return h.createElement(B.Z,(0,W.Z)({},e,{ref:t,icon:z}))};var G=h.forwardRef(U),V=n(26724),X=n.n(V),q="drawerWrap___dkOcq",J="drawer___ntUC2",Y="title___Z2x84",Q="closeBtn___V3pCn",K="titleIcon___mIUoJ",$="filePathWrap___ib1bc",ee="filePathContent___JrvtY",te="folderName___m5MVw",ne="copy___EPMue",re="listWrap___QzkC1",ie="item___msJ9l",se="itemText___u5GrX",oe=(0,v.connect)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t}}))((function(e){e.globalSetting,e.loading,e.dispatch;var t=e.visible,n=e.identifier,r=e.cancel,i=(0,h.useState)([]),s=p()(i,2),o=s[0],a=s[1],l=(0,h.useState)(),d=p()(l,2),f=(d[0],d[1]),m=(0,h.useState)(),v=p()(m,2),_=v[0],x=v[1],y=(0,h.useState)(),w=p()(y,2),j=w[0],b=w[1],S=(0,h.useState)({page:1,limit:20,identifier:null}),E=p()(S,2),N=E[0],L=E[1];(0,h.useEffect)((function(){n&&(N.identifier=n,L(N),I(N))}),[n]);var I=function(){var e=u()(c()().mark((function e(t){var n,r;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.a$)(t);case 2:(n=e.sent)&&(a(n.data_sets||[]),b(20===(null===(r=n.data_sets)||void 0===r?void 0:r.length)),f(n.data_sets_count),x(n.folder_name));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,R.jsx)(k.Z,{placement:"right",closable:!1,mask:!1,onClose:r,width:330,zIndex:998,open:1===t,rootClassName:q,children:(0,R.jsxs)("div",{className:J,children:[(0,R.jsxs)("h2",{className:Y,children:[(0,R.jsx)(H.Z,{className:Q,onClick:r}),(0,R.jsx)("i",{className:"iconfont icon-base ".concat(K)}),"数据集"]}),(0,R.jsxs)("div",{className:$,children:[(0,R.jsx)("span",{className:"ml50",children:"文件路径"}),(0,R.jsxs)("div",{className:ee,children:[(0,R.jsx)("span",{className:te,children:_}),(0,R.jsx)(M.CopyToClipboard,{text:_,onCopy:function(){return g.ZP.success("复制成功")},children:(0,R.jsx)("span",{className:"".concat(ne," current"),children:"复制地址"})})]})]}),(0,R.jsx)("div",{className:re,children:(0,R.jsx)(X(),{initialLoad:!1,pageStart:1,threshold:20,loadMore:function(e){return N.page=N.page+1,L(N),void I(N)},hasMore:j,useWindow:!1,children:o.map((function(e,t){return(0,R.jsxs)("div",{className:ie,children:[(0,R.jsxs)("span",{className:se,title:e.title,children:[(0,R.jsx)(G,{style:{color:"#28b887",fontSize:25}}),e.title]}),(0,R.jsx)(M.CopyToClipboard,{text:e.file_path,onCopy:function(){return g.ZP.success("复制成功")},children:(0,R.jsx)("span",{className:"".concat(ne," current"),children:"复制地址"})})]})}))})})]})})})),ae="wrap___SEtIN",ce="bg___JE5ml",le=function(e){var t=e.showModal,n=e.setShowModal;return(0,R.jsx)("div",{className:ae,style:{display:t?"flex":"none"},children:(0,R.jsx)("div",{className:ce,children:(0,R.jsx)("i",{onClick:function(){return n(!1)},className:"iconfont icon-roundclose"})})})},ue=n(79633),de=n(87134),pe=n(3446),fe=n(79818),me=n.n(fe),he="diff-panel-container___DRHwS",ve="diff-panel-container-2___T3Rde",_e=new(me());_e.Diff_EditCost=8;var xe={oldStr:"",newStr:""};function ge(e,t){if("init"===t.type)return i()(i()({},e),t.payload);throw new Error}function ye(e,t){var n=e[0],r=(e[1]||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),i=!r.trim();if("oldStr"===t)switch(n){case fe.DIFF_DELETE:return"<ins class=".concat(i?"empty":"",">")+r+"</ins>";case fe.DIFF_EQUAL:return"<span>"+r+"</span>"}else switch(n){case fe.DIFF_INSERT:return"<del class=".concat(i?"empty":"",">")+r+"</del>";case fe.DIFF_EQUAL:return"<span>"+r+"</span>"}}var we=function(e){var t,n,r=e.output,i=e.actual_output,s=(0,h.useReducer)(ge,xe),o=p()(s,2),a=o[0],c=o[1];return r=null===(t=r)||void 0===t?void 0:t.replace(/\n/g,"\r").replace(/\u0020/g," ").replace(/\u0000/g,"\\u0000"),i=null===(n=i)||void 0===n?void 0:n.replace(/\n/g,"\r").replace(/\u0020/g," ").replace(/\u0000/g,"\\u0000"),(0,h.useEffect)((function(){var e=_e.diff_main(r||"",i||"");_e.diff_cleanupEfficiency(e);var t=e.map((function(e){return ye(e,"oldStr")})).join(""),n=e.map((function(e){return ye(e,"newStr")})).join("");c({type:"init",payload:{oldStr:t,newStr:n}})}),[r,i]),(0,R.jsxs)("div",{className:he,children:[(0,R.jsx)("div",{dangerouslySetInnerHTML:{__html:a.oldStr}}),(0,R.jsx)("div",{dangerouslySetInnerHTML:{__html:a.newStr}})]})},je=n(6457),be={"choose-game-item":"choose-game-item___sJBZO","output-title-container":"output-title-container___HnzHt","output-title":"output-title___cQCt2","test-case-list":"test-case-list___ULWwO","test-header":"test-header___HMjcY",active:"active___YxidH","resize-y-bar":"resize-y-bar___es6Oh","test-result":"test-result___zXN_Y","markdown-body":"markdown-body___EHEjV",success:"success___ZvFU2",failer:"failer___lQvRe",count:"count___lVWvy","test-case-item":"test-case-item___ptoQn","case-header":"case-header___UDkvN",iconfont:"iconfont___XT_ll",description:"description___BJIlI","item-desc":"item-desc___e8tqN",show:"show___nh0Ha","item-tip":"item-tip___H05sn","arrow-down":"arrow-down___DcvbX","test-title":"test-title___2XlIU","arrow-right":"arrow-right___a5kiA","case-info":"case-info___akfl1","test-case-run-header":"test-case-run-header___rIpIu","test-case-run-wrp":"test-case-run-wrp___hfxtY",title:"title___ldXVu",warp:"warp_____VWp",spin:"spin___OU0Kn",spinTest:"spinTest___UNIX8","diff-panel-container":"diff-panel-container___xo1_S"},ke=new(me());ke.Diff_EditCost=8;var Se={oldStr:"",newStr:""};function Ee(e,t){if("init"===t.type)return i()(i()({},e),t.payload);throw new Error}function Ne(e,t){var n=e[0],r=(e[1]||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),i=!r.trim();if("oldStr"===t)switch(n){case fe.DIFF_DELETE:return"<ins class=".concat(i?"empty":"",">")+r+"</ins>";case fe.DIFF_EQUAL:return"<span>"+r+"</span>"}else switch(n){case fe.DIFF_INSERT:return"<del class=".concat(i?"empty":"",">")+r+"</del>";case fe.DIFF_EQUAL:return"<span>"+r+"</span>"}}var Ce=function(e){var t,n,r=e.output,i=e.actual_output,s=(0,h.useReducer)(Ee,Se),o=p()(s,2),a=o[0],c=o[1];return r=null===(t=r)||void 0===t?void 0:t.replace(/\n/g,"\r"),i=null===(n=i)||void 0===n?void 0:n.replace(/\n/g,"\r"),(0,h.useEffect)((function(){var e=ke.diff_main(r||"",i||"");ke.diff_cleanupEfficiency(e);var t=e.map((function(e){return Ne(e,"oldStr")})).join(""),n=e.map((function(e){return Ne(e,"newStr")})).join("");c({type:"init",payload:{oldStr:t,newStr:n}})}),[r,i]),(0,R.jsx)("div",{style:{width:"100%"},className:"c-white ".concat(he," ").concat(ve),children:(0,R.jsx)("div",{style:{minHeight:0,padding:"0px 12px"},dangerouslySetInnerHTML:{__html:a.oldStr}})})},Le=n(89918);function Ie(e){var t=e.ts_mem,n=e.ts_time,r=e.input,i=e.output,s=e.actual_output,o=e.is_file,a=e.output_file_url,c=e.result,l=e.compile_success,u=e.title,d=e.isActive,f=e.id,m=e.onActive,v=e.is_public,_=(e.test_sets_view,e.identity,e.is_invisible),x=e.actual_output_visible,y=e.user,w=(0,h.useState)(!1),j=p()(w,2),b=j[0],k=j[1];return _&&(null==y?void 0:y.identity_number)>5&&(i="该预期输出不可查看"),x&&(null==y?void 0:y.identity_number)>5&&(s="该实际输出不可查看"),(0,R.jsxs)("li",{className:be["test-case-item"],children:[(0,R.jsxs)("a",{className:be["case-header"],style:{borderWidth:d?1:0},onClick:function(){(0,Le.I2)([Le.GD.CertifiedTeacher,Le.GD.SuperAdmin,Le.GD.Operation])||v?m(f):g.ZP.info("本测试集不可解锁")},children:[(0,R.jsxs)("h2",{children:[(0,R.jsx)("div",{className:d?be["arrow-down"]:be["arrow-right"]}),(0,R.jsx)("span",{className:be["test-title"],children:u})]}),(0,R.jsxs)("div",{className:be["case-info"],children:[t?(0,R.jsxs)("span",{className:be.description,children:["消耗内存",t,"MB"]}):null,n?(0,R.jsxs)("span",{className:be.description,children:[" 代码执行时长:",n,"秒 "]}):null,v?null:(0,R.jsx)("i",{className:"iconfont icon-suo1"}),l>0?(0,R.jsx)("img",{width:16,src:c?ue.Z:de.Z}):null]})]}),(0,R.jsxs)("div",{className:"".concat(be["item-desc"]," ").concat(be["choose-game-item"]," ").concat(d?be.show:be.hide),children:[r&&(0,R.jsxs)("span",{style:{color:"white",display:"flex",alignItems:"center"},children:["测试输入",r&&(0,R.jsx)("div",{style:{width:"33%"},children:(0,R.jsx)(Ce,{output:r})})]}),(0,R.jsxs)("p",{className:be["output-title-container"],style:{marginTop:10},children:[(0,R.jsx)("span",{style:{color:"#747a7f"},children:"——预期输出——"}),(0,R.jsxs)("span",{className:be["output-title"],children:[(0,R.jsx)("span",{style:{color:"#fff"},children:"——实际输出——"}),!o&&(0,R.jsx)("span",{className:"c-blue current",onClick:function(){return k(!b)},children:b?"展示格式化输出":"展示原始输出"})]})]}),o&&(0,R.jsxs)("div",{className:be["diff-panel-container"],children:[(0,R.jsx)("div",{className:"tc",children:(0,R.jsx)("a",{className:"underline",onClick:function(){return(0,je.LR)(a,i)},children:i})}),(0,R.jsx)("div",{className:"tc",children:l?(0,R.jsx)("a",{className:"underline",onClick:function(){return(0,je.LR)(s,i)},children:i}):s})]}),!o&&!b&&(0,R.jsx)(we,{output:i,actual_output:s}),!o&&b&&(0,R.jsxs)("div",{className:be["diff-panel-container"],children:[(0,R.jsx)("div",{className:"",children:i}),(0,R.jsx)("div",{className:"",children:s})]})]})]})}var Pe=function(e){var t=e.test_sets,n=e.gamesData,r=e.loading,s=e.codeMessage,o=e.jupyterData,a=(0,h.useState)(-1),c=p()(a,2),l=c[0],u=c[1],d=(0,h.useRef)();function f(e){u(e===l?-1:e)}return(0,h.useEffect)((function(){if(d.current){var e=function(e){i=r.offsetHeight,s=!0,o=e.pageY,(0,je.kk)("none"),document.onselectstart=function(){return!1}},t=function(){s=!1,(0,je.kk)("auto"),document.onselectstart=null},n=function(e){if(s){var t=o-e.pageY,n=i+t;n<200&&(n=200),n>window.innerHeight-130&&(n=window.innerHeight-130),r.style.height=n+"px"}},r=document.getElementById("jupyter-test-case-list"),i=0,s=!1,o=0,a=document.getElementById("jupyter-y-bar");return null==a||a.addEventListener("mousedown",e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",t),function(){var r=document.getElementById("jupyter-y-bar");null==r||r.removeEventListener("mousedown",e),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",t)}}}),[d]),(0,R.jsxs)("ul",{id:"jupyter-test-case-list",className:be["test-case-list"],children:[(0,R.jsx)("div",{className:be["resize-y-bar"],id:"jupyter-y-bar",ref:d,draggable:!1,children:(0,R.jsx)("i",{className:"iconfont icon-guangbiao",draggable:!1})}),(0,R.jsx)("div",{className:be.warp,children:(0,R.jsxs)(j.Z,{tip:s,spinning:r,className:be.spinTest,children:[(0,R.jsx)("div",{className:be.title,style:{color:"white"},children:"测试结果:"}),null!=n&&n.last_compile_output?(0,R.jsxs)("p",{className:"".concat(be["test-result"]," ").concat(0===(null==n?void 0:n.sets_error_count)?be.success:be.failer),children:[(0,R.jsxs)("span",{className:be.count,children:[(0,R.jsx)("img",{width:16,src:0===(null==n?void 0:n.sets_error_count)?ue.Z:pe.Z}),(null==n?void 0:n.test_sets_count)-(null==n?void 0:n.sets_error_count),"/",null==n?void 0:n.test_sets_count]}),0==(null==n?void 0:n.sets_error_count)?(0,R.jsx)("span",{className:be.count,children:"全部通过"}):(0,R.jsx)("div",{dangerouslySetInnerHTML:{__html:null==n?void 0:n.last_compile_output}})]}):null,!r&&t.map((function(e,t){return(0,R.jsx)(Ie,i()(i()({title:"测试用例".concat(t+1)},e),{},{isActive:l===t,id:t,user:null==o?void 0:o.user,onActive:f}),"item"+t)}))]})})]})},Te=n(42195),Ze=n(21978),Me=n(52787),Re=function(e){var t=e.noDragging,n=e.moveX;return(0,R.jsx)(h.Fragment,{children:t?(0,R.jsx)("a",{className:"trapezoid ".concat(.01===n?"enlarge":""),children:(0,R.jsx)("img",{src:.01===n?Ze:Me,alt:"resize-icon",width:20})}):(0,R.jsx)("a",{className:"btn-resize",draggable:!1,children:(0,R.jsx)("svg",{width:"16",height:"13",viewBox:"0 0 16 13",children:(0,R.jsx)("path",{d:"M12.245 7.53H5.647v1.882h6.598v2.823L16 8.471l-3.755-3.765V7.53zM10.353 4.706H3.755v2.823L0 3.765 3.755 0v2.824h6.598v1.882z"})})})})},Fe=function(e,t){switch(t.type){case"MOVE_X":return i()(i()({},e),{},{moveX:t.payload});case"SET_DRAGMODULE":return i()(i()({},e),{},{showDragModule:t.payload});case"TRIGGER_RIGHT_PANEL_MASK":return i()(i()({},e),{},{showDragMask:t.payload})}},Oe=n(30929),Ae=n(51136),De=n(11397),He=n(27308),We=n(69352),ze=n(3883),Be=n(88289),Ue=n(83),Ge=["globalSetting","loading","dispatch","user"],Ve=x.Z.Countdown,Xe=function(e){return e[e.LoadFail=1]="LoadFail",e[e.ReLoad=2]="ReLoad",e[e.Success=3]="Success",e}(Xe||{}),qe={moveX:"40%",showDragModule:!1,showDragMask:!1},Je=(0,v.connect)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t,user:e.user}}))((function(e){e.globalSetting,e.loading;var t,n,r,s,a,l,d,f,x,L,I=e.dispatch,P=e.user,T=(m()(e,Ge),(0,v.useParams)()),M=(0,v.useSearchParams)(),F=p()(M,1)[0],O=((0,v.useLocation)(),(0,h.useRef)()),H=(0,h.useState)(!0),W=p()(H,2),z=W[0],B=W[1],U=(0,h.useState)(!1),G=p()(U,2),V=G[0],X=G[1],q=(0,h.useState)(0),J=p()(q,2),Y=J[0],Q=J[1],K=(0,h.useState)(0),$=p()(K,2),ee=$[0],te=$[1],ne=(0,h.useState)(!0),re=p()(ne,2),ie=re[0],se=re[1],ae=(0,h.useState)(!1),ce=p()(ae,2),ue=ce[0],de=ce[1],pe=(0,h.useRef)(!0),fe=(0,h.useState)({}),me=p()(fe,2),he=me[0],ve=me[1],_e=(0,h.useState)({}),xe=p()(_e,2),ge=xe[0],ye=xe[1],we=(0,h.useState)(),be=p()(we,2),ke=be[0],Se=be[1],Ee=(0,h.useRef)(),Ne=(0,h.useRef)(),Ce=(0,h.useState)(Xe.Success),Le=p()(Ce,2),Ie=Le[0],Ze=Le[1],Me=(0,h.useState)(),Je=p()(Me,2),Ye=Je[0],Qe=Je[1],Ke=(0,h.useState)(),$e=p()(Ke,2),et=$e[0],tt=$e[1],nt=(0,h.useState)(!1),rt=p()(nt,2),it=rt[0],st=rt[1],ot=(0,h.useState)(""),at=p()(ot,2),ct=at[0],lt=at[1],ut=(0,h.useRef)(null),dt=(0,h.useRef)({}),pt=(0,h.useRef)(!1),ft=(0,h.useRef)(),mt=(0,h.useReducer)(Fe,qe),ht=p()(mt,2),vt=ht[0],_t=ht[1],xt=(0,h.useState)(!1),gt=p()(xt,2),yt=gt[0],wt=gt[1],jt=(0,h.useState)(!0),bt=p()(jt,2),kt=bt[0],St=bt[1],Et=(0,h.useRef)(),Nt=(0,h.useRef)(!1),Ct=(0,h.useState)(!1),Lt=p()(Ct,2),It=Lt[0],Pt=Lt[1],Tt=(0,h.useState)(!1),Zt=p()(Tt,2),Mt=Zt[0],Rt=Zt[1];(0,h.useEffect)((function(){var e;0!==(null==P||null===(e=P.userInfo)||void 0===e?void 0:e.user_status)&&((new Date).getTime()>parseFloat(localStorage.getItem("task_ignore"))||0===parseFloat(localStorage.getItem("task_ignore")||0))?Rt(!0):Rt(!1)}),[localStorage.getItem("task_ignore"),null==P?void 0:P.userInfo]),(0,h.useEffect)((function(){return I({type:"globalSetting/headerFooterToggle",payload:!1}),F.get("exercisesId")&&"coursesId"!==F.get("coursesId")&&Ft(),function(){I({type:"globalSetting/headerFooterToggle",payload:!0})}}),[]),(0,h.useEffect)((function(){0!==Y?(clearInterval(ut.current),ut.current=setInterval((function(){Q(Y-1)}),1e3)):clearInterval(ut.current)}),[Y]),(0,h.useEffect)((function(){return window.addEventListener("message",Dt),function(){window.removeEventListener("message",Dt)}}),[]),(0,h.useEffect)((function(){zt()}),[T.identifier]),(0,h.useEffect)((function(){he.myshixun_identifier&&Bt(),he.tpm_modified&&Ot()}),[he]);var Ft=function(){var e=u()(c()().mark((function e(){var t;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ue._B)({categoryId:F.get("exercisesId"),login:F.get("login")});case 2:t=e.sent,Et.current=t;case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ot=function(){qt({title:"更新通知",content:(0,R.jsxs)("p",{children:["关卡任务的代码文件有更新啦~",(0,R.jsx)("br",{})," 更新操作将保留已完成的评测记录和成绩。",(0,R.jsx)("br",{}),"还未完成评测的任务代码,请自行保存!"]})})},At=function(){var e=u()(c()().mark((function e(){return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return document.getElementById("taskJupyterIframe").contentWindow.postMessage("saveCode","*"),e.next=4,(0,Ae.ZP)("/api/homework_commons/".concat(F.get("homework_common_id"),"/student_works.json"),{method:"post",body:{myshixun_identifier:null==he?void 0:he.myshixun_identifier}});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Dt=function(e){"jupytermessage"===(null==e?void 0:e.data)&&pe.current&&(pe.current=!1,Ht(),pt.current||setTimeout((function(){return pe.current=!0}),500))},Ht=function(){var e=u()(c()().mark((function e(){var t,n,r,s,a,l,u;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Nt.current=!1,e.t0=C.zE,e.t1=T.identifier,e.t2=Ne.current,e.t3=O.current,e.t4=null===(t=Ee.current)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.domain,e.t5=F.get("exercisesId"),e.t6=F.get("exercisesId"),!e.t6){e.next=12;break}return e.next=11,(0,De.y)({ip_limit:null===(n=Et.current)||void 0===n||null===(n=n.exercise)||void 0===n?void 0:n.ip_limit,ip_bind:null===(r=Et.current)||void 0===r||null===(r=r.exercise)||void 0===r?void 0:r.ip_bind,ip_bind_type:null===(s=Et.current)||void 0===s||null===(s=s.exercise)||void 0===s?void 0:s.ip_bind_type});case 11:e.t6=e.sent;case 12:return e.t7=e.t6,e.t8={identifier:e.t1,jupyter_port:e.t2,token:e.t3,jupyter_domain:e.t4,exercise_id:e.t5,ip:e.t7},e.next=16,(0,e.t0)(e.t8);case 16:if(0!==(a=e.sent).status){e.next=21;break}pt.current?Wt(null==a?void 0:a.data):g.ZP.success({content:"保存成功!",key:"save-jupyter"}),e.next=24;break;case 21:if(-5!==a.status||"object"!==o()(null==a?void 0:a.message)){e.next=24;break}return(0,v.getDvaApp)()._store.dispatch({type:"exercise/setActionTabs",payload:{key:"student-unlock",exerciseParams:i()(i()({},(null===(l=Et.current)||void 0===l?void 0:l.exercise)||{}),{},{errorMessage:null==a?void 0:a.message,exercise_user_id:null===(u=Et.current)||void 0===u||null===(u=u.exercise)||void 0===u?void 0:u.exercise_user_id,id:F.get("exercisesId")})}}),e.abrupt("return");case 24:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Wt=function(){var e=u()(c()().mark((function e(t){var n,r,s,o,a,l,d,p,f,m;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=F.get("exercisesId"),e.t1=F.get("questionId"),e.t2=null==he?void 0:he.challenge_id,e.t3=F.get("exercisesId"),!e.t3){e.next=8;break}return e.next=7,(0,De.y)({ip_limit:null===(n=Et.current)||void 0===n||null===(n=n.exercise)||void 0===n?void 0:n.ip_limit,ip_bind:null===(r=Et.current)||void 0===r||null===(r=r.exercise)||void 0===r?void 0:r.ip_bind,ip_bind_type:null===(s=Et.current)||void 0===s||null===(s=s.exercise)||void 0===s?void 0:s.ip_bind_type});case 7:e.t3=e.sent;case 8:return e.t4=e.t3,e.t5={exercise_id:e.t0,question_id:e.t1,challenge_id:e.t2,ip:e.t4},e.t6=null==t?void 0:t.sec_key,e.t7=null==t?void 0:t.resubmit,l={extras:e.t5,sec_key:e.t6,resubmit:e.t7,first:1,content_modified:0},F.get("homework_common_id")&&(l.extras={homework_common_id:F.get("homework_common_id")}),e.next=16,(0,D.Xy)(null===(o=dt.current)||void 0===o?void 0:o.game_identifier,l);case 16:if(-1!==e.sent.status){e.next=26;break}if("exercises"!==F.get("type")){e.next=21;break}return window.parent.location.href="/classrooms/".concat(F.get("coursesId"),"/exercise/").concat(F.get("exercisesId"),"/detail"),e.abrupt("return");case 21:return X(!1),Q(10),pt.current=!1,pe.current=!0,e.abrupt("return");case 26:d=1,p=!1,f=(null===(a=dt.current)||void 0===a?void 0:a.exec_time)+11,m=function(){var e=u()(c()().mark((function e(){var n,r,s,o;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,D.Qo)(null===(n=dt.current)||void 0===n?void 0:n.game_identifier,{resubmit:null==t?void 0:t.resubmit,time_out:p,port:null===(r=dt.current)||void 0===r?void 0:r.port,sec_key:null==t?void 0:t.sec_key,challenge_id:null===(s=dt.current)||void 0===s?void 0:s.challenge_id});case 2:null===(null==(o=e.sent)?void 0:o.running_code_status)||1===(null==o?void 0:o.running_code_status)||2===(null==o?void 0:o.running_code_status)?((d+=1)>f&&(p=!0),p&&g.ZP.info("本次评测超时"),1!==(null==o?void 0:o.running_code_status)&&2!==(null==o?void 0:o.running_code_status)||lt(null==o?void 0:o.running_code_message),setTimeout((function(){m()}),1e3)):(2===o.status&&Pt(!0),ye(i()({},o)),de(!0),X(!1),lt(""),Q(10),pt.current=!1,pe.current=!0);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),m();case 31:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),zt=function(){var e=u()(c()().mark((function e(){var t;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.dU)({identifier:T.identifier,homework_id:F.get("homework_common_id")});case 2:(t=e.sent)&&(ve(t),dt.current=i()({},t),ye(i()(i()({},ge),{},{test_sets:(null==t?void 0:t.test_sets)||[]})),_t({type:"SET_DRAGMODULE",payload:t.jupyter_show_description}));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Bt=function(){var e=u()(c()().mark((function e(){var t,n,r,s,o,a,l,u,d,p,f,m;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={},"exercises"===F.get("type")?n.exercise_id=F.get("exercisesId"):T.courseId&&T.homeworkId&&(n.homework_common_id=F.get("homework_common_id")),e.next=4,(0,C.rV)(i()({identifier:T.identifier,homework_common_id:F.get("homework_common_id")||""},n));case 4:if(r=e.sent,B(!1),null==r||null===(t=r.data)||void 0===t||null===(t=t.data_list)||void 0===t||!t.length){e.next=9;break}return Oe.Z.publish("pod-restrict-data",{identifier:null==r||null===(s=r.data)||void 0===s?void 0:s.identifier,data_list:null==r||null===(o=r.data)||void 0===o?void 0:o.data_list}),e.abrupt("return");case 9:if(null==r||!r.data){e.next=21;break}if(Se(r.data),Ee.current=r.data,O.current=null===(a=(0,je.en)(null==r||null===(l=r.data)||void 0===l||null===(l=l[0])||void 0===l?void 0:l.link_url))||void 0===a?void 0:a.token,Ne.current=null==r||null===(u=r.data)||void 0===u||null===(u=u[0])||void 0===u?void 0:u.port,!((null===(d=r.data)||void 0===d?void 0:d.length)>1)){e.next=16;break}return e.abrupt("return");case 16:return se(!1),Ze(Xe.Success),Qe(Date.now()+(null==r||null===(p=r.data)||void 0===p||null===(p=p[0])||void 0===p?void 0:p.remaining_time)),tt((null==r||null===(f=r.data)||void 0===f||null===(f=f[0])||void 0===f?void 0:f.remaining_time)-3e5<=0?Date.now()+1e3:Date.now()+((null==r||null===(m=r.data)||void 0===m||null===(m=m[0])||void 0===m?void 0:m.remaining_time)-3e5)),e.abrupt("return");case 21:-1===r.status?(Ze(Xe.LoadFail),se(!1)):Ze(Xe.ReLoad);case 22:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ut=function(){Xt(!0),B(!0),y.Z.confirm({centered:!0,title:"重置环境",content:" 是否确定重置环境?",okText:"确定",cancelText:"取消",onOk:function(){Gt()},onCancel:function(){Xt(!1),B(!1)}})},Gt=function(){var e=u()(c()().mark((function e(){var t;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.m_)({identifier:null==he?void 0:he.myshixun_identifier});case 2:if(0===(null==(t=e.sent)?void 0:t.status)){e.next=5;break}return e.abrupt("return");case 5:g.ZP.success("重置成功!"),B(!1),setTimeout((function(){return window.location.reload()}),300);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Vt=function(){y.Z.destroyAll(),y.Z.confirm({centered:!0,title:"倒计时截止",content:(0,R.jsx)("p",{className:"tc font14",children:"服务已中断,是否确认重置实验环境?"}),okText:"确定",cancelText:"取消",onOk:function(){Gt()}})},Xt=function(e){var t=document.getElementById("taskJupyterIframe");t&&(e?t.contentWindow.postMessage("stopParent","*"):t.contentWindow.postMessage("clonsParent","*"))},qt=function(e){var t;y.Z.confirm({centered:!0,title:e.title,content:e.content,okText:"确定",cancelText:"取消",onOk:(t=u()(c()().mark((function e(){var t;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={},"exercises"===F.get("type")?t.exercise_id=F.get("exercisesId"):F.get("homework_common_id")&&(t.homework_common_id=F.get("homework_common_id")),e.next=4,(0,C.fi)(i()({identifier:T.identifier},t));case 4:if(0===e.sent.status){e.next=7;break}return e.abrupt("return");case 7:g.ZP.success("操作成功"),B(!1),setTimeout((function(){return window.location.reload()}),300);case 10:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)}),onCancel:function(){Xt(!1),B(!1)}})};(0,h.useEffect)((function(){function e(e){_t({type:"MOVE_X",payload:e.pageX})}function t(){_t({type:"TRIGGER_RIGHT_PANEL_MASK",payload:!1}),document.onselectstart=null}return vt.showDragMask&&(document.addEventListener("mousemove",e),document.addEventListener("mouseup",t)),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}}),[vt.showDragMask]);var Jt="number"==typeof vt.moveX&&.01!==vt.moveX?"".concat(vt.moveX,"px"):"40%",Yt="calc(100% - 4px - ".concat(Jt,")"),Qt=function(e){_t({type:"TRIGGER_RIGHT_PANEL_MASK",payload:e})},Kt=(0,h.useState)(),$t=p()(Kt,2),en=$t[0],tn=$t[1],nn=function(){var e=u()(c()().mark((function e(t){var n;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ae.ZP)("/api/shixuns/".concat(t,"/get_standard_answer.json"),{method:"get",params:{from:"starting"}});case 2:0===(n=e.sent).status&&tn(n);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function rn(){wt(!1)}(0,h.useEffect)((function(){he.identifier&&nn(he.identifier)}),[he]);var sn=function(e){(0,ze.vp)()?St(!1):St(!0)};function on(){return an.apply(this,arguments)}function an(){return(an=u()(c()().mark((function e(){var t,n;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={},"exercises"===F.get("type")?t.exercise_id=F.get("exercisesId"):F.get("homework_common_id")&&(t.homework_common_id=F.get("homework_common_id")),e.next=4,(0,D.Tf)(null==he?void 0:he.myshixun_identifier,i()({},t));case 4:if(-5!==(null==(n=e.sent)?void 0:n.status)){e.next=8;break}return y.Z.info({title:"提示",maskClosable:!0,icon:null,width:700,centered:!0,content:(0,R.jsxs)("div",{children:["该实践项目已在教学课堂考试(",(0,R.jsx)("a",{href:"/classrooms/".concat(null==n?void 0:n.course_identifier,"/exercise/").concat(null==n?void 0:n.exercise_id,"/detail"),children:null==n?void 0:n.exercise_name}),")中被使用,用户试卷已交卷,禁止再作答!"]})}),e.abrupt("return");case 8:return e.abrupt("return",n);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,h.useEffect)((function(){return document.addEventListener((0,ze.gH)(),sn),ft.current=setInterval((function(){var e;e=new Event("beforeunload"),window.dispatchEvent(e)}),2e3),function(){clearInterval(ft.current),document.removeEventListener((0,ze.gH)(),sn)}}),[]);var cn=function(){y.Z.confirm({title:"重置代码仓库",icon:(0,R.jsx)(Be.Z,{}),content:"您的所有代码将被还原至初始状态,不影响通关状态与作业成绩。确认重置?",centered:!0,okText:"确定",cancelText:"取消",onOk:on})},ln={is_jupyter:!0,is_jupyter_notebook:!0===(null==he?void 0:he.is_jupyter),is_jupyter_lab:!1===(null==he?void 0:he.is_jupyter),jupyterData:he,onVncAction:function(e){var t,n;rn(),"reset-task"===e&&Ut(),"reset-git-code"===e&&cn(),"reset-code"===e&&(B(!0),Xt(!0),qt({title:"恢复初始代码",content:(0,R.jsxs)("div",{className:"tc font14",children:["你在本文件中修改的内容将丢失,",(0,R.jsx)("br",{}),"是否确定重新加载初始代码?"]})})),"full-screen"===e&&((0,ze.vp)()?(0,ze.BU)():(0,ze.Dj)(null===(t=document)||void 0===t||null===(n=t.getElementById)||void 0===n?void 0:n.call(t,"juptyer")))},onHideToolBar:rn,port:null==ke||null===(t=ke[0])||void 0===t?void 0:t.port,token:O.current},un=(null==P||null===(n=P.userInfo)||void 0===n?void 0:n.user_id)===(null==he||null===(r=he.user)||void 0===r?void 0:r.user_id);console.log(un,null==P||null===(s=P.userInfo)||void 0===s?void 0:s.user_id,null==he||null===(a=he.user)||void 0===a?void 0:a.user_id,333);var dn=function(){I({type:"user/getUserInfo",payload:{objective_id:he.identifier,objective_type:"shixun"}}),"exercises"===F.get("type")&&"IFRAME"!==document.activeElement.tagName&&window.parent.postMessage("backExercise","*"),v.history.push("/shixuns/".concat(he.identifier,"/challenges"))};return(0,R.jsxs)(j.Z,{spinning:z,tip:"加载中...",children:[(0,R.jsxs)("section",{id:"juptyer",className:N.bg,style:{userSelect:vt.showDragMask?"none":"unset"},children:[vt.showDragMask&&(0,R.jsx)("div",{className:N.dragingMask}),Mt&&(0,R.jsxs)("div",{style:{minHeight:40,height:40,background:"#FCD8D8",color:"#E30000",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0px 30px"},children:[(0,R.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,R.jsx)("i",{className:"iconfont icon-tishi9 font14 ml10 mr10",style:{color:"#E30000"}}),(0,R.jsx)("div",{children:null===(l=P.userInfo)||void 0===l?void 0:l.user_message})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)("span",{style:{cursor:"pointer",color:"#666666"},onClick:function(){var e=86399999+new Date((new Date).toLocaleDateString()).getTime();localStorage.setItem("task_ignore",e),Rt(!1)},children:"忽略"}),(0,R.jsx)("span",{style:{cursor:"pointer",marginLeft:20,color:"#165DFF"},onClick:u()(c()().mark((function e(){var t;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ae.ZP)("/api/business_contacts.json",{method:"post"});case 2:0===(null==(t=e.sent)?void 0:t.status)&&g.ZP.info("申请成功");case 4:case"end":return e.stop()}}),e)}))),children:"申请延期"})]})]}),(0,R.jsxs)("header",{className:N.header,children:[(0,R.jsxs)("div",{className:N.user,children:[(0,R.jsx)("img",{src:"".concat(_.Z.IMG_SERVER,"/images/").concat(null==he||null===(d=he.user)||void 0===d?void 0:d.image_url),alt:"用户头像"}),(0,R.jsx)("span",{className:"ml10",children:null==he||null===(f=he.user)||void 0===f?void 0:f.name})]}),(0,R.jsxs)("div",{className:N.titleWrap,children:[(0,R.jsx)("span",{className:N.title,children:null==he?void 0:he.name}),(0,R.jsxs)("span",{children:[(0,R.jsx)(Ve,{value:Ye,format:"HH:mm:ss",onFinish:Vt}),(0,R.jsx)("span",{className:N.endTimeWrap,children:et&&(0,R.jsx)(Ve,{value:et,format:"HH:mm:ss",onFinish:function(){var e;y.Z.destroyAll(),y.Z.confirm({centered:!0,title:"服务中断提醒",content:(0,R.jsxs)("div",{className:"tc font14",children:["jupyter将于",(0,R.jsx)("span",{children:(0,R.jsx)(Ve,{value:Ye,format:"HH:mm:ss",onFinish:Vt})}),"时间后服务中断,是否需要延长使用时间?"]}),okText:"立即延长",cancelText:"不需要",onOk:(e=u()(c()().mark((function e(){return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.rB)(null==he?void 0:he.myshixun_identifier);case 2:if(0!==e.sent.status){e.next=7;break}return e.next=6,Bt();case 6:g.ZP.success("延长成功!");case 7:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})}})})]})]}),(0,R.jsxs)("div",{className:N.actionWrap,children:[he.tpm_modified&&kt&&(0,R.jsx)("img",{src:Te.GY,onClick:Ot,style:{position:"relative",top:-1,marginRight:8,cursor:"pointer"}}),kt&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("img",{alt:"tool",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAABZ0lEQVRYR+2YrU7FQBBGzzwEPAMSi+M6MARDggNJgiIkWLiSBIFCkyCuQECCQFIcEstb8AYf2ZvmhpbuT9ttUpJWdma+OZ3O7k5rRC5Jh8ARsBPzjdhvgXczew75WSyJpCdgP+aXaP8ws63OQJK2gbdSYJ6Y1Od2WRpmZlb4nIIVqgEFhUKwbXTGByRpDzgBdnu+kr7hD8CLSboGLvqqZYp/dEDK1LR9mZZNXwEys6u+ql3iJbm8E5C3eFOFYn2VrUKS1oADYL1M+gW8mtl3DOK3PQuQpE1gAWzUkn8CZ6Hzqg6bC+gcuPFU4s7MTlOrlAvITQFuGijMbOaSS/pzLwXKB+QdCQKiXqAUkJqP06rs1B00liFNFeqqVQEaXYXmbc6ypn7J3UNtgUa3ysa1D5XLfDw7dedl1BCYZWOcgHJWIKb1f15Z7EkGtq+G/NXEP3DCFPl79xnkTln3u+U4JWJAH/czo/gBVkc5pun3NGoAAAAASUVORK5CYII=",width:14,style:{opacity:"0.45",margin:"0 -5px 2px 15px"}}),(0,R.jsx)(b.ZP,{className:"".concat(N.colorGray," font14"),type:"link",onClick:function(){wt(!yt)},children:"工具栏"})]}),(0,R.jsx)(b.ZP,{icon:(0,R.jsx)(E.Z,{}),className:"".concat(N.colorGray," font14"),type:"link",onClick:function(){var e;console.log(un,777);var t=!(null!=P&&null!==(e=P.userInfo)&&void 0!==e&&null!==(e=e.shixun)&&void 0!==e&&e.editable);y.Z.confirm({title:"退出实训",icon:(0,R.jsx)(Be.Z,{}),content:(0,R.jsxs)("div",{children:[(0,R.jsx)("div",{children:"您确定要退出实训吗?"}),un&&(0,R.jsx)(w.Z,{className:"mt10",defaultChecked:t,onChange:function(e){t=e.target.checked},children:"退出实训时,立即释放实验资源"})]}),centered:!0,okText:"确定",cancelText:"取消",onOk:function(){un&&t?(0,Ue.eA)(null==he?void 0:he.myshixun_identifier).then((function(e){0==(null==e?void 0:e.status)&&(g.ZP.success("释放资源成功"),setTimeout((function(){dn()}),1e3))})):dn()},onCancel:function(){}})},children:"退出"})]})]}),(0,R.jsxs)("section",{className:N.content,style:{height:null!=he&&he.open_evaluate?"calc(100vh - 130px)":"calc(100vh - 60px)"},children:[vt.showDragModule&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("section",{className:N.leftContainer,style:{width:Jt,display:.01===vt.moveX?"none":""},children:[(0,R.jsx)("div",{className:N.tabNav,children:(0,R.jsx)("div",{children:"任务要求"})}),(0,R.jsx)("div",{className:N.mdContent,children:(0,R.jsx)(Z.Z,{stylesPrev:{position:"absolute"},value:he.description||""})})]}),(0,R.jsx)("section",{className:N.resizeBar,onMouseDown:function(){Qt(!0)},onMouseUp:function(){return Qt(!1)},children:(0,R.jsx)(Re,{noDragging:!1,moveX:vt.moveX})})]}),(0,R.jsx)("section",{className:N.rightCotainer,style:{width:Yt},children:(0,R.jsx)("main",{className:N.main,style:{height:"100%"},children:ie?(0,R.jsxs)("div",{className:N.start,style:{visibility:z?"hidden":"visible"},children:[(0,R.jsx)("div",{className:N.title,children:"请点击一个文件进入实验环境,开始实验!"}),(0,R.jsx)("b",{className:"iconfont icon-dianji1"}),(0,R.jsx)("div",{className:N.liWarp,children:null==ke?void 0:ke.map((function(e,t){return(0,R.jsxs)("div",{onClick:function(){return e=t,se(!1),te(e),Bt(),void Ze(Xe.Success);var e},className:N.li,children:[(0,R.jsx)("i",{className:"iconfont icon-wenjian6"}),(0,R.jsx)("span",{title:e.name,children:e.name})]})}))})]}):(0,R.jsxs)(h.Fragment,{children:[kt&&(0,R.jsx)("div",{style:{right:1===it?330:2===it&&600},className:"".concat(N.dataSetButton," ").concat(it?"".concat(N.dataSetOpen," ").concat(1===it?N.ac:""):""),onClick:function(e){st(!it&&1),rn(),e.nativeEvent.stopPropagation()},children:(0,R.jsx)("span",{className:N.dataSetText,children:"数据集"})}),!(null!=en&&en.hide_answer)&&(0,R.jsx)("div",{style:{top:"53%",right:2===it&&600},className:"".concat(N.dataSetButton," ").concat(it?"".concat(N.dataSetOpen," ").concat(2===it?N.ac:""):""),onClick:function(e){st(2),e.nativeEvent.stopPropagation()},children:(0,R.jsx)("span",{className:N.dataSetText,children:"参考答案"})}),Ie===Xe.LoadFail&&(0,R.jsx)("div",{className:N.loadFail,children:" "}),Ie===Xe.ReLoad&&(0,R.jsx)("div",{className:N.reload,children:(0,R.jsxs)("div",{className:N.failWrap,children:[(0,R.jsx)("i",{className:"iconfont icon-jiazaishibai1 ".concat(N.failIcon)}),(0,R.jsxs)("p",{className:"font12",children:["加载实训失败,",(0,R.jsx)("span",{className:N.failReload,onClick:Bt,children:"重新加载"})]})]})}),Ie===Xe.Success&&(0,R.jsx)("iframe",{frameBorder:0,id:"taskJupyterIframe",width:"100%",height:"100%",allow:"geolocation; microphone; camera; midi; encrypted-media;",src:null==ke||null===(x=ke[ee])||void 0===x?void 0:x.link_url}),(0,R.jsx)(oe,{visible:it,identifier:he.identifier,cancel:function(){st(!1)}}),(0,R.jsx)(A,{visible:it,answerData:en,cancel:function(){return st(!1)}})]})})})]}),null!=he&&he.open_evaluate?(0,R.jsx)(R.Fragment,{children:(0,R.jsxs)("div",{className:N.footer,style:{background:"#111c24"},children:[(0,R.jsxs)("span",{children:[null!=ge&&ge.time_limit?(0,R.jsx)("span",{children:"本关最大执行时间:".concat(null==ge?void 0:ge.time_limit,"秒")}):null,null!=ge&&ge.record_consume_time?(0,R.jsxs)("span",{className:"ml10",children:["本次评测耗时(编译、运行总时间):",null==ge?void 0:ge.record_consume_time," 秒"]}):null]}),(0,R.jsx)(b.ZP,{onClick:function(){return de(!ue)},type:"primary",ghost:!0,className:"mr20",children:ue?"隐藏测试结果":"查看测试结果"}),(0,R.jsx)(b.ZP,{className:N.disabled,disabled:0!==Y||2===(null==P||null===(L=P.userInfo)||void 0===L?void 0:L.user_status),loading:V,onClick:function(){Nt.current=!0;var e=document.getElementById("taskJupyterIframe");e&&(e.contentWindow.postMessage("saveCode","*"),pt.current=!0,X(!0),de(!0),setTimeout((function(){Nt.current&&Ht()}),5e3))},style:{padding:"0 30px"},type:"primary",children:0!==Y?"".concat(Y,"s"):"评测"})]})}):(0,R.jsx)(R.Fragment,{children:F.get("homework_common_id")&&!(null!=he&&he.homework_is_end)&&(0,R.jsx)("div",{className:N.footer,style:{background:"#111c24"},children:(0,R.jsx)(b.ZP,{onClick:function(){return At()},type:"primary",className:"mr20",children:"提交作品"})})}),ue&&(0,R.jsx)(Pe,{codeMessage:ct,loading:V,gamesData:ge,test_sets:(null==ge?void 0:ge.test_sets)||[],jupyterData:he})]}),(0,R.jsx)(He.Z,{children:(0,R.jsx)(k.Z,{width:280,rootClassName:"setting-drawer",title:null,placement:"right",closable:!1,open:yt,onClose:rn,children:(0,R.jsx)(We.Z,i()({},ln))})}),(0,R.jsx)(S.Z,{successCb:Ht}),(0,R.jsx)(le,{showModal:It,setShowModal:Pt})]})}))},50153:function(e,t,n){"use strict";n.d(t,{Jd:function(){return E},a$:function(){return k},dU:function(){return p},fi:function(){return j},m_:function(){return x},rB:function(){return y},rV:function(){return m},x4:function(){return v},zE:function(){return u}});var r=n(82242),i=n.n(r),s=n(7557),o=n.n(s),a=n(41498),c=n.n(a),l=n(51136);function u(e){return d.apply(this,arguments)}function d(){return(d=c()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.ZP)("/api/jupyters/save_with_tpi.json",{method:"Get",params:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e){return f.apply(this,arguments)}function f(){return(f=c()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.ZP)("/api/tasks/".concat(t.identifier,"/jupyter.json"),{method:"Get",params:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function m(e){return h.apply(this,arguments)}function h(){return(h=c()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.ZP)("/api/myshixuns/".concat(t.identifier,"/start.json"),{method:"Get",params:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e){return _.apply(this,arguments)}function _(){return(_=c()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.ZP)("/api/jupyters/timeinfo_with_tpi.json",{method:"Get",params:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function x(e){return g.apply(this,arguments)}function g(){return(g=c()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.ZP)("/api/myshixuns/".concat(t.identifier,"/reset_pod.json"),{method:"Get",params:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(e,t){return w.apply(this,arguments)}function w(){return(w=c()(o()().mark((function e(t,n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.ZP)("/api/myshixuns/".concat(t,"/active_pod.json"),{method:"Get",params:n}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function j(e){return b.apply(this,arguments)}function b(){return(b=c()(o()().mark((function e(t){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return delete(n=i()({},t)).identifier,e.abrupt("return",(0,l.ZP)("/api/myshixuns/".concat(t.identifier,"/sync_code.json"),{method:"Post",body:n}));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(e){return S.apply(this,arguments)}function S(){return(S=c()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.ZP)("/api/shixuns/".concat(t.identifier,"/get_data_sets.json"),{method:"Get",params:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(e){return N.apply(this,arguments)}function N(){return(N=c()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.ZP)("/api/tasks/".concat(t.identifier,"/reboot_esc.json"),{method:"post",body:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},3883:function(e,t,n){"use strict";function r(e){try{e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen()}catch(e){console.log(e,":e")}}function i(){window.top.document.webkitExitFullscreen?window.top.document.webkitExitFullscreen():document.exitFullscreen?window.top.document.exitFullscreen():document.msExitFullscreen?window.top.document.msExitFullscreen():document.mozCancelFullScreen&&window.top.document.mozCancelFullScreen()}n.d(t,{BU:function(){return i},Dj:function(){return r},gH:function(){return s},vp:function(){return o}});var s=function(){return document.webkitExitFullscreen?"webkitfullscreenchange":document.exitFullscreen?"fullscreenchange":document.msExitFullscreen?"msfullscreenchange":document.mozCancelFullScreen?"mozfullscreenchange":void 0};function o(){var e=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement;document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",e),null!=e}},55369:function(e,t,n){"use strict";n.d(t,{AL:function(){return j},Iy:function(){return p},Qv:function(){return h},ez:function(){return w},jb:function(){return f}});var r=n(79800),i=n.n(r),s=n(32834),o=n.n(s),a=n(11690);var c=[],l=["<ul>"],u=new(o().Renderer),d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function p(){c.length=0,l=["<ul>"]}var f={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(e,t,n,r){if(t>=e.length||e[t].level<=n)return t;var i=e[t];r.push("<li><a href='#"+i.anchor+"'>"+i.text+"</a>");var s=[];return t=m(e,++t,i.level,s),s.length>0&&(r.push("<ul>"),s.forEach((function(e){r.push(e)})),r.push("</ul>")),r.push("</li>"),t=m(e,t,n,r)}function h(){return m(c,0,0,l),l.push("</ul>"),l.join("")}var v={heading:function(e){var t=d.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},fences:function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],r=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var r=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:i()(t,1)[0].length>=r.length?e.slice(r.length):e})).join("\n")}(n,t[3]||""),s=t[2]?t[2].trim():t[2];if(["latex","katex","math"].indexOf(s)>=0){var o=g(),a=r;r=o,y[o]={type:"block",expression:a}}return{type:"code",raw:n,lang:s,text:r}}}},_=/(?:\${2})([^\n`]+?)(?:\${2})/gi,x=0,g=function(){return"__special_katext_id_".concat(x++,"__")},y={};function w(){return y}function j(){x=0,y={}}function b(e){return e=e.replace(_,(function(e,t){var n=g();return y[n]={type:"inline",expression:t},n}))}var k=u.listitem;u.listitem=function(e){return k(b(e))};var S=u.paragraph;u.paragraph=function(e){return S(b(e))};var E=u.tablecell;u.tablecell=function(e,t){return E(b(e),t)},u.code=function(e,t,n){var r=(t||"").match(/\S*/)[0];return r?["latex","katex","math"].indexOf(r)>=0?"<p class='editormd-tex'>".concat(e,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(t,'">').concat(n?e:(0,a.escape)(e,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(n?e:(0,a.escape)(e,!0))+"</code></pre>"},u.heading=function(e,t,n){var r=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return c.push({anchor:r,level:t,text:e}),"<h"+t+' id="'+r+'">'+e+"</h"+t+">"},o().setOptions({silent:!0,gfm:!0,pedantic:!1}),o().use({tokenizer:v,renderer:u}),t.ZP=o()},51581:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(59301),s=a(i),o=a(n(12708));function a(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.scrollListener=n.scrollListener.bind(n),n.eventListenerOptions=n.eventListenerOptions.bind(n),n.mousewheelListener=n.mousewheelListener.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var e=this.getParentElement(this.scrollComponent);e.scrollTop=e.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var e=!1,t={get passive(){e=!0}};try{document.addEventListener("test",null,t),document.removeEventListener("test",null,t)}catch(e){}return e}},{key:"eventListenerOptions",value:function(){var e=this.props.useCapture;return this.isPassiveSupported()&&(e={useCapture:this.props.useCapture,passive:!0}),e}},{key:"setDefaultLoader",value:function(e){this.defaultLoader=e}},{key:"detachMousewheelListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.scrollComponent.parentNode),e.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.getParentElement(this.scrollComponent)),e.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),e.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(e){var t=this.props.getScrollParent&&this.props.getScrollParent();return null!=t?t:e&&e.parentNode}},{key:"filterProps",value:function(e){return e}},{key:"attachScrollListener",value:function(){var e=this.getParentElement(this.scrollComponent);if(this.props.hasMore&&e){var t=window;!1===this.props.useWindow&&(t=e),t.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),t.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(e){1!==e.deltaY||this.isPassiveSupported()||e.preventDefault()}},{key:"scrollListener",value:function(){var e=this.scrollComponent,t=window,n=this.getParentElement(e),r=void 0;if(this.props.useWindow){var i=document.documentElement||document.body.parentNode||document.body,s=void 0!==t.pageYOffset?t.pageYOffset:i.scrollTop;r=this.props.isReverse?s:this.calculateOffset(e,s)}else r=this.props.isReverse?n.scrollTop:e.scrollHeight-n.scrollTop-n.clientHeight;r<Number(this.props.threshold)&&e&&null!==e.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=n.scrollHeight,this.beforeScrollTop=n.scrollTop,"function"==typeof this.props.loadMore&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(e,t){return e?this.calculateTopPosition(e)+(e.offsetHeight-t-window.innerHeight):0}},{key:"calculateTopPosition",value:function(e){return e?e.offsetTop+this.calculateTopPosition(e.offsetParent):0}},{key:"render",value:function(){var e=this,t=this.filterProps(this.props),n=t.children,r=t.element,i=t.hasMore,o=(t.initialLoad,t.isReverse),a=t.loader,c=(t.loadMore,t.pageStart,t.ref),l=(t.threshold,t.useCapture,t.useWindow,t.getScrollParent,function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]));l.ref=function(t){e.scrollComponent=t,c&&c(t)};var u=[n];return i&&(a?o?u.unshift(a):u.push(a):this.defaultLoader&&(o?u.unshift(this.defaultLoader):u.push(this.defaultLoader))),s.default.createElement(r,l,u)}}]),t}(i.Component);c.propTypes={children:o.default.node.isRequired,element:o.default.node,hasMore:o.default.bool,initialLoad:o.default.bool,isReverse:o.default.bool,loader:o.default.node,loadMore:o.default.func.isRequired,pageStart:o.default.number,ref:o.default.func,getScrollParent:o.default.func,threshold:o.default.number,useCapture:o.default.bool,useWindow:o.default.bool},c.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},t.default=c,e.exports=t.default},26724:function(e,t,n){e.exports=n(51581)}}]); |