|
|
(self.webpackChunk=self.webpackChunk||[]).push([[49716],{43501:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(1565),i=n(59301),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},a=n(68475),o=function(e,t){return i.createElement(a.Z,(0,r.Z)({},e,{ref:t,icon:c}))};var s=i.forwardRef(o)},89136:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(1565),i=n(59301),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},a=n(68475),o=function(e,t){return i.createElement(a.Z,(0,r.Z)({},e,{ref:t,icon:c}))};var s=i.forwardRef(o)},53547:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(1565),i=n(59301),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},a=n(68475),o=function(e,t){return i.createElement(a.Z,(0,r.Z)({},e,{ref:t,icon:c}))};var s=i.forwardRef(o)},21740:function(e,t,n){"use strict";var r=n(82242),i=n.n(r),c=(n(59301),n(93314)),a=n(3113),o=n(37712);t.Z=function(e){var t=e.img,n=e.buttonProps,r=void 0===n?{}:n,s=e.styles,l=void 0===s?{}:s,u=e.customText,d=e.ButtonText,f=e.ButtonClick,p=e.Buttonclass,h=e.ButtonTwo,v=e.imgStyles,m=e.loading,x=void 0!==m&&m;return(0,o.jsxs)("section",{className:"tc animated fadeIn",style:i()(i()({},{color:"#999",margin:"100px auto",visibility:x?"hidden":"visible"}),l),children:[(0,o.jsx)("img",{src:t||c,style:i()(i()({},v),{},{pointerEvents:"none",userSelect:"none"})}),(0,o.jsx)("p",{className:"mt20 font14",children:u||"暂时还没有相关数据哦!"}),d&&(0,o.jsx)(a.ZP,i()(i()({className:p,onClick:f},r),{},{children:d})),h&&h]})}},16269:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(82242),i=n.n(r),c=n(7557),a=n.n(c),o=n(41498),s=n.n(o),l=n(79800),u=n.n(l),d=n(59301),f={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},p=n(3113),h=n(74516),v=n(16844),m=n(6848),x=n(92818),g=n(96005),_=n(21740),y=n(14103),j=n(81458),b=n(37712),E=function(e){var t,n,r,c,o,l,E=e.editOffice,C=void 0===E?"view":E,w=e.data,A=(e.theme,e.type),N=e.filename,O=e.monacoEditor,I=e.className,k=e.style,S=e.close,T=e.onClose,Z=e.hasMask,B=e.disabledDownload,L=e.onImgDimensions,P=e.showNodata,R=e.recordInfo,F=(0,d.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),M=u()(F,2),U=(M[0],M[1],(0,d.useState)("")),z=u()(U,2),D=(z[0],z[1]),H=(0,d.useState)(),V=u()(H,2),q=V[0],X=V[1],$="build"===window.ENV?"/react/build":"",W=location.host.startsWith("localhost")?y.Z.PROXY_SERVER:y.Z.API_SERVER,Y=(0,d.useRef)();null!==(t=w)&&void 0!==t&&t.startsWith("/api")&&"txt"!==A&&(w=y.Z.API_SERVER+w);N&&(O.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]&&D(t[1])}))}),[]),(0,d.useEffect)((function(){var e;"office"===A&&(w.indexOf("bigfilescdn.")>-1||w.indexOf("bigfiles1")>-1?X({url:w,fileType:(e=w,e.substring(e.lastIndexOf("/")+1).split(".").pop()),model:w.indexOf("model=edit")?"edit":"view"}):J())}),[A,w]);var J=function(){var e=s()(a()().mark((function e(){var t,n,r;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("data:",w),t=w,w.startsWith("http")||(t=location.origin+t),n=new URL(t).pathname.split("/").pop(),e.next=6,(0,g.gJ)({attachment_id:n});case 6:(r=e.sent).url=W+r.url,X(r);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),K=function(){w.startsWith("http")||w.startsWith("blob:")?Q():(0,x.Sv)(N||"educoder",w,N)},Q=function(){R&&(0,j.fc)({id:null==R?void 0:R.id,watch_type:1,course_id:null==R?void 0:R.course_id}),(0,x.Nd)(N||"educoder",decodeURIComponent(w))};return(0,b.jsxs)("div",{style:i()({},k||{}),className:"".concat(Z&&f.bgBlack," ").concat(A?f.wrp:"hide"),children:[S&&(0,b.jsxs)("div",{className:f.close,ref:Y,children:[!!L&&(0,b.jsx)(m.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return Y.current},children:(0,b.jsx)("span",{onClick:function(){T(),L()},children:(0,b.jsx)("i",{className:"icon-yulanpizhu"})})}),!B&&(0,b.jsx)(m.Z,{title:"点击下载此文件",getPopupContainer:function(){return Y.current},children:(0,b.jsx)("span",{onClick:Q,children:(0,b.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,b.jsx)(m.Z,{title:"关闭",getPopupContainer:function(){return Y.current},children:(0,b.jsx)("span",{className:"",onClick:T,children:(0,b.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,b.jsx)("div",{className:"".concat(f[I]," ").concat(I," ").concat(f.monaco," ").concat("txt"===A?"show":"hide"),children:"txt"===A&&(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(v.ZP,i()({},O))})}),"audio"===A&&(0,b.jsx)("audio",{src:"".concat((null===(n=w)||void 0===n?void 0:n.indexOf("http://"))>-1||(null===(r=w)||void 0===r?void 0:r.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(w),autoPlay:!0}),"video"===A&&(0,b.jsx)(b.Fragment,{children:(null===(c=w)||void 0===c?void 0:c.indexOf("http"))>-1?(0,b.jsx)("video",{controls:!0,src:"".concat(w),autoPlay:!0}):(0,b.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(w),autoPlay:!0})}),"office"===A&&q&&(0,b.jsx)("iframe",{src:"".concat($,"/office.html?key=").concat(q.key,"&url=").concat(btoa(q.url),"&callbackUrl=").concat(W+q.callbackUrl,"&fileType=").concat(q.fileType,"&title=").concat(q.title,"&model=").concat(C,"&officeServer=").concat(y.Z.ONLYOFFICE,"&disabledDownload=").concat(!!B)}),"html"===A&&(0,b.jsx)("iframe",{src:w+"&disposition=inline"}),"pdf"===A&&(0,b.jsx)("iframe",{src:"".concat($,"/js/pdfview/index.html?url=").concat(w,"&disabledDownload=").concat(!!B)}),"image"===A&&(0,b.jsx)("img",{src:"".concat((null===(o=w)||void 0===o?void 0:o.indexOf("http://"))>-1||(null===(l=w)||void 0===l?void 0:l.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(w)}),("other"===A||"download"===A)&&(0,b.jsx)(b.Fragment,{children:P?(0,b.jsx)(_.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,b.jsx)(p.ZP,{icon:(0,b.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:K,children:"下载"})}):(0,b.jsxs)(p.ZP,{type:"primary",size:"middle",onClick:K,children:[(0,b.jsx)(h.Z,{}),"点击下载"]})})]})}},11829:function(e,t,n){"use strict";var r=n(82242),i=n.n(r),c=n(37205),a=n.n(c),o=n(91232),s=n.n(o),l=n(79800),u=n.n(l),d=n(59301),f=(n(25027),n(570)),p=(n(64018),n(63824)),h=n(14103),v=n(15342),m=n(1012),x=n(16269),g=n(37712),_="@▁@",y=/<pre[^>]*>/g;t.Z=function(e){var t=e.value,n=void 0===t?"":t,r=e.className,c=e.showTextOnly,o=e.showLines,l=e.style,j=void 0===l?{}:l,b=e.stylesPrev,E=void 0===b?{}:b,C=e.highlightKeywords,w=e.showProgramFill,A=(e.isProgramFill,e.disabledFill),N=void 0!==A&&A,O=e.programFillValue,I=e.onFillChange,k=void 0===I?function(e){}:I,S=e.onFillBlur,T=void 0===S?function(){}:S,Z=String(n),B=(0,d.useState)(""),L=u()(B,2),P=L[0],R=L[1],F=(0,d.useState)("office"),M=u()(F,2),U=M[0],z=M[1],D=(0,d.useState)([]),H=u()(D,2),V=H[0],q=H[1],X=(0,d.useRef)("a"+(0,m.Z)()),$={},W=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(X.current," ").concat(e))})),"<style>".concat(r.join("}"),"</style>")}))},Y=(0,d.useMemo)((function(){try{Z=Z.replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,"("+h.Z.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+h.Z.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+h.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(w){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===_?"input":"textarea");r.style.width="100%",r.style.height=e===_?"40px":"151px",r.rows=5,r.spellcheck=!1,r.name="edu-program-fill",r.placeholder="请输入",r.dataset.id=t;var i=Object.keys($).length;return $[i]=r,'<span class="edu-program-fill-wrap '.concat(e===_?"":"show",'" style="width:').concat(e===_?"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==O||null===(i=O[e])||void 0===i?void 0:i.value)})),'<pre style="background:#fff;padding:4px">'.concat(W(Z||""),"</pre>")}var t=W(Z);t=(0,f.ZP)(t);var n=(0,f.ez)();Z.match(/\[TOC\]/)&&(t=t.replace("<p>[TOC]</p>",(0,f.Qv)()),(0,f.Iy)()),t=t.replace(/(__special_katext_id_\d+__)/g,(function(e,t){var r=n[t],i=r.type,c=r.expression;return(0,v.renderToString)(function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}(c)||"",{displayMode:"block"===i,throwOnError:!1,output:"html"})})),t=t.replace(/▁/g,"▁▁▁▁▁"),(0,f.AL)();var r=document.createElement("div");return r.innerHTML=t,C?(Q(r,C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),r.innerHTML):c?r.innerText:(setTimeout((function(){return te()}),500),r.innerHTML)}),[Z,C]);(0,d.useEffect)((function(){G.current&&G.current.querySelectorAll(["input","textarea"]).forEach((function(e){e.oninput=J,e.onblur=K}))}),[V]),(0,d.useEffect)((function(){if(null!=O&&O.length)try{var e,t=G.current.querySelectorAll(".edu-program-fill-score"),n=G.current.querySelectorAll('[name="edu-program-fill"]'),r=s()(n.entries());try{for(r.s();!(e=r.n()).done;){var i,c,a,o=u()(e.value,2),l=o[0],d=o[1];d.value=(null==O||null===(i=O[l])||void 0===i?void 0:i.value)||"","warning"===(null==O||null===(c=O[l])||void 0===c?void 0:c.type)?d.className="program-fill-warning":"success"===(null==O||null===(a=O[l])||void 0===a?void 0:a.type)?d.className="program-fill-success":d.className=""}}catch(e){r.e(e)}finally{r.f()}var f,p=s()(t.entries());try{for(p.s();!(f=p.n()).done;){var h,v,m=u()(f.value,2),x=m[0];m[1].innerHTML=null!=O&&null!==(h=O[x])&&void 0!==h&&h.score?"".concat(null==O||null===(v=O[x])||void 0===v?void 0:v.score,"分"):""}}catch(e){p.e(e)}finally{p.f()}q(O)}catch(e){console.log(e,"error")}}),[O]);var J=function(e){V[e.target.dataset.id]=V[e.target.dataset.id]||{},V[e.target.dataset.id].value=e.target.value,q(a()(V)),k(V,e.target.dataset.id)},K=function(e){V[e.target.dataset.id]=V[e.target.dataset.id]||{},V[e.target.dataset.id].value=e.target.value,q(a()(V)),T(V,e.target.dataset.id)};function Q(e,t){return e.childNodes.forEach((function(e){if(e.childNodes.length>0)Q(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 G=(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(),R(n),z("office");else if(n.indexOf("application/pdf")>-1)e.preventDefault(),R(n),z("pdf");else if(n.indexOf("text/html")>-1)e.preventDefault(),R(n),z("html");else if(n.startsWith("#")){e.preventDefault();var r=document.getElementById(n.replace("#",""));r&&r.scrollIntoView(!0)}}}f.jb.WebkitLineClamp=o,o&&(j=i()(i()({},j),f.jb));var te=function(){var e,t=null===(e=G.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(p.ZP.isSupported()){var t=new p.ZP;t.loadSource(e.src),t.attachMedia(e)}}))};return(0,d.useEffect)((function(){if(G.current&&Y&&Y.match(y)&&window.PR.prettyPrint(),G.current)return G.current.addEventListener("click",ee),function(){var e;null===(e=G.current)||void 0===e||e.removeEventListener("click",ee),(0,f.AL)(),(0,f.Iy)()}}),[Y,G.current,ee]),(0,g.jsxs)(g.Fragment,{children:[c&&(0,g.jsx)("div",{ref:G,children:Y}),!c&&(0,g.jsx)("div",{ref:G,style:i()({},j),className:"".concat(r||""," ").concat(N?"disabled-fill":""," markdown-body ").concat(X.current),dangerouslySetInnerHTML:{__html:Y}}),(0,g.jsx)(x.Z,{close:!0,data:P,type:null!=P&&P.length?U:"",style:i()({},E),onClose:function(){return R("")}})]})}},80575:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(96048),i="ldsRing___mpBZC",c="idsRingWrapper___Of9_n",a=n(37712),o=function(e){var t=e.message,n=e.className,o=e.children,s=e.style,l=void 0===s?{}:s;return(0,a.jsxs)("div",{className:"custom-spinner ".concat(c," ").concat(n),children:[(0,a.jsxs)("div",{className:i,children:[(0,a.jsx)("div",{}),(0,a.jsx)("div",{}),(0,a.jsx)("div",{}),(0,a.jsx)("div",{})]}),t?(0,a.jsx)("p",{style:l,children:t}):null,o,(0,a.jsx)(r.Outlet,{})]})}},17341:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});n(59301);var r="result___gu5zt",i="title___xrnx2",c="left___IAxp9",a="leftNode___HL8fG",o="right___ZXYmw",s="rightNode___jYL5_",l=n(92310),u=n.n(l),d=n(37712),f=function(e){var t=e.className,n=e.style,l=void 0===n?{}:n,f=e.leftNode,p=e.leftTitle,h=void 0===p?"自测输入":p,v=e.rightNode,m=e.rightTitle,x=void 0===m?"运行结果":m;return(0,d.jsxs)("div",{className:u()(r,t),style:l,children:[(0,d.jsxs)("div",{className:c,children:[(0,d.jsxs)("div",{className:i,children:[(0,d.jsx)("i",{style:{color:"#08CF76"},className:"iconfont iconfont icon-zidingyiceshiyongli font14 mr5"}),(0,d.jsx)("span",{children:h})]}),(0,d.jsx)("div",{className:a,children:f})]}),(0,d.jsxs)("div",{className:o,children:[(0,d.jsxs)("div",{className:i,children:[(0,d.jsx)("i",{style:{color:"#00DFFF"},className:"iconfont iconfont icon-daimazhihangjieguo font14 mr5"}),(0,d.jsx)("span",{children:x})]}),(0,d.jsx)("div",{className:s,children:v})]})]})}},80471:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return j}});var r=n(7557),i=n.n(r),c=n(41498),a=n.n(c),o=n(79800),s=n.n(o),l=n(59301),u=n(98537),d=n(14103),f=n(96048),p=n(71418),h=n(3581),v=n(69101),m=n(16844),x=n(24334),g=n(99232),_=n.n(g),y=n(37712),j=function(){var e=(0,f.useParams)(),t=e.submitId,n=e.id,r=(0,l.useState)(void 0),c=s()(r,2),o=c[0],g=c[1];console.log((0,f.useLocation)(),33);var j=(0,f.useLocation)();(0,l.useEffect)((function(){return(0,f.getDvaApp)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),(0,f.getDvaApp)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),function(){(0,f.getDvaApp)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),(0,f.getDvaApp)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}}),[]),(0,l.useEffect)((function(){document.title="在线刷题"})),(0,l.useEffect)((function(){if(t){var e=function(){var e=a()(i()().mark((function e(){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,h.X6)(t);case 2:n=e.sent,g(n.data);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[t]);var b=o||{},E=b.status,C=b.created_at,w=b.code,A=b.name,N=b.language,O=b.pass_sets_count,I=b.set_count,k=b.error_msg,S=b.output,T=b.input,Z=b.expected_output,B=(b.execute_memory,b.user),L=b.execute_time,P=b.input_file_url,R=b.output_file_url,F=b.is_file,M=b.expected_output_file_url;return(0,y.jsx)(p.Z,{spinning:!o,delay:500,children:(0,y.jsx)("div",{className:"record-detail-info",children:o?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("header",{className:u.Z.header,children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("img",{src:"".concat(d.Z.IMG_SERVER,"/images/").concat(B.image_url),alt:"user",width:30}),(0,y.jsx)("span",{children:B.name})]}),(0,y.jsxs)("h2",{children:[" ",A," "]}),(0,y.jsx)("button",{className:"ant-btn",onClick:function(){var e;f.history.push("/problems/".concat(n,"/oj/").concat(null==j||null===(e=j.query)||void 0===e?void 0:e.backId,"?tab=1"))},style:{border:"1px solid #bacffe",color:"#3061d0"},children:"返回该题"})]}),(0,y.jsxs)("div",{className:"record-detail-body",children:[(0,y.jsx)("h2",{children:" 提交记录 "}),(0,y.jsxs)("ul",{className:"record-info",children:[(0,y.jsxs)("li",{children:[" 状态:",(0,y.jsx)("span",{className:0===E?"c-green":"c-red",children:v.Im[E]})," "]}),(0,y.jsxs)("li",{children:[" 提交时间:",(0,y.jsx)("span",{children:_()(C).format("YYYY-MM-DD HH:mm:ss")})," "]}),(0,y.jsxs)("li",{children:[" 语言:",(0,y.jsx)("span",{children:N})," "]}),(0,y.jsxs)("li",{children:[" 执行用时:",(0,y.jsxs)("span",{children:[1e3*L,"ms"]})," "]}),(0,y.jsxs)("li",{children:[" ","".concat(O," / ").concat(I," 个通过的测试用例")," "]})]}),(0,v.gZ)({status:E,error_msg:k,execute_time:L,output:S,input:T,expected_output:Z,input_file_url:P,output_file_url:R,is_file:F,expected_output_file_url:M}),(0,y.jsx)("h2",{children:" 提交的内容 "}),(0,y.jsx)(m.ZP,{height:"200px",width:"100%",language:null==N?void 0:N.toLocaleLowerCase(),value:x.Base64.decode(w),options:{readOnly:!0}})]})]}):null})})}},69101:function(e,t,n){"use strict";n.d(t,{Im:function(){return E},ZP:function(){return O},gZ:function(){return A}});var r=n(79800),i=n.n(r),c=n(82242),a=n.n(c),o=n(85573),s=n.n(o),l=n(59301),u=n(98135),d=n(3113),f=n(43501),p=n(53547),h=n(9452),v=n(24334),m=n(80575),x=n(11829),g=n(92818),_=n(17341),y=n(37712),j=u.Z.TextArea,b={visible:!1,tabIndex:"0"},E=s()(s()(s()(s()(s()(s()({},h.h.NOMATCH,"测试用例结果不匹配"),h.h.OK,"调试通过"),2,"调试超时"),3,"调试pod失败"),4,"编译失败"),5,"执行失败"),C=function(e){return e[e.SET_VISIBLE=0]="SET_VISIBLE",e[e.SET_TABINDEX=1]="SET_TABINDEX",e}(C||{});function w(e,t){switch(t.type){case C.SET_VISIBLE:return a()(a()({},e),{},{visible:t.payload});case C.SET_TABINDEX:return a()(a()({},e),{},{tabIndex:t.payload});default:throw new Error}}function A(e){var t=e.status,n=e.error_msg,r=e.output,i=e.input,c=e.expected_output,a=e.is_file,o=e.input_file_url,s=e.output_file_url,l=e.expected_output_file_url,u=null,d={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(t){case h.h.NOMATCH:u=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("p",{className:"c-red",children:"实际输入:"}),!a&&(0,y.jsx)(x.Z,{value:i,style:d}),a&&(0,y.jsx)("div",{style:d,children:(0,y.jsx)("a",{onClick:function(){return(0,g.LR)(o,i)},children:i})}),(0,y.jsx)("p",{className:"c-red",children:"实际输出:"}),!a&&(0,y.jsx)(x.Z,{value:r&&v.Base64.decode(r)||"",style:d}),a&&(0,y.jsx)("div",{style:d,children:(0,y.jsx)("a",{onClick:function(){return(0,g.LR)(s,r)},children:r})}),(0,y.jsx)("p",{className:"c-red",children:"预期输出:"}),!a&&(0,y.jsx)(x.Z,{value:c&&v.Base64.decode(c)||"",style:d}),a&&(0,y.jsx)("div",{style:d,children:(0,y.jsx)("a",{onClick:function(){return(0,g.LR)(l,c)},children:c})})]});break;case h.h.EXECUTEFAILURE:case h.h.COMPILEFAILURE:u=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("p",{children:"最后执行的输入:"}),!a&&(0,y.jsx)(x.Z,{value:i,style:d}),a&&(0,y.jsx)("div",{style:d,children:(0,y.jsx)("a",{onClick:function(){return(0,g.LR)(o,i)},children:i})}),(0,y.jsx)("p",{children:"执行出错信息:"}),(0,y.jsx)("pre",{className:"error",children:v.Base64.decode(n)})]});break;case h.h.PODFAILURE:u=(0,y.jsx)("p",{children:"创建pod失败,请稍后重试"});break;case h.h.TIMEOUT:u=(0,y.jsx)("p",{children:"评测超时,请稍后重试"})}return(0,y.jsxs)(y.Fragment,{children:[" ",u," "]})}function N(e){var t=e.status,n=e.error_msg,r=e.execute_time,i=e.output,c=e.input,a=e.expected_output,o=(e.is_file,e.input_file_url,e.output_file_url,e.expected_output_file_url,null);switch(t){case h.h.OK:o=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("p",{children:["执行用时:",r,"秒"]}),(0,y.jsx)("p",{children:"执行结果:"}),(0,y.jsx)("pre",{children:v.Base64.decode(i)})]});break;case h.h.NOMATCH:o=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("p",{children:["输入:",(0,y.jsx)("pre",{children:c})]}),(0,y.jsxs)("p",{children:["输出:",i&&v.Base64.decode(i)]}),(0,y.jsxs)("p",{children:["预期输出:",a&&v.Base64.decode(a)]})]});break;case h.h.EXECUTEFAILURE:case h.h.COMPILEFAILURE:o=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("p",{children:["最后执行的输入:",(0,y.jsx)("pre",{children:c})]}),(0,y.jsx)("p",{children:"执行出错信息:"}),(0,y.jsx)("pre",{className:"error",children:v.Base64.decode(n)})]});break;case h.h.PODFAILURE:o=(0,y.jsx)("p",{children:"创建pod失败,请稍后重试"});break;case h.h.TIMEOUT:o=(0,y.jsx)("p",{children:"评测超时,请稍后重试"})}return(0,y.jsxs)(y.Fragment,{children:[" ",o," "]})}var O=function(e){var t=e.id,n=e.is_file,r=e.input,c=e.debuging,a=e.submitting,o=(e.executingMessage,e.debugResult),s=e.onChangeInput,u=e.onDebugCode,h=e.onSubmitCode,v=(0,l.useReducer)(w,b),x=i()(v,2),g=x[0],E=x[1],A=g.visible;g.tabIndex;(0,l.useEffect)((function(){E({type:C.SET_VISIBLE,payload:!1})}),[t]);var O=(0,l.useMemo)((function(){if(o){o.status;return(0,y.jsx)(y.Fragment,{children:N(o)})}return null}),[o]);return(0,y.jsxs)("div",{className:"test-case-panel",children:[(0,y.jsxs)("div",{className:"test-case-panel-body ".concat(A?"active":""),children:[(0,y.jsx)("ul",{className:"s-navs",children:(0,y.jsx)("li",{children:(0,y.jsx)("a",{className:"active",children:"调试代码结果"})})}),(0,y.jsx)(_.Z,{leftTitle:"自定义测试用例",rightTitle:"代码执行结果",style:{height:240},leftNode:(0,y.jsx)(j,{placeholder:"请输入自测用例(如果未填写,自测运行时,系统会自动填充第一个非隐藏的文本类型的测试用例)",value:n?"":r,onChange:s}),rightNode:c?(0,y.jsx)(m.Z,{message:"代码执行中..."}):o?O:(0,y.jsx)("p",{style:{color:"#536879"},children:"请填写测试用例的输入值,点击“调试代码”"})})]}),(0,y.jsx)("a",{className:"btn-collapse ".concat(A?"up":""),onClick:function(){E({type:C.SET_VISIBLE,payload:!A})},children:A?(0,y.jsx)(f.Z,{}):(0,y.jsx)(p.Z,{})}),(0,y.jsxs)("footer",{className:"footer",children:[(0,y.jsx)("span",{style:{visibility:"hidden"},children:"控制台"}),(0,y.jsxs)("div",{className:"flex-container",children:[(0,y.jsx)(d.ZP,{id:"oj-prev",className:"btn-blue",type:"ghost",children:"上一题"}),(0,y.jsx)(d.ZP,{id:"oj-next",className:"btn-blue",type:"ghost",children:"下一题"}),(0,y.jsx)(d.ZP,{className:"btn-green",type:"ghost",loading:c,onClick:function(){E({type:C.SET_VISIBLE,payload:!0}),E({type:C.SET_TABINDEX,payload:"1"}),u()},children:"调试代码"}),(0,y.jsx)(d.ZP,{type:"primary",className:"custom-ant-disabled",loading:a,disabled:a,onClick:function(){E({type:C.SET_VISIBLE,payload:!1}),h()},children:"评测并提交"})]})]})]})}},9452:function(e,t,n){"use strict";n.d(t,{h:function(){return r}});var r=function(e){return e[e.NOMATCH=-1]="NOMATCH",e[e.OK=0]="OK",e[e.TIMEOUT=2]="TIMEOUT",e[e.PODFAILURE=3]="PODFAILURE",e[e.COMPILEFAILURE=4]="COMPILEFAILURE",e[e.EXECUTEFAILURE=5]="EXECUTEFAILURE",e}({})},3581:function(e,t,n){"use strict";n.d(t,{H7:function(){return d},KC:function(){return m},M3:function(){return y},MK:function(){return u},MU:function(){return a},Rg:function(){return E},WH:function(){return x},X6:function(){return s},bM:function(){return c},bx:function(){return g},dd:function(){return h},de:function(){return w},fi:function(){return f},fu:function(){return i},gu:function(){return _},n4:function(){return p},qe:function(){return b},rL:function(){return C},rX:function(){return l},uc:function(){return A},vl:function(){return v},wO:function(){return j},zO:function(){return o}});var r=n(82420);function i(e){return(0,r.U2)("mypractices/".concat(e,".json"),{hidePopLogin:!0})}function c(e,t){return(0,r.v_)("mypractices/".concat(e,"/code_submit.json"),t)}function a(e,t){return(0,r.v_)("mypractices/".concat(e,"/code_debug.json"),t)}function o(e,t){return t.language&&(t.language=encodeURIComponent(t.language)),(0,r.U2)("mypractices/".concat(e,"/submit_records.json"),t)}function s(e){return(0,r.U2)("mypractices/record_detail.json",{id:e})}function l(e,t){return(0,r.U2)("mypractices/".concat(e,"/result.json"),{mode:t})}function u(e,t){return(0,r.v_)("mypractices/".concat(e,"/add_notes.json"),t)}function d(e,t){return(0,r.v_)("mypractices/".concat(e,"/restore_initial_code.json"),t)}function f(e,t){return(0,r.v_)("mypractices/".concat(e,"/sync_code.json"),t)}function p(e,t){return(0,r.v_)("mypractices/".concat(e,"/update_code.json"),t)}function h(e){return(0,r.v_)("mypractices/".concat(e,"/initial_codes.json"))}function v(e,t){return(0,r.v_)("discusses/".concat(e,"/plus.json"),t)}function m(e){return(0,r.U2)("practices/practices_list.json",e)}function x(e,t){return(0,r.U2)("practices/".concat(e,"/question_solution_articles"),t)}function g(e,t){return(0,r.v_)("practices/".concat(e,"/question_solution_articles"),t)}function _(e,t){return(0,r.gz)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active),t)}function y(e,t){return(0,r.U2)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active,"/edit"),t)}function j(e,t){return(0,r.U2)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active),t)}function b(e,t){return(0,r.v_)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active,"/set_authority_or_excellent"),t)}function E(e,t){return(0,r.v_)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active,"/praise_or_treads"),t)}function C(e,t){return(0,r.v_)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active,"/hide"))}function w(e,t){return(0,r.IV)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active),t)}function A(e,t){return(0,r.v_)("mypractices/".concat(e,"/update_practice_time_sum"),t)}},570:function(e,t,n){"use strict";n.d(t,{AL:function(){return b},Iy:function(){return f},Qv:function(){return v},ez:function(){return j},jb:function(){return p}});var r=n(79800),i=n.n(r),c=n(32834),a=n.n(c),o=n(11690);var s=[],l=["<ul>"],u=new(a().Renderer),d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function f(){s.length=0,l=["<ul>"]}var p={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function h(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 c=[];return t=h(e,++t,i.level,c),c.length>0&&(r.push("<ul>"),c.forEach((function(e){r.push(e)})),r.push("</ul>")),r.push("</li>"),t=h(e,t,n,r)}function v(){return h(s,0,0,l),l.push("</ul>"),l.join("")}var m={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]||""),c=t[2]?t[2].trim():t[2];if(["latex","katex","math"].indexOf(c)>=0){var a=_(),o=r;r=a,y[a]={type:"block",expression:o}}return{type:"code",raw:n,lang:c,text:r}}}},x=/(?:\${2})([^\n`]+?)(?:\${2})/gi,g=0,_=function(){return"__special_katext_id_".concat(g++,"__")},y={};function j(){return y}function b(){g=0,y={}}function E(e){return e=e.replace(x,(function(e,t){var n=_();return y[n]={type:"inline",expression:t},n}))}var C=u.listitem;u.listitem=function(e){return C(E(e))};var w=u.paragraph;u.paragraph=function(e){return w(E(e))};var A=u.tablecell;u.tablecell=function(e,t){return A(E(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,o.escape)(e,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(n?e:(0,o.escape)(e,!0))+"</code></pre>"},u.heading=function(e,t,n){var r=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:r,level:t,text:e}),"<h"+t+' id="'+r+'">'+e+"</h"+t+">"},a().setOptions({silent:!0,gfm:!0,pedantic:!1}),a().use({tokenizer:m,renderer:u}),t.ZP=a()},98537:function(e,t){"use strict";t.Z={header:"header___HqHSe",checkboxs:"checkboxs___ObBnD",field:"field___w_sM6","oj-form-container":"oj-form-container____odYP","oj-left-panel":"oj-left-panel___emEB2","oj-form-info":"oj-form-info___m00Ag",footer:"footer___O4iSJ",collapse:"collapse___Ltfkj","test-case-name":"test-case-name___miZcb","btn-remove-case":"btn-remove-case___cHap2","icon-tag":"icon-tag___gmyTb",btn_back:"btn_back___tNmX3",testJi:"testJi___L3fHb",upBtn:"upBtn___RGH6X",djs:"djs____TS0n",time:"time___IAdHc"}},98135:function(e,t,n){"use strict";n.d(t,{Z:function(){return Z}});var r=n(92310),i=n.n(r),c=n(59301),a=n(36355),o=n(32441),s=n(9937);var l=e=>{const{getPrefixCls:t,direction:n}=(0,c.useContext)(a.E_),{prefixCls:r,className:l}=e,u=t("input-group",r),d=t("input"),[f,p]=(0,s.ZP)(d),h=i()(u,{[`${u}-lg`]:"large"===e.size,[`${u}-sm`]:"small"===e.size,[`${u}-compact`]:e.compact,[`${u}-rtl`]:"rtl"===n},p,l),v=(0,c.useContext)(o.aM),m=(0,c.useMemo)((()=>Object.assign(Object.assign({},v),{isFormItemInput:!1})),[v]);return f(c.createElement("span",{className:h,style:e.style,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onFocus:e.onFocus,onBlur:e.onBlur},c.createElement(o.aM.Provider,{value:m},e.children)))},u=n(9432),d=n(1565),f={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},p=n(68475),h=function(e,t){return c.createElement(p.Z,(0,d.Z)({},e,{ref:t,icon:f}))};var v=c.forwardRef(h),m=n(89136),x=n(70521),g=n(16863),_=n(59412),y=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const j=e=>e?c.createElement(m.Z,null):c.createElement(v,null),b={click:"onClick",hover:"onMouseOver"};var E=c.forwardRef(((e,t)=>{const{visibilityToggle:n=!0}=e,r="object"==typeof n&&void 0!==n.visible,[o,s]=(0,c.useState)((()=>!!r&&n.visible)),l=(0,c.useRef)(null);c.useEffect((()=>{r&&s(n.visible)}),[r,n]);const d=(0,_.Z)(l),f=()=>{const{disabled:t}=e;t||(o&&d(),s((e=>{var t;const r=!e;return"object"==typeof n&&(null===(t=n.onVisibleChange)||void 0===t||t.call(n,r)),r})))},{className:p,prefixCls:h,inputPrefixCls:v,size:m}=e,E=y(e,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:C}=c.useContext(a.E_),w=C("input",v),A=C("input-password",h),N=n&&(t=>{const{action:n="click",iconRender:r=j}=e,i=b[n]||"",a=r(o),s={[i]:f,className:`${t}-icon`,key:"passwordIcon",onMouseDown:e=>{e.preventDefault()},onMouseUp:e=>{e.preventDefault()}};return c.cloneElement(c.isValidElement(a)?a:c.createElement("span",null,a),s)})(A),O=i()(A,p,{[`${A}-${m}`]:!!m}),I=Object.assign(Object.assign({},(0,x.Z)(E,["suffix","iconRender","visibilityToggle"])),{type:o?"text":"password",className:O,prefixCls:w,suffix:N});return m&&(I.size=m),c.createElement(u.Z,Object.assign({ref:(0,g.sQ)(t,l)},I))})),C=n(11013),w=n(92343),A=n(3113),N=n(19716),O=n(33234),I=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};var k=c.forwardRef(((e,t)=>{const{prefixCls:n,inputPrefixCls:r,className:o,size:s,suffix:l,enterButton:d=!1,addonAfter:f,loading:p,disabled:h,onSearch:v,onChange:m,onCompositionStart:x,onCompositionEnd:_}=e,y=I(e,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:j,direction:b}=c.useContext(a.E_),E=c.useRef(!1),k=j("input-search",n),S=j("input",r),{compactSize:T}=(0,O.ri)(k,b),Z=(0,N.Z)((e=>{var t;return null!==(t=null!=s?s:T)&&void 0!==t?t:e})),B=c.useRef(null),L=e=>{var t;document.activeElement===(null===(t=B.current)||void 0===t?void 0:t.input)&&e.preventDefault()},P=e=>{var t,n;v&&v(null===(n=null===(t=B.current)||void 0===t?void 0:t.input)||void 0===n?void 0:n.value,e,{source:"input"})},R="boolean"==typeof d?c.createElement(C.Z,null):null,F=`${k}-button`;let M;const U=d||{},z=U.type&&!0===U.type.__ANT_BUTTON;M=z||"button"===U.type?(0,w.Tm)(U,Object.assign({onMouseDown:L,onClick:e=>{var t,n;null===(n=null===(t=null==U?void 0:U.props)||void 0===t?void 0:t.onClick)||void 0===n||n.call(t,e),P(e)},key:"enterButton"},z?{className:F,size:Z}:{})):c.createElement(A.ZP,{className:F,type:d?"primary":void 0,size:Z,disabled:h,key:"enterButton",onMouseDown:L,onClick:P,loading:p,icon:R},d),f&&(M=[M,(0,w.Tm)(f,{key:"addonAfter"})]);const D=i()(k,{[`${k}-rtl`]:"rtl"===b,[`${k}-${Z}`]:!!Z,[`${k}-with-button`]:!!d},o);return c.createElement(u.Z,Object.assign({ref:(0,g.sQ)(B,t),onPressEnter:e=>{E.current||p||P(e)}},y,{size:Z,onCompositionStart:e=>{E.current=!0,null==x||x(e)},onCompositionEnd:e=>{E.current=!1,null==_||_(e)},prefixCls:S,addonAfter:M,suffix:l,onChange:e=>{e&&e.target&&"click"===e.type&&v&&v(e.target.value,e,{source:"clear"}),m&&m(e)},className:D,disabled:h}))})),S=n(1643);const T=u.Z;T.Group=l,T.Search=k,T.TextArea=S.Z,T.Password=E;var Z=T},24334:function(e,t,n){var r,i;i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:this,e.exports=function(n){"use strict";var i,c=(n=n||{}).Base64,a="2.6.4",o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=function(e){for(var t={},n=0,r=e.length;n<r;n++)t[e.charAt(n)]=n;return t}(o),l=String.fromCharCode,u=function(e){if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?l(192|t>>>6)+l(128|63&t):l(224|t>>>12&15)+l(128|t>>>6&63)+l(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return l(240|t>>>18&7)+l(128|t>>>12&63)+l(128|t>>>6&63)+l(128|63&t)},d=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,f=function(e){return e.replace(d,u)},p=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[o.charAt(n>>>18),o.charAt(n>>>12&63),t>=2?"=":o.charAt(n>>>6&63),t>=1?"=":o.charAt(63&n)].join("")},h=n.btoa&&"function"==typeof n.btoa?function(e){return n.btoa(e)}:function(e){if(e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return e.replace(/[\s\S]{1,3}/g,p)},v=function(e){return h(f(String(e)))},m=function(e){return e.replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,"")},x=function(e,t){return t?m(v(e)):v(e)},g=function(e){return x(e,!0)};n.Uint8Array&&(i=function(e,t){for(var n="",r=0,i=e.length;r<i;r+=3){var c=e[r],a=e[r+1],s=e[r+2],l=c<<16|a<<8|s;n+=o.charAt(l>>>18)+o.charAt(l>>>12&63)+(void 0!==a?o.charAt(l>>>6&63):"=")+(void 0!==s?o.charAt(63&l):"=")}return t?m(n):n});var _,y=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,j=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return l(55296+(t>>>10))+l(56320+(1023&t));case 3:return l((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return l((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},b=function(e){return e.replace(y,j)},E=function(e){var t=e.length,n=t%4,r=(t>0?s[e.charAt(0)]<<18:0)|(t>1?s[e.charAt(1)]<<12:0)|(t>2?s[e.charAt(2)]<<6:0)|(t>3?s[e.charAt(3)]:0),i=[l(r>>>16),l(r>>>8&255),l(255&r)];return i.length-=[0,0,2,1][n],i.join("")},C=n.atob&&"function"==typeof n.atob?function(e){return n.atob(e)}:function(e){return e.replace(/\S{1,4}/g,E)},w=function(e){return C(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},A=function(e){return b(C(e))},N=function(e){return String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},O=function(e){return A(N(e))};n.Uint8Array&&(_=function(e){return Uint8Array.from(w(N(e)),(function(e){return e.charCodeAt(0)}))});var I=function(){var e=n.Base64;return n.Base64=c,e};if(n.Base64={VERSION:a,atob:w,btoa:h,fromBase64:O,toBase64:x,utob:f,encode:x,encodeURI:g,btou:b,decode:O,noConflict:I,fromUint8Array:i,toUint8Array:_},"function"==typeof Object.defineProperty){var k=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};n.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",k((function(){return O(this)}))),Object.defineProperty(String.prototype,"toBase64",k((function(e){return x(this,e)}))),Object.defineProperty(String.prototype,"toBase64URI",k((function(){return x(this,!0)})))}}return n.Meteor&&(Base64=n.Base64),e.exports?e.exports.Base64=n.Base64:void 0===(r=function(){return n.Base64}.apply(t,[]))||(e.exports=r),{Base64:n.Base64}}(i)}}]); |