PageSourceSearch

https://cdn.sudokuonline.io/static/js/game.ae6d8f4c.min.js

js sudokuonline.io collected 2026-10-04 04:36:26 UTC 54,017 bytes, 106 lines download raw bytes

1(function(){function wa(b=null){if(xa())if(""===a.push_token||"granted"!==Notification.permission)if("granted"===Notification.permission)ea();else{if((new Date).getTime()>=a.nextPushRequest){if(b){let e=document.getElementsByClassName("push-request-title");for(let f=0;f<e.length;f++)e[f].style.display="none";document.getElementById(b).style.display="block"}Q.open(function(){try{gtag("event","Web Push Request",{event_category:"Show",event_label:DAILY_GAME?"DAILY":3<=a.session?"SESSION":"10GAMES"})}catch(e){}},
2function(){try{gtag("event","Web Push Request",{event_category:"Accept",event_label:DAILY_GAME?"DAILY":3<=a.session?"SESSION":"10GAMES"})}catch(e){}ea()},function(){try{gtag("event","Web Push Request",{event_category:"Reject",event_label:DAILY_GAME?"DAILY":3<=a.session?"SESSION":"10GAMES"})}catch(e){}},function(){try{gtag("event","Web Push Request",{event_category:"Dismiss",event_label:DAILY_GAME?"DAILY":3<=a.session?"SESSION":"10GAMES"})}catch(e){}},function(){try{gtag("event","Web Push Request",
3{event_category:"Don't show again",event_label:DAILY_GAME?"DAILY":3<=a.session?"SESSION":"10GAMES"})}catch(e){}})}}else navigator.serviceWorker.getRegistrations().then(e=>{let f=!1;const g=(new URL(swUrl)).pathname;for(const c of e)c.active.scriptURL.endsWith(g)&&(f=!0);f||("granted"===Notification.permission?ea():(new Date).getTime()>=a.nextPushRequest&&Q.open(function(){try{gtag("event","Web Push Request",{event_category:"Show",event_label:DAILY_GAME?"DAILY":3<=a.session?"SESSION":"10GAMES"})}catch(c){}},
4function(){try{gtag("event","Web Push Request",{event_category:"Accept",event_label:DAILY_GAME?"DAILY":3<=a.session?"SESSION":"10GAMES"})}catch(c){}ea()},function(){try{gtag("event","Web Push Request",{event_category:"Reject",event_label:DAILY_GAME?"DAILY":3<=a.session?"SESSION":"10GAMES"})}catch(c){}},function(){try{gtag("event","Web Push Request",{event_category:"Dismiss",event_label:DAILY_GAME?"DAILY":3<=a.session?"SESSION":"10GAMES"})}catch(c){}},function(){try{gtag("event","Web Push Request",
5{event_category:"Don't show again",event_label:DAILY_GAME?"DAILY":3<=a.session?"SESSION":"10GAMES"})}catch(c){}}))}).catch(e=>{console.error("Error retrieving sws. ",e)})}function xa(){return"serviceWorker"in navigator&&"Notification"in window?!0:!1}function Ja(){return Notification.requestPermission().then(function(b){return"granted"!==b?!1:!0}).catch(b=>{console.error("An error occurred while requesting permission. ",b);return!1})}function ea(){if(xa())if("granted"===Notification.permission)ya();
6else{const b=(navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language).substring(0,2);"en"!==b&&(document.querySelector("#image-aid img").style.display="none");Q.openVisualAid(function(){try{gtag("event","Web Push Request",{event_category:"Visual AID - "+("en"===b?"Show":"Hidden"),event_label:DAILY_GAME?"DAILY":3<=a.session?"SESSION":"10GAMES"})}catch(e){}});Ja().then(e=>{Q.close();try{gtag("event","Web Push Request",{event_category:"Visual AID - "+("en"===b?"(Shown) ":
7"(Hidden) ")+(e?"Granted":"Rejected"),event_label:DAILY_GAME?"DAILY":3<=a.session?"SESSION":"10GAMES"})}catch(f){}e&&ya()}).catch(e=>{Q.close();console.error("An error occurred while accessing permission. ",e);try{gtag("event","Web Push Request",{event_category:"Visual AID - "+("en"===b?"(Shown) ":"(Hidden) ")+" Rejected",event_label:DAILY_GAME?"DAILY":3<=a.session?"SESSION":"10GAMES"})}catch(f){}})}}async function ya(){importJSModule("https://www.gstatic.com/firebasejs/10.12.2/firebase-app.js",b=>
8{importJSModule("https://www.gstatic.com/firebasejs/10.12.2/firebase-messaging.js",e=>{const f=b.initializeApp({apiKey:"AIzaSyCIu3syGWP47VGTblgDjlbLlH6BcyfJjxw",authDomain:"sudoku-web-a7014.firebaseapp.com",projectId:"sudoku-web-a7014",storageBucket:"sudoku-web-a7014.appspot.com",messagingSenderId:"408968173383",appId:"1:408968173383:web:5adab7c907973c17361e62"}),g=e.getMessaging(f),c=(new URL(swUrl)).pathname;navigator.serviceWorker.register(c).then(d=>{e.getToken(g,{serviceWorkerRegistration:d,
9vapidKey:"BA2gp0XSB3IspWbYUFuE1HM0qkTdfpO5umKKvn533pT7QooAceuwkZs2sb1TQ_3ASVV7l5X38CI6KjwBz2k3vv8"}).then(k=>{k&&(a.push_token=k,delete a.SessionToken,delete a.DeviceToken,a.save(),S.forceAuthValidation(),a.save());try{gtag("event","Web Push Request",{event_category:"Successfully Registered",event_label:DAILY_GAME?"DAILY":3<=a.session?"SESSION":"10GAMES"})}catch(r){}navigator.serviceWorker.getRegistrations().then(r=>{for(const u of r)u.active.scriptURL.endsWith(c)||u.unregister()})}).catch(k=>{console.error("An error occurred while retrieving token. ",
10k)})}).catch(d=>{console.error("SW failed ",d)})})})}async function qa(b){b=(new TextEncoder).encode(b);b=await crypto.subtle.digest("SHA-256",b);return Array.from(new Uint8Array(b)).map(e=>e.toString(16).padStart(2,"0")).join("")}function za(b){return parseInt(b.dataset.key)%(parseInt(b.dataset.celln)+10)==parseInt(b.dataset.value)}function Aa(b){null!=E&&E!=b&&(E.classList.remove("active"),fa(),E=null);b.classList.add("active");fa(b);E=b}function T(b,e,f=!1){if(!B.isPaused()&&!b.classList.contains("fixed")&&
11b.dataset.value!=e){N&&(f?f=J[J.length-1]:(f={c:b.dataset.column,r:b.dataset.row,ref:b.dataset.celln,a:"setVal",v:e,t:Math.round(B.getPreciseTime()),tc:Math.round(B.getPreciseTimeCheck())},J.push(f)),M.push({ele:b,ref:b.dataset.celln,state:W(),gameplayData:f}));f=b.dataset.value;b.classList.remove("invalid");var g=document.querySelectorAll(".cell[data-value='"+b.dataset.value+"']"),c=[];for(var d=0;d<g.length;d++){var k=g[d];k==b||k.dataset.row!=b.dataset.row&&k.dataset.column!=b.dataset.column&&
12k.dataset.square!=b.dataset.square||c.push(k)}for(d=0;d<c.length;d++){k=c[d];let r=!0;for(let u=0;u<g.length;u++){let z=g[u];z==b||z==k||z.dataset.row!=k.dataset.row&&z.dataset.column!=k.dataset.column&&z.dataset.square!=k.dataset.square||(r=!1)}r&&k.classList.remove("invalid")}b.dataset.value=e;g=document.querySelectorAll(".color-"+e+".visible");for(c=0;c<g.length;c++)d=g[c],k=d.closest(".cell"),k.dataset.row!=b.dataset.row&&k.dataset.column!=b.dataset.column&&k.dataset.square!=b.dataset.square||
13d.classList.remove("visible");if(""!=e)for(g=document.querySelectorAll(".cell[data-value='"+b.dataset.value+"']"),c=0;c<g.length;c++)d=g[c],d==b||d.dataset.row!=b.dataset.row&&d.dataset.column!=b.dataset.column&&d.dataset.square!=b.dataset.square||(d.classList.add("invalid"),b.classList.add("invalid"));ra&&(""==b.dataset.value||za(b)?b.classList.remove("invalid2"):(b.classList.contains("invalid2")||(a.currentGame.errorsDetected+=1),b.classList.add("invalid2")));fa(b);""!=f&&Ba(f);""!=e&&Ba(e);Ka()}}
14function sa(b,e){if(!b.classList.contains("fixed")&&""==b.dataset.value&&P&&isFinite(e)){if(N){let f={c:b.dataset.column,r:b.dataset.row,ref:b.dataset.celln,a:"ann",v:e,t:Math.round(B.getPreciseTime()),tc:Math.round(B.getPreciseTimeCheck())};J.push(f);M.push({ele:b,ref:b.dataset.celln,state:W(),gameplayData:f})}b.querySelector(".color-"+e).classList.toggle("visible")}}function Ba(b){document.querySelectorAll(".cell[data-value='"+b+"']:not(.invalid):not
14(.invalid2)").length===puzzleSize?document.getElementById("number-"+
15b).classList.add("completed"):document.getElementById("number-"+b).classList.remove("completed")}function fa(b=null){var e=document.querySelectorAll(".cell");for(let f=0;f<e.length;f++){let g=e[f];null==b?(g.classList.remove("highlighted"),g.classList.remove("highlighted2")):""!=g.dataset.value&&g.dataset.value==b.dataset.value?(g.classList.add("highlighted2"),g.classList.remove("highlighted")):(g.dataset.row==b.dataset.row||g.dataset.column==b.dataset.column||g.dataset.square==b.dataset.square?g.classList.add("highlighted"):
16g.classList.remove("highlighted"),g.classList.remove("highlighted2"))}e=document.getElementById("sudoku");e.classList.remove("colored-1");e.classList.remove("colored-2");e.classList.remove("colored-3");e.classList.remove("colored-4");e.classList.remove("colored-5");e.classList.remove("colored-6");e.classList.remove("colored-7");e.classList.remove("colored-8");e.classList.remove("colored-9");null!=b&&e.classList.add("colored-"+b.dataset.value)}function Ka(){if(null===document.querySelector(".cell[data-value=''],.cell.invali
16d")){a.gamesPlayed+=
171;B.stop();ba=!0;try{gtag("event","puzzle_completed",{difficulty,is_daily:!!a.currentGame.isDaily,is_challenge:!!a.currentGame.challengeID,value:Math.round(B.getPreciseTime()/1E3)})}catch(r){}M=[];K=[];const b=B.getPreciseTime(),e=JSON.parse(JSON.stringify(J));J=[];delete a.currentGame.gameState;delete a.currentGame.replay;delete a.savedGames[ha(difficulty)];document.getElementById("final-time").innerText=B.getTimeString();document.getElementById("final-hints").innerText=a.currentGame.hintsUsed+` (+${60*
18a.currentGame.hintsUsed}s)`;document.getElementById("final-mistakes").innerText=a.currentGame.errorsDetected+` (+${10*a.currentGame.errorsDetected}s)`;document.getElementById("final-time-total").innerText=B.getTimeString(B.getPreciseTime()+6E4*a.currentGame.hintsUsed+1E4*a.currentGame.errorsDetected);a.currentGame.challengeID&&(document.getElementById("final-challenger-time").innerText=B.getTimeString(challenge.best_time),document.getElementById("challenge-resume").classList.add("visible"));const f=
19a.currentGame.hintsUsed,g=a.currentGame.errorsDetected,c=a.currentGame.isDaily,d=a.currentGame.challengeID,k=a.currentGame.puzzleID;(async()=>{let r=await qa(parseInt(b/2+2*f+g+667)+k);S.sendScore(k,b,f,g,d,!0,r,c,e,function(u){let z=document.getElementById("stat-avg");z&&"-"!==z.innerText?(document.getElementById("final-avg").innerText=z.innerText,document.getElementById("final-best").innerText=document.getElementById("stat-best").innerText):(document.getElementById("final-avg").innerText=B.getTimeString(1E3*
20u.stats.avg),document.getElementById("final-best").innerText=B.getTimeString(1E3*u.stats.best));document.getElementById("final-top").innerText=u.stats.pctl+"%";document.getElementById("final-points").innerText=u.stats.points;document.getElementById("secondary-resume").classList.add("visible");a.currentGame.challengeID||""==u.reference_id||(document.getElementById("challenge").
20classList.add("visible"),Ca=u.reference_id);DAILY_GAME&&(a.lastDailyPlay=(new Date).toISOString().slice(0,10),a.lastDailyStats=
21{time:B.getTimeString(B.getPreciseTime()+6E4*f+1E4*g),points:u.stats.points,pctl:u.stats.pctl+"%"});a.currentGame.puzzleID===k&&(delete a.currentGame,a.currentGame={},a.currentGame.puzzleID=k,ia(k,c));(DAILY_GAME||3<=a.session||10<a.gamesPlayed)&&wa(DAILY_GAME?null:3<=a.session?"game-push-title-1":"game-push-title-2")},function(){})})();document.getElementById("victory-screen").style.display="block";c&&document.getElementById("new-game")&&"none"===document.getElementById("new-game").style.display&&
22(document.getElementById("new-game").style.display="flex")}}function La(){S.createChallenge(Ca,function(b){var e=b.challenge;b=window.location.href;let f=b.indexOf("?");0<=f&&(b=b.substring(0,f));b+="?chr="+e;e=ActiveLang.ChallengeBody.replace("%url%",b);e=e.replace("%puzzletime%",B.getTimeString()+"s");try{const g={title:ActiveLang.ChallengeSubject,text:e.substring(0,e.indexOf("\n\r\n")+1),url:b};navigator.share(g)}catch(g){window.open("mailto:[email protected]?subject="+ActiveLang.ChallengeSubject+
23"&body="+encodeURIComponent(e))}},function(){alert("Failed to generate a challenge")})}function Da(){let b=M.pop();if(b){let e=JSON.parse(JSON.stringify(b.gameplayData));e.a="undo";e.t=Math.round(B.getPreciseTime());e.tc=Math.round(B.getPreciseTimeCheck());J.push(e);K.push({ele:b.ele,ref:b.ref,state:W(),gameplayData:e});N=!1;ja(b.state);N=!0;b.ele.focus()}}function Ea(){let b=K.pop();if(b){let e=JSON.parse(JSON.stringify(b.gameplayData));e.a="redo";e.t=Math.round(B.getPreciseTime());e.tc=Math.round(B.getPreciseTimeCheck());
24J.push(e);M.push({ele:b.ele,ref:b.ref,state:W(),gameplayData:e});N=!1;ja(b.state);N=!0;b.ele.focus()}}function Fa(){if(!B.isPaused()&&null!=E&&!E.classList.contains("fixed")){2>a.currentGame.hintsUsed?b():readyInterstitial?(resumeGame=b,readyInterstitial(),rewardedTimer=setTimeout(function(){"function"===typeof resumeGame&&resumeGame()},5E3)):b();function b(){resumeGame=null;null!=rewardedTimer&&(clearTimeout(rewardedTimer),rewardedTimer=null);let e={c:E.dataset.column,r:E.dataset.row,ref:E.dataset.celln,
25a:"hint",v:""+parseInt(E.dataset.key)%(parseInt(E.dataset.celln)+10),t:Math.round(B.getPreciseTime()),tc:Math.round(B.getPreciseTimeCheck())};J.push(e);a.currentGame.hintsUsed+=1;T(E,parseInt(E.dataset.key)%(parseInt(E.dataset.celln)+10),!0);E.classList.add("fixed");document.getElementById("hint").dataset.hints=Math.max(0,2-a.currentGame.hintsUsed)}}}function W(){let b=[],e=document.querySelectorAll(".cell");for(let g=0;g<e.length;g++){var f=e[g];0<f.dataset.value.length?f.classList.contains("fixed")?
26b.push(parseInt(f.dataset.value)+100):b.push(parseInt(f.dataset.value)+200+parseInt(f.dataset.key)%(parseInt(f.dataset.celln)+10)*10):b.push(parseInt(f.dataset.key)%(parseInt(f.dataset.celln)+10));f=f.querySelectorAll(".annotation.visible");if(0<f.length){let c=b[b.length-1]+".";for(let d=0;d<f.length;d++)c+=f[d].innerHTML;b[b.length-1]=parseFloat(c)}}return a.currentGame.isKiller?{game_data:b,cages:a.currentGame.cages}:b}function ia(b,e){document.getElementById("stat-games")&&S.getPuzzleStats(b,
27e,function(f){var g=f.stats;null!=g?(document.getElementById("stat-games").innerText=g.games_played,document.getElementById("stat-avg").innerText=g.avg_time,document.getElementById("stat-best").innerText=g.best_time,document.getElementById("stat-winrate").innerText=g.win_rate):(document.getElementById("stat-games").innerText="0",document.getElementById("stat-avg").innerText="-",document.getElementById("stat-best").innerText="-",document.getElementById("stat-winrate").innerText="-");if(0<f.leaderboard.length){g=
28document.querySelector("#leaderboard-scores");g.innerHTML="";document.getElementById("no-leaderboard").style.display="none";for(let k=0;k<f.leaderboard.length;k++){let r=f.leaderboard[k],u=document.createElement("li");u.classList.add("leaderboard-score");r.self&&u.classList.add("me");var c=document.createElement("b");c.innerText=r.rank+".";u.appendChild(c);if(r.self||""==r.public_id||"undefined"===typeof profileURL)c=document.createElement("span"),c.innerText=r.user,c.dataset.uid=r.user+"#"+r.uid,
29u.appendChild(c);else{c=document.createElement("a");c.innerText=r.user;c.rel="nofollow";var d=profileURL.substring(0,profileURL.lastIndexOf("/")+1)+r.public_id;c.href=d;c.dataset.uid=r.user+"#"+r.uid;u.appendChild(c)}c=document.createElement("div");c.classList.add("progress-bar");d=document.createElement("div");d.classList.add("progress");d.style.maxWidth=r.percentage_comparative+"%";d.innerText=r.score;c.appendChild(d);u.appendChild(c);g.appendChild(u)}}else document.querySelector("#leaderboard-scores").innerHTML=
30"",document.getElementById("no-leaderboard").style.display="block"},function(){document.getElementById("stat-games").innerText="0";document.getElementById("stat-avg").innerText="-";document.getElementById("stat-best").innerText="-";document.getElementById("stat-winrate").innerText="-";document.querySelector("#leaderboard-scores").innerHTML="";document.getElementById("no-leaderboard").style.display="block"})}function U(b=null,e=null){M=[];K=[];N=!0;document.getElementById("secondary-resume").classList.remove("visible");
31document.getElementById("challenge").classList.remove("visible");document.getElementById("challenge-resume").classList.remove("visible");document.getElementById("victory-screen").style.display="none";document.getElementById("hint").dataset.hints="2";null==b&&(puzzleID+=1,puzzleID>=preloadedPuzzles.length&&(puzzleID=0),b=preloadedPuzzles[puzzleID]);ja(b.data);a.currentGame={};a.currentGame.puzzleID=b.id;a.currentGame.hintsUsed=0;a.currentGame.errorsDetected=0;a.currentGame.challengeID=e;a.currentGame.gameDifficulty=
32b.difficulty;a.currentGame.isDaily=DAILY_GAME;a.currentGame.date=(new Date).toISOString().slice(0,10);a.currentGame.isKiller=b.killer;!0===b.killer&&(a.currentGame.cages=b.data.cages);ba=!1;B.restart();J=[];ia(b.id,DAILY_GAME)}function Ga(){let b=function(){};if(!ba&&0<M.length){const e=a.currentGame.puzzleID,f=B.getPreciseTime(),g=a.currentGame.hintsUsed,c=a.currentGame.errorsDetected,d=a.currentGame.challengeID,k=a.currentGame.isDaily,r=JSON.parse(JSON.stringify(J));b=function(){(async()=>{let u=
33await qa(parseInt(f/2+2*g+c+667)+e);S.sendScore(e,f,g,c,d,!1,u,k,r,function(){delete a.savedGames[ha(difficulty)]})})()}}S.getRandomPuzzle(difficulty,KILLER,function(e){U(e.puzzle);b()},function(){U();b()})}function ja(b){var e=document.querySelectorAll(".annotation.visible");for(var f=0;f<e.length;f++)e[f].classList.remove("visible");e=document.querySelectorAll(".cell");for(f=0;f<e.length;f++)e[f].dataset.value="",delete e[f].dataset.key,e[f].classList="cell";e=document.querySelectorAll(".number");
34for(f=0;f<e.length;f++)e[f].classList="number";e=document.querySelectorAll(".cage-value");for(f=0;f<e.length;f++)e[f].style.display="none",e[f].innerText="";e=document.querySelectorAll(".cage-edge");for(f=0;f<e.length;f++)e[f].style.display="none";if(b.hasOwnProperty("cages"))for(e=b.cages,b=b.game_data,f=0;f<e.length;f++){var g=e[f],c=new Set(g.cells.map(k=>k.join(",")));let d=null;for(let k=0;k<g.cells.length;k++){const r=g.cells[k][0],u=g.cells[k][1];let z=document.querySelector("[data-row='"+
35r+"'][data-column='"+u+"']");if(null===d||r<d[0]||r==d[0]&&u<d[1])d=[r,u];mergeRight=mergeTop=mergeBottom=!1;c.has(r-1+","+u)&&(mergeTop=!0,z.classList.add("cage-top"));c.has(r+1+","+u)&&(mergeBottom=!0,z.classList.add("cage-bottom"));c.has(r+","+(u-1))&&(z.classList.add("cage-left"),mergeTop&&(document.querySelector("[data-row='"+r+"'][data-column='"+u+"'] .cage-edge-tl").style.display="block"),mergeBottom&&(document.querySelector("[data-row='"+r+"'][data-column='"+u+"'] .cage-edge-bl").style.display=
36"block"));c.has(r+","+(u+1))&&(mergeRight=!0,z.classList.add("cage-right"),mergeTop&&(document.querySelector("[data-row='"+r+"'][data-column='"+u+"'] .cage-edge-tr").style.display="block"),mergeBottom&&(document.querySelector("[data-row='"+r+"'][data-column='"+u+"'] .cage-edge-br").style.display="block"))}c=document.querySelector("[data-row='"+d[0]+"'][data-column='"+d[1]+"'] .cage-value");c.innerText=g.count;c.style.display="block"}for(e=0;e<b.length;e++){f=document.querySelector(".cell[data-celln='"+
37e+"']");if(0<b[e]%1)for(g=(b[e]+"").split("."),b[e]=parseInt(b[e]),c=0;c<g[1].length;c++)f.querySelector(".color-"+g[1][c]).classList.add("visible");100<b[e]&&200>b[e]?(f.dataset.value=b[e]-100,f.classList.add("fixed")):100>b[e]?f.dataset.key=b[e]+Math.floor(100*Math.random())*(e+10):(g=parseInt((b[e]/10+"").split(".")[1]),g=parseInt(((b[e]-g)/100+"").split(".")[1]),f.dataset.key=g+Math.floor(100*Math.random())*(e+10))}f=null;for(e=0;e<b.length;e++)200<b[e]&&(f=document.querySelector(".cell[data-celln='"+
38e+"']"),0<b[e]%1&&(b[e]=parseInt(b[e])),g=parseInt((b[e]/10+"").split(".")[1]),T(f,g),g=parseInt(((b[e]-g)/100+"").split(".")[1]),f.dataset.key=g+Math.floor(100*Math.random())*(e+10));null!=f&&Aa(f)}function ha(b){return DAILY_GAME?"DAILY":KILLER?"KILLER_"+b:"REG_"+b}var ka={sha1_hmac:function(b,e){var f;64<e.length&&(e=ka.sha1(e,!0));var g=[];var c=e.length;for(f=0;64>f;++f)g[f]=c>f?e.charCodeAt(f):0;c=e="";for(f=0;64>f;++f)e+=String.fromCharCode(g[f]^92),c+=String.fromCharCode(g[f]^54);b=ka.sha1(c+
39b,!0);return ka.sha1(e+b)},sha1:function(b,e){function f(X,Y){return X<<Y|X>>>32-Y}function g(X,Y){var la="",Z;for(Z=7;0<=Z;Z--){var ca=X>>>4*Z&15;la+=Y?String.fromCharCode(ca):ca.toString(16)}return la}var c,d=Array(80),k=1732584193,r=4023233417,u=2562383102,z=271733878,F=3285377520;var y=b.length;var A=[];for(c=0;c<y-3;c+=4){var C=b.charCodeAt(c)<<24|b.charCodeAt(c+1)<<16|b.charCodeAt(c+2)<<8|b.charCodeAt(c+3);A.push(C)}switch(y%4){case 0:c=2147483648;break;case 1:c=b.charCodeAt(y-1)<<24|8388608;
40break;case 2:c=b.charCodeAt(y-2)<<24|b.charCodeAt(y-1)<<16|32768;break;case 3:c=b.charCodeAt(y-3)<<24|b.charCodeAt(y-2)<<16|b.charCodeAt(y-1)<<8|128}
40for(A.push(c);14!=A.length%16;)A.push(0);A.push(y>>>29);A.push(y<<3&4294967295);for(b=0;b<A.length;b+=16){for(c=0;16>c;c++)d[c]=A[b+c];for(c=16;79>=c;c++)d[c]=f(d[c-3]^d[c-8]^d[c-14]^d[c-16],1);C=k;y=r;var D=u;var H=z;var L=F;for(c=0;19>=c;c++){var R=f(C,5)+(y&D|~y&H)+L+d[c]+1518500249&4294967295;L=H;H=D;D=f(y,30);y=C;C=R}for(c=20;39>=c;c++)R=f(C,5)+
41(y^D^H)+L+d[c]+1859775393&4294967295,L=H,H=D,D=f(y,30),y=C,C=R;for(c=40;59>=c;c++)R=f(C,5)+(y&D|y&H|D&H)+L+d[c]+2400959708&4294967295,L=H,H=D,D=f(y,30),y=C,C=R;for(c=60;79>=c;c++)R=f(C,5)+(y^D^H)+L+d[c]+3395469782&4294967295,L=H,H=D,D=f(y,30),y=C,C=R;k=k+C&4294967295;r=r+y&4294967295;u=u+D&4294967295;z=z+H&4294967295;F=F+L&4294967295}c=(g(k)+g(r)+g(u)+g(z)+g(F)).toLowerCase();if(!e)return c;for(e="";c.length;)e+=String.fromCharCode(parseInt(c.substr(0,2),16)),c=c.substr(2);return e}};const a=new function(){function b(){let c=
42{};for(var d in e)e.hasOwnProperty(d)&&"function"!=typeof e[d]&&(c[d]=e[d]);return JSON.stringify(c)}let e=this;this.version=4.2;this.platform="web";this.gamesPlayed=this.savedAt=this.session=0;this.push_token="";this.nextPushRequest=0;this.currentGame=null;this.savedGames={};this.loggedInWithGoogle=this.loggedInWithFacebook=!1;try{var f="localStorage"in window&&null!==window.localStorage}catch(c){f=!1}const g=f;this.save=function(){g&&(e.savedAt=(new Date).getTime(),localStorage.setItem("gconf",
43b()))};this.load=function(){if(g){let d=JSON.parse(localStorage.getItem("gconf"));if(d){let k=e.version;for(var c in d)d.hasOwnProperty(c)&&"function"!=typeof d[c]&&(e[c]=d[c]);e.version!=k&&(e.version=k,delete e.SessionToken,delete e.DeviceToken);(new Date).getTime()>e.savedAt+18E5&&(e.session+=1)}}};e.load();b()},S=new function(){function b(){var n=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(l){var h=(n+16*Math.random())%16|0;n=Math.floor(n/16);return("x"==
44l?h:h&3|8).toString(16)})}function e(n,l){n=ka.sha1_hmac(n,l);return btoa(n)}function f(){var n=JSON.stringify({app_version:a.version,app_platform:a.platform,device_udid:da,app_id:"SudokuWeb",push_token:a.push_token}),l=new XMLHttpRequest;l.open("POST",D);l.setRequestHeader("Content-Type","application/json");l.setRequestHeader("X-AUTH-TOKEN","");l.setRequestHeader("X-APP-ID","SudokuWeb");l.setRequestHeader("X-APP-VERSION",a.version);"undefined"!==typeof X_DEV_TOKEN&&l.setRequestHeader("X-DEV-TOKEN",
45X_DEV_TOKEN);l.send(n);l.onload=function(){if(200==this.status){var h=JSON.parse(l.responseText);a.InstallationID=h.InstallationID;a.SecretKey=h.SecretKey;a.DeviceToken="AG_V1 "+e("iid="+h.InstallationID,h.SecretKey);c()}};return!0}function g(n){ta?ma.push(n):(ta=!0,ma.push(n),c())}function c(){if(!a.hasOwnProperty("DeviceToken")||""===a.DeviceToken)return f(),!0;var n=navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language,l=window.navigator.vendor;0==l.length&&
46(l="unknown");n=JSON.stringify({network_status:"wifi",device_model:window.navigator.appName,device_vendor:l,os_version:window.navigator.platform,locale:n,screen_width:window.screen.width,screen_height:window.screen.height,os_name:"n/a"});var h=new XMLHttpRequest;h.open("POST",C);h.setRequestHeader("Content-Type","application/json");h.setRequestHeader("X-AUTH-TOKEN",a.DeviceToken);h.setRequestHeader("X-APP-ID","SudokuWeb");h.setRequestHeader("X-APP-VERSION",a.version);"undefined"!==typeof X_DEV_TOKEN&&
47h.setRequestHeader("X-DEV-TOKEN",X_DEV_TOKEN);h.send(n);h.onload=function(){if(200==this.status){var m=JSON.parse(h.responseText);a.SessionToken="AG_V1 "+e("iid="+a.InstallationID+";sid="+m.SessionID,a.SecretKey);let p=new Date;p.setTime(p.getTime()+1E3*m.ValidForSec-36E5);a.SessionTokenExpireAt=p;a.save();for(ta=!1;0<ma.length;)m=ma.shift(),"function"===typeof m&&m()}else 401==this.status&&f()};h.onerror=function(){401==this.status&&f()};return!0}function d(n=null){!a.hasOwnProperty("SessionToken")||
48!a.hasOwnProperty("SessionTokenExpireAt")||(new Date(Date.parse(a.SessionTokenExpireAt))).getTime()<Date.now()?g(n):"function"===typeof n&&n()}function k(){function n(){for(ua=!1;0<na.length;){let h=na.shift();"function"===typeof h&&h()}}var l=new XMLHttpRequest;l.open("GET",Ma);l.setRequestHeader("Content-Type","application/json");l.setRequestHeader("X-AUTH-TOKEN",a.SessionToken);l.setRequestHeader("X-APP-ID","SudokuWeb");l.setRequestHeader("X-APP-VERSION",a.version);l.send();l.onload=function(){if(200==
49this.status){var h=JSON.parse(l.responseText);a.userToken=h.token;var m=new Date;m.setTime(m.getTime()+1E3*h.expires_in-6E4);a.userTokenExpiresAt=m;a.refreshToken=h.refresh_token;m=new Date;m.setTime(m.getTime()+1E3*h.refresh_token_expires_in-6E4);a.refreshTokenExpiresAt=m;a.loggedInWithGoogle=!1;a.loggedInWithFacebook=!1;a.nickname=h.nickname;a.uid=h.nickname_uid;a.ratings={};a.save();sync(n)}else g(k)}}function r(n){ua?na.push(n):(ua=!0,na.push(n),k())}function u(){function n(){for(va=!1;0<oa.length;){let m=
50oa.shift();"function"===typeof m&&m()}}var l=JSON.stringify({refresh_token:a.refreshToken}),h=new XMLHttpRequest;h.open("POST",Na);h.setRequestHeader("Content-Type","application/json");h.setRequestHeader("X-AUTH-TOKEN",a.SessionToken);h.setRequestHeader("X-APP-ID","SudokuWeb");h.setRequestHeader("X-APP-VERSION",a.version);h.setRequestHeader("X-USER-AUTH-TOKEN",a.userToken);h.send(l);h.onload=function(){if(200==this.status){var m=JSON.parse(h.responseText);a.userToken=m.token;var p=new Date;p.setTime(p.getTime()+
511E3*m.expires_in-6E4);a.userTokenExpiresAt=p;a.refreshToken=m.refresh_token;p=new Date;p.setTime(p.getTime()+1E3*m.refresh_token_expires_in-6E4);a.refreshTokenExpiresAt=p;a.nickname=m.nickname;a.uid=m.nickname_uid;a.save();sync(n)}else 401!=this.status&&403!=this.status||r(n)};h.onerror=function(){401!=this.status&&403!=this.status||r(n)}}function z(n=null){try{if("string"!=typeof a.userToken||0==a.userToken.length)r(n);else{var l=(new Date(Date.parse(a.userTokenExpiresAt))).getTime(),h=(new Date(Date.parse(a.refreshTokenExpiresAt))).getTime(),
52m=Date.now();m>h&&(a.loggedInWithFacebook||a.loggedInWithGoogle)?F(n):m>l?va?oa.push(n):(va=!0,oa.push(n),u()):"function"===typeof n&&n()}}catch(p){r(n)}}function F(n=null){function l(){delete a.nickname;delete a.userToken;delete a.userTokenExpiresAt;delete a.refreshToken;delete a.refreshTokenExpiresAt;a.loggedInWithFacebook=!1;a.loggedInWithGoogle=!1;a.ratings={};a.save();"string"==typeof a.olduserToken&&0<a.olduserToken.length?(a.nickname=a.oldnickname,a.userToken=a.olduserToken,a.userTokenExpiresAt=
53a.olduserTokenExpiresAt,a.refreshToken=a.oldrefreshToken,a.refreshTokenExpiresAt=a.oldrefreshTokenExpiresAt,a.ratings=a.oldratings,delete a.oldnickname,delete a.olduserToken,delete a.olduserTokenExpiresAt,delete a.oldrefreshToken,delete a.oldrefreshTokenExpiresAt,delete a.oldratings,a.save(),sync(function(){z(n)})):r(n)}d(function(){var h=new XMLHttpRequest;h.open("POST",Oa);h.setRequestHeader("Content-Type","application/json");h.setRequestHeader("X-AUTH-TOKEN",a.SessionToken);h.setRequestHeader("X-APP-ID",
54"SudokuWeb");h.setRequestHeader("X-APP-VERSION",a.version);"undefined"!==typeof X_DEV_TOKEN&&h.setRequestHeader("X-DEV-TOKEN",X_DEV_TOKEN);h.setRequestHeader("X-USER-AUTH-TOKEN",a.userToken);h.send();h.onload=function(){l()};h.onerror=function(){l()}})}function y(n=null){function l(){delete a.nickname;delete a.userToken;delete a.userTokenExpiresAt;delete a.refreshToken;delete a.refreshTokenExpiresAt;a.loggedInWithFacebook=!1;a.loggedInWithGoogle=!1;a.ratings={};a.save();"string"==typeof a.olduserToken&&
550<a.olduserToken.length?(a.nickname=a.oldnickname,a.userToken=a.olduserToken,a.userTokenExpiresAt=a.olduserTokenExpiresAt,a.refreshToken=a.oldrefreshToken,a.refreshTokenExpiresAt=a.oldrefreshTokenExpiresAt,a.ratings=a.oldratings,delete a.oldnickname,delete a.olduserToken,delete a.olduserTokenExpiresAt,delete a.oldrefreshToken,delete a.oldrefreshTokenExpiresAt,delete a.oldratings,a.save(),sync(function(){z(n)})):r(n)}d(function(){var h=new XMLHttpRequest;h.open("POST",Pa);h.setRequestHeader("Content-Type",
56"application/json");h.setRequestHeader("X-AUTH-TOKEN",a.SessionToken);h.setRequestHeader("X-APP-ID","SudokuWeb");h.setRequestHeader("X-APP-VERSION",a.version);"undefined"!==typeof X_DEV_TOKEN&&h.setRequestHeader("X-DEV-TOKEN",X_DEV_TOKEN);h.setRequestHeader("X-USER-AUTH-TOKEN",a.userToken);h.send();h.onload=function(){l()};h.onerror=function(){l()}})}const A="undefined"!=typeof baseAPIURL?baseAPIURL:"https://games-api.appgeneration.com/",C=A+"auth/startsession/",D=A+"auth/registerdevice/",H=A+"game/sudoku/log/score",
57L=A+"game/sudoku/getrandompuzzle",R=A+"game/sudoku/getpuzzle",X=A+"game/sudoku/challenge/create",Y=A+"game/sudoku/challenge/get",la=A+"game/sudoku/get/leaderboard",Z=A+"game/sudoku/get/puzzlestats",ca=A+"game/sudoku/get/stats2",Qa=A+"game/sudoku/get/tourn
57ament",Ra=A+"users/verifynickname",Sa=A+"users/changenickname",Ta=A+"users/googleauth",Ua=A+"users/facebookauth",Oa=A+"users/logout",Pa=A+"users/fulllogout",Va=A+"users/getinfo",Ma=A+"users/getanon",Na=A+"users/refreshauth";let ta=!1,ma=[],va=!1,
58oa=[],ua=!1,na=[];try{var Ha="localStorage"in window&&null!==window.localStorage}catch(n){Ha=!1}const aa=Ha;let da=null;aa&&(da=localStorage.getItem("SoupID"),null==da&&(da=b(),window.localStorage.setItem("SoupID",da)));this.sendScore=function(n,l,h,m,p,q,v,x=!1,w=null,I=null,G=null){if(aa)try{d(V);function V(){z(Wa)}function Wa(){var Xa=JSON.stringify({time:Math.round(l),platform:2,puzzle_id:n,hints_used:h,errors_detected:m,challenge:p,success:q,registerid:v,source:x?1:0,gameplay:w,is_debug:"undefined"!==
59typeof X_DEV_TOKEN}),O=new XMLHttpRequest;O.open("POST",H);O.setRequestHeader("Content-Type","application/json");O.setRequestHeader("X-AUTH-TOKEN",a.SessionToken);O.setRequestHeader("X-APP-ID","SudokuWeb");O.setRequestHeader("X-APP-VERSION",a.version);"undefined"!==typeof X_DEV_TOKEN&&O.setRequestHeader("X-DEV-TOKEN",X_DEV_TOKEN);O.setRequestHeader("X-USER-AUTH-TOKEN",a.userToken);O.send(Xa);O.onload=function(){if(200==this.status){var Ia=JSON.parse(O.responseText);Ia.login_expired&&F();"function"===
60typeof I&&I(Ia)}else 401==this.status?g(V):"function"===typeof G&&G()};O.onerror=function(){"function"===typeof G&&G()}}}catch(V){return null}else"function"===typeof G&&G()};this.getLeaderboard=function(n,l,h,m=null,p=null){try{d(q);function q(){z(v)}function v(){var x=JSON.stringify({difficulty:n,number_pieces:l,time_span:h}),w=new XMLHttpRequest;w.open("POST",la);w.setRequestHeader("Content-Type","application/json");w.setRequestHeader("X-AUTH-TOKEN",a.SessionToken);w.setRequestHeader("X-APP-ID",
61"SudokuWeb");w.setRequestHeader("X-APP-VERSION",a.version);"undefined"!==typeof X_DEV_TOKEN&&w.setRequestHeader("X-DEV-TOKEN",X_DEV_TOKEN);w.setRequestHeader("X-USER-AUTH-TOKEN",a.userToken);w.send(x);w.onload=function(){if(200==this.status){var I=JSON.parse(w.responseText);"function"===typeof m&&m(I)}else 401==this.status?g(q):"function"===typeof p&&p()};w.onerror=function(){"function"===typeof p&&p()}}}catch(q){return null}};this.getPuzzleStats=function(n,l=!1,h=null,m=null){try{d(p);function p(){z(q)}
62function q(){var v=JSON.stringify({puzzle_id:n,number_of_elements:5,daily:l?1:0}),x=new XMLHttpRequest;x.open("POST",Z);x.setRequestHeader("Content-Type","application/json");x.setRequestHeader("X-AUTH-TOKEN",a.SessionToken);x.setRequestHeader("X-APP-ID","SudokuWeb");x.setRequestHeader("X-APP-VERSION",a.version);"undefined"!==typeof X_DEV_TOKEN&&x.setRequestHeader("X-DEV-TOKEN",X_DEV_TOKEN);x.setRequestHeader("X-USER-AUTH-TOKEN",a.userToken);x.send(v);x.onload=function(){if(200==this.status){var w=
63JSON.parse(x.responseText);w.success?"function"===typeof h&&h(w):m()}else 401==this.status?g(p):"function"===typeof m&&m()};x.onerror=function(){"function"===typeof m&&m()}}}catch(p){return null}};this.getStats=function(n=null,l=!1,h=null,m=null){try{d(p);function p(){z(q)}function q(){var v=new XMLHttpRequest;null!=n?v.open("GET",ca+"?force="+encodeURIComponent(l)+"&uid="+encodeURIComponent(n)):v.open("GET",ca+"?force="+encodeURIComponent(l));v.setRequestHeader("Content-Type","application/json");
64v.setRequestHeader("X-AUTH-TOKEN",a.SessionToken);v.setRequestHeader("X-APP-ID","SudokuWeb");v.setRequestHeader("X-APP-VERSION",a.version);"undefined"!==typeof X_DEV_TOKEN&&v.setRequestHeader("X-DEV-TOKEN",X_DEV_TOKEN);v.setRequestHeader("X-USER-AUTH-TOKEN",a.userToken);v.send();v.onload=function(){if(200==this.status){var x=JSON.parse(v.responseText);"function"===typeof h&&h(x)}else 401==this.status?g(p):"function"===typeof m&&m()};v.onerror=function(){"function"===typeof m&&m()}}}catch(p){return null}};
65this.getTournament=function(n,l,h,m=50,p=!1,q=null,v=null){try{d(x);function x(){z(w)}function w(){var I=new XMLHttpRequest;I.open("GET",Qa+"?force="+encodeURIComponent(p)+"&year="+encodeURIComponent(n)+"&week="+encodeURIComponent(l)+"&page="+encodeURIComponent(h)+"&noe="+encodeURIComponent(m));I.setRequestHeader("Content-Type","application/json");I.setRequestHeader("X-AUTH-TOKEN",a.SessionToken);I.setRequestHeader("X-APP-ID","SudokuWeb");I.setRequestHeader("X-APP-VERSION",a.version);"undefined"!==
66typeof X_DEV_TOKEN&&I.setRequestHeader("X-DEV-TOKEN",X_DEV_TOKEN);I.setRequestHeader("X-USER-AUTH-TOKEN",a.userToken);I.send();I.onload=function(){if(200==this.status){var G=JSON.parse(I.responseText);"function"===typeof q&&q(G)}else 401==this.status?g(x):"function"===typeof v&&v()};I.onerror=function(){"function"===typeof v&&v()}}}catch(x){return null}};this.getRandomPuzzle=function(n,l,h=null,m=null){if(aa)try{d(p);function p(){var q=JSON.stringify({difficulty:n,type:l?1:0}),v=new XMLHttpRequest;
67v.open("POST",L);v.setRequestHeader("Content-Type","application/json");v.setRequestHeader("X-AUTH-TOKEN",a.SessionToken);v.setRequestHeader("X-APP-ID","SudokuWeb");v.setRequestHeader("X-APP-VERSION",a.version);"undefined"!==typeof X_DEV_TOKEN&&v.setRequestHeader("X-DEV-TOKEN",X_DEV_TOKEN);v.send(q);v.onload=function(){if(200==this.status){var x=JSON.parse(v.responseText);"function"===typeof h&&h(x)}else 401==this.status?g(p):"function"===typeof m&&m()};v.onerror=function(){"function"===typeof m&&
68m()}}}catch(p){return null}else"function"===typeof m&&m()};this.getPuzzle=function(n,l=null,h=null){if(aa)try{d(m);function m(){var p=JSON.stringify({puzzle:n}),q=new XMLHttpRequest;q.open("POST",R);q.setRequestHeader("Content-Type","application/json");q.setRequestHeader("X-AUTH-TOKEN",a.SessionToken);q.setRequestHeader("X-APP-ID","SudokuWeb");q.setRequestHeader("X-APP-VERSION",a.version);"undefined"!==typeof X_DEV_TOKEN&&q.setRequestHeader("X-DEV-TOKEN",X_DEV_TOKEN);q.send(p);q.onload=function(){if(200==
69this.status){var v=JSON.parse(q.responseText);"function"===typeof l&&l(v)}else 401==this.status?g(sendTheScore):"function"===typeof h&&h()};q.onerror=function(){"function"===typeof h&&h()}}}catch(m){return null}else"function"===typeof h&&h()};this.createChallenge=function(n,l=null,h=null){if(aa)try{d(m);function m(){var p=JSON.stringify({challenger:n}),q=new XMLHttpRequest;q.open("POST",X);q.setRequestHeader("Content-Type","application/json");q.setRequestHeader("X-AUTH-TOKEN",a.SessionToken);q.setRequestHeader("X-APP-ID",
70"SudokuWeb");q.setRequestHeader("X-APP-VERSION",a.version);"undefined"!==typeof X_DEV_TOKEN&&q.setRequestHeader("X-DEV-TOKEN",X_DEV_TOKEN);q.send(p);q.onload=function(){if(200==this.status){var v=JSON.parse(q.responseText);"function"===typeof l&&l(v)}else 401==this.status?g(sendTheScore):"function"===typeof h&&h()};q.onerror=function(){"function"===typeof h&&h()}}}catch(m){return null}else"function"===typeof h&&h()};this.getChallengeData=function(n,l=null,h=null){if(aa)try{d(m);function m(){var p=
71JSON.stringify({challenge:n}),q=new XMLHttpRequest;q.open("POST",Y);q.setRequestHeader("Content-Type","application/json");q.setRequestHeader("X-AUTH-TOKEN",a.SessionToken);q.setRequestHeader("X-APP-ID","SudokuWeb");q.setRequestHeader("X-APP-VERSION",a.version);"undefined"!==typeof X_DEV_TOKEN&&q.setRequestHeader("X-DEV-TOKEN",X_DEV_TOKEN);q.send(p);q.onload=function(){if(200==this.status){var v=JSON.parse(q.responseText);"function"===typeof l&&l(v)}else 401==this.status?g(sendTheScore):"function"===
72typeof h&&h()};q.onerror=function(){"function"===typeof h&&h()}}}catch(m){return null}else"function"===typeof h&&h()};this.solveSudoku=function(n,l=null,h=null){try{var m=JSON.stringify({data:n}),p=new XMLHttpRequest;p.open("POST",solverUrl);p.setRequestHeader("Content-Type","application/json");p.setRequestHeader("X-CSRFToken",t);p.send(m);p.onload=function(){if(200==this.status){var q=JSON.parse(p.responseText);"function"===typeof l&&l(q)}else"function"===typeof h&&h()};p.onerror=function(){"function"===
73typeof h&&h()}}catch(q){"function"===typeof h&&h()}};this.forceAuthValidation=function(){d()};this.verifyNickname=function(n,l=null){function h(){var m=JSON.stringify({nickname:n}),p=new XMLHttpRequest;p.open("POST",Ra);p.setRequestHeader("Content-Type","application/json");p.setRequestHeader("X-AUTH-TOKEN",a.SessionToken);p.setRequestHeader("X-APP-ID","SudokuWeb");p.setRequestHeader("X-APP-VERSION",a.version);"undefined"!==typeof X_DEV_TOKEN&&p.setRequestHeader("X-DEV-TOKEN",X_DEV_TOKEN);p.send(m);
74p.onload=function(){if(200==this.status){var q=JSON.parse(p.responseText);"function"===typeof l&&l(q.exists,q.reason,q.nickname)}else 401==this.status?g(h):"function"===typeof l&&l(!1,"FAILED","")}}d(h)};this.changeNickname=function(n,l=null){function h(){z(m)}function m(){if(a.loggedInWithFacebook||a.loggedInWithGoogle){var p=JSON.stringify({nickname:n}),q=new XMLHttpRequest;q.open("POST",Sa);q.setRequestHeader("Content-Type","application/json");q.setRequestHeader("X-AUTH-TOKEN",a.SessionToken);
75q.setRequestHeader("X-APP-ID","SudokuWeb");q.setRequestHeader("X-APP-VERSION",a.version);"undefined"!==typeof X_DEV_TOKEN&&q.setRequestHeader("X-DEV-TOKEN",X_DEV_TOKEN);q.setRequestHeader("X-USER-AUTH-TOKEN",a.userToken);q.send(p);q.onload=function(){if(200==this.status){var v=JSON.parse(q.responseText);v.success&&(a.nickname=v.nickname,a.uid=v.nickname_uid);"function"===typeof l&&l(v.success)}else 401==this.status?g(h):"function"===typeof l&&l(!1)}}else location.reload()}d(h)};this.loginFacebook=
76function(n,l=!1,h=null,m=null){function p(){z(q)}function q(){var v=JSON.stringify({facebook_token:n,is_link:l}),x=new XMLHttpRequest;x.open("POST",Ua);x.setRequestHeader("Content-Type","application/json");x.setRequestHeader("X-AUTH-TOKEN",a.SessionToken);x.setRequestHeader("X-APP-ID","SudokuWeb");x.setRequestHeader("X-APP-VERSION",a.version);"string"==typeof a.userToken&&0<a.userToken.length&&x.setRequestHeader("X-USER-AUTH-TOKEN",a.userToken);x.send(v);x.onload=function(){if(200==this.status){var w=
77JSON.parse(x.responseText);if(!1===w.success&&"BANNED"===w.reason)"function"===typeof m&&m({banned:!0,bannedUntil:w.banned_until,bannedReason:w.banned_reason});else{var I=w.creation;"string"==typeof a.userToken&&0<a.userToken.length&&!a.loggedInWithGoogle&&a.userToken!=w.token&&(a.oldnickname=a.nickname,a.olduserToken=a.userToken,a.olduserTokenExpiresAt=a.userTokenExpiresAt,a.oldrefreshToken=a.refreshToken,a.oldrefreshTokenExpiresAt=a.refreshTokenExpiresAt,a.oldratings=a.ratings);a.nickname=w.nickname;
78a.uid=w.nickname_uid;a.userToken=w.token;var G=new Date;G.setTime(G.getTime()+1E3*w.expires_in-6E4);a.userTokenExpiresAt=G;a.refreshToken=w.refresh_token;G=new Date;G.setTime(G.getTime()+1E3*w.refresh_token_expires_in-6E4);a.refreshTokenExpiresAt=G;a.loggedInWithFacebook=!0;a.ratings={};a.save();sync(h);if(I)if(l)try{gtag("event","Account Linked - Facebook",{event_category:"Accounts",event_label:(new Date).toISOString().split("T")[0]})}catch(V){}else try{gtag("event","Account Created - Facebook",
79{event_category:"Accounts",event_label:(new Date).toISOString().split("T")[0]})}catch(V){}}}else 401==this.status?g(p):"function"===typeof m&&m({status:this.status})}}d(p)};this.loginGoogle=function(n,l=!1,h=null,m=null){function p(){z(q)}function q(){var v=JSON.stringify({google_token:n,is_link:l}),x=new XMLHttpRequest;x.open("POST",Ta);x.setRequestHeader("Content-Type","application/json");x.setRequestHeader("X-AUTH-TOKEN",a.SessionToken);x.setRequestHeader("X-APP-ID","SudokuWeb");x.setRequestHeader("X-APP-VERSION",
80a.version);"string"==typeof a.userToken&&0<a.userToken.length&&x.setRequestHeader("X-USER-AUTH-TOKEN",a.userToken);x.send(v);x.onload=function(){if(200==this.status){var w=JSON.parse(x.responseText);if(!1===w.success&&"BANNED"===w.reason)"function"===typeof m&&m({banned:!0,bannedUntil:w.banned_until,bannedReason:w.banned_reason});else{var I=w.creation;"string"==typeof a.userToken&&0<a.userToken.length&&!a.loggedInWithFacebook&&a.userToken!=w.token&&(a.oldnickname=a.nickname,a.olduserToken=a.userToken,
81a.olduserTokenExpiresAt=a.userTokenExpiresAt,a.oldrefreshToken=a.refreshToken,a.oldrefreshTokenExpiresAt=a.refreshTokenExpiresAt,a.oldratings=a.ratings);a.nickname=w.nickname;a.uid=w.nickname_uid;a.userToken=w.token;var G=new Date;G.setTime(G.getTime()+1E3*w.expires_in-6E4);a.userTokenExpiresAt=G;a.refreshToken=w.refresh_token;G=new Date;G.setTime(G.getTime()+1E3*w.refresh_token_expires_in-6E4);a.refreshTokenExpiresAt=G;a.loggedInWithGoogle=!0;a.ratings={};a.save();sync(h);if(I)if(l)try{gtag("event",
82"Account Linked - Google",{event_category:"Accounts",event_label:(new Date).toISOString().split("T")[0]})}catch(V){}else try{gtag("event","Account Created - Google",{event_category:"Accounts",event_label:(new Date).toISOString().split("T")[0]})}catch(V){}}}else 401==this.status?g(p):"function"===typeof m&&m({status:this.status})}}d(p)};this.updateInfo=function(n=null){function l(){z(h)}function h(){var p=new XMLHttpRequest;p.open("POST",Va);p.setRequestHeader("Content-Type","application/json");p.setRequestHeader("X-AUTH-TOKEN",
83a.SessionToken);p.setRequestHeader("X-APP-ID","SudokuWeb");p.setRequestHeader("X-APP-VERSION",a.version);"undefined"!==typeof X_DEV_TOKEN&&p.setRequestHeader("X-DEV-TOKEN",X_DEV_TOKEN);p.setRequestHeader("X-USER-AUTH-TOKEN",a.userToken);p.send();p.onload=function(){if(200==this.status){var q=JSON.parse(p.responseText);a.nickname=q.nickname;a.uid=q.nickname_uid;a.ratings={...a.ratings,...q.ratings};"function"===typeof n&&n(q.linked_google,q.linked_facebook,1<m)}else 401==this.status&&(0===m?(m=1,g(l)):
84(m=2,F(function(){g(l)})))}}let m=0;d(l)};this.logout=function(n=null){F(n)};this.logoutFull=function(n=null){y(n)}},Q=new function(){let b=document.getElementById("push-request-modal"),e=document.getElementById("base-request"),f=document.getElementById("image-aid"),g=null,c=null,d=null,k=null,r=null;this.open=function(u=null,z=null,F=null,y=null,A=null){g=u;c=z;d=F;k=y;r=A;f.style.display="none";e.style.display="block";b.style.display="block";"function"===typeof g&&g()};this.openVisualAid=function(u=
85null,z=null,F=null,y=null,A=null){g=u;c=z;d=F;k=y;r=A;f.style.display="block";e.style.display="none";b.style.display="block";"function"===typeof g&&g()};this.accept=function(u){b.style.display="none";u.stopPropagation();"function"===typeof c&&c()};this.reject=function(u){b.style.display="none";u.stopPropagation();"function"===typeof d&&d();a.nextPushRequest=(new Date).getTime()+6048E5};this.dismiss=function(u){b.style.display="none";u.stopPropagation();"function"===typeof k&&k();a.nextPushRequest=
86(new Date).getTime()+3E6};this.snooze=function(u){b.style.display="none";u.stopPropagation();"function"===typeof r&&r();a.nextPushRequest=(new Date).getTime()+2592E6};this.close=function(){b.style.display="none"}};(function(){document.getElementById("push-request-modal")&&(document.getElementById("push-request-modal").addEventListener("click",function(b){Q.dismiss(b)}),document.getElementById("push-request-modal").firstElementChild.addEventListener("click",function(b){b.stopPropagation();b.preventDefault()}),
87document.getElementById("push-request-accept").addEventListener("click",function(b){Q.accept(b)}),document.getElementById("push-request-reject").addEventListener("click",function(b){Q.reject(b)}),document.getElementById("push-request-snooze").addEventListener("click",function(b){Q.snooze(b)}))})();"use strict";let E=null,M=[],K=[],J=[],N=!0,P=!1,ra=!1,B=new function(b=null,e=[]){function f(C){let D=performance.now(),H=C-k,L=D-u;k=C;u=D;F||y?F&&!y&&(d+=H):(c+=H,r+=L);window.requestAnimationFrame(f);
88C=g.getTimeString();null!=b&&z!=C&&(z=b.innerText=C)}let g=this,c=0,d=0,k=performance.now(),r=0,u=performance.now(),z="",F=!1,y=!1,A=!1;window.requestAnimationFrame(f);this.pause=function(){F=!F;let C={c:"",r:"",ref:"",a:"pause",v:0,t:Math.round(B.getPreciseTime()),tc:Math.round(B.getPreciseTimeCheck())};for(let D=0;D<e.length;D++)F?(e[D].classList.add("paused"),A||(J.push(C),d=0)):(e[D].classList.remove("paused"),A||(C.a="unpause",C.v=Math.round(d),J.push(C)))};this.isPaused=function(){return F||
89y};this.stop=function(){y=!0};this.restart=function(){F&&document.getElementById("togglePause").click();r=d=c=0;u=performance.now();k=performance.now();z="";F=y=!1};this.loadTime=function(C){c+=C;r+=C;k=performance.now();u=performance.now()};this.getTime=function(){return c};
89this.getPreciseTime=function(){return F||y?c:c+(performance.now()-k)};this.getPreciseTimeCheck=function(){return F||y?r:r+(performance.now()-u)};this.getTimeString=function(C=c){var D=C/1E3;C=Math.floor(D%86400/3600);let H=Math.floor(D%
903600/60);D=Math.floor(D%60);let L="";C&&(L=C+":");return L+((10>H?"0":"")+H+":")+((10>D?"0":"")+D)};document.addEventListener("visibilitychange",function(){document.hidden?F||(A=!0,g.pause()):F&&A&&(k=performance.now(),u=performance.now(),g.pause(),A=!1)})}(document.getElementById("puzzleTimer"),[document.getElementById("sudoku")]),Ca=null,ba=!1,pa=new function(){let b=document.getElementById("modal"),e=null,f=null;this.open=function(g=null,c=null){e=g;f=c;b.style.display="block"};this.accept=function(g){const c=
91a.currentGame.gameTime,d=a.currentGame.hintsUsed,k=a.currentGame.errorsDetected,r=JSON.parse(JSON.stringify(a.currentGame.replay)),u=a.currentGame.challengeID,z=a.currentGame.isDaily,F=a.currentGame.puzzleID;"function"===typeof e&&e();document.getElementById("modal").style.display="none";g.stopPropagation();(async()=>{let y=await qa(parseInt(c/2+2*d+k+667)+F);S.sendScore(F,c,d,k,u,!1,y,z,r,function(){delete a.savedGames[ha(difficulty)]})})()};this.reject=function(g){"function"===typeof f&&f();document.getElementById("modal").style.display=
92"none";g.stopPropagation()}};(function(){function b(){if(DAILY_GAME&&null!==a&&a.lastDailyPlay===(new Date).toISOString().slice(0,10)){B.stop();var c=a.lastDailyStats;c&&document.getElementById("daily-played-stats")?(document.getElementById("daily-played-stat-time").innerText=c.time,document.getElementById("daily-played-stat-points").innerText=c.points,document.getElementById("daily-played-stat-pctl").innerText=c.pctl):document.getElementById("daily-played-stats").style.display="none";document.getElementById("daily-played").style.display=
93"flex";ia(preloadedPuzzles[0].id,!0);wa()}else if(2<=difficulty&&null!==a&&a.savedGames.hasOwnProperty(g))if(c=a.savedGames[g],!DAILY_GAME||c.hasOwnProperty("date")&&(new Date).toISOString().slice(0,10)===c.date){a.currentGame=structuredClone(c);document.getElementById("hint").dataset.hints=Math.max(0,2-a.currentGame.hintsUsed);ja(c.gameState);B.loadTime(c.gameTime);M=c.undoTree;for(var d=0;d<M.length;d++)M[d].ele=document.querySelector(".cell[data-celln='"+M[d].ref+"']");K=c.redoTree;for(d=0;d<K.length;d++)K[d].ele=
94document.querySelector(".cell[data-celln='"+K[d].ref+"']");J=c.replay;d={c:"",r:"",ref:"",a:"loadGame",v:"",t:Math.round(B.getPreciseTime()),tc:Math.round(B.getPreciseTimeCheck())};J.push(d);ia(c.puzzleID,c.isDaily)}else U();else U()}function e(){let c=printUrl;c=c.substring(0,c.lastIndexOf("/")+1)+a.currentGame.puzzleID;"undefined"!==typeof isLetters&&isLetters&&(c+="-1");let d=window.open(c,"_blank");d.addEventListener("afterprint",function(k){d.close()});"undefined"!=typeof d.onload?d.onload=function(){d.focus();
95d.print()}:(d.focus(),d.print())}function f(c){S.getRandomPuzzle(c,function(d){U(d.puzzle)},function(){U()})}let g=ha(difficulty);challenge?null!==a&&a.savedGames.hasOwnProperty(g)?pa.open(function(){U(challenge.puzzle,challenge.id)},b):U(challenge.puzzle,challenge.id):b();document.getElementById("toggleMistakes").addEventListener("click",function(){if(ra=!ra){var c=document.querySelectorAll(".cell[data-key]:not([data-value=''])");for(var d=0;d<c.length;d++){let k=c[d];za(k)||(k.classList.contains("invalid2")||
96(a.currentGame.errorsDetected+=1),k.classList.add("invalid2"))}}
96else for(c=document.querySelectorAll(".cell.invalid2"),d=0;d<c.length;d++)c[d].classList.remove("invalid2")});document.getElementById("togglePause").addEventListener("click",function(){B.pause()});document.getElementById("challenge").addEventListener("click",function(){La()});document.querySelectorAll(".cell").forEach(function(c){c.addEventListener("focus",function(d){Aa(d.target)});c.addEventListener("keydown",function(d){var k=d.target;
97if(isFinite(d.key)&&0!=d.key&&(1<a.currentGame.gameDifficulty||1==a.currentGame.gameDifficulty&&6>=d.key||0==a.currentGame.gameDifficulty&&4>=d.key))N&&(K=[]),P?sa(k,d.key):T(k,d.key);else if(2>a.currentGame.gameDifficulty&&document.getElementById("sudoku").classList.contains("letters")&&65<=d.keyCode&&70>=d.keyCode)N&&(K=[]),P?sa(k,d.keyCode-64):T(k,d.keyCode-64);else if(48===d.keyCode||8===d.keyCode||46===d.keyCode||68===d.keyCode)N&&(K=[]),T(k,"");else switch(d.keyCode){case 27:k.classList.remove("active");
98fa();E=null;break;case 65:P=!P;null!=E&&E.focus();document.getElementById("notes").classList.toggle("active");break;case 78:P=!P;null!=E&&E.focus();document.getElementById("notes").classList.toggle("active");break;case 72:Fa();break;case 85:Da();break;case 82:Ea();break;case 9:k=parseInt(k.dataset.celln)+1;k=k>=puzzleSize*puzzleSize?0:k;document.querySelector(".cell[data-celln='"+k+"']").focus();d.stopPropagation();d.preventDefault();break;case 37:d=parseInt(k.dataset.column)-1;d=0>d?puzzleSize-1:
99d;document.querySelector(".cell[data-column='"+d+"'][data-row='"+k.dataset.row+"']").focus();break;case 39:d=parseInt(k.dataset.column)+1;d=d>puzzleSize-1?0:d;document.querySelector(".cell[data-column='"+d+"'][data-row='"+k.dataset.row+"']").focus();break;case 38:var r=parseInt(k.dataset.row)-1;r=0>r?puzzleSize-1:r;document.querySelector(".cell[data-column='"+k.dataset.column+"'][data-row='"+r+"']").focus();d.stopPropagation();d.preventDefault();break;case 40:r=parseInt(k.dataset.row)+1,r=r>puzzleSize-
1001?0:r,document.querySelector(".cell[data-column='"+k.dataset.column+"'][data-row='"+r+"']").focus(),d.stopPropagation(),d.preventDefault()}})});document.getElementById("new-game")&&document.getElementById("new-game").addEventListener("click",function(){document.getElementById("victory-screen")&&"none"!==document.getElementById("victory-screen").style.display?Ga():document.getElementById("new-game-menu").style.display="block"});document.getElementById("new-game-api")&&(document.getElementById("new-game-api").addEventListener("click",
101function(){Ga()}),document.getElementById("restart").addEventListener("click",function(){var c=document.querySelectorAll(".annotation.visible");for(var d=0;d<c.length;d++)c[d].classList.remove("visible");c=document.querySelectorAll(".cell[data-key]");for(d=0;d<c.length;d++)c[d].dataset.value="";
101c=document.querySelectorAll(".cell.invalid");for(d=0;d<c.length;d++)c[d].classList.remove("invalid");c=document.querySelectorAll(".cell.invalid2");for(d=0;d<c.length;d++)c[d].classList.remove("invalid2");c=
102document.querySelectorAll(".number");for(d=0;d<c.length;d++)c[d].classList="number";M=[];K=[];N=!0;document.getElementById("secondary-resume").classList.remove("visible");document.getElementById("challenge").classList.remove("visible");document.getElementById("challenge-resume").classList.remove("visible");document.getElementById("victory-screen").style.display="none";ba=!1;B.restart();c={c:"",r:"",ref:"",a:"restart",v:"",t:Math.round(B.getPreciseTime()),tc:Math.round(B.getPreciseTimeCheck())};J.push(c)}));
103document.querySelectorAll(".number").forEach(function(c){c.addEventListener("click",function(d){for(d=d.target;!d.classList.contains("number");)d=d.parentElement;null!=E&&(N&&(K=[]),P?sa(E,d.dataset.value):T(E,d.dataset.value),E.focus())})});document.getElementById("undo").addEventListener("click",function(){Da()});document.getElementById("redo").addEventListener("click",function(){Ea()});document.getElementById("del").addEventListener("click",function(){null!=E&&(N&&(K=[]),T(E,""))});document.getElementById("notes").addEventListener("click",
104function(){P=!P;null!=E&&E.focus();this.classList.toggle("active")});document.getElementById("hint").addEventListener("click",function(){Fa()});document.getElementById("sudoku-print")&&document.getElementById("sudoku-print").addEventListener("click",function(){e()});document.getElementById("modal").addEventListener("click",function(c){pa.reject(c)});document.getElementById("submit_modal").addEventListener("click",function(c){pa.accept(c)});document.getElementById("modal-reject").addEventListener("click",
105function(c){pa.reject(c)});window.addEventListener("beforeunload",function(c){c=a.savedGames[g];ba||!(0<M.length||0<K.length)||void 0!==c&&JSON.stringify(c.gameState)===JSON.stringify(W())&&c.undoTree.length==M.length?a.hasOwnProperty("gameState")||delete a.currentGame:(c=structuredClone(a.currentGame),c.gameState=W(),c.gameTime=B.getPreciseTime(),c.undoTree=M,c.redoTree=K,c.replay=J,a.savedGames[g]=c,delete a.currentGame);a.save()});document.getElementById("sudoku-solver")&&document.getElementById("sudoku-solver").addEventListener("click",
106function(){_123solveThePuzzleForMe(T,B)});document.querySelectorAll(".difficulty-option").forEach(function(c){c.addEventListener("click",function(){f(c.dataset.value)})})})()})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.