\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]"));function N(e){for(var _=0,t=0;t \n ").concat(_.name,"\n ").concat(_.help(Math.max(1,e.perks[_.id])),"\n ".concat(A("score_panel.upgrades_picked")," ".concat(A("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>l&&e.threshold".concat(A("gameOver.test_run"),"
"):"","\n").concat(_,"
\n").concat(A("gameOver.cumulative_total",{startTs:l,endTs:o}),"
\n ").concat(s," \n "),{value:null,text:A("gameOver.restart"),help:""},' \n '.concat(ey(_U),"\n ").concat(function(e){var _="";try{var t=JSON.parse(localStorage.getItem("breakout_71_runs_history")||"[]");t.sort(function(e,_){return e.score-_.score}).reverse(),(t=t.slice(0,100)).push(k(y({},e.runStatistics),{perks:e.perks,mode:e.mode,appVersion:K})),e.isCreativeModeRun||localStorage.setItem("breakout_71_runs_history",JSON.stringify(t,null,2));var r=function(_,r,a){var n,s,o,l=t.filter(function(_){return(_.mode||"short")===e.mode}).map(function(e){return r(e)||0}),i=(n=Math).min.apply(n,w(l)),u=(s=Math).max.apply(s,w(l));if(i===u)return"";u-i<10&&(i=Math.max(0,u-10),u=Math.max(u,i+10));var c=Math.min(l.length,10);if(c<3)return"";for(var p=[],d=[],m=0;m".concat(A("gameOver.stats.intro",{count:t.length-1}),"
")+_)}catch(e){console.warn(e)}return _}(_U)," \n ")]}).then(function(){return _X({levelToAvoid:eW(_U).name})})}}function e8(e){var _=R(),t=(u=(null==e?void 0:e.level)?$.filter(function(_){return _.name===(null==e?void 0:e.level)}):[],c=$.filter(function(e){return _>=e.threshold}).filter(function(_){return _.name!==(null==e?void 0:e.level)}).filter(function(_){return _.name!==(null==e?void 0:e.levelToAvoid)}).sort(function(){return Math.random()-.5}),u.concat(c.slice(0,10).sort(function(e,_){return e.sortKey-_.sortKey}))),r=y({},em(ee),(null==e?void 0:e.perks)||{}),a=k(y({runLevels:t,level:t[0],currentLevel:0,upgradesOfferedFor:-1,perks:r,bannedPerks:em(ee),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-"+(null==e?void 0:e.mode))||"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:ed(r)>1,pauseUsesDuringRun:0,keyboardPuckSpeed:0,lastTick:performance.now(),lastTickDown:0,runStatistics:{started:Date.now(),levelsPlayed:0,runTime:0,coins_spawned:0,score:0,best_level_score:-1,worst_level_score:-1,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,mode:(null==e?void 0:e.mode)||"short",readyToRender:!0});if(__(a),!ed(a.perks)){var n=ev(a).filter(function(e){return e.giftable}),s=et("easy")&&"slow_down"||n[Math.floor(Math.random()*n.length)].id;r[s]=1,_i(a,s)}var o=!0,l=!1,i=void 0;try{for(var u,c,p,d=ee[Symbol.iterator]();!(o=(p=d.next()).done);o=!0){var m=p.value;a.perks[m.id]&&_i(a,m.id)}}catch(e){l=!0,i=e}finally{try{o||null==d.return||d.return()}finally{if(l)throw i}}return a}var v=g("5mG9B"),x=g("6QuVk");function e9(){return(e9=(0,v._)(function(e,_){var t,r,a;return(0,x.__generator)(this,function(n){switch(n.label){case 0:e.readyToRender=!1,t=B("creativeModePerks_"+_,{}),ee.forEach(function(_){t[_.id]=Math.min(t[_.id]||0,_.max-e.bannedPerks[_.id])}),a=["extra_levels","shunt","one_more_choice","instant_upgrade"],n.label=1;case 1:return[4,e4({title:A("sandbox.title",{lvl:_+1}),actionsAsGrid:!0,content:[A("sandbox.instructions")].concat(w(ee.filter(function(e){return!a.includes(e.id)}).map(function(_){return{icon:_.icon,text:_.name,help:(t[_.id]||0)+"/"+(_.max-e.bannedPerks[_.id]),value:_,disabled:_.max-e.bannedPerks[_.id]<=0,className:t[_.id]?"sandbox":"sandbox grey-out-unless-hovered"}})),[A("sandbox.select_level")],w($.map(function(e){return{icon:Q[e.name],text:e.name,value:e}})))})];case 2:if(!(r=n.sent()))return[3,3];if("bricks"in r)return H("creativeModePerks_"+_,t),ee.forEach(function(_){e.perks[_.id]=t[_.id],e.bannedPerks[_.id]+=t[_.id]}),e.runLevels[_]=r,[3,3];return r&&(t[r.id]=((t[r.id]||0)+1)%(r.max-e.bannedPerks[r.id]+1)),[3,1];case 3:return[2]}})})).apply(this,arguments)}function _e(e,_){e.puckPosition=_,e.needsRender=!0}function __(e){_t(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(A("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:l}),"\n
\n").concat(A("level_up.after_buttons",{level:e.currentLevel+1,max:ef(e)}),"
\n").concat(ek(e),"
\n")].concat(w(o),[ey(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 eb(_U,Math.floor(_/_U.brickWidth),Math.floor((e-_U.offsetX)/_U.brickWidth))}function _q(e){if(_U.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=eB.getBoundingClientRect(),_=e.width,t=e.height;(_!==_U.canvasWidth||t!==_U.canvasHeight)&&_z()},1e3),eB.addEventListener("mouseup",function(e){0===e.button&&(_U.running?_S(!0):(_x(),et("pointerLock")&&eB.requestPointerLock&&eB.requestPointerLock().then()))}),eB.addEventListener("mousemove",function(e){document.pointerLockElement===eB?_e(_U,_U.puckPosition+e.movementX):_e(_U,e.x)}),eB.addEventListener("touchstart",function(e){var _;e.preventDefault(),(null===(_=e.touches)||void 0===_?void 0:_.length)&&(_e(_U,e.touches[0].pageX),_t(_U),_x())}),eB.addEventListener("touchend",function(e){e.preventDefault(),_S(!0)}),eB.addEventListener("touchcancel",function(e){e.preventDefault(),_S(!0)}),eB.addEventListener("touchmove",function(e){var _;(null===(_=e.touches)||void 0===_?void 0:_.length)&&_e(_U,e.touches[0].pageX)});var _B=0,_H=60;function _R(){return _L.apply(this,arguments)}function _L(){return(_L=(0,v._)(function(){return(0,x.__generator)(this,function(e){switch(e.label){case 0:return _S(!0),[4,e5({title:_U.loop?A("score_panel.title_looped",{loop:_U.loop,score:_U.score,level:_U.currentLevel+1,max:ef(_U)}):A("score_panel.title",{score:_U.score,level:_U.currentLevel+1,max:ef(_U)}),content:[_U.isCreativeModeRun?"".concat(A("score_panel.test_run"),"
"):"",ey(_U),ek(_U),_U.rerolls?A("score_panel.rerolls_count",{rerolls:_U.rerolls}):""],allowClose:!0})];case 1:return e.sent(),[2]}})})).apply(this,arguments)}setInterval(function(){_H=_B,_B=0},1e3),window.addEventListener("visibilitychange",function(){document.hidden&&_S(!0)}),eF.addEventListener("click",function(e){e.preventDefault(),eQ||_R()}),document.addEventListener("visibilitychange",function(){document.hidden&&_S(!0)}),document.getElementById("menu").addEventListener("click",function(e){e.preventDefault(),eQ||_O()});var _C=(p=Math).max.apply(p,w(ee.map(function(e){return e.threshold})));function _O(){return _T.apply(this,arguments)}function _T(){return(_T=(0,v._)(function(){var e,_;return(0,x.__generator)(this,function(t){switch(t.label){case 0:return _S(!0),e=[{icon:Q["icon:7_levels_run"],text:A("main_menu.normal"),help:A("main_menu.normal_help"),value:function(){_X({levelToAvoid:eW(_U).name,mode:"short"})}},{icon:Q["icon:unlocks"],text:A("main_menu.unlocks"),help:A("main_menu.unlocks_help"),value:function(){(function(){_D.apply(this,arguments)})()}},{icon:Q["icon:loop"],text:A("main_menu.loop_run"),help:R()<_C?A("sandbox.unlocks_at",{score:_C}):A("main_menu.loop_run_help"),value:function(){_X({levelToAvoid:eW(_U).name,mode:"long"})},disabled:R()<_C},{icon:Q["icon:sandbox"],text:A("sandbox.menu_entry"),help:R()<_C?A("sandbox.unlocks_at",{score:_C}):A("sandbox.help"),disabled:R()<_C,value:function(){return(0,v._)(function(){return(0,x.__generator)(this,function(e){switch(e.label){case 0:return[4,_V(_U)];case 1:return e.sent()&&_X({mode:"creative"}),[2]}})})()}}].concat(w(function(e){if(!et("donation_reminder"))return[];var _=D();return[{text:A("main_menu.donate",{hours:_}),help:A("main_menu.donate_help",{suggestion:Math.min(20,Math.max(1,.2*_)).toFixed(0)}),icon:Q["icon:premium"],value:function(){window.open("https://paypal.me/renanlecaro","_blank")}}]}(0)),[{text:A("main_menu.settings_title"),help:A("main_menu.settings_help"),icon:Q["icon:settings"],value:function(){_A()}},{icon:Q["icon:help"],text:A("main_menu.help_title"),help:A("main_menu.help_help"),value:function(){return(0,v._)(function(){return(0,x.__generator)(this,function(e){switch(e.label){case 0:return[4,e5({title:A("main_menu.help_title"),allowClose:!0,content:[V(A("main_menu.help_content")),A("main_menu.help_upgrades")].concat(w(ee.map(function(e){return'\n\n ").concat(e.name,"
\n ").concat(e.help(1),"\n
\n ").concat(e.name,'
\n ').concat(e.credit," \n
".concat(A("unlocks.intro",{ts:e}),"\n ").concat(r<100?A("unlocks.greyed_out_help"):"","
")].concat(w(_),[A("unlocks.level")],w(t)),allowClose:!0,actionsAsGrid:!0})];case 1:if(!(a=n.sent()))return[3,3];return[4,_V(_U)];case 2:n.sent()&&_X(k(y({},a),{mode:"short"})),n.label=3;case 3:return[2]}})})).apply(this,arguments)}function _V(e){return _Z.apply(this,arguments)}function _Z(){return(_Z=(0,v._)(function(e){return(0,x.__generator)(this,function(_){return!e.currentLevel||eQ?[2,!0]:[2,e5({title:A("confirmRestart.title"),content:[A("confirmRestart.text"),{value:!0,text:A("confirmRestart.yes")},{value:!1,text:A("confirmRestart.no")}]})]})})).apply(this,arguments)}var _I={ArrowLeft:0,ArrowRight:0,Shift:0};function _F(e,_){_I[e]=_,_U.keyboardPuckSpeed=(_I.ArrowRight-_I.ArrowLeft)*(1+2*_I.Shift)*_U.gameZoneWidth/50}document.addEventListener("keydown",(t=(0,v._)(function(e){return(0,x.__generator)(this,function(_){return"f"!==e.key.toLowerCase()||e.ctrlKey||e.metaKey?e.key in _I&&_F(e.key,1):(er("fullscreen"),_j())," "!==e.key||eQ||(_U.running?_S(!0):_x(),e.preventDefault()),[2]})}),function(e){return t.apply(this,arguments)}));var _N=new Date;document.addEventListener("keyup",(r=(0,v._)(function(e){var _,t,r,a,n;return(0,x.__generator)(this,function(s){switch(s.label){case 0:if(n=document.querySelector("button:focus"),!(e.key in _I))return[3,1];return _F(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&&e$))return[3,4];return e$(),[3,10];case 4:if(!("Escape"===e.key&&_U.running))return[3,5];return _S(!0),[3,10];case 5:if(!("m"===e.key.toLowerCase()&&!eQ))return[3,6];return _O().then(),[3,10];case 6:if(!("s"===e.key.toLowerCase()&&!eQ))return[3,7];return _R().then(),[3,10];case 7:if(!("r"===e.key.toLowerCase()&&!eQ&&_N>Date.now()+1e3))return[3,9];return[4,_V(_U)];case 8:return s.sent()&&_X({levelToAvoid:eW(_U).name,mode:_U.mode}),[3,10];case 9:return[2];case 10:return e.preventDefault(),[2]}})}),function(e){return r.apply(this,arguments)}));var _U=e8({mode:"short"});function _X(e){console.log("restart : ",e),_z(),Object.assign(_U,e8(e)),eJ(),_c(_U,0)}_X(window.location.search.includes("stressTest")&&{perks:{pierce:2,bigger_explosions:10,sapper:3},mode:"short"}||{mode:"short"}),function e(){var _=performance.now(),t=_-_U.lastTick;_U.lastTick=_;var r=Math.min(4,t/(1e3/60));_U.keyboardPuckSpeed&&_e(_U,_U.puckPosition+_U.keyboardPuckSpeed),_t(_U),_U.running&&(_U.levelTime+=t,_U.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