UNPKG

scratchcard

Version:
3 lines (2 loc) 21.4 kB
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.Scratchcard=e()}}(function(){return function e(t,n,r){function i(s,u){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!u&&l)return l(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var a=n[s]={exports:{}};t[s][0].call(a.exports,function(e){var n=t[s][1][e];return i(n?n:e)},a,a.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){"use strict";function r(e){this.options=i({},e,o)}var i=e("lodash.defaults");t.exports=n=r;var o={color:"silver",thickness:50};r.prototype.reset=function(e,t,n){e.fillStyle=this.options.color,e.globalCompositeOperation="source-over",e.fillRect(0,0,t,n)},r.prototype.drawPoint=function(e,t){e.fillStyle="rgba(0,0,0,1)",e.globalCompositeOperation="destination-out",e.beginPath(),e.arc(t.x,t.y,this.options.thickness/2,0,2*Math.PI),e.fill()},r.prototype.drawLine=function(e,t,n){e.lineWidth=this.options.thickness,e.lineCap="round",e.lineJoin="round",e.strokeStyle="rgba(0,0,0,1)",e.globalCompositeOperation="destination-out",e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(n.x,n.y),e.stroke()},r.prototype.complete=function(e,t,n){e.fillStyle="rgba(0,0,0,1)",e.globalCompositeOperation="destination-out",e.fillRect(0,0,t,n)},r.prototype.drawLayer=function(e,t,n,r){}},{"lodash.defaults":5}],2:[function(e,t,n){"use strict";function r(e,t){function n(){return e}function r(t){t?(e=t,E(),A.addEventListener("mousedown",x,!0),A.addEventListener("touchstart",O,!0),G||_()):e&&(e=null,M.parentNode.removeChild(M),A.removeEventListener("mousedown",x,!0),A.removeEventListener("touchstart",O,!0))}function u(){return B}function f(e){B=e instanceof c?e:new c(e),m()}function h(){return M}function p(){return A}function v(){B.reset(z,A.width,A.height),H=!0,$=!1,A.style.pointerEvents=null,b()}function d(e){B.drawPoint(z,e),H=!0}function y(e,t){B.drawLine(z,e,t),H=!0}function g(){B.complete(z,A.width,A.height),H=!0,$=!0,A.style.pointerEvents="none",b()}function m(){$?B.complete(z,A.width,A.height):B.reset(z,A.width,A.height),H=!0;for(var e=0,t=k.length;e<t;e++){var n=k[e];B.drawLayer(n.ctx,n.canvas.width,n.canvas.height,e)}b()}function w(){var e=A.width,n=A.height,r=e*n;if(0===r)return 0;for(var i=0,o=z.getImageData(0,0,e,n).data,s=3,u=o.length;s<u;s+=4)o[s]>=t.threshold&&i++;return(r-i)/r}function b(){if(H){var e=J;J=w(),H=!1,J!==e&&(C.emit("progress",J),1!==J||$||g())}}function E(){var t=e.parentNode;if(!t)return void r(null);M.nextSibling!==e&&t.insertBefore(M,e);var n=o(e);if(A.width!==n.width||A.height!==n.height){A.width=n.width,A.height=n.height;for(var i=0,s=k.length;i<s;i++){var u=k[i].canvas;u.width=n.width,u.height=n.height}m()}}function _(){if(!e)return void(G=!1);D(_),G=!0,E();for(var n in U){var r=F[n],i=U[n];r?i.x===r.x&&i.y===r.y||y(r,i):d(i)}(t.realtime||0===q&&I>0)&&b(),F=U,I=q}function x(e){if(0===e.button){e.preventDefault();var t=A.getBoundingClientRect();U={mouse:{x:e.clientX-t.left,y:e.clientY-t.top}},q=1,window.addEventListener("mousemove",L,!0),window.addEventListener("mouseup",j,!0),A.removeEventListener("mousedown",x,!0),A.removeEventListener("touchstart",O,!0)}}function L(e){if(0===e.button){e.preventDefault();var t=A.getBoundingClientRect();U={mouse:{x:e.clientX-t.left,y:e.clientY-t.top}},q=1}}function j(t){0===t.button&&(t.preventDefault(),U={},q=0,window.removeEventListener("mousemove",L,!0),window.removeEventListener("mouseup",j,!0),e&&(A.addEventListener("mousedown",x,!0),A.addEventListener("touchstart",O,!0)))}function O(e){e.preventDefault(),U={},q=e.touches.length;for(var t=A.getBoundingClientRect(),n=0;n<q;n++){var r=e.touches[n];U[r.identifier]={x:r.clientX-t.left,y:r.clientY-t.top}}window.addEventListener("touchstart",S,!0),window.addEventListener("touchmove",S,!0),window.addEventListener("touchend",S,!0),A.removeEventListener("mousedown",x,!0),A.removeEventListener("touchstart",O,!0)}function S(t){if(t.preventDefault(),U={},q=t.touches.length,q>0)for(var n=A.getBoundingClientRect(),r=0;r<q;r++){var i=t.touches[r];U[i.identifier]={x:i.clientX-n.left,y:i.clientY-n.top}}else window.removeEventListener("touchstart",S,!0),window.removeEventListener("touchmove",S,!0),window.removeEventListener("touchend",S,!0),e&&(A.addEventListener("mousedown",x,!0),A.addEventListener("touchstart",O,!0))}if(i())throw new Error("Internet Explorer not supported prior to version 9");s.call(this);var C=this,A=document.createElement("canvas");if(!A.getContext)throw new Error("HTML5 canvas not supported");var z=A.getContext("2d");t=t instanceof c?l({painter:t},a):l({},t,a);var D=window.requestAnimationFrame,T=t.animationFrame;if(T&&T.request&&(D=T.request.bind(T)),!D)throw new Error("requestAnimationFrame not supported");var N=o(e);A.style.position="absolute",A.width=N.width,A.height=N.height,A.style.zIndex=t.layers+1,A.style["-webkit-tap-highlight-color"]="rgba(0,0,0,0)";var M=document.createElement("div");M.className="scratchcard",M.style.position="relative",M.style.display="inline",M.style.verticalAlign="top",M.appendChild(A);for(var k=[],P=0;P<t.layers;P++){var R=document.createElement("canvas");R.style.position="absolute",R.width=N.width,R.height=N.height,R.style.zIndex=P+1,R.style.pointerEvents="none",k.push({canvas:R,ctx:R.getContext("2d")}),M.appendChild(R)}var B=null,F={},I=0,U={},q=0,H=!1,J=null,$=!1,G=!1;this.getElement=n,this.setElement=r,this.getPainter=u,this.setPainter=f,this.getWrapper=h,this.getCanvas=p,this.reset=v,this.complete=g,this.getProgress=w,f(t.painter),e&&(e.parentNode.insertBefore(M,e),e.style.visibility="visible",A.addEventListener("mousedown",x,!0),A.addEventListener("touchstart",O,!0),_())}function i(){var e=document.createElement("div");return e.innerHTML="<!--[if lt IE 9]><i></i><![endif]-->",1===e.getElementsByTagName("i").length}function o(e){if(!e)return f;var t=e.getClientRects();if(0===t.length)return f;var n=t[0];return{width:Math.ceil(n.right)-Math.floor(n.left),height:Math.ceil(n.bottom)-Math.floor(n.top)}}var s=e("events").EventEmitter,u=e("util"),l=e("lodash.defaults"),c=r.Painter=e("./painter");t.exports=n=r;var a={threshold:255,realtime:!1,layers:0,painter:{},animationFrame:null};u.inherits(r,s);var f={width:0,height:0}},{"./painter":1,events:3,"lodash.defaults":5,util:8}],3:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function o(e){return"number"==typeof e}function s(e){return"object"==typeof e&&null!==e}function u(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!o(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,o,l,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;var a=new Error('Uncaught, unspecified "error" event. ('+t+")");throw a.context=t,a}if(n=this._events[e],u(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),n.apply(this,o)}else if(s(n))for(o=Array.prototype.slice.call(arguments,1),c=n.slice(),r=c.length,l=0;l<r;l++)c[l].apply(this,o);return!0},r.prototype.addListener=function(e,t){var n;if(!i(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?s(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,s(this._events[e])&&!this._events[e].warned&&(n=u(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,o,u;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],o=n.length,r=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(n)){for(u=o;u-- >0;)if(n[u]===t||n[u].listener&&n[u].listener===t){r=u;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],i(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],4:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],5:[function(e,t,n){(function(e){function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function r(e){return function(t){return null==t?void 0:t[e]}}function i(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function o(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function s(e,t,n,r){return void 0===e||y(e,k[n])&&!P.call(r,n)?t:e}function u(e,t,n){var r=e[t];P.call(e,t)&&y(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function l(e){e=null==e?e:Object(e);var t=[];for(var n in e)t.push(n);return t}function c(e,t){return t=U(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=U(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var u=Array(t+1);++i<t;)u[i]=r[i];return u[t]=s,n(e,this,u)}}function a(e,t,n,r){n||(n={});for(var i=-1,o=t.length;++i<o;){var s=t[i],l=r?r(n[s],e[s],s,n,e):void 0;u(n,s,void 0===l?e[s]:l)}return n}function f(e){return c(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,s&&v(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var u=n[r];u&&e(t,u,r,o)}return t})}function h(e){var t=e?e.length:void 0;return E(t)&&(H(e)||L(e)||g(e))?i(t,String):null}function p(e,t){return t=null==t?O:t,!!t&&("number"==typeof e||D.test(e))&&e>-1&&e%1==0&&e<t}function v(e,t,n){if(!_(n))return!1;var r=typeof t;return!!("number"==r?m(n)&&p(t,n.length):"string"==r&&t in n)&&y(n[t],e)}function d(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||k;return e===n}function y(e,t){return e===t||e!==e&&t!==t}function g(e){return w(e)&&P.call(e,"callee")&&(!I.call(e,"callee")||R.call(e)==S)}function m(e){return null!=e&&E(q(e))&&!b(e)}function w(e){return x(e)&&m(e)}function b(e){var t=_(e)?R.call(e):"";return t==C||t==A}function E(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=O}function _(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function x(e){return!!e&&"object"==typeof e}function L(e){return"string"==typeof e||!H(e)&&x(e)&&R.call(e)==z}function j(e){for(var t=-1,n=d(e),r=l(e),i=r.length,o=h(e),s=!!o,u=o||[],c=u.length;++t<i;){var a=r[t];s&&("length"==a||p(a,c))||"constructor"==a&&(n||!P.call(e,a))||u.push(a)}return u}var O=9007199254740991,S="[object Arguments]",C="[object Function]",A="[object GeneratorFunction]",z="[object String]",D=/^(?:0|[1-9]\d*)$/,T="object"==typeof e&&e&&e.Object===Object&&e,N="object"==typeof self&&self&&self.Object===Object&&self,M=T||N||Function("return this")(),k=Object.prototype,P=k.hasOwnProperty,R=k.toString,B=M.Reflect,F=B?B.enumerate:void 0,I=k.propertyIsEnumerable,U=Math.max;F&&!I.call({valueOf:1},"valueOf")&&(l=function(e){return o(F(e))});var q=r("length"),H=Array.isArray,J=f(function(e,t,n,r){a(t,j(t),e,r)}),$=c(function(e){return e.push(void 0,s),n(J,void 0,e)});t.exports=$}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],6:[function(e,t,n){function r(e){if(c===setTimeout)return setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(e){if(a===clearTimeout)return clearTimeout(e);try{return a(e)}catch(t){try{return a.call(null,e)}catch(t){return a.call(this,e)}}}function o(){v&&h&&(v=!1,h.length?p=h.concat(p):d=-1,p.length&&s())}function s(){if(!v){var e=r(o);v=!0;for(var t=p.length;t;){for(h=p,p=[];++d<t;)h&&h[d].run();d=-1,t=p.length}h=null,v=!1,i(e)}}function u(e,t){this.fun=e,this.array=t}function l(){}var c,a,f=t.exports={};!function(){try{c=setTimeout}catch(e){c=function(){throw new Error("setTimeout is not defined")}}try{a=clearTimeout}catch(e){a=function(){throw new Error("clearTimeout is not defined")}}}();var h,p=[],v=!1,d=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];p.push(new u(e,t)),1!==p.length||v||r(s)},u.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=l,f.addListener=l,f.once=l,f.off=l,f.removeListener=l,f.removeAllListeners=l,f.emit=l,f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},{}],7:[function(e,t,n){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],8:[function(e,t,n){(function(t,r){function i(e,t){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(t)?r.showHidden=t:t&&n._extend(r,t),E(r.showHidden)&&(r.showHidden=!1),E(r.depth)&&(r.depth=2),E(r.colors)&&(r.colors=!1),E(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),l(r,e,r.depth)}function o(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function s(e,t){return e}function u(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function l(e,t,r){if(e.customInspect&&t&&O(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(r,e);return w(i)||(i=l(e,i,r)),i}var o=c(e,t);if(o)return o;var s=Object.keys(t),d=u(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),j(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return a(t);if(0===s.length){if(O(t)){var y=t.name?": "+t.name:"";return e.stylize("[Function"+y+"]","special")}if(_(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(L(t))return e.stylize(Date.prototype.toString.call(t),"date");if(j(t))return a(t)}var g="",m=!1,b=["{","}"];if(v(t)&&(m=!0,b=["[","]"]),O(t)){var E=t.name?": "+t.name:"";g=" [Function"+E+"]"}if(_(t)&&(g=" "+RegExp.prototype.toString.call(t)),L(t)&&(g=" "+Date.prototype.toUTCString.call(t)),j(t)&&(g=" "+a(t)),0===s.length&&(!m||0==t.length))return b[0]+g+b[1];if(r<0)return _(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var x;return x=m?f(e,t,r,d,s):s.map(function(n){return h(e,t,r,d,n,m)}),e.seen.pop(),p(x,g,b)}function c(e,t){if(E(t))return e.stylize("undefined","undefined");if(w(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return m(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}function a(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,n,r,i){for(var o=[],s=0,u=t.length;s<u;++s)D(t,String(s))?o.push(h(e,t,n,r,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(h(e,t,n,r,i,!0))}),o}function h(e,t,n,r,i,o){var s,u,c;if(c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},c.get?u=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(u=e.stylize("[Setter]","special")),D(r,i)||(s="["+i+"]"),u||(e.seen.indexOf(c.value)<0?(u=y(n)?l(e,c.value,null):l(e,c.value,n-1),u.indexOf("\n")>-1&&(u=o?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n"))):u=e.stylize("[Circular]","special")),E(s)){if(o&&i.match(/^\d+$/))return u;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+u}function p(e,t,n){var r=0,i=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function v(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function y(e){return null===e}function g(e){return null==e}function m(e){return"number"==typeof e}function w(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function E(e){return void 0===e}function _(e){return x(e)&&"[object RegExp]"===C(e)}function x(e){return"object"==typeof e&&null!==e}function L(e){return x(e)&&"[object Date]"===C(e)}function j(e){return x(e)&&("[object Error]"===C(e)||e instanceof Error)}function O(e){return"function"==typeof e}function S(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function C(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}function z(){var e=new Date,t=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":");return[e.getDate(),k[e.getMonth()],t].join(" ")}function D(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var T=/%[sdj%]/g;n.format=function(e){if(!w(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(i(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,o=r.length,s=String(e).replace(T,function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),u=r[n];n<o;u=r[++n])s+=y(u)||!x(u)?" "+u:" "+i(u);return s},n.deprecate=function(e,i){function o(){if(!s){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?console.trace(i):console.error(i),s=!0}return e.apply(this,arguments)}if(E(r.process))return function(){return n.deprecate(e,i).apply(this,arguments)};if(t.noDeprecation===!0)return e;var s=!1;return o};var N,M={};n.debuglog=function(e){if(E(N)&&(N=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!M[e])if(new RegExp("\\b"+e+"\\b","i").test(N)){var r=t.pid;M[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else M[e]=function(){};return M[e]},n.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=v,n.isBoolean=d,n.isNull=y,n.isNullOrUndefined=g,n.isNumber=m,n.isString=w,n.isSymbol=b,n.isUndefined=E,n.isRegExp=_,n.isObject=x,n.isDate=L,n.isError=j,n.isFunction=O,n.isPrimitive=S,n.isBuffer=e("./support/isBuffer");var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",z(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!x(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":7,_process:6,inherits:4}]},{},[2])(2)}); //# sourceMappingURL=scratchcard.min.js.map