!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.line_heatmap=e():t.line_heatmap=e()}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(3),i=n.n(r);function a(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},e={container:document.getElementById(this.ID)};e=Object.assign(e,t),this.heatmap=i.a.create(e),console.log(this.heatmap)}},{key:"setTrackData",value:function(t){var e=this;this.heatmap.setData({max:0,min:0,data:[]}),t.forEach(function(t){e.heatmap.addData(t)})}},{key:"instance",get:function(){return this.heatmap}}])&&a(e.prototype,n),r&&a(e,r),t}()},function(t,e,n){"use strict";(function(t){var r,i,a,o,s,l,u,c,d=n(0),h=(n(2),'
\n
\n
\n
\n
\n
\n
\n
\n
\n'),f=10,p={},m=!0,g=null;function v(t,e,n,r){for(var i=p.heatmap.instance.getData().data,a=0,o=0;o=t&&s.y>=e&&s.x<=n&&s.y<=r&&(a+=s.value)}return a}function y(){return p.data.length}function x(){return p.data}function b(t){return t.split("\n").filter(function(t){return t.split(",").length>3}).map(function(t){var e=JSON.parse("["+t+"]");return{x:e[0],y:e[1],value:1}})}function _(t,e,n,r,i){var a=v(e,n,r,i),o=a/y();t.innerHTML='Quantidade de clicks: '.concat(a,'\n Proporção em relação ao total: ').concat(o,"")}function w(t){if(t.length<=1)return 0;if(2==t.length)return S(t[0],t[1]);var e=0;return t.reduce(function(t,n){return e+=S(t,n),n}),e}function S(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}e.a={init:function(e,n){var v=arguments.length>2&&void 0!==arguments[2]&&arguments[2],y=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},x=document.getElementById(e);x.innerHTML=h;var w=b(n),S=new d.a("line-heatmap-view");S.create(y),S.setTrackData(w);var C,E=document.getElementById("line-heatmap-slider");if(t.create(E,{start:[1,w.length],connect:!0,step:1,margin:1,range:{min:1,max:w.length}}),p.container=x,p.heatmap=S,p.data=w,p.slider=E,v){C=document.querySelector(".heatmap-canvas"),window.onclick=function(t){if(t.target===C)if(m)t.pageX||t.pageY?(r=t.pageX,i=t.pageY):(r=t.clientX+document.body.scrollLeft+C.scrollLeft,i=t.clientY+document.body.scrollTop+C.scrollTop),r-=C.offsetLeft,i-=C.offsetTop,m=!1;else{t.pageX||t.pageY?(a=t.pageX,o=t.pageY):(a=t.clientX+document.body.scrollLeft+C.scrollLeft,o=t.clientY+document.body.scrollTop+C.scrollTop),a-=C.offsetLeft,o-=C.offsetTop,m=!0,null!==g&&(document.getElementById("line-heatmap-canvas").removeChild(g),g=null),g=document.createElement("div"),s=Math.min(r,a),l=Math.min(i,o)-585,u=Math.max(i,o)-585,c=Math.max(r,a);var e=Math.abs(c-s),n=Math.abs(u-l);_(g,s,l,c,u),g.style.width=e+"px",g.style.height=n+"px",g.style.position="absolute",g.style.top=l+"px",g.style.left=s+"px",g.style.border="1px solid green",document.getElementById("line-heatmap-canvas").append(g)}};var D=document.getElementById("line-heatmap-canvas"),M=document.getElementById("line-heatmap-tooltip");D.onmousemove=function(t){var e=t.layerX,n=t.layerY,r=p.heatmap.instance.getValueAt({x:e,y:n});M.style.display="block",function(t,e,n){var r="translate(".concat(t+f,"px, ").concat(e+f,"px)");M.style.webkitTransform=r,M.innerHTML="(".concat(t,",").concat(e,",").concat(n,")")}(e,n,r)},D.onmouseout=function(){M.style.display="none"}}E.noUiSlider.on("update",function(t,e){var n=this.get(),r=p.data.slice(+n[0]-1,+n[1]+1);p.heatmap.setTrackData(r),null!==g&&_(g,s,l,c,u)})},updateLogString:function(t){var e=b(t);p.data=e,p.slider.noUiSlider.updateOptions({range:{min:1,max:e.length}}),p.heatmap.setTrackData(e)},countClicks:v,totalClicks:y,getData:x,calcPixelsPerClick:function(){return w(x())/y()},calcPixelsPerClickInArea:function(){return null==g?0:w(function(t,e,n,r){for(var i=p.heatmap.instance.getData().data,a=[],o=0;o=t&&s.y>=e&&s.x<=n&&s.y<=r&&a.push(s)}return a}(s,l,c,u))/v(s,l,c,u)}}}).call(this,n(2))},function(t,e,n){var r,i,a;/*! nouislider - 12.1.0 - 10/25/2018 */i=[],void 0===(a="function"==typeof(r=function(){"use strict";var t="12.1.0";function e(t){return null!=t}function n(t){t.preventDefault()}function r(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function i(t,e,n){n>0&&(l(t,e),setTimeout(function(){u(t,e)},n))}function a(t){return Math.max(Math.min(t,100),0)}function o(t){return Array.isArray(t)?t:[t]}function s(t){var e=(t=String(t)).split(".");return e.length>1?e[1].length:0}function l(t,e){t.classList?t.classList.add(e):t.className+=" "+e}function u(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function c(t){var e=void 0!==window.pageXOffset,n="CSS1Compat"===(t.compatMode||""),r=e?window.pageXOffset:n?t.documentElement.scrollLeft:t.body.scrollLeft,i=e?window.pageYOffset:n?t.documentElement.scrollTop:t.body.scrollTop;return{x:r,y:i}}function d(t,e){return 100/(e-t)}function h(t,e){return 100*e/(t[1]-t[0])}function f(t,e){for(var n=1;t>=e[n];)n+=1;return n}function p(t,e,n){if(n>=t.slice(-1)[0])return 100;var r=f(n,t),i=t[r-1],a=t[r],o=e[r-1],s=e[r];return o+function(t,e){return h(t,t[0]<0?e+Math.abs(t[0]):e-t[0])}([i,a],n)/d(o,s)}function m(t,e,n,r){if(100===r)return r;var i=f(r,t),a=t[i-1],o=t[i];return n?r-a>(o-a)/2?o:a:e[i-1]?t[i-1]+function(t,e){return Math.round(t/e)*e}(r-t[i-1],e[i-1]):r}function g(e,n,i){var a;if("number"==typeof n&&(n=[n]),!Array.isArray(n))throw new Error("noUiSlider ("+t+"): 'range' contains invalid value.");if(!r(a="min"===e?0:"max"===e?100:parseFloat(e))||!r(n[0]))throw new Error("noUiSlider ("+t+"): 'range' value isn't numeric.");i.xPct.push(a),i.xVal.push(n[0]),a?i.xSteps.push(!isNaN(n[1])&&n[1]):isNaN(n[1])||(i.xSteps[0]=n[1]),i.xHighestCompleteStep.push(0)}function v(t,e,n){if(!e)return!0;n.xSteps[t]=h([n.xVal[t],n.xVal[t+1]],e)/d(n.xPct[t],n.xPct[t+1]);var r=(n.xVal[t+1]-n.xVal[t])/n.xNumSteps[t],i=Math.ceil(Number(r.toFixed(3))-1),a=n.xVal[t]+n.xNumSteps[t]*i;n.xHighestCompleteStep[t]=a}function y(t,e,n){var r;this.xPct=[],this.xVal=[],this.xSteps=[n||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=e;var i=[];for(r in t)t.hasOwnProperty(r)&&i.push([t[r],r]);for(i.length&&"object"==typeof i[0][0]?i.sort(function(t,e){return t[0][0]-e[0][0]}):i.sort(function(t,e){return t[0]-e[0]}),r=0;r=100)return t.slice(-1)[0];var r=f(n,e),i=t[r-1],a=t[r],o=e[r-1],s=e[r];return function(t,e){return e*(t[1]-t[0])/100+t[0]}([i,a],(n-o)*d(o,s))}(this.xVal,this.xPct,t)},y.prototype.getStep=function(t){return t=m(this.xPct,this.xSteps,this.snap,t)},y.prototype.getNearbySteps=function(t){var e=f(t,this.xPct);return{stepBefore:{startValue:this.xVal[e-2],step:this.xNumSteps[e-2],highestStep:this.xHighestCompleteStep[e-2]},thisStep:{startValue:this.xVal[e-1],step:this.xNumSteps[e-1],highestStep:this.xHighestCompleteStep[e-1]},stepAfter:{startValue:this.xVal[e],step:this.xNumSteps[e],highestStep:this.xHighestCompleteStep[e]}}},y.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(s);return Math.max.apply(null,t)},y.prototype.convert=function(t){return this.getStep(this.toStepping(t))};var x={to:function(t){return void 0!==t&&t.toFixed(2)},from:Number};function b(e){if(function(t){return"object"==typeof t&&"function"==typeof t.to&&"function"==typeof t.from}(e))return!0;throw new Error("noUiSlider ("+t+"): 'format' requires 'to' and 'from' methods.")}function _(e,n){if(!r(n))throw new Error("noUiSlider ("+t+"): 'step' is not numeric.");e.singleStep=n}function w(e,n){if("object"!=typeof n||Array.isArray(n))throw new Error("noUiSlider ("+t+"): 'range' is not an object.");if(void 0===n.min||void 0===n.max)throw new Error("noUiSlider ("+t+"): Missing 'min' or 'max' in 'range'.");if(n.min===n.max)throw new Error("noUiSlider ("+t+"): 'range' 'min' and 'max' cannot be equal.");e.spectrum=new y(n,e.snap,e.singleStep)}function S(e,n){if(n=o(n),!Array.isArray(n)||!n.length)throw new Error("noUiSlider ("+t+"): 'start' option is incorrect.");e.handles=n.length,e.start=n}function C(e,n){if(e.snap=n,"boolean"!=typeof n)throw new Error("noUiSlider ("+t+"): 'snap' option must be a boolean.")}function E(e,n){if(e.animate=n,"boolean"!=typeof n)throw new Error("noUiSlider ("+t+"): 'animate' option must be a boolean.")}function D(e,n){if(e.animationDuration=n,"number"!=typeof n)throw new Error("noUiSlider ("+t+"): 'animationDuration' option must be a number.")}function M(e,n){var r,i=[!1];if("lower"===n?n=[!0,!1]:"upper"===n&&(n=[!1,!0]),!0===n||!1===n){for(r=1;r=100)throw new Error("noUiSlider ("+t+"): 'padding' option must not exceed 100% of the range.")}}function U(e,n){switch(n){case"ltr":e.dir=0;break;case"rtl":e.dir=1;break;default:throw new Error("noUiSlider ("+t+"): 'direction' option was not recognized.")}}function A(e,n){if("string"!=typeof n)throw new Error("noUiSlider ("+t+"): 'behaviour' must be a string containing options.");var r=n.indexOf("tap")>=0,i=n.indexOf("drag")>=0,a=n.indexOf("fixed")>=0,o=n.indexOf("snap")>=0,s=n.indexOf("hover")>=0,l=n.indexOf("unconstrained")>=0;if(a){if(2!==e.handles)throw new Error("noUiSlider ("+t+"): 'fixed' behaviour must be used with 2 handles");k(e,e.start[1]-e.start[0])}if(l&&(e.margin||e.limit))throw new Error("noUiSlider ("+t+"): 'unconstrained' behaviour cannot be used with margin or limit");e.events={tap:r||o,drag:i,fixed:a,snap:o,hover:s,unconstrained:l}}function L(e,n){if(!1!==n)if(!0===n){e.tooltips=[];for(var r=0;rA&&((s=j(i,!1)).className=c(o,r.cssClasses.value),s.setAttribute("data-value",a),s.style[r.style]=t+"%",s.innerHTML=n.to(a))}}(a,t[a][0],t[a][1])}),i}function H(){var t;m&&((t=m).parentElement.removeChild(t),m=null)}function X(e){H();var n=e.mode,r=e.density||1,i=e.filter||!1,a=e.values||!1,o=e.stepped||!1,s=function(e,n,r){if("range"===e||"steps"===e)return D.xVal;if("count"===e){if(n<2)throw new Error("noUiSlider ("+t+"): 'values' (>= 2) required for mode 'count'.");var i=n-1,a=100/i;for(n=[];i--;)n[i]=i*a;n.push(100),e="positions"}return"positions"===e?n.map(function(t){return D.fromStepping(r?D.getStep(t):t)}):"values"===e?r?n.map(function(t){return D.fromStepping(D.getStep(D.toStepping(t)))}):n:void 0}(n,a,o),l=function(t,e,n){var r,i={},a=D.xVal[0],o=D.xVal[D.xVal.length-1],s=!1,l=!1,u=0;return(r=n.slice().sort(function(t,e){return t-e}),n=r.filter(function(t){return!this[t]&&(this[t]=!0)},{}))[0]!==a&&(n.unshift(a),s=!0),n[n.length-1]!==o&&(n.push(o),l=!0),n.forEach(function(r,a){var o,c,d,h,f,p,m,g,v,y,x=r,b=n[a+1],_="steps"===e;if(_&&(o=D.xNumSteps[a]),o||(o=b-x),!1!==x&&void 0!==b)for(o=Math.max(o,1e-7),c=x;c<=b;c=(c+o).toFixed(7)/1){for(g=(f=(h=D.toStepping(c))-u)/t,y=f/(v=Math.round(g)),d=1;d<=v;d+=1)i[(p=u+d*y).toFixed(5)]=[D.fromStepping(p),0];m=n.indexOf(c)>-1?L:_?V:A,!a&&s&&(m=0),c===b&&l||(i[h.toFixed(5)]=[c,m]),u=h}}),i}(r,n,s),u=e.format||{to:Math.round};return m=w.appendChild(I(l,i,u))}function Y(){var t=d.getBoundingClientRect(),e="offset"+["Width","Height"][r.ort];return 0===r.ort?t.width||d[e]:t.height||d[e]}function G(t,e,n,i){var a=function(a){return!!(a=function(t,e,n){var r,i,a=0===t.type.indexOf("touch"),o=0===t.type.indexOf("mouse"),s=0===t.type.indexOf("pointer");if(0===t.type.indexOf("MSPointer")&&(s=!0),a){var l=function(t){return t.target===n||n.contains(t.target)};if("touchstart"===t.type){var u=Array.prototype.filter.call(t.touches,l);if(u.length>1)return!1;r=u[0].pageX,i=u[0].pageY}else{var d=Array.prototype.find.call(t.changedTouches,l);if(!d)return!1;r=d.pageX,i=d.pageY}}return e=e||c(k),(o||s)&&(r=t.clientX+e.x,i=t.clientY+e.y),t.pageOffset=e,t.points=[r,i],t.cursor=o||s,t}(a,i.pageOffset,i.target||e))&&!(w.hasAttribute("disabled")&&!i.doNotReject)&&(o=w,s=r.cssClasses.tap,!((o.classList?o.classList.contains(s):new RegExp("\\b"+s+"\\b").test(o.className))&&!i.doNotReject)&&!(t===x.start&&void 0!==a.buttons&&a.buttons>1)&&(!i.hover||!a.buttons)&&(_||a.preventDefault(),a.calcPoint=a.points[r.ort],void n(a,i)));var o,s},o=[];return t.split(" ").forEach(function(t){e.addEventListener(t,a,!!_&&{passive:!0}),o.push([t,a])}),o}function q(t){var e,n,i,o,s,l,u=t-(e=d,n=r.ort,i=e.getBoundingClientRect(),o=e.ownerDocument,s=o.documentElement,l=c(o),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(l.x=0),n?i.top+l.y-s.clientTop:i.left+l.x-s.clientLeft),h=100*u/Y();return h=a(h),r.dir?100-h:h}function J(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&W(t,e)}function Q(t,e){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==e.buttonsProperty)return W(t,e);var n=(r.dir?-1:1)*(t.calcPoint-e.startCalcPoint),i=100*n/e.baseSize;at(n>0,i,e.locations,e.handleNumbers)}function W(t,e){e.handle&&(u(e.handle,r.cssClasses.active),E-=1),e.listeners.forEach(function(t){O.removeEventListener(t[0],t[1])}),0===E&&(u(w,r.cssClasses.drag),st(),t.cursor&&(P.style.cursor="",P.removeEventListener("selectstart",n))),e.handleNumbers.forEach(function(t){et("change",t),et("set",t),et("end",t)})}function $(t,e){var i;if(1===e.handleNumbers.length){var a=h[e.handleNumbers[0]];if(a.hasAttribute("disabled"))return!1;i=a.children[0],E+=1,l(i,r.cssClasses.active)}t.stopPropagation();var o=[],s=G(x.move,O,Q,{target:t.target,handle:i,listeners:o,startCalcPoint:t.calcPoint,baseSize:Y(),pageOffset:t.pageOffset,handleNumbers:e.handleNumbers,buttonsProperty:t.buttons,locations:S.slice()}),u=G(x.end,O,W,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:e.handleNumbers}),c=G("mouseout",O,J,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:e.handleNumbers});o.push.apply(o,s.concat(u,c)),t.cursor&&(P.style.cursor=getComputedStyle(t.target).cursor,h.length>1&&l(w,r.cssClasses.drag),P.addEventListener("selectstart",n,!1)),e.handleNumbers.forEach(function(t){et("start",t)})}function K(t){t.stopPropagation();var e=q(t.calcPoint),n=function(t){var e=100,n=!1;return h.forEach(function(r,i){if(!r.hasAttribute("disabled")){var a=Math.abs(S[i]-t);(a1&&!r.events.unconstrained&&(i&&e>0&&(n=Math.max(n,t[e-1]+r.margin)),o&&e1&&r.limit&&(i&&e>0&&(n=Math.min(n,t[e-1]+r.limit)),o&&e1?r.forEach(function(t,n){var r=rt(i,t,i[t]+e,a[n],o[n],!1);!1===r?e=0:(e=r-i[t],i[t]=r)}):a=o=[!0];var s=!1;r.forEach(function(t,r){s=lt(t,n[t]+e,a[r],o[r])||s}),s&&r.forEach(function(t){et("update",t),et("slide",t)})}function ot(t,e){return r.dir?100-t-e:t}function st(){C.forEach(function(t){var e=S[t]>50?-1:1,n=3+(h.length+e*t);h[t].style.zIndex=n})}function lt(t,e,n,i){return!1!==(e=rt(S,t,e,n,i,!1))&&(function(t,e){S[t]=e,M[t]=D.fromStepping(e);var n="translate("+it(nt(ot(e,0)-F),"0")+")";h[t].style[r.transformRule]=n,ut(t),ut(t+1)}(t,e),!0)}function ut(t){if(f[t]){var e=0,n=100;0!==t&&(e=S[t-1]),t!==f.length-1&&(n=S[t]);var i=n-e,a="translate("+it(nt(ot(e,i)),"0")+")",o="scale("+it(i/100,"1")+")";f[t].style[r.transformRule]=a+" "+o}}function ct(t,e){var n=o(t),a=void 0===S[0];e=void 0===e||!!e,r.animate&&!a&&i(w,r.cssClasses.tap,r.animationDuration),C.forEach(function(t){lt(t,function(t,e){return null===t||!1===t||void 0===t?S[e]:("number"==typeof t&&(t=String(t)),t=r.format.from(t),!1===(t=D.toStepping(t))||isNaN(t)?S[e]:t)}(n[t],t),!0,!1)}),C.forEach(function(t){lt(t,S[t],!0,!0)}),st(),C.forEach(function(t){et("update",t),null!==n[t]&&e&&et("set",t)})}function dt(){var t=M.map(r.format.to);return 1===t.length?t[0]:t}return l(y=w,r.cssClasses.target),0===r.dir?l(y,r.cssClasses.ltr):l(y,r.cssClasses.rtl),0===r.ort?l(y,r.cssClasses.horizontal):l(y,r.cssClasses.vertical),d=j(y,r.cssClasses.base),function(t,e){var n=j(e,r.cssClasses.connects);h=[],(f=[]).push(B(n,t[0]));for(var i=0;in.stepAfter.startValue&&(i=n.stepAfter.startValue-r),a=r>n.thisStep.startValue?n.thisStep.step:!1!==n.stepBefore.step&&r-n.stepBefore.highestStep,100===t?i=null:0===t&&(a=null);var o=D.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(o))),null!==a&&!1!==a&&(a=Number(a.toFixed(o))),[a,i]})},on:tt,off:function(t){var e=t&&t.split(".")[0],n=e&&t.substring(e.length);Object.keys(N).forEach(function(t){var r=t.split(".")[0],i=t.substring(r.length);e&&e!==r||n&&n!==i||delete N[t]})},get:dt,set:ct,setHandle:function(e,n,r){var i=[];if(!((e=Number(e))>=0&&es?(e?this.setDataMax(d):this._max=d,!1):d0)for(var t=arguments[0],e=t.length;e--;)this.addData.call(this,t[e]);else{var n=this._organiseData(arguments[0],!0);n&&(0===this._data.length&&(this._min=this._max=n.value),this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[n]}))}return this},setData:function(t){var e=t.data,n=e.length;this._data=[],this._radi=[];for(var r=0;r0&&(this._drawAlpha(t),this._colorize())},renderAll:function(t){this._clear(),t.data.length>0&&(this._drawAlpha(function(t){for(var e=[],n=t.min,r=t.max,i=t.radi,a=(t=t.data,Object.keys(t)),o=a.length;o--;)for(var s=a[o],l=Object.keys(t[s]),u=l.length;u--;){var c=l[u],d=t[s][c],h=i[s][c];e.push({x:s,y:c,value:d,radius:h})}return{min:n,max:r,data:e}}(t)),this._colorize())},_updateGradient:function(e){this._palette=t(e)},updateConfig:function(t){t.gradient&&this._updateGradient(t),this._setStyles(t)},setDimensions:function(t,e){this._width=t,this._height=e,this.canvas.width=this.shadowCanvas.width=t,this.canvas.height=this.shadowCanvas.height=e},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(t){this._blur=0==t.blur?0:t.blur||t.defaultBlur,t.backgroundColor&&(this.canvas.style.backgroundColor=t.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=t.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=t.height||this._height,this._opacity=255*(t.opacity||0),this._maxOpacity=255*(t.maxOpacity||t.defaultMaxOpacity),this._minOpacity=255*(t.minOpacity||t.defaultMinOpacity),this._useGradientOpacity=!!t.useGradientOpacity},_drawAlpha:function(t){for(var n=this._min=t.min,r=this._max=t.max,i=(t=t.data||[]).length,a=1-this._blur;i--;){var o,s=t[i],l=s.x,u=s.y,c=s.radius,d=Math.min(s.value,r),h=l-c,f=u-c,p=this.shadowCtx;this._templates[c]?o=this._templates[c]:this._templates[c]=o=e(c,a);var m=(d-n)/(r-n);p.globalAlpha=m<.01?.01:m,p.drawImage(o,h,f),hthis._renderBoundaries[2]&&(this._renderBoundaries[2]=h+2*c),f+2*c>this._renderBoundaries[3]&&(this._renderBoundaries[3]=f+2*c)}},_colorize:function(){var t=this._renderBoundaries[0],e=this._renderBoundaries[1],n=this._renderBoundaries[2]-t,r=this._renderBoundaries[3]-e,i=this._width,a=this._height,o=this._opacity,s=this._maxOpacity,l=this._minOpacity,u=this._useGradientOpacity;t<0&&(t=0),e<0&&(e=0),t+n>i&&(n=i-t),e+r>a&&(r=a-e);for(var c=this.shadowCtx.getImageData(t,e,n,r),d=c.data,h=d.length,f=this._palette,p=3;p0?o:g>0},getDataURL:function(){return this.canvas.toDataURL()}},n}(),i=(t=!1,"canvas2d"===e.defaultRenderer&&(t=r),t),a={merge:function(){for(var t={},e=arguments.length,n=0;n