funnel-chart-js
Version:
The funnel plugin for Chart.js
12 lines • 219 kB
JavaScript
/*!
* Chart.Funnel.js
* A funnel plugin for Chart.js(http://chartjs.org/)
* Version: 1.1.2
*
* Copyright 2016 Jone Casaper
* Copyright 2019 Steve Yardumian
* Released under the MIT license
* https://github.com/CopperHill-Consulting/Chart.Funnel.js/blob/master/LICENSE.md
*/
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(e.Chart||(e.Chart={})).Funnel=t()}}(function(){var t;return function(){function t(e,n,i){function a(o,s){if(!n[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(r)return r(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var d=n[o]={exports:{}};e[o][0].call(d.exports,function(t){var n=e[o][1][t];return a(n||t)},d,d.exports,t,e,n,i)}return n[o].exports}for(var r="function"==typeof require&&require,o=0;o<i.length;o++)a(i[o]);return a}return t}()({1:[function(e,n,i){!function(a,r){"object"==typeof i&&"undefined"!=typeof n?n.exports=r(function(){try{return e(2)}catch(t){}}()):"function"==typeof t&&t.amd?t(["require"],function(t){return r(function(){try{return t(2)}catch(e){}}())}):a.Chart=r(a.moment)}(this,function(t){"use strict";function e(t){var e,n,i,a=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(a,r,o),l=Math.max(a,r,o),u=l-s;return l==s?e=0:a==l?e=(r-o)/u:r==l?e=2+(o-a)/u:o==l&&(e=4+(a-r)/u),e=Math.min(60*e,360),e<0&&(e+=360),i=(s+l)/2,n=l==s?0:i<=.5?u/(l+s):u/(2-l-s),[e,100*n,100*i]}function n(t){var e,n,i,a=t[0],r=t[1],o=t[2],s=Math.min(a,r,o),l=Math.max(a,r,o),u=l-s;return n=0==l?0:u/l*1e3/10,l==s?e=0:a==l?e=(r-o)/u:r==l?e=2+(o-a)/u:o==l&&(e=4+(a-r)/u),e=Math.min(60*e,360),e<0&&(e+=360),i=l/255*1e3/10,[e,n,i]}function i(t){var n=t[0],i=t[1],a=t[2],r=e(t)[0],o=1/255*Math.min(n,Math.min(i,a)),a=1-1/255*Math.max(n,Math.max(i,a));return[r,100*o,100*a]}function a(t){var e,n,i,a,r=t[0]/255,o=t[1]/255,s=t[2]/255;return a=Math.min(1-r,1-o,1-s),e=(1-r-a)/(1-a)||0,n=(1-o-a)/(1-a)||0,i=(1-s-a)/(1-a)||0,[100*e,100*n,100*i,100*a]}function o(t){return rn[JSON.stringify(t)]}function s(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var a=.4124*e+.3576*n+.1805*i,r=.2126*e+.7152*n+.0722*i,o=.0193*e+.1192*n+.9505*i;return[100*a,100*r,100*o]}function l(t){var e,n,i,a=s(t),r=a[0],o=a[1],l=a[2];return r/=95.047,o/=100,l/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,l=l>.008856?Math.pow(l,1/3):7.787*l+16/116,e=116*o-16,n=500*(r-o),i=200*(o-l),[e,n,i]}function u(t){return R(l(t))}function d(t){var e,n,i,a,r,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return r=255*l,[r,r,r];n=l<.5?l*(1+s):l+s-l*s,e=2*l-n,a=[0,0,0];for(var u=0;u<3;u++)i=o+1/3*-(u-1),i<0&&i++,i>1&&i--,r=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*r;return a}function h(t){var e,n,i=t[0],a=t[1]/100,r=t[2]/100;return 0===r?[0,0,0]:(r*=2,a*=r<=1?r:2-r,n=(r+a)/2,e=2*a/(r+a),[i,100*e,100*n])}function c(t){return i(d(t))}function f(t){return a(d(t))}function p(t){return o(d(t))}function m(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*r),l=255*i*(1-n*(1-r)),i=255*i;switch(a){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}}function v(t){var e,n,i=t[0],a=t[1]/100,r=t[2]/100;return n=(2-a)*r,e=a*r,e/=n<=1?n:2-n,e=e||0,n/=2,[i,100*e,100*n]}function y(t){return i(m(t))}function x(t){return a(m(t))}function _(t){return o(m(t))}function k(t){var e,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,u=s+l;switch(u>1&&(s/=u,l/=u),e=Math.floor(6*o),n=1-l,i=6*o-e,0!=(1&e)&&(i=1-i),a=s+i*(n-s),e){default:case 6:case 0:r=n,g=a,b=s;break;case 1:r=a,g=n,b=s;break;case 2:r=s,g=n,b=a;break;case 3:r=s,g=a,b=n;break;case 4:r=a,g=s,b=n;break;case 5:r=n,g=s,b=a}return[255*r,255*g,255*b]}function w(t){return e(k(t))}function M(t){return n(k(t))}function S(t){return a(k(t))}function D(t){return o(k(t))}function C(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100,s=t[3]/100;return e=1-Math.min(1,a*(1-s)+s),n=1-Math.min(1,r*(1-s)+s),i=1-Math.min(1,o*(1-s)+s),[255*e,255*n,255*i]}function P(t){return e(C(t))}function T(t){return n(C(t))}function O(t){return i(C(t))}function I(t){return o(C(t))}function A(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100;return e=3.2406*a+r*-1.5372+o*-.4986,n=a*-.9689+1.8758*r+.0415*o,i=.0557*a+r*-.204+1.057*o,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:e=12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n=12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i=12.92*i,e=Math.min(Math.max(0,e),1),n=Math.min(Math.max(0,n),1),i=Math.min(Math.max(0,i),1),[255*e,255*n,255*i]}function F(t){var e,n,i,a=t[0],r=t[1],o=t[2];return a/=95.047,r/=100,o/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,e=116*r-16,n=500*(a-r),i=200*(r-o),[e,n,i]}function W(t){return R(F(t))}function L(t){var e,n,i,a,r=t[0],o=t[1],s=t[2];return r<=8?(n=100*r/903.3,a=7.787*(n/100)+16/116):(n=100*Math.pow((r+16)/116,3),a=Math.pow(n/100,1/3)),e=e/95.047<=.008856?e=95.047*(o/500+a-16/116)/7.787:95.047*Math.pow(o/500+a,3),i=i/108.883<=.008859?i=108.883*(a-s/200-16/116)/7.787:108.883*Math.pow(a-s/200,3),[e,n,i]}function R(t){var e,n,i,a=t[0],r=t[1],o=t[2];return e=Math.atan2(o,r),n=360*e/2/Math.PI,n<0&&(n+=360),i=Math.sqrt(r*r+o*o),[a,i,n]}function Y(t){return A(L(t))}function N(t){var e,n,i,a=t[0],r=t[1],o=t[2];return i=o/360*2*Math.PI,e=r*Math.cos(i),n=r*Math.sin(i),[a,e,n]}function z(t){return L(N(t))}function V(t){return Y(N(t))}function H(t){return an[t]}function E(t){return e(H(t))}function B(t){return n(H(t))}function j(t){return i(H(t))}function U(t){return a(H(t))}function G(t){return l(H(t))}function q(t){return s(H(t))}function Z(t){if(t){var e=/^#([a-fA-F0-9]{3,4})$/i,n=/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i,i=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,a=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,r=/(\w+)/,o=[0,0,0],s=1,l=t.match(e),u="";if(l){l=l[1],u=l[3];for(var d=0;d<o.length;d++)o[d]=parseInt(l[d]+l[d],16);u&&(s=Math.round(parseInt(u+u,16)/255*100)/100)}else if(l=t.match(n)){u=l[2],l=l[1];for(var d=0;d<o.length;d++)o[d]=parseInt(l.slice(2*d,2*d+2),16);u&&(s=Math.round(parseInt(u,16)/255*100)/100)}else if(l=t.match(i)){for(var d=0;d<o.length;d++)o[d]=parseInt(l[d+1]);s=parseFloat(l[4])}else if(l=t.match(a)){for(var d=0;d<o.length;d++)o[d]=Math.round(2.55*parseFloat(l[d+1]));s=parseFloat(l[4])}else if(l=t.match(r)){if("transparent"==l[1])return[0,0,0,0];if(o=gn[l[1]],!o)return}for(var d=0;d<o.length;d++)o[d]=ut(o[d],0,255);return s=s||0==s?ut(s,0,1):1,o[3]=s,o}}function $(t){if(t){var e=/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,n=t.match(e);if(n){var i=parseFloat(n[4]),a=ut(parseInt(n[1]),0,360),r=ut(parseFloat(n[2]),0,100),o=ut(parseFloat(n[3]),0,100),s=ut(isNaN(i)?1:i,0,1);return[a,r,o,s]}}}function X(t){if(t){var e=/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,n=t.match(e);if(n){var i=parseFloat(n[4]),a=ut(parseInt(n[1]),0,360),r=ut(parseFloat(n[2]),0,100),o=ut(parseFloat(n[3]),0,100),s=ut(isNaN(i)?1:i,0,1);return[a,r,o,s]}}}function K(t){var e=Z(t);return e&&e.slice(0,3)}function J(t){var e=$(t);return e&&e.slice(0,3)}function Q(t){var e=Z(t);return e?e[3]:(e=$(t))?e[3]:(e=X(t))?e[3]:void 0}function tt(t,e){var e=void 0!==e&&3===t.length?e:t[3];return"#"+dt(t[0])+dt(t[1])+dt(t[2])+(e>=0&&e<1?dt(Math.round(255*e)):"")}function et(t,e){return e<1||t[3]&&t[3]<1?nt(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"}function nt(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function it(t,e){if(e<1||t[3]&&t[3]<1)return at(t,e);var n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+n+"%, "+i+"%, "+a+"%)"}function at(t,e){var n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgba("+n+"%, "+i+"%, "+a+"%, "+(e||t[3]||1)+")"}function rt(t,e){return e<1||t[3]&&t[3]<1?ot(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"}function ot(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function st(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"}function lt(t){return mn[t.slice(0,3)]}function ut(t,e,n){return Math.min(Math.max(e,t),n)}function dt(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}function ht(t){return!t||_n.isNullOrUndef(t.size)||_n.isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function ct(t,e,n,i){var a,r,o,s,l,u,d,h,c,f=Object.keys(n);for(a=0,r=f.length;a<r;++a)if(o=f[a],u=n[o],e.hasOwnProperty(o)||(e[o]=u),s=e[o],s!==u&&"_"!==o[0]){if(t.hasOwnProperty(o)||(t[o]=s),l=t[o],d=typeof u,d===typeof l)if("string"===d){if(h=yn(l),h.valid&&(c=yn(u),c.valid)){e[o]=c.mix(h,i).rgbString();continue}}else if(Rn.isFinite(l)&&Rn.isFinite(u)){e[o]=l+(u-l)*i;continue}e[o]=u}}function ft(t,e){return t._chartjs?void t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),void Gn.forEach(function(e){var n="onData"+e.charAt(0).toUpperCase()+e.slice(1),i=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),a=i.apply(this,e);return Rn.each(t._chartjs.listeners,function(t){"function"==typeof t[n]&&t[n].apply(t,e)}),a}})}))}function gt(t,e){var n=t._chartjs;if(n){var i=n.listeners,a=i.indexOf(e);a!==-1&&i.splice(a,1),i.length>0||(Gn.forEach(function(e){delete t[e]}),delete t._chartjs)}}function pt(t){var e=this._view;return!!e&&Math.abs(t-e.x)<e.radius+e.hitRadius}function mt(t){var e=this._view;return!!e&&Math.abs(t-e.y)<e.radius+e.hitRadius}function vt(t){return t&&void 0!==t.width}function bt(t){var e,n,i,a,r;return vt(t)?(r=t.width/2,e=t.x-r,n=t.x+r,i=Math.min(t.y,t.base),a=Math.max(t.y,t.base)):(r=t.height/2,e=Math.min(t.x,t.base),n=Math.max(t.x,t.base),i=t.y-r,a=t.y+r),{left:e,top:i,right:n,bottom:a}}function yt(t,e,n){return t===e?n:t===n?e:t}function xt(t){var e=t.borderSkipped,n={};return e?(t.horizontal?t.base>t.x&&(e=yt(e,"left","right")):t.base<t.y&&(e=yt(e,"bottom","top")),n[e]=!0,n):n}function _t(t,e,n){var i,a,r,o,s=t.borderWidth,l=xt(t);return Rn.isObject(s)?(i=+s.top||0,a=+s.right||0,r=+s.bottom||0,o=+s.left||0):i=a=r=o=+s||0,{t:l.top||i<0?0:i>n?n:i,r:l.right||a<0?0:a>e?e:a,b:l.bottom||r<0?0:r>n?n:r,l:l.left||o<0?0:o>e?e:o}}function kt(t){var e=bt(t),n=e.right-e.left,i=e.bottom-e.top,a=_t(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i},inner:{x:e.left+a.l,y:e.top+a.t,w:n-a.l-a.r,h:i-a.t-a.b}}}function wt(t,e,n){var i=null===e,a=null===n,r=!(!t||i&&a)&&bt(t);return r&&(i||e>=r.left&&e<=r.right)&&(a||n>=r.top&&n<=r.bottom)}function Mt(t,e){var n,i,a,r,o=t.isHorizontal()?t.width:t.height,s=t.getTicks();for(a=1,r=e.length;a<r;++a)o=Math.min(o,Math.abs(e[a]-e[a-1]));for(a=0,r=s.length;a<r;++a)i=t.getPixelForTick(a),o=a>0?Math.min(o,i-n):o,n=i;return o}function St(t,e,n){var i,a,r=n.barThickness,o=e.stackCount,s=e.pixels[t];return Rn.isNullOrUndef(r)?(i=e.min*n.categoryPercentage,a=n.barPercentage):(i=r*o,a=1),{chunk:i/o,ratio:a,start:s-i/2}}function Dt(t,e,n){var i,a,r=e.pixels,o=r[t],s=t>0?r[t-1]:null,l=t<r.length-1?r[t+1]:null,u=n.categoryPercentage;return null===s&&(s=o-(null===l?e.end-e.start:l-o)),null===l&&(l=o+o-s),i=o-(o-Math.min(s,l))/2*u,a=Math.abs(l-s)/2*u,{chunk:a/e.stackCount,ratio:n.barPercentage,start:i}}function Ct(t,e){return bi(t.showLine,e.showLines)}function Pt(t,e){return t["native"]?{x:t.x,y:t.y}:Rn.getRelativePosition(t,e)}function Tt(t,e){var n,i,a,r,o,s=t.data.datasets;for(i=0,r=s.length;i<r;++i)if(t.isDatasetVisible(i))for(n=t.getDatasetMeta(i),a=0,o=n.data.length;a<o;++a){var l=n.data[a];l._view.skip||e(l)}}function Ot(t,e){var n=[];return Tt(t,function(t){t.inRange(e.x,e.y)&&n.push(t)}),n}function It(t,e,n,i){var a=Number.POSITIVE_INFINITY,r=[];return Tt(t,function(t){if(!n||t.inRange(e.x,e.y)){var o=t.getCenterPoint(),s=i(e,o);s<a?(r=[t],a=s):s===a&&r.push(t)}}),r}function At(t){var e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(t,i){var a=e?Math.abs(t.x-i.x):0,r=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(r,2))}}function Ft(t,e,n){var i=Pt(e,t);n.axis=n.axis||"x";var a=At(n.axis),r=n.intersect?Ot(t,i):It(t,i,!1,a),o=[];return r.length?(t.data.datasets.forEach(function(e,n){if(t.isDatasetVisible(n)){var i=t.getDatasetMeta(n),a=i.data[r[0]._index];a&&!a._view.skip&&o.push(a)}}),o):[]}function Wt(t,e){return Rn.where(t,function(t){return t.position===e})}function Lt(t,e){t.forEach(function(t,e){return t._tmpIndex_=e,t}),t.sort(function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i._tmpIndex_-a._tmpIndex_:i.weight-a.weight}),t.forEach(function(t){delete t._tmpIndex_})}function Rt(t){var e=0,n=0,i=0,a=0;return Rn.each(t,function(t){if(t.getPadding){var r=t.getPadding();e=Math.max(e,r.top),n=Math.max(n,r.left),i=Math.max(i,r.bottom),a=Math.max(a,r.right)}}),{top:e,left:n,bottom:i,right:a}}function Yt(t,e){Rn.each(t,function(t){e[t.position]+=t.isHorizontal()?t.height:t.width})}function Nt(t){return t&&t["default"]||t}function zt(t,e){var n=Rn.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}function Vt(t,e){var n=t.style,i=t.getAttribute("height"),a=t.getAttribute("width");if(t[Ri]={initial:{height:i,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===a||""===a){var r=zt(t,"width");void 0!==r&&(t.width=r)}if(null===i||""===i)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var o=zt(t,"height");void 0!==r&&(t.height=o)}return t}function Ht(t,e,n){t.addEventListener(e,n,ji)}function Et(t,e,n){t.removeEventListener(e,n,ji)}function Bt(t,e,n,i,a){return{type:t,chart:e,"native":a||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function jt(t,e){var n=Ei[t.type]||t.type,i=Rn.getRelativePosition(t,e);return Bt(n,e,i.x,i.y,t)}function Ut(t,e){var n=!1,i=[];return function(){i=Array.prototype.slice.call(arguments),e=e||this,n||(n=!0,Rn.requestAnimFrame.call(window,function(){n=!1,t.apply(e,i)}))}}function Gt(t){var e=document.createElement("div");return e.className=t||"",e}function qt(t){var e=1e6,n=Gt(Ni),i=Gt(Ni+"-expand"),a=Gt(Ni+"-shrink");i.appendChild(Gt()),a.appendChild(Gt()),n.appendChild(i),n.appendChild(a),n._reset=function(){i.scrollLeft=e,i.scrollTop=e,a.scrollLeft=e,a.scrollTop=e};var r=function(){n._reset(),t()};return Ht(i,"scroll",r.bind(i,"expand")),Ht(a,"scroll",r.bind(a,"shrink")),n}function Zt(t,e){var n=t[Ri]||(t[Ri]={}),i=n.renderProxy=function(t){t.animationName===Vi&&e()};Rn.each(Hi,function(e){Ht(t,e,i)}),n.reflow=!!t.offsetParent,t.classList.add(zi)}function $t(t){var e=t[Ri]||{},n=e.renderProxy;n&&(Rn.each(Hi,function(e){Et(t,e,n)}),delete e.renderProxy),t.classList.remove(zi)}function Xt(t,e,n){var i=t[Ri]||(t[Ri]={}),a=i.resizer=qt(Ut(function(){if(i.resizer){var a=n.options.maintainAspectRatio&&t.parentNode,r=a?a.clientWidth:0;e(Bt("resize",n)),a&&a.clientWidth<r&&n.canvas&&e(Bt("resize",n))}}));Zt(t,function(){if(i.resizer){var e=t.parentNode;e&&e!==a.parentNode&&e.insertBefore(a,e.firstChild),a._reset()}})}function Kt(t){var e=t[Ri]||{},n=e.resizer;delete e.resizer,$t(t),n&&n.parentNode&&n.parentNode.removeChild(n)}function Jt(t,e){var n=t._style||document.createElement("style");t._style||(t._style=n,e="/* Chart.js */\n"+e,n.setAttribute("type","text/css"),document.getElementsByTagName("head")[0].appendChild(n)),n.appendChild(document.createTextNode(e))}function Qt(t,e){return e&&(Rn.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function te(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function ee(t){var e=t._xScale,n=t._yScale||t._scale,i=t._index,a=t._datasetIndex,r=t._chart.getDatasetMeta(a).controller,o=r._getIndexScale(),s=r._getValueScale();return{xLabel:e?e.getLabelForIndex(i,a):"",yLabel:n?n.getLabelForIndex(i,a):"",label:o?""+o.getLabelForIndex(i,a):"",value:s?""+s.getLabelForIndex(i,a):"",index:i,datasetIndex:a,x:t._model.x,y:t._model.y}}function ne(t){var e=Fn.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,bodyFontColor:t.bodyFontColor,_bodyFontFamily:Xi(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:Xi(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:Xi(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:Xi(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:Xi(t.titleFontStyle,e.defaultFontStyle),titleFontSize:Xi(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:Xi(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:Xi(t.footerFontStyle,e.defaultFontStyle),footerFontSize:Xi(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function ie(t,e){var n=t._chart.ctx,i=2*e.yPadding,a=0,r=e.body,o=r.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);o+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,l=e.footer.length,u=e.titleFontSize,d=e.bodyFontSize,h=e.footerFontSize;i+=s*u,i+=s?(s-1)*e.titleSpacing:0,i+=s?e.titleMarginBottom:0,i+=o*d,i+=o?(o-1)*e.bodySpacing:0,i+=l?e.footerMarginTop:0,i+=l*h,i+=l?(l-1)*e.footerSpacing:0;var c=0,f=function(t){a=Math.max(a,n.measureText(t).width+c)};return n.font=Rn.fontString(u,e._titleFontStyle,e._titleFontFamily),Rn.each(e.title,f),n.font=Rn.fontString(d,e._bodyFontStyle,e._bodyFontFamily),Rn.each(e.beforeBody.concat(e.afterBody),f),c=e.displayColors?d+2:0,Rn.each(r,function(t){Rn.each(t.before,f),Rn.each(t.lines,f),Rn.each(t.after,f)}),c=0,n.font=Rn.fontString(h,e._footerFontStyle,e._footerFontFamily),Rn.each(e.footer,f),a+=2*e.xPadding,{width:a,height:i}}function ae(t,e){var n=t._model,i=t._chart,a=t._chart.chartArea,r="center",o="center";n.y<e.height?o="top":n.y>i.height-e.height&&(o="bottom");var s,l,u,d,h,c=(a.left+a.right)/2,f=(a.top+a.bottom)/2;"center"===o?(s=function(t){return t<=c},l=function(t){return t>c}):(s=function(t){return t<=e.width/2},l=function(t){return t>=i.width-e.width/2}),u=function(t){return t+e.width+n.caretSize+n.caretPadding>i.width},d=function(t){return t-e.width-n.caretSize-n.caretPadding<0},h=function(t){return t<=f?"top":"bottom"},s(n.x)?(r="left",u(n.x)&&(r="center",o=h(n.y))):l(n.x)&&(r="right",d(n.x)&&(r="center",o=h(n.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:r,yAlign:g.yAlign?g.yAlign:o}}function re(t,e,n,i){var a=t.x,r=t.y,o=t.caretSize,s=t.caretPadding,l=t.cornerRadius,u=n.xAlign,d=n.yAlign,h=o+s,c=l+s;return"right"===u?a-=e.width:"center"===u&&(a-=e.width/2,a+e.width>i.width&&(a=i.width-e.width),a<0&&(a=0)),"top"===d?r+=h:r-="bottom"===d?e.height+h:e.height/2,"center"===d?"left"===u?a+=h:"right"===u&&(a-=h):"left"===u?a-=c:"right"===u&&(a+=c),{x:a,y:r}}function oe(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function se(t){return Qt([],te(t))}function le(){return Rn.merge({},[].slice.call(arguments),{merger:function(t,e,n,i){if("xAxes"===t||"yAxes"===t){var a,r,o,s=n[t].length;for(e[t]||(e[t]=[]),a=0;a<s;++a)o=n[t][a],r=ea(o.type,"xAxes"===t?"category":"linear"),a>=e[t].length&&e[t].push({}),!e[t][a].type||o.type&&o.type!==e[t][a].type?Rn.merge(e[t][a],[$i.getScaleDefaults(r),o]):Rn.merge(e[t][a],o)}else Rn._merger(t,e,n,i)}})}function ue(){return Rn.merge({},[].slice.call(arguments),{merger:function(t,e,n,i){var a=e[t]||{},r=n[t];"scales"===t?e[t]=le(a,r):"scale"===t?e[t]=Rn.merge(a,[$i.getScaleDefaults(r.type),r]):Rn._merger(t,e,n,i)}})}function de(t){t=t||{};var e=t.data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=ue(Fn.global,Fn[t.type],t.options||{}),t}function he(t){var e=t.options;Rn.each(t.scales,function(e){Ii.removeBox(t,e)}),e=ue(Fn.global,Fn[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function ce(t){return"top"===t||"bottom"===t}function fe(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function ge(t){this.options=t||{}}function pe(t){var e,n,i=[];for(e=0,n=t.length;e<n;++e)i.push(t[e].label);return i}function me(t,e,n){var i=t.getPixelForTick(e);return n&&(i-=1===t.getTicks().length?t.isHorizontal()?Math.max(i-t.left,t.right-i):Math.max(i-t.top,t.bottom-i):0===e?(t.getPixelForTick(1)-i)/2:(i-t.getPixelForTick(e-1))/2),i}function ve(t,e,n){return Rn.isArray(e)?Rn.longestText(t,n,e):t.measureText(e).width}function be(t,e){var n,i,a,r,o=[],s=1e-14,l=t.stepSize,u=l||1,d=t.maxTicks-1,h=t.min,c=t.max,f=t.precision,g=e.min,p=e.max,m=Rn.niceNum((p-g)/d/u)*u;if(m<s&&pa(h)&&pa(c))return[g,p];r=Math.ceil(p/m)-Math.floor(g/m),r>d&&(m=Rn.niceNum(r*m/d/u)*u),l||pa(f)?n=Math.pow(10,Rn._decimalPlaces(m)):(n=Math.pow(10,f),m=Math.ceil(m*n)/n),i=Math.floor(g/m)*m,a=Math.ceil(p/m)*m,l&&(!pa(h)&&Rn.almostWhole(h/m,m/1e3)&&(i=h),!pa(c)&&Rn.almostWhole(c/m,m/1e3)&&(a=c)),r=(a-i)/m,r=Rn.almostEquals(r,Math.round(r),m/1e3)?Math.round(r):Math.ceil(r),i=Math.round(i*n)/n,a=Math.round(a*n)/n,o.push(pa(h)?i:h);for(var v=1;v<r;++v)o.push(Math.round((i+v*m)*n)/n);return o.push(pa(c)?a:c),o}function ye(t,e){var n,i,a=[],r=xa(t.min,Math.pow(10,Math.floor(Rn.log10(e.min)))),o=Math.floor(Rn.log10(e.max)),s=Math.ceil(e.max/Math.pow(10,o));0===r?(n=Math.floor(Rn.log10(e.minNotZero)),i=Math.floor(e.minNotZero/Math.pow(10,n)),a.push(r),r=i*Math.pow(10,n)):(n=Math.floor(Rn.log10(r)),i=Math.floor(r/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do a.push(r),++i,10===i&&(i=1,++n,l=n>=0?1:l),r=Math.round(i*Math.pow(10,n)*l)/l;while(n<o||n===o&&i<s);var u=xa(t.max,r);return a.push(u),a}function xe(t,e){return Rn.isFinite(t)&&t>=0?t:e}function _e(t){var e=t.options;return e.angleLines.display||e.pointLabels.display?t.chart.data.labels.length:0}function ke(t){var e=t.ticks;return e.display&&t.display?Ma(e.fontSize,Fn.global.defaultFontSize)+2*e.backdropPaddingY:0}function we(t,e,n){return Rn.isArray(n)?{w:Rn.longestText(t,t.font,n),h:n.length*e}:{w:t.measureText(n).width,h:e}}function Me(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:t<i||t>a?{start:e-n,end:e}:{start:e,end:e+n}}function Se(t){var e,n,i,a=Rn.options._parseFont(t.options.pointLabels),r={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={};t.ctx.font=a.string,t._pointLabelSizes=[];var s=_e(t);for(e=0;e<s;e++){i=t.getPointPosition(e,t.drawingArea+5),n=we(t.ctx,a.lineHeight,t.pointLabels[e]||""),t._pointLabelSizes[e]=n;var l=t.getIndexAngle(e),u=Rn.toDegrees(l)%360,d=Me(u,i.x,n.w,0,180),h=Me(u,i.y,n.h,90,270);d.start<r.l&&(r.l=d.start,o.l=l),d.end>r.r&&(r.r=d.end,o.r=l),h.start<r.t&&(r.t=h.start,o.t=l),h.end>r.b&&(r.b=h.end,o.b=l)}t.setReductions(t.drawingArea,r,o)}function De(t){return 0===t||180===t?"center":t<180?"left":"right"}function Ce(t,e,n,i){var a,r,o=n.y+i/2;if(Rn.isArray(e))for(a=0,r=e.length;a<r;++a)t.fillText(e[a],n.x,o),o+=i;else t.fillText(e,n.x,o)}function Pe(t,e,n){90===t||270===t?n.y-=e.h/2:(t>270||t<90)&&(n.y-=e.h)}function Te(t){var e=t.ctx,n=t.options,i=n.angleLines,a=n.gridLines,r=n.pointLabels,o=Ma(i.lineWidth,a.lineWidth),s=Ma(i.color,a.color),l=ke(n);e.save(),e.lineWidth=o,e.strokeStyle=s,e.setLineDash&&(e.setLineDash(Da([i.borderDash,a.borderDash,[]])),e.lineDashOffset=Da([i.borderDashOffset,a.borderDashOffset,0]));var u=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),d=Rn.options._parseFont(r);e.font=d.string,e.textBaseline="middle";for(var h=_e(t)-1;h>=0;h--){if(i.display&&o&&s){var c=t.getPointPosition(h,u);e.beginPath(),e.moveTo(t.xCenter,t.yCenter),e.lineTo(c.x,c.y),e.stroke()}if(r.display){var f=0===h?l/2:0,g=t.getPointPosition(h,u+f+5),p=Sa(r.fontColor,h,Fn.global.defaultFontColor);e.fillStyle=p;var m=t.getIndexAngle(h),v=Rn.toDegrees(m);e.textAlign=De(v),Pe(v,t._pointLabelSizes[h],g),Ce(e,t.pointLabels[h]||"",g,d.lineHeight)}}e.restore()}function Oe(t,e,n,i){var a,r=t.ctx,o=e.circular,s=_e(t),l=Sa(e.color,i-1),u=Sa(e.lineWidth,i-1);if((o||s)&&l&&u){if(r.save(),r.strokeStyle=l,r.lineWidth=u,r.setLineDash&&(r.setLineDash(e.borderDash||[]),r.lineDashOffset=e.borderDashOffset||0),r.beginPath(),o)r.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{a=t.getPointPosition(0,n),r.moveTo(a.x,a.y);for(var d=1;d<s;d++)a=t.getPointPosition(d,n),r.lineTo(a.x,a.y)}r.closePath(),r.stroke(),r.restore()}}function Ie(t){return Rn.isNumber(t)?t:0}function Ae(t,e){return t-e}function Fe(t){var e,n,i,a={},r=[];for(e=0,n=t.length;e<n;++e)i=t[e],a[i]||(a[i]=!0,r.push(i));return r}function We(t,e,n,i){if("linear"===i||!t.length)return[{time:e,pos:0},{time:n,pos:1}];var a,r,o,s,l,u=[],d=[e];for(a=0,r=t.length;a<r;++a)s=t[a],s>e&&s<n&&d.push(s);for(d.push(n),a=0,r=d.length;a<r;++a)l=d[a+1],o=d[a-1],s=d[a],void 0!==o&&void 0!==l&&Math.round((l+o)/2)===s||u.push({time:s,pos:a/(r-1)});return u}function Le(t,e,n){for(var i,a,r,o=0,s=t.length-1;o>=0&&o<=s;){if(i=o+s>>1,a=t[i-1]||null,r=t[i],!a)return{lo:null,hi:r};if(r[e]<n)o=i+1;else{if(!(a[e]>n))return{lo:a,hi:r};s=i-1}}return{lo:r,hi:null}}function Re(t,e,n,i){var a=Le(t,e,n),r=a.lo?a.hi?a.lo:t[t.length-2]:t[0],o=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=o[e]-r[e],l=s?(n-r[e])/s:0,u=(o[i]-r[i])*l;return r[i]+u}function Ye(t,e){var n=t._adapter,i=t.options.time,a=i.parser,r=a||i.format,o=e;return"function"==typeof a&&(o=a(o)),Rn.isFinite(o)||(o="string"==typeof r?n.parse(o,r):n.parse(o)),null!==o?+o:(a||"function"!=typeof r||(o=r(e),Rn.isFinite(o)||(o=n.parse(o))),o)}function Ne(t,e){if(Rn.isNullOrUndef(e))return null;var n=t.options.time,i=Ye(t,t.getRightValue(e));return null===i?i:(n.round&&(i=+t._adapter.startOf(i,n.round)),i)}function ze(t,e,n,i){var a,r,o,s=e-t,l=Fa[n],u=l.size,d=l.steps;if(!d)return Math.ceil(s/(i*u));for(a=0,r=d.length;a<r&&(o=d[a],!(Math.ceil(s/(u*o))<=i));++a);return o}function Ve(t,e,n,i){var a,r,o,s=Wa.length;for(a=Wa.indexOf(t);a<s-1;++a)if(r=Fa[Wa[a]],o=r.steps?r.steps[r.steps.length-1]:Aa,r.common&&Math.ceil((n-e)/(o*r.size))<=i)return Wa[a];return Wa[s-1]}function He(t,e,n,i,a){var r,o,s=Wa.length;for(r=s-1;r>=Wa.indexOf(n);r--)if(o=Wa[r],Fa[o].common&&t._adapter.diff(a,i,o)>=e.length)return o;return Wa[n?Wa.indexOf(n):0]}function Ee(t){for(var e=Wa.indexOf(t)+1,n=Wa.length;e<n;++e)if(Fa[Wa[e]].common)return Wa[e]}function Be(t,e,n,i){var a,r=t._adapter,o=t.options,s=o.time,l=s.unit||Ve(s.minUnit,e,n,i),u=Ee(l),d=Oa(s.stepSize,s.unitStepSize),h="week"===l&&s.isoWeekday,c=o.ticks.major.enabled,f=Fa[l],g=e,p=n,m=[];for(d||(d=ze(e,n,l,i)),h&&(g=+r.startOf(g,"isoWeek",h),p=+r.startOf(p,"isoWeek",h)),g=+r.startOf(g,h?"day":l),p=+r.startOf(p,h?"day":l),p<n&&(p=+r.add(p,1,l)),a=g,c&&u&&!h&&!s.round&&(a=+r.startOf(a,u),a=+r.add(a,~~((g-a)/(f.size*d))*d,l));a<p;a=+r.add(a,d,l))m.push(+a);return m.push(+a),m}function je(t,e,n,i,a){var r,o,s=0,l=0;return a.offset&&e.length&&(a.time.min||(r=Re(t,"time",e[0],"pos"),s=1===e.length?1-r:(Re(t,"time",e[1],"pos")-r)/2),a.time.max||(o=Re(t,"time",e[e.length-1],"pos"),l=1===e.length?o:(o-Re(t,"time",e[e.length-2],"pos"))/2)),{start:s,end:l}}function Ue(t,e,n){var i,a,r,o,s=[];for(i=0,a=e.length;i<a;++i)r=e[i],o=!!n&&r===+t._adapter.startOf(r,n),s.push({value:r,major:o});return s}function Ge(t,e,n){var i,a=t._model||{},r=a.fill;if(void 0===r&&(r=!!a.backgroundColor),r===!1||null===r)return!1;if(r===!0)return"origin";if(i=parseFloat(r,10),isFinite(i)&&Math.floor(i)===i)return"-"!==r[0]&&"+"!==r[0]||(i=e+i),!(i===e||i<0||i>=n)&&i;switch(r){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return r;default:return!1}}function qe(t){var e,n=t.el._model||{},i=t.el._scale||{},a=t.fill,r=null;if(isFinite(a))return null;if("start"===a?r=void 0===n.scaleBottom?i.bottom:n.scaleBottom:"end"===a?r=void 0===n.scaleTop?i.top:n.scaleTop:void 0!==n.scaleZero?r=n.scaleZero:i.getBasePosition?r=i.getBasePosition():i.getBasePixel&&(r=i.getBasePixel()),void 0!==r&&null!==r){if(void 0!==r.x&&void 0!==r.y)return r;if(Rn.isFinite(r))return e=i.isHorizontal(),{x:e?r:null,y:e?null:r}}return null}function Ze(t,e,n){var i,a=t[e],r=a.fill,o=[e];if(!n)return r;for(;r!==!1&&o.indexOf(r)===-1;){if(!isFinite(r))return r;if(i=t[r],!i)return!1;if(i.visible)return r;o.push(r),r=i.fill}return!1}function $e(t){var e=t.fill,n="dataset";return e===!1?null:(isFinite(e)||(n="boundary"),Va[n](t))}function Xe(t){return t&&!t.skip}function Ke(t,e,n,i,a){var r;if(i&&a){for(t.moveTo(e[0].x,e[0].y),r=1;r<i;++r)Rn.canvas.lineTo(t,e[r-1],e[r]);for(t.lineTo(n[a-1].x,n[a-1].y),r=a-1;r>0;--r)Rn.canvas.lineTo(t,n[r],n[r-1],!0)}}function Je(t,e,n,i,a,r){var o,s,l,u,d,h,c,f=e.length,g=i.spanGaps,p=[],m=[],v=0,b=0;for(t.beginPath(),o=0,s=f+!!r;o<s;++o)l=o%f,u=e[l]._view,d=n(u,l,i),h=Xe(u),c=Xe(d),h&&c?(v=p.push(u),b=m.push(d)):v&&b&&(g?(h&&p.push(u),c&&m.push(d)):(Ke(t,p,m,v,b),v=b=0,p=[],m=[]));Ke(t,p,m,v,b),t.closePath(),t.fillStyle=a,t.fill()}function Qe(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}function tn(t,e){var n=new ja({ctx:t.ctx,options:e,chart:t});Ii.configure(t,n,e),Ii.addBox(t,n),t.legend=n}function en(t,e){var n=new qa({ctx:t.ctx,options:e,chart:t});Ii.configure(t,n,e),Ii.addBox(t,n),t.titleBlock=n}t=t&&t.hasOwnProperty("default")?t["default"]:t;var nn={rgb2hsl:e,rgb2hsv:n,rgb2hwb:i,rgb2cmyk:a,rgb2keyword:o,rgb2xyz:s,rgb2lab:l,rgb2lch:u,hsl2rgb:d,hsl2hsv:h,hsl2hwb:c,hsl2cmyk:f,hsl2keyword:p,hsv2rgb:m,hsv2hsl:v,hsv2hwb:y,hsv2cmyk:x,hsv2keyword:_,hwb2rgb:k,hwb2hsl:w,hwb2hsv:M,hwb2cmyk:S,hwb2keyword:D,cmyk2rgb:C,cmyk2hsl:P,cmyk2hsv:T,cmyk2hwb:O,cmyk2keyword:I,keyword2rgb:H,keyword2hsl:E,keyword2hsv:B,keyword2hwb:j,keyword2cmyk:U,keyword2lab:G,keyword2xyz:q,xyz2rgb:A,xyz2lab:F,xyz2lch:W,lab2xyz:L,lab2rgb:Y,lab2lch:R,lch2lab:N,lch2xyz:z,lch2rgb:V},an={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],
lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},rn={};for(var on in an)rn[JSON.stringify(an[on])]=on;var sn=function(){return new cn};for(var ln in nn){sn[ln+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),nn[t](e)}}(ln);var un=/(\w+)2(\w+)/.exec(ln),dn=un[1],hn=un[2];sn[dn]=sn[dn]||{},sn[dn][hn]=sn[ln]=function(t){return function(e){"number"==typeof e&&(e=Array.prototype.slice.call(arguments));var n=nn[t](e);if("string"==typeof n||void 0===n)return n;for(var i=0;i<n.length;i++)n[i]=Math.round(n[i]);return n}}(ln)}var cn=function(){this.convs={}};cn.prototype.routeSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n))},cn.prototype.setValues=function(t,e){return this.space=t,this.convs={},this.convs[t]=e,this},cn.prototype.getValues=function(t){var e=this.convs[t];if(!e){var n=this.space,i=this.convs[n];e=sn[n][t](i),this.convs[t]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(t){cn.prototype[t]=function(e){return this.routeSpace(t,arguments)}});var fn=sn,gn={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},pn={getRgba:Z,getHsla:$,getRgb:K,getHsl:J,getHwb:X,getAlpha:Q,hexString:tt,rgbString:et,rgbaString:nt,percentString:it,percentaString:at,hslString:rt,hslaString:ot,hwbString:st,keyword:lt},mn={};for(var vn in gn)mn[gn[vn]]=vn;var bn=function(t){if(t instanceof bn)return t;if(!(this instanceof bn))return new bn(t);this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1};var e;"string"==typeof t?(e=pn.getRgba(t),e?this.setValues("rgb",e):(e=pn.getHsla(t))?this.setValues("hsl",e):(e=pn.getHwb(t))&&this.setValues("hwb",e)):"object"==typeof t&&(e=t,void 0!==e.r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e))};bn.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t%=360,t=t<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return pn.hexString(this.values.rgb)},rgbString:function(){return pn.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return pn.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return pn.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return pn.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return pn.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return pn.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return pn.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],n=0;n<t.length;n++){var i=t[n]/255;e[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb,e=(299*t[0]+587*t[1]+114*t[2])/1e3;return e<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=this,i=t,a=void 0===e?.5:e,r=2*a-1,o=n.alpha()-i.alpha(),s=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*i.red(),s*n.green()+l*i.green(),s*n.blue()+l*i.blue()).alpha(n.alpha()*a+i.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new bn,i=this.values,a=n.values;for(var r in i)i.hasOwnProperty(r)&&(t=i[r],e={}.toString.call(t),"[object Array]"===e?a[r]=t.slice(0):"[object Number]"===e?a[r]=t:console.error("unexpected color value:",t));return n}},bn.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},bn.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},bn.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i<t.length;i++)n[t.charAt(i)]=e[t][i];return 1!==e.alpha&&(n.a=e.alpha),n},bn.prototype.setValues=function(t,e){var n,i=this.values,a=this.spaces,r=this.maxes,o=1;if(this.valid=!0,"alpha"===t)o=e;else if(e.length)i[t]=e.slice(0,t.length),o=e[t.length];else if(void 0!==e[t.charAt(0)]){for(n=0;n<t.length;n++)i[t][n]=e[t.charAt(n)];o=e.a}else if(void 0!==e[a[t][0]]){var s=a[t];for(n=0;n<t.length;n++)i[t][n]=e[s[n]];o=e.alpha}if(i.alpha=Math.max(0,Math.min(1,void 0===o?i.alpha:o)),"alpha"===t)return!1;var l;for(n=0;n<t.length;n++)l=Math.max(0,Math.min(r[t][n],i[t][n])),i[t][n]=Math.round(l);for(var u in a)u!==t&&(i[u]=fn[t][u](i[t]));return!0},bn.prototype.setSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n),this)},bn.prototype.setChannel=function(t,e,n){var i=this.values[t];return void 0===n?i[e]:n===i[e]?this:(i[e]=n,this.setValues(t,i),this)},"undefined"!=typeof window&&(window.Color=bn);var yn=bn,xn={noop:function(){},uid:function(){var t=0;return function(){return t++}}(),isNullOrUndef:function(t){return null===t||"undefined"==typeof t},isArray:function(t){if(Array.isArray&&Array.isArray(t))return!0;var e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},isFinite:function(t){return("number"==typeof t||t instanceof Number)&&isFinite(t)},valueOrDefault:function(t,e){return"undefined"==typeof t?e:t},valueAtIndexOrDefault:function(t,e,n){return xn.valueOrDefault(xn.isArray(t)?t[e]:t,n)},callback:function(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)},each:function(t,e,n,i){var a,r,o;if(xn.isArray(t))if(r=t.length,i)for(a=r-1;a>=0;a--)e.call(n,t[a],a);else for(a=0;a<r;a++)e.call(n,t[a],a);else if(xn.isObject(t))for(o=Object.keys(t),r=o.length,a=0;a<r;a++)e.call(n,t[o[a]],o[a])},arrayEquals:function(t,e){var n,i,a,r;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(a=t[n],r=e[n],a instanceof Array&&r instanceof Array){if(!xn.arrayEquals(a,r))return!1}else if(a!==r)return!1;return!0},clone:function(t){if(xn.isArray(t))return t.map(xn.clone);if(xn.isObject(t)){for(var e={},n=Object.keys(t),i=n.length,a=0;a<i;++a)e[n[a]]=xn.clone(t[n[a]]);return e}return t},_merger:function(t,e,n,i){var a=e[t],r=n[t];xn.isObject(a)&&xn.isObject(r)?xn.merge(a,r,i):e[t]=xn.clone(r)},_mergerIf:function(t,e,n){var i=e[t],a=n[t];xn.isObject(i)&&xn.isObject(a)?xn.mergeIf(i,a):e.hasOwnProperty(t)||(e[t]=xn.clone(a))},merge:function(t,e,n){var i,a,r,o,s,l=xn.isArray(e)?e:[e],u=l.length;if(!xn.isObject(t))return t;for(n=n||{},i=n.merger||xn._merger,a=0;a<u;++a)if(e=l[a],xn.isObject(e))for(r=Object.keys(e),s=0,o=r.length;s<o;++s)i(r[s],t,e,n);return t},mergeIf:function(t,e){return xn.merge(t,e,{merger:xn._mergerIf})},extend:function(t){for(var e=function(e,n){t[n]=e},n=1,i=arguments.length;n<i;++n)xn.each(arguments[n],e);return t},inherits:function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},i=function(){this.constructor=n};return i.prototype=e.prototype,n.prototype=new i,n.extend=xn.inherits,t&&xn.extend(n.prototype,t),n.__super__=e.prototype,n}},_n=xn;xn.callCallback=xn.callback,xn.indexOf=function(t,e,n){return Array.prototype.indexOf.call(t,e,n)},xn.getValueOrDefault=xn.valueOrDefault,xn.getValueAtIndexOrDefault=xn.valueAtIndexOrDefault;var kn={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return(t-=1)*t*t+1},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-((t-=1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return(t-=1)*t*t*t*t+1},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-Math.cos(t*(Math.PI/2))+1},easeOutSine:function(t){return Math.sin(t*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},easeInExpo:function(t){return 0===t?0:Math.pow(2,10*(t-1))},easeOutExpo:function(t){return 1===t?1:-Math.pow(2,-10*t)+1},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-(i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2===(t/=.5)?1:(n||(n=.45),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?-.5*(i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)):i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:function(t){return 1-kn.easeOutBounce(1-t)},easeOutBounce:function