\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]"));function I(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(e.title,'\n \n
\n '.concat(c.title,'\n \n
\n\n'),i.slice(i.indexOf(c)+1).slice(0,3).forEach(function(e){l+='\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:s}),"
\n ").concat(l," \n "),{value:null,text:T("gameOver.restart"),help:""},' \n '.concat(ev(_F),"\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({},_F.runStatistics),{perks:_F.perks,appVersion:Y})),_F.isCreativeModeRun||localStorage.setItem("breakout_71_runs_history",JSON.stringify(_,null,2));var t=function(e,t,r){var a,n,l,s=_.map(function(e){return t(e)||0}),o=(a=Math).min.apply(a,W(s)),i=(n=Math).max.apply(n,W(s));if(o===i)return"";i-o<10&&(o=Math.max(0,i-10),i=Math.max(i,o+10));var u=Math.min(s.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 _N({levelToAvoid:ey(_F).name})})}}function e6(e,_){var t=(null==_?void 0:_.level)?K.filter(function(e){return e.name===(null==_?void 0:_.level)}):[],r=K.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 e7(e){var _=R(),t=e6(_,e),r=f({},ep($),(null==e?void 0:e.perks)||{}),a=y(f({runLevels:t,level:t[0],currentLevel:0,upgradesOfferedFor:-1,perks:r,bannedPerks:ep($),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:ec(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(e9(a),!ec(a.perks)){var n=eg(a).filter(function(e){return e.giftable}),l=ee("easy")&&"slow_down"||n[Math.floor(Math.random()*n.length)].id;r[l]=1,_s(a,l)}var s=!0,o=!1,i=void 0;try{for(var u,c,p,d=$[Symbol.iterator]();!(s=(p=d.next()).done);s=!0){var m=p.value;a.perks[m.id]&&_s(a,m.id)}}catch(e){o=!0,i=e}finally{try{s||null==d.return||d.return()}finally{if(o)throw i}}return a}function e8(e,_){e.puckPosition=_,e.needsRender=!0}function e9(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:l,levelWallBounces:e.levelWallBounces,wallHitsGain:n,compliment:o}),"\n
\n").concat(T("level_up.after_buttons",{level:e.currentLevel+1,max:eb(e)}),"
\n").concat(ef(e),"
\n")].concat(W(s),[ev(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 _M(e,_){return eh(_F,Math.floor(_/_F.brickWidth),Math.floor((e-_F.offsetX)/_F.brickWidth))}function _G(e){if(_F.bricks[e])return e}function _H(e,_,t){var r,a,n;return null!==(n=null!==(a=null!==(r=_G(_M(e-t,_-t)))&&void 0!==r?r:_G(_M(e+t,_-t)))&&void 0!==a?a:_G(_M(e+t,_+t)))&&void 0!==n?n:_G(_M(e-t,_+t))}window.addEventListener("resize",_S),window.addEventListener("fullscreenchange",_S),setInterval(function(){var e=eH.getBoundingClientRect(),_=e.width,t=e.height;(_!==_F.canvasWidth||t!==_F.canvasHeight)&&_S()},1e3),eH.addEventListener("mouseup",function(e){0===e.button&&(_F.running?_x(!0):(_w(),ee("pointerLock")&&eH.requestPointerLock&&eH.requestPointerLock().then()))}),eH.addEventListener("mousemove",function(e){document.pointerLockElement===eH?e8(_F,_F.puckPosition+e.movementX):e8(_F,e.x)}),eH.addEventListener("touchstart",function(e){var _;e.preventDefault(),(null===(_=e.touches)||void 0===_?void 0:_.length)&&(e8(_F,e.touches[0].pageX),_e(_F),_w())}),eH.addEventListener("touchend",function(e){e.preventDefault(),_x(!0)}),eH.addEventListener("touchcancel",function(e){e.preventDefault(),_x(!0)}),eH.addEventListener("touchmove",function(e){var _;(null===(_=e.touches)||void 0===_?void 0:_.length)&&e8(_F,e.touches[0].pageX)});var _B=0,_q=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 _x(!0),[4,e2({title:_F.loop?T("score_panel.title_looped",{loop:_F.loop,score:_F.score,level:_F.currentLevel+1,max:eb(_F)}):T("score_panel.title",{score:_F.score,level:_F.currentLevel+1,max:eb(_F)}),content:[_F.isCreativeModeRun?"".concat(T("score_panel.test_run"),"
"):"",ev(_F),ef(_F),_F.rerolls?T("score_panel.rerolls_count",{rerolls:_F.rerolls}):""],allowClose:!0})];case 1:return e.sent(),[2]}})})).apply(this,arguments)}function _P(){return _O.apply(this,arguments)}function _O(){return(_O=(0,b._)(function(){var e,_,t,r;return(0,w.__generator)(this,function(a){switch(a.label){case 0:return _x(!0),_=(e=Math).max.apply(e,W($.map(function(e){return e.threshold}))),t=[{icon:J["icon:7_levels_run"],text:T("main_menu.normal"),help:T("main_menu.normal_help"),value:function(){_N({levelToAvoid:ey(_F).name,maxLoop:0})}},{icon:J["icon:unlocks"],text:T("main_menu.unlocks"),help:T("main_menu.unlocks_help"),value:function(){(function(){_E.apply(this,arguments)})()}},{icon:J["icon:loop"],text:T("main_menu.loop_run"),help:R()<_?T("sandbox.unlocks_at",{score:_}):T("main_menu.loop_run_help"),value:function(){_N({levelToAvoid:ey(_F).name,maxLoop:7})},disabled:R()<_},{icon:J["icon:sandbox"],text:T("sandbox.title"),help:R()<_?T("sandbox.unlocks_at",{score:_}):T("sandbox.help"),disabled:R()<_,value:function(){return(0,b._)(function(){var e,_;return(0,w.__generator)(this,function(t){switch(t.label){case 0:e=B("creativeModePerks",{}),t.label=1;case 1:return[4,e2({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:J["icon:continue"]}])})];case 2:if(!(_=t.sent()))return[3,3];if("start"===_)return _N({perks:e}),[3,3];return _&&(e[_.id]=((e[_.id]||0)+1)%(_.max+1),q("creativeModePerks",e)),[3,1];case 3:return[2]}})})()}}].concat(W(function(e){if(!ee("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:J["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:J["icon:settings"],value:function(){_C()}}]),[4,e2({title:T("main_menu.title"),content:W(t).concat([T("main_menu.footer_html",{appVersion:Y})]),allowClose:!0})];case 1:return(r=a.sent())&&(r(),_F.needsRender=!0),[2]}})})).apply(this,arguments)}function _C(){return _T.apply(this,arguments)}function _T(){return(_T=(0,b._)(function(){var e,_,t,r,a,n,l,s;return(0,w.__generator)(this,function(o){switch(o.label){case 0:_x(!0),e=[],_=!0,t=!1,r=void 0;try{for(a=function(){var _=l.value;Q[_]&&e.push({icon:ee(_)?J["icon:checkmark_checked"]:J["icon:checkmark_unchecked"],text:Q[_].name,help:Q[_].help,value:function(){e_(_),_S(),_A(),_C()}})},n=Object.keys(Q)[Symbol.iterator]();!(_=(l=n.next()).done);_=!0)a()}catch(e){t=!0,r=e}finally{try{_||null==n.return||n.return()}finally{if(t)throw r}}return e.push({text:T("main_menu.reset"),help:T("main_menu.reset_help"),value:function(){return(0,b._)(function(){return(0,w.__generator)(this,function(e){switch(e.label){case 0:return[4,e2({title:T("main_menu.reset"),content:[T("main_menu.reset_instruction"),{text:T("main_menu.reset_confirm"),value:!0},{text:T("main_menu.reset_cancel"),value:!1}],allowClose:!0})];case 1:return e.sent()&&(localStorage.clear(),window.location.reload()),[2]}})})()}}),e.push({text:T("main_menu.download_save_file"),help:T("main_menu.download_save_file_help"),value:function(){return(0,b._)(function(){var e,_,t,r,a,n;return(0,w.__generator)(this,function(l){for(_=0,e={};_".concat(T("unlocks.intro",{ts:e,highScore:_F.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,_D(_F)];case 2:n.sent()&&_N(y(f({},a),{maxLoop:0})),n.label=3;case 3:return[2]}})})).apply(this,arguments)}function _D(e){return _Z.apply(this,arguments)}function _Z(){return(_Z=(0,b._)(function(e){return(0,w.__generator)(this,function(_){return!e.currentLevel||eJ?[2,!0]:[2,e2({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(){_q=_B,_B=0},1e3),window.addEventListener("visibilitychange",function(){document.hidden&&_x(!0)}),eV.addEventListener("click",function(e){e.preventDefault(),eJ||_R()}),document.addEventListener("visibilitychange",function(){document.hidden&&_x(!0)}),document.getElementById("menu").addEventListener("click",function(e){e.preventDefault(),eJ||_P()});var _j={ArrowLeft:0,ArrowRight:0,Shift:0};function _V(e,_){_j[e]=_,_F.keyboardPuckSpeed=(_j.ArrowRight-_j.ArrowLeft)*(1+2*_j.Shift)*_F.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 _j&&_V(e.key,1):(e_("fullscreen"),_A())," "!==e.key||eJ||(_F.running?_x(!0):_w(),e.preventDefault()),[2]})}),function(e){return t.apply(this,arguments)}));var _I=new Date;document.addEventListener("keyup",(r=(0,b._)(function(e){var _,t,r,a,n;return(0,w.__generator)(this,function(l){switch(l.label){case 0:if(n=document.querySelector("button:focus"),!(e.key in _j))return[3,1];return _V(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&&eK))return[3,4];return eK(),[3,10];case 4:if(!("Escape"===e.key&&_F.running))return[3,5];return _x(!0),[3,10];case 5:if(!("m"===e.key.toLowerCase()&&!eJ))return[3,6];return _P().then(),[3,10];case 6:if(!("s"===e.key.toLowerCase()&&!eJ))return[3,7];return _R().then(),[3,10];case 7:if(!("r"===e.key.toLowerCase()&&!eJ&&_I>Date.now()+1e3))return[3,9];return[4,_D(_F)];case 8:return l.sent()&&_N({levelToAvoid:ey(_F).name}),[3,10];case 9:return[2];case 10:return e.preventDefault(),[2]}})}),function(e){return r.apply(this,arguments)}));var _F=e7({});function _N(e){console.log("restart : ",e),_S(),Object.assign(_F,e7(e)),eU(),_u(_F,0)}_N(window.location.search.includes("stressTest")&&{perks:{pierce:2,bigger_explosions:10,sapper:3},levelsPerLoop:2}||{}),function e(){var _=performance.now(),t=_-_F.lastTick;_F.lastTick=_;var r=Math.min(4,t/(1e3/60));_F.keyboardPuckSpeed&&e8(_F,_F.puckPosition+_F.keyboardPuckSpeed),_e(_F),_F.running&&(_F.levelTime+=t,_F.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