(()=>{var t={999:()=>{},502:()=>{},174:()=>{},966:()=>{},832:()=>{},242:()=>{},314:()=>{},407:()=>{},523:()=>{},558:()=>{},91:()=>{},763:()=>{}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,i),a.exports}(()=>{"use strict";const t=function(t,e){for(var i=Math.abs(t)+"",n=t<0,s=e-i.length;s>0;s--)i="0"+i;return(n?"-":"")+i};var e={create:function(t){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(i=-1===e.SVG_ELEMENTS.indexOf(t)?document.createElement(t):document.createElementNS(e.SVG_NAMESPACE,t),n.constructor===String)i.setAttribute("class",n);else for(var a in n)i.setAttribute(a,n[a]);if(s instanceof Array)for(var r=0;r=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"]};const n=e;function s(t,e){for(var i=0;i0?this.remaining:0,this.el.classList[this.remaining>10?"remove":"add"]("alert"),this.counterEl.textContent=t(this.remaining,3),this.barEl.style.width=this.remaining/this.duration*100+"%",0==this.remaining&&(this.stop(),this.endCallback&&this.endCallback())}}],a&&s(i.prototype,a),Object.defineProperty(i,"prototype",{writable:!1}),e}();const r=a;function o(t,e){for(var i=0;i0&&window.requestAnimationFrame(this.scrollToStart.bind(this))}},{key:"clear",value:function(t){this.lastPattern=null,this.containerEl.remove(),this.containerEl=n.create("div",{class:"history-container","data-helper":t}),this.el.appendChild(this.containerEl)}}],i&&c(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();const h=u;function d(t,e){for(var i=0;i>0===i&&e%3-i%3==i%3-t%3&&Math.floor(e/3)-Math.floor(i/3)==Math.floor(i/3)-Math.floor(t/3)){var n=this.addDot(i);return this.isComplete()||(this.suite.push(t),n.push(t)),n}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,i=0,n=0;n1&&void 0!==arguments[1]?arguments[1]:14,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#fff",s=[];i=i instanceof Array?i:[i];for(var a=1;a0&&void 0!==arguments[0]?arguments[0]:3,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[];e.fill=e.fill||"#fff";for(var s=0;s<9;s++)i.push(n.create("circle",{cx:s%3*this.GRID_GUTTER+this.SVG_MARGIN,cy:Math.floor(s/3)*this.GRID_GUTTER+this.SVG_MARGIN,rel:s,r:t}));return this.addGroup(e,i)}},{key:"addGroup",value:function(t,e){var i=n.create("g",t,e);return this.el.appendChild(i),i}},{key:"addCombinaison",value:function(t,e,i){var s=t+e+i,a=Math.min(Math.floor(this.SVG_WIDTH/s),this.SVG_COMB_EXP),r=Math.floor(.75*a),o=r+Math.floor(.25*a),l=Math.floor((this.SVG_WIDTH-(s-1)*o)/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 u=[],h=0;h=t?a:i,n=r<=e&&o>=e?a:n}if(void 0!==i&&null!=n){var l=3*n+i;s=this.triggerDot(l)}return s||this.updateLine(t,e),!0}}},{key:"triggerDot",value:function(t){var e=this;if(!this.pattern.gotDot(t)){var i=this.pattern.addDot(t);navigator.vibrate&&navigator.vibrate(20),i.forEach((function(t,n){var s=m.prototype.GRID_GUTTER*(t%3)+m.prototype.SVG_MARGIN,a=m.prototype.GRID_GUTTER*Math.floor(t/3)+m.prototype.SVG_MARGIN;if(e.closeLine(s,a),e.bigDotsEl.childNodes[t].classList.add("active"),n+1===i.length&&e.pattern.isComplete())return e.checkPattern();e.startLine(s,a)}))}}},{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",b.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?b.COLORS.SUCCESS:b.COLORS.ERROR),t}},{key:"startLine",value:function(t,e){this.currentLine=n.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}}])&&E(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();var T=[{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"}],k=["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"];var w=[];function C(t){for(var e=w.length-1;e>=0;e--)if(w[e].el===t)return w.splice(e,1)[0]}function _(t){if(t.counter-=1,t.counter<=0)return t.el.textContent=t.originalText,void C(t.el);var e=Math.floor(t.originalLength-t.counter/3);t.el.textContent=t.originalText.substr(0,e)+function(t){var e="",i="abcdefghijklmnopqrstuvwxyz0123456789 _*%!?#/\\|@";if(t<=0)return e;for(var n=0;n=e})).map((function(t){return t.text}))):(i="Sorry, you didn\'t make it this time. ",n=k),i+n[Math.floor(n.length*Math.random())]}(t,e),this.revealEl.classList[t?"add":"remove"]("hide"),this.updateSocialLinks(),this.toggle(!0)}},{key:"toggle",value:function(t){t=null!=t?t:!this.el.classList.contains("active"),this.el.classList[t?"add":"remove"]("active")}},{key:"triggerAction",value:function(t){var e=parseInt(t.currentTarget.getAttribute("rel")||0,10);this.onAction(e)}},{key:"updateSocialLinks",value:function(){this.socialButtons.forEach((function(t){var e=t.getAttribute("platform"),i=b.SOCIAL.PLATFORMS[e];t.setAttribute("href",i.URL(b.URL,b.SOCIAL.MESSAGE,b.SOCIAL.TAGS))}))}}])&&G(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t}(),A=function(t,e){var i=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));for(var n=[],s=((e=Math.min(255,Math.max(0,e)))-t)/++i,a=0;a<=i;a++){var r=Math.round(t+a*s),o=r.toString(16);n.push("#"+o+o+o)}return n};function I(t,e){for(var i=0;i"),this.labelEl=n.create("span","selectbox-item selector-label"),this.el=n.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}}])&&D(e.prototype,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function B(t,e){for(var i=0;i