!function(t){function e(i){if(n[i])return n[i].exports;var a=n[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=9)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={create:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(e=-1===i.SVG_ELEMENTS.indexOf(t)?document.createElement(t):document.createElementNS(i.SVG_NAMESPACE,t),n.constructor===String)e.setAttribute("class",n);else for(var r in n)e.setAttribute(r,n[r]);if(a instanceof Array)for(var o=0;o=0;e--)t.childNodes[e].remove()},SVG_NAMESPACE:"http://www.w3.org/2000/svg",XLINK_NAMESPACE:"http://www.w3.org/1999/xlink",SVG_ELEMENTS:["svg","g","circle","line","path","use","rect"]};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={GAME:{DIFFICULTY:{EASY:4,MEDIUM:5,HARD:6},TYPE:{PRACTICE:1,CHALLENGE:2,COUNTDOWN:3},ACTIONS:{CONTINUE:1,NEW_GAME:2,BACK_HOME:3}},SOCIAL:{PLATFORMS:{FB:{NAME:"Facebook",ICON:"facebook",URL:function(t){return"https://www.facebook.com/sharer/sharer.php?u="+encodeURI(t)}},TWITTER:{NAME:"Twitter",ICON:"twitter",URL:function(t,e,n){return"http://twitter.com/"+(t?"share?":"intent/tweet?")+(e?"text="+encodeURI(e)+"&":"")+(t?"url="+encodeURI(t)+"&":"")+(n?"hashtags="+encodeURI(n.join(",")):"")}}},MESSAGE:"I wasted my time on BreakLock, it's pointless, don't try it.",TAGS:["breaklock"]},URL:"https://maxwellito.github.io/breaklock/",COLORS:{BRIGHT:"#ffffff",DARK:"#14171b",SUCCESS:"#116699",ERROR:"#ff0000"},PATTERN:{HEX_COLOR_START:"66",HEX_COLOR_END:"FF"}};e.default=i},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n>0===n&&e%3-n%3==n%3-t%3&&Math.floor(e/3)-Math.floor(n/3)==Math.floor(n/3)-Math.floor(t/3)){var i=this.addDot(n);return this.isComplete()||(this.suite.push(t),i.push(t)),i}return this.suite.push(t),[t]}},{key:"isComplete",value:function(){return this.suite.length>=this.dotLength}},{key:"gotDot",value:function(t){return~this.suite.indexOf(t)}},{key:"compare",value:function(t){for(var e=0,n=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:14,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#fff",i=[];n=n instanceof Array?n:[n];for(var a=1;a0&&void 0!==arguments[0]?arguments[0]:3,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];e.fill=e.fill||"#fff";for(var i=0;i<9;i++)n.push(o.default.create("circle",{cx:i%3*this.GRID_GUTTER+this.SVG_MARGIN,cy:Math.floor(i/3)*this.GRID_GUTTER+this.SVG_MARGIN,rel:i,r:t}));return this.addGroup(e,n)}},{key:"addGroup",value:function(t,e){var n=o.default.create("g",t,e);return this.el.appendChild(n),n}},{key:"addCombinaison",value:function(t,e,n){var i=t+e+n,a=Math.min(Math.floor(this.SVG_WIDTH/i),this.SVG_COMB_EXP),r=Math.floor(.75*a),s=Math.floor(.25*a),u=r+s,l=Math.floor((this.SVG_WIDTH-(i-1)*u)/2),c=this.SVG_WIDTH+Math.floor(this.SVG_COMB_EXP/2);this.el.setAttribute("viewBox","0 0 "+this.SVG_WIDTH+" "+(this.SVG_WIDTH+this.SVG_COMB_EXP));for(var h=[],d=0;d=0;e--)if(c[e].el===t)return c.splice(e,1)[0]}function r(t){t.nextFrame=u(function(){o(t)})}function o(t){if(t.counter-=1,t.counter<=0)return t.el.textContent=t.originalText,void a(t.el);var e=Math.floor(t.originalLength-t.counter/h);t.el.textContent=t.originalText.substr(0,e)+s(Math.min(t.originalLength-e,3)),r(t)}function s(t){var e="",n="abcdefghijklmnopqrstuvwxyz0123456789 _*%!?/\\|#@";if(t<=0)return e;for(var i=0;i0;a--)n="0"+n;return(i?"-":"")+n};e.default=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n0?this.remaining:0,this.el.classList[this.remaining>10?"remove":"add"]("alert"),this.counterEl.textContent=(0,s.default)(this.remaining,3),this.barEl.style.width=this.remaining/this.duration*100+"%",0==this.remaining&&(this.stop(),this.endCallback&&this.endCallback())}}]),t}();e.default=c},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n0&&window.requestAnimationFrame(this.scrollToStart.bind(this))}},{key:"clear",value:function(t){this.lastPattern=null,this.containerEl.remove(),this.containerEl=o.default.create("div",{class:"history-container","data-helper":t}),this.el.appendChild(this.containerEl)}}]),t}();e.default=s},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n=t?a:n,i=r<=e&&o>=e?a:i}var s=void 0;if(void 0!==n&&void 0!=i){var u=3*i+n;s=this.triggerDot(u)}return s||this.updateLine(t,e),!0}}},{key:"triggerDot",value:function(t){var e=this;if(!this.pattern.gotDot(t)){var n=this.pattern.addDot(t);navigator.vibrate&&navigator.vibrate(20),n.forEach(function(t,i){var a=l.default.prototype.GRID_GUTTER*(t%3)+l.default.prototype.SVG_MARGIN,r=l.default.prototype.GRID_GUTTER*Math.floor(t/3)+l.default.prototype.SVG_MARGIN;if(e.closeLine(a,r),e.bigDotsEl.childNodes[t].classList.add("active"),i+1===n.length&&e.pattern.isComplete())return e.checkPattern();e.startLine(a,r)})}}},{key:"reset",value:function(){clearTimeout(this.isPendingReset),this.isPendingReset=null,this.pattern.reset(),this.currentLine=null;for(var t=0;t<9;t++)this.bigDotsEl.childNodes[t].classList.remove("active");for(var e=this.patternEl.childNodes.length-1;e>=0;e--)this.patternEl.childNodes[e].remove();this.patternEl.setAttribute("stroke",f.default.COLORS.BRIGHT)}},{key:"checkPattern",value:function(){var t=this.onNewPattern(this.pattern);return this.isPendingReset=setTimeout(this.reset.bind(this),1e3),this.patternEl.setAttribute("stroke",t?f.default.COLORS.SUCCESS:f.default.COLORS.ERROR),t}},{key:"startLine",value:function(t,e){this.currentLine=h.default.create("line",{x1:t,y1:e}),this.patternEl.appendChild(this.currentLine)}},{key:"updateLine",value:function(t,e){this.currentLine&&(this.currentLine.setAttribute("x2",t),this.currentLine.setAttribute("y2",e))}},{key:"closeLine",value:function(t,e){this.updateLine(t,e),this.currentLine=null}}]),t}();e.default=p},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n"),this.labelEl=o.default.create("span","selectbox-item selector-label"),this.el=o.default.create("div","selector selectbox",[this.btnLeft,this.btnRight,this.labelEl]),this.el}},{key:"init",value:function(){this.btnLeft.addEventListener("click",this.previous.bind(this)),this.btnLeft.addEventListener("touchstart",this.previous.bind(this)),this.btnRight.addEventListener("click",this.next.bind(this)),this.btnRight.addEventListener("touchstart",this.next.bind(this))}},{key:"setChoices",value:function(t){this.choices=t;for(var e=this.choices.length-1;e>=0;e--)this.selectionIndex=this.choices[e].default?e:this.selectionIndex;this.selectionIndex=this.selectionIndex||0,this.updateLabel()}},{key:"updateLabel",value:function(){this.selectionIndex=(this.selectionIndex+this.choices.length)%this.choices.length;var t=this.choices[this.selectionIndex];return this.labelEl.textContent=t.label,this.selectCallback&&this.selectCallback(this.choices[this.selectionIndex]),this.selectionIndex}},{key:"next",value:function(t){return t.preventDefault(),t.stopPropagation(),this.selectionIndex++,this.updateLabel()}},{key:"previous",value:function(t){return t.preventDefault(),t.stopPropagation(),this.selectionIndex--,this.updateLabel()}},{key:"onSelect",value:function(t){this.selectCallback=t,this.updateLabel()}},{key:"getValue",value:function(){var t=this.choices[this.selectionIndex];return t&&t.value}}]),t}();e.default=s},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n=e}).map(function(t){return t.text})):(n="Sorry, you didn't make it this time. ",i=r),n+i[Math.floor(i.length*Math.random())]}Object.defineProperty(e,"__esModule",{value:!0});var a=[{min:1,max:3,text:"That was pure luck, nothing else. Stop dreamin."},{min:2,max:4,text:"You got lucky, without staying up all night."},{min:1,max:2,text:"No merit. Absolutely none."},{min:2,max:5,text:"That was given on a golden plate."},{min:1,max:4,text:"Absolutely no synapse got used during that game."},{min:2,max:5,text:"Don't even dare to tweet your score."},{min:8,max:10,text:"Saperlipopette!! That was close."},{min:4,max:8,text:"Seems legit, with a bit of luck."},{min:7,max:10,text:"Pretty good!"},{min:9,max:10,text:"But you made it!"},{min:11,max:50,text:"Trying random patterns is not a strategy..."},{min:11,max:50,text:"That was looooooooong."},{min:11,max:50,text:"At least you made it."},{min:11,max:50,text:"You must hate this game by now."},{min:11,max:50,text:"I hope you didn't cheat."},{min:41,max:403,text:"Your dedication is impressive."},{min:404,max:404,text:"Logic not found."},{min:405,max:999,text:"No comment."}],r=["I believe there's some work to do.","Do you understand the game? Don't take it personnaly, I struggle to explain it.","One day you will make it...","It's not funny for you, but it is for me ;)","Don't stress, you will make it.","If you want to avoid battles, stay out of the grassy areas!","Even if you loose in battle, if you surpass what you've done before, you have bested yourself.","TILT! Insert coin and try again!"];e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={greydient:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t="string"==typeof t?parseInt(t,16):t,e="string"==typeof e?parseInt(e,16):e,t=Math.min(255,Math.max(0,t)),e=Math.min(255,Math.max(0,e)),n++;for(var i=[],a=(e-t)/n,r=0;r<=n;r++){var o=Math.round(t+r*a),s=o.toString(16);i.push("#"+s+s+s)}return i}};e.default=i},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){}]);