\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]"));function F(e){for(var _=0,t=0;t \n ").concat(_.name,"\n ").concat(_.help(Math.max(1,e.perks[_.id])),"\n ".concat(T("score_panel.upgrades_picked")," ".concat(T("score_panel.upcoming_levels")," ").concat(_,"
\n '.concat(c.title,'\n \n
\n\n'),i.slice(i.indexOf(c)+1).slice(0,3).forEach(function(e){s+='\n\n '.concat(e.title," \n
\n")})}var h=i.filter(function(e){return e.threshold>o&&e.threshold".concat(T("gameOver.test_run"),"
"):"","\n").concat(_,"
\n").concat(T("gameOver.cumulative_total",{startTs:o,endTs:l}),"
\n ").concat(s," \n "),{value:null,text:T("gameOver.restart"),help:""},' \n '.concat(ef(_N),"\n ").concat(function(){var e="";try{var _=JSON.parse(localStorage.getItem("breakout_71_runs_history")||"[]");_.sort(function(e,_){return e.score-_.score}).reverse(),(_=_.slice(0,100)).push(y(f({},_N.runStatistics),{perks:_N.perks,appVersion:J})),_N.isCreativeModeRun||localStorage.setItem("breakout_71_runs_history",JSON.stringify(_,null,2));var t=function(e,t,r){var a,n,s,l=_.map(function(e){return t(e)||0}),o=(a=Math).min.apply(a,W(l)),i=(n=Math).max.apply(n,W(l));if(o===i)return"";i-o<10&&(o=Math.max(0,i-10),i=Math.max(i,o+10));var u=Math.min(l.length,10);if(u<3)return"";for(var c=[],p=[],d=0;d1?"s":""," between ").concat(Math.floor(o+_*m)," and ").concat(Math.floor(o+(_+1)*m)).concat(r,'"\n >').concat(!e&&" "||_==v&&b+r||Math.round(p[_]/e)+r,"")}).join("");return'".concat(T("gameOver.stats.intro",{count:_.length-1}),"
")+e)}catch(e){console.warn(e)}return e}()," \n ")]}).then(function(){return _U({levelToAvoid:ek(_N).name})})}}function e7(e,_){var t=(null==_?void 0:_.level)?Q.filter(function(e){return e.name===(null==_?void 0:_.level)}):[],r=Q.filter(function(_){return e>=_.threshold}).filter(function(e){return e.name!==(null==_?void 0:_.level)}).filter(function(e){return e.name!==(null==_?void 0:_.levelToAvoid)}).sort(function(){return Math.random()-.5});return t.concat(r.slice(0,10).sort(function(e,_){return e.sortKey-_.sortKey}))}function e8(e){var _=H(),t=e7(_,e),r=f({},ed($),(null==e?void 0:e.perks)||{}),a=y(f({runLevels:t,level:t[0],currentLevel:0,upgradesOfferedFor:-1,perks:r,bannedPerks:ed($),puckWidth:200,baseSpeed:12,combo:1,gridSize:12,running:!1,isGameOver:!1,ballStickToPuck:!0,puckPosition:400,lastPuckPosition:400,lastPuckMove:0,pauseTimeout:null,canvasWidth:0,canvasHeight:0,offsetX:0,offsetXRoundedDown:0,gameZoneWidth:0,gameZoneWidthRoundedUp:0,gameZoneHeight:0,brickWidth:0,score:0,lastScoreIncrease:-1e3,lastExplosion:-1e3,lastBrickBroken:0,highScore:parseFloat(localStorage.getItem("breakout-3-hs")||"0"),balls:[],ballsColor:"white",bricks:[],brickHP:[],lights:{indexMin:0,total:0,list:[]},particles:{indexMin:0,total:0,list:[]},texts:{indexMin:0,total:0,list:[]},coins:{indexMin:0,total:0,list:[]},respawns:{indexMin:0,total:0,list:[]},levelStartScore:0,levelMisses:0,levelSpawnedCoins:0,puckColor:"#FFF",ballSize:20,coinSize:14,puckHeight:20,totalScoreAtRunStart:_,isCreativeModeRun:ep(r)>1,pauseUsesDuringRun:0,keyboardPuckSpeed:0,lastTick:performance.now(),lastTickDown:0,runStatistics:{started:Date.now(),levelsPlayed:0,runTime:0,coins_spawned:0,score:0,bricks_broken:0,misses:0,balls_lost:0,puck_bounces:0,wall_bounces:0,upgrades_picked:1,max_combo:1,max_level:0},lastOffered:{},levelTime:0,winAt:0,levelWallBounces:0,needsRender:!0,autoCleanUses:0},{aboutToPlaySound:{wallBeep:{vol:0,x:0},comboIncreaseMaybe:{vol:0,x:0},comboDecrease:{vol:0,x:0},coinBounce:{vol:0,x:0},explode:{vol:0,x:0},lifeLost:{vol:0,x:0},coinCatch:{vol:0,x:0},colorChange:{vol:0,x:0}}}),{rerolls:0,loop:0,baseCombo:1,levelsPerLoop:null!==(u=null==e?void 0:e.levelsPerLoop)&&void 0!==u?u:7,maxLoop:null!==(c=null==e?void 0:e.maxLoop)&&void 0!==c?c:0});if(_e(a),!ep(a.perks)){var n=eb(a).filter(function(e){return e.giftable}),s=e_("easy")&&"slow_down"||n[Math.floor(Math.random()*n.length)].id;r[s]=1,_o(a,s)}var l=!0,o=!1,i=void 0;try{for(var u,c,p,d=$[Symbol.iterator]();!(l=(p=d.next()).done);l=!0){var m=p.value;a.perks[m.id]&&_o(a,m.id)}}catch(e){o=!0,i=e}finally{try{l||null==d.return||d.return()}finally{if(o)throw i}}return a}function e9(e,_){e.puckPosition=_,e.needsRender=!0}function _e(e){__(e);var _,t=1+((null===(_=e.perks)||void 0===_?void 0:_.multiball)||0),r=e.puckWidth/(t+1);e.balls=[],e.ballsColor="#FFF",(e.perks.picky_eater||e.perks.pierce_color)&&(e.ballsColor=function(e){var _,t,r={};e.forEach(function(e){return r[e]=(r[e]||0)+1});var a=(t=Math).max.apply(t,W(Object.keys(r).map(function(e){return r[e]})));return(_=Object.keys(r).filter(function(e){return r[e]==a}))[Math.floor(_.length*Math.random())]}(e.bricks.filter(function(e){return e}))||"#FFF");for(var a=0;a".concat(T("level_up.before_buttons",{score:e.score-e.levelStartScore,catchGain:a,levelSpawnedCoins:e.levelSpawnedCoins,time:Math.round(e.levelTime/1e3),timeGain:r,levelMisses:e.levelMisses,missesGain:s,levelWallBounces:e.levelWallBounces,wallHitsGain:n,compliment:o}),"\n
\n").concat(T("level_up.after_buttons",{level:e.currentLevel+1,max:ev(e)}),"
\n").concat(ey(e),"
\n")].concat(W(l),[ef(e),''])})];case 2:return"reroll"===(i=u.sent())?(t++,e.rerolls--):(e.perks[i]++,"instant_upgrade"===i&&(t+=2),e.runStatistics.upgrades_picked++),[3,1];case 3:return[2]}})})).apply(this,arguments)}function _G(e,_){return eg(_N,Math.floor(_/_N.brickWidth),Math.floor((e-_N.offsetX)/_N.brickWidth))}function _q(e){if(_N.bricks[e])return e}function _P(e,_,t){var r,a,n;return null!==(n=null!==(a=null!==(r=_q(_G(e-t,_-t)))&&void 0!==r?r:_q(_G(e+t,_-t)))&&void 0!==a?a:_q(_G(e+t,_+t)))&&void 0!==n?n:_q(_G(e-t,_+t))}window.addEventListener("resize",_z),window.addEventListener("fullscreenchange",_z),setInterval(function(){var e=eP.getBoundingClientRect(),_=e.width,t=e.height;(_!==_N.canvasWidth||t!==_N.canvasHeight)&&_z()},1e3),eP.addEventListener("mouseup",function(e){0===e.button&&(_N.running?_S(!0):(_x(),e_("pointerLock")&&eP.requestPointerLock&&eP.requestPointerLock().then()))}),eP.addEventListener("mousemove",function(e){document.pointerLockElement===eP?e9(_N,_N.puckPosition+e.movementX):e9(_N,e.x)}),eP.addEventListener("touchstart",function(e){var _;e.preventDefault(),(null===(_=e.touches)||void 0===_?void 0:_.length)&&(e9(_N,e.touches[0].pageX),__(_N),_x())}),eP.addEventListener("touchend",function(e){e.preventDefault(),_S(!0)}),eP.addEventListener("touchcancel",function(e){e.preventDefault(),_S(!0)}),eP.addEventListener("touchmove",function(e){var _;(null===(_=e.touches)||void 0===_?void 0:_.length)&&e9(_N,e.touches[0].pageX)});var _B=0,_H=60;function _R(){return _L.apply(this,arguments)}function _L(){return(_L=(0,b._)(function(){return(0,w.__generator)(this,function(e){switch(e.label){case 0:return _S(!0),[4,e4({title:_N.loop?T("score_panel.title_looped",{loop:_N.loop,score:_N.score,level:_N.currentLevel+1,max:ev(_N)}):T("score_panel.title",{score:_N.score,level:_N.currentLevel+1,max:ev(_N)}),content:[_N.isCreativeModeRun?"".concat(T("score_panel.test_run"),"
"):"",ef(_N),ey(_N),_N.rerolls?T("score_panel.rerolls_count",{rerolls:_N.rerolls}):""],allowClose:!0})];case 1:return e.sent(),[2]}})})).apply(this,arguments)}function _O(){return _C.apply(this,arguments)}function _C(){return(_C=(0,b._)(function(){var e,_,t,r;return(0,w.__generator)(this,function(a){switch(a.label){case 0:return _S(!0),_=(e=Math).max.apply(e,W($.map(function(e){return e.threshold}))),t=[{icon:K["icon:7_levels_run"],text:T("main_menu.normal"),help:T("main_menu.normal_help"),value:function(){_U({levelToAvoid:ek(_N).name,maxLoop:0})}},{icon:K["icon:unlocks"],text:T("main_menu.unlocks"),help:T("main_menu.unlocks_help"),value:function(){(function(){_D.apply(this,arguments)})()}},{icon:K["icon:loop"],text:T("main_menu.loop_run"),help:H()<_?T("sandbox.unlocks_at",{score:_}):T("main_menu.loop_run_help"),value:function(){_U({levelToAvoid:ek(_N).name,maxLoop:7})},disabled:H()<_},{icon:K["icon:sandbox"],text:T("sandbox.title"),help:H()<_?T("sandbox.unlocks_at",{score:_}):T("sandbox.help"),disabled:H()<_,value:function(){return(0,b._)(function(){var e,_;return(0,w.__generator)(this,function(t){switch(t.label){case 0:e=P("creativeModePerks",{}),t.label=1;case 1:return[4,e4({title:T("sandbox.title"),actionsAsGrid:!0,content:[T("sandbox.instructions")].concat(W($.map(function(_){return{icon:_.icon,text:_.name,help:(e[_.id]||0)+"/"+_.max,value:_,className:e[_.id]?"":"grey-out-unless-hovered"}})),[{text:T("sandbox.start"),value:"start",icon:K["icon:continue"]}])})];case 2:if(!(_=t.sent()))return[3,3];if("start"===_)return _U({perks:e}),[3,3];return _&&(e[_.id]=((e[_.id]||0)+1)%(_.max+1),B("creativeModePerks",e)),[3,1];case 3:return[2]}})})()}}].concat(W(function(e){if(!e_("donation_reminder"))return[];var _=D();return[{text:T("main_menu.donate",{hours:_}),help:T("main_menu.donate_help",{suggestion:Math.min(20,Math.max(1,.2*_)).toFixed(0)}),icon:K["icon:premium"],value:function(){window.open("https://paypal.me/renanlecaro","_blank")}}]}(0)),[{text:T("main_menu.settings_title"),help:T("main_menu.settings_help"),icon:K["icon:settings"],value:function(){_T()}},{icon:K["icon:help"],text:T("main_menu.help_title"),help:T("main_menu.help_help"),value:function(){return(0,b._)(function(){return(0,w.__generator)(this,function(e){switch(e.label){case 0:return[4,e4({title:T("main_menu.help_title"),allowClose:!0,content:[j(T("main_menu.help_content")),T("main_menu.help_upgrades")].concat(W($.map(function(e){return'\n\n\n\n ").concat(e.name,"
\n ").concat(e.help(1),"\n
\n ").concat(e.name,'
\n ').concat(e.credit," \n
".concat(T("unlocks.intro",{ts:e,highScore:_N.highScore}),"\n ").concat(r<100?T("unlocks.greyed_out_help"):"","
")].concat(W(_),[T("unlocks.level")],W(t)),allowClose:!0,actionsAsGrid:!0})];case 1:if(!(a=n.sent()))return[3,3];return[4,_j(_N)];case 2:n.sent()&&_U(y(f({},a),{maxLoop:0})),n.label=3;case 3:return[2]}})})).apply(this,arguments)}function _j(e){return _V.apply(this,arguments)}function _V(){return(_V=(0,b._)(function(e){return(0,w.__generator)(this,function(_){return!e.currentLevel||eK?[2,!0]:[2,e4({title:T("confirmRestart.title"),content:[T("confirmRestart.text"),{value:!0,text:T("confirmRestart.yes")},{value:!1,text:T("confirmRestart.no")}]})]})})).apply(this,arguments)}setInterval(function(){_H=_B,_B=0},1e3),window.addEventListener("visibilitychange",function(){document.hidden&&_S(!0)}),eI.addEventListener("click",function(e){e.preventDefault(),eK||_R()}),document.addEventListener("visibilitychange",function(){document.hidden&&_S(!0)}),document.getElementById("menu").addEventListener("click",function(e){e.preventDefault(),eK||_O()});var _Z={ArrowLeft:0,ArrowRight:0,Shift:0};function _I(e,_){_Z[e]=_,_N.keyboardPuckSpeed=(_Z.ArrowRight-_Z.ArrowLeft)*(1+2*_Z.Shift)*_N.gameZoneWidth/50}document.addEventListener("keydown",(t=(0,b._)(function(e){return(0,w.__generator)(this,function(_){return"f"!==e.key.toLowerCase()||e.ctrlKey||e.metaKey?e.key in _Z&&_I(e.key,1):(et("fullscreen"),_E())," "!==e.key||eK||(_N.running?_S(!0):_x(),e.preventDefault()),[2]})}),function(e){return t.apply(this,arguments)}));var _F=new Date;document.addEventListener("keyup",(r=(0,b._)(function(e){var _,t,r,a,n;return(0,w.__generator)(this,function(s){switch(s.label){case 0:if(n=document.querySelector("button:focus"),!(e.key in _Z))return[3,1];return _I(e.key,0),[3,10];case 1:if("ArrowDown"!==e.key||(null==n?void 0:null===(_=n.nextElementSibling)||void 0===_?void 0:_.tagName)!=="BUTTON")return[3,2];return null==n||null===(t=n.nextElementSibling)||void 0===t||t.focus(),[3,10];case 2:if("ArrowUp"!==e.key||(null==n?void 0:null===(r=n.previousElementSibling)||void 0===r?void 0:r.tagName)!=="BUTTON")return[3,3];return null==n||null===(a=n.previousElementSibling)||void 0===a||a.focus(),[3,10];case 3:if(!("Escape"===e.key&&eQ))return[3,4];return eQ(),[3,10];case 4:if(!("Escape"===e.key&&_N.running))return[3,5];return _S(!0),[3,10];case 5:if(!("m"===e.key.toLowerCase()&&!eK))return[3,6];return _O().then(),[3,10];case 6:if(!("s"===e.key.toLowerCase()&&!eK))return[3,7];return _R().then(),[3,10];case 7:if(!("r"===e.key.toLowerCase()&&!eK&&_F>Date.now()+1e3))return[3,9];return[4,_j(_N)];case 8:return s.sent()&&_U({levelToAvoid:ek(_N).name}),[3,10];case 9:return[2];case 10:return e.preventDefault(),[2]}})}),function(e){return r.apply(this,arguments)}));var _N=e8({});function _U(e){console.log("restart : ",e),_z(),Object.assign(_N,e8(e)),eY(),_c(_N,0)}_U(window.location.search.includes("stressTest")&&{perks:{pierce:2,bigger_explosions:10,sapper:3},levelsPerLoop:2}||{}),function e(){var _=performance.now(),t=_-_N.lastTick;_N.lastTick=_;var r=Math.min(4,t/(1e3/60));_N.keyboardPuckSpeed&&e9(_N,_N.puckPosition+_N.keyboardPuckSpeed),__(_N),_N.running&&(_N.levelTime+=t,_N.runStatistics.runTime+=t,function(e){var _=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;e.runStatistics.max_combo=Math.max(e.runStatistics.max_combo,e.combo),e.perks.addiction&&e.lastBrickBroken&&e.lastBrickBroken