/*! * Stockfish.js 18 (c) 2026, Chess.com, LLC * https://github.com/nmrugg/stockfish.js * License: GPLv3 * * Based on Stockfish (c) T. Romstad, M. Costalba, J. Kiiski, G. Linscott and other contributors. * https://github.com/official-stockfish/Stockfish * * Nets by Linmiao Xu (linrock) * https://tests.stockfishchess.org/nns?network_name=nn-9067e33176e */!function(){var u,s,e,c,r,n,l=7295411;function t(){function e(e){e=e||{},(f=f||(void 0!==e?e:{})).ready=new Promise(function(e,n){j=e,a=n}),"undefined"!=typeof global&&"[object process]"===Object.prototype.toString.call(global.process)&&"undefined"!=typeof fetch&&("undefined"==typeof XMLHttpRequest&&(global.XMLHttpRequest=function(){var t,r={open:function(e,n){t=n},send:function(){require("fs").readFile(t,function(e,n){r.readyState=4,e?(console.error(e),r.status=404,r.onerror(e)):(r.status=200,r.response=n,r.onreadystatechange(),r.onload())})}};return r}),fetch=null),f.print=function(e){f.listener?f.listener(e):console.log(e)},f.printErr=function(e){f.listener?f.listener(e):console.error(e)},f.terminate=function(){"undefined"!=typeof PThread&&PThread.Z()};var f,j,a,n,t,H,r,k,i,o=Object.assign({},f),u=[],s="./this.program",c=(e,n)=>{throw n},U="object"==typeof window,l="function"==typeof importScripts,W="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,p="",L=(W?(p=l?require("path").dirname(p)+"/":__dirname+"/",k=()=>{r||(H=require("fs"),r=require("path"))},n=function(e,n){return k(),e=r.normalize(e),H.readFileSync(e,n?void 0:"utf8")},t=e=>e=(e=n(e,!0)).buffer?e:new Uint8Array(e),1{if(m||0<_)throw process.exitCode=e,n;n instanceof Y||d("exiting due to exception: "+n),process.exit(e)},f.inspect=function(){return"[Emscripten Module object]"}):(U||l)&&(l?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),p=0!==(p=je?je:p).indexOf("blob:")?p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1):"",n=e=>{var n=new XMLHttpRequest;return n.open("GET",e,!1),n.send(null),n.responseText},l)&&(t=e=>{var n=new XMLHttpRequest;return n.open("GET",e,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}),f.print||console.log.bind(console)),d=f.printErr||console.warn.bind(console),m=(Object.assign(f,o),f.arguments&&(u=f.arguments),f.thisProgram&&(s=f.thisProgram),f.quit&&(c=f.quit),f.wasmBinary&&(i=f.wasmBinary),f.noExitRuntime||!0);"object"!=typeof WebAssembly&&A("no native wasm support detected");var q,B,h,y,g,N,v=!1,K="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function X(e,n,t){var r=n+t;for(t=n;e[t]&&!(r<=t);)++t;if(16>10,56320|1023&i)))):r+=String.fromCharCode(i)}return r}function z(e){return e?X(y,e,void 0):""}function G(e,n,t,r){if(0>6}else{if(a<=65535){if(r<=t+2)break;n[t++]=224|a>>12}else{if(r<=t+3)break;n[t++]=240|a>>18,n[t++]=128|a>>12&63}n[t++]=128|a>>6&63}n[t++]=128|63&a}}n[t]=0}}function V(e){for(var n=0,t=0;t{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now(),fe=[];function pe(e){if(!te&&!v)try{e()}catch(e){ue(e)}}var de,me={};function he(){if(!de){var e,n={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:s||"./this.program"};for(e in me)void 0===me[e]?delete n[e]:n[e]=me[e];var t=[];for(e in n)t.push(e+"="+n[e]);de=t}return de}function M(e){return 0==e%4&&(0!=e%100||0==e%400)}function ye(e,n){for(var t=0,r=0;r<=n;t+=e[r++]);return t}var x=[31,29,31,30,31,30,31,31,30,31,30,31],R=[31,28,31,30,31,30,31,31,30,31,30,31];function C(e,n){for(e=new Date(e.getTime());0r-e.getDate())){e.setDate(e.getDate()+n);break}n-=r-e.getDate()+1,e.setDate(1),t<11?e.setMonth(t+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}function ge(e,n,t,r){function o(e,n,t){for(e="number"==typeof e?e.toString():e||"";e.length>2];for(c in r={V:g[r>>2],U:g[r+4>>2],M:g[r+8>>2],L:g[r+12>>2],K:g[r+16>>2],A:g[r+20>>2],N:g[r+24>>2],O:g[r+28>>2],$:g[r+32>>2],T:g[r+36>>2],W:l?z(l):""},t=z(t),l={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})t=t.replace(new RegExp(c,"g"),l[c]);var f,p,d="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),m="January February March April May June July August September October November December".split(" "),l={"%a":function(e){return d[e.N].substring(0,3)},"%A":function(e){return d[e.N]},"%b":function(e){return m[e.K].substring(0,3)},"%B":function(e){return m[e.K]},"%C":function(e){return a((e.A+1900)/100|0,2)},"%d":function(e){return a(e.L,2)},"%e":function(e){return o(e.L,2," ")},"%g":function(e){return s(e).toString().substring(2)},"%G":s,"%H":function(e){return a(e.M,2)},"%I":function(e){return 0==(e=e.M)?e=12:12n?0:(h.set(c,e),c.length-1)}function F(e){try{e()}catch(e){A(e)}}var E=0,O=null,T=[],ve={},we={},_e=0,be=null,Se=[];function Ae(t){var e,r={};for(e in t)!function(e){var n=t[e];r[e]="function"==typeof n?function(){T.push(e);try{return n.apply(null,arguments)}finally{v||(T.pop()!==e&&A(void 0),O&&1===E&&0===T.length&&(E=0,F(f._asyncify_stop_unwind),"undefined"!=typeof Fibers)&&Fibers.aa())}}:n}(e);return r}function De(e){var o,a,n,t;v||(0===E?(a=o=!1,e(()=>{if(!v&&(o=!0,a)){E=2,F(()=>f._asyncify_start_rewind(O)),"undefined"!=typeof Browser&&Browser.R.S&&Browser.R.resume();var n=!1;try{var t=(0,f.asm[we[g[O+8>>2]]])()}catch(e){t=e,n=!0}var e,r=!1;if(O||(e=be)&&(be=null,(n?e.reject:e.resolve)(t),r=!0),n&&!r)throw t}}),a=!0,o||(E=1,e=Ce(10485772),n=e+12,g[e>>2]=n,g[e+4>>2]=n+10485760,n=T[0],void 0===(t=ve[n])&&(t=_e++,ve[n]=t,we[t]=n),g[e+8>>2]=t,O=e,F(()=>f._asyncify_start_unwind(O)),"undefined"!=typeof Browser&&Browser.R.S&&Browser.R.pause())):2===E?(E=0,F(f._asyncify_stop_rewind),xe(O),O=null,Se.forEach(e=>pe(e))):A("invalid state: "+E))}var I,Me={d:function(){return 0},i:function(){},r:function(){return 0},f:function(){},a:function(){A("")},g:function(e,n){if(0===e)e=Date.now();else{if(1!==e&&4!==e)return g[Re()>>2]=28,-1;e=le()}return g[n>>2]=e/1e3|0,g[n+4>>2]=e%1e3*1e6|0,0},j:function(e,n,t){var r;for(fe.length=0,t>>=2;r=y[n++];)(r=r<105)&&1&t&&t++,fe.push(r?N[t++>>1]:g[t]),++t;return ie[e].apply(null,fe)},h:function(e,n,t){y.copyWithin(e,n,n+t)},c:function(e){var n=y.length;if(!(2147483648<(e>>>=0)))for(var t=1;t<=4;t*=2){var r=n*(1+.2/t),r=Math.min(r,e+100663296),o=Math;r=Math.max(e,r),o=o.min.call(o,2147483648,r+(65536-r%65536)%65536);e:{try{q.grow(o-B.byteLength+65535>>>16),Z();var a=1;break e}catch(e){}a=void 0}if(a)return!0}return!1},k:function(t){De(e=>{return n=e,setTimeout(function(){pe(n)},t);var n})},n:function(r,o){var a=0;return he().forEach(function(e,n){var t=o+a;for(n=g[r+4*n>>2]=t,t=0;t>0]=e.charCodeAt(t);h[n>>0]=0,a+=e.length+1}),0},o:function(e,n){var t=he(),r=(g[e>>2]=t.length,0);return t.forEach(function(e){r+=e.length+1}),g[n>>2]=r,0},b:function(e){Pe(e)},e:function(){return 0},q:function(e,n,t,r){return e=ce.Y(e),n=ce.X(e,n,t),g[r>>2]=n,0},l:function(){},p:function(e,n,t,r){for(var o=0,a=0;a>2],u=g[n+4>>2];n+=8;for(var s=0;s>2]=o,0},m:ge},xe=(!function(){function n(e){e=Ae(e=e.exports),f.asm=e,q=f.asm.s,Z(),Q.unshift(f.asm.t),b--,f.monitorRunDependencies&&f.monitorRunDependencies(b),0==b&&(null!==re&&(clearInterval(re),re=null),S)&&(e=S,S=null,e())}function t(e){n(e.instance)}function r(e){return(i||!U&&!l||"function"!=typeof fetch?Promise.resolve().then(ae):fetch(w,{credentials:"same-origin"}).then(function(e){if(e.ok)return e.arrayBuffer();throw"failed to load wasm binary file at '"+w+"'"}).catch(ae)).then(function(e){return WebAssembly.instantiate(e,o)}).then(function(e){return e}).then(e,function(e){d("failed to asynchronously prepare wasm: "+e),A(e)})}var o={a:Me};if(b++,f.monitorRunDependencies&&f.monitorRunDependencies(b),f.instantiateWasm)try{var e=f.instantiateWasm(o,n);return Ae(e)}catch(e){return d("Module.instantiateWasm callback failed with error: "+e)}(i||"function"!=typeof WebAssembly.instantiateStreaming||oe()||"function"!=typeof fetch?r(t):fetch(w,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,o).then(t,function(e){return d("wasm streaming compile failed: "+e),d("falling back to ArrayBuffer instantiation"),r(t)})})).catch(a)}(),f.___wasm_call_ctors=function(){return(f.___wasm_call_ctors=f.asm.t).apply(null,arguments)},f._main=function(){return(f._main=f.asm.u).apply(null,arguments)},f._command=function(){return(f._command=f.asm.v).apply(null,arguments)},f._isSearching=function(){return(f._isSearching=f.asm.w).apply(null,arguments)},f._free=function(){return(xe=f._free=f.asm.x).apply(null,arguments)}),Re=f.___errno_location=function(){return(Re=f.___errno_location=f.asm.y).apply(null,arguments)},Ce=f._malloc=function(){return(Ce=f._malloc=f.asm.z).apply(null,arguments)},Fe=f.stackSave=function(){return(Fe=f.stackSave=f.asm.B).apply(null,arguments)},Ee=f.stackRestore=function(){return(Ee=f.stackRestore=f.asm.C).apply(null,arguments)},P=f.stackAlloc=function(){return(P=f.stackAlloc=f.asm.D).apply(null,arguments)},Oe=f.dynCall_vi=function(){return(Oe=f.dynCall_vi=f.asm.E).apply(null,arguments)},Te=f.dynCall_v=function(){return(Te=f.dynCall_v=f.asm.F).apply(null,arguments)};function Y(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Ie(a){function e(){if(!I&&(I=!0,f.calledRun=!0,!v)){if(D(Q),D(ee),j(f),f.onRuntimeInitialized&&f.onRuntimeInitialized(),Ye){var e=a,n=f._main,t=(e=e||[]).length+1,r=P(4*(t+1));g[r>>2]=J(s);for(var o=1;o>2)+o]=J(e[o-1]);g[(r>>2)+t]=0;try{Pe(n(t,r))}catch(e){ue(e)}}if(f.postRun)for("function"==typeof f.postRun&&(f.postRun=[f.postRun]);f.postRun.length;)e=f.postRun.shift(),ne.unshift(e);D(ne)}}if(a=a||u,!(0{be={resolve:e,reject:n}}).then(a):(r=a(r),o?Promise.resolve(r):r)},S=function e(){I||Ie(),I||(S=e)},f.run=Ie,f.preInit)for("function"==typeof f.preInit&&(f.preInit=[f.preInit]);0