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

1 line
38 KiB

This file contains ambiguous Unicode characters!

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

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[49716],{18290:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(5891),a=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"},i=n(88853),o=function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:c}))};var s=a.forwardRef(o)},61441:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(5891),a=n(59301),c={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"},i=n(88853),o=function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:c}))};var s=a.forwardRef(o)},30631:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(5891),a=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"},i=n(88853),o=function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:c}))};var s=a.forwardRef(o)},88551:function(e,t,n){n.d(t,{Z:function(){return s}});var r=n(5891),a=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"},i=n(88853),o=function(e,t){return a.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:c}))};var s=a.forwardRef(o)},12225:function(e,t,n){var r=n(82242),a=n.n(r),c=(n(59301),n(93314)),i=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,p=e.ButtonClick,f=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:a()(a()({},{color:"#999",margin:"100px auto",visibility:x?"hidden":"visible"}),l),children:[(0,o.jsx)("img",{src:t||c,style:a()(a()({},v),{},{pointerEvents:"none",userSelect:"none"})}),(0,o.jsx)("p",{className:"mt20 font14",children:u||"暂时还没有相关数据哦!"}),d&&(0,o.jsx)(i.ZP,a()(a()({className:f,onClick:p},r),{},{children:d})),h&&h]})}},31695:function(e,t,n){n.d(t,{Z:function(){return E}});var r=n(82242),a=n.n(r),c=n(7557),i=n.n(c),o=n(41498),s=n.n(o),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),h=n(63093),v=n(17568),m=n(6848),x=n(69824),g=n(15697),_=n(12225),j=n(22805),y=n(87422),b=n(37712),E=function(e){var t,n,r,c,o,l,E=e.editOffice,w=void 0===E?"view":E,C=e.data,N=(e.theme,e.type),Z=e.filename,I=e.monacoEditor,O=e.className,A=e.style,S=e.close,k=e.onClose,T=e.hasMask,L=e.disabledDownload,R=e.onImgDimensions,P=e.showNodata,M=e.recordInfo,B=(0,d.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),z=u()(B,2),F=(z[0],z[1],(0,d.useState)("")),U=u()(F,2),D=(U[0],U[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")?j.Z.PROXY_SERVER:j.Z.API_SERVER,J=(0,d.useRef)();null!==(t=C)&&void 0!==t&&t.startsWith("/api")&&"txt"!==N&&(C=j.Z.API_SERVER+C);Z&&I&&(I.filename=Z),(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"===N&&(C.indexOf("bigfilescdn.")>-1||C.indexOf("bigfiles1")>-1?X({url:C,fileType:(e=C,e.substring(e.lastIndexOf("/")+1).split(".").pop()),model:C.indexOf("model=edit")?"edit":"view"}):Y())}),[N,C]);var Y=function(){var e=s()(i()().mark((function e(){var t,n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("data:",C),t=C,C.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(){C.startsWith("http")||C.startsWith("blob:")?Q():(0,x.Sv)(Z||"educoder",C,Z)},Q=function(){M&&(0,y.fc)({id:null==M?void 0:M.id,watch_type:1,course_id:null==M?void 0:M.course_id}),(0,x.Nd)(Z||"educoder",decodeURIComponent(C))};return(0,b.jsxs)("div",{style:a()({},A||{}),className:"".concat(T&&p.bgBlack," ").concat(N?p.wrp:"hide"),children:[S&&(0,b.jsxs)("div",{className:p.close,ref:J,children:[!!R&&(0,b.jsx)(m.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return J.current},children:(0,b.jsx)("span",{onClick:function(){k(),R()},children:(0,b.jsx)("i",{className:"icon-yulanpizhu"})})}),!L&&(0,b.jsx)(m.Z,{title:"点击下载此文件",getPopupContainer:function(){return J.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 J.current},children:(0,b.jsx)("span",{className:"",onClick:k,children:(0,b.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,b.jsx)("div",{className:"".concat(p[O]," ").concat(O," ").concat(p.monaco," ").concat("txt"===N?"show":"hide"),children:"txt"===N&&(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(v.ZP,a()({},I))})}),"audio"===N&&(0,b.jsx)("audio",{src:"".concat((null===(n=C)||void 0===n?void 0:n.indexOf("http://"))>-1||(null===(r=C)||void 0===r?void 0:r.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(C),autoPlay:!0}),"video"===N&&(0,b.jsx)(b.Fragment,{children:(null===(c=C)||void 0===c?void 0:c.indexOf("http"))>-1?(0,b.jsx)("video",{controls:!0,src:"".concat(C),autoPlay:!0}):(0,b.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(C),autoPlay:!0})}),"office"===N&&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(w,"&officeServer=").concat(j.Z.ONLYOFFICE,"&disabledDownload=").concat(!!L)}),"html"===N&&(0,b.jsx)("iframe",{src:C+"&disposition=inline"}),"pdf"===N&&(0,b.jsx)("iframe",{src:"".concat($,"/js/pdfview/index.html?filename=").concat(Z||"educoder.pdf","&url=").concat(encodeURIComponent(C),"&disabledDownload=").concat(!!L)}),"image"===N&&(0,b.jsx)("img",{src:"".concat((null===(o=C)||void 0===o?void 0:o.indexOf("http://"))>-1||(null===(l=C)||void 0===l?void 0:l.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(C)}),("other"===N||"download"===N)&&(0,b.jsx)(b.Fragment,{children:P?(0,b.jsx)(_.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,b.jsx)(f.ZP,{icon:(0,b.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:K,disabled:L,children:"下载"})}):(0,b.jsxs)(f.ZP,{type:"primary",size:"middle",onClick:K,disabled:L,children:[(0,b.jsx)(h.Z,{}),"点击下载"]})})]})}},47245:function(e,t,n){n.d(t,{z:function(){return b}});var r=n(82242),a=n.n(r),c=n(37205),i=n.n(c),o=n(91232),s=n.n(o),l=n(79800),u=n.n(l),d=n(59301),p=(n(22159),n(90034)),f=(n(64018),n(55511)),h=n(22805),v=n(69824),m=n(15342),x=n(1012),g=n(31695),_=n(37712),j="@▁@",y=/<pre[^>]*>/g;var b=function(e,t){e=e||"";var n=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return t?e.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(n,(function(e,t,n,r,a,c,i){var o=t||r||c,s=n||a||i||"?";return h.Z.API_SERVER+"/api/attachments/"+o+s+"&t="+(0,v.Jn)(o,Date.now())+(e.indexOf(")")>-1?")":"&")})).replaceAll('src="(','src="').replaceAll("src='(",'src="'):e=e.replace(/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,(function(e,t,n,r,a,c,i){var o=t||r||c,s=n||a||i||"?";return h.Z.API_SERVER+"/attachments/download/"+o+s+"&t="+(0,v.Jn)(o,Date.now())+(e.indexOf(")")>-1?")":"&")})).replace(n,(function(e,t,n,r,a,c,i){var o=t||r||c,s=n||a||i||"?";return h.Z.API_SERVER+"/api/attachments/"+o+s+"&t="+(0,v.Jn)(o,Date.now())+(e.indexOf(")")>-1?")":"&")})).replace(/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,(function(e,t,n,r,a){var c=t||r,i=n||a||"";return'"'+h.Z.API_SERVER+"/api/attachments/"+c+i+c+i+"&t="+(0,v.Jn)(c,Date.now())})).replace(/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,(function(e,t,n,r,a){var c=t||r,i=n||a||"";return"("+h.Z.API_SERVER+"/files/uploads/"+c+i+c+i+"&t="+(0,v.Jn)(c,Date.now())})).replaceAll('src="(','src="').replaceAll("src='(",'src="').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")};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,v=void 0===l?{}:l,b=e.stylesPrev,E=void 0===b?{}:b,w=e.highlightKeywords,C=e.showProgramFill,N=(e.isProgramFill,e.disabledFill),Z=void 0!==N&&N,I=e.programFillValue,O=e.onFillChange,A=void 0===O?function(e){}:O,S=e.onFillBlur,k=void 0===S?function(){}:S,T=e.onFillFocus,L=void 0===T?function(){}:T,R=String(n),P=(0,d.useState)(""),M=u()(P,2),B=M[0],z=M[1],F=(0,d.useState)("office"),U=u()(F,2),D=U[0],H=U[1],V=(0,d.useState)([]),q=u()(V,2),X=q[0],$=q[1],W=(0,d.useRef)("a"+(0,x.Z)()),J={};var Y=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(W.current," ").concat(e))})),"<style>".concat(r.join("}"),"</style>")}))},K=(0,d.useMemo)((function(){try{R=R.replace(/\(\/attachments\/download\//g,"("+h.Z.API_SERVER+"/attachments/download/").replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\//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(C){var e=-1;return R=R.replaceAll("<","&lt;").replaceAll(">","&gt;").replace(/(@▁▁@|@▁@)/g,(function(t,n,r){var a;return function(e,t,n){var r=document.createElement(e===j?"input":"textarea");r.style.width="100%",r.style.height=e===j?"40px":"151px",r.rows=5,r.spellcheck=!1,r.name="edu-program-fill",r.placeholder="请输入",r.dataset.id=t;var a=Object.keys(J).length;return J[a]=r,'<span class="edu-program-fill-wrap '.concat(e===j?"":"show",'" style="width:').concat(e===j?"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==I||null===(a=I[e])||void 0===a?void 0:a.value.replaceAll("<","&lt;").replaceAll(">","&gt;"))})),'<pre style="background:#fff;padding:4px">'.concat(Y(R||""),"</pre>")}var t=Y(R);t=(0,p.ZP)(t);var n=(0,p.ez)();R.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],a=r.type,c=r.expression;return(0,m.renderToString)(function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}(c)||"",{displayMode:"block"===a,throwOnError:!1,output:"html"})})),t=t.replace(/▁/g,"▁▁▁▁▁"),(0,p.AL)();var r=document.createElement("div");return r.innerHTML=t,c?r.innerText:w?(te(r,w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),r.innerHTML):(setTimeout((function(){return ae()}),500),r.innerHTML)}),[R,w]);(0,d.useEffect)((function(){ne.current&&ne.current.querySelectorAll(["input","textarea"]).forEach((function(e){e.oninput=Q,e.onblur=G,e.onfocus=ee}))}),[X]),(0,d.useEffect)((function(){if(null!=I&&I.length)try{var e,t=ne.current.querySelectorAll(".edu-program-fill-score"),n=ne.current.querySelectorAll('[name="edu-program-fill"]'),r=s()(n.entries());try{for(r.s();!(e=r.n()).done;){var a,c,i,o=u()(e.value,2),l=o[0],d=o[1];d.value=(null==I||null===(a=I[l])||void 0===a?void 0:a.value)||"","warning"===(null==I||null===(c=I[l])||void 0===c?void 0:c.type)?d.className="program-fill-warning":"success"===(null==I||null===(i=I[l])||void 0===i?void 0:i.type)?d.className="program-fill-success":d.className=""}}catch(e){r.e(e)}finally{r.f()}var p,f=s()(t.entries());try{for(f.s();!(p=f.n()).done;){var h,v,m=u()(p.value,2),x=m[0];m[1].innerHTML=null!=I&&null!==(h=I[x])&&void 0!==h&&h.score?"".concat(null==I||null===(v=I[x])||void 0===v?void 0:v.score,"分"):""}}catch(e){f.e(e)}finally{f.f()}$(I)}catch(e){console.log(e,"error")}}),[I]);var Q=function(e){X[e.target.dataset.id]=X[e.target.dataset.id]||{},X[e.target.dataset.id].value=e.target.value,$(i()(X)),A(X,e.target.dataset.id)},G=function(e){X[e.target.dataset.id]=X[e.target.dataset.id]||{},X[e.target.dataset.id].value=e.target.value,$(i()(X)),k(X,e.target.dataset.id)},ee=function(e){X[e.target.dataset.id]=X[e.target.dataset.id]||{},X[e.target.dataset.id].value=e.target.value,$(i()(X)),L(X,e.target.dataset.id)};function te(e,t){return e.childNodes.forEach((function(e){if(e.childNodes.length>0)te(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 ne=(0,d.useRef)();function re(e){var t=e.target;if("A"===t.tagName.toUpperCase()){var n=t.getAttribute("href");if(n.indexOf("office")>-1)e.preventDefault(),z(n),H("office");else if(n.indexOf("application/pdf")>-1)e.preventDefault(),z(n),H("pdf");else if(n.indexOf("text/html")>-1)e.preventDefault(),z(n),H("html");else if(n.startsWith("#")){e.preventDefault();var r=document.getElementById(n.replace("#",""));r&&r.scrollIntoView(!0)}}}p.jb.WebkitLineClamp=o,o&&(v=a()(a()({},v),p.jb));var ae=function(){var e,t=null===(e=ne.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(ne.current&&K&&K.match(y)&&window.PR.prettyPrint(),ne.current)return ne.current.addEventListener("click",re),function(){var e;null===(e=ne.current)||void 0===e||e.removeEventListener("click",re),(0,p.AL)(),(0,p.Iy)()}}),[K,ne.current,re]),(0,d.useEffect)((function(){var e,t=function(e){e.preventDefault(),e.clipboardData.setData("text",window.getSelection().toString())};return null===(e=ne.current)||void 0===e||e.addEventListener("copy",t),function(){var e;null===(e=ne.current)||void 0===e||e.removeEventListener("copy",t)}}),[ne.current]),(0,_.jsxs)(_.Fragment,{children:[c&&(0,_.jsx)("div",{ref:ne,children:K}),!c&&(0,_.jsx)("div",{ref:ne,style:a()({},v),className:"".concat(r||""," ").concat(Z?"disabled-fill":""," markdown-body ").concat(W.current),dangerouslySetInnerHTML:{__html:K}}),(0,_.jsx)(g.Z,{close:!0,data:B,type:null!=B&&B.length?D:"",style:a()({},E),onClose:function(){return z("")}})]})}},21036:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(87381),a="ldsRing___mpBZC",c="idsRingWrapper___Of9_n",i=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,i.jsxs)("div",{className:"custom-spinner ".concat(c," ").concat(n),children:[(0,i.jsxs)("div",{className:a,children:[(0,i.jsx)("div",{}),(0,i.jsx)("div",{}),(0,i.jsx)("div",{}),(0,i.jsx)("div",{})]}),t?(0,i.jsx)("p",{style:l,children:t}):null,o,(0,i.jsx)(r.Outlet,{})]})}},84143:function(e,t,n){n.d(t,{Z:function(){return p}});n(59301);var r="result___gu5zt",a="title___xrnx2",c="left___IAxp9",i="leftNode___HL8fG",o="right___ZXYmw",s="rightNode___jYL5_",l=n(92310),u=n.n(l),d=n(37712),p=function(e){var t=e.className,n=e.style,l=void 0===n?{}:n,p=e.leftNode,f=e.leftTitle,h=void 0===f?"自测输入":f,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:a,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:i,children:p})]}),(0,d.jsxs)("div",{className:o,children:[(0,d.jsxs)("div",{className:a,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})]})]})}},78642:function(e,t,n){n.r(t),n.d(t,{default:function(){return y}});var r=n(7557),a=n.n(r),c=n(41498),i=n.n(c),o=n(79800),s=n.n(o),l=n(59301),u=n(61550),d=n(22805),p=n(87381),f=n(71418),h=n(23868),v=n(21150),m=n(17568),x=n(24334),g=n(61186),_=n.n(g),j=n(37712),y=function(){var e=(0,p.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,p.useLocation)(),33);var y=(0,p.useLocation)();(0,l.useEffect)((function(){return(0,p.getDvaApp)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),(0,p.getDvaApp)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),function(){(0,p.getDvaApp)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),(0,p.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=i()(a()().mark((function e(){var n;return a()().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,w=b.created_at,C=b.code,N=b.name,Z=b.language,I=b.pass_sets_count,O=b.set_count,A=b.error_msg,S=b.output,k=b.input,T=b.expected_output,L=(b.execute_memory,b.user),R=b.execute_time,P=b.input_file_url,M=b.output_file_url,B=b.is_file,z=b.expected_output_file_url;return(0,j.jsx)(f.Z,{spinning:!o,delay:500,children:(0,j.jsx)("div",{className:"record-detail-info",children:o?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("header",{className:u.Z.header,children:[(0,j.jsxs)("div",{children:[(0,j.jsx)("img",{src:"".concat(d.Z.IMG_SERVER,"/images/").concat(L.image_url),alt:"user",width:30}),(0,j.jsx)("span",{children:L.name})]}),(0,j.jsxs)("h2",{children:[" ",N," "]}),(0,j.jsx)("button",{className:"ant-btn",onClick:function(){var e;p.history.push("/problems/".concat(n,"/oj/").concat(null==y||null===(e=y.query)||void 0===e?void 0:e.backId,"?tab=1"))},style:{border:"1px solid #bacffe",color:"#3061d0"},children:"返回该题"})]}),(0,j.jsxs)("div",{className:"record-detail-body",children:[(0,j.jsx)("h2",{children:" 提交记录 "}),(0,j.jsxs)("ul",{className:"record-info",children:[(0,j.jsxs)("li",{children:[" 状态:",(0,j.jsx)("span",{className:0===E?"c-green":"c-red",children:v.Im[E]})," "]}),(0,j.jsxs)("li",{children:[" 提交时间:",(0,j.jsx)("span",{children:_()(w).format("YYYY-MM-DD HH:mm:ss")})," "]}),(0,j.jsxs)("li",{children:[" 语言:",(0,j.jsx)("span",{children:Z})," "]}),(0,j.jsxs)("li",{children:[" 执行用时:",(0,j.jsxs)("span",{children:[1e3*R,"ms"]})," "]}),(0,j.jsxs)("li",{children:[" ","".concat(I," / ").concat(O," 个通过的测试用例")," "]})]}),(0,v.gZ)({status:E,error_msg:A,execute_time:R,output:S,input:k,expected_output:T,input_file_url:P,output_file_url:M,is_file:B,expected_output_file_url:z}),(0,j.jsx)("h2",{children:" 提交的内容 "}),(0,j.jsx)(m.ZP,{height:"200px",width:"100%",language:null==Z?void 0:Z.toLocaleLowerCase(),value:x.Base64.decode(C),options:{readOnly:!0}})]})]}):null})})}},21150:function(e,t,n){n.d(t,{Im:function(){return N},ZP:function(){return k},gZ:function(){return A}});var r=n(79800),a=n.n(r),c=n(82242),i=n.n(c),o=n(85573),s=n.n(o),l=n(59301),u=n(92832),d=n(3113),p=n(18290),f=n(88551),h=n(78640),v=n(24334),m=n(21036),x=n(47245),g=n(69824),_=n(84143),j=n(34376),y=n(92310),b=n.n(y),E=n(37712),w=u.Z.TextArea,C={visible:!1,tabIndex:"0"},N=s()(s()(s()(s()(s()(s()({},h.h.NOMATCH,"测试用例结果不匹配"),h.h.OK,"调试通过"),2,"调试超时"),3,"调试pod失败"),4,"编译失败"),5,"执行失败"),Z=function(e){return e[e.SET_VISIBLE=0]="SET_VISIBLE",e[e.SET_TABINDEX=1]="SET_TABINDEX",e}(Z||{});function I(e,t){switch(t.type){case Z.SET_VISIBLE:return i()(i()({},e),{},{visible:t.payload});case Z.SET_TABINDEX:return i()(i()({},e),{},{tabIndex:t.payload});default:throw new Error}}function O(e){var t=e.value,n=e.className,r=(0,l.useState)(!1),c=a()(r,2),i=c[0],o=c[1],s=(0,l.useRef)(),u=(0,l.useRef)();return(0,l.useEffect)((function(){i&&(u.current.reset(),u.current.write((0,g.pp)(t||"")))}),[t,i]),(0,l.useEffect)((function(){if(s.current){var e;u.current=new j.Terminal({fontSize:14,disableStdin:!0}),u.current.open(s.current);var t=s.current.offsetWidth-14,n=(null===(e=u.current)||void 0===e||null===(e=e._core)||void 0===e||null===(e=e._renderService)||void 0===e||null===(e=e.dimensions)||void 0===e?void 0:e.actualCellWidth)||9.5,r=Math.ceil(t/n);u.current.resize(r,8),o(!0)}}),[]),(0,E.jsx)("div",{ref:s,className:b()("XtermText-valueRef",n)})}function A(e){var t=e.status,n=e.error_msg,r=e.output,a=e.input,c=e.expected_output,i=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,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("p",{className:"c-red",children:"实际输入:"}),!i&&(0,E.jsx)(O,{className:"mb10",value:a}),i&&(0,E.jsx)("div",{style:d,children:(0,E.jsx)("a",{onClick:function(){return(0,g.LR)(o,a)},children:a})}),(0,E.jsx)("p",{className:"c-red",children:"实际输出:"}),!i&&(0,E.jsx)(O,{className:"mb10",value:r&&v.Base64.decode(r)||""}),i&&(0,E.jsx)("div",{style:d,children:(0,E.jsx)("a",{onClick:function(){return(0,g.LR)(s,r)},children:r})}),(0,E.jsx)("p",{className:"c-red",children:"预期输出:"}),!i&&(0,E.jsx)(O,{className:"mb10",value:c&&v.Base64.decode(c)||""}),i&&(0,E.jsx)("div",{style:d,children:(0,E.jsx)("a",{onClick:function(){return(0,g.LR)(l,c)},children:c})})]});break;case h.h.EXECUTEFAILURE:case h.h.COMPILEFAILURE:u=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("p",{children:"最后执行的输入:"}),!i&&(0,E.jsx)(x.Z,{value:a,style:d}),i&&(0,E.jsx)("div",{style:d,children:(0,E.jsx)("a",{onClick:function(){return(0,g.LR)(o,a)},children:a})}),(0,E.jsx)("p",{children:"执行出错信息:"}),(0,E.jsx)("pre",{className:"error",children:v.Base64.decode(n)})]});break;case h.h.PODFAILURE:u=(0,E.jsx)("p",{children:"创建pod失败请稍后重试"});break;case h.h.TIMEOUT:u=(0,E.jsx)("p",{children:"评测超时,请稍后重试"})}return(0,E.jsxs)(E.Fragment,{children:[" ",u," "]})}function S(e){var t=e.status,n=e.error_msg,r=e.execute_time,a=e.output,c=e.input,i=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,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("p",{children:["执行用时:",r,"秒"]}),(0,E.jsx)("p",{children:"执行结果:"}),(0,E.jsx)("pre",{children:v.Base64.decode(a)})]});break;case h.h.NOMATCH:o=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("p",{children:["输入:",(0,E.jsx)("pre",{children:c})]}),(0,E.jsxs)("p",{children:["输出:",a&&v.Base64.decode(a)]}),(0,E.jsxs)("p",{children:["预期输出:",i&&v.Base64.decode(i)]})]});break;case h.h.EXECUTEFAILURE:case h.h.COMPILEFAILURE:o=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("p",{children:["最后执行的输入:",(0,E.jsx)("pre",{children:c})]}),(0,E.jsx)("p",{children:"执行出错信息:"}),(0,E.jsx)("pre",{className:"error",children:v.Base64.decode(n)})]});break;case h.h.PODFAILURE:o=(0,E.jsx)("p",{children:"创建pod失败请稍后重试"});break;case h.h.TIMEOUT:o=(0,E.jsx)("p",{children:"评测超时,请稍后重试"})}return(0,E.jsxs)(E.Fragment,{children:[" ",o," "]})}var k=function(e){var t=e.id,n=e.is_file,r=e.input,c=e.debuging,i=e.submitting,o=(e.executingMessage,e.debugResult),s=e.onChangeInput,u=e.onDebugCode,h=e.onSubmitCode,v=(0,l.useReducer)(I,C),x=a()(v,2),g=x[0],j=x[1],y=g.visible;g.tabIndex;(0,l.useEffect)((function(){j({type:Z.SET_VISIBLE,payload:!1})}),[t]);var b=(0,l.useMemo)((function(){if(o){o.status;return(0,E.jsx)(E.Fragment,{children:S(o)})}return null}),[o]);return(0,E.jsxs)("div",{className:"test-case-panel",children:[(0,E.jsxs)("div",{className:"test-case-panel-body ".concat(y?"active":""),children:[(0,E.jsx)("ul",{className:"s-navs",children:(0,E.jsx)("li",{children:(0,E.jsx)("a",{className:"active",children:"调试代码结果"})})}),(0,E.jsx)(_.Z,{leftTitle:"自定义测试用例",rightTitle:"代码执行结果",style:{height:240},leftNode:(0,E.jsx)(w,{placeholder:"请输入自测用例(如果未填写,首次自测运行时,系统会自动填充第一个非隐藏的文本类型的测试用例)",value:n?"":r,onChange:s}),rightNode:c?(0,E.jsx)(m.Z,{message:"代码执行中..."}):o?b:(0,E.jsx)("p",{style:{color:"#536879"},children:"请填写测试用例的输入值,点击“调试代码”"})})]}),(0,E.jsx)("a",{className:"btn-collapse ".concat(y?"up":""),onClick:function(){j({type:Z.SET_VISIBLE,payload:!y})},children:y?(0,E.jsx)(p.Z,{}):(0,E.jsx)(f.Z,{})}),(0,E.jsxs)("footer",{className:"footer",children:[(0,E.jsx)("span",{style:{visibility:"hidden"},children:"控制台"}),(0,E.jsxs)("div",{className:"flex-container",children:[(0,E.jsx)(d.ZP,{id:"oj-prev",className:"btn-blue",type:"ghost",children:"上一题"}),(0,E.jsx)(d.ZP,{id:"oj-next",className:"btn-blue",type:"ghost",children:"下一题"}),(0,E.jsx)(d.ZP,{className:"btn-green",type:"ghost",loading:c,onClick:function(){j({type:Z.SET_VISIBLE,payload:!0}),j({type:Z.SET_TABINDEX,payload:"1"}),u()},children:"调试代码"}),(0,E.jsx)(d.ZP,{type:"primary",className:"custom-ant-disabled",loading:i,disabled:i,onClick:function(){j({type:Z.SET_VISIBLE,payload:!1}),h()},children:"评测并提交"})]})]})]})}},78640:function(e,t,n){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}({})},23868:function(e,t,n){n.d(t,{H7:function(){return d},KC:function(){return m},M3:function(){return j},MK:function(){return u},MU:function(){return i},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 C},fi:function(){return p},fu:function(){return a},gu:function(){return _},n4:function(){return f},qe:function(){return b},rL:function(){return w},rX:function(){return l},uc:function(){return N},vl:function(){return v},wO:function(){return y},zO:function(){return o}});var r=n(5219);function a(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 i(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 p(e,t){return(0,r.v_)("mypractices/".concat(e,"/sync_code.json"),t)}function f(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 j(e,t){return(0,r.U2)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active,"/edit"),t)}function y(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 w(e,t){return(0,r.v_)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active,"/hide"))}function C(e,t){return(0,r.IV)("practices/".concat(e,"/question_solution_articles/").concat(null==t?void 0:t.active),t)}function N(e,t){return(0,r.v_)("mypractices/".concat(e,"/update_practice_time_sum"),t)}},90034:function(e,t,n){n.d(t,{AL:function(){return b},Iy:function(){return p},Qv:function(){return v},ez:function(){return y},jb:function(){return f}});var r=n(79800),a=n.n(r),c=n(32834),i=n.n(c),o=n(11690);var s=[],l=["<ul>"],u=new(i().Renderer),d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function p(){s.length=0,l=["<ul>"]}var f={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 a=e[t];r.push("<li><a href='#"+a.anchor+"'>"+a.text+"</a>");var c=[];return t=h(e,++t,a.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:a()(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 i=_(),o=r;r=i,j[i]={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++,"__")},j={};function y(){return j}function b(){g=0,j={}}function E(e){return e=e.replace(x,(function(e,t){var n=_();return j[n]={type:"inline",expression:t},n}))}var w=u.listitem;u.listitem=function(e){return w(E(e))};var C=u.paragraph;u.paragraph=function(e){return C(E(e))};var N=u.tablecell;u.tablecell=function(e,t){return N(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+">"},i().setOptions({silent:!0,gfm:!0,pedantic:!1}),i().use({tokenizer:m,renderer:u}),t.ZP=i()},61550:function(e,t){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"}},92832:function(e,t,n){n.d(t,{Z:function(){return O}});var r=n(92310),a=n.n(r),c=n(59301),i=n(36355),o=n(32441),s=n(9937);var l=e=>{const{getPrefixCls:t,direction:n}=(0,c.useContext)(i.E_),{prefixCls:r,className:l}=e,u=t("input-group",r),d=t("input"),[p,f]=(0,s.ZP)(d),h=a()(u,{[`${u}-lg`]:"large"===e.size,[`${u}-sm`]:"small"===e.size,[`${u}-compact`]:e.compact,[`${u}-rtl`]:"rtl"===n},f,l),v=(0,c.useContext)(o.aM),m=(0,c.useMemo)((()=>Object.assign(Object.assign({},v),{isFormItemInput:!1})),[v]);return p(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(61441),p=n(30631),f=n(45115),h=n(35648),v=n(59412),m=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 a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n};const x=e=>e?c.createElement(p.Z,null):c.createElement(d.Z,null),g={click:"onClick",hover:"onMouseOver"};var _=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,v.Z)(l),p=()=>{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:_,prefixCls:j,inputPrefixCls:y,size:b}=e,E=m(e,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:w}=c.useContext(i.E_),C=w("input",y),N=w("input-password",j),Z=n&&(t=>{const{action:n="click",iconRender:r=x}=e,a=g[n]||"",i=r(o),s={[a]:p,className:`${t}-icon`,key:"passwordIcon",onMouseDown:e=>{e.preventDefault()},onMouseUp:e=>{e.preventDefault()}};return c.cloneElement(c.isValidElement(i)?i:c.createElement("span",null,i),s)})(N),I=a()(N,_,{[`${N}-${b}`]:!!b}),O=Object.assign(Object.assign({},(0,f.Z)(E,["suffix","iconRender","visibilityToggle"])),{type:o?"text":"password",className:I,prefixCls:C,suffix:Z});return b&&(O.size=b),c.createElement(u.Z,Object.assign({ref:(0,h.sQ)(t,l)},O))})),j=n(21970),y=n(92343),b=n(3113),E=n(19716),w=n(33234),C=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 a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n};var N=c.forwardRef(((e,t)=>{const{prefixCls:n,inputPrefixCls:r,className:o,size:s,suffix:l,enterButton:d=!1,addonAfter:p,loading:f,disabled:v,onSearch:m,onChange:x,onCompositionStart:g,onCompositionEnd:_}=e,N=C(e,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:Z,direction:I}=c.useContext(i.E_),O=c.useRef(!1),A=Z("input-search",n),S=Z("input",r),{compactSize:k}=(0,w.ri)(A,I),T=(0,E.Z)((e=>{var t;return null!==(t=null!=s?s:k)&&void 0!==t?t:e})),L=c.useRef(null),R=e=>{var t;document.activeElement===(null===(t=L.current)||void 0===t?void 0:t.input)&&e.preventDefault()},P=e=>{var t,n;m&&m(null===(n=null===(t=L.current)||void 0===t?void 0:t.input)||void 0===n?void 0:n.value,e,{source:"input"})},M="boolean"==typeof d?c.createElement(j.Z,null):null,B=`${A}-button`;let z;const F=d||{},U=F.type&&!0===F.type.__ANT_BUTTON;z=U||"button"===F.type?(0,y.Tm)(F,Object.assign({onMouseDown:R,onClick:e=>{var t,n;null===(n=null===(t=null==F?void 0:F.props)||void 0===t?void 0:t.onClick)||void 0===n||n.call(t,e),P(e)},key:"enterButton"},U?{className:B,size:T}:{})):c.createElement(b.ZP,{className:B,type:d?"primary":void 0,size:T,disabled:v,key:"enterButton",onMouseDown:R,onClick:P,loading:f,icon:M},d),p&&(z=[z,(0,y.Tm)(p,{key:"addonAfter"})]);const D=a()(A,{[`${A}-rtl`]:"rtl"===I,[`${A}-${T}`]:!!T,[`${A}-with-button`]:!!d},o);return c.createElement(u.Z,Object.assign({ref:(0,h.sQ)(L,t),onPressEnter:e=>{O.current||f||P(e)}},N,{size:T,onCompositionStart:e=>{O.current=!0,null==g||g(e)},onCompositionEnd:e=>{O.current=!1,null==_||_(e)},prefixCls:S,addonAfter:z,suffix:l,onChange:e=>{e&&e.target&&"click"===e.type&&m&&m(e.target.value,e,{source:"clear"}),x&&x(e)},className:D,disabled:v}))})),Z=n(1643);const I=u.Z;I.Group=l,I.Search=N,I.TextArea=Z.Z,I.Password=_;var O=I}}]);