\n ").concat(a.name,"\n ").concat(a.help(Math.max(1,e.perks[a.id])),"\n
\n ").concat(t.reverse().join(""),"\n".concat(et("score_panel.upgrades_picked"),"
")+a.join("")}function eK(e,a){if(!e.perks.clairvoyant||e.creative)return"";for(var r="",t=0;t".concat(et("score_panel.upcoming_levels"),"
").concat(r,"
")}function eY(e){return e.level}function eX(e){return -1!==e.bricks.indexOf(e.ballsColor)}function eJ(e){if(!e.perks.reach)return -1;for(var a=e.level.size,r=-1,t=-1,n=-1,i=0;i0&&en(1-a.y/e.gameZoneHeight*1.1+.1,0,1)||0}function e0(e,a){return Math.pow(e.x-a.x,2)+Math.pow(e.y-a.y,2)}function e1(e,a){return Math.sqrt(e0(e,a))}function e2(e){return!!(e.lastPuckMove&&e.perks.passive_income&&e.lastPuckMove>e.levelTime-250*e.perks.passive_income)}function e4(){try{return parseInt(localStorage.getItem("breakout-3-hs-short")||"0")}catch(e){}return 0}function e3(e){var a=[],r=[],t=Math.max(-1e3+100*e,0);if(e>20){var n=eu.slice(0,Math.floor(e/2)).map(function(e){return e}).filter(function(e){var a;return a=e.id,o||(o=new Set(["extra_levels","extra_life","one_more_choice","instant_upgrade","shunt","slow_down"]),eu.forEach(function(e){e.requires&&o.add(e.requires)})),!o.has(a)}).sort(function(a,r){return ep(e+a.id)-ep(e+r.id)}),i=Math.min(3,Math.ceil(e/30));a=n.slice(0,i),r=n.slice(i,i+i)}return{required:a,forbidden:r,minScore:t}}function e5(e,a,r){var t=e3(e),n=t.required,i=t.forbidden,s=t.minScore,_=function(e){var a,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(a=Math).max.apply(a,[0].concat(M(e.filter(function(e){return!r.find(function(a){var r;return!(null==e?void 0:null===(r=e.perks)||void 0===r?void 0:r[a.id])})&&!t.find(function(a){var r;return null==e?void 0:null===(r=e.perks)||void 0===r?void 0:r[a.id]})}).map(function(e){return e.score}))))}(a,n,i),o=_&&r?et("unlocks.reached",{reached:_}):"";return _>=s?null:n.length||i.length?{reached:_,minScore:s,text:et("unlocks.minScoreWithPerks",{minScore:s,required:n.map(function(e){return e.name}).join(", "),forbidden:i.map(function(e){return e.name}).join(", ")})+o}:{reached:_,minScore:s,text:et("unlocks.minScore",{minScore:s})+o}}function e6(e,a){return a.perks.transparency?en(a.perks.transparency*(1-e.y/a.gameZoneHeight*1.2),0,1):0}function e7(e,a){return e.perks.metamorphosis||ex("colorful_coins")||e.perks.hypnosis||e.perks.rainbow?a.color:"#ffd300"}function e8(e){return(e.levelTime?e.perks.corner_shot*e.brickWidth:0)-e.perks.unbounded*e.brickWidth}var e9=!!window.location.href.includes("isInWebView=true"),ae={};if(ae=y("kqXj6").getBundleURL("lgcGd")+"sw-b71.ec7142b8.js","serviceWorker"in navigator&&window.location.href.endsWith("/index.html?isPWA=true")){var aa=new URL(ae);navigator.serviceWorker.register(aa)}var W=y("5mG9B"),q=y("6QuVk"),ar=document.getElementById("game"),at=ar.getContext("2d",{alpha:!1}),an=document.createElement("img");an.src="data:image/svg+xml;base64,"+btoa(''),an.onload=function(){return rQ.needsRender=!0};var ai=document.createElement("img");ai.onload=function(){return rQ.needsRender=!0};var as=document.createElement("canvas"),a_=document.createElement("canvas"),ao=a_.getContext("2d",{alpha:!1});function al(){return 16*(ex("precise_lighting")?1:2)}var au=0;function ac(e,a,r,t,n,i,s){var _=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1;t=Math.round(t),n=Math.round(n),i=Math.round(i),s=Math.round(s),e.globalAlpha=_,r&&(e.strokeStyle=r,"#FF0000"==r?(e.lineDashOffset=aw(a),e.lineWidth=2,e.setLineDash(az)):e.lineWidth=1,e.beginPath(),e.moveTo(t,n),e.lineTo(i,s),e.stroke(),"#FF0000"==r&&(e.setLineDash(aW),e.lineWidth=1),e.globalAlpha=1)}var ad=document.createElement("canvas"),ap="",am={};function ag(e,a,r,t,n){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",s="ball"+a+"_"+r+"_"+i,_=Math.round(r);if(!am[s]){var o=document.createElement("canvas");o.width=_,o.height=_;var l=o.getContext("2d");l.beginPath(),l.arc(_/2,_/2,Math.round(_/2)-1,0,2*Math.PI),l.fillStyle=a,l.fill(),i&&(l.lineWidth=2,l.strokeStyle=i,l.stroke()),am[s]=o}e.drawImage(am[s],Math.round(t-_/2),Math.round(n-_/2))}function ab(e,a,r,t,n,i,s){var _=(Math.round(s/Math.PI*64)%32+32)%32,o="coin with halo_"+a+"_"+r+"_"+i+"_"+("#ffd300"===a?_:"whatever");if(!am[o]){var l=document.createElement("canvas");l.width=r,l.height=r;var u=l.getContext("2d");u.beginPath(),u.arc(r/2,r/2,r/2,0,2*Math.PI),u.fillStyle=a,u.fill(),u.strokeStyle=i,"#FF0000"==i&&(u.lineWidth=2,u.setLineDash(az)),"transparent"===a&&(u.lineWidth=2),u.stroke(),"#ffd300"===a&&(u.beginPath(),u.arc(r/2,r/2,r/2*.6,0,2*Math.PI),u.fillStyle="rgba(255,255,255,0.5)",u.fill(),u.translate(r/2,r/2),u.rotate(_/16),u.translate(-r/2,-r/2),u.globalCompositeOperation="multiply",ak(u,"$",a,r-2,r/2,r/2+1),ak(u,"$",a,r-2,r/2,r/2+1)),am[o]=l}e.drawImage(am[o],Math.round(t-r/2),Math.round(n-r/2))}function ah(e,a,r,t,n){var i="fuzzy-circle"+a+"_"+(r=Math.max(r,2));null==a||a.startsWith("#");var s=Math.round(3*r);if(!(!s||isNaN(s))){if(!am[i]){var _=document.createElement("canvas");_.width=s,_.height=s;var o=_.getContext("2d"),l=o.createRadialGradient(s/2,s/2,0,s/2,s/2,s/2);l.addColorStop(0,a),l.addColorStop(.3,a+"88"),l.addColorStop(.6,a+"22"),l.addColorStop(1,"transparent"),o.fillStyle=l,o.fillRect(0,0,s,s),am[i]=_}e.drawImage(am[i],Math.round(t-s/2),Math.round(n-s/2))}}function av(e,a,r,t,n){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=arguments.length>6?arguments[6]:void 0,_=Math.ceil(t-e.brickWidth/2),o=Math.ceil(n-e.brickWidth/2),l=Math.ceil(t+e.brickWidth/2)-1,u=Math.ceil(n+e.brickWidth/2)-1,c=l-_,d=u-o,p="brick"+r+"__"+c+"_"+d+"_"+i+"_"+s+"_";if(!am[p]){var m,g,b,h,v,k,y=document.createElement("canvas");y.width=c,y.height=d;var f=y.getContext("2d");f.fillStyle=r,f.setLineDash(-1!==i?az:aW),f.lineDashOffset=i,f.strokeStyle=-1!==i&&"#FF000033"||r,f.lineJoin="round",f.lineWidth=4,m=f,g=2,b=2,h=c-4,v=d-4,k=2,m.beginPath(),m.moveTo(4,2),m.lineTo(g+h-k,b),m.quadraticCurveTo(g+h,b,g+h,b+k),m.lineTo(g+h,b+v-k),m.quadraticCurveTo(g+h,b+v,g+h-k,b+v),m.lineTo(g+k,b+v),m.quadraticCurveTo(g,b+v,g,b+v-k),m.lineTo(g,b+k),m.quadraticCurveTo(g,b,g+k,b),m.closePath(),s||f.fill(),f.stroke(),am[p]=y}a.drawImage(am[p],_,o,c,d)}function ak(e,a,r,t,n,i){var s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],_="text"+a+"_"+r+"_"+t+"_"+s;if(!am[_]){var o=document.createElement("canvas");o.width=t*a.length,o.height=t;var l=o.getContext("2d");l.fillStyle=r,l.textAlign=s?"left":"center",l.textBaseline="middle",l.font=t+"px monospace",l.fillText(a,s?0:o.width/2,o.height/2,o.width),am[_]=o}e.drawImage(am[_],s?n:Math.round(n-am[_].width/2),Math.round(i-am[_].height/2))}var ay=document.getElementById("score"),af=document.getElementById("menuLabel"),aW=[],az=[5,5];function aw(e){return ex("basic")?0:Math.floor(e.levelTime%500/500*10)%10}var aS=null,ax=!1,W=y("5mG9B"),q=y("6QuVk");function aB(){ex("record")&&(null==l?void 0:l.state)==="recording"&&(null==l||l.pause())}function aM(){ex("record")&&l&&(null==l||l.stop(),l=null)}var W=y("5mG9B"),q=y("6QuVk"),aq=0,aP=null,aO=document.getElementById("popup"),aL=document.getElementById("close-modale");aL.addEventListener("click",function(e){e.preventDefault(),aP&&aP()}),aL.title=et("play.close_modale_window_tooltip");var aR=-1;function aG(e){return aC.apply(this,arguments)}function aC(){return(aC=(0,W._)(function(e){var a,r,t,n,i,s,_;return(0,q.__generator)(this,function(o){return a=e.title,t=void 0===(r=e.content)?[]:r,i=void 0===(n=e.allowClose)||n,_=void 0===(s=e.className)?"":s,aT(1),[2,new Promise(function(e){var r,n=function(a){o||(o=!0,Array.prototype.forEach.call(s.querySelectorAll("button:not([disabled])"),function(e){return e.disabled=!0}),document.body.style.minHeight=document.body.scrollHeight+"px",setTimeout(function(){return document.body.style.minHeight=""},0),s.remove(),e(a))};aO.className=_,aL.style.display=i?"":"none";var s=document.createElement("div"),o=!1;if(aP=i?function(){n(void 0)}:null,a){var l=document.createElement("h1");l.innerHTML=a,s.appendChild(l)}null==t||t.filter(function(e){return e}).forEach(function(e,a){if(e){if("string"==typeof e){var r,t,i=document.createElement("div");i.innerHTML=e,s.appendChild(i);return}(null===(r=s.lastChild)||void 0===r?void 0:r.nodeName)=="SECTION"?t=s.lastChild:((t=document.createElement("section")).className="actions",s.appendChild(t));var _=e.text,o=e.value,l=e.help,u=e.disabled,c=e.className,d=e.icon,p=e.tooltip,m=document.createElement("button");m.innerHTML="\n".concat(void 0===d?"":d,"\n\n ").concat(e.name,"\n ").concat(e.help(1),"\n
\n".concat(a,"
\n").concat(et("gameOver.cumulative_total",{startTs:n,endTs:t}),"
\n "),{icon:ey["icon:new_run"],value:null,text:et("confirmRestart.yes"),help:""},'',s,function(e){if(e.creative)return"";var a="",r="";try{var t=ez.map(function(e,a){var r;return{li:a,l:e,r:null===(r=e5(a,aK,!1))||void 0===r?void 0:r.text}}).filter(function(e){return e.r});e.runStatistics.runTime=Math.round(e.runStatistics.runTime);var n=w({},e.perks);for(var i in n)n[i]||delete n[i];aK.push(S(w({},e.runStatistics),{perks:n,appVersion:ek}));var s=t.filter(function(e){var a=e.li;return!e5(a,aK,!0)});s.length&&(a="\n\n\n ").concat(a.name,"\n ").concat(ej(a),"\n
\n".concat(et("gameOver.stats_intro",{count:aK.length-1}),"
")+r)}catch(e){console.warn(e)}return a+r}(rQ)]}).then(function(){return r0({levelToAvoid:eY(rQ).name})})}}function aU(e){return e.creative?""+et("gameOver.creative")+"
":""}var aK=[];try{aK=JSON.parse(localStorage.getItem("breakout_71_runs_history")||"[]").sort(function(e,a){return a.score-e.score}).slice(0,100)}catch(e){}function aY(e,a){e.startParams.computer_controlled||(e.puckPosition=a,e.needsRender=!0)}function aX(e){aJ(e);var a,r=1+((null===(a=e.perks)||void 0===a?void 0:a.multiball)||0),t=e.puckWidth/(r+1);e.balls=[],e.ballsColor="#FFFFFF",(e.perks.picky_eater||e.perks.pierce_color)&&(e.ballsColor=function(e){var a,r={};e.forEach(function(e){return r[e]=(r[e]||0)+1});var t=(a=Math).max.apply(a,M(Object.keys(r).map(function(e){return r[e]})));return eE(Object.keys(r).filter(function(e){return r[e]==t}))}(e.bricks.filter(function(e){return e}))||"#FFFFFF");for(var n=0;n".concat(et("score_panel.close_to_unlock"),'
\n\n ").concat(s,"\n ").concat(null===(a=t.reason)||void 0===a?void 0:a.text,"\n
\n".concat(et("level_up.before_buttons",{score:e.score-e.levelStartScore,catchGain:n,levelSpawnedCoins:e.levelSpawnedCoins,time:Math.round(e.levelTime/1e3),timeGain:t,levelMisses:e.levelMisses,missesGain:s,levelWallBounces:e.levelWallBounces,wallHitsGain:i,compliment:o}),"\n
\n").concat(et("level_up.after_buttons",{level:e.currentLevel+1,max:eN(e)}),"
\n").concat(eK(e,e.currentLevel+1),"
\n")].concat(M(_),[eU(e),rz(e),''])}),{allowClose:!1}))];case 2:return"reroll"===(l=u.sent())?(r++,e.rerolls--):(e.perks[l]++,"instant_upgrade"===l&&(r+=2),e.runStatistics.upgrades_picked++),[3,1];case 3:return[2]}})})).apply(this,arguments)}function rP(e,a){return eI(rQ,Math.floor(a/rQ.brickWidth),Math.floor((e-rQ.offsetX)/rQ.brickWidth))}function rO(e){if(rQ.bricks[e])return e}function rL(e,a,r){var t,n,i;return null!==(i=null!==(n=null!==(t=rO(rP(e-r,a-r)))&&void 0!==t?t:rO(rP(e+r,a-r)))&&void 0!==n?n:rO(rP(e+r,a+r)))&&void 0!==i?i:rO(rP(e-r,a+r))}window.addEventListener("resize",function(){return rM(rQ)}),window.addEventListener("fullscreenchange",function(){return rM(rQ)}),setInterval(function(){var e=window.innerWidth,a=window.innerHeight;(e!==rQ.canvasWidth||a!==rQ.canvasHeight)&&rM(rQ)},1e3),ar.addEventListener("mouseup",function(e){0===e.button&&(rQ.running?rB(!0):(rS(),ex("pointerLock")&&ar.requestPointerLock&&ar.requestPointerLock().then()))}),ar.addEventListener("mousemove",function(e){document.pointerLockElement===ar?aY(rQ,rQ.puckPosition+e.movementX):aY(rQ,e.x)}),ar.addEventListener("touchstart",function(e){var a;e.preventDefault(),(null===(a=e.touches)||void 0===a?void 0:a.length)&&(aY(rQ,e.touches[0].pageX),aJ(rQ),rS())}),ar.addEventListener("touchend",function(e){e.preventDefault(),rB(!0)}),ar.addEventListener("touchcancel",function(e){e.preventDefault(),rB(!0)}),ar.addEventListener("touchmove",function(e){var a;(null===(a=e.touches)||void 0===a?void 0:a.length)&&aY(rQ,e.touches[0].pageX)});var rR=document.getElementById("stats"),rG={},rC=performance.now(),rT="idle",rj=0,rE=60;function rA(e){if(rQ.startParams.stress){var a=performance.now();rT&&(rG[rT]=(rG[rT]||0)+(a-rC)),rC=a,rT=e}}setInterval(function(){if(rE=rj,rj=0,!rQ.startParams.stress){rR.style.display="none";return}rR.style.display="block";var e=eA(rG);rR.innerHTML="\n\n ").concat(e.name,"
\n ").concat(e.help(1),"\n
\n ").concat(e.name," \n
\n ").concat(e_(e.credit||""),"\n\n Made in France by Renan LE CARO. \n Donate\n Discord\n F-Droid\n Google Play\n itch.io \n Gitlab\n Web version\n HackerNews\n Privacy Policy\n Archives\n v.'.concat(ek,"\n
")]),allowClose:!0})];case 1:return(a=r.sent())&&(a(),rQ.needsRender=!0),[2]}})})).apply(this,arguments)}function rI(){return rV.apply(this,arguments)}function rV(){return(rV=(0,W._)(function(){var e,a,r,t,n,i,s,_,o;return(0,q.__generator)(this,function(l){switch(l.label){case 0:rB(!0),(a=[{disabled:ex("easy"),icon:ey["icon:starting_perks"],text:et("starting_perks.title"),help:et("starting_perks.help"),value:function(){return(0,W._)(function(){return(0,q.__generator)(this,function(e){switch(e.label){case 0:return[4,rm()];case 1:return e.sent(),[2]}})})()}}]).push({icon:ey[null===(e=Q.find(function(e){return e.value===er()}))||void 0===e?void 0:e.levelName],text:et("settings.language"),help:et("settings.language_help"),value:function(){return(0,W._)(function(){var e,a;return(0,q.__generator)(this,function(r){switch(r.label){case 0:return[4,aG({title:et("settings.language"),content:[et("settings.language_help")].concat(M(Q.map(function(e){return S(w({},e),{icon:ey[e.levelName]})}))),allowClose:!0})];case 1:if(!(a=(e=r.sent())&&e!==er()))return[3,3];return[4,rK(rQ)];case 2:a=r.sent(),r.label=3;case 3:return a&&(N("lang",e),K(),window.location.reload()),[2]}})})()}}),r=!0,t=!1,n=void 0;try{for(i=function(){var e=_.value;eS[e]&&a.push({icon:ex(e)?ey["icon:checkmark_checked"]:ey["icon:checkmark_unchecked"],text:eS[e].name,help:eS[e].help,disabled:ex("basic")&&["extra_bright","contrast","smooth_lighting","precise_lighting","probabilistic_lighting"].includes(e)||!1,value:function(){eB(e),rM(rQ),rZ(),rI()}})},s=Object.keys(eS)[Symbol.iterator]();!(r=(_=s.next()).done);r=!0)i()}catch(e){t=!0,n=e}finally{try{r||null==s.return||s.return()}finally{if(t)throw n}}return a.push({icon:ey["icon:download"],text:et("settings.download_save_file"),help:et("settings.download_save_file_help"),value:function(){return(0,W._)(function(){var e,a;return(0,q.__generator)(this,function(r){return e=document.createElement("a"),a=JSON.stringify({fileType:"B71-save-file",appVersion:ek,payload:rh()},null,2),e.setAttribute("href","data:application/json;charset=utf-8,"+encodeURIComponent(a)),e.setAttribute("download","b71-save-"+new Date().toISOString().slice(0,19).replace(/[^0-9]+/gi,"-")+".json"),document.body.appendChild(e),e.click(),setTimeout(function(){return document.body.removeChild(e)},1e3),[2]})})()}}),a.push({icon:ey["icon:upload"],text:et("settings.load_save_file"),help:et("settings.load_save_file_help"),value:function(){return(0,W._)(function(){var e,a;return(0,q.__generator)(this,function(r){if(!document.getElementById("save_file_picker")){var t;(a=document.createElement("input")).setAttribute("type","file"),a.setAttribute("id","save_file_picker"),a.setAttribute("accept",".b71,.json"),a.style.position="absolute",a.style.left="-1000px",a.addEventListener("change",(t=(0,W._)(function(e){var r,t,n,i,s,_,o,l;return(0,q.__generator)(this,function(e){switch(e.label){case 0:if(e.trys.push([0,4,,6]),!(t=a&&(null===(r=a.files)||void 0===r?void 0:r.item(0))))return[3,3];return[4,new Promise(function(e,a){var r=new FileReader;r.onload=function(){var a;e((null===(a=r.result)||void 0===a?void 0:a.toString())||"")},r.onerror=function(){a(r.error)},r.readAsText(t)})];case 1:if(i=(n=JSON.parse(e.sent())).fileType,s=n.signedPayload,_=n.payload,"B71-save-file"!==i)throw Error("Not a B71 save file");if(_)for(var u in localStorage.clear(),_)localStorage.setItem(u,JSON.stringify(_[u]));else if(s)for(var c in o=JSON.parse(s),localStorage.clear(),o)localStorage.setItem(c,o[c]);return[4,aG({title:et("settings.save_file_loaded"),content:[et("settings.save_file_loaded_help"),{text:et("settings.save_file_loaded_ok")}]})];case 2:e.sent(),window.location.reload(),e.label=3;case 3:return[3,6];case 4:return l=e.sent(),[4,aG({title:et("settings.save_file_error"),content:[l.message,{text:et("settings.save_file_loaded_ok")}]})];case 5:return e.sent(),[3,6];case 6:return a.value="",[2]}})}),function(e){return t.apply(this,arguments)})),document.body.appendChild(a)}return null===(e=document.getElementById("save_file_picker"))||void 0===e||e.click(),[2]})})()}}),a.push({icon:ey["icon:coins"],text:et("settings.max_coins",{max:X()}),help:et("settings.max_coins_help"),value:function(){return(0,W._)(function(){return(0,q.__generator)(this,function(e){switch(e.label){case 0:return N("max_coins",(V("max_coins",2)+1)%7),[4,rI()];case 1:return e.sent(),[2]}})})()}}),a.push({icon:ey["icon:reset"],text:et("settings.reset"),help:et("settings.reset_help"),value:function(){return(0,W._)(function(){return(0,q.__generator)(this,function(e){switch(e.label){case 0:return[4,aG({title:et("settings.reset"),content:[et("settings.reset_instruction"),{text:et("settings.reset_confirm"),value:!0},{text:et("settings.reset_cancel"),value:!1}],allowClose:!0})];case 1:return e.sent()&&(localStorage.clear(),window.location.reload()),[2]}})})()}}),a.push({text:et("settings.autoplay"),help:et("settings.autoplay_help"),value:function(){return(0,W._)(function(){return(0,q.__generator)(this,function(e){return r1(!1),[2]})})()}}),a.push({text:et("settings.stress_test"),help:et("settings.stress_test_help"),value:function(){return(0,W._)(function(){return(0,q.__generator)(this,function(e){return r1(!0),[2]})})()}}),[4,aG({title:et("main_menu.settings_title"),content:[et("main_menu.settings_help")].concat(M(a)),allowClose:!0,className:"settings"})];case 1:return(o=l.sent())&&(o(),rQ.needsRender=!0),[2]}})})).apply(this,arguments)}function rZ(){return rN.apply(this,arguments)}function rN(){return(rN=(0,W._)(function(){var e;return(0,q.__generator)(this,function(a){switch(a.label){case 0:if(a.trys.push([0,10,,11]),!(document.fullscreenEnabled||document.webkitFullscreenEnabled))return[2,!1];if(!(null!==document.fullscreenElement&&!ex("fullscreen")))return[3,5];if(!document.exitFullscreen)return[3,2];return[4,document.exitFullscreen()];case 1:case 3:case 6:case 8:return a.sent(),[2,!0];case 2:if(!document.webkitCancelFullScreen)return[3,4];return[4,document.webkitCancelFullScreen()];case 4:return[3,9];case 5:if(!(ex("fullscreen")&&!document.fullscreenElement))return[3,9];if(!(e=document.documentElement).requestFullscreen)return[3,7];return[4,e.requestFullscreen()];case 7:if(!e.webkitRequestFullscreen)return[3,9];return[4,e.webkitRequestFullscreen()];case 9:return[3,11];case 10:return console.warn(a.sent()),[3,11];case 11:return[2,!1]}})})).apply(this,arguments)}function rU(){return(rU=(0,W._)(function(){var e,a,r,t,n,i;return(0,q.__generator)(this,function(s){switch(s.label){case 0:return e=Y(),a=ex("mobile-mode")?"help":"tooltip",r=ew.sort(function(e,a){return e.threshold-a.threshold}).map(function(r){var t=r.name,n=r.id,i=r.threshold,s=r.icon,_=r.help;return z({text:t,disabled:e'):"";return z({text:e.name+i,disabled:!!n,value:{level:e},icon:ey[e.name]},a,(null==n?void 0:n.text)||ej(e))}),[4,aG({title:et("unlocks.title_upgrades",{unlocked:r.filter(function(e){return!e.disabled}).length,out_of:r.length}),content:["".concat(et("unlocks.intro",{ts:e}),"\n ").concat(r.find(function(e){return e.disabled})?et("unlocks.greyed_out_help"):"","
")].concat(M(r),[et("unlocks.level",{unlocked:n.filter(function(e){return!e.disabled}).length,out_of:n.length})],M(n)),allowClose:!0,className:ex("mobile-mode")?"":"actionsAsGrid"})];case 1:if(!(i=s.sent()))return[3,3];return[4,rK(rQ)];case 2:s.sent()&&r0(w({},i)),s.label=3;case 3:return[2]}})})).apply(this,arguments)}function rK(e){return rY.apply(this,arguments)}function rY(){return(rY=(0,W._)(function(e){return(0,q.__generator)(this,function(a){return!e.currentLevel||aq?[2,!0]:(rB(!0),[2,aG({title:et("confirmRestart.title"),content:[et("confirmRestart.text"),{value:!0,text:et("confirmRestart.yes")},{value:!1,text:et("confirmRestart.no")}]})])})})).apply(this,arguments)}var rX={ArrowLeft:0,ArrowRight:0,Shift:0};function rJ(e,a){rX[e]=a,rQ.keyboardPuckSpeed=(rX.ArrowRight-rX.ArrowLeft)*(1+2*rX.Shift)*rQ.gameZoneWidth/50}document.addEventListener("keydown",(r=(0,W._)(function(e){return(0,q.__generator)(this,function(a){return"f"!==e.key.toLowerCase()||e.ctrlKey||e.metaKey?e.key in rX&&rJ(e.key,1):(eB("fullscreen"),rZ())," "!==e.key||aq||(rQ.running?rB(!0):rS(),e.preventDefault()),[2]})}),function(e){return r.apply(this,arguments)}));var r$=new Date;document.addEventListener("keyup",(t=(0,W._)(function(e){var a,r,t,n,i;return(0,q.__generator)(this,function(s){switch(s.label){case 0:if(i=document.querySelector("button:focus"),!(e.key in rX))return[3,1];return rJ(e.key,0),[3,10];case 1:if("ArrowDown"!==e.key||(null==i?void 0:null===(a=i.nextElementSibling)||void 0===a?void 0:a.tagName)!=="BUTTON")return[3,2];return null==i||null===(r=i.nextElementSibling)||void 0===r||r.focus(),[3,10];case 2:if("ArrowUp"!==e.key||(null==i?void 0:null===(t=i.previousElementSibling)||void 0===t?void 0:t.tagName)!=="BUTTON")return[3,3];return null==i||null===(n=i.previousElementSibling)||void 0===n||n.focus(),[3,10];case 3:if(!("Escape"===e.key&&aP))return[3,4];return aP(),[3,10];case 4:if(!("Escape"===e.key&&rQ.running))return[3,5];return rB(!0),[3,10];case 5:if(!("m"===e.key.toLowerCase()&&!aq))return[3,6];return rD().then(),[3,10];case 6:if(!("s"===e.key.toLowerCase()&&!aq))return[3,7];return rf(rQ).then(),[3,10];case 7:if(!("r"===e.key.toLowerCase()&&!aq&&r$a$(rQ),a=e&&rQ.perks.picky_eater&&eX(rQ),r=e&&e2(rQ),t=eJ(rQ),n=rQ.perks.clairvoyant,i=aw(rQ);a||r||-1!==t||rQ.perks.zen||(i=0);var s=n&&rQ.brickHP.reduce(function(e,a){return e+a},0),_=rQ.gameZoneWidth+"_"+rQ.bricks.join("_")+an.complete+"_"+t+"_"+a+"_"+r+"_"+rQ.ballsColor+"_"+rQ.perks.pierce_color+"_"+s+"_"+i;if(_!==ap){ap=_,ad.width=rQ.gameZoneWidth,ad.height=rQ.gameZoneWidth+1;var o=ad.getContext("2d");o.clearRect(0,0,rQ.gameZoneWidth,rQ.gameZoneWidth),o.resetTransform(),o.translate(-rQ.offsetX,0),rQ.bricks.forEach(function(s,_){var l=eD(rQ,_),u=eF(rQ,_);if(s){var c=t===Math.floor(_/rQ.level.size),d=rQ.ballsColor!==s&&"black"!==s&&a||e&&rQ.perks.zen&&"black"===s||c||r;o.globalCompositeOperation="source-over",av(rQ,o,s,l,u,d?i:-1,n>=2),rQ.brickHP[_]>1&&n&&(o.globalCompositeOperation="source-over",ak(o,rQ.brickHP[_].toString(),n>=2?s:rQ.level.color,rQ.puckHeight,l,u)),"black"===s&&(o.globalCompositeOperation="source-over",function(e,a,r,t,n){var i="svg"+a+"_"+r+"_"+a.complete;if(!am[i]){var s=document.createElement("canvas");s.width=r,s.height=r;var _=s.getContext("2d"),o=r/Math.max(a.width,a.height),l=a.width*o,u=a.height*o;_.drawImage(a,(r-l)/2,(r-u)/2,l,u),am[i]=s}e.drawImage(am[i],Math.round(t-r/2),Math.round(n-r/2))}(o,an,rQ.brickWidth,l,u))}})}at.drawImage(ad,rQ.offsetX,0)}(),rA("render:lights"),at.globalCompositeOperation="screen",ru(e.lights,function(a){var r=a.x,t=a.y,n=a.time,i=a.color,s=(a.size,a.duration);at.globalAlpha=.5*Math.min(1,2-(e.levelTime-n)/s*2),av(e,at,i,r,t,-1,e.perks.clairvoyant>=2)}),rA("render:texts"),at.globalCompositeOperation="screen",ru(e.texts,function(a){var r=a.x,t=a.y,n=a.time,i=a.color,s=a.size,_=a.duration,o=e.levelTime-n;at.globalAlpha=Math.max(0,Math.min(1,2-o/_*2)),at.globalCompositeOperation="source-over",ak(at,a.text,i,s,r,t-o/10)}),rA("render:particles"),ru(e.particles,function(a){var r=a.x,t=a.y,n=a.time,i=a.color,s=a.size,_=a.duration;at.globalAlpha=Math.max(0,Math.min(1,2-(e.levelTime-n)/_*2)),at.globalCompositeOperation="screen",ag(at,i,s,r,t)}),rA("render:extra_life"),e.perks.extra_life){at.globalAlpha=1,at.globalCompositeOperation="source-over",at.fillStyle=e.puckColor;for(var y=0;y