!function(t,e){for(var i in e)t[i]=e[i]}(this,function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=3)}([function(t,e,i){"use strict";i.r(e),i.d(e,"noop",function(){return o}),i.d(e,"sqrt2",function(){return a}),i.d(e,"sqrt3",function(){return s}),i.d(e,"invSqrt2",function(){return u}),i.d(e,"clone",function(){return c}),i.d(e,"has",function(){return l}),i.d(e,"hypotenuse",function(){return h}),i.d(e,"isObject",function(){return f}),i.d(e,"random",function(){return p}),i.d(e,"range",function(){return v}),i.d(e,"rangeInclusive",function(){return g}),i.d(e,"getQueryStringParameters",function(){return y}),i.d(e,"getQueryStringObj",function(){return d}),i.d(e,"parseString",function(){return w}),i.d(e,"toFixed",function(){return T}),i.d(e,"getColor",function(){return x}),i.d(e,"grayscale",function(){return O}),i.d(e,"extend",function(){return S}),i.d(e,"quickCanvas",function(){return P});var n=i(1);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){}var a=Math.sqrt(2),s=Math.sqrt(3),u=1/a;function c(t){return JSON.parse(JSON.stringify(t))}function l(t,e){return t&&(t.hasOwnProperty(e)||e in t)}function h(t,e){return null==e&&(e=t),Math.sqrt(t*t+e*e)}function f(t){return!(!t||"object"!==r(t)||Array.isArray(t))}function p(t,e){return Array.isArray(t)?t[p(t.length-1)]:"object"===r(t)?t[p(Object.keys(t))]:(null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1)))}function v(t,e){if(null==e&&(e=t,t=0),t>e){var i=t;t=e,e=i}return Array.from(Array(Math.abs(e-t)),function(e,i){return i+t})}function g(t,e){return null==e&&(e=t,t=0),v(Math.min(t,e),Math.max(t,e)+1)}function y(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.location.search,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"=",n={};return t.replace(/(^\?)/,"").split(e).forEach(function(t){t=t.split(i),n[t[0]]=t[1]}),n}function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.location.search,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"=";return Object(n.mapObj)(y(t,e,i),w)}var m=/^{.*}$/,b=/^\[.*\]$/;function w(t){return"string"!=typeof t?t:"true"===t.toLowerCase()||"false"!==t.toLowerCase()&&("null"===t.toLowerCase()?null:"undefined"===t.toLowerCase()?void 0:isNaN(Number(t))?m.test(t)||b.test(t)?JSON.parse(decodeURIComponent(t)):t:Number(t))}function T(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN;return"number"!=typeof t||isNaN(t)?i:Number(t.toFixed(e))}function x(t){var e=t.red,i=t.green,n=t.blue,r=t.alpha;return null!=r?"rgba(".concat(e,", ").concat(i,", ").concat(n,", ").concat(r,")"):"rgb(".concat(e,", ").concat(i,", ").concat(n,")")}var k={red:.299,green:.587,blue:.114};function O(t){var e=t.red,i=t.green,n=t.blue;return k.red*e+k.green*i+k.blue*n}function S(t){for(var e=Object.assign({},t),i=arguments.length,r=new Array(i>1?i-1:0),o=1;o2&&void 0!==arguments[2]?arguments[2]:e,n=document.createElement("canvas");return n.height=e,n.width=i,t(n.getContext("2d"),n.height,n.width),n}},function(t,e,i){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){var e={log:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0})(t)&&console.log(t),e},value:function(){return t}};return l(S,function(i,n){e[n]=function(){return t=i.apply(void 0,[t].concat(Array.prototype.slice.call(arguments))),e}}),e}function o(t){return s(t,function(t){return null!=t})}function a(t,e){if(Array.isArray(t)){for(var i=t.length,n=0;n0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,i=-1/0;if(e){var n=-1/0;l(t,function(t,r,o){var a=e(t,r,o);(a>n||a===-1/0&&i===-1/0)&&(i=t,n=a)})}else l(t,function(t){return i=t>i?t:i});return i}function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,i=1/0;if(e){var n=1/0;l(t,function(t,r,o){var a=e(t,r,o);(a1&&void 0!==arguments[1]?arguments[1]:f;return Array.from(Array(t),function(t,i){return e(i)})}function x(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null!=t[0]?t[0]:0;return Array.isArray(t)?t.reduce(e,i):(l(t,function(t,n,r){i=e(i,t,n,r)}),i)}function k(t,e){return s(t,function(t,i,n){return!e(t,i,n)})}function O(t){return!!u(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:f)}i.r(e),i.d(e,"chain",function(){return r}),i.d(e,"compact",function(){return o}),i.d(e,"contains",function(){return a}),i.d(e,"filter",function(){return s}),i.d(e,"find",function(){return u}),i.d(e,"flatten",function(){return c}),i.d(e,"forEach",function(){return l}),i.d(e,"groupBy",function(){return h}),i.d(e,"identity",function(){return f}),i.d(e,"map",function(){return p}),i.d(e,"mapObj",function(){return y}),i.d(e,"max",function(){return d}),i.d(e,"min",function(){return m}),i.d(e,"omit",function(){return b}),i.d(e,"pick",function(){return w}),i.d(e,"range",function(){return T}),i.d(e,"reduce",function(){return x}),i.d(e,"reject",function(){return k}),i.d(e,"some",function(){return O}),i.d(e,"_",function(){return S});var S={compact:o,contains:a,filter:s,find:u,flatten:c,forEach:l,groupBy:h,identity:f,map:p,mapObj:y,max:d,min:m,omit:b,pick:w,range:T,reduce:x,reject:k,some:O}},,function(t,e,i){t.exports=i(4)},function(t,e,i){"use strict";i.r(e);var n=i(0),r=i(1);function o(t){return function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e1&&(this.state.scaleStart=Object(n.hypotenuse)(e[0].pageX-e[1].pageX,e[0].pageY-e[1].pageY),this.state.pinching=!0,this.state.lastPinch=1,clearTimeout(this.state.pressTO)),this.tapStart(t)}},{key:"pressStart",value:function(t){this.settings.pressStart(t)}},{key:"mouseup",value:function(t){if(Object.assign(t,{mobile:!1,duration:t.timeStampUTC-this.state.tapStartTime}),!this.state.moving){var e=t.which&&1!==t.which||t.altKey||t.ctrlKey||t.metaKey,i=this.settings.desktopPress&&t.duration>=this.settings.pressThreshold;e||i?this.settings.press(t):(clearTimeout(this.state.pressTO),this.settings.tap(t))}this.state.moving=null,this.state.lastX=null,this.state.lastY=null,this.state.tapStartTime=null,clearTimeout(this.state.pressTO)}},{key:"touchend",value:function(t){t.preventDefault(),Object.assign(t,{mobile:!0,duration:t.timeStampUTC-this.state.tapStartTime});var e=o(t.touches);e.length?(t.offsetX=e.reduce(function(t,e){return t+e.pageX},0)/e.length,t.offsetY=e.reduce(function(t,e){return t+e.pageY},0)/e.length,this.state.lastX=t.offsetX,this.state.lastY=t.offsetY):(t.offsetX=this.state.lastX,t.offsetY=this.state.lastY),this.state.moving||this.state.pinching||(t.duration>=this.settings.pressThreshold?this.settings.press(t):(clearTimeout(this.state.pressTO),this.settings.tap(t))),t.touches.length<=1&&(this.state.pinching=!1,this.state.scaleStart=null,this.state.lastPinch=null),0===t.touches.length&&(this.state.moving=null,this.state.lastX=null,this.state.lastY=null,this.state.tapStartTime=null)}},{key:"mousemove",value:function(t){this.state.tapStartTime&&(this.state.moving||(Math.abs(t.offsetX-this.state.lastX)>this.settings.moveThreshold||Math.abs(t.offsetY-this.state.lastY)>this.settings.moveThreshold)&&(this.state.moving=!0,clearTimeout(this.state.pressTO)),this.state.moving&&(Object.assign(t,{mobile:!1,deltaX:t.offsetX-this.state.lastX,deltaY:t.offsetY-this.state.lastY}),this.settings.move(t),this.state.lastX=t.offsetX,this.state.lastY=t.offsetY))}},{key:"touchmove",value:function(t){if(t.preventDefault(),this.state.tapStartTime){var e=o(t.touches);Object(n.has)(t,"scale")||(t.scale=e.length<2?1:Object(n.hypotenuse)(e[0].pageX-e[1].pageX,e[0].pageY-e[1].pageY)/this.state.scaleStart),Object.assign(t,{offsetX:e.reduce(function(t,e){return t+e.pageX},0)/e.length,offsetY:e.reduce(function(t,e){return t+e.pageY},0)/e.length,scaleStep:t.scale/this.state.lastPinch,mobile:!0}),this.state.pinching&&(this.settings.zoom(t),this.state.lastPinch=t.scale),this.state.moving||(Math.abs(t.offsetX-this.state.lastX)>this.settings.moveThreshold||Math.abs(t.offsetY-this.state.lastY)>this.settings.moveThreshold)&&(this.state.moving=!0,clearTimeout(this.state.pressTO)),this.state.moving&&(Object.assign(t,{deltaX:t.offsetX-this.state.lastX,deltaY:t.offsetY-this.state.lastY}),this.settings.move(t),this.state.lastX=t.offsetX,this.state.lastY=t.offsetY)}}},{key:"touchcancel",value:function(t){console.log("touchcancel",t)}},{key:"wheel",value:function(t){Object.assign(t,{scaleStep:1+t.deltaY/this.settings.wheelFactor,mobile:!1}),this.settings.zoom(t)}}])&&a(e.prototype,i),r&&a(e,r),t}();function h(t){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){for(var i=0;i5&&void 0!==arguments[5]?arguments[5]:1,a=r.tileStyle,s=r.orientation,u=r.pips;if(this.pipVertices[a]&&this.pipVertices[a][s]&&this.pipVertices[a][s][u]){e!==this.pipCache.scale&&this.setPipCache(this.pipVertices[a][s],e);var c=2*e*r.scale,l=2*e*r.scale;t.globalAlpha=o,t.drawImage(this.pipCache.pips[u],i-c/2,n-l/2,c,l),t.globalAlpha=1}}},{key:"mine",value:function(t,e,i,n){arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.settings.mine;e!==this.mineCache.scale&&this.setMineCache(e),t.drawImage(this.mineCache.mine,i-e,n-e,2*e,2*e)}},{key:"setMineCache",value:function(t){var e=this;this.mineCache.scale=t,this.mineCache.mine=Object(n.quickCanvas)(function(i){e._mine(i,t,t,t,e.settings.mine.border),e._horns(i,t,t,t,e.settings.mine.border.horns,e.settings.mine.border.color),e._mine(i,t,t,t,e.settings.mine.body),e._horns(i,t,t,t,e.settings.mine.body.horns,e.settings.mine.body.color)},2*t)}},{key:"_mine",value:function(t,e,i,r,o){t.beginPath(),t.moveTo(i,r),t.arc(i,r,e*o.scale,0,2*Math.PI,!0),t.closePath(),t.fillStyle=Object(n.getColor)(o.color),t.fill()}},{key:"_horns",value:function(t,e,i,r,o,a){var s=this,u=e*o.scale,c=e*o.distance;t.beginPath(),this.horns.forEach(function(n){var o=O(n,2),a=o[0],l=o[1];return s.pip(t,e,i,r,a,l,u,c)}),t.closePath(),t.fillStyle=Object(n.getColor)(a),t.fill()}},{key:"explosion",value:function(t,e,i,r){var o=this,a=.667*e,s=.333*e;t.beginPath(),t.moveTo(i,r),t.moveTo(i+a*this.slicesX[0],r+a*this.slicesY[0]),Object(n.range)(this.settings.slices).filter(function(t){return t%2==1}).forEach(function(e){t.lineTo(i+s*o.slicesX[e],r+s*o.slicesY[e]),t.lineTo(i+a*o.slicesX[e+1],r+a*o.slicesY[e+1])}),t.closePath(),t.fillStyle="rgb(255,0,0)",t.fill()}}])&&P(e.prototype,i),r&&P(e,r),t}();function M(t,e){for(var i=0;ithis.settings.scale?this.scaleMin:this.settings.scale}},{key:"setOriginX",value:function(t,e){this.originX=e?e-t/2:this.negativeTiles?parseInt(t/2):this.width?this.width*this.horizontalDistance()/-2+t/2+this.horizontalDistance()/2:this.tileWidth()/2}},{key:"setOriginY",value:function(t,e){var i=this.height*this.verticalDistance();this.originY=e?e+t/2:this.negativeTiles?parseInt(t/2):this.height?i-(i-t)/2-this.verticalDistance()/2:t-this.tileHeight()/2}},{key:"move",value:function(t){Object(n.has)(t,"height")||(t.height=t.target.offsetHeight),Object(n.has)(t,"width")||(t.width=t.target.offsetWidth);var e=this.originX+t.deltaX,i=this.originY+t.deltaY;return this.originX=e,this.originY=i,this._checkMove(t),this.originX===e&&this.originY===i}},{key:"_checkMove",value:function(t){this.negativeTiles?this._checkMoveNegativeTiles(t):this._checkMovePositiveTiles(t)}},{key:"_checkMovePositiveTiles",value:function(t){var e=t.width,i=t.height,n=this.horizontalDistance(),r=this.verticalDistance(),o=this.tileWidth()/2,a=i-this.tileHeight()/2;if(!this.wrap){if(this.originX=this.originX>o?o:this.originX,this.originY=this.originYu?u:this.originY}}}},{key:"_checkMoveNegativeTiles",value:function(t){var e=this.horizontalDistance(),i=this.verticalDistance();if(!this.wrap){if(this.width){var n=t.width,r=(this.width*e+this.horizontalOverhang())/2;this.originX=this.originX>r?r:n-this.originX>r?n-r:this.originX}if(this.height){var o=t.height,a=(this.height*i+this.verticalOverhang())/2;this.originY=this.originY>a?a:o-this.originY>a?o-a:this.originY}}}},{key:"zoom",value:function(t){var e=this.scale,i=e*t.scaleStep;i=Math.max(i,this.scaleMin),e!==(i=Math.min(i,this.scaleMax))&&(this.scale=i,this.move({deltaX:(t.offsetX-this.originX)/e*(e-i),deltaY:(t.offsetY-this.originY)/e*(e-i),width:t.target.offsetWidth,height:t.target.offsetHeight}))}},{key:"remap",value:function(t){Object.assign(this,Object(r.pick)(t,["height","width","negativeTiles"])),this.checkScale(t.canvasHeight,t.canvasWidth),this.setOriginX(t.canvasWidth,t.centerX),this.setOriginY(t.canvasHeight,t.centerY)}}])&&q(e.prototype,i),o&&q(e,o),t}();function H(t){return(H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function B(t,e){return!e||"object"!==H(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function I(t){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function L(t,e){return(L=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var N=function(t){function e(t,i){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),B(this,I(e).call(this,t,i))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&L(t,e)}(e,p),e}();function Q(t){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function F(t,e,i){return(F=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,i){var n=[null];n.push.apply(n,e);var r=new(Function.bind.apply(t,n));return i&&J(r,i.prototype),r}).apply(null,arguments)}function V(t,e){for(var i=0;i=0&&e=0&&i=0&&e=0&&ic&&u>l?o=-a-s:c>l?a=-o-s:s=-o-a,r.x=-0===o?0:o,r.y=-0===a?0:a,r.z=-0===s?0:s,t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ht(t,e)}(e,p),lt(e,null,[{key:"qrToCube",value:function(t,e){return{x:t,y:pt(t,e),z:e}}},{key:"cubeToEvenR",value:function(t){var e=t.x,i=(t.y,t.z);return{col:e+(i+(1&i))/2,row:i}}},{key:"evenRToCube",value:function(t,i){var n=t-(i+(1&i))/2;return new e(n,-n-i,i)}},{key:"cubeToEvenQ",value:function(t){var e=t.x;t.y;return{col:e,row:t.z+(e+(1&e))/2}}},{key:"evenQToCube",value:function(t,i){var n=i-(t+(1&t))/2;return new e(t,-t-n,n)}}]),lt(e,[{key:"getX",value:function(){return this.x}},{key:"getY",value:function(){return this.y}},{key:"getZ",value:function(){return this.z}},{key:"setX",value:function(t){return this.x=t,this}},{key:"setY",value:function(t){return this.y=t,this}},{key:"setZ",value:function(t){return this.z=t,this}},{key:"moveX",value:function(t){return this.x+=t,this}},{key:"moveY",value:function(t){return this.y+=t,this}},{key:"moveZ",value:function(t){return this.z+=t,this}},{key:"getQ",value:function(){return this.x}},{key:"getR",value:function(){return this.z}},{key:"setQ",value:function(t){return this.x=t,this.y=pt(this.x,this.z),this}},{key:"setR",value:function(t){return this.z=t,this.y=pt(this.x,this.z),this}},{key:"moveQ",value:function(t){return this.x+=t,this.y=pt(this.x,this.z),this}},{key:"moveR",value:function(t){return this.z+=t,this.y=pt(this.x,this.z),this}},{key:"getPoint",value:function(){return{x:this.x,y:this.y,z:this.z}}},{key:"setHex",value:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}},{key:"moveHex",value:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}},{key:"subtractHex",value:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}},{key:"getAxial",value:function(){return{q:this.x,r:this.z}}},{key:"setAxial",value:function(t){return this.x=t.q,this.z=t.r,this.y=pt(this.x,this.y),this}},{key:"moveAxial",value:function(t){return this.x+=t.q,this.z+=t.r,this.y=pt(this.x,this.z),this}},{key:"distance",value:function(t){return Math.max(Math.abs(this.x-t.x),Math.abs(this.y-t.y),Math.abs(this.z-t.z))}}]),e}();function gt(t){return(gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yt(t){return function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e=0&&e=0&&t.x