window.chesscom=window.chesscom||{};window.chesscom.routes=window.chesscom.routes||{};Object.assign(window.chesscom.routes,{web_2fa_login:{tokens:[["text","/2fa"]],defaults:{host:"www.chess.com"},requirements:{host:"(www|schach|ru|uk|ajedrez|fr|scacchi|sakk|schaken|szachy)?(\\.)?[^\\s]+",_locale:"af_ZA|ar_AR|az_AZ|be_BY|bg_BG|bn_BD|bs_BA|ca|cs_CZ|da_DK|de_DE|el_GR|en_US|es_ES|et_EE|eu_ES|fa_IR|fi_FI|fil_PH|fr_FR|gl_ES|he_IL|hi_IN|hr_HR|hu_HU|hy_AM|id_ID|is_IS|it_IT|ja_JP|ka_GE|ko_KR|lt_LT|lv_LV|nl_BE|ms_MY|nl_NL|no_NO|pl_PL|pt_BR|pt_PT|ro_RO|ru_RU|sk_SK|sl_SI|sq_AL|sr_RS|sv_SE|tk_TM|tr_TR|uk_UA|ur_PK|vi_VN|zh_CN|zh_HK|zh_TW"},hosttokens:[["variable","","(?:www|schach|ru|uk|ajedrez|fr|scacchi|sakk|schaken|szachy)?(?:\\.)?[^\\s]+","host",!0]],methods:[],schemes:["https"]},i18n_web_2fa_login:{tokens:[["text","/2fa"],["variable","/","es|fr|de|pl|ru|sv|el|pt|it|zh|ja|ko|nl|hy|bg|hr|cs|da|fi|hu|lt|no|ro|sk|sl|tr|uk|af|ar|az|be|bs|et|fa|gl|he|hi|id|is|ka|lv|ms|pt-BR|sq|sr|vi|zh-HK|zh-TW|fil|nl-BE|bn|tk|uz|ca|ur|--locale--","_locale",!0]],defaults:{host:"www.chess.com",_locale:""},requirements:{host:"(www|schach|ru|uk|ajedrez|fr|scacchi|sakk|schaken|szachy)?(\\.)?[^\\s]+",_locale:"es|fr|de|pl|ru|sv|el|pt|it|zh|ja|ko|nl|hy|bg|hr|cs|da|fi|hu|lt|no|ro|sk|sl|tr|uk|af|ar|az|be|bs|et|fa|gl|he|hi|id|is|ka|lv|ms|pt-BR|sq|sr|vi|zh-HK|zh-TW|fil|nl-BE|bn|tk|uz|ca|ur|--locale--"},hosttokens:[["variable","","(?:www|schach|ru|uk|ajedrez|fr|scacchi|sakk|schaken|szachy)?(?:\\.)?[^\\s]+","host",!0]],methods:[],schemes:["https"]}});(("undefined"!=typeof self?self:this).wpChessCom_dvZK=("undefined"!=typeof self?self:this).wpChessCom_dvZK||[]).push([[9833],{37634:function(e,t){var n,r,s;!function(o,i){r=[],void 0!==(s="function"==typeof(n=i().Routing)?n.apply(t,r):n)&&(e.exports=s)}(0,function(){var e={};"use strict";e.__esModule=!0;e.Routing=e.Router=void 0;var t=function(){function Router2(e,t){this.context_=e||{base_url:"",prefix:"",host:"",port:"",scheme:"",locale:""};this.setRoutes(t||{})}return Router2.getInstance=function(){return e.Routing},Router2.setData=function(e){Router2.getInstance().setRoutingData(e)},Router2.prototype.setRoutingData=function(e){this.setBaseUrl(e.base_url);this.setRoutes(e.routes);void 0!==e.prefix&&this.setPrefix(e.prefix);void 0!==e.port&&this.setPort(e.port);void 0!==e.locale&&this.setLocale(e.locale);this.setHost(e.host);void 0!==e.scheme&&this.setScheme(e.scheme)},Router2.prototype.setRoutes=function(e){this.routes_=Object.freeze(e)},Router2.prototype.getRoutes=function(){return this.routes_},Router2.prototype.setBaseUrl=function(e){this.context_.base_url=e},Router2.prototype.getBaseUrl=function(){return this.context_.base_url},Router2.prototype.setPrefix=function(e){this.context_.prefix=e},Router2.prototype.setScheme=function(e){this.context_.scheme=e},Router2.prototype.getScheme=function(){return this.context_.scheme},Router2.prototype.setHost=function(e){this.context_.host=e},Router2.prototype.getHost=function(){return this.context_.host},Router2.prototype.setPort=function(e){this.context_.port=e},Router2.prototype.getPort=function(){return this.context_.port},Router2.prototype.setLocale=function(e){this.context_.locale=e},Router2.prototype.getLocale=function(){return this.context_.locale},Router2.prototype.buildQueryParams=function(e,t,n){var r,s=this,o=new RegExp(/\[\]$/);if(t instanceof Array)t.forEach(function(t,r){o.test(e)?n(e,t):s.buildQueryParams(e+"["+("object"==typeof t?r:"")+"]",t,n)});else if("object"==typeof t)for(r in t)this.buildQueryParams(e+"["+r+"]",t[r],n);else n(e,t)},Router2.prototype.getRoute=function(e){var t=[this.context_.prefix+e,e+"."+this.context_.locale,this.context_.prefix+e+"."+this.context_.locale,e];for(var n in t)if(t[n]in this.routes_)return this.routes_[t[n]];throw Error('The route "'+e+'" does not exist.')},Router2.prototype.generate=function(e,t,n){var r=this.getRoute(e),s=t||{},o=Object.assign({},s),i="",a=!0,c="",u=void 0===this.getPort()||null===this.getPort()?"":this.getPort();r.tokens.forEach(function(t){if("text"===t[0]&&"string"==typeof t[1]){i=Router2.encodePathComponent(t[1])+i;a=!1;return}if("variable"===t[0]){6===t.length&&!0===t[5]&&(a=!1);var n=r.defaults&&!Array.isArray(r.defaults)&&"string"==typeof t[3]&&t[3]in r.defaults;if(!1===a||!n||"string"==typeof t[3]&&t[3]in s&&!Array.isArray(r.defaults)&&s[t[3]]!=r.defaults[t[3]]){var c=void 0;if("string"==typeof t[3]&&t[3]in s){c=s[t[3]];delete o[t[3]]}else if("string"==typeof t[3]&&n&&!Array.isArray(r.defaults))c=r.defaults[t[3]];else if(a)return;else throw Error('The route "'+e+'" requires the parameter "'+t[3]+'".');var u=!0===c||!1===c||""===c;if(!u||!a){var l=Router2.encodePathComponent(c);"null"===l&&null===c&&(l="");i=t[1]+l+i}a=!1}else n&&"string"==typeof t[3]&&t[3]in o&&delete o[t[3]];return}throw Error('The token type "'+t[0]+'" is not supported.')});""===i&&(i="/");r.hosttokens.forEach(function(e){var t;if("text"===e[0]){c=e[1]+c;return}if("variable"===e[0]){if(e[3]in s){t=s[e[3]];delete o[e[3]]}else r.defaults&&!Array.isArray(r.defaults)&&e[3]in r.defaults&&(t=r.defaults[e[3]]);c=e[1]+t+c}});i=this.context_.base_url+i;if(r.requirements&&"_scheme"in r.requirements&&this.getScheme()!=r.requirements._scheme){var l=c||this.getHost();i=r.requirements._scheme+"://"+l+(l.indexOf(":"+u)>-1||""===u?"":":"+u)+i}else if(void 0!==r.schemes&&void 0!==r.schemes[0]&&this.getScheme()!==r.schemes[0]){var l=c||this.getHost();i=r.schemes[0]+"://"+l+(l.indexOf(":"+u)>-1||""===u?"":":"+u)+i}else c&&this.getHost()!==c+(c.indexOf(":"+u)>-1||""===u?"":":"+u)?i=this.getScheme()+"://"+c+(c.indexOf(":"+u)>-1||""===u?"":":"+u)+i:!0===n&&(i=this.getScheme()+"://"+this.getHost()+(this.getHost().indexOf(":"+u)>-1||""===u?"":":"+u)+i);if(Object.keys(o).length>0){var d=[],add=function(e,t){t=null===(t="function"==typeof t?t():t)?"":t;d.push(Router2.encodeQueryComponent(e)+"="+Router2.encodeQueryComponent(t))};for(var p in o)o.hasOwnProperty(p)&&this.buildQueryParams(p,o[p],add);i=i+"?"+d.join("&")}return i},Router2.customEncodeURIComponent=function(e){return encodeURIComponent(e).replace(/%2F/g,"/").replace(/%40/g,"@").replace(/%3A/g,":").replace(/%21/g,"!").replace(/%3B/g,";").replace(/%2C/g,",").replace(/%2A/g,"*").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/'/g,"%27")},Router2.encodePathComponent=function(e){return Router2.customEncodeURIComponent(e).replace(/%3D/g,"=").replace(/%2B/g,"+").replace(/%21/g,"!").replace(/%7C/g,"|")},Router2.encodeQueryComponent=function(e){return Router2.customEncodeURIComponent(e).replace(/%3F/g,"?")},Router2}();return e.Router=t,e.Routing=new t,e.default=e.Routing,{Router:e.Router,Routing:e.Routing}})},51578:function(e,t,n){"use strict";n.d(t,{G:function(){return refreshAds}});var r=n(43400);function refreshAds(){window.tude=window.tude||{cmd:[]};window.tude.cmd.push(()=>{window.tude?.refreshAdsViaDivMappings?.(r.h())})}},15e3:function(e,t,n){"use strict";n.r(t);n.d(t,{adsClient:function(){return p}});var r=n(51578),s=n(23618),is_2fa=()=>-1!==window.location.href.indexOf(s.A.generate("web_2fa_login"));function isLoggedIn(){return!!(window.context?.user&&!is_2fa())}function getCookie(e){let t={};return document.cookie.split("; ").forEach(e=>{let[n,r]=e.split("=");n&&r&&(t[n]=r)}),t[e]||null}function setPageTargeting(){let e=40,t=window.location.pathname.slice(1),n=t.split("/").pop(),r=window.context.user?.properties?.gam_audiences||[],s=window.chesscom.features.includes("liveramp_gam_key");r.push(isLoggedIn()?"is_logged_in":"not_logged_in");window.tude=window.tude||{cmd:[]};window.tude.cmd.push(()=>{window.tude?.setPageTargeting?.({url:t.slice(0,e),url_slug:n.slice(0,e),...r.length&&{gam_audiences:r},...s&&{liveramp_id:getCookie("_lr_env")?"true":"false"}})})}var o=n(75629);let i=3e4;function setupAdsRefreshTrigger(){setTimeout(triggerRefresh,i)}function triggerRefresh(){if(o.I.isAdsTemporarilyDisabled?.())setTimeout(triggerRefresh,i);else if(o.I.shouldNotRefreshAds?.())setTimeout(triggerRefresh,3e3);else{(0,r.G)();setTimeout(triggerRefresh,i)}}let a={skyscraper:"#sidebar-ad",leaderboardAtf:"#leaderboard-atf-ad",leaderboardBtf:"#leaderboard-btf-ad",mediumRectangleAtf:"#medium-rectangle-atf-ad",mediumRectangleBtf:"#medium-rectangle-btf-ad"},c={};document.querySelector(a.skyscraper)&&Object.assign(c,{[a.skyscraper]:()=>Promise.all([n.e(1655),n.e(702)]).then(n.bind(n,12497))});document.querySelector(a.leaderboardAtf)&&Object.assign(c,{[a.leaderboardAtf]:()=>n.e(8630).then(n.bind(n,16527))});document.querySelector(a.leaderboardBtf)&&Object.assign(c,{[a.leaderboardBtf]:()=>n.e(2187).then(n.bind(n,63513))});document.querySelector(a.mediumRectangleAtf)&&Object.assign(c,{[a.mediumRectangleAtf]:()=>n.e(5920).then(n.bind(n,51312))});document.querySelector(a.mediumRectangleBtf)&&Object.assign(c,{[a.mediumRectangleBtf]:()=>n.e(2769).then(n.bind(n,56502))});var u=n(15591),l=n(43400);function getPromises(){return window.chesscom.promises||(window.chesscom.promises={}),window.chesscom.promises}function execAndCache({id:e,promise:t,ttl:n}){let r=getPromises();if(!r[e]){r[e]=new Promise((e,n)=>{t().then(e).catch(n)});"number"==typeof n&&setTimeout(()=>{invalidatePromise(e)},n)}return r[e]}function invalidatePromise(e){delete getPromises()[e]}function loadConfiant(){return execAndCache({id:"loadConfiant",promise:()=>new Promise((e,t)=>{let n="XOvl74ZjQYVxeXLSbIOC9TYzBeY";function loadScript(){let r=document.createElement("script");Object.assign(r,{src:`https://cdn.confiant-integrations.net/${n}/gpt_and_prebid/config.js`,type:"text/javascript"});r.onerror=t;r.onload=e;document.body.appendChild(r)}!function setupConfiant(){window.confiant={[n]:{clientSettings:{}}};window.confiant[n].clientSettings.callback=(...e)=>{if(!(e.length>5&&"object"==typeof e[5]))return;let{dfp:t}=e[5];if(!t?.s)return;let n=(0,l.h)().find(e=>e.divId===t.s);if(n){window.tude=window.tude||{cmd:[]};window.tude.cmd?.push(()=>{window.tude?.refreshAdsViaDivMappings&&window.tude?.refreshAdsViaDivMappings([n])})}}}();loadScript()})})}function loadPrebid(){return execAndCache({id:"loadPrebid",promise:()=>new Promise((e,t)=>{let n=document.createElement("script");Object.assign(n,{src:"https://dn0qt3r0xannq.cloudfront.net/chess-RXC9HVsKRD/chess-default/prebid-load.js",async:!0,type:"text/javascript"});n.onerror=t;n.onload=e;document.body.appendChild(n)})})}function preloadGpt(){return execAndCache({id:"preloadGpt",promise:()=>new Promise(e=>{let t=document.createElement("link");Object.assign(preloadGpt,{rel:"preload",as:"script",href:"https://www.googletagservices.com/tag/js/gpt.js"});document.head.appendChild(t);e(!0)})})}let isInExperiment=e=>!!window.chesscom.experiments&&!!window.chesscom.experiments[e],isInExperimentSegment=(e,t)=>!!isInExperiment(e)&&window.chesscom.experiments[e]===t;var d=n(55133);let p=(0,u.createClient)({init(){(0,u.initControllers)(c);if(!(0,d.J)()){document.addEventListener("visibilitychange",this.onVisibilityChange);setPageTargeting();(0,r.G)();setupAdsRefreshTrigger();if(window.chesscom.features.includes("ads_confiant_rollout")&&!isInExperimentSegment("web_ad_requests_test","confiant_off")){if(isInExperimentSegment("web_ad_requests_test","confiant_async")){preloadGpt();loadPrebid();loadConfiant()}else loadConfiant().then(()=>{preloadGpt();loadPrebid()})}else{preloadGpt();loadPrebid()}}},onVisibilityChange(){document?.visibilityState!=="visible"||o.I.isAdsTemporarilyDisabled?.()||o.I.shouldNotRefreshAds?.()||(0,r.G)()}})},50455:function(e,t,n){"use strict";n.d(t,{p:function(){return r}});let r={gameOver:"gameover-1",gameOverVariantsFfa:"gameover-2",gameOverVariantsTeams:"gameover-3",leaderboardAtf:"leaderboard-1",leaderboardBtf:"leaderboard-2",mediumRectangleAtf:"rectangle-1",mediumRectangleBtf:"rectangle-2",skyscraper:"skyscraper-1",skyscraperWide:"skyscraper-2"}},43400:function(e,t,n){"use strict";n.d(t,{h:function(){return getAdsDivMappings}});var r=n(50455);let s={chessboard:"chessboard",chessboardAlt:"chessboardAlt",oneColumn:"oneColumn",twoColumn:"twoColumn",twoColumnAlt:"twoColumnAlt",variants:"variants",events:"events"},o={[s.oneColumn]:[r.p.leaderboardAtf,r.p.leaderboardBtf],[s.twoColumn]:[r.p.leaderboardAtf,r.p.mediumRectangleAtf,r.p.mediumRectangleBtf],[s.twoColumnAlt]:[r.p.mediumRectangleAtf,r.p.mediumRectangleBtf,r.p.leaderboardBtf],[s.chessboard]:[r.p.skyscraper,r.p.skyscraperWide,r.p.gameOver],[s.chessboardAlt]:[r.p.skyscraper,r.p.skyscraperWide],[s.variants]:[r.p.skyscraper,r.p.gameOver,r.p.gameOverVariantsFfa,r.p.gameOverVariantsTeams],[s.events]:[r.p.leaderboardAtf,r.p.skyscraper,r.p.skyscraperWide,r.p.gameOver]},i={features:"features",featuresChessboard:"features-chessboard",home:"home",learn:"learn",learnChessboard:"learn-chessboard",news:"news",newsSingle:"news-single",play:"play",playChessboard:"play-chessboard",profile:"profile",puzzlesChessboard:"puzzles-chessboard",puzzles:"puzzles",resources:"resources",social:"social",socialSingle:"social-single",watch:"watch",events:"events",variants:"variants",ratings:"ratings"};var a=n(75629);function generateAdsDivMappings(e,t){let n=[];return t.forEach(t=>{n.push({divId:t,baseDivId:`pb-slot-${e}-${t}`})}),n}function getAdsDivMappings(){let{chessboard:e,chessboardAlt:t,twoColumn:n,twoColumnAlt:r,oneColumn:s,variants:c,events:u}=o;switch(a.I.getAdsSection()){case i.features:return generateAdsDivMappings(i.features,n);case i.featuresChessboard:return generateAdsDivMappings(i.features,t);case i.home:return generateAdsDivMappings(i.home,n);case i.learn:return generateAdsDivMappings(i.learn,n);case i.learnChessboard:return generateAdsDivMappings(i.learn,t);case i.news:return generateAdsDivMappings(i.news,n);case i.newsSingle:return generateAdsDivMappings(i.news,r);case i.playChessboard:return generateAdsDivMappings(i.play,e);case i.play:return generateAdsDivMappings(i.play,n);case i.profile:return generateAdsDivMappings(i.profile,n);case i.puzzlesChessboard:return generateAdsDivMappings(i.puzzles,t);case i.resources:return generateAdsDivMappings(i.resources,n);case i.social:return generateAdsDivMappings(i.social,n);case i.socialSingle:return generateAdsDivMappings(i.social,r);case i.watch:return generateAdsDivMappings(i.watch,n);case i.events:return generateAdsDivMappings(i.play,u);case i.variants:return generateAdsDivMappings(i.variants,c);case i.ratings:return generateAdsDivMappings(i.news,s);default:return generateAdsDivMappings(i.home,n)}}},23189:function(e,t,n){"use strict";n.d(t,{o:function(){return getDomainFromRoute}});function getDomainFromRoute(e=window.location.href){return new URL(e).hostname.split(".").slice(-2).join(".")}},55133:function(e,t,n){"use strict";n.d(t,{J:function(){return isCI}});function isCI(){return!!(window.Cypress||window.Config?.cypress||window.location.host.includes("localhost:"))}},15529:function(e,t,n){"use strict";n.d(t,{D:function(){return copyRoute}});var r=n(53233),s=n(81055);function copyRoute(e){let t=(0,r.R)();if(t.routes_[e])return;try{Object.assign(t.context_,{base_url:"",prefix:"",host:"www.chess.com",port:"",scheme:"https",locale:""})}catch(e){}Object.isFrozen(t.routes_)&&(t.routes_=Object.assign({},t.routes_));let n=".chess-dev.com",o=window.location.host.replace(/^[^.]+/,""),i=!window.Config?.cypress&&o;i&&t.context_.host.includes(n)&&(t.context_.host=t.context_.host.replace(n,o));if(window.chesscom?.routes?.[e]){let r=window.chesscom.routes[e];if(i){r.defaults?.host?.includes(n)&&(r.defaults.host=r.defaults.host.replace(n,o));r.hosttokens?.forEach(e=>{e.forEach((t,r)=>{s.Kg(t)&&t.includes(n)&&(e[r]=t.replace(n,o))})})}t.routes_[e]=r}}},53233:function(e,t,n){"use strict";n.d(t,{R:function(){return getRouting}});var r=n(37634),s=/*#__PURE__*/n.n(r);function getRouting(){return s()}},23618:function(e,t,n){"use strict";var r=n(23189),s=n(55133),o=n(15529),i=n(53233),a=n(48858);class c{generate(e,t,n){let c=t||{};"string"==typeof c.username&&(c.username=c.username.toLowerCase());(0,o.D)(e);try{let t=(0,i.R)().generate(e,c,n);if(t.startsWith("http"))try{if(new URL(t).hostname===window.location.hostname)return t;let e=(0,r.o)(),n=(0,r.o)(t);t=t.replace(n,e)}catch(r){let t=Error(`Failed replacing hostname in route '${e}'.`);(0,a.C)(t,{routeName:e,routeParams:c,absoluteUrl:n})}return t}catch(n){let t=Error(`Couldn't find missing route '${e}'.`);window.Jest||console.error(t);(0,s.J)()||(0,a.C)(t,{missing_route:e});return"/"}}i18nable(e){return`i18n_${e}`in window.chesscom.routes}i18n(e,t,n){let r=e,s=t||{};if(window.context?.route?.startsWith("i18n")&&this.i18nable(e)){s._locale=window.context.locale.slice(0,2);r=`i18n_${e}`}let o=this.generate(r,s,n);return n?o:o.replace(/^.*\/\/[^/]+/,"")}}t.A=new c},48858:function(e,t,n){"use strict";n.d(t,{C:function(){return captureException}});var r=n(95085),s=n(21347),o=n(70502);async function captureException(e,t){if(!await (0,o.T)())return;await (0,r.z)();let n=await (0,s.Q)(),i=e instanceof Error?e:Error(e);t?n.withScope(e=>{Object.keys(t).forEach(n=>e.setExtra(n,t[n]));n.captureException(i)}):n.captureException(i)}},95085:function(e,t,n){"use strict";n.d(t,{z:function(){return enableSentry}});var r=n(21347),s=n(70502);async function enableSentry(e=0){if(!await (0,s.T)())return;window.chesscom.sudoEnableSentry=!0;let t=await (0,r.Q)();for(;window.chesscom.queuedSentryReports?.length;)t.captureException(window.chesscom.queuedSentryReports.shift());if(e>0){let t=Date.now()+864e5*e;window.localStorage.setItem("enableSentryUntil",t.toString())}}},21347:function(e,t,n){"use strict";n.d(t,{Q:function(){return getSentryBrowser}});async function getSentryBrowser(){return n.e(3484).then(n.bind(n,3484))}},70502:function(e,t,n){"use strict";n.d(t,{T:function(){return isSentryAvailable}});var r=n(21347);async function isSentryAvailable(){try{return!!(await (0,r.Q)()).getCurrentHub().getClient()}catch(e){return!1}}},81055:function(e,t,n){"use strict";n.d(t,{Et:function(){return isNumber},Gv:function(){return isObject},Kg:function(){return isString},Lm:function(){return isBoolean},Tn:function(){return isFunction}});function isObject(e){return null!==e&&"object"==typeof e}function isString(e){return"string"==typeof e}function isFunction(e){return"function"==typeof e}function isNumber(e){return"number"==typeof e&&!isNaN(e)}function isBoolean(e){return"boolean"==typeof e}}}]);