text: /*! taucharts - v0.9.3 - 2016-08-30
  * https://github.com/TargetProcess/tauCharts
  * Copyright (c) 2016 Taucraft Limited; Licensed Apache License 2.0 */
  !function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b(require("d3"),require("underscore")):"function"==typeof define&&define.amd?define(["d3","underscore"],b):"object"==typeof exports?exports.tauCharts=b(require("d3"),require("underscore")):a.tauCharts=b(a.d3,a._)}(this,function(a,b){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}Object.defineProperty(b,"__esModule",{value:!0}),b.version=b.api=b.__api__=b.Chart=b.Plot=b.GPL=void 0;var f=c(1),g=c(4),h=c(24),i=c(28),j=c(109),k=c(26),l=c(16),m=c(32),n=c(33),o=c(111),p=c(113),q=c(114),r=c(117),s=c(5),t=c(21),u=c(118),v=c(18),w=c(22),x=c(23),y=c(119),z=c(120),A=c(122),B=c(123),C=c(124),D=c(125),E=c(126),F=c(127),G=c(128),H=c(129),I=c(130),J=c(110),K=c(131),L=c(132),M=c(134),N=c(135),O=c(136),P=c(137),Q=c(17),R=c(10),S=c(138),T=c(3),U=d(T),V=c(2),W=d(V),X={},Y={},Z={UnitDomainPeriodGenerator:k.UnitDomainPeriodGenerator},$={errorCodes:R.errorCodes,unitsRegistry:m.unitsRegistry,scalesRegistry:n.scalesRegistry,tickFormat:l.FormatterRegistry,isChartElement:g.utils.isChartElement,isLineElement:g.utils.isLineElement,d3:W["default"],_:U["default"],tickPeriod:k.UnitDomainPeriodGenerator,colorBrewers:{add:function(a,b){a in X||(X[a]=b)},get:function(a){return X[a]}},d3_animationInterceptor:Q.d3_animationInterceptor,pluginsSDK:S.PluginsSDK,plugins:{add:function(a,b){if(a in Y)throw new Error("Plugin is already registered.");Y[a]=b},get:function(a){return Y[a]||function(a){throw new Error(a+" plugin is not defined")}}},globalSettings:{animationSpeed:750,defaultNiceColor:!0,defaultColorBrewer:["#fde725","#fbe723","#f8e621","#f6e620","#f4e61e","#f1e51d","#efe51c","#ece51b","#eae51a","#e7e419","#e5e419","#e2e418","#dfe318","#dde318","#dae319","#d8e219","#d5e21a","#d2e21b","#d0e11c","#cde11d","#cae11f","#c8e020","#c5e021","#c2df23","#c0df25","#bddf26","#bade28","#b8de29","#b5de2b","#b2dd2d","#b0dd2f","#addc30","#aadc32","#a8db34","#a5db36","#a2da37","#a0da39","#9dd93b","#9bd93c","#98d83e","#95d840","#93d741","#90d743","#8ed645","#8bd646","#89d548","#86d549","#84d44b","#81d34d","#7fd34e","#7cd250","#7ad151","#77d153","#75d054","#73d056","#70cf57","#6ece58","#6ccd5a","#69cd5b","#67cc5c","#65cb5e","#63cb5f","#60ca60","#5ec962","#5cc863","#5ac864","#58c765","#56c667","#54c568","#52c569","#50c46a","#4ec36b","#4cc26c","#4ac16d","#48c16e","#46c06f","#44bf70","#42be71","#40bd72","#3fbc73","#3dbc74","#3bbb75","#3aba76","#38b977","#37b878","#35b779","#34b679","#32b67a","#31b57b","#2fb47c","#2eb37c","#2db27d","#2cb17e","#2ab07f","#29af7f","#28ae80","#27ad81","#26ad81","#25ac82","#25ab82","#24aa83","#23a983","#22a884","#22a785","#21a685","#21a585","#20a486","#20a386","#1fa287","#1fa187","#1fa188","#1fa088","#1f9f88","#1f9e89","#1e9d89","#1e9c89","#1e9b8a","#1f9a8a","#1f998a","#1f988b","#1f978b","#1f968b","#1f958b","#1f948c","#20938c","#20928c","#20928c","#21918c","#21908d","#218f8d","#218e8d","#228d8d","#228c8d","#228b8d","#238a8d","#23898e","#23888e","#24878e","#24868e","#25858e","#25848e","#25838e","#26828e","#26828e","#26818e","#27808e","#277f8e","#277e8e","#287d8e","#287c8e","#297b8e","#297a8e","#29798e","#2a788e","#2a778e","#2a768e","#2b758e","#2b748e","#2c738e","#2c728e","#2c718e","#2d718e","#2d708e","#2e6f8e","#2e6e8e","#2e6d8e","#2f6c8e","#2f6b8e","#306a8e","#30698e","#31688e","#31678e","#31668e","#32658e","#32648e","#33638d","#33628d","#34618d","#34608d","#355f8d","#355e8d","#365d8d","#365c8d","#375b8d","#375a8c","#38598c","#38588c","#39568c","#39558c","#3a548c","#3a538b","#3b528b","#3b518b","#3c508b","#3c4f8a","#3d4e8a","#3d4d8a","#3e4c8a","#3e4a89","#3e4989","#3f4889","#3f4788","#404688","#404588","#414487","#414287","#424186","#424086","#423f85","#433e85","#433d84","#443b84","#443a83","#443983","#453882","#453781","#453581","#463480","#46337f","#46327e","#46307e","#472f7d","#472e7c","#472d7b","#472c7a","#472a7a","#482979","#482878","#482677","#482576","#482475","#482374","#482173","#482071","#481f70","#481d6f","#481c6e","#481b6d","#481a6c","#48186a","#481769","#481668","#481467","#471365","#471164","#471063","#470e61","#470d60","#460b5e","#460a5d","#46085c","#46075a","#450559","#450457","#440256","#440154"],defaultClassBrewer:U["default"].times(20,function(a){return"color20-"+(1+a)}),log:function(a,b){b=b||"INFO",Array.isArray(a)||(a=[a]),console[b.toLowerCase()].apply(console,a)},facetLabelDelimiter:" → ",excludeNull:!0,specEngine:[{name:"COMPACT",width:600},{name:"AUTO",width:Number.MAX_VALUE}],fitModel:"normal",layoutEngine:"EXTRACT",autoRatio:!0,defaultSourceMap:["https://raw.githubusercontent.com","TargetProcess/tauCharts/master/src/addons","world-countries.json"].join("/"),getAxisTickLabelSize:U["default"].memoize(f.utilsDom.getAxisTickLabelSize,function(a){return(a||"").length}),getScrollBarWidth:U["default"].memoize(f.utilsDom.getScrollbarWidth),xAxisTickLabelLimit:150,yAxisTickLabelLimit:150,xTickWordWrapLinesLimit:2,yTickWordWrapLinesLimit:2,xTickWidth:9,yTickWidth:9,distToXAxisLabel:10,distToYAxisLabel:10,xAxisPadding:20,yAxisPadding:20,xFontLabelDescenderLineHeight:4,xFontLabelHeight:10,yFontLabelHeight:10,xDensityPadding:2,yDensityPadding:2,"xDensityPadding:measure":8,"yDensityPadding:measure":8,defaultFormats:{measure:"x-num-auto","measure:time":"x-time-auto"}}};i.Plot.__api__=$,i.Plot.globalSettings=$.globalSettings,[["COORDS.RECT",o.Cartesian],["COORDS.MAP",q.GeoMap],["COORDS.PARALLEL",p.Parallel],["ELEMENT.GENERIC.CARTESIAN",r.GenericCartesian],["ELEMENT.POINT",s.Point],["ELEMENT.LINE",v.Line],["ELEMENT.PATH",u.Path],["ELEMENT.AREA",t.Area],["ELEMENT.INTERVAL",w.Interval],["ELEMENT.INTERVAL.STACKED",x.StackedInterval],["PARALLEL/ELEMENT.LINE",y.ParallelLine]].reduce(function(a,b){return a.reg(b[0],b[1])},$.unitsRegistry),[["identity",z.IdentityScale,function(a,b){return U["default"].defaults(a,{references:b.references,refCounter:b.refCounter})}],["color",A.ColorScale,function(a,b){return U["default"].defaults(a,{nice:b.defaultNiceColor,brewer:"measure"===a.dimType?b.defaultColorBrewer:b.defaultClassBrewer})}],["fill",I.FillScale],["size",B.SizeScale],["ordinal",C.OrdinalScale],["period",D.PeriodScale],["time",E.TimeScale],["linear",F.LinearScale],["logarithmic",G.LogarithmicScale],["value",H.ValueScale]].reduce(function(a,b){return a.reg.apply(a,e(b))},$.scalesRegistry);var _=[function(a){return a.data?[]:["[data] must be specified"]}];$.chartTypesRegistry=J.chartTypesRegistry.add("scatterplot",M.ChartScatterplot,_).add("line",N.ChartLine,_).add("area",O.ChartArea,_).add("stacked-area",function(a){return(0,O.ChartArea)(U["default"].defaults(a,{stack:!0}))},_).add("bar",function(a){return(0,L.ChartInterval)(U["default"].defaults(a,{flip:!1}))},_).add("horizontalBar",function(a){return(0,L.ChartInterval)(U["default"].defaults({flip:!0},a))},_).add("horizontal-bar",function(a){return(0,L.ChartInterval)(U["default"].defaults({flip:!0},a))},_).add("stacked-bar",function(a){return(0,L.ChartInterval)(U["default"].defaults({flip:!1,stack:!0},a))},_).add("horizontal-stacked-bar",function(a){return(0,L.ChartInterval)(U["default"].defaults({flip:!0,stack:!0},a))},_).add("map",K.ChartMap,_.concat([function(a){var b=a.fill&&a.code;return a.fill&&!b?"[code] must be specified when using [fill]":void 0},function(a){var b=a.latitude&&a.longitude;return!a.latitude&&!a.longitude||b?void 0:"[latitude] and [longitude] both must be specified"}])).add("parallel",P.ChartParallel,_.concat([function(a){var b=a.columns&&a.columns.length>1;return b?void 0:"[columns] property must contain at least 2 dimensions"}]));var aa="0.9.3";b.GPL=h.GPL,b.Plot=i.Plot,b.Chart=j.Chart,b.__api__=Z,b.api=$,b.version=aa},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(b,"__esModule",{value:!0}),b.utilsDom=void 0;var e=c(2),f=d(e),g=c(3),h=d(g),i=document.createElement("div"),j={appendTo:function(a,b){var c;return a instanceof Node?c=a:(i.insertAdjacentHTML("afterbegin",a),c=i.childNodes[0]),b.appendChild(c),c},getScrollbarWidth:function(){var a=document.createElement("div");a.style.overflow="scroll",a.style.visibility="hidden",a.style.position="absolute",a.style.width="100px",a.style.height="100px",document.body.appendChild(a);var b=a.offsetWidth-a.clientWidth;return document.body.removeChild(a),b},getStyle:function(a,b){return window.getComputedStyle(a,void 0).getPropertyValue(b)},getStyleAsNum:function(a,b){return parseInt(this.getStyle(a,b)||0,10)},getContainerSize:function(a){var b=this.getStyleAsNum(a,"padding-left"),c=this.getStyleAsNum(a,"padding-right"),d=this.getStyleAsNum(a,"padding-bottom"),e=this.getStyleAsNum(a,"padding-top"),f=this.getStyleAsNum(a,"border-top-width"),g=this.getStyleAsNum(a,"border-left-width"),h=this.getStyleAsNum(a,"border-right-width"),i=this.getStyleAsNum(a,"border-bottom-width"),j=f+g+h+i,k=a.getBoundingClientRect();return{width:k.width-b-c-2*j,height:k.height-d-e-2*j}},getAxisTickLabelSize:function(a){var b=['<svg class="graphical-report__svg">','<g class="graphical-report__cell cell">','<g class="x axis">','<g class="tick"><text><%= xTick %></text></g>',"</g>","</g>","</svg>"].join(""),c=h["default"].template(b),d=document.createElement("div");d.style.position="absolute",d.style.visibility="hidden",d.style.width="100px",d.style.height="100px",d.style.border="1px solid green",document.body.appendChild(d),d.innerHTML=c({xTick:a});var e=f["default"].select(d).selectAll(".x.axis .tick text")[0][0],g={width:0,height:0},i=e.getBoundingClientRect();g.width=i.right-i.left,g.height=i.bottom-i.top;var j=0!==a.length?g.width/a.length:0;return g.width=g.width+1.5*j,document.body.removeChild(d),g},getLabelSize:function(a,b){for(var c=b.fontSize,d=b.fontFamily,e=b.fontWeight,f="string"==typeof c?c:c+"px",g=0,h=0,i=a.length-1,k=0;i>=k;k++){var l=a.charAt(k),m=j.getCharSize(l,{fontSize:f,fontFamily:d,fontWeight:e});g+=m.width,h=Math.max(h,m.height)}return{width:g,height:h}},getCharSize:h["default"].memoize(function(a,b){var c=b.fontSize,d=b.fontFamily,e=b.fontWeight,f=document.createElement("div");f.style.position="absolute",f.style.visibility="hidden",f.style.border="0px",f.style.fontSize=c,f.style.fontFamily=d,f.style.fontWeight=e,document.body.appendChild(f),f.innerHTML=" "===a?"&nbsp;":a;var g={width:0,height:0},h=f.getBoundingClientRect();return g.width=h.right-h.left,g.height=h.bottom-h.top,document.body.removeChild(f),g},function(a,b){return a+"_"+JSON.stringify(b)})};b.utilsDom=j},function(b,c){b.exports=a},function(a,c){a.exports=b},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(b,"__esModule",{value:!0}),b.utils=void 0;var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},f=c(5),g=c(18),h=c(21),i=c(22),j=c(23),k=c(3),l=d(k),m=function u(a,b,c,d){var e=d(c(a),a);return(e[b]||[]).forEach(function(a){return u(a,b,c,d)}),e},n=function v(a,b,c){var d=arguments.length<=3||void 0===arguments[3]?0:arguments[3],e=b(a,d);e&&(a.units||[]).map(function(a){return v(a,b,c,d+1)}),c(a,d)},o=0,p={},q=function(){function a(a){return"object"==("undefined"==typeof a?"undefined":e(a))?JSON.parse(JSON.stringify(a)):a}function b(a){for(var b in a)this[b]=a[b]}function c(){this.copiedObjects=[];var a=this;this.recursiveDeepCopy=function(b){return a.deepCopy(b)},this.depth=0}function d(a,b){var d=new c;return b&&(d.maxDepth=b),d.deepCopy(a)}var f=[];return b.prototype={constructor:b,canCopy:function(a){return!1},create:function(a){},populate:function(a,b,c){}},c.prototype={constructor:c,maxDepth:256,cacheResult:function(a,b){this.copiedObjects.push([a,b])},getCachedResult:function(a){for(var b=this.copiedObjects,c=b.length,d=0;c>d;d++)if(b[d][0]===a)return b[d][1]},deepCopy:function(a){if(null===a)return null;if("object"!==("undefined"==typeof a?"undefined":e(a)))return a;var b=this.getCachedResult(a);if(b)return b;for(var c=0;c<f.length;c++){var d=f[c];if(d.canCopy(a))return this.applyDeepCopier(d,a)}throw new Error("no DeepCopier is able to copy "+a)},applyDeepCopier:function(a,b){var c=a.create(b);if(this.cacheResult(b,c),this.depth++,this.depth>this.maxDepth)throw new Error("Exceeded max recursion depth in deep copy.");return a.populate(this.recursiveDeepCopy,b,c),this.depth--,c}},d.DeepCopier=b,d.deepCopiers=f,d.register=function(a){a instanceof b||(a=new b(a)),f.unshift(a)},d.register({canCopy:function(){return!0},create:function(b){return b instanceof b.constructor?a(b.constructor.prototype):{}},populate:function(a,b,c){for(var d in b)b.hasOwnProperty(d)&&(c[d]=a(b[d]));return c}}),d.register({canCopy:function(a){return a instanceof Array},create:function(a){return new a.constructor},populate:function(a,b,c){for(var d=0;d<b.length;d++)c.push(a(b[d]));return c}}),d.register({canCopy:function(a){return a instanceof Date},create:function(a){return new Date(a)}}),d}(),r=[i.Interval,f.Point,g.Line,h.Area,j.StackedInterval],s=function(a){return/^(#|rgb\(|rgba\()/.test(a)},t={clone:function(a){return q(a)},isArray:function(a){return Array.isArray(a)},isChartElement:function(a){return r.some(function(b){return a instanceof b})},isLineElement:function(a){return a instanceof g.Line},niceZeroBased:function(a){var b=10,c=parseFloat(Math.min.apply(null,a).toFixed(15)),d=parseFloat(Math.max.apply(null,a).toFixed(15));if(c===d){var e=d>=0?-1:1,f=d||1;d-=e*f/b}for(var g=[c,d],h=g[1]-g[0],i=Math.pow(10,Math.floor(Math.log(h/b)/Math.LN10)),j=b/h*i,k=[[.15,10],[.35,5],[.75,2],[1,1],[2,1]],l=-1;j>k[++l][0];);i*=k[l][1],g[0]=Math.floor(g[0]/i)*i,g[1]=Math.ceil(g[1]/i)*i;var m=c-g[0],n=g[1]-d,o=i/2;if(c>=0)g[0]=0;else{var p=o>=m?i:0;g[0]=g[0]-p}if(0>=d)g[1]=0;else{var q=o>=n?i:0;g[1]=g[1]+q}return[parseFloat(g[0].toFixed(15)),parseFloat(g[1].toFixed(15))]},traverseJSON:m,generateHash:function(a){var b=btoa(encodeURIComponent(a)).replace(/=/g,"_");return p.hasOwnProperty(b)||(p[b]="H"+ ++o),p[b]},generateRatioFunction:function(a,b,c){var d=function(a){return a instanceof Date?a.getTime():a},e=0,f=null,g=l["default"].memoize(function(a,b){return(0,l["default"])(a).chain().map(function(a){return b.reduce(function(b,c){return b.concat(d(a[c]))},[])}).uniq(function(a){return JSON.stringify(a)}).reduce(function(a,b){var c=b[0];return a[c]=a[c]||0,a[c]+=1,a},{}).value()},function(a,b){var c=f===a?e:++e;return f=a,b.join("")+"-"+c});return function(d,e,f){var h=f.length,i=c.getSpec(),j=i.sources["/"].data,k=i.unit.units[0].guide||{};k.padding=k.padding||{l:0,r:0,t:0,b:0};var m=0;"x"===a?m=k.padding.l+k.padding.r:"y"===a&&(m=k.padding.t+k.padding.b);var n=function(a){return l["default"].values(g(j,a)).reduce(function(a,b){return a+b},0)},o=function(a,b){return g(j,a)[b]},p=n(b),q=(e-h*m)/p,r=o(b,d);return(r*q+m)/e}},traverseSpec:n,isSpecRectCoordsOnly:function(a){var b=!0;try{t.traverseSpec(a,function(a){if(0===a.type.indexOf("COORDS.")&&"COORDS.RECT"!==a.type)throw new Error("Not applicable")},function(a){return a})}catch(c){"Not applicable"===c.message&&(b=!1)}return b},throttleLastEvent:function(a,b,c){var d=arguments.length<=3||void 0===arguments[3]?0:arguments[3];return function(){var e={e:b,ts:new Date},f=a.e&&a.e===e.e?e.ts-a.ts:d;if(f>=d){for(var g=arguments.length,h=Array(g),i=0;g>i;i++)h[i]=arguments[i];c.apply(this,h)}a.e=e.e,a.ts=e.ts}},splitEvenly:function(a,b){var c=a[0],d=a[1],e=(d-c)/(b-1),f=l["default"].times(b-2,function(a){return c+e*(a+1)});return[c].concat(f).concat(d)},extRGBColor:function(a){return s(a)?a:""},extCSSClass:function(a){return s(a)?"":a},toRadian:function(a){return a/180*Math.PI},normalizeAngle:function(a){return Math.abs(a)>=360&&(a%=360),0>a&&(a=360+a),a}};b.utils=t},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.Point=void 0;var i=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),j=c(6),k=c(7),l=c(9),m=c(11),n=c(17),o=c(3),p=d(o),q=c(2),r=d(q);b.Point=function(a){function b(a){f(this,b);var c=g(this,Object.getPrototypeOf(b).call(this,a));c.config=a,c.config.guide=p["default"].defaults(c.config.guide||{},{animationSpeed:0,prettify:!0,enableColorToBarPosition:!1}),c.config.guide.size=p["default"].defaults(c.config.guide.size||{},{defMinSize:10,defMaxSize:c.isEmptySize?10:40,enableDistributeEvenly:!c.isEmptySize}),c.config.guide.label=p["default"].defaults(c.config.guide.label||{},{position:["auto:avoid-label-label-overlap","auto:avoid-label-anchor-overlap","auto:hide-on-label-label-overlap","keep-in-box"]}),c.defMin=a.guide.size.defMinSize,c.defMax=a.guide.size.defMaxSize,c.minLimit=a.guide.size.minSize,c.maxLimit=a.guide.size.maxSize,c.isHorizontal=!1;var d=c.config.stack,e=c.config.guide.enableColorToBarPosition,h=c.config.guide.size.enableDistributeEvenly;return c.decorators=[l.CartesianGrammar.decorator_orientation,l.CartesianGrammar.decorator_groundY0,l.CartesianGrammar.decorator_group,d&&l.CartesianGrammar.decorator_stack,e&&l.CartesianGrammar.decorator_positioningByColor,l.CartesianGrammar.decorator_dynamic_size,l.CartesianGrammar.decorator_color,l.CartesianGrammar.decorator_label,a.adjustPhase&&d&&l.CartesianGrammar.adjustYScale,a.adjustPhase&&(h?l.CartesianGrammar.adjustSigmaSizeScale:l.CartesianGrammar.adjustStaticSizeScale)].concat(a.transformModel||[]),c.on("highlight",function(a,b){return c.highlight(b)}),c}return h(b,a),i(b,[{key:"createScales",value:function(a){var b=this.config;this.xScale=a("pos",b.x,[0,b.options.width]),this.yScale=a("pos",b.y,[b.options.height,0]),this.size=a("size",b.size,{}),this.color=a("color",b.color,{}),this.split=a("split",b.split,{}),this.label=a("label",b.label,{}),this.identity=a("identity",b.identity,{});var c=function(a,b){var c=a.discrete?1:0,d=b.discrete?1:0;return d*b.domain().length-c*a.domain().length};return this.isHorizontal=this.yScale===[this.xScale,this.yScale].sort(c)[0],this.regScale("x",this.xScale).regScale("y",this.yScale).regScale("size",this.size).regScale("color",this.color).regScale("split",this.split).regScale("label",this.label)}},{key:"walkFrames",value:function(a){var b={defMin:this.defMin,defMax:this.defMax,minLimit:this.minLimit,maxLimit:this.maxLimit,isHorizontal:this.isHorizontal,dataSource:a.reduce(function(a,b){return a.concat(b.part())},[])};return this.decorators.filter(function(a){return a}).reduce(function(a,c){return l.CartesianGrammar.compose(a,c(a,b))},new l.CartesianGrammar({scaleX:this.xScale,scaleY:this.yScale,scaleSize:this.size,scaleLabel:this.label,scaleColor:this.color,scaleSplit:this.split,scaleIdentity:this.identity}))}},{key:"drawFrames",value:function(a){var b=this,c=this.config.options,d=j.CSS_PREFIX+"dot dot i-role-element i-role-datum",e=a.reduce(function(a,b){return a.concat(b.part())},[]),f=this.walkFrames(a);b.screenModel=f.toScreenModel();var g=1e4,h={r:function(a){return Math.round(g*b.screenModel.size(a)/2)/g},cx:function(a){return b.screenModel.x(a)},cy:function(a){return b.screenModel.y(a)},fill:function(a){return b.screenModel.color(a)},"class":function(a){return d+" "+b.screenModel["class"](a)}},i=n.d3_animationInterceptor,k=function(){this.attr("class","frame").call(function(){var a=this.selectAll("circle").data(function(a){return a},b.screenModel.id);a.exit().call(i(b.config.guide.animationSpeed,null,{r:0},function(a){return r["default"].select(a).remove()})),a.call(i(b.config.guide.animationSpeed,null,h)),a.enter().append("circle").call(i(b.config.guide.animationSpeed,{r:0},h)),b.subscribe(a)})},l=p["default"].groupBy(e,b.screenModel.group),o=Object.keys(l).reduce(function(a,b){return a.concat([l[b]])},[]),q=c.container.selectAll(".frame").data(o);q.exit().remove(),q.call(k),q.enter().append("g").call(k),b.subscribe(new m.LayerLabels(f,this.isHorizontal,this.config.guide.label,c).draw(o))}},{key:"highlight",value:function(a){var b,c,d="graphical-report__highlighted",f="graphical-report__dimmed",g=this.config.options.container;g.selectAll(".dot").classed((b={},e(b,d,function(b){return a(b)===!0}),e(b,f,function(b){return a(b)===!1}),b)),g.selectAll(".i-role-label").classed((c={},e(c,d,function(b){return a(b)===!0}),e(c,f,function(b){return a(b)===!1}),c))}}]),b}(k.Element)},function(a,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.CSS_PREFIX="graphical-report__"},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.Element=void 0;var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=c(8),j=c(4),k=c(2),l=d(k);b.Element=function(a){function b(a){e(this,b);var c=f(this,Object.getPrototypeOf(b).call(this,a));return c.screenModel=null,c._elementNameSpace=a.namespace||"default",c._elementScalesHub={},c.isEmptySize=!a.size||0===a.size.indexOf("size_undefined")||0===a.size.indexOf("size_null"),c}return g(b,a),h(b,[{key:"regScale",value:function(a,b){return this._elementScalesHub[a]=b,this}},{key:"getScale",value:function(a){return this._elementScalesHub[a]||null}},{key:"fireNameSpaceEvent",value:function(a,b){var c=this._elementNameSpace;this.fire(a+"."+c,b)}},{key:"subscribe",value:function(a){var b=arguments.length<=1||void 0===arguments[1]?function(a){return a}:arguments[1],c=arguments.length<=2||void 0===arguments[2]?function(a){return a}:arguments[2],d=this,e={};[{event:"mouseover",limit:0},{event:"mouseout",limit:0},{event:"click",limit:0},{event:"mousemove",limit:25}].forEach(function(f){var g=f.event,h=f.limit,i=function(a){var e={data:b.call(this,a),event:c.call(this,l["default"].event,a)};d.fire(g,e),d.fireNameSpaceEvent(g,e)};a.on(g,j.utils.throttleLastEvent(e,g,i,h))})}},{key:"walkFrames",value:function(){return{toScreenModel:function(){return null}}}},{key:"createScales",value:function(){}},{key:"allocateRect",value:function(){return{left:0,top:0,width:0,height:0}}},{key:"init",value:function(){this.createScales(this.config.fnCreateScale),this.screenModel=this.walkFrames(this.config.frames).toScreenModel()}},{key:"draw",value:function(){this.config.options.container=this.config.options.slot(this.config.uid),this.drawFrames(this.config.frames)}},{key:"data",value:function(){return this.config.frames.reduce(function(a,b){return a.concat(b.part())},[])}},{key:"node",value:function(){return this}}]),b}(i.Emitter)},function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function d(a){var b=g[a];return b||(b=function(){for(var b,c,d=this,e=0,f=[];d=d.handler;){if(c=d.callbacks[a],"function"==typeof c){if(!b)for(b=[this],e=0;e<arguments.length;e++)b.push(arguments[e]);f.unshift({fn:c,context:d.context,args:b})}if(c=d.callbacks["*"],"function"==typeof c){if(!b)for(b=[this],e=0;e<arguments.length;e++)b.push(arguments[e]);f.unshift({fn:c,context:d.context,args:[{sender:this,type:a,args:b}]})}}f.forEach(function(a){return a.fn.apply(a.context,a.args)})},g[a]=b),b}Object.defineProperty(b,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f={},g={},h=function(){function a(){c(this,a),this.handler=null,this.emit_destroy=d("destroy")}return e(a,[{key:"addHandler",value:function(a,b){b=b||this,this.handler={callbacks:a,context:b,handler:this.handler}}},{key:"on",value:function(a,b,c){var d={};return d[a]=b,this.addHandler(d,c),d}},{key:"fire",value:function(a,b){d.call(this,a).call(this,b)}},{key:"removeHandler",value:function(a,b){var c,d=this;for(b=b||this;c=d,d=d.handler;)if(d.callbacks===a&&d.context===b)return d.callbacks=f,void(c.handler=d.handler)}},{key:"destroy",value:function(){this.emit_destroy(),this.handler=null}}]),a}();b.Emitter=h},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(null==a)throw new TypeError("Cannot destructure undefined")}function f(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function g(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0}),b.CartesianGrammar=void 0;var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=c(3),j=d(i),k=c(10),l="(@taucharts@)",m="taucharts_synthetic_record";b.CartesianGrammar=function(){function a(b){g(this,a);var c=function(a){return function(){return a}};this.flip=b.flip||!1,this.scaleX=b.scaleX,this.scaleY=b.scaleY,this.scaleSize=b.scaleSize,this.scaleLabel=b.scaleLabel,this.scaleColor=b.scaleColor,this.scaleSplit=b.scaleSplit,this.scaleIdentity=b.scaleIdentity;var d=this.scaleIdentity;this.id=function(a){return d.value(a[d.dim],a)},this.y0=b.y0||c(0),this.yi=b.yi||c(0),this.xi=b.xi||c(0),this.size=b.size||c(1),this.label=b.label||c(""),this.color=b.color||c(""),this.group=b.group||c(""),this.order=b.order||c(0)}return h(a,[{key:"toScreenModel",value:function(){var a=this.flip,b=function(a,b,c){return a?b:c},c=this;return{flip:a,id:c.id,x:b(a,c.yi,c.xi),y:b(a,c.xi,c.yi),x0:b(a,c.y0,c.xi),y0:b(a,c.xi,c.y0),size:c.size,group:c.group,order:c.order,label:c.label,color:function(a){return c.scaleColor.toColor(c.color(a))},"class":function(a){return c.scaleColor.toClass(c.color(a))},model:c}}}],[{key:"compose",value:function(b){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return Object.keys(c).reduce(function(a,b){return a[b]=c[b],a},new a(b))}},{key:"decorator_identity",value:function(a){return a}},{key:"decorator_orientation",value:function(a,b){var c=b.isHorizontal,d=c?a.scaleY:a.scaleX,e=c?a.scaleX:a.scaleY;return{flip:c,scaleX:d,scaleY:e,y0:function(a){return e.value(a[e.dim])},yi:function(a){return e.value(a[e.dim])},xi:function(a){return d.value(a[d.dim])}}}},{key:"decorator_groundY0",value:function(a,b){var c=b.isHorizontal,d=c?-.5:.5,e=a.scaleY.domain(),g=e[0],h=a.scaleY.discrete?a.scaleY.value(g)+a.scaleY.stepSize(g)*d:a.scaleY.value(Math.max(0,Math.min.apply(Math,f(e))));return{y0:function(){return h}}}},{key:"decorator_dynamic_size",value:function(a,b){return e(b),{size:function(b){return a.size(b)*a.scaleSize.value(b[a.scaleSize.dim])}}}},{key:"decorator_positioningByColor",value:function(b,c){var d=b.scaleX.discrete?a.decorator_discrete_positioningByColor:a.decorator_identity;return d(b,c)}},{key:"decorator_discrete_positioningByColor",value:function(a,b){e(b);var c=a.scaleX,d=a.scaleColor,f=d.discrete?d.domain():d.originalSeries().sort(function(a,b){return a-b}),g=f.length||1,h=function(b){return Math.max(0,f.indexOf(b[a.scaleColor.dim]))},i=function(a){return c.stepSize(a[c.dim])*(g/(1+g))};return{xi:function(b){var c=i(b),d=a.xi(b)-c/2,e=c/(g+1),f=(1+h(b))*e;return d+f}}}},{key:"decorator_color",value:function(a,b){return e(b),{color:function(b){return a.scaleColor.value(b[a.scaleColor.dim])}}}},{key:"decorator_label",value:function(a,b){return e(b),{label:function(b){return a.scaleLabel.value(b[a.scaleLabel.dim])}}}},{key:"decorator_group",value:function(a,b){return e(b),{group:function(b){return""+b[a.scaleColor.dim]+l+b[a.scaleSplit.dim]}}}},{key:"decorator_groupOrderByColor",value:function(a,b){e(b);var c=a.scaleColor.domain();return{order:function(a){var b=a.split(l)[0],d=c.indexOf(b);return 0>d?Number.MAX_VALUE:d}}}},{key:"decorator_groupOrderByAvg",value:function(a,b){var c=b.dataSource,d=function(b){return b.map(a.yi).reduce(function(a,b){return a+b},0)/b.length},e=c.reduce(function(b,c){var d=a.group(c);return b[d]=b[d]||[],b[d].push(c),b},{}),f=Object.keys(e).map(function(a){return[a,d(e[a])]}).sort(function(a,b){return a[1]-b[1]}).map(function(a){return a[0]});return{order:function(a){var b=f.indexOf(a);return 0>b?Number.MAX_VALUE:b}}}},{key:"decorator_stack",value:function(a,b){e(b);var c=a.scaleX,d=a.scaleY;if(d.discrete||d.domain().some(function(a){return"number"!=typeof a}))throw new k.TauChartError("Stacked field ["+d.dim+"] should be a number",k.errorCodes.STACKED_FIELD_NOT_NUMBER,{field:d.dim});var f=function(a){return function(b){var e=b[c.dim],f=b[d.dim],g=b[m]?"positive"===b[m+"sign"]:f>=0,h=g?a.positive:a.negative,i=h[e]||0,j=i+f;return h[e]=j,{isPositive:g,nextStack:j,prevStack:i}}},g=f({positive:{},negative:{}}),h=f({positive:{},negative:{}}),i=function(b){return j["default"].memoize(b,a.id)};return{yi:i(function(a){return d.value(g(a).nextStack)}),y0:i(function(a){return d.value(h(a).prevStack)})}}},{key:"decorator_size_distribute_evenly",value:function(a,b){var c=b.dataSource,d=b.minLimit,e=b.maxLimit,f=b.defMin,g=b.defMax,h=function(a,b){return a-b},i=a.scaleX.discrete?a.scaleX.stepSize()/2:Number.MAX_VALUE,j=c.map(function(b){return a.xi(b)}).sort(h),k=j[0],l=j.slice(1).map(function(a){var b=a-k;return k=a,b}).filter(function(a){return a>0}).sort(h).concat(Number.MAX_VALUE)[0],m=Math.min(l,i),n="number"==typeof d?d:f,o={minSize:n,maxSize:"number"==typeof e?e:Math.max(n,Math.min(g,m))};return a.scaleSize.fixup(function(a){var b={};return a.fixed?a.maxSize>o.maxSize&&(b.maxSize=o.maxSize):(b.fixed=!0,b.minSize=o.minSize,b.maxSize=o.maxSize),b}),{}}},{key:"adjustYScale",value:function(a,b){var c=b.dataSource,d=Number.MAX_VALUE,e=Number.MIN_VALUE,f=function(a){d=d>a?a:d,e=a>e?a:e},g=a.scaleY.value;return a.scaleY.value=function(a){return f(a),g(a)},c.forEach(function(b){a.yi(b),a.y0(b)}),a.scaleY.fixup(function(a){var b={};return(!a.hasOwnProperty("max")||a.max<e)&&(b.max=e),(!a.hasOwnProperty("min")||a.min>d)&&(b.min=d),b}),{}}},{key:"adjustStaticSizeScale",value:function(a,b){var c=b.minLimit,d=b.maxLimit,e=b.defMin,f=b.defMax,g={minSize:"number"==typeof c?c:e,maxSize:"number"==typeof d?d:f};return a.scaleSize.fixup(function(a){var b={};return a.fixed||(b.fixed=!0,b.minSize=g.minSize,b.maxSize=g.maxSize),b}),{}}},{key:"adjustSigmaSizeScale",value:function(a,b){
  var c=b.dataSource,d=b.minLimit,e=b.maxLimit,f=b.defMin,g=b.defMax,h=function(a,b){return a-b},i=c.map(function(b){return a.xi(b)}).sort(h),j=i[0],k=i.slice(1).map(function(a){var b=a-j;return j=a,b}).filter(function(a){return a>0}).sort(h).concat(Number.MAX_VALUE)[0],l=a.scaleX.discrete?a.scaleX.stepSize()/2:Number.MAX_VALUE,m=Math.min(k,l),n="number"==typeof d?d:f,o="number"==typeof e?e:g,p=function(a){var b=(n+o)/2,c=o,d=n,e=.5;return Math.round(b+(c-b)/(1+Math.exp(-(a-d)/e)))},q={minSize:n,maxSize:Math.max(n,Math.min(o,p(m)))};return a.scaleSize.fixup(function(a){var b={};return a.fixed?a.maxSize>q.maxSize&&(b.maxSize=q.maxSize):(b.fixed=!0,b.minSize=q.minSize,b.maxSize=q.maxSize),b}),{}}},{key:"toFibers",value:function(a,b){var c=j["default"].groupBy(a,b.group);return Object.keys(c).sort(function(a,c){return b.order(a)-b.order(c)}).reduce(function(a,b){return a.concat([c[b]])},[])}},{key:"isNonSyntheticRecord",value:function(a){return a[m]!==!0}},{key:"toStackedFibers",value:function(a,b){var c=b.scaleX.dim,d=b.scaleY.dim,e=b.scaleColor.dim,f=b.scaleSplit.dim,g=a.sort(function(a,c){return b.xi(a)-b.xi(c)}),h=j["default"].uniq(g.map(function(a){return a[c]}),!0),i=function(a){return a[d]>=0?"positive":"negative"},k=function(a,b,g){var h={};return h[c]=a,h[d]=0,h[f]=b[f],h[e]=b[e],h[m]=!0,h[m+"sign"]=g,h},l=function(a,b,d){var e=j["default"].groupBy(b,function(a){return a[c]}),f=b[0];return a.reduce(function(a,b){return a.concat(e[b]||k(b,f,d))},[])},n=j["default"].groupBy(g,b.group);return Object.keys(n).sort(function(a,c){return b.order(a)-b.order(c)}).reduce(function(a,b){var c=j["default"].groupBy(n[b],i);return Object.keys(c).reduce(function(a,b){return a.concat([l(h,c[b],b)])},a)},[])}}]),a}()},function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function d(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function e(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0});var f=function(a){function b(a,e,f){c(this,b);var g=d(this,Object.getPrototypeOf(b).call(this));return g.name="TauChartError",g.message=a,g.errorCode=e,g.errorArgs=f,g}return e(b,a),b}(Error),g={STACKED_FIELD_NOT_NUMBER:"STACKED_FIELD_NOT_NUMBER",NO_DATA:"NO_DATA",NOT_SUPPORTED_TYPE_CHART:"NOT_SUPPORTED_TYPE_CHART",UNKNOWN_UNIT_TYPE:"UNKNOWN_UNIT_TYPE",INVALID_LOG_DOMAIN:"INVALID_LOG_DOMAIN"};b.TauChartError=f,b.errorCodes=g},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0}),b.LayerLabels=void 0;var g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=c(3),i=d(h),j=c(12),k=c(1),l=c(13),m=c(14),n=c(15),o=c(16),p=function(a,b,c,d,e,f,g,h){return j.utilsDraw.isIntersect(a,e,b,f,c,g,d,h)};b.LayerLabels=function(){function a(b,c,d,e){var g=e.width,h=e.height,j=e.container;f(this,a),this.container=j,this.model=b,this.flip=c,this.w=g,this.h=h,this.guide=i["default"].defaults(d||{},{fontFamily:"Helvetica, Arial, sans-serif",fontWeight:"normal",fontSize:10,fontColor:"#000",position:[],tickFormat:null,tickFormatNullAlias:""})}return g(a,[{key:"draw",value:function(a){var b=this,c=this.model,d=this.guide,f=l.LayerLabelsModel.seed(c,{fontSize:d.fontSize,fontColor:d.fontColor,flip:b.flip,formatter:o.FormatterRegistry.get(d.tickFormat,d.tickFormatNullAlias),labelRectSize:function(a){return k.utilsDom.getLabelSize(a,d)},paddingKoeff:.4}),g={maxWidth:b.w,maxHeight:b.h,data:a.reduce(function(a,b){return a.concat(b)},[])},h=d.position.filter(function(a){return-1===a.indexOf("auto:")}),j=h.map(m.LayerLabelsRules.getRule).reduce(function(a,b){return l.LayerLabelsModel.compose(a,b(a,g))},f),n=function(a,b){for(var c=a.length-1,d=[],e=0;c>=e;e++){var f=0===e?e:e-1,g=e,h=e===c?e:e+1;d.push(b(a[f],a[g],a[h]))}return d},p=a.reduce(function(a,b){var c=b.map(function(a){return{data:a,x:j.x(a)+j.dx(a),y:j.y(a)+j.dy(a),w:j.w(a),h:j.h(a),hide:j.hide(a),extr:null,size:j.model.size(a),angle:j.angle(a),label:j.label(a),color:j.color(a)}});return a.text=a.text.concat(c),a.edges=a.edges.concat(n(c,function(a,b,c){return b.y===Math.max(b.y,a.y,c.y)?b.extr="min":b.y===Math.min(b.y,a.y,c.y)?b.extr="max":b.extr="norm",{x0:a.x,x1:b.x,y0:a.y,y1:b.y}})),a},{text:[],edges:[]});p.text=p.text.filter(function(a){return a.label}).map(function(a,b){return i["default"].extend(a,{i:b})});var q=this.guide.position.filter(function(a){return 0===a.indexOf("auto:avoid")});p=p.text.length>0&&q.length>0?this.autoPosition(p,q):p;var r=this.guide.position.reduce(function(a,b){return i["default"].extend(a,e({},b,!0))},{});p.text=r["auto:hide-on-label-edges-overlap"]?this.hideOnLabelEdgesOverlap(p.text,p.edges):p.text,p.text=r["auto:hide-on-label-label-overlap"]?this.hideOnLabelLabelOverlap(p.text):p.text;var s=p.text,t=function(a){return function(b,c){return s[c][a]}},u=t("x"),v=t("y"),w=t("angle"),x=t("color"),y=function(){this.style("fill",x).style("font-size",b.guide.fontSize).style("display",function(a,b){return s[b].hide?"none":null}).attr("text-anchor","middle").attr("transform",function(a,b){return"translate("+u(a,b)+","+v(a,b)+") rotate("+w(a,b)+")"}).text(t("label"))},z=this.container.selectAll(".i-role-label").data(s.map(function(a){return a.data}));return z.exit().remove(),z.call(y),z.enter().append("text").attr("class","i-role-label").call(y),z}},{key:"autoPosition",value:function(a,b){var c={"auto:avoid-label-label-overlap":function(a,b){var c=arguments.length<=2||void 0===arguments[2]?1:arguments[2];return function(b){var d=a[b].x,e=a[b].y-a[b].h+2,f=a[b].x+a[b].w,g=a[b].y+2;return a.reduce(function(a,h,i){var j=i!==b,k=h.x,l=h.y-h.h+2,m=h.x+h.w,n=h.y+2,o=Math.max(0,Math.min(m,f)-Math.max(k,d)),p=Math.max(0,Math.min(n,g)-Math.max(l,e)),q=o*p;return a+j*(q*c)},0)}},"auto:avoid-label-anchor-overlap":function(a,b){var c=arguments.length<=2||void 0===arguments[2]?1:arguments[2];return function(b){var d=a[b],e=d.x-d.w/2,f=d.x+d.w/2,g=d.y-d.h/2+2,h=d.y+d.h/2+2;return a.reduce(function(a,b){var d=b.x0-b.size/2,i=b.x0+b.size/2,j=b.y0-b.size/2,k=b.y0+b.size/2,l=Math.max(0,Math.min(i,f)-Math.max(d,e)),m=Math.max(0,Math.min(k,h)-Math.max(j,g)),n=l*m;return a+n*c},0)}},"auto:avoid-label-edges-overlap":function(a,b){var c=arguments.length<=2||void 0===arguments[2]?1:arguments[2];return function(d){var e=a[d],f=e.x-e.w/2,g=e.x+e.w/2,h=e.y-e.h/2,i=e.y+e.h/2;return b.reduce(function(a,b){var d=p(f,g,b.x0,b.x1,h,i,b.y0,b.y1),e=p(f,g,b.x0,b.x1,i,h,b.y0,b.y1);return a+(d+e)*c},0)}}},d=a.edges,e=a.text,f=e.map(function(a){var b=2+(a.size+a.w)/2,c=2+(a.size+a.h)/2,d={max:-Math.PI/2,min:Math.PI/2,norm:Math.random()>.5?Math.PI:0},e=d[a.extr];return{i:a.i,x0:a.x,y0:a.y,x:a.x+b*Math.cos(e),y:a.y+c*Math.sin(e),w:a.w,h:a.h,size:a.size,hide:a.hide,extr:a.extr}}).filter(function(a){return!a.hide}),g=this.w,h=this.h,i=new n.AnnealingSimulator({items:f,transactor:function(a){var b=a.x,c=a.y;return{modify:function(){var b=2+(a.size+a.w)/2,c=2+(a.size+a.h)/2,d={max:-Math.PI,min:Math.PI,norm:2*Math.PI},e=4,f=d[a.extr],i=f/e+Math.random()*(f*(e-2))/e,j=a.x0+b*Math.cos(i),k=a.y0+c*Math.sin(i);return a.x=Math.min(Math.max(j,a.w/2),g-a.w/2),a.y=Math.max(Math.min(k,h-a.h/2),a.h/2),a},revert:function(){return a.x=b,a.y=c,a}}},penalties:b.map(function(a){return c[a]}).filter(function(a){return a}).map(function(a){return a(e,d)})});return i.start(4),e=f.reduce(function(a,b){var c=a[b.i];return c.x=b.x,c.y=b.y,a},e),a}},{key:"hideOnLabelEdgesOverlap",value:function(a,b){function c(a,b){var c=a.x-a.w/2,d=a.x+a.w/2,e=a.y-a.h/2,f=a.y+a.h/2;return b.reduce(function(a,b){var g=p(c,d,b.x0,b.x1,e,f,b.y0,b.y1),h=p(c,d,b.x0,b.x1,f,e,b.y0,b.y1);return a+2*(g+h)},0)}return a.filter(function(a){return!a.hide}).forEach(function(a){c(a,b)>0&&(a.hide=!0)}),a}},{key:"hideOnLabelLabelOverlap",value:function(a){var b=function(a){var b=0;return{x0:a.x-a.w/2-b,x1:a.x+a.w/2+b,y0:a.y-a.h/2-b,y1:a.y+a.h/2+b}},c={min:0,max:1,norm:2},d={"min/min":function(a,b){return b.y-a.y},"max/max":function(a,b){return a.y-b.y},"min/max":function(){return-1},"min/norm":function(){return-1},"max/norm":function(){return-1},"norm/norm":function(a,b){return a.y-b.y}},e=function(a,e){var f=b(a),g=b(e),h=!a.hide&&!e.hide,i=h*Math.max(0,Math.min(g.x1,f.x1)-Math.max(f.x0,g.x0)),j=h*Math.max(0,Math.min(g.y1,f.y1)-Math.max(f.y0,g.y0));if(i*j>0){var k=[a,e];k.sort(function(a,b){return c[a.extr]-c[b.extr]});var l=d[k[0].extr+"/"+k[1].extr](k[0],k[1])<0?k[0]:k[1];l.hide=!0}};return a.filter(function(a){return!a.hide}).sort(function(a,b){return c[a.extr]-c[b.extr]}).forEach(function(b){a.forEach(function(a){b.i!==a.i&&e(b,a)})}),a}}]),a}()},function(a,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0});var c={translate:function(a,b){return"translate("+a+","+b+")"},rotate:function(a){return"rotate("+a+")"},getOrientation:function(a){return["bottom","top"].indexOf(a.toLowerCase())>=0?"h":"v"},isIntersect:function(a,b,c,d,e,f,g,h){var i,j,k,l;i=c-a,j=d-b,k=g-e,l=h-f;var m,n;return m=(-j*(a-e)+i*(b-f))/(-k*j+i*l),n=(k*(b-f)-l*(a-e))/(-k*j+i*l),m>=0&&1>=m&&n>=0&&1>=n}};b.utilsDraw=c},function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),e=function(a){return function(){return a}};b.LayerLabelsModel=function(){function a(b){c(this,a),this.model=b.model,this.x=b.x||e(0),this.y=b.y||e(0),this.dx=b.dx||e(0),this.dy=b.dy||e(0),this.w=b.w||e(0),this.h=b.h||e(0),this.hide=b.hide||e(!1),this.label=b.label||e(""),this.color=b.color||e(""),this.angle=b.angle||e(0)}return d(a,null,[{key:"seed",value:function(b,c){var d=c.fontColor,e=c.flip,f=c.formatter,g=c.labelRectSize,h=c.paddingKoeff,i=void 0===h?.5:h,j=e?b.yi:b.xi,k=e?b.xi:b.yi,l=function(a){return f(b.label(a))};return new a({model:b,x:function(a){return j(a)},y:function(a){return k(a)},dy:function(a){return g(l(a)).height*i},w:function(a){return g(l(a)).width},h:function(a){return g(l(a)).height},label:l,color:function(){return d},angle:function(){return 0}})}},{key:"compose",value:function(b){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return Object.keys(c).reduce(function(a,b){return a[b]=c[b],a},new a(b))}}]),a}()},function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),e={},f=b.LayerLabelsRules=function(){function a(){c(this,a)}return d(a,null,[{key:"regRule",value:function(a,b){return e[a]=b,this}},{key:"getRule",value:function(a){return e[a]}}]),a}(),g=function(a,b){return a.discrete||!a.discrete&&b[a.dim]>=0},h=function(a,b){return!a.discrete&&b[a.dim]<0},i=function(a){return function(b){return{dx:function(c){var d=b.model.scaleY;if("+"===a[2]&&!g(d,c))return b.dx(c);if("-"===a[2]&&!h(d,c))return b.dx(c);var e=a[1],f=a[0]===a[0].toUpperCase()?1:0;return b.dx(c)+e*(b.w(c)/2)+e*f*b.model.size(c)/2+2*e}}}},j=function(a){return function(b){return{dy:function(c){var d=b.model.scaleY;if("+"===a[2]&&!g(d,c))return b.dy(c);if("-"===a[2]&&!h(d,c))return b.dy(c);var e=a[1],f=a[0]===a[0].toUpperCase()?1:0;return b.dy(c)+(e*(b.h(c)/2)+e*f*b.model.size(c)/2)}}}};f.regRule("l",i(["l",-1,null])).regRule("L",i(["L",-1,null])).regRule("l+",i(["l",-1,"+"])).regRule("l-",i(["l",-1,"-"])).regRule("L+",i(["L",-1,"+"])).regRule("L-",i(["L",-1,"-"])).regRule("r",i(["r",1,null])).regRule("R",i(["R",1,null])).regRule("r+",i(["r",1,"+"])).regRule("r-",i(["r",1,"-"])).regRule("R+",i(["R",1,"+"])).regRule("R-",i(["R",1,"-"])).regRule("t",j(["t",-1,null])).regRule("T",j(["T",-1,null])).regRule("t+",j(["t",-1,"+"])).regRule("t-",j(["t",-1,"-"])).regRule("T+",j(["T",-1,"+"])).regRule("T-",j(["T",-1,"-"])).regRule("b",j(["b",1,null])).regRule("B",j(["B",1,null])).regRule("b+",j(["b",1,"+"])).regRule("b-",j(["b",1,"-"])).regRule("B+",j(["B",1,"+"])).regRule("B-",j(["B",1,"-"])).regRule("rotate-on-size-overflow",function(a,b){var c=b.data,d=function(b){return a.model.size(b)<a.w(b)},e=c.reduce(function(a,b){return a+(d(b)?1:0)},0),f=e/c.length>.5,g={};if(f){var h=.5;g={angle:function(){return-90},w:function(b){return a.h(b)},h:function(b){return a.w(b)},dx:function(b){return a.h(b)*h-2},dy:function(){return 0}}}return g}).regRule("keep-inside-or-hide-vertical",function(a){return{hide:function(b){if(a.model.size(b)<a.w(b))return!0;var c=Math.abs(a.model.y0(b)-a.model.yi(b));return c<a.h(b)?!0:a.hide(b)}}}).regRule("keep-inside-or-hide-horizontal",function(a){return{hide:function(b){if(a.model.size(b)<a.h(b))return!0;var c=Math.abs(a.model.y0(b)-a.model.yi(b));return c<a.w(b)?!0:a.hide(b)}}}).regRule("keep-within-diameter-or-top",function(a){return{dy:function(b){return a.model.size(b)/a.w(b)<1?a.dy(b)-a.h(b)/2-a.model.size(b)/2:a.dy(b)}}}).regRule("keep-in-box",function(a,b){var c=b.maxWidth,d=b.maxHeight;return{dx:function e(b){var e=a.dx(b),d=a.x(b)+e,f=a.w(b),g=d-f/2,h=d+f/2,i=0-g;if(i>0)return e+i;var j=h-c;return j>0?e-j:e},dy:function f(b){var f=a.dy(b),c=a.y(b)+f,e=a.h(b),g=c-e/2,h=c+e/2,i=0-g;if(i>0)return 0;var j=h-d;return j>0?f-j:f}}})},function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}();b.AnnealingSimulator=function(){function a(b){c(this,a),this.items=b.items,this.penalties=b.penalties,this.transactor=b.transactor,this.cooling_schedule=b.cooling_schedule||function(a,b,c){return a-b/c}}return d(a,[{key:"energy",value:function(a){return this.penalties.reduce(function(b,c){return b+c(a)},0)}},{key:"move",value:function(a){var b=Math.floor(Math.random()*this.items.length),c=this.transactor(this.items[b]),d=this.energy(b);this.items[b]=c.modify();var e=this.energy(b);Math.random()>=Math.exp(-(e-d)/a)&&(this.items[b]=c.revert())}},{key:"start",value:function(a){for(var b=this,c=1,d=1,e=0;a>e;e++)this.items.forEach(function(){return b.move(c)}),c=this.cooling_schedule(c,d,a)}}]),a}()},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(b,"__esModule",{value:!0}),b.FormatterRegistry=void 0;var e=c(2),f=d(e),g=c(3),h=d(g),i={"x-num-auto":function(a){var b=parseFloat(a.toFixed(2));return Math.abs(b)<1?b.toString():f["default"].format("s")(b)},percent:function(a){var b=parseFloat((100*a).toFixed(2));return b.toString()+"%"},day:f["default"].time.format("%d-%b-%Y"),"day-short":f["default"].time.format("%d-%b"),week:f["default"].time.format("%d-%b-%Y"),"week-short":f["default"].time.format("%d-%b"),month:function(a){var b=new Date(a),c=b.getMonth(),d=0===c?"%B, %Y":"%B";return f["default"].time.format(d)(a)},"month-short":function(a){var b=new Date(a),c=b.getMonth(),d=0===c?"%b '%y":"%b";return f["default"].time.format(d)(a)},"month-year":f["default"].time.format("%B, %Y"),quarter:function(a){var b=new Date(a),c=b.getMonth(),d=(c-c%3)/3;return"Q"+(d+1)+" "+b.getFullYear()},year:f["default"].time.format("%Y"),"x-time-auto":null},j={get:function(a,b){var c=b||"",d=function(a){return(null===a||"undefined"==typeof a?c:a).toString()},e=i.hasOwnProperty(a),g=e?i[a]:d;return e&&(g=i[a]),!e&&a&&(g=function(b){var c=h["default"].isDate(b)?f["default"].time.format(a):f["default"].format(a);return c(b)}),e||a||(g=d),g},add:function(a,b){i[a]=b}};b.FormatterRegistry=j},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(b,"__esModule",{value:!0}),b.cutText=b.wrapText=b.d3_decorator_avoid_labels_collisions=b.d3_decorator_prettify_categorical_axis_ticks=b.d3_decorator_fix_horizontal_axis_ticks_overflow=b.d3_decorator_fix_axis_bottom_line=b.d3_decorator_prettify_axis_label=b.d3_decorator_wrap_tick_label=b.d3_animationInterceptor=void 0;var e=c(4),f=c(12),g=c(3),h=d(g),i=c(2),j=d(i),k=h["default"].memoize(function(a){return a.node().getComputedTextLength()},function(a){return a.node().textContent.length}),l=function(a,b,c){c=c||k,a.each(function(){var a=j["default"].select(this.parentNode),d=a.data()[0],e=b(d),f=j["default"].select(this),g=f.text().split(/\s+/),h=!1,i=g.reduce(function(a,b,d){if(h)return a;var g=d>0?[a,b].join(" "):b,i=c(f.text(g));if(e>i)a=g;else{var j=Math.floor(e/i*g.length);a=g.substr(0,j-4)+"...",h=!0}return a},"");f.text(i)})},m=function(a,b,c,d,e,f){f=f||k;var g=function(a,b,c,d,e,f,g){var h=g*c+f;return a.append("tspan").attr("x",d).attr("y",e).attr("dy",h+"em").text(b)};a.each(function(){var a=j["default"].select(this.parentNode),h=a.data()[0],i=b(h),k=j["default"].select(this),l=k.text().split(/\s+/),m=1.1,n=k.attr("x"),o=k.attr("y"),p=parseFloat(k.attr("dy"));k.text(null);var q=g(k,null,m,n,o,p,0),r=!1,s=l.length-1,t=l.reduce(function(a,b,d){if(r)return a;var e=a.length===c||d===s,g=a[a.length-1],h=""!==g?g+" "+b:b,j=f(q.text(h)),k=j>i;if(k&&e){var l=Math.floor(i/j*h.length);a[a.length-1]=h.substr(0,l-4)+"...",r=!0}return k&&!e&&a.push(b),k||(a[a.length-1]=h),a},[""]).filter(function(a){return a.length>0});o=e?-1*(t.length-1)*Math.floor(.5*d):o,t.forEach(function(a,b){return g(k,a,m,n,o,p,b)}),q.remove()})},n=function(a,b,c){a.selectAll(".tick line").empty()||a.selectAll(".tick")[0].forEach(function(a){var d=j["default"].select(a),e=d.data()[0],f=b(e),g=c?f:0,h=c?0:f;d.attr("transform","translate("+g+","+h+")");var i=.5*b.stepSize(e),k=c?"x":"y",l=c?i:-i;d.select("line").attr(k+"1",l).attr(k+"2",l)})},o=function(a){var b=a.selectAll(".tick")[0];if(!(b.length<2)){var c=parseFloat(b[0].attributes.transform.value.replace("translate(","")),d=parseFloat(b[1].attributes.transform.value.replace("translate(","")),e=d-c,f=0,g=-1,h=a.selectAll(".tick text")[0];if(h.forEach(function(a,b){var c=a.textContent||"",d=c.length;d>f&&(f=d,g=b)}),g>=0){var i=h[g].getBoundingClientRect();e-i.width<8&&a.classed({"graphical-report__d3-time-overflown":!0})}}},p=function(a,b,c){var d=a.selectAll(".tick line");if(!d.empty()){var e=-1;if(c)e=0;else{var g=b/d[0].length,h=g/2;e=-h}var i=a.select(".tick").node().cloneNode(!0);a.append(function(){return i}).attr("transform",f.utilsDraw.translate(0,b-e))}},q=function(a,b,c){var d=c?1:-1,e=a.append("text").attr("transform",f.utilsDraw.rotate(b.rotate)).attr("class",b.cssClass).attr("x",d*b.size*.5).attr("y",d*b.padding).style("text-anchor",b.textAnchor),g=" → ",h=b.text.split(g),i=h.length;if(h.forEach(function(a,b){e.append("tspan").attr("class","label-token label-token-"+b).text(a),i-1>b&&e.append("tspan").attr("class","label-token-delimiter label-token-delimiter-"+b).text(g)}),"right"===b.dock){var j=a.selectAll("path.domain").node().getBBox();e.attr("x",c?j.width:0)}else if("left"===b.dock){var k=a.selectAll("path.domain").node().getBBox();e.attr("x",c?0:-k.height)}},r=function(a,b,c,d){var g=e.utils.normalizeAngle(b.rotate),h=a.selectAll(".tick text");h.attr({transform:f.utilsDraw.rotate(g)}).style("text-anchor",b.textAnchor);var i=Math.abs(g/90);if(i%2>0){var j=180>g?1:-1,n=c?.5:-2,o=n*parseFloat(h.attr("dy")),p={x:9*j,y:0,dx:c?null:o+"em",dy:o+"em"};h.attr(p)}var q=function(a){return Math.max(d.stepSize(a),b.tickFormatWordWrapLimit)};b.tickFormatWordWrap?h.call(m,q,b.tickFormatWordWrapLines,b.tickFontHeight,!c):h.call(l,q,k)},s=function(a,b){var c=11,d=b?-10:20,e=b?0:1,f=b?1:-1,g=[];a.selectAll(".tick").each(function(){var a=j["default"].select(this),b=a.attr("transform").replace("translate(","").replace(" ",",").split(",")[e],c=f*parseFloat(b),d=a.selectAll("text"),h=d.node().getBBox().width,i=h/2,k=c-i,l=c+i;g.push({c:c,s:k,e:l,l:0,textRef:d,tickRef:a})});var h=function(a,b){return a.map(function(a,c,d){return b(d[c-1]||{e:-(1/0),s:-(1/0),l:0},a,d[c+1]||{e:1/0,s:1/0,l:0})})},i=function(a,b){var c={"[T][1]":-1,"[T][-1]":0,"[T][0]":1,"[F][0]":-1},d="["+b.toString().toUpperCase().charAt(0)+"]["+a+"]";return c.hasOwnProperty(d)?c[d]:0},k=g.sort(function(a,b){return a.c-b.c});h(k,function(a,e,f){var g=a.e>e.s,h=f.s<e.e;if(g||h){e.l=i(a.l,g);var j=e.textRef[0].length,k=e.textRef.text();j>1&&(k=k.replace(/([\.]*$)/gi,"")+"...");var l=parseFloat(e.textRef.attr("y")),m=l+e.l*c;e.textRef.text(function(a,b){return 0===b?k:""}).attr("y",m);var n={x1:0,x2:0,y1:m+(b?-1:5),y2:d};b||(n.transform="rotate(-90)"),e.tickRef.append("line").attr("class","label-ref").attr(n)}return e})},t=function(a,b,c,d){var e=d||h["default"].identity,f=function(){e(this)};return function(){var d=this;return b&&(d=d.attr(h["default"].defaults(b,c))),a>0&&(d=d.transition().duration(a)),d=d.attr(c),a>0?d.each("end",f):d.each(f),d}};b.d3_animationInterceptor=t,b.d3_decorator_wrap_tick_label=r,b.d3_decorator_prettify_axis_label=q,b.d3_decorator_fix_axis_bottom_line=p,b.d3_decorator_fix_horizontal_axis_ticks_overflow=o,b.d3_decorator_prettify_categorical_axis_ticks=n,b.d3_decorator_avoid_labels_collisions=s,b.wrapText=m,b.cutText=l},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.Line=void 0;var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=function r(a,b,c){null===a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){var e=Object.getPrototypeOf(a);return null===e?void 0:r(e,b,c)}if("value"in d)return d.value;var f=d.get;if(void 0!==f)return f.call(c)},j=c(6),k=c(19),l=c(9),m=c(20),n=c(3),o=d(n),p=c(2),q=d(p);b.Line=function(a){function b(a){e(this,b);var c=f(this,Object.getPrototypeOf(b).call(this,a)),d=c.config.stack;return c.config.guide=o["default"].defaults(c.config.guide||{},{interpolate:"linear"}),c.decorators=[l.CartesianGrammar.decorator_orientation,l.CartesianGrammar.decorator_groundY0,l.CartesianGrammar.decorator_group,!d&&l.CartesianGrammar.decorator_groupOrderByAvg,d&&l.CartesianGrammar.decorator_groupOrderByColor,d&&l.CartesianGrammar.decorator_stack,l.CartesianGrammar.decorator_dynamic_size,l.CartesianGrammar.decorator_color,l.CartesianGrammar.decorator_label,a.adjustPhase&&l.CartesianGrammar.adjustStaticSizeScale,a.adjustPhase&&d&&l.CartesianGrammar.adjustYScale].concat(a.transformModel||[]),c}return g(b,a),h(b,[{key:"buildModel",value:function(a){var c=this.config.options.width,d=this.config.options.height,e=function(a,b,c){var d=1e3,e=Math.round(a*d)/d;return b>e?b:e>c?c:e},f=i(Object.getPrototypeOf(b.prototype),"buildModel",this).call(this,a);f.matchRowInCoordinates=function(a,b){var c=b.x,d=b.y,e=function(a){return function(b,c){return b[a]-c[a]}},g=function(a,b,c,d){return Math.sqrt(Math.pow(a-b,2)+Math.pow(c-d,2))},h=a.map(function(a){var b=f.x(a),e=f.y(a);return{x:b,y:e,dist:g(c,b,d,e),data:a}});h.push(h[0]);var i=o["default"].times(h.length-1,function(a){return a}).map(function(a){var b=h[a],c=h[a+1],d=g(c.x,b.x,c.y,b.y),e=b.dist,f=c.dist,i=Math.abs(d-(e+f));return[i,b,c]}).sort(e("0"))[0].slice(1);return i.sort(e("dist"))[0].data};var g=this.config.guide,h=this.config.options,k=this.isEmptySize?g.widthCssClass||(0,m.getLineClassesByWidth)(h.width):"",l=(0,m.getLineClassesByCount)(a.model.scaleColor.domain().length),n=this.isEmptySize?"line":"area",p=""+j.CSS_PREFIX+n+" "+n+" i-role-path "+k+" "+l+" "+g.cssClass+" ",r=q["default"].svg.line().interpolate(g.interpolate).x(f.x).y(f.y);f.groupAttributes={"class":function(a){return p+" "+f["class"](a[0])+" frame"}},f.pathElement=this.isEmptySize?"path":"polygon";var s=function(a,b,f){return function(g){var h=function(c){return[a(c),b(c)]},i=g.reduce(function(a,b,g,i){var j=i[g-1],k=i[g+1],l=h(b),m=j?h(j):null,n=k?h(k):null,o=f(b),p=j?Math.PI-Math.atan2(l[1]-m[1],l[0]-m[0]):Math.PI,q=k?Math.atan2(l[1]-n[1],n[0]-l[0]):0,r=p-q;if(0===r)return a;var s=o/2/Math.sin(r/2),t=q+r/2,u=t-Math.PI,v=s*Math.cos(t),w=s*Math.sin(t),x=s*Math.cos(u),y=s*Math.sin(u),z=[e(l[0]+v,0,c),e(l[1]-w,0,d)],A=[e(l[0]+x,0,c),e(l[1]-y,0,d)];return a.dir.push(z),a.rev.push(A),a},{dir:[],rev:[]});return[].concat(i.dir).concat(i.rev.reverse()).join(" ")}},t=[],u=o["default"].memoize(function(a,b){var c=q["default"].select(a.parentNode).append("path").datum(b).attr({d:r,opacity:0}),d=c.node().getTotalLength();return c.remove(),{prev:a.hasAttribute("d")?a.getTotalLength():0,next:d}},function(a){var b=t.indexOf(a);return 0>b&&(b=t.push(a)-1),b}),v=this.isEmptySize?{d:function(a){return u(this,a),r(a)},"stroke-dasharray":function(a){var b=u(this,a),c=b.next;return c+" "+c},"stroke-dashoffset":function(a){var b=u(this,a),c=b.prev,d=b.next;return d-c}}:{points:s(f.x,f.y,function(){return 0})},w=this.isEmptySize?{d:r,stroke:function(a){return f.color(a[0])},"class":"i-role-datum","stroke-dashoffset":0}:{fill:function(a){return f.color(a[0])},points:s(f.x,f.y,f.size)};return f.pathAttributesUpdateInit=this.isEmptySize?f.gog.scaleX.discrete?null:v:null,f.pathAttributesUpdateDone=w,f.pathAttributesEnterInit=v,f.pathAttributesEnterDone=w,f.afterPathUpdate=function(a){q["default"].select(a).attr({"stroke-dasharray":null,"stroke-dashoffset":null})},f}}]),b}(k.BasePath)},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.BasePath=void 0;var i=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),j=c(7),k=c(9),l=c(11),m=c(6),n=c(17),o=c(3),p=d(o),q=c(2),r=d(q);b.BasePath=function(a){function b(a){f(this,b);var c=g(this,Object.getPrototypeOf(b).call(this,a));if(c.config=a,c.config.guide=p["default"].defaults(c.config.guide||{},{animationSpeed:0,cssClass:"",widthCssClass:"",showAnchors:!0,anchorSize:.1,color:{},label:{}}),c.config.guide.label=p["default"].defaults(c.config.guide.label,{fontSize:11,position:["auto:avoid-label-label-overlap","auto:avoid-label-anchor-overlap","auto:avoid-label-edges-overlap","auto:hide-on-label-label-overlap","auto:hide-on-label-edges-overlap","keep-in-box"]}),c.config.guide.color=p["default"].defaults(c.config.guide.color||{},{fill:null}),c.config.guide.size=p["default"].defaults(c.config.guide.size||{},{defMinSize:2,defMaxSize:c.isEmptySize?6:40}),c.decorators=[],c.on("highlight",function(a,b){return c.highlight(b)}),c.on("highlight-data-points",function(a,b){return c.highlightDataPoints(b)}),c.config.guide.showAnchors){var d=function(a,b){return a.fire("highlight-data-points",function(a){return a===b.data})},e=function(a){return a.fire("highlight-data-points",function(){return!1})};c.on("mouseover",d),c.on("mousemove",d),c.on("mouseout",e)}return c}return h(b,a),i(b,[{key:"createScales",value:function(a){var b=this.config;return this.xScale=a("pos",b.x,[0,b.options.width]),this.yScale=a("pos",b.y,[b.options.height,0]),this.size=a("size",b.size,{}),this.color=a("color",b.color,{}),this.label=a("label",b.label,{}),this.split=a("split",b.split,{}),this.identity=a("identity",b.identity,{}),this.regScale("x",this.xScale).regScale("y",this.yScale).regScale("size",this.size).regScale("color",this.color).regScale("split",this.split).regScale("label",this.label)}},{key:"buildModel",value:function(a){var b="i-role-datum",c=m.CSS_PREFIX+"dot-line dot-line i-role-dot "+b+" "+m.CSS_PREFIX+"dot ",d=1e4,e={gog:a.model,x:a.x,y:a.y,x0:a.x0,y0:a.y0,size:a.size,group:a.group,order:a.order,color:a.color,"class":a["class"],matchRowInCoordinates:function(){throw"Not implemented"},groupAttributes:{},pathAttributesUpdateInit:{},pathAttributesUpdateDone:{},pathAttributesEnterInit:{},pathAttributesEnterDone:{},pathElement:null,dotAttributes:{r:function(a){return Math.round(d*e.size(a)/2)/d},cx:function(a){return e.x(a)},cy:function(a){return e.y(a)},fill:function(a){return e.color(a)},"class":function(a){return c+" "+e["class"](a)}},dotAttributesDefault:{r:0,cy:function(a){return e.y0(a)}}};return e}},{key:"getDistance",value:function(a,b,c,d){return Math.sqrt(Math.pow(a-c,2)+Math.pow(b-d,2))}},{key:"walkFrames",value:function(a){var b={isHorizontal:this.config.flip,defMin:this.config.guide.size.defMinSize,defMax:this.config.guide.size.defMaxSize,minLimit:this.config.guide.size.minSize,maxLimit:this.config.guide.size.maxSize,dataSource:a.reduce(function(a,b){return a.concat(b.part())},[])};return this.decorators.filter(function(a){return a}).reduce(function(a,c){return k.CartesianGrammar.compose(a,c(a,b))},new k.CartesianGrammar({scaleX:this.xScale,scaleY:this.yScale,scaleSize:this.size,scaleLabel:this.label,scaleColor:this.color,scaleSplit:this.split,scaleIdentity:this.identity}))}},{key:"drawFrames",value:function(a){var b=this,c=this.config.guide,d=this.config.options,e=a.reduce(function(a,b){return a.concat(b.part())},[]),f=this.walkFrames(a);this.screenModel=f.toScreenModel();var g=this.buildModel(this.screenModel),h=n.d3_animationInterceptor,i=function(){this.attr(g.groupAttributes);var a=this.selectAll("circle").data(function(a){return a.length<=1?a:[]},b.screenModel.id);a.exit().call(h(c.animationSpeed,null,{r:0},function(a){return r["default"].select(a).remove()})),a.call(h(c.animationSpeed,null,g.dotAttributes)),a.enter().append("circle").call(h(c.animationSpeed,g.dotAttributesDefault,g.dotAttributes)),b.subscribe(a,function(a){return a;
  });var d=this.selectAll(g.pathElement).data(function(a){return a.length>1?[a]:[]},function(a){return a.map(b.screenModel.id).join("-")});if(d.exit().remove(),d.call(h(c.animationSpeed,g.pathAttributesUpdateInit,g.pathAttributesUpdateDone,g.afterPathUpdate)),d.enter().append(g.pathElement).call(h(c.animationSpeed,g.pathAttributesEnterInit,g.pathAttributesEnterDone,g.afterPathUpdate)),b.subscribe(d,function(a){var b=r["default"].mouse(this);return g.matchRowInCoordinates(a.filter(k.CartesianGrammar.isNonSyntheticRecord),{x:b[0],y:b[1]})}),c.showAnchors){var e={r:function(){return c.anchorSize},cx:function(a){return g.x(a)},cy:function(a){return g.y(a)},opacity:0,"class":"i-data-anchor"},f=this.selectAll(".i-data-anchor").data(function(a){return a.filter(k.CartesianGrammar.isNonSyntheticRecord)});f.exit().remove(),f.call(h(c.animationSpeed,null,e)),f.enter().append("circle").call(h(c.animationSpeed,{r:0},e)),b.subscribe(f)}},j=this.config.stack?k.CartesianGrammar.toStackedFibers(e,f):k.CartesianGrammar.toFibers(e,f),m=d.container.selectAll(".frame").data(j);m.exit().remove(),m.call(i),m.enter().append("g").call(i);var o=k.CartesianGrammar.toFibers(e,f);b.subscribe(new l.LayerLabels(f,this.config.flip,this.config.guide.label,d).draw(o))}},{key:"highlight",value:function(a){var b,c,d,f=this.config.options.container,g="graphical-report__highlighted",h="graphical-report__dimmed";f.selectAll(".i-role-path").classed((b={},e(b,g,function(b){return a(b.filter(k.CartesianGrammar.isNonSyntheticRecord)[0])===!0}),e(b,h,function(b){return a(b.filter(k.CartesianGrammar.isNonSyntheticRecord)[0])===!1}),b)),f.selectAll(".i-role-dot").classed((c={},e(c,g,function(b){return a(b)===!0}),e(c,h,function(b){return a(b)===!1}),c)),f.selectAll(".i-role-label").classed((d={},e(d,g,function(b){return a(b)===!0}),e(d,h,function(b){return a(b)===!1}),d))}},{key:"highlightDataPoints",value:function(a){var b=this,c="i-data-anchor";this.config.options.container.selectAll("."+c).attr({r:function(c){return a(c)?b.screenModel.size(c)/2:b.config.guide.anchorSize},opacity:function(b){return a(b)?1:0},fill:function(a){return b.screenModel.color(a)},"class":function(a){return c+" "+b.screenModel["class"](a)}})}}]),b}(j.Element)},function(a,b,c){"use strict";function d(a){return h[a-1]||h[4]}function e(a){var b=0;return a>=160&&320>a?b=1:a>=320&&480>a?b=2:a>=480&&640>a?b=3:a>=640&&(b=4),i[b]}Object.defineProperty(b,"__esModule",{value:!0}),b.getLineClassesByCount=b.getLineClassesByWidth=void 0;var f=c(6),g=[1,2,3,4,5],h=g.map(function(a){return f.CSS_PREFIX+"line-opacity-"+a}),i=g.map(function(a){return f.CSS_PREFIX+"line-width-"+a});b.getLineClassesByWidth=e,b.getLineClassesByCount=d},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.Area=void 0;var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=function p(a,b,c){null===a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){var e=Object.getPrototypeOf(a);return null===e?void 0:p(e,b,c)}if("value"in d)return d.value;var f=d.get;if(void 0!==f)return f.call(c)},j=c(2),k=d(j),l=c(6),m=c(19),n=c(20),o=c(9);b.Area=function(a){function b(a){e(this,b);var c=f(this,Object.getPrototypeOf(b).call(this,a)),d=c.config.stack;return c.decorators=[o.CartesianGrammar.decorator_orientation,o.CartesianGrammar.decorator_groundY0,o.CartesianGrammar.decorator_group,!d&&o.CartesianGrammar.decorator_groupOrderByAvg,d&&o.CartesianGrammar.decorator_groupOrderByColor,d&&o.CartesianGrammar.decorator_stack,o.CartesianGrammar.decorator_dynamic_size,o.CartesianGrammar.decorator_color,o.CartesianGrammar.decorator_label,a.adjustPhase&&o.CartesianGrammar.adjustStaticSizeScale,a.adjustPhase&&d&&o.CartesianGrammar.adjustYScale].concat(a.transformModel||[]),c}return g(b,a),h(b,[{key:"buildModel",value:function(a){var c=this,d=i(Object.getPrototypeOf(b.prototype),"buildModel",this).call(this,a);d.matchRowInCoordinates=function(a,b){var e=b.x,f=b.y,g=a.map(function(a){var b=d.x(a),g=d.y(a);return{x:b,y:g,dist:c.getDistance(e,f,b,g),data:a}}).sort(function(a,b){return a.dist-b.dist})[0];return g.data};var e=this.config.guide,f=(0,n.getLineClassesByCount)(a.model.scaleColor.domain().length),g=l.CSS_PREFIX+"area area i-role-path "+f+" "+e.cssClass+" ";d.groupAttributes={"class":function(a){return g+" "+d["class"](a[0])+" frame"}};var h=function(a,b,c,d){return function(e){var f=e.reduce(function(e,f){return e.dir.push([a(f),b(f)]),e.rev.push([c(f),d(f)]),e},{dir:[],rev:[]});return[].concat(f.dir).concat(f.rev.reverse()).join(" ")}},j={points:h(d.x,d.y0,d.x0,d.y0)},m={fill:function(a){return d.color(a[0])},stroke:function(a){var b=d.color(a[0]);return b.length>0&&(b=k["default"].rgb(b).darker(1)),b},points:h(d.x,d.y,d.x0,d.y0)};return d.pathAttributesUpdateInit=null,d.pathAttributesUpdateDone=m,d.pathAttributesEnterInit=j,d.pathAttributesEnterDone=m,d.pathElement="polygon",d}},{key:"getDistance",value:function(a,b,c,d){return this.config.flip?Math.abs(b-d):Math.abs(a-c)}}]),b}(m.BasePath)},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.Interval=void 0;var i=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),j=c(6),k=c(7),l=c(9),m=c(11),n=c(17),o=c(3),p=d(o),q=c(2),r=d(q);b.Interval=function(a){function b(a){f(this,b);var c=g(this,Object.getPrototypeOf(b).call(this,a));c.config=a;var d=c.config.stack;c.config.guide=c.config.guide||{},c.config.guide=p["default"].defaults(c.config.guide,{animationSpeed:0,prettify:!0,enableColorToBarPosition:!d}),c.config.guide.size=p["default"].defaults(c.config.guide.size||{},{enableDistributeEvenly:!0,defMinSize:c.config.guide.prettify?3:0,defMaxSize:c.config.guide.prettify?40:Number.MAX_VALUE}),c.config.guide.label=p["default"].defaults(c.config.guide.label||{},{position:c.config.flip?["r-","l+","keep-inside-or-hide-horizontal"]:d?["rotate-on-size-overflow","t-","b+","keep-inside-or-hide-vertical","auto:hide-on-label-label-overlap"]:["rotate-on-size-overflow","t+","b-","keep-inside-or-hide-vertical","auto:hide-on-label-label-overlap"]}),c.baseCssClass="i-role-element i-role-datum bar "+j.CSS_PREFIX+"bar",c.defMin=a.guide.size.defMinSize,c.defMax=a.guide.size.defMaxSize,c.minLimit=a.guide.size.minSize,c.maxLimit=a.guide.size.maxSize;var e=c.config.guide.enableColorToBarPosition,h=c.config.guide.size.enableDistributeEvenly;return c.decorators=[l.CartesianGrammar.decorator_orientation,l.CartesianGrammar.decorator_groundY0,l.CartesianGrammar.decorator_group,l.CartesianGrammar.decorator_groupOrderByColor,d&&l.CartesianGrammar.decorator_stack,e&&l.CartesianGrammar.decorator_positioningByColor,l.CartesianGrammar.decorator_dynamic_size,l.CartesianGrammar.decorator_color,l.CartesianGrammar.decorator_label,a.adjustPhase&&h&&l.CartesianGrammar.decorator_size_distribute_evenly,a.adjustPhase&&d&&l.CartesianGrammar.adjustYScale].concat(a.transformModel||[]),c.on("highlight",function(a,b){return c.highlight(b)}),c}return h(b,a),i(b,[{key:"createScales",value:function(a){var b=this.config;return this.xScale=a("pos",b.x,[0,b.options.width]),this.yScale=a("pos",b.y,[b.options.height,0]),this.size=a("size",b.size,{}),this.color=a("color",b.color,{}),this.split=a("split",b.split,{}),this.label=a("label",b.label,{}),this.identity=a("identity",b.identity,{}),this.regScale("x",this.xScale).regScale("y",this.yScale).regScale("size",this.size).regScale("color",this.color).regScale("split",this.split).regScale("label",this.label)}},{key:"walkFrames",value:function(a){var b={isHorizontal:this.config.flip,minLimit:this.minLimit,maxLimit:this.maxLimit,defMin:this.defMin,defMax:this.defMax,dataSource:this.convertFramesToData(a)};return this.decorators.filter(function(a){return a}).reduce(function(a,c){return l.CartesianGrammar.compose(a,c(a,b))},new l.CartesianGrammar({scaleX:this.xScale,scaleY:this.yScale,scaleSize:this.size,scaleLabel:this.label,scaleColor:this.color,scaleSplit:this.split,scaleIdentity:this.identity}))}},{key:"convertFramesToData",value:function(a){return a.reduce(function(a,b){return a.concat(b.part())},[])}},{key:"drawFrames",value:function(a){var b=this,c=this.config.options,d=this.config,f=d.guide.prettify,g=this.baseCssClass,h=this.walkFrames(a);b.screenModel=h.toScreenModel();var i=this.buildModel(b.screenModel,{prettify:f,minBarH:1,minBarW:1,baseCssClass:g}),j=n.d3_animationInterceptor,k=d.flip?"y":"x",o=d.flip?"x":"y",p=d.flip?"width":"height",q=d.flip?"height":"width",s=function(){var a,c;this.attr("class","frame i-role-bar-group");var f=this.selectAll(".bar").data(function(a){return a},b.screenModel.id);f.exit().call(j(d.guide.animationSpeed,null,(a={},e(a,k,function(){var a=r["default"].select(this),b=a.attr(k)-0,c=a.attr(q)-0;return b+c/2}),e(a,o,function(){var a=r["default"].select(this),b=a.attr(o)-0,c=a.attr(p)-0;return b+c/2}),e(a,q,0),e(a,p,0),a),function(a){return r["default"].select(a).remove()})),f.call(j(d.guide.animationSpeed,null,i)),f.enter().append("rect").call(j(d.guide.animationSpeed,(c={},e(c,o,b.screenModel[o+"0"]),e(c,p,0),c),i)),b.subscribe(f)},t=this.convertFramesToData(a),u=l.CartesianGrammar.toFibers(t,h),v=c.container.selectAll(".frame").data(u);v.exit().remove(),v.call(s),v.enter().append("g").call(s),b.subscribe(new m.LayerLabels(h,d.flip,d.guide.label,c).draw(u))}},{key:"buildModel",value:function(a,b){var c,d=b.prettify,e=b.minBarH,f=b.minBarW,g=b.baseCssClass,h=a.flip,i=function(b){var c=a.size(b);return d&&(c=Math.max(f,c)),c},j=function(b){return b[a.model.scaleY.dim]};return h?!function(){var b=function(b){return Math.abs(a.x(b)-a.x0(b))};c={y:function(b){return a.y(b)-.5*i(b)},x:function f(c){var f=Math.min(a.x0(c),a.x(c));if(d){var g=b(c),h=j(c),i=0;0===h&&(i=0),h>0&&(i=g),0>h&&(i=0-e);var k=e>g;return k?f+i:f}return f},height:function(a){return i(a)},width:function(a){var c=b(a);return d?0===j(a)?c:Math.max(e,c):c}}}():!function(){var b=function(b){return Math.abs(a.y(b)-a.y0(b))};c={x:function(b){return a.x(b)-.5*i(b)},y:function f(c){var f=Math.min(a.y0(c),a.y(c));if(d){var g=b(c),h=e>g;f=h&&j(c)>0?f-e:f}return f},width:function(a){return i(a)},height:function(a){var c=b(a);return d&&(c=0===j(a)?c:Math.max(e,c)),c}}}(),p["default"].extend(c,{"class":function(b){return g+" "+a["class"](b)},fill:function(b){return a.color(b)}})}},{key:"highlight",value:function(a){var b,c,d="graphical-report__highlighted",f="graphical-report__dimmed",g=this.config.options.container;g.selectAll(".bar").classed((b={},e(b,d,function(b){return a(b)===!0}),e(b,f,function(b){return a(b)===!1}),b)),g.selectAll(".i-role-label").classed((c={},e(c,d,function(b){return a(b)===!0}),e(c,f,function(b){return a(b)===!1}),c))}}]),b}(k.Element)},function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.StackedInterval=void 0;var g=c(22);b.StackedInterval=function(a){function b(a){return d(this,b),a.stack=!0,e(this,Object.getPrototypeOf(b).call(this,a))}return f(b,a),b}(g.Interval)},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.GPL=void 0;var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=c(8),j=c(4),k=c(25),l=c(27),m=c(3),n=d(m),o=function(a){return n["default"].isDate(a)?a.getTime():a};b.GPL=function(a){function b(a,c,d){e(this,b);var g=f(this,Object.getPrototypeOf(b).call(this));return n["default"].defaults(a.scales,{size_null:{type:"size",source:"?"},split_null:{type:"value",source:"?"},label_null:{type:"value",source:"?"},color_null:{type:"color",source:"?"},identity_null:{type:"identity",source:"?"},"size:default":{type:"size",source:"?"},"color:default":{type:"color",source:"?"},"split:default":{type:"value",source:"?"},"label:default":{type:"value",source:"?"},"identity:default":{type:"identity",source:"?"}}),a.settings=a.settings||{},g.config=a,g.sources=a.sources,g.scales=a.scales,g.unitSet=d,g.scalesHub=c,g.transformations=n["default"].extend(a.transformations||{},{where:function(a,b){var c=n["default"].map(b,function(a,b){return function(c){return o(c[b])===a}});return(0,n["default"])(a).filter(function(a){return n["default"].every(c,function(b){return b(a)})})}}),g}return g(b,a),h(b,[{key:"unfoldStructure",value:function(){return this.root=this._expandUnitsStructure(this.config.unit),this.config}},{key:"getDrawScenario",value:function(a){var b=this;return this._flattenDrawScenario(a,function(a,c,d){var e=c.expression.inherit===!1?null:d,f=b.unitSet.create(c.type,n["default"].extend({adjustPhase:!0},{fnCreateScale:b._createFrameScalesFactoryMethod(e)},c,{options:a.allocateRect(d.key)}));return f.init(),f}),Object.keys(this.scales).forEach(function(a){return b.scalesHub.createScaleInfo(b.scales[a]).commit()}),this._flattenDrawScenario(a,function(a,c,d){var e=c.expression.inherit===!1?null:d,f=b.unitSet.create(c.type,n["default"].extend({fnCreateScale:b._createFrameScalesFactoryMethod(e)},c,{options:a.allocateRect(d.key)}));return f.init(),f.parentUnit=a,f})}},{key:"_flattenDrawScenario",value:function(a,c){var d=0,e=[],f=[a],g=function(a){return f.unshift(a)},h=function(){return f.shift()},i=function(){return f[0]};return b.traverseSpec({unit:this.root},function(a,b,f){a.uid=++d,a.guide=j.utils.clone(a.guide);var h=c(i(),a,f);e.push(h),0===a.type.indexOf("COORDS.")&&g(h)},function(a){0===a.type.indexOf("COORDS.")&&h()},null,this._datify({source:this.root.expression.source,pipe:[]})),e}},{key:"_expandUnitsStructure",value:function(a){var b=this,c=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],d=this;if(a.expression.operator===!1)a.frames=a.frames.map(function(a){return d._datify(a)});else{var e=this._parseExpression(a.expression,c);a.transformation=a.transformation||[],a.frames=e.exec().map(function(b){var f=e.inherit?c:[],g=f.concat([{type:"where",args:b}]).concat(a.transformation);return d._datify({key:b,pipe:g,source:e.source,units:a.units?a.units.map(function(a){var b=j.utils.clone(a);return b.guide=a.guide,b}):[]})})}return a.frames.forEach(function(a){return a.units.forEach(function(c){return b._expandUnitsStructure(c,a.pipe)})}),a}},{key:"_createFrameScalesFactoryMethod",value:function(a){var b=this;return function(c,d,e){var f=d||c+":default";return b.scalesHub.createScaleInfo(b.scales[f],a).create(e)}}},{key:"_datify",value:function(a){return new l.DataFrame(a,this.sources[a.source].data,this.transformations)}},{key:"_parseExpression",value:function(a,b){var c=this,d=a.operator||"none",e=a.source,f=a.inherit!==!1,g=a.params,h={source:e,pipe:f?b:[]},i=function(){return c._datify(h).part()},j=k.FramesAlgebra[d];if(!j)throw new Error(d+" operator is not supported");return{source:e,inherit:f,func:j,args:g,exec:function(){return j.apply(null,[i].concat(g))}}}}],[{key:"traverseSpec",value:function(a,b,c){var d=arguments.length<=3||void 0===arguments[3]?null:arguments[3],e=arguments.length<=4||void 0===arguments[4]?null:arguments[4],f=function g(a,b,c,d,e){b(a,d,e),a.frames&&a.frames.forEach(function(d){(d.units||[]).map(function(e){return g(e,b,c,a,d)})}),c(a,d,e)};f(a.unit,b,c,d,e)}}]),b}(i.Emitter)},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}Object.defineProperty(b,"__esModule",{value:!0}),b.FramesAlgebra=void 0;var f=c(3),g=d(f),h=c(26),i=function(a){return a instanceof Date?a.getTime():a},j={cross:function(a,b,c){var d=a(),e=(0,g["default"])(d).chain().pluck(b).unique(i).value(),f=(0,g["default"])(d).chain().pluck(c).unique(i).value(),h=0===e.length?[null]:e,j=0===f.length?[null]:f;return(0,g["default"])(j).reduce(function(a,d){return a.concat((0,g["default"])(h).map(function(a){var e={};return b&&(e[b]=i(a)),c&&(e[c]=i(d)),e}))},[])},cross_period:function(a,b,c,d,e){var f=a(),j=(0,g["default"])(f).chain().pluck(b).unique(i).value(),k=(0,g["default"])(f).chain().pluck(c).unique(i).value(),l=0===j.length?[null]:j,m=0===k.length?[null]:k;return d&&(l=h.UnitDomainPeriodGenerator.generate(g["default"].min(j),g["default"].max(j),d)),e&&(m=h.UnitDomainPeriodGenerator.generate(g["default"].min(k),g["default"].max(k),e)),(0,g["default"])(m).reduce(function(a,d){return a.concat((0,g["default"])(l).map(function(a){var e={};return b&&(e[b]=i(a)),c&&(e[c]=i(d)),e}))},[])},groupBy:function(a,b){var c=a(),d=(0,g["default"])(c).chain().pluck(b).unique(i).value();return d.map(function(a){return e({},b,i(a))})},none:function(){return[null]}};b.FramesAlgebra=j},function(a,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0});var c={day:{cast:function(a){var b=new Date(a);return new Date(b.setHours(0,0,0,0))},next:function e(a){var b=new Date(a),e=new Date(b.setDate(b.getDate()+1));return this.cast(e)}},week:{cast:function(a){var b=new Date(a);return b=new Date(b.setHours(0,0,0,0)),new Date(b.setDate(b.getDate()-b.getDay()))},next:function f(a){var b=new Date(a),f=new Date(b.setDate(b.getDate()+7));return this.cast(f)}},month:{cast:function(a){var b=new Date(a);return b=new Date(b.setHours(0,0,0,0)),b=new Date(b.setDate(1))},next:function g(a){var b=new Date(a),g=new Date(b.setMonth(b.getMonth()+1));return this.cast(g)}},quarter:{cast:function(a){var b=new Date(a);b=new Date(b.setHours(0,0,0,0)),b=new Date(b.setDate(1));var c=b.getMonth(),d=c-c%3;return new Date(b.setMonth(d))},next:function h(a){var b=new Date(a),h=new Date(b.setMonth(b.getMonth()+3));return this.cast(h)}},year:{cast:function(a){var b=new Date(a);return b=new Date(b.setHours(0,0,0,0)),b=new Date(b.setDate(1)),b=new Date(b.setMonth(0))},next:function i(a){var b=new Date(a),i=new Date(b.setFullYear(b.getFullYear()+1));return this.cast(i)}}},d={add:function(a,b){return c[a.toLowerCase()]=b,this},get:function(a){var b=a||"";return c[b.toLowerCase()]||null},generate:function(a,b,c){var e=[],f=d.get(c);if(f){var g=f.cast(new Date(b)),h=f.cast(new Date(a));for(e.push(h);(h=f.next(new Date(h)))<=g;)e.push(h)}return e}};b.UnitDomainPeriodGenerator=d},function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0}),b.DataFrame=void 0;var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=c(4);b.DataFrame=function(){function a(b,c){var e=b.key,f=b.pipe,g=b.source,h=b.units,i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];d(this,a),this.key=e,this.pipe=f||[],this.source=g,this.units=h,this._frame={key:e,source:g,pipe:this.pipe},this._data=c,this._pipeReducer=function(a,b){return i[b.type](a,b.args)}}return e(a,[{key:"hash",value:function(){var a=[this._frame.pipe,this._frame.key,this._frame.source].map(JSON.stringify).join("");return f.utils.generateHash(a)}},{key:"full",value:function(){return this._data}},{key:"part",value:function(){var a=arguments.length<=0||void 0===arguments[0]?function(a){return a}:arguments[0];return this._frame.pipe.map(a).reduce(this._pipeReducer,this._data)}}]),a}()},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.Plot=void 0;var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=function G(a,b,c){null===a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){var e=Object.getPrototypeOf(a);return null===e?void 0:G(e,b,c)}if("value"in d)return d.value;var f=d.get;if(void 0!==f)return f.call(c)},j=c(29),k=c(8),l=c(31),m=c(4),n=c(1),o=c(32),p=c(33),q=c(34),r=c(35),s=c(36),t=d(s),u=c(102),v=c(103),w=c(104),x=c(105),y=c(107),z=c(108),A=c(6),B=c(24),C=c(3),D=d(C),E=c(2),F=d(E);b.Plot=function(a){function b(a){e(this,b);var c=f(this,Object.getPrototypeOf(b).call(this));c._nodes=[],c._svg=null,c._filtersStore={filters:{},tick:0},c._layout=(0,u.getLayout)();var d=0;a.settings=b.setupSettings(D["default"].defaults(a.settings||{},{references:new t["default"],refCounter:function(){return++d}})),2===["sources","scales"].filter(function(b){return a.hasOwnProperty(b)}).length?c.configGPL=a:c.configGPL=new v.SpecConverter(c.setupConfig(a)).convert(),c.configGPL=b.setupPeriodData(c.configGPL);var g=a.plugins||[];return c.transformers=[y.SpecTransformApplyRatio,w.SpecTransformAutoLayout],c.onUnitsStructureExpandedTransformers=[z.SpecTransformExtractAxes,x.SpecTransformCalcSize],c._originData=D["default"].clone(c.configGPL.sources),c._chartDataModel=function(a){return a},c._liveSpec=c.configGPL,c._plugins=new l.Plugins(g,c),c}return g(b,a),h(b,[{key:"destroy",value:function(){this.destroyNodes(),F["default"].select(this._svg).remove(),F["default"].select(this._layout.layout).remove(),i(Object.getPrototypeOf(b.prototype),"destroy",this).call(this)}},{key:"setupChartSourceModel",value:function(a){this._chartDataModel=a}},{key:"setupConfig",value:function(a){if(!a.spec||!a.spec.unit)throw new Error("Provide spec for plot");var c=D["default"].defaults(a,{spec:{},data:[],plugins:[],settings:{}});this._emptyContainer=a.emptyContainer||"",c.spec.dimensions=b.setupMetaInfo(c.spec.dimensions,c.data);var d=c.settings.log;return c.settings.excludeNull&&this.addFilter({tag:"default",src:"/",predicate:r.DataProcessor.excludeNullValues(c.spec.dimensions,function(a){return d([a,"point was excluded, because it has undefined values."],"WARN")})}),c}},{key:"insertToLeftSidebar",value:function(a){return n.utilsDom.appendTo(a,this._layout.leftSidebar)}},{key:"insertToRightSidebar",value:function(a){return n.utilsDom.appendTo(a,this._layout.rightSidebar)}},{key:"insertToFooter",value:function(a){return n.utilsDom.appendTo(a,this._layout.footer)}},{key:"insertToHeader",value:function(a){return n.utilsDom.appendTo(a,this._layout.header)}},{key:"addBalloon",value:function(a){return new j.Tooltip("",a||{})}},{key:"destroyNodes",value:function(){this._nodes.forEach(function(a){return a.destroy()}),this._nodes=[]}},{key:"onUnitDraw",value:function(a){var b=this;this._nodes.push(a),this.fire("unitdraw",a),["click","mouseover","mouseout"].forEach(function(c){return a.on(c,function(a,d){b.fire("element"+c,{element:a,data:d.data,event:d.event})})})}},{key:"onUnitsStructureExpanded",value:function(a){var b=this;this.onUnitsStructureExpandedTransformers.forEach(function(c){return new c(a).transform(b)}),this.fire(["units","structure","expanded"].join(""),a)}},{key:"renderTo",value:function(a,b){var c=this;this._svg=null,this._target=a,this._defaultSize=D["default"].clone(b);var d=F["default"].select(a).node();if(null===d)throw new Error("Target element not found");d.appendChild(this._layout.layout);var e=this._layout.content,f=D["default"].clone(b)||{};if(f.width&&f.height||(e.style.display="none",f=D["default"].defaults(f,n.utilsDom.getContainerSize(e.parentNode)),e.style.display="",f.height||(f.height=n.utilsDom.getContainerSize(this._layout.layout).height)),this.configGPL.settings.size=f,this._liveSpec=m.utils.clone(D["default"].omit(this.configGPL,"plugins")),this._liveSpec.sources=this.getDataSources(),this._liveSpec.settings=this.configGPL.settings,this.isEmptySources(this._liveSpec.sources))return void(e.innerHTML=this._emptyContainer);this._liveSpec=this.transformers.reduce(function(a,b){return new b(a).transform(c)},this._liveSpec),this.destroyNodes(),this.fire("specready",this._liveSpec);var g=new B.GPL(this._liveSpec,this.getScaleFactory(),o.unitsRegistry),h=g.unfoldStructure();this.onUnitsStructureExpanded(h);var i=g.config.settings.size,j=F["default"].select(e),k={"class":A.CSS_PREFIX+"svg",width:i.width,height:i.height},l=j.selectAll("svg").data([1]);l.attr(k),l.enter().append("svg").attr(k).append("g").attr("class",A.CSS_PREFIX+"cell cell frame-root");var p=g.getDrawScenario({allocateRect:function(){return{slot:function(){return j.select(".frame-root")},frameId:"root",left:0,top:0,width:i.width,containerWidth:i.width,height:i.height,containerHeight:i.height}}});p.forEach(function(a){a.draw(),c.onUnitDraw(a.node())}),this._svg=l.node(),this._layout.rightSidebar.style.maxHeight=this._liveSpec.settings.size.height+"px",this.fire("render",this._svg)}},{key:"getScaleFactory",value:function(){var a=arguments.length<=0||void 0===arguments[0]?null:arguments[0];return new q.ScalesFactory(p.scalesRegistry.instance(this._liveSpec.settings),a||this._liveSpec.sources,this._liveSpec.scales)}},{key:"getScaleInfo",value:function(a){var b=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return this.getScaleFactory().createScaleInfoByName(a,b)}},{key:"getSourceFiltersIterator",value:function(a){var b=(0,D["default"])(this._filtersStore.filters).chain().values().flatten().reject(function(b){return a(b)}).pluck("predicate").value();return function(a){return b.reduce(function(b,c){return b&&c(a)},!0)}}},{key:"getDataSources",value:function(){var a=this,b=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],c=function(a){return function(c){return D["default"].contains(b.excludeFilter,c.tag)||c.src!==a}},d=this._chartDataModel(this._originData);return Object.keys(d).filter(function(a){return"?"!==a}).reduce(function(b,e){var f=d[e],g=a.getSourceFiltersIterator(c(e));return b[e]={dims:f.dims,data:f.data.filter(g)},b},{"?":d["?"]})}},{key:"isEmptySources",value:function(a){return!Object.keys(a).filter(function(a){return"?"!==a}).filter(function(b){return a[b].data.length>0}).length}},{key:"getChartModelData",value:function(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],b=arguments.length<=1||void 0===arguments[1]?"/":arguments[1],c=this.getDataSources(a);return c[b].data}},{key:"getDataDims",value:function(){var a=arguments.length<=0||void 0===arguments[0]?"/":arguments[0];return this._originData[a].dims}},{key:"getData",value:function(){var a=arguments.length<=0||void 0===arguments[0]?"/":arguments[0];return this._originData[a].data}},{key:"setData",value:function(a){var b=arguments.length<=1||void 0===arguments[1]?"/":arguments[1];this._originData[b].data=a,this.refresh()}},{key:"getSVG",value:function(){return this._svg}},{key:"addFilter",value:function(a){a.src=a.src||"/";var b=a.tag,c=this._filtersStore.filters[b]=this._filtersStore.filters[b]||[],d=this._filtersStore.tick++;return a.id=d,c.push(a),d}},{key:"removeFilter",value:function(a){var b=this;return D["default"].each(this._filtersStore.filters,function(c,d){b._filtersStore.filters[d]=D["default"].reject(c,function(b){return b.id===a})}),this}},{key:"refresh",value:function(){this._target&&this.renderTo(this._target,this._defaultSize)}},{key:"resize",value:function(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.renderTo(this._target,a)}},{key:"select",value:function(a){return this._nodes.filter(a)}},{key:"traverseSpec",value:function(a,b){var c=function d(a,b,c,e){b(a,c,e),a.frames?a.frames.forEach(function(c){(c.units||[]).map(function(e){return d(e,b,a,c)})}):(a.units||[]).map(function(c){return d(c,b,a,null)})};c(a.unit,b,null,null)}},{key:"getSpec",value:function(){return this._liveSpec}},{key:"getLayout",value:function(){return this._layout}}],[{key:"setupPeriodData",value:function(a){var c=b.__api__.tickPeriod,d=a.settings.log,e=Object.keys(a.scales).map(function(b){return a.scales[b]}),f=e.filter(function(a){return"period"===a.type}).reduce(function(a,b){var e=c.get(b.period);return e?a.push({source:b.source,dim:b.dim,period:e}):(d(['Unknown period "'+b.period+'".',"Docs: http://api.taucharts.com/plugins/customticks.html#how-to-add-custom-tick-period"],"WARN"),b.period=null),a},[]),g=function(a){return null===a||"undefined"==typeof a},h=function(a,b){return a[b.source].data=a[b.source].data.map(function(a){var c=a[b.dim];return g(c)||(a[b.dim]=b.period.cast(c)),a}),a};return a.sources=f.reduce(h,a.sources),a}},{key:"setupMetaInfo",value:function(a,b){var c=a?a:r.DataProcessor.autoDetectDimTypes(b);return r.DataProcessor.autoAssignScales(c)}},{key:"setupSettings",value:function(a){var c=b.globalSettings,d=Object.keys(c).reduce(function(a,b){return a[b]=D["default"].isFunction(c[b])?c[b]:m.utils.clone(c[b]),a},{}),e=D["default"].defaults(a||{},d);
  return m.utils.isArray(e.specEngine)||(e.specEngine=[{width:Number.MAX_VALUE,name:e.specEngine}]),e}}]),b}(k.Emitter)},function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.Tooltip=void 0;var d=c(6),e=c(30);e.Tooltip.defaults.baseClass=d.CSS_PREFIX+"tooltip",b.Tooltip=e.Tooltip},function(a,b,c){var d,e,f;!function(c,g){e=[],d=g,f="function"==typeof d?d.apply(b,e):d,!(void 0!==f&&(a.exports=f))}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b){"use strict";function c(a,b){for(var c in b)a[c]=b[c];return a}function d(a){return a&&null!=a.setInterval}function e(a){var b=k.pageYOffset||m.scrollTop,e=k.pageXOffset||m.scrollLeft,f={left:0,right:0,top:0,bottom:0,width:0,height:0};if(d(a))f.width=k.innerWidth||m.clientWidth,f.height=k.innerHeight||m.clientHeight;else{if(!m.contains(a)||null==a.getBoundingClientRect)return f;c(f,a.getBoundingClientRect()),f.width=f.right-f.left,f.height=f.bottom-f.top}return f.top=f.top+b-m.clientTop,f.left=f.left+e-m.clientLeft,f.right=f.left+f.width,f.bottom=f.top+f.height,f}function f(a){return 0|Math.round(String(a).replace(/[^\-0-9.]/g,""))}function g(a){var b=String(o(a,g.propName)),c=b.match(/([0-9.]+)([ms]{1,2})/);return c&&(b=Number(c[1]),"s"===c[2]&&(b*=1e3)),0|b}function h(a,b){return this instanceof h?(this.hidden=1,this.options=c(p(h.defaults),b),this._createElement(),void(a&&this.content(a))):new h(a,b)}Object.defineProperty(b,"__esModule",{value:!0});var i=function(a){return{add:function(b){a.classList.add(b)},remove:function(b){a.classList.remove(b)}}},j=function(a,b){return a.indexOf(b)},k=window,l=k.document,m=l.documentElement,n=["top","bottom"],o=k.getComputedStyle;g.propName=function(){for(var a=l.createElement("div"),b=["transitionDuration","webkitTransitionDuration"],c="1s",d=0;d<b.length;d++)if(a.style[b[d]]=c,a.style[b[d]]===c)return b[d]}();var p=Object.create;h.prototype._createElement=function(){this.element=l.createElement("div"),this.classes=i(this.element),this.classes.add(this.options.baseClass);for(var a,b=0;b<h.classTypes.length;b++)a=h.classTypes[b]+"Class",this.options[a]&&this.classes.add(this.options[a])},h.prototype.type=function(a){return this.changeClassType("type",a)},h.prototype.effect=function(a){return this.changeClassType("effect",a)},h.prototype.changeClassType=function(a,b){return a+="Class",this.options[a]&&this.classes.remove(this.options[a]),this.options[a]=b,b&&this.classes.add(b),this},h.prototype.updateSize=function(){return this.hidden&&(this.element.style.visibility="hidden",l.body.appendChild(this.element)),this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,null==this.spacing&&(this.spacing=null!=this.options.spacing?this.options.spacing:f(o(this.element,"top"))),this.hidden?(l.body.removeChild(this.element),this.element.style.visibility=""):this.position(),this},h.prototype.content=function(a){return"object"==typeof a?(this.element.innerHTML="",this.element.appendChild(a)):this.element.innerHTML=a,this.updateSize(),this},h.prototype.place=function(a){return this.options.place=a,this.hidden||this.position(),this},h.prototype.attach=function(a){return this.attachedTo=a,this.hidden||this.position(),this},h.prototype.detach=function(){return this.hide(),this.attachedTo=null,this},h.prototype._pickPlace=function(a){if(!this.options.auto)return this.options.place;var b=e(k),c=this.options.place.split("-"),d=this.spacing;if(-1!==j(n,c[0]))switch(a.top-this.height-d<=b.top?c[0]="bottom":a.bottom+this.height+d>=b.bottom&&(c[0]="top"),c[1]){case"left":a.right-this.width<=b.left&&(c[1]="right");break;case"right":a.left+this.width>=b.right&&(c[1]="left");break;default:a.left+a.width/2+this.width/2>=b.right?c[1]="left":a.right-a.width/2-this.width/2<=b.left&&(c[1]="right")}else switch(a.left-this.width-d<=b.left?c[0]="right":a.right+this.width+d>=b.right&&(c[0]="left"),c[1]){case"top":a.bottom-this.height<=b.top&&(c[1]="bottom");break;case"bottom":a.top+this.height>=b.bottom&&(c[1]="top");break;default:a.top+a.height/2+this.height/2>=b.bottom?c[1]="top":a.bottom-a.height/2-this.height/2<=b.top&&(c[1]="bottom")}return c.join("-")},h.prototype.position=function(a,b){this.attachedTo&&(a=this.attachedTo),null==a&&this._p?(a=this._p[0],b=this._p[1]):this._p=arguments;var c="number"==typeof a?{left:0|a,right:0|a,top:0|b,bottom:0|b,width:0,height:0}:e(a),d=this.spacing,f=this._pickPlace(c);f!==this.curPlace&&(this.curPlace&&this.classes.remove(this.curPlace),this.classes.add(f),this.curPlace=f);var g,h;switch(this.curPlace){case"top":g=c.top-this.height-d,h=c.left+c.width/2-this.width/2;break;case"top-left":g=c.top-this.height-d,h=c.right-this.width;break;case"top-right":g=c.top-this.height-d,h=c.left;break;case"bottom":g=c.bottom+d,h=c.left+c.width/2-this.width/2;break;case"bottom-left":g=c.bottom+d,h=c.right-this.width;break;case"bottom-right":g=c.bottom+d,h=c.left;break;case"left":g=c.top+c.height/2-this.height/2,h=c.left-this.width-d;break;case"left-top":g=c.bottom-this.height,h=c.left-this.width-d;break;case"left-bottom":g=c.top,h=c.left-this.width-d;break;case"right":g=c.top+c.height/2-this.height/2,h=c.right+d;break;case"right-top":g=c.bottom-this.height,h=c.right+d;break;case"right-bottom":g=c.top,h=c.right+d}return this.element.style.top=Math.round(g)+"px",this.element.style.left=Math.round(h)+"px",this},h.prototype.show=function(a,b){return a=this.attachedTo?this.attachedTo:a,clearTimeout(this.aIndex),null!=a&&this.position(a,b),this.hidden&&(this.hidden=0,l.body.appendChild(this.element)),this.attachedTo&&this._aware(),this.options.inClass&&(this.options.effectClass&&void this.element.clientHeight,this.classes.add(this.options.inClass)),this},h.prototype.getElement=function(){return this.element},h.prototype.hide=function(){if(!this.hidden){var a=this,b=0;return this.options.inClass&&(this.classes.remove(this.options.inClass),this.options.effectClass&&(b=g(this.element))),this.attachedTo&&this._unaware(),clearTimeout(this.aIndex),this.aIndex=setTimeout(function(){a.aIndex=0,l.body.removeChild(a.element),a.hidden=1},b),this}},h.prototype.toggle=function(a,b){return this[this.hidden?"show":"hide"](a,b)},h.prototype.destroy=function(){clearTimeout(this.aIndex),this._unaware(),this.hidden||l.body.removeChild(this.element),this.element=this.options=null},h.prototype._aware=function(){var a=j(h.winAware,this);-1===a&&h.winAware.push(this)},h.prototype._unaware=function(){var a=j(h.winAware,this);-1!==a&&h.winAware.splice(a,1)},h.reposition=function(){function a(){!c&&h.winAware.length&&(c=d(b))}function b(){c=0;for(var a,b=0,d=h.winAware.length;d>b;b++)a=h.winAware[b],a.position()}var c,d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return setTimeout(a,17)};return a}(),h.winAware=[],window.addEventListener("resize",h.reposition),window.addEventListener("scroll",h.reposition),h.classTypes=["type","effect"],h.defaults={baseClass:"tooltip",typeClass:null,effectClass:null,inClass:"in",place:"top",spacing:null,auto:0},b.Tooltip=h}])})},function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),e=function(){function a(b,d){c(this,a),this.chart=d,this._plugins=b.map(this.initPlugin,this)}return d(a,[{key:"initPlugin",value:function(a){var b=this;a.init&&a.init(this.chart);var c=function(){};this.chart.on("destroy",a.destroy&&a.destroy.bind(a)||c),Object.keys(a).forEach(function(c){if(0===c.indexOf("on")){var d=c.substr(2);b.chart.on(d.toLowerCase(),a[c].bind(a))}})}}]),a}();b.Plugins=e},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(b,"__esModule",{value:!0}),b.unitsRegistry=void 0;var e=c(3),f=d(e),g=c(10),h={},i={},j={reg:function(a,b,c){return c?(i[a]=c,h[a]=function(a){this.___tauchartsseed___=a},h[a].prototype=f["default"].extend({node:function(){return this.___tauchartsseed___},init:function(){this.node().init()},draw:function(){this.node().draw()}},b)):h[a]=b,this},get:function(a){if(!h.hasOwnProperty(a))throw new g.TauChartError("Unknown unit type: "+a,g.errorCodes.UNKNOWN_UNIT_TYPE);return h[a]},create:function(a,b){var c,d=this.get(a);if(i[a]){var e=this.get(i[a]);c=new d(new e(b))}else c=new d(b);return c}};b.unitsRegistry=j},function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),e={},f={};b.scalesRegistry=function(){function a(){c(this,a)}return d(a,null,[{key:"reg",value:function(a,b){var c=arguments.length<=2||void 0===arguments[2]?function(a){return a}:arguments[2];return e[a]=b,f[a]=c,this}},{key:"get",value:function(a){return e[a]}},{key:"instance",value:function(){var b=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return{create:function(c,d,e){var g=a.get(c),h=f[c];return new g(d,h(e,b))}}}}]),a}()},function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0}),b.ScalesFactory=void 0;var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=c(27);b.ScalesFactory=function(){function a(b,c,e){d(this,a),this.registry=b,this.sources=c,this.scales=e}return e(a,[{key:"createScaleInfo",value:function(a){var b=arguments.length<=1||void 0===arguments[1]?null:arguments[1],c=a.dim,d=a.source,e=(this.sources[d].dims[c]||{}).type,g=this.sources[d].data,h=b||new f.DataFrame({source:d},g);return a.dimType=e,this.registry.create(a.type,h,a)}},{key:"createScaleInfoByName",value:function(a){var b=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return this.createScaleInfo(this.scales[a],b)}}]),a}()},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(b,"__esModule",{value:!0}),b.DataProcessor=void 0;var e=c(4),f=c(3),g=d(f),h=function(a){return a===Object(a)},i={isYFunctionOfX:function(a,b,c){var d=!0,e=null;try{a.reduce(function(a,d){var f=function(a,b){var c=d[b],e=h(c)?JSON.stringify(c):c;return a.push(e),a},g=b.reduce(f,[]).join("/"),i=c.reduce(f,[]).join("/");if(a.hasOwnProperty(g)){var j=a[g];if(j!==i)throw e={type:"RelationIsNotAFunction",keyX:b.join("/"),keyY:c.join("/"),valX:g,errY:[j,i]},new Error("RelationIsNotAFunction")}else a[g]=i;return a},{})}catch(f){if("RelationIsNotAFunction"!==f.message)throw f;d=!1}return{result:d,error:e}},excludeNullValues:function(a,b){var c=Object.keys(a).reduce(function(b,c){var d=a[c];return d.hasOwnProperty("hasNull")&&!d.hasNull||"measure"!==d.type&&"period"!==d.scale||b.push(c),b},[]);return function(a){var d=!c.some(function(b){return!(b in a)||null===a[b]});return d||b(a),d}},autoAssignScales:function(a){var b="category",c={category:"ordinal",order:"ordinal",measure:"linear"},d={};return Object.keys(a).forEach(function(e){var f=a[e],h=(f.type||b).toLowerCase();d[e]=g["default"].extend({},f,{type:h,scale:f.scale||c[h],value:f.value})}),d},autoDetectDimTypes:function(a){var b={type:"category",scale:"ordinal"},c=function(a,b){var c=b;return g["default"].isDate(a)?(c.type="measure",c.scale="time"):g["default"].isObject(a)?(c.type="order",c.scale="ordinal"):g["default"].isNumber(a)&&(c.type="measure",c.scale="linear"),c},d=function(a,d){return Object.keys(d).forEach(function(f){var g=d.hasOwnProperty(f)?d[f]:null;if(a[f]=a[f]||{type:null,hasNull:!1},null===g)a[f].hasNull=!0;else{var h=c(g,e.utils.clone(b)),i=h.type,j=h.scale,k=null!==a[f].type&&a[f].type!==i;a[f].type=k?b.type:i,a[f].scale=k?b.scale:j}}),a};return g["default"].reduce(a,d,{})},sortByDim:function(a,b,c){var d=a,e=["period","time"].indexOf(c.scale)>=0?function(a){return new Date(a)}:function(a){return a};if("measure"===c.type||"period"===c.scale)d=a.map(function(a){return a}).sort(function(a,c){return e(a[b])-e(c[b])});else if(c.order){var f=c.order.reduce(function(a,b,c){return a[b]=c,a},{}),g=c.order.length,h="(___"+b+"___)";d=a.map(function(a){var c=f[a[b]];return c=c>=0?c:g,a[h]=c,a}).sort(function(a,b){return a[h]-b[h]}).map(function(a){return delete a[h],a})}return d}};b.DataProcessor=i},function(a,b,c){c(37),c(38),c(84),a.exports=c(51).WeakMap},function(a,b){},function(a,b,c){c(39);for(var d=c(50),e=c(54),f=c(42),g=c(81)("toStringTag"),h=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],i=0;5>i;i++){var j=h[i],k=d[j],l=k&&k.prototype;l&&!l[g]&&e(l,g,j),f[j]=f.Array}},function(a,b,c){"use strict";var d=c(40),e=c(41),f=c(42),g=c(43);a.exports=c(47)(Array,"Array",function(a,b){this._t=g(a),this._i=0,this._k=b},function(){var a=this._t,b=this._k,c=this._i++;return!a||c>=a.length?(this._t=void 0,e(1)):"keys"==b?e(0,c):"values"==b?e(0,a[c]):e(0,[c,a[c]])},"values"),f.Arguments=f.Array,d("keys"),d("values"),d("entries")},function(a,b){a.exports=function(){}},function(a,b){a.exports=function(a,b){return{value:b,done:!!a}}},function(a,b){a.exports={}},function(a,b,c){var d=c(44),e=c(46);a.exports=function(a){return d(e(a))}},function(a,b,c){var d=c(45);a.exports=Object("z").propertyIsEnumerable(0)?Object:function(a){return"String"==d(a)?a.split(""):Object(a)}},function(a,b){var c={}.toString;a.exports=function(a){return c.call(a).slice(8,-1)}},function(a,b){a.exports=function(a){if(void 0==a)throw TypeError("Can't call method on  "+a);return a}},function(a,b,c){"use strict";var d=c(48),e=c(49),f=c(64),g=c(54),h=c(65),i=c(42),j=c(66),k=c(80),l=c(82),m=c(81)("iterator"),n=!([].keys&&"next"in[].keys()),o="@@iterator",p="keys",q="values",r=function(){return this};a.exports=function(a,b,c,s,t,u,v){j(c,b,s);var w,x,y,z=function(a){if(!n&&a in D)return D[a];switch(a){case p:return function(){return new c(this,a)};case q:return function(){return new c(this,a)}}return function(){return new c(this,a)}},A=b+" Iterator",B=t==q,C=!1,D=a.prototype,E=D[m]||D[o]||t&&D[t],F=E||z(t),G=t?B?z("entries"):F:void 0,H="Array"==b?D.entries||E:E;if(H&&(y=l(H.call(new a)),y!==Object.prototype&&(k(y,A,!0),d||h(y,m)||g(y,m,r))),B&&E&&E.name!==q&&(C=!0,F=function(){return E.call(this)}),d&&!v||!n&&!C&&D[m]||g(D,m,F),i[b]=F,i[A]=r,t)if(w={values:B?F:z(q),keys:u?F:z(p),entries:G},v)for(x in w)x in D||f(D,x,w[x]);else e(e.P+e.F*(n||C),b,w);return w}},function(a,b){a.exports=!0},function(a,b,c){var d=c(50),e=c(51),f=c(52),g=c(54),h="prototype",i=function(a,b,c){var j,k,l,m=a&i.F,n=a&i.G,o=a&i.S,p=a&i.P,q=a&i.B,r=a&i.W,s=n?e:e[b]||(e[b]={}),t=s[h],u=n?d:o?d[b]:(d[b]||{})[h];n&&(c=b);for(j in c)k=!m&&u&&void 0!==u[j],k&&j in s||(l=k?u[j]:c[j],s[j]=n&&"function"!=typeof u[j]?c[j]:q&&k?f(l,d):r&&u[j]==l?function(a){var b=function(b,c,d){if(this instanceof a){switch(arguments.length){case 0:return new a;case 1:return new a(b);case 2:return new a(b,c)}return new a(b,c,d)}return a.apply(this,arguments)};return b[h]=a[h],b}(l):p&&"function"==typeof l?f(Function.call,l):l,p&&((s.virtual||(s.virtual={}))[j]=l,a&i.R&&t&&!t[j]&&g(t,j,l)))};i.F=1,i.G=2,i.S=4,i.P=8,i.B=16,i.W=32,i.U=64,i.R=128,a.exports=i},function(a,b){var c=a.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=c)},function(a,b){var c=a.exports={version:"2.4.0"};"number"==typeof __e&&(__e=c)},function(a,b,c){var d=c(53);a.exports=function(a,b,c){if(d(a),void 0===b)return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}}},function(a,b){a.exports=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a}},function(a,b,c){var d=c(55),e=c(63);a.exports=c(59)?function(a,b,c){return d.f(a,b,e(1,c))}:function(a,b,c){return a[b]=c,a}},function(a,b,c){var d=c(56),e=c(58),f=c(62),g=Object.defineProperty;b.f=c(59)?Object.defineProperty:function(a,b,c){if(d(a),b=f(b,!0),d(c),e)try{return g(a,b,c)}catch(h){}if("get"in c||"set"in c)throw TypeError("Accessors not supported!");return"value"in c&&(a[b]=c.value),a}},function(a,b,c){var d=c(57);a.exports=function(a){if(!d(a))throw TypeError(a+" is not an object!");return a}},function(a,b){a.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},function(a,b,c){a.exports=!c(59)&&!c(60)(function(){return 7!=Object.defineProperty(c(61)("div"),"a",{get:function(){return 7}}).a})},function(a,b,c){a.exports=!c(60)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(a,b){a.exports=function(a){try{return!!a()}catch(b){return!0}}},function(a,b,c){var d=c(57),e=c(50).document,f=d(e)&&d(e.createElement);a.exports=function(a){return f?e.createElement(a):{}}},function(a,b,c){var d=c(57);a.exports=function(a,b){if(!d(a))return a;var c,e;if(b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;if("function"==typeof(c=a.valueOf)&&!d(e=c.call(a)))return e;if(!b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;throw TypeError("Can't convert object to primitive value")}},function(a,b){a.exports=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}}},function(a,b,c){a.exports=c(54)},function(a,b){var c={}.hasOwnProperty;a.exports=function(a,b){return c.call(a,b)}},function(a,b,c){"use strict";var d=c(67),e=c(63),f=c(80),g={};c(54)(g,c(81)("iterator"),function(){return this}),a.exports=function(a,b,c){a.prototype=d(g,{next:e(1,c)}),f(a,b+" Iterator")}},function(a,b,c){var d=c(56),e=c(68),f=c(78),g=c(75)("IE_PROTO"),h=function(){},i="prototype",j=function(){var a,b=c(61)("iframe"),d=f.length,e=">";for(b.style.display="none",c(79).appendChild(b),b.src="javascript:",a=b.contentWindow.document,a.open(),a.write("<script>document.F=Object</script"+e),a.close(),j=a.F;d--;)delete j[i][f[d]];return j()};a.exports=Object.create||function(a,b){var c;return null!==a?(h[i]=d(a),c=new h,h[i]=null,c[g]=a):c=j(),void 0===b?c:e(c,b)}},function(a,b,c){var d=c(55),e=c(56),f=c(69);a.exports=c(59)?Object.defineProperties:function(a,b){e(a);for(var c,g=f(b),h=g.length,i=0;h>i;)d.f(a,c=g[i++],b[c]);return a}},function(a,b,c){var d=c(70),e=c(78);a.exports=Object.keys||function(a){return d(a,e)}},function(a,b,c){var d=c(65),e=c(43),f=c(71)(!1),g=c(75)("IE_PROTO");a.exports=function(a,b){var c,h=e(a),i=0,j=[];for(c in h)c!=g&&d(h,c)&&j.push(c);for(;b.length>i;)d(h,c=b[i++])&&(~f(j,c)||j.push(c));return j}},function(a,b,c){var d=c(43),e=c(72),f=c(74);a.exports=function(a){return function(b,c,g){var h,i=d(b),j=e(i.length),k=f(g,j);if(a&&c!=c){for(;j>k;)if(h=i[k++],h!=h)return!0}else for(;j>k;k++)if((a||k in i)&&i[k]===c)return a||k||0;return!a&&-1}}},function(a,b,c){var d=c(73),e=Math.min;a.exports=function(a){return a>0?e(d(a),9007199254740991):0}},function(a,b){var c=Math.ceil,d=Math.floor;a.exports=function(a){return isNaN(a=+a)?0:(a>0?d:c)(a)}},function(a,b,c){var d=c(73),e=Math.max,f=Math.min;a.exports=function(a,b){return a=d(a),0>a?e(a+b,0):f(a,b)}},function(a,b,c){var d=c(76)("keys"),e=c(77);a.exports=function(a){return d[a]||(d[a]=e(a))}},function(a,b,c){var d=c(50),e="__core-js_shared__",f=d[e]||(d[e]={});a.exports=function(a){return f[a]||(f[a]={})}},function(a,b){var c=0,d=Math.random();a.exports=function(a){return"Symbol(".concat(void 0===a?"":a,")_",(++c+d).toString(36))}},function(a,b){a.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(a,b,c){a.exports=c(50).document&&document.documentElement},function(a,b,c){var d=c(55).f,e=c(65),f=c(81)("toStringTag");a.exports=function(a,b,c){a&&!e(a=c?a:a.prototype,f)&&d(a,f,{configurable:!0,value:b})}},function(a,b,c){var d=c(76)("wks"),e=c(77),f=c(50).Symbol,g="function"==typeof f,h=a.exports=function(a){return d[a]||(d[a]=g&&f[a]||(g?f:e)("Symbol."+a))};h.store=d},function(a,b,c){var d=c(65),e=c(83),f=c(75)("IE_PROTO"),g=Object.prototype;a.exports=Object.getPrototypeOf||function(a){return a=e(a),d(a,f)?a[f]:"function"==typeof a.constructor&&a instanceof a.constructor?a.constructor.prototype:a instanceof Object?g:null}},function(a,b,c){var d=c(46);a.exports=function(a){return Object(d(a))}},function(a,b,c){"use strict";var d,e=c(85)(0),f=c(64),g=c(89),h=c(90),i=c(93),j=c(57),k=(c(65),g.getWeak),l=Object.isExtensible,m=i.ufstore,n={},o=function(a){return function(){return a(this,arguments.length>0?arguments[0]:void 0)}},p={get:function(a){if(j(a)){var b=k(a);return b===!0?m(this).get(a):b?b[this._i]:void 0}},set:function(a,b){return i.def(this,a,b)}},q=a.exports=c(101)("WeakMap",o,p,i,!0,!0);7!=(new q).set((Object.freeze||Object)(n),7).get(n)&&(d=i.getConstructor(o),h(d.prototype,p),g.NEED=!0,e(["delete","has","get","set"],function(a){var b=q.prototype,c=b[a];f(b,a,function(b,e){if(j(b)&&!l(b)){this._f||(this._f=new d);var f=this._f[a](b,e);return"set"==a?this:f}return c.call(this,b,e)})}))},function(a,b,c){var d=c(52),e=c(44),f=c(83),g=c(72),h=c(86);a.exports=function(a,b){var c=1==a,i=2==a,j=3==a,k=4==a,l=6==a,m=5==a||l,n=b||h;return function(b,h,o){for(var p,q,r=f(b),s=e(r),t=d(h,o,3),u=g(s.length),v=0,w=c?n(b,u):i?n(b,0):void 0;u>v;v++)if((m||v in s)&&(p=s[v],q=t(p,v,r),a))if(c)w[v]=q;else if(q)switch(a){case 3:return!0;case 5:return p;case 6:return v;case 2:w.push(p)}else if(k)return!1;return l?-1:j||k?k:w}}},function(a,b,c){var d=c(87);a.exports=function(a,b){return new(d(a))(b)}},function(a,b,c){var d=c(57),e=c(88),f=c(81)("species");a.exports=function(a){var b;return e(a)&&(b=a.constructor,"function"!=typeof b||b!==Array&&!e(b.prototype)||(b=void 0),d(b)&&(b=b[f],null===b&&(b=void 0))),void 0===b?Array:b}},function(a,b,c){var d=c(45);a.exports=Array.isArray||function(a){return"Array"==d(a)}},function(a,b,c){var d=c(77)("meta"),e=c(57),f=c(65),g=c(55).f,h=0,i=Object.isExtensible||function(){return!0},j=!c(60)(function(){return i(Object.preventExtensions({}))}),k=function(a){g(a,d,{value:{i:"O"+ ++h,w:{}}})},l=function(a,b){if(!e(a))return"symbol"==typeof a?a:("string"==typeof a?"S":"P")+a;if(!f(a,d)){if(!i(a))return"F";if(!b)return"E";k(a)}return a[d].i},m=function(a,b){if(!f(a,d)){if(!i(a))return!0;if(!b)return!1;k(a)}return a[d].w},n=function(a){return j&&o.NEED&&i(a)&&!f(a,d)&&k(a),a},o=a.exports={KEY:d,NEED:!1,fastKey:l,getWeak:m,onFreeze:n}},function(a,b,c){"use strict";var d=c(69),e=c(91),f=c(92),g=c(83),h=c(44),i=Object.assign;a.exports=!i||c(60)(function(){var a={},b={},c=Symbol(),d="abcdefghijklmnopqrst";return a[c]=7,d.split("").forEach(function(a){b[a]=a}),7!=i({},a)[c]||Object.keys(i({},b)).join("")!=d})?function(a,b){for(var c=g(a),i=arguments.length,j=1,k=e.f,l=f.f;i>j;)for(var m,n=h(arguments[j++]),o=k?d(n).concat(k(n)):d(n),p=o.length,q=0;p>q;)l.call(n,m=o[q++])&&(c[m]=n[m]);return c}:i},function(a,b){b.f=Object.getOwnPropertySymbols},function(a,b){b.f={}.propertyIsEnumerable},function(a,b,c){"use strict";var d=c(94),e=c(89).getWeak,f=c(56),g=c(57),h=c(95),i=c(96),j=c(85),k=c(65),l=j(5),m=j(6),n=0,o=function(a){return a._l||(a._l=new p)},p=function(){this.a=[]},q=function(a,b){return l(a.a,function(a){return a[0]===b})};p.prototype={get:function(a){var b=q(this,a);return b?b[1]:void 0},has:function(a){return!!q(this,a)},set:function(a,b){var c=q(this,a);c?c[1]=b:this.a.push([a,b])},"delete":function(a){var b=m(this.a,function(b){return b[0]===a});return~b&&this.a.splice(b,1),!!~b}},a.exports={getConstructor:function(a,b,c,f){var j=a(function(a,d){h(a,j,b,"_i"),a._i=n++,a._l=void 0,void 0!=d&&i(d,c,a[f],a)});return d(j.prototype,{"delete":function(a){if(!g(a))return!1;var b=e(a);return b===!0?o(this)["delete"](a):b&&k(b,this._i)&&delete b[this._i]},has:function(a){if(!g(a))return!1;var b=e(a);return b===!0?o(this).has(a):b&&k(b,this._i)}}),j},def:function(a,b,c){var d=e(f(b),!0);return d===!0?o(a).set(b,c):d[a._i]=c,a},ufstore:o}},function(a,b,c){var d=c(54);a.exports=function(a,b,c){for(var e in b)c&&a[e]?a[e]=b[e]:d(a,e,b[e]);return a}},function(a,b){a.exports=function(a,b,c,d){if(!(a instanceof b)||void 0!==d&&d in a)throw TypeError(c+": incorrect invocation!");return a}},function(a,b,c){var d=c(52),e=c(97),f=c(98),g=c(56),h=c(72),i=c(99),j={},k={},b=a.exports=function(a,b,c,l,m){var n,o,p,q,r=m?function(){return a}:i(a),s=d(c,l,b?2:1),t=0;if("function"!=typeof r)throw TypeError(a+" is not iterable!");if(f(r)){for(n=h(a.length);n>t;t++)if(q=b?s(g(o=a[t])[0],o[1]):s(a[t]),q===j||q===k)return q}else for(p=r.call(a);!(o=p.next()).done;)if(q=e(p,s,o.value,b),q===j||q===k)return q};b.BREAK=j,b.RETURN=k},function(a,b,c){var d=c(56);a.exports=function(a,b,c,e){try{return e?b(d(c)[0],c[1]):b(c)}catch(f){var g=a["return"];throw void 0!==g&&d(g.call(a)),f}}},function(a,b,c){var d=c(42),e=c(81)("iterator"),f=Array.prototype;a.exports=function(a){return void 0!==a&&(d.Array===a||f[e]===a)}},function(a,b,c){var d=c(100),e=c(81)("iterator"),f=c(42);a.exports=c(51).getIteratorMethod=function(a){return void 0!=a?a[e]||a["@@iterator"]||f[d(a)]:void 0}},function(a,b,c){var d=c(45),e=c(81)("toStringTag"),f="Arguments"==d(function(){return arguments}()),g=function(a,b){try{return a[b]}catch(c){}};a.exports=function(a){var b,c,h;return void 0===a?"Undefined":null===a?"Null":"string"==typeof(c=g(b=Object(a),e))?c:f?d(b):"Object"==(h=d(b))&&"function"==typeof b.callee?"Arguments":h}},function(a,b,c){"use strict";var d=c(50),e=c(49),f=c(89),g=c(60),h=c(54),i=c(94),j=c(96),k=c(95),l=c(57),m=c(80),n=c(55).f,o=c(85)(0),p=c(59);a.exports=function(a,b,c,q,r,s){var t=d[a],u=t,v=r?"set":"add",w=u&&u.prototype,x={};return p&&"function"==typeof u&&(s||w.forEach&&!g(function(){(new u).entries().next()}))?(u=b(function(b,c){k(b,u,a,"_c"),b._c=new t,void 0!=c&&j(c,r,b[v],b)}),o("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(a){var b="add"==a||"set"==a;a in w&&(!s||"clear"!=a)&&h(u.prototype,a,function(c,d){if(k(this,u,a),!b&&s&&!l(c))return"get"==a?void 0:!1;var e=this._c[a](0===c?0:c,d);return b?this:e})}),"size"in w&&n(u.prototype,"size",{get:function(){return this._c.size}})):(u=q.getConstructor(b,a,r,v),i(u.prototype,c),f.NEED=!0),m(u,a),x[a]=u,e(e.G+e.W+e.F,x),s||q.setStrong(u,a,r),u}},function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.getLayout=void 0;var d=c(6),e=function(a,b){var c="div",e=document.createElement(c);return e.classList.add(d.CSS_PREFIX+a),b&&b.appendChild(e),e},f=function(){var a=e("layout"),b=e("layout__header",a),c=e("layout__container",a),d=e("layout__sidebar",c),f=e("layout__content",c),g=e("layout__content__wrap",f),h=e("layout__sidebar-right",c),i=e("layout__sidebar-right__wrap",h),j=e("layout__footer",a);return{layout:a,header:b,content:g,leftSidebar:d,rightSidebar:i,footer:j}};b.getLayout=f},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0}),b.SpecConverter=void 0;var f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=c(3),h=d(g),i=c(4);b.SpecConverter=function(){function a(b){e(this,a),this.spec=b,this.dist={sources:{"?":{dims:{},data:[{}]},"/":{dims:{},data:[]}},scales:{x_null:{type:"ordinal",source:"?"},y_null:{type:"ordinal",source:"?"},size_null:{type:"size",source:"?"},color_null:{type:"color",source:"?"},split_null:{type:"value",source:"?"},"pos:default":{type:"ordinal",source:"?"},"size:default":{type:"size",source:"?"},"label:default":{type:"value",source:"?"},"color:default":{type:"color",source:"?"},"split:default":{type:"value",source:"?"}},settings:b.settings}}return f(a,[{key:"convert",value:function(){var a=this.spec,b=this.dist;return this.ruleAssignSourceDims(a,b),this.ruleAssignStructure(a,b),this.ruleAssignSourceData(a,b),this.ruleApplyDefaults(b),b}},{key:"ruleApplyDefaults",value:function(a){var b=a.settings||{},c=function e(a,b,c){b(a,c),(a.units||[]).map(function(c){return e(c,b,a)})},d=function(a,c){if(a.namespace="chart",c&&!a.hasOwnProperty("units")){a=h["default"].defaults(a,h["default"].pick(c,"x","y"));var d=i.utils.clone(c.guide||{});a.guide=h["default"].defaults(a.guide||{},{animationSpeed:b.animationSpeed}),a.guide.x=h["default"].defaults(a.guide.x||{},d.x),a.guide.y=h["default"].defaults(a.guide.y||{},d.y),a.expression.inherit=c.expression.inherit}return a};c(a.unit,d,null)}},{key:"ruleAssignSourceData",value:function(a,b){var c=a.spec.dimensions||{},d=b.sources["/"].dims,e=function(a,b){return h["default"].isObject(a[b])&&!h["default"].isDate(a[b])&&h["default"].each(a[b],function(c,d){return a[b+"."+d]=c}),a};b.sources["/"].data=a.data.map(function(a){var b=Object.keys(a).reduce(e,a);return Object.keys(d).reduce(function(a,b){return a.hasOwnProperty(b)||(a[b]=null),null!==a[b]&&c[b]&&["period","time"].indexOf(c[b].scale)>=0&&(a[b]=new Date(a[b])),a},b)})}},{key:"ruleAssignSourceDims",value:function(a,b){var c=a.spec.dimensions;b.sources["/"].dims=Object.keys(c).reduce(function(a,b){return a[b]={type:c[b].type},a},{})}},{key:"ruleAssignStructure",value:function(a,b){var c=this,d=function f(a){var b=i.utils.clone(h["default"].omit(a,"unit"));return c.ruleCreateScales(a,b),b.expression=c.ruleInferExpression(a),a.unit&&(b.units=a.unit.map(f)),b},e=d(a.spec.unit);e.expression.inherit=!1,b.unit=e}},{key:"ruleCreateScales",value:function(a,b){var c=this,d=a.guide||{};["identity","color","size","label","x","y","split"].forEach(function(e){a.hasOwnProperty(e)&&(b[e]=c.scalesPool(e,a[e],d[e]||{}))})}},{key:"ruleInferDim",value:function(a,b){var c=a,d=this.spec.spec.dimensions;if(!d.hasOwnProperty(c))return c;b.hasOwnProperty("tickLabel")?c=a+"."+b.tickLabel:d[a].value&&(c=a+"."+d[a].value);var e=this.dist.sources["/"].dims;return e.hasOwnProperty(c)||(e[c]={type:e[a].type},delete e[a]),c}},{key:"scalesPool",value:function(a,b,c){var d=a+"_"+b;if(this.dist.scales.hasOwnProperty(d))return d;var e=this.spec.spec.dimensions,f={};return"color"===a&&null!==b&&(f={type:"color",source:"/",dim:this.ruleInferDim(b,c)},c.hasOwnProperty("brewer")&&(f.brewer=c.brewer),e[b]&&e[b].hasOwnProperty("order")&&(f.order=e[b].order),c.hasOwnProperty("min")&&(f.min=c.min),c.hasOwnProperty("max")&&(f.max=c.max),c.hasOwnProperty("nice")&&(f.nice=c.nice)),"size"===a&&null!==b&&(f={type:"size",source:"/",dim:this.ruleInferDim(b,c)},c.hasOwnProperty("func")&&(f.func=c.func),c.hasOwnProperty("min")&&(f.min=c.min),c.hasOwnProperty("max")&&(f.max=c.max),c.hasOwnProperty("minSize")&&(f.minSize=c.minSize),c.hasOwnProperty("maxSize")&&(f.maxSize=c.maxSize)),"label"===a&&null!==b&&(f={type:"value",source:"/",dim:this.ruleInferDim(b,c)}),"split"===a&&null!==b&&(f={type:"value",source:"/",dim:this.ruleInferDim(b,c)}),"identity"===a&&null!==b&&(f={type:"identity",source:"/",dim:this.ruleInferDim(b,c)}),!e.hasOwnProperty(b)||"x"!==a&&"y"!==a||(f={type:e[b].scale,source:"/",dim:this.ruleInferDim(b,c)},e[b].hasOwnProperty("order")&&(f.order=e[b].order),c.hasOwnProperty("min")&&(f.min=c.min),c.hasOwnProperty("max")&&(f.max=c.max),
  c.hasOwnProperty("autoScale")?f.autoScale=c.autoScale:f.autoScale=!0,c.hasOwnProperty("nice")?f.nice=c.nice:f.nice=f.autoScale,c.hasOwnProperty("niceInterval")?f.niceInterval=c.niceInterval:f.niceInterval=null,c.hasOwnProperty("tickPeriod")&&(f.period=c.tickPeriod,f.type="period"),f.fitToFrameByDims=c.fitToFrameByDims,f.ratio=c.ratio),this.dist.scales[d]=f,d}},{key:"getScaleConfig",value:function(a,b){var c=a+"_"+b;return this.dist.scales[c]}},{key:"ruleInferExpression",value:function(a){var b={operator:"none",params:[]},c=a.guide||{},d=c.x||{},e=c.y||{},f=this.getScaleConfig("x",a.x),g=this.getScaleConfig("y",a.y);return 0===a.type.indexOf("ELEMENT.")?a.color&&(b={operator:"groupBy",params:[this.ruleInferDim(a.color,c.color||{})]}):"COORDS.RECT"===a.type&&1===a.unit.length&&"COORDS.RECT"===a.unit[0].type&&(b=f.period||g.period?{operator:"cross_period",params:[this.ruleInferDim(a.x,d),this.ruleInferDim(a.y,e),f.period,g.period]}:{operator:"cross",params:[this.ruleInferDim(a.x,d),this.ruleInferDim(a.y,e)]}),h["default"].extend({inherit:!0,source:"/"},b)}}]),a}()},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b,c,d){var e=a.hasOwnProperty(c)?a[c]:{};e=e||{},i["default"].each(d,function(a){i["default"].extend(b.guide[c][a],e[a])}),i["default"].extend(b.guide[c],i["default"].omit.apply(i["default"],[e].concat[d]))}Object.defineProperty(b,"__esModule",{value:!0}),b.SpecTransformAutoLayout=void 0;var g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=c(3),i=d(h),j=c(4),k=c(16),l=function(a){return a.reduce(function(a,b){return a+b},0)},m=function(a,b){var c=b.guide||{},d={x:["label"],y:["label"],size:["label"],color:["label"],padding:[]};return i["default"].each(d,function(b,d){f(c,a,d,b)}),i["default"].extend(a.guide,i["default"].omit.apply(i["default"],[c].concat(i["default"].keys(d)))),a},n=function(a,b,c){return a[b]=i["default"].defaults(a[b]||{},{label:""}),a[b].label=i["default"].isObject(a[b].label)?a[b].label:{text:a[b].label},a[b].label=i["default"].defaults(a[b].label,c||{},{padding:32,rotate:0,textAnchor:"middle",cssClass:"label",dock:null}),a[b]},o=function(a,b,c){return a[b]=i["default"].defaults(a[b],c||{},{padding:0,density:30,rotate:0,tickPeriod:null,tickFormat:null,autoScale:!0}),a[b].tickFormat=a[b].tickFormat||a[b].tickPeriod,a[b].nice=a[b].hasOwnProperty("nice")?a[b].nice:a[b].autoScale,a[b]},p=function(a){return a.options=a.options||{},a.guide=a.guide||{},a.guide.padding=i["default"].defaults(a.guide.padding||{},{l:0,b:0,r:0,t:0}),a.guide.x=n(a.guide,"x"),a.guide.x=o(a.guide,"x",{cssClass:"x axis",scaleOrient:"bottom",textAnchor:"middle"}),a.guide.y=n(a.guide,"y",{rotate:-90}),a.guide.y=o(a.guide,"y",{cssClass:"y axis",scaleOrient:"left",textAnchor:"end"}),a.guide.size=n(a.guide,"size"),a.guide.color=n(a.guide,"color"),a},q=function(a,b){return a.guide=a.guide||{},a.guide.padding=a.guide.padding||{l:0,t:0,r:0,b:0},a.hasOwnProperty("units")||(a=i["default"].defaults(a,b),a.guide=i["default"].defaults(a.guide,j.utils.clone(b.guide)),a.guide.x=i["default"].defaults(a.guide.x,j.utils.clone(b.guide.x)),a.guide.y=i["default"].defaults(a.guide.y,j.utils.clone(b.guide.y))),a},r=function(a){var b=a.units||[],c=!a.hasOwnProperty("units"),d=!b.some(function(a){return a.hasOwnProperty("units")});return{type:a.type,isLeaf:c,isLeafParent:!c&&d}},s=function(a,b,c,d){if(0===a.length)return{width:0,height:0};if(null===b){var e=c("TauChart Library");return e.width=.625*d,e}var f=i["default"].max(a,function(a){return b(a).toString().length}),g=i["default"].isNumber(f)?".00":"";return c(b(f)+g)},t=function(a,b){var c=a.dimType,d=a.scaleType,e="*",f=[c,d,e].join(":"),g=[c,d].join(":");return b[f]||b[g]||b[c]||null},u=function(a,b,c){return a.hasOwnProperty(b+":"+c)?a[b+":"+c]:a[""+b]},v=function(a){var b=["day","week","month"];return b.indexOf(a)>=0&&(a+="-short"),a},w=function(a,b){var c=a.width,d=a.height,e=Math.abs(j.utils.toRadian(b));return{width:Math.max(Math.cos(e)*c,d),height:Math.max(Math.sin(e)*c,d)}},x=function(a){var b=arguments.length<=1||void 0===arguments[1]?"x":arguments[1],c=j.utils.normalizeAngle(a),d="x"===b?[[0,45,"middle"],[45,135,"start"],[135,225,"middle"],[225,315,"end"],[315,360,"middle"]]:[[0,90,"end"],[90,135,"middle"],[135,225,"start"],[225,315,"middle"],[315,360,"end"]],e=i["default"].findIndex(d,function(a){return c>=a[0]&&c<a[1]});return d[e][2]},y=function(a,b,c){var d=Math.ceil(a.width/b),e=Math.min(d,c);return{height:e*a.height,width:b}},z=function(a,b,c,d,e){var f=c.values,g=d.values,h=c.isEmpty,j=d.isEmpty,m=s(f,k.FormatterRegistry.get(a.x.tickFormat,a.x.tickFormatNullAlias),b.getAxisTickLabelSize,b.xAxisTickLabelLimit),n=s(g,k.FormatterRegistry.get(a.y.tickFormat,a.y.tickFormatNullAlias),b.getAxisTickLabelSize,b.yAxisTickLabelLimit),o=m,p=n;m.width>b.xAxisTickLabelLimit&&(a.x.tickFormatWordWrap=!0,a.x.tickFormatWordWrapLines=b.xTickWordWrapLinesLimit,o=y(m,b.xAxisTickLabelLimit,b.xTickWordWrapLinesLimit)),n.width>b.yAxisTickLabelLimit&&(a.y.tickFormatWordWrap=!0,a.y.tickFormatWordWrapLines=b.yTickWordWrapLinesLimit,p=y(n,b.yAxisTickLabelLimit,b.yTickWordWrapLinesLimit));var q=h?0:1,r=j?0:1,t=a.x.label,v=a.y.label,x=t.text&&!t.hide?1:0,z=v.text&&!v.hide?1:0,A=w(o,a.x.rotate),B=w(p,a.y.rotate);e?(t.padding=(-b.xAxisPadding-b.xFontLabelHeight)/2+b.xFontLabelHeight,v.padding=(-b.yAxisPadding-b.yFontLabelHeight)/2,x=0,z=0):(t.padding=l([q*(b.xTickWidth+A.height),x*(b.distToXAxisLabel+b.xFontLabelHeight)]),v.padding=l([r*(b.yTickWidth+B.width),z*b.distToYAxisLabel]));var C=b.xFontLabelDescenderLineHeight;return a.padding=i["default"].extend(a.padding,{b:a.x.hide?0:l([a.x.padding,q*(b.xTickWidth+A.height),x*(b.distToXAxisLabel+b.xFontLabelHeight+C)]),l:a.y.hide?0:l([a.y.padding,r*(b.yTickWidth+B.width),z*(b.distToYAxisLabel+b.yFontLabelHeight)])}),a.x=i["default"].extend(a.x,{density:A.width+2*u(b,"xDensityPadding",c.dimType),tickFontHeight:m.height,$minimalDomain:f.length,$maxTickTextW:o.width,$maxTickTextH:o.height,tickFormatWordWrapLimit:b.xAxisTickLabelLimit}),a.y=i["default"].extend(a.y,{density:B.height+2*u(b,"yDensityPadding",d.dimType),tickFontHeight:n.height,$minimalDomain:g.length,$maxTickTextW:p.width,$maxTickTextH:p.height,tickFormatWordWrapLimit:b.yAxisTickLabelLimit}),a},A=function(a,b,c,d,e,f){var g=b.dimension(a.x),h=b.dimension(a.y),i=b.scaleMeta(a.x,a.guide.x),j=b.scaleMeta(a.y,a.guide.y),k=i.isEmpty,l=j.isEmpty;a.guide.x.tickFormat=v(a.guide.x.tickFormat||t(g,c.defaultFormats)),a.guide.y.tickFormat=v(a.guide.y.tickFormat||t(h,c.defaultFormats));var m=d?!("measure"===g.dimType):!1,n=e?!("measure"===h.dimType):!1;if(a.guide.x.padding=k?0:c.xAxisPadding,a.guide.y.padding=l?0:c.yAxisPadding,a.guide.x.rotate=m?-90:0,a.guide.x.textAnchor=x(a.guide.x.rotate,"x"),a.guide.y.rotate=n?-90:0,a.guide.y.textAnchor=x(a.guide.y.rotate,"y"),a.guide=z(a.guide,c,i,j,f),f){var o=a.guide.x.label,p=a.guide.y.label;o.cssClass+=" inline",o.dock="right",o.textAnchor="end",p.cssClass+=" inline",p.dock="right",p.textAnchor="end"}return a},B={NONE:function(a,b,c){var d=j.utils.clone(a);return C(j.utils.clone(d.unit),d.unit,function(a,b){return b.guide.x.tickFontHeight=c.getAxisTickLabelSize("X").height,b.guide.y.tickFontHeight=c.getAxisTickLabelSize("Y").height,b.guide.x.tickFormatWordWrapLimit=c.xAxisTickLabelLimit,b.guide.y.tickFormatWordWrapLimit=c.yAxisTickLabelLimit,b}),d},"BUILD-LABELS":function(a,b){var c=j.utils.clone(a),d=[],e=[],f=null,g=null;j.utils.traverseJSON(c.unit,"units",r,function(a,c){if(a.isLeaf)return c;!f&&c.x&&(f=c),!g&&c.y&&(g=c),c.guide=c.guide||{},c.guide.x=c.guide.x||{label:""},c.guide.y=c.guide.y||{label:""},c.guide.x.label=i["default"].isObject(c.guide.x.label)?c.guide.x.label:{text:c.guide.x.label},c.guide.y.label=i["default"].isObject(c.guide.y.label)?c.guide.y.label:{text:c.guide.y.label},c.x&&(c.guide.x.label.text=c.guide.x.label.text||b.dimension(c.x).dimName),c.y&&(c.guide.y.label.text=c.guide.y.label.text||b.dimension(c.y).dimName);var h=c.guide.x.label.text;h&&(d.push(h),c.guide.x.tickFormatNullAlias=c.guide.x.hasOwnProperty("tickFormatNullAlias")?c.guide.x.tickFormatNullAlias:"No "+h,c.guide.x.label.text="",c.guide.x.label._original_text=h);var j=c.guide.y.label.text;return j&&(e.push(j),c.guide.y.tickFormatNullAlias=c.guide.y.hasOwnProperty("tickFormatNullAlias")?c.guide.y.tickFormatNullAlias:"No "+j,c.guide.y.label.text="",c.guide.y.label._original_text=j),c});var h=" → ";return f&&(f.guide.x.label.text=f.guide.x.label.hide?"":d.join(h)),g&&(g.guide.y.label.text=g.guide.y.label.hide?"":e.join(h)),c},"BUILD-GUIDE":function(a,b,c){var d=j.utils.clone(a);return C(j.utils.clone(d.unit),d.unit,function(a,d){if(a.isLeaf)return d;var e=!a.isLeaf&&!a.isLeafParent,f=b.scaleMeta(d.x,d.guide.x),g=b.scaleMeta(d.y,d.guide.y),h=!e&&Boolean(f.dimType)&&"measure"!==f.dimType;return d.guide.x.rotate=h?-90:0,d.guide.x.textAnchor=x(d.guide.x.rotate),d.guide.x.tickFormat=d.guide.x.tickFormat||t(f,c.defaultFormats),d.guide.y.tickFormat=d.guide.y.tickFormat||t(g,c.defaultFormats),d.guide.x.padding=e?0:c.xAxisPadding,d.guide.y.padding=e?0:c.yAxisPadding,d.guide=z(d.guide,i["default"].defaults({distToXAxisLabel:f.isEmpty?c.xTickWidth:c.distToXAxisLabel,distToYAxisLabel:g.isEmpty?c.yTickWidth:c.distToYAxisLabel},c),f,g),d.guide.x=i["default"].extend(d.guide.x,{cssClass:e?d.guide.x.cssClass+" facet-axis":d.guide.x.cssClass,avoidCollisions:e?!0:d.guide.x.avoidCollisions}),d.guide.y=i["default"].extend(d.guide.y,{cssClass:e?d.guide.y.cssClass+" facet-axis":d.guide.y.cssClass,avoidCollisions:e?!1:d.guide.y.avoidCollisions}),d.guide=i["default"].extend(d.guide,{showGridLines:d.guide.hasOwnProperty("showGridLines")?d.guide.showGridLines:a.isLeafParent?"xy":""}),d}),d},"BUILD-COMPACT":function(a,b,c){var d=j.utils.clone(a);return C(j.utils.clone(d.unit),d.unit,function(a,d){return a.isLeaf?d:(d.guide.hasOwnProperty("showGridLines")||(d.guide.showGridLines=a.isLeafParent?"xy":""),a.isLeafParent?A(d,b,i["default"].defaults({xTickWordWrapLinesLimit:1,yTickWordWrapLinesLimit:1},c),!0,!1,!0):(d.guide.x.cssClass+=" facet-axis compact",d.guide.x.avoidCollisions=!0,d.guide.y.cssClass+=" facet-axis compact",d.guide.y.avoidCollisions=!0,A(d,b,i["default"].defaults({xAxisPadding:0,yAxisPadding:0,distToXAxisLabel:0,distToYAxisLabel:0,xTickWordWrapLinesLimit:1,yTickWordWrapLinesLimit:1},c),!1,!0,!1)))}),d}};B.AUTO=function(a,b,c){return["BUILD-LABELS","BUILD-GUIDE"].reduce(function(a,d){return B[d](a,b,c)},a)},B.COMPACT=function(a,b,c){return["BUILD-LABELS","BUILD-COMPACT"].reduce(function(a,d){return B[d](a,b,c)},a)};var C=function E(a,b,c){var d=p(b);d=c(r(d),d),d=m(d,a);var e=i["default"].omit(d,"units");return(d.units||[]).forEach(function(a){return E(j.utils.clone(a),q(a,e),c)}),d},D={get:function(a,b,c,d){var e=B[a]||B.NONE,f={dimension:function(a){var b=c.scales[a],d=c.sources[b.source].dims[b.dim]||{};return{dimName:b.dim,dimType:d.type,scaleType:b.type}},scaleMeta:function(a){var b=d("pos",a),e=b.domain(),f=c.scales[a],g=c.sources[f.source].dims[f.dim]||{};return{dimName:f.dim,dimType:g.type,scaleType:f.type,values:e,isEmpty:null==g.type}}},g={unit:j.utils.clone(c.unit)},h=e(g,f,b);return c.unit=h.unit,c}};b.SpecTransformAutoLayout=function(){function a(b){e(this,a),this.spec=b,this.isApplicable=j.utils.isSpecRectCoordsOnly(b.unit)}return g(a,[{key:"transform",value:function(a){var b=this.spec;if(!this.isApplicable)return b;var c=b.settings.size,d=i["default"].find(b.settings.specEngine,function(a){return c.width<=a.width});return D.get(d.name,b.settings,b,function(b,c){return a.getScaleInfo(c||b+":default")})}}]),a}()},function(a,b,c){"use strict";function d(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0}),b.SpecTransformCalcSize=void 0;var f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=c(4),h=c(106),i=function(a){return a.$maxTickTextW},j=function(a){return 0==a.rotate?a.$maxTickTextW:a.$maxTickTextH},k=function(a){return a.density},l={"entire-view":function(a,b,c,d){var e=b("x",c.unit,i);e<=a.width&&d(c.unit,c.settings);var f=a.width,g=a.height;return{newW:f,newH:g}},minimal:function(a,b,c){var d=b("x",c.unit,k),e=b("y",c.unit,k);return{newW:d,newH:e}},normal:function(a,b,c,d){var e=a.width,f=b("x",c.unit,i);if(f<=a.width)d(c.unit,c.settings);else{var g=b("x",c.unit,j);if(g>a.width){var h=Math.max(a.width,b("x",c.unit,k));e=Math.min(g,h)}}var l=Math.max(a.height,b("y",c.unit,k));return{newW:e,newH:l}},"fit-width":function(a,b,c,d){var e=b("x",c.unit,i);e<=a.width&&d(c.unit,c.settings);var f=a.width,g=b("y",c.unit,k);return{newW:f,newH:g}},"fit-height":function(a,b,c){var d=b("x",c.unit,k),e=a.height;return{newW:d,newH:e}}};b.SpecTransformCalcSize=function(){function a(b){e(this,a),this.spec=b,this.isApplicable=g.utils.isSpecRectCoordsOnly(b.unit)}return f(a,[{key:"transform",value:function(a){var b=this.spec;if(!this.isApplicable)return b;var c=b.settings.fitModel;if(!c)return b;var e=b.scales,f=function(a,b){return a.reduce(function(a,c){var d=c.key||{},e=d[b];return a[e]=a[e]||[],a[e].push(c),a},{})},g=function(a,b){var c=0;return c=a.discrete?b*a.domain().length:4*b},i=function q(b,c,h){var i=arguments.length<=3||void 0===arguments[3]?null:arguments[3],j="x"===b?c.x:c.y,k="x"===b?c.y:c.x,l=c.guide,m=h("x"===b?l.x:l.y),n="x"===b?l.padding.l+l.padding.r:l.padding.b+l.padding.t;if("COORDS.RECT"!==c.units[0].type){var o=a.getScaleInfo(j,i);return n+g(o,m)}var p=f(c.frames,e[k].dim),r=Object.keys(p).map(function(a){return p[a].map(function(a){return q(b,a.units[0],h,a)}).reduce(function(a,b){return a+b},0)}),s=Math.max.apply(Math,d(r));return n+s},j=b.settings.size,k=j.width,m=j.height,n=l[c];if(n){var o=n(j,i,b,h.SpecTransformOptimize.optimize);k=o.newW,m=o.newH}var p=function(a,c){var d=b.settings.getScrollBarWidth(),e=c.width,f=c.height,g=a.width-e,h=a.height-f,i=h>=0?0:d,j=g>=0?0:d;return{height:f-j,width:e-i}};return b.settings.size=p(j,{width:k,height:m}),b}}]),a}()},function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}();b.SpecTransformOptimize=function(){function a(){c(this,a)}return d(a,null,[{key:"optimize",value:function(a,b){var c=function d(a,b,c){if(a.guide.x.hide!==!0&&0!==a.guide.x.rotate){a.guide.x.rotate=0,a.guide.x.textAnchor="middle";var e=Math.min(b,a.guide.x.$maxTickTextW),f=0-e+a.guide.x.$maxTickTextH;c(a,f)}(a.units||[]).filter(function(a){return"COORDS.RECT"===a.type}).forEach(function(a){return d(a,b,c)})};c(a,b.xAxisTickLabelLimit,function(b,c){a!==b&&"extract-axes"===b.guide.autoLayout?(a.guide.x.padding+=c,a.guide.padding.b+=c):(b.guide.x.label.padding+=b.guide.x.label.padding>0?c:0,b.guide.padding.b+=b.guide.padding.b>0?c:0)})}}]),a}()},function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0}),b.SpecTransformApplyRatio=void 0;var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=c(4);b.SpecTransformApplyRatio=function(){function a(b){d(this,a),this.spec=b,this.isApplicable=b.settings.autoRatio&&f.utils.isSpecRectCoordsOnly(b.unit)}return e(a,[{key:"transform",value:function(a){var b=this.spec;if(!this.isApplicable)return b;try{this.ruleApplyRatio(b,a)}catch(c){if("Not applicable"!==c.message)throw c}return b}},{key:"ruleApplyRatio",value:function(a,b){var c=function(a){return"COORDS.RECT"===a.type||"RECT"===a.type},d=function(a){return 0===a.type.indexOf("ELEMENT.")},e=function p(a,b,c){var d=arguments.length<=3||void 0===arguments[3]?0:arguments[3],e=b(a,d);e&&(a.units||[]).map(function(a){return p(a,b,c,d+1)}),c(a,d)},g=[],h=[],i=function(a,b){if(b>1||!c(a))throw new Error("Not applicable");g.push(a.x),h.push(a.y);var e=a.units||[],f=e.map(function(a){if(!c(a)&&!d(a))throw new Error("Not applicable");return a}).filter(c);return 1===f.length};e(a.unit,i,function(){return 0});var j=function(b){return a.scales[b]},k=function(a){return"/"===a.source&&!a.ratio&&!a.fitToFrameByDims},l=function(a){return"ordinal"===a.type||"period"===a.type&&!a.period},m=g.map(j).filter(k),n=h.map(j).filter(k),o=2;[m.length,n.length].some(function(a){return a===o})&&!function(){var a=function(a){return a.dim},c=function(b,c,d){return b.fitToFrameByDims=d.slice(0,c).map(a)},d=function(d,e){e.filter(l).length===o&&(e.forEach(c),e[0].ratio=f.utils.generateRatioFunction(d,e.map(a),b))};d("x",m),d("y",n)}()}}]),a}()},function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0}),b.SpecTransformExtractAxes=void 0;var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=c(4);b.SpecTransformExtractAxes=function(){function a(b){d(this,a),this.spec=b,this.isApplicable="EXTRACT"===b.settings.layoutEngine&&f.utils.isSpecRectCoordsOnly(b.unit)}return e(a,[{key:"transform",value:function(){var a=this.spec;if(!this.isApplicable)return a;try{this.ruleExtractAxes(a)}catch(b){if("Not applicable"!==b.message)throw b;console.log("[TauCharts]: can't extract axes for the given chart specification")}return a}},{key:"ruleExtractAxes",value:function(a){var b=function(a){return"COORDS.RECT"===a.type||"RECT"===a.type},c=function(a){return 0===a.type.indexOf("ELEMENT.")},d=function(a){return a?10:0},e={l:0,r:10,t:10,b:0},g=[],h=function(a,d){if(d>1||!b(a))throw new Error("Not applicable");a.guide=a.guide||{};var f=a.guide,h=f.padding||{l:0,r:0,t:0,b:0};e.l+=h.l,e.r+=h.r,e.t+=h.t,e.b+=h.b,g.push({l:e.l,r:e.r,t:e.t,b:e.b});var i=a.units||[],j=i.map(function(a){if(!b(a)&&!c(a))throw new Error("Not applicable");return a}).filter(b);return 1===j.length},i=function(a){var b=g.pop(),c=a.guide||{};c.x=c.x||{},c.x.padding=c.x.padding||0,c.y=c.y||{},c.y.padding=c.y.padding||0,c.padding={l:d(a.y),r:d(1),t:d(1),b:d(a.x)},c.autoLayout="extract-axes",c.x.padding+=e.b-b.b,c.y.padding+=e.l-b.l};f.utils.traverseSpec(a.unit,h,i),a.unit.guide.padding=e}}]),a}()},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.Chart=void 0;var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=function o(a,b,c){null===a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){var e=Object.getPrototypeOf(a);return null===e?void 0:o(e,b,c)}if("value"in d)return d.value;var f=d.get;if(void 0!==f)return f.call(c)},j=c(28),k=c(110),l=c(3),m=d(l),n=function(a){function b(a){e(this,b);var c=k.chartTypesRegistry.validate(a.type,a);if(c.length>0)throw new Error(c[0]);var d=k.chartTypesRegistry.get(a.type);a=m["default"].defaults(a,{autoResize:!0}),a.settings=j.Plot.setupSettings(a.settings),a.dimensions=j.Plot.setupMetaInfo(a.dimensions,a.data);var g=f(this,Object.getPrototypeOf(b).call(this,d(a)));return a.autoResize&&b.winAware.push(g),g}return g(b,a),h(b,[{key:"destroy",value:function(){var a=b.winAware.indexOf(this);-1!==a&&b.winAware.splice(a,1),i(Object.getPrototypeOf(b.prototype),"destroy",this).call(this)}}]),b}(j.Plot);n.resizeOnWindowEvent=function(){function a(){!c&&n.winAware.length&&(c=d(b))}function b(){c=0;for(var a,b=0,d=n.winAware.length;d>b;b++)a=n.winAware[b],a.resize()}var c,d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return setTimeout(a,17)};return a}(),n.winAware=[],window.addEventListener("resize",n.resizeOnWindowEvent),b.Chart=n},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(b,"__esModule",{value:!0}),b.chartTypesRegistry=void 0;var e=c(10),f=c(3),g=d(f),h={},i={},j=function(a){var b="Chart type "+a+" is not supported.";throw console.log(b),console.log("Use one of "+g["default"].keys(h).join(", ")+"."),new e.TauChartError(b,e.errorCodes.NOT_SUPPORTED_TYPE_CHART)},k={validate:function(a,b){return i.hasOwnProperty(a)||j(a),i[a].reduce(function(a,c){return a.concat(c(b)||[])},[])},get:function(a){var b=h[a];return g["default"].isFunction(b)||j(a),b},add:function(a,b){var c=arguments.length<=2||void 0===arguments[2]?[]:arguments[2];return h[a]=b,i[a]=c,this},getAllRegisteredTypes:function(){return h}};b.chartTypesRegistry=k},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.Cartesian=void 0;var i=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),j=c(2),k=d(j),l=c(3),m=d(l),n=c(7),o=c(112),p=c(12),q=c(6),r=c(16),s=c(17);b.Cartesian=function(a){function b(a){f(this,b);var c=g(this,Object.getPrototypeOf(b).call(this,a));c.config=a,c.config.guide=m["default"].defaults(c.config.guide||{},{showGridLines:"xy",padding:{l:50,r:0,t:0,b:50}}),c.config.guide.x=c.config.guide.x||{},c.config.guide.x=m["default"].defaults(c.config.guide.x,{cssClass:"x axis",textAnchor:"middle",padding:10,hide:!1,scaleOrient:"bottom",rotate:0,density:20,label:{},tickFormatWordWrapLimit:100}),m["default"].isString(c.config.guide.x.label)&&(c.config.guide.x.label={text:c.config.guide.x.label}),c.config.guide.x.label=m["default"].defaults(c.config.guide.x.label,{text:"X",rotate:0,padding:40,textAnchor:"middle"}),c.config.guide.y=c.config.guide.y||{},c.config.guide.y=m["default"].defaults(c.config.guide.y,{cssClass:"y axis",textAnchor:"start",padding:10,hide:!1,scaleOrient:"left",rotate:0,density:20,label:{},tickFormatWordWrapLimit:100}),m["default"].isString(c.config.guide.y.label)&&(c.config.guide.y.label={text:c.config.guide.y.label}),c.config.guide.y.label=m["default"].defaults(c.config.guide.y.label,{text:"Y",rotate:-90,padding:20,textAnchor:"middle"});var d=c.config,e=d.guide;if("extract-axes"===e.autoLayout){var h=d.options.containerHeight,i=h-(d.options.top+d.options.height);e.x.hide=Math.floor(i)>0,e.y.hide=Math.floor(d.options.left)>0}var j=c.config.options,k=c.config.guide.padding;return c.L=j.left+k.l,c.T=j.top+k.t,c.W=j.width-(k.l+k.r),c.H=j.height-(k.t+k.b),c}return h(b,a),i(b,[{key:"createScales",value:function(a){this.xScale=a("pos",this.config.x,[0,this.W]),this.yScale=a("pos",this.config.y,[this.H,0]),this.regScale("x",this.xScale).regScale("y",this.yScale)}},{key:"walkFrames",value:function(){var a=this.W,b=this.H;return[o.CartesianModel.decorator_size,o.CartesianModel.decorator_color].filter(function(a){return a}).reduce(function(a,b){return b(a,{})},new o.CartesianModel({scaleX:this.xScale,scaleY:this.yScale,xi:function(){return a/2},yi:function(){return b/2},sizeX:function(){return a},sizeY:function(){return b}}))}},{key:"allocateRect",value:function(a){var b=this,c=this.screenModel;return{slot:function(a){return b.config.options.container.select(".uid_"+a)},left:c.xi(a)-c.sizeX(a)/2,top:c.yi(a)-c.sizeY(a)/2,width:c.sizeX(a),height:c.sizeY(a),containerWidth:this.W,containerHeight:this.H}}},{key:"drawFrames",value:function(a){var b=m["default"].extend({},this.config),c=b.options,d=this.W,e=this.H;b.x=this.xScale,b.y=this.yScale,b.x.scaleObj=this.xScale,b.y.scaleObj=this.yScale,b.x.guide=b.guide.x,b.y.guide=b.guide.y,b.x.guide.label.size=d,b.y.guide.label.size=e,c.container.attr("transform",p.utilsDraw.translate(this.L,this.T));var f=b.x.getHash()+e,g=b.y.getHash()+d;if(!b.x.guide.hide){var h=b.x.guide.scaleOrient,i="top"===h?[0,0-b.guide.x.padding]:[0,e+b.guide.x.padding];this._fnDrawDimAxis(c.container,b.x,i,d,c.frameId+"x",f)}if(!b.y.guide.hide){var j=b.y.guide.scaleOrient,k="right"===j?[d+b.guide.y.padding,0]:[0-b.guide.y.padding,0];this._fnDrawDimAxis(c.container,b.y,k,e,c.frameId+"y",g)}var l=a.reduce(function(a,b){return a.concat((b.units||[]).map(function(a){return a.uid}))},[]),n=this._fnDrawGrid(c.container,b,e,d,c.frameId,f+g).selectAll(".cell").data(l,function(a){return a});n.exit().remove(),n.enter().append("g").attr("class",function(a){return q.CSS_PREFIX+"cell cell uid_"+a})}},{key:"_fnDrawDimAxis",value:function(a,b,c,d,f,g){var h=k["default"].svg.axis().scale(b.scaleObj).orient(b.guide.scaleOrient),i=r.FormatterRegistry.get(b.guide.tickFormat,b.guide.tickFormatNullAlias);null!==i&&(h.ticks(Math.round(d/b.guide.density)),h.tickFormat(i));var j=a.selectAll(".axis_"+f).data([g],function(a){return a});j.exit().remove(),j.enter().append("g").attr("class",b.guide.cssClass+" axis_"+f).attr("transform",p.utilsDraw.translate.apply(p.utilsDraw,e(c))).call(function(a){if(!a.empty()){h.call(this,a);var c="h"===p.utilsDraw.getOrientation(b.guide.scaleOrient),d="ordinal"===b.scaleType||"period"===b.scaleType;d&&(0,s.d3_decorator_prettify_categorical_axis_ticks)(a,b,c),(0,s.d3_decorator_wrap_tick_label)(a,b.guide,c,b),d&&b.guide.avoidCollisions&&(0,s.d3_decorator_avoid_labels_collisions)(a,c),b.guide.label.hide||(0,s.d3_decorator_prettify_axis_label)(a,b.guide.label,c),c&&"time"===b.scaleType&&(0,s.d3_decorator_fix_horizontal_axis_ticks_overflow)(a)}})}},{key:"_fnDrawGrid",value:function(a,b,c,d,e,f){var g=a.selectAll(".grid_"+e).data([f],function(a){return a});return g.exit().remove(),g.enter().append("g").attr("class","grid grid_"+e).attr("transform",p.utilsDraw.translate(0,0)).call(function(a){if(!a.empty()){var e=a,f=(b.guide.showGridLines||"").toLowerCase();if(f.length>0){var g=e.append("g").attr("class","grid-lines");if(f.indexOf("x")>-1){var h=b.x,i="top"===h.guide.scaleOrient?-1:1,j=k["default"].svg.axis().scale(h.scaleObj).orient(h.guide.scaleOrient).tickSize(i*c),l=r.FormatterRegistry.get(h.guide.tickFormat);null!==l&&(j.ticks(Math.round(d/h.guide.density)),j.tickFormat(l));var n=g.append("g").attr("class","grid-lines-x").call(j),o="h"===p.utilsDraw.getOrientation(h.guide.scaleOrient),q="ordinal"===h.scaleType||"period"===h.scaleType;q&&(0,s.d3_decorator_prettify_categorical_axis_ticks)(n,h,o);var t=n.select("g.tick");if(t.node()&&"translate(0,0)"!==t.attr("transform")){var u=t.node().cloneNode(!0);g.node().appendChild(u),k["default"].select(u).attr("class","border").attr("transform",p.utilsDraw.translate(0,0)).select("line").attr("x1",0).attr("x2",0)}}if(f.indexOf("y")>-1){var v=b.y,w="right"===v.guide.scaleOrient?1:-1,x=k["default"].svg.axis().scale(v.scaleObj).orient(v.guide.scaleOrient).tickSize(w*d),y=r.FormatterRegistry.get(v.guide.tickFormat);null!==y&&(x.ticks(Math.round(c/v.guide.density)),x.tickFormat(y));var z=g.append("g").attr("class","grid-lines-y").call(x),A="h"===p.utilsDraw.getOrientation(v.guide.scaleOrient),B="ordinal"===v.scaleType||"period"===v.scaleType;B&&(0,s.d3_decorator_prettify_categorical_axis_ticks)(z,v,A);var C=["time","ordinal","period"],D=m["default"].contains(C,v.scaleType);D&&(0,s.d3_decorator_fix_axis_bottom_line)(z,c,"time"===v.scaleType)}g.selectAll("text").remove()}}}),g}}]),b}(n.Element)},function(a,b){"use strict";function c(a){if(null==a)throw new TypeError("Cannot destructure undefined")}function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}();b.CartesianModel=function(){function a(b){d(this,a);var c=function(a){return function(){return a}};this.scaleX=b.scaleX,this.scaleY=b.scaleY,this.yi=b.yi||c(0),this.xi=b.xi||c(0),this.sizeX=b.sizeX||c(0),this.sizeY=b.sizeY||c(0)}return e(a,[{key:"toScreenModel",value:function(){return this}}],[{key:"compose",value:function(b){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return Object.keys(c).reduce(function(a,b){return a[b]=c[b],a},new a(b))}},{key:"decorator_size",value:function(b,d){c(d);var e=b.scaleX,f=b.scaleY;return a.compose(b,{xi:function(a){return a?e(a[e.dim]):b.xi(a)},yi:function(a){return a?f(a[f.dim]):b.yi(a)},sizeX:function(a){return a?e.stepSize(a[e.dim]):b.sizeX(a)},sizeY:function(a){return a?f.stepSize(a[f.dim]):b.sizeY(a)}})}}]),a}()},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.Parallel=void 0;var i=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),j=c(2),k=d(j),l=c(3),m=d(l),n=c(7),o=c(12),p=c(4),q=c(6),r=c(16);b.Parallel=function(a){
  function b(a){f(this,b);var c=g(this,Object.getPrototypeOf(b).call(this,a));c.config=a,c.config.guide=m["default"].defaults(c.config.guide||{},{padding:{l:50,r:50,t:50,b:50},enableBrushing:!1}),c.columnsBrushes={},c.on("force-brush",function(a,b){return c._forceBrushing(b)});var d=c.config.options,e=c.config.guide.padding;return c.L=d.left+e.l,c.T=d.top+e.t,c.W=d.width-(e.l+e.r),c.H=d.height-(e.t+e.b),c}return h(b,a),i(b,[{key:"createScales",value:function(a){var b=this.config,c=this.W,d=this.H;this.columnsScalesMap=b.columns.reduce(function(b,c){return b[c]=a("pos",c,[d,0]),b},{});var e=c/(b.columns.length-1),f=b.columns.reduce(function(a,b,c){return a[b]=c*e,a},{});return this.xBase=function(a){return f[a]},this.regScale("columns",this.columnsScalesMap)}},{key:"allocateRect",value:function(){var a=this;return{slot:function(b){return a.config.options.container.select(".uid_"+b)},left:0,top:0,width:this.W,height:this.H,containerWidth:this.W,containerHeight:this.H}}},{key:"drawFrames",value:function(a){var b=this,c=m["default"].extend({},this.config),d=c.options,e=function(a,b,c){var d=b.selectAll(".layer_"+a).data(c.units,function(a){return a.uid});d.exit().remove(),d.enter().append("g").attr("class",function(b){return"layer_"+a+" uid_"+b.uid})},f=function(a){e(d.frameId,k["default"].select(this),a)},g=this._fnDrawGrid(d.container,c,d.frameId,Object.keys(this.columnsScalesMap).reduce(function(a,c){return a.concat([b.columnsScalesMap[c].getHash()])},[]).join("_")),h=g.selectAll(".parent-frame-"+d.frameId).data(a,function(a){return a.hash()});h.exit().remove(),h.each(f),h.enter().append("g").attr("class",function(a){return q.CSS_PREFIX+"cell cell parent-frame-"+d.frameId+" frame-"+a.hash()}).each(f);var i=this._fnDrawColumns(g,c);c.guide.enableBrushing&&this._enableBrushing(i)}},{key:"_fnDrawGrid",value:function(a,b,c,d){var e=a.selectAll(".grid_"+c).data([d],m["default"].identity);return e.exit().remove(),e.enter().append("g").attr("class","grid grid_"+c).attr("transform",o.utilsDraw.translate(this.L,this.T)),e}},{key:"_fnDrawColumns",value:function(a,b){var c=b.guide.columns||{},d=this.xBase,e=this.columnsScalesMap,f=k["default"].svg.axis().orient("left"),g=a.selectAll(".column").data(b.columns,m["default"].identity);return g.exit().remove(),g.enter().append("g").attr("class","column").attr("transform",function(a){return o.utilsDraw.translate(d(a),0)}).call(function(){this.append("g").attr("class","y axis").each(function(a){var b=e[a].dim,d=f.scale(e[a]),g=c[b]||{},h=r.FormatterRegistry.get(g.tickFormat,g.tickFormatNullAlias);null!==h&&d.tickFormat(h),k["default"].select(this).call(d)}).append("text").attr("class","label").attr("text-anchor","middle").attr("y",-9).text(function(a){return((c[a]||{}).label||{}).text||e[a].dim})}),g}},{key:"_enableBrushing",value:function(a){var b=this,c=16,d=this.columnsScalesMap,e=this.columnsBrushes,f=function(a){return a},g=function(a){return a},h=function(){var a=Object.keys(e).filter(function(a){return!e[a].empty()}).map(function(a){var b=e[a].extent(),c=[];return c=d[a].discrete?d[a].domain().filter(function(c){var e=d[a](c);return b[0]<=e&&b[1]>=e}):[b[0],b[1]],{dim:d[a].dim,func:d[a].discrete?"inset":"between",args:c}});b.fire("brush",a)};return a.selectAll(".brush").remove(),a.append("g").attr("class","brush").each(function(a){e[a]=k["default"].svg.brush().y(d[a]).on("brushstart",f).on("brush",h).on("brushend",g),k["default"].select(this).classed("brush-"+p.utils.generateHash(a),!0).call(e[a])}).selectAll("rect").attr("x",c/2*-1).attr("width",c),a}},{key:"_forceBrushing",value:function(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],b=this.columnsBrushes,c=this.columnsScalesMap;Object.keys(a).filter(function(d){return b[d]&&c[d]&&a[d]}).forEach(function(d){var f=a[d],g=[];if(c[d].discrete){var h=f.map(c[d]).filter(function(a){return a>=0}),i=c[d].stepSize()/2;g=[Math.min.apply(Math,e(h))-i,Math.max.apply(Math,e(h))+i]}else g=[f[0],f[1]];var j=p.utils.generateHash(d);b[d].extent(g),b[d](k["default"].select(".brush-"+j)),b[d].event(k["default"].select(".brush-"+j))})}}]),b}(n.Element)},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.GeoMap=void 0;var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=c(2),j=d(i),k=c(3),l=d(k),m=c(115),n=d(m),o=c(116),p=c(7);j["default"].labeler=o.d3Labeler;var q=5.5,r=10,s=.5,t=["land","continents","georegions","countries","regions","subunits","states","counties"];b.GeoMap=function(a){function b(a){e(this,b);var c=f(this,Object.getPrototypeOf(b).call(this,a));return c.config=a,c.config.guide=l["default"].defaults(c.config.guide||{},{defaultFill:"rgba(128,128,128,0.25)",padding:{l:0,r:0,t:0,b:0},showNames:!0}),c.contourToFill=null,c.on("highlight-area",function(a,b){return c._highlightArea(b)}),c.on("highlight-point",function(a,b){return c._highlightPoint(b)}),c.on("highlight",function(a,b){return c._highlightPoint(b)}),c}return g(b,a),h(b,[{key:"createScales",value:function(a){var b=this.config,c=b.options,d=b.guide.padding,e=c.width-(d.l+d.r),f=c.height-(d.t+d.b);return this.latScale=a("pos",b.latitude,[0,f]),this.lonScale=a("pos",b.longitude,[e,0]),this.sizeScale=a("size",b.size),this.colorScale=a("color",b.color),this.codeScale=a("value",b.code),this.fillScale=a("fill",b.fill),this.W=e,this.H=f,this.regScale("latitude",this.latScale).regScale("longitude",this.lonScale).regScale("size",this.sizeScale).regScale("color",this.colorScale).regScale("code",this.codeScale).regScale("fill",this.fillScale)}},{key:"drawFrames",value:function(a){var b=this,c=this.config.guide;"string"==typeof c.sourcemap?j["default"].json(c.sourcemap,function(c,d){if(c)throw c;b._drawMap(a,d)}):this._drawMap(a,c.sourcemap)}},{key:"_calcLabels",value:function(a,b,c){var d=this.W,e=this.H,f={};return b.forEach(function(b){var g=n["default"].feature(a,a.objects[b]).features||[],h=g.map(function(a){var e=a.properties||{},f=c.centroid(a),g=c.bounds(a),h=f[0],i=f[1],j=g[1][0],k=g[0][0],l=j-k,m=e.name||"",n=e.abbr||m,o=l<m.length*q,p=o?n:m,r=2.5*q>l,s=r?d-h-3*q:0;return{id:b+"-"+a.id,sx:h,sy:i,x:h+s,y:i,width:p.length*q,height:10,name:p,r:s,isRef:r}}).filter(function(a){return!isNaN(a.x)&&!isNaN(a.y)}),i=h.map(function(a){return{x:a.sx,y:a.sy,r:a.r}});j["default"].labeler().label(h).anchor(i).width(d).height(e).start(r),h.filter(function(a){return!a.isRef}).map(function(a){return a.x=a.sx,a.y=a.sy,a}).reduce(function(a,b){return a[b.id]=b,a},f);var k=h.filter(function(a){return a.isRef});k.length<6&&k.reduce(function(a,b){return a[b.id]=b,a},f)}),f}},{key:"_drawMap",value:function(a,b){var c=this,d=this,e=this.config.guide,f=this.config.options,g=this.config.options.container,h=this.latScale,i=this.lonScale,k=this.sizeScale,m=this.colorScale,o=this.codeScale,p=this.fillScale,r=this.W,u=this.H,v=t.filter(function(a){return(b.objects||{}).hasOwnProperty(a)});if(0===v.length)throw new Error("Invalid map: should contain some contours");var w;if(p.dim){if(!o.georole)throw console.log("Specify [georole] for code scale"),new Error("[georole] is missing");if(-1===v.indexOf(o.georole))throw console.log('There is no contour for georole "'+o.georole+'"'),console.log("Available contours are: "+v.join(" | ")),new Error("Invalid [georole]");w=o.georole}else w=v[v.length-1];this.contourToFill=w;var x;if(h.dim&&i.dim){var y=j["default"].extent(h.domain()),z=j["default"].extent(i.domain());x=[(z[1]+z[0])/2,(y[1]+y[0])/2]}var A=this._createProjection(b,v[0],x),B=j["default"].geo.path().projection(A),C=g.selectAll(".map-container").data([""+r+u+x+v.join("-")],l["default"].identity);C.exit().remove(),C.enter().append("g").call(function(){var a=this;a.attr("class","map-container");var c={},f=v.reduceRight(function(a,b){return a.concat(b)},[]);if(e.showNames&&(c=d._calcLabels(b,f,B)),f.forEach(function(d,e){var f=function(a){return c[d+"-"+a.id]};a.selectAll(".map-contour-"+d).data(n["default"].feature(b,b.objects[d]).features||[]).enter().append("g").call(function(){var a=this;a.attr("class","map-contour-"+d+" map-contour-level map-contour-level-"+e).attr("fill","none"),a.append("title").text(function(a){return(a.properties||{}).name}),a.append("path").attr("d",B),a.append("text").attr("class","place-label-"+d).attr("transform",function(a){var b=f(a);return b?"translate("+[b.x,b.y]+")":""}).text(function(a){var b=f(a);return b?b.name:""}),a.append("line").attr("class","place-label-link-"+d).attr("stroke","gray").attr("stroke-width",.25).attr("x1",function(a){var b=f(a);return b&&b.isRef?b.sx:0}).attr("y1",function(a){var b=f(a);return b&&b.isRef?b.sy:0}).attr("x2",function(a){var b=f(a);return b&&b.isRef?b.x-.6*b.name.length*q:0}).attr("y2",function(a){var b=f(a);return b&&b.isRef?b.y-3.5:0})})}),b.objects.hasOwnProperty("places")){var g=n["default"].feature(b,b.objects.places),h=g.features.map(function(a){var b=A(a.geometry.coordinates);return{x:b[0]+3.5,y:b[1]+3.5,width:a.properties.name.length*q,height:12,name:a.properties.name}}),i=g.features.map(function(a){var b=A(a.geometry.coordinates);return{x:b[0],y:b[1],r:2.5}});j["default"].labeler().label(h).anchor(i).width(r).height(u).start(100),a.selectAll(".place").data(i).enter().append("circle").attr("class","place").attr("transform",function(a){return"translate("+a.x+","+a.y+")"}).attr("r",function(a){return a.r+"px"}),a.selectAll(".place-label").data(h).enter().append("text").attr("class","place-label").attr("transform",function(a){return"translate("+a.x+","+a.y+")"}).text(function(a){return a.name})}}),this.groupByCode=a.reduce(function(a,b){return b.part().reduce(function(a,b){var c=(b[o.dim]||"").toLowerCase();return a[c]=b,a},a)},{});var D=this._resolveFeature.bind(this);if(C.selectAll(".map-contour-"+w).data(n["default"].feature(b,b.objects[w]).features).call(function(){this.classed("map-contour",!0).attr("fill",function(a){var b=D(a);return null===b?e.defaultFill:p(b[p.dim])})}).on("mouseover",function(a){return c.fire("area-mouseover",{data:D(a),event:j["default"].event})}).on("mouseout",function(a){return c.fire("area-mouseout",{data:D(a),event:j["default"].event})}).on("click",function(a){return c.fire("area-click",{data:D(a),event:j["default"].event})}),!h.dim||!i.dim)return[];var E=function(){return this.attr({r:function(a){var b=a.data;return k(b[k.dim])},transform:function(a){var b=a.data;return"translate("+A([b[i.dim],b[h.dim]])+")"},"class":function(a){var b=a.data;return m(b[m.dim])},opacity:s}).on("mouseover",function(a){var b=a.data;return d.fire("point-mouseover",{data:b,event:j["default"].event})}).on("mouseout",function(a){var b=a.data;return d.fire("point-mouseout",{data:b,event:j["default"].event})}).on("click",function(a){var b=a.data;return d.fire("point-click",{data:b,event:j["default"].event})})},F=function(){this.attr("class",function(a){return"frame frame-"+a.hash}).call(function(){var a=this.selectAll("circle").data(function(a){return a.data.map(function(a){return{data:a,uid:f.uid}})});a.exit().remove(),a.call(E),a.enter().append("circle").call(E)})},G=function(a){return{tags:a.key||{},hash:a.hash(),data:a.part()}},H=C.selectAll(".frame").data(a.map(G),function(a){return a.hash});return H.exit().remove(),H.call(F),H.enter().append("g").call(F),[]}},{key:"_resolveFeature",value:function(a){var b,c=this.groupByCode,d=a.properties,e=["c1","c2","c3","abbr","name"].filter(function(a){return d.hasOwnProperty(a)&&d[a]&&c.hasOwnProperty(d[a].toLowerCase())});if(0===e.length)b=null;else if(e.length>0){var f=d[e[0]].toLowerCase();b=c[f]}return b}},{key:"_highlightArea",value:function(a){var b=this,c=this.config.options.container,d=this.contourToFill;c.selectAll(".map-contour-"+d).classed("map-contour-highlighted",function(c){return a(b._resolveFeature(c))})}},{key:"_highlightPoint",value:function(a){this.config.options.container.selectAll("circle").classed("map-point-highlighted",function(b){var c=b.data;return a(c)}).attr("opacity",function(b){var c=b.data;return a(c)?s:.1})}},{key:"_createProjection",value:function(a,b,c){var d=this.W,e=this.H,f=this.config.guide,g=100,h=[d/2,e/2],i=c||a.center,k=f.projection||a.projection||"mercator",l=this._createD3Projection(k,i,g,h),m=j["default"].geo.path().projection(l),o=m.bounds(n["default"].feature(a,a.objects[b])),p=g*d/(o[1][0]-o[0][0]),q=g*e/(o[1][1]-o[0][1]);return g=q>p?p:q,h=[d-(o[0][0]+o[1][0])/2,e-(o[0][1]+o[1][1])/2],this._createD3Projection(k,i,g,h)}},{key:"_createD3Projection",value:function(a,b,c,d){var e=j["default"].geo[a];if(!e)throw console.log('Unknown projection "'+a+'"'),console.log("See available projection types here: https://github.com/mbostock/d3/wiki/Geo-Projections"),new Error('Invalid map: unknown projection "'+a+'"');var f=e(),g=[{method:"scale",args:c},{method:"center",args:b},{method:"translate",args:d}].filter(function(a){return a.args});return g.reduce(function(a,b){return a[b.method]&&(a=a[b.method](b.args)),a},f)}}]),b}(p.Element)},function(a,b,c){!function(a,c){c(b)}(this,function(a){"use strict";function b(){}function c(a){if(!a)return b;var c,d,e=a.scale[0],f=a.scale[1],g=a.translate[0],h=a.translate[1];return function(a,b){b||(c=d=0),a[0]=(c+=a[0])*e+g,a[1]=(d+=a[1])*f+h}}function d(a){if(!a)return b;var c,d,e=a.scale[0],f=a.scale[1],g=a.translate[0],h=a.translate[1];return function(a,b){b||(c=d=0);var i=(a[0]-g)/e|0,j=(a[1]-h)/f|0;a[0]=i-c,a[1]=j-d,c=i,d=j}}function e(a,b){for(var c,d=a.length,e=d-b;e<--d;)c=a[e],a[e++]=a[d],a[d]=c}function f(a,b){for(var c=0,d=a.length;d>c;){var e=c+d>>>1;a[e]<b?c=e+1:d=e}return c}function g(a,b){return"GeometryCollection"===b.type?{type:"FeatureCollection",features:b.geometries.map(function(b){return h(a,b)})}:h(a,b)}function h(a,b){var c={type:"Feature",id:b.id,properties:b.properties||{},geometry:i(a,b)};return null==b.id&&delete c.id,c}function i(a,b){function d(a,b){b.length&&b.pop();for(var c,d=l[0>a?~a:a],f=0,g=d.length;g>f;++f)b.push(c=d[f].slice()),k(c,f);0>a&&e(b,g)}function f(a){return a=a.slice(),k(a,0),a}function g(a){for(var b=[],c=0,e=a.length;e>c;++c)d(a[c],b);return b.length<2&&b.push(b[0].slice()),b}function h(a){for(var b=g(a);b.length<4;)b.push(b[0].slice());return b}function i(a){return a.map(h)}function j(a){var b=a.type;return"GeometryCollection"===b?{type:b,geometries:a.geometries.map(j)}:b in m?{type:b,coordinates:m[b](a)}:null}var k=c(a.transform),l=a.arcs,m={Point:function(a){return f(a.coordinates)},MultiPoint:function(a){return a.coordinates.map(f)},LineString:function(a){return g(a.arcs)},MultiLineString:function(a){return a.arcs.map(g)},Polygon:function(a){return i(a.arcs)},MultiPolygon:function(a){return a.arcs.map(i)}};return j(b)}function j(a,b){function c(b){var c,d=a.arcs[0>b?~b:b],e=d[0];return a.transform?(c=[0,0],d.forEach(function(a){c[0]+=a[0],c[1]+=a[1]})):c=d[d.length-1],0>b?[c,e]:[e,c]}function d(a,b){for(var c in a){var d=a[c];delete b[d.start],delete d.start,delete d.end,d.forEach(function(a){e[0>a?~a:a]=1}),h.push(d)}}var e={},f={},g={},h=[],i=-1;return b.forEach(function(c,d){var e,f=a.arcs[0>c?~c:c];f.length<3&&!f[1][0]&&!f[1][1]&&(e=b[++i],b[i]=c,b[d]=e)}),b.forEach(function(a){var b,d,e=c(a),h=e[0],i=e[1];if(b=g[h])if(delete g[b.end],b.push(a),b.end=i,d=f[i]){delete f[d.start];var j=d===b?b:b.concat(d);f[j.start=b.start]=g[j.end=d.end]=j}else f[b.start]=g[b.end]=b;else if(b=f[i])if(delete f[b.start],b.unshift(a),b.start=h,d=g[h]){delete g[d.end];var k=d===b?b:d.concat(b);f[k.start=d.start]=g[k.end=b.end]=k}else f[b.start]=g[b.end]=b;else b=[a],f[b.start=h]=g[b.end=i]=b}),d(g,f),d(f,g),b.forEach(function(a){e[0>a?~a:a]||h.push([a])}),h}function k(a){return i(a,l.apply(this,arguments))}function l(a,b,c){function d(a){var b=0>a?~a:a;(k[b]||(k[b]=[])).push({i:a,g:i})}function e(a){a.forEach(d)}function f(a){a.forEach(e)}function g(a){"GeometryCollection"===a.type?a.geometries.forEach(g):a.type in l&&(i=a,l[a.type](a.arcs))}var h=[];if(arguments.length>1){var i,k=[],l={LineString:e,MultiLineString:f,Polygon:f,MultiPolygon:function(a){a.forEach(f)}};g(b),k.forEach(arguments.length<3?function(a){h.push(a[0].i)}:function(a){c(a[0].g,a[a.length-1].g)&&h.push(a[0].i)})}else for(var m=0,n=a.arcs.length;n>m;++m)h.push(m);return{type:"MultiLineString",arcs:j(a,h)}}function m(a){var b=a[0],c=a[1],d=a[2];return Math.abs((b[0]-d[0])*(c[1]-b[1])-(b[0]-c[0])*(d[1]-b[1]))}function n(a){for(var b,c=-1,d=a.length,e=a[d-1],f=0;++c<d;)b=e,e=a[c],f+=b[0]*e[1]-b[1]*e[0];return f/2}function o(a){return i(a,p.apply(this,arguments))}function p(a,b){function c(a){a.forEach(function(b){b.forEach(function(b){(e[b=0>b?~b:b]||(e[b]=[])).push(a)})}),f.push(a)}function d(b){return n(i(a,{type:"Polygon",arcs:[b]}).coordinates[0])>0}var e={},f=[],g=[];return b.forEach(function(a){"Polygon"===a.type?c(a.arcs):"MultiPolygon"===a.type&&a.arcs.forEach(c)}),f.forEach(function(a){if(!a._){var b=[],c=[a];for(a._=1,g.push(b);a=c.pop();)b.push(a),a.forEach(function(a){a.forEach(function(a){e[0>a?~a:a].forEach(function(a){a._||(a._=1,c.push(a))})})})}}),f.forEach(function(a){delete a._}),{type:"MultiPolygon",arcs:g.map(function(b){var c,f=[];if(b.forEach(function(a){a.forEach(function(a){a.forEach(function(a){e[0>a?~a:a].length<2&&f.push(a)})})}),f=j(a,f),(c=f.length)>1)for(var g,h=d(b[0][0]),i=0;c>i;++i)if(h===d(f[i])){g=f[0],f[0]=f[i],f[i]=g;break}return f})}}function q(a){function b(a,b){a.forEach(function(a){0>a&&(a=~a);var c=e[a];c?c.push(b):e[a]=[b]})}function c(a,c){a.forEach(function(a){b(a,c)})}function d(a,b){"GeometryCollection"===a.type?a.geometries.forEach(function(a){d(a,b)}):a.type in h&&h[a.type](a.arcs,b)}var e={},g=a.map(function(){return[]}),h={LineString:b,MultiLineString:c,Polygon:c,MultiPolygon:function(a,b){a.forEach(function(a){c(a,b)})}};a.forEach(d);for(var i in e)for(var j=e[i],k=j.length,l=0;k>l;++l)for(var m=l+1;k>m;++m){var n,o=j[l],p=j[m];(n=g[o])[i=f(n,p)]!==p&&n.splice(i,0,p),(n=g[p])[i=f(n,o)]!==o&&n.splice(i,0,o)}return g}function r(a,b){return a[1][2]-b[1][2]}function s(){function a(a,b){for(;b>0;){var c=(b+1>>1)-1,e=d[c];if(r(a,e)>=0)break;d[e._=b]=e,d[a._=b=c]=a}}function b(a,b){for(;;){var c=b+1<<1,f=c-1,g=b,h=d[g];if(e>f&&r(d[f],h)<0&&(h=d[g=f]),e>c&&r(d[c],h)<0&&(h=d[g=c]),g===b)break;d[h._=b]=h,d[a._=b=g]=a}}var c={},d=[],e=0;return c.push=function(b){return a(d[b._=e]=b,e++),e},c.pop=function(){if(!(0>=e)){var a,c=d[0];return--e>0&&(a=d[e],b(d[a._=0]=a,0)),c}},c.remove=function(c){var f,g=c._;if(d[g]===c)return g!==--e&&(f=d[e],(r(f,c)<0?a:b)(d[f._=g]=f,g)),g},c}function t(a,b){function e(a){h.remove(a),a[1][2]=b(a),h.push(a)}var f=c(a.transform),g=d(a.transform),h=s();return b||(b=m),a.arcs.forEach(function(a){var c,d,i,j,k=[],l=0;for(d=0,i=a.length;i>d;++d)j=a[d],f(a[d]=[j[0],j[1],1/0],d);for(d=1,i=a.length-1;i>d;++d)c=a.slice(d-1,d+2),c[1][2]=b(c),k.push(c),h.push(c);for(d=0,i=k.length;i>d;++d)c=k[d],c.previous=k[d-1],c.next=k[d+1];for(;c=h.pop();){var m=c.previous,n=c.next;c[1][2]<l?c[1][2]=l:l=c[1][2],m&&(m.next=n,m[2]=c[2],e(m)),n&&(n.previous=m,n[0]=c[0],e(n))}a.forEach(g)}),a}var u="1.6.24";a.version=u,a.mesh=k,a.meshArcs=l,a.merge=o,a.mergeArcs=p,a.feature=g,a.neighbors=q,a.presimplify=t})},function(a,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0});var c=function(){var a,b=[],c=[],d=1,e=1,f={},g=5,h=.5,i=0,j=0,k=.2,l=1,m=30,n=30,o=3,p=!1,q=function(a){var d=b.length,e=0,f=b[a].x-c[a].x,g=c[a].y-b[a].y,h=Math.sqrt(f*f+g*g),i=!0;h>0&&(e+=h*k),f/=h,g/=h,e+=f>0&&g>0?0*o:0>f&&g>0?1*o:0>f&&0>g?2*o:3*o;for(var j,p,q,r,s,u,v,w=b[a].x,x=b[a].y-b[a].height+2,y=b[a].x+b[a].width,z=b[a].y+2,A=0;d>A;A++)A!=a&&(i=t(c[a].x,b[a].x,c[A].x,b[A].x,c[a].y,b[a].y,c[A].y,b[A].y),i&&(e+=l),j=b[A].x,q=b[A].y-b[A].height+2,p=b[A].x+b[A].width,r=b[A].y+2,s=Math.max(0,Math.min(p,y)-Math.max(j,w)),u=Math.max(0,Math.min(r,z)-Math.max(q,x)),v=s*u,e+=v*m),j=c[A].x-c[A].r,q=c[A].y-c[A].r,p=c[A].x+c[A].r,r=c[A].y+c[A].r,s=Math.max(0,Math.min(p,y)-Math.max(j,w)),u=Math.max(0,Math.min(r,z)-Math.max(q,x)),v=s*u,e+=v*n;return e},r=function(f){var h,k=Math.floor(Math.random()*b.length),l=b[k].x,m=b[k].y;h=p?a(k,b,c):q(k),b[k].x+=(Math.random()-.5)*g,b[k].y+=(Math.random()-.5)*g,b[k].x>d&&(b[k].x=l),b[k].x<0&&(b[k].x=l),b[k].y>e&&(b[k].y=m),b[k].y<0&&(b[k].y=m);var n;n=p?a(k,b,c):q(k);var o=n-h;Math.random()<Math.exp(-o/f)?i+=1:(b[k].x=l,b[k].y=m,j+=1)},s=function(f){var g,k=Math.floor(Math.random()*b.length),l=b[k].x,m=b[k].y;g=p?a(k,b,c):q(k);var n=(Math.random()-.5)*h,o=Math.sin(n),r=Math.cos(n);b[k].x-=c[k].x,b[k].y-=c[k].y;var s=b[k].x*r-b[k].y*o,t=b[k].x*o+b[k].y*r;b[k].x=s+c[k].x,b[k].y=t+c[k].y,b[k].x>d&&(b[k].x=l),b[k].x<0&&(b[k].x=l),b[k].y>e&&(b[k].y=m),b[k].y<0&&(b[k].y=m);var u;u=p?a(k,b,c):q(k);var v=u-g;Math.random()<Math.exp(-v/f)?i+=1:(b[k].x=l,b[k].y=m,j+=1)},t=function(a,b,c,d,e,f,g,h){var i,j,k,l,m;return k=(h-g)*(b-a)-(d-c)*(f-e),l=(d-c)*(e-g)-(h-g)*(a-c),m=(b-a)*(e-g)-(f-e)*(a-c),i=l/k,j=m/k,!(0>i||i>1||0>j||j>1)},u=function(a,b,c){return a-b/c};return f.start=function(a){for(var c=b.length,d=1,e=1,f=0;a>f;f++){for(var g=0;c>g;g++)Math.random()<.5?r(d):s(d);d=u(d,e,a)}},f.width=function(a){return arguments.length?(d=a,f):d},f.height=function(a){return arguments.length?(e=a,f):e},f.label=function(a){return arguments.length?(b=a,f):b},f.anchor=function(a){return arguments.length?(c=a,f):c},f.alt_energy=function(b){return arguments.length?(a=b,p=!0,f):q},f.alt_schedule=function(){return arguments.length?f:u},f};b.d3Labeler=c},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.GenericCartesian=void 0;var i=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),j=c(7),k=c(9),l=c(17),m=c(3),n=d(m),o=c(2),p=d(o);b.GenericCartesian=function(a){function b(a){f(this,b);var c=g(this,Object.getPrototypeOf(b).call(this,a));c.config=a,c.config.guide=n["default"].defaults(c.config.guide||{},{animationSpeed:0,prettify:!0,enableColorToBarPosition:!1}),c.config.guide.size=n["default"].defaults(c.config.guide.size||{},{defMinSize:10,defMaxSize:c.isEmptySize?10:40,enableDistributeEvenly:!c.isEmptySize}),c.defMin=a.guide.size.defMinSize,c.defMax=a.guide.size.defMaxSize,c.minLimit=a.guide.size.minSize,c.maxLimit=a.guide.size.maxSize,c.isHorizontal=c.config.flip;var d=c.config.stack,e=c.config.guide.enableColorToBarPosition,h=c.config.guide.size.enableDistributeEvenly;return c.decorators=[k.CartesianGrammar.decorator_orientation,k.CartesianGrammar.decorator_groundY0,k.CartesianGrammar.decorator_group,k.CartesianGrammar.decorator_groupOrderByColor,d&&k.CartesianGrammar.decorator_stack,e&&k.CartesianGrammar.decorator_positioningByColor,k.CartesianGrammar.decorator_dynamic_size,k.CartesianGrammar.decorator_color,k.CartesianGrammar.decorator_label,a.adjustPhase&&d&&k.CartesianGrammar.adjustYScale,a.adjustPhase&&(h?k.CartesianGrammar.adjustSigmaSizeScale:k.CartesianGrammar.adjustStaticSizeScale)].concat(a.transformModel||[]),c}return h(b,a),i(b,[{key:"createScales",value:function(a){var b=this.config;return this.xScale=a("pos",b.x,[0,b.options.width]),this.yScale=a("pos",b.y,[b.options.height,0]),this.size=a("size",b.size,{}),this.color=a("color",b.color,{}),this.split=a("split",b.split,{}),this.label=a("label",b.label,{}),this.identity=a("identity",b.identity,{}),this.regScale("x",this.xScale).regScale("y",this.yScale).regScale("size",this.size).regScale("color",this.color).regScale("split",this.split).regScale("label",this.label)}},{key:"walkFrames",value:function(){var a={defMin:this.defMin,defMax:this.defMax,minLimit:this.minLimit,maxLimit:this.maxLimit,isHorizontal:this.isHorizontal,dataSource:this.data()};return this.decorators.filter(function(a){return a}).reduce(function(b,c){return k.CartesianGrammar.compose(b,c(b,a))},new k.CartesianGrammar({scaleX:this.xScale,scaleY:this.yScale,scaleSize:this.size,scaleLabel:this.label,scaleColor:this.color,scaleSplit:this.split,scaleIdentity:this.identity}))}},{key:"drawFrames",value:function(){var a=this,b=this.config.options,c=function(a,b){var c=Math.pow(10,b);return Math.round(c*a)/c},d=function(b){return c(a.screenModel.size(b)/2,4)},f=l.d3_animationInterceptor,g=function(b,c,d){var e=a.config.guide.animationSpeed,g=b.selectAll("."+c).data(function(a){return[a]},a.screenModel.id);g.exit().call(f(e,null,{width:0},function(a){return p["default"].select(a).remove()})),g.call(f(e,null,d)),g.enter().append("rect").style("stroke-width",0).call(f(e,{width:0},d))},h=this.config.flip,i=h?"y":"x",j=h?"x":"y",k=h?"x0":"y0",m=h?"height":"width",o=h?"width":"height",q=function(){var b,c,f;g(this,"lvl-top",(b={},e(b,m,function(a){return d(a)}),e(b,o,1),e(b,i,function(b){return a.screenModel[i](b)-d(b)/2}),e(b,j,function(b){return a.screenModel[j](b)}),e(b,"fill",function(b){return a.screenModel.color(b)}),e(b,"class",function(b){return"lvl-top "+a.screenModel["class"](b)}),b)),g(this,"lvl-btm",(c={},e(c,m,function(a){return d(a)}),e(c,o,1),e(c,i,function(b){return a.screenModel[i](b)-d(b)/2}),e(c,j,function(b){return a.screenModel[k](b)}),e(c,"fill",function(b){return a.screenModel.color(b)}),e(c,"class",function(b){return"lvl-btm "+a.screenModel["class"](b)}),c)),g(this,"lvl-link",(f={},e(f,m,.5),e(f,o,function(b){return Math.abs(a.screenModel[j](b)-a.screenModel[k](b))}),e(f,i,function(b){return a.screenModel[i](b)-.25}),e(f,j,function(b){return Math.min(a.screenModel[j](b),a.screenModel[k](b))}),e(f,"fill",function(b){return a.screenModel.color(b)}),e(f,"class",function(b){return"lvl-link "+a.screenModel["class"](b)}),f))},r=function(){this.attr("class","frame-id-"+a.config.uid).call(function(){var b=this.selectAll(".generic").data(function(a){return a},a.screenModel.id);b.exit().remove(),b.call(q),b.enter().append("g").attr("class","generic").call(q)})},s=n["default"].groupBy(this.data(),a.screenModel.group),t=Object.keys(s).sort(function(b,c){return a.screenModel.order(b)-a.screenModel.order(c)}).reduce(function(a,b){return a.concat([s[b]])},[]),u=b.container.selectAll(".frame-id-"+a.config.uid).data(t);u.exit().remove(),u.call(r),u.enter().append("g").call(r)}}]),b}(j.Element)},function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.Path=void 0;var g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=function m(a,b,c){null===a&&(a=Function.prototype);var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){var e=Object.getPrototypeOf(a);return null===e?void 0:m(e,b,c)}if("value"in d)return d.value;var f=d.get;if(void 0!==f)return f.call(c)},i=c(6),j=c(9),k=c(19),l=c(20);b.Path=function(a){function b(a){d(this,b);var c=e(this,Object.getPrototypeOf(b).call(this,a));return c.decorators=[j.CartesianGrammar.decorator_orientation,j.CartesianGrammar.decorator_group,j.CartesianGrammar.decorator_dynamic_size,j.CartesianGrammar.decorator_color,j.CartesianGrammar.decorator_label,a.adjustPhase&&j.CartesianGrammar.adjustStaticSizeScale].concat(a.transformModel||[]),c}return f(b,a),g(b,[{key:"buildModel",value:function(a){var c=this,d=h(Object.getPrototypeOf(b.prototype),"buildModel",this).call(this,a);d.matchRowInCoordinates=function(a,b){var e=b.x,f=b.y,g=a.map(function(a){var b=d.x(a),g=d.y(a);return{x:b,y:g,dist:c.getDistance(e,f,b,g),data:a}}).sort(function(a,b){return a.dist-b.dist})[0];return g.data};var e=this.config.guide,f=(0,l.getLineClassesByCount)(a.model.scaleColor.domain().length),g=i.CSS_PREFIX+"area area i-role-path "+f+" "+e.cssClass+" ";d.groupAttributes={"class":function(a){return g+" "+d["class"](a[0])+" frame"}};var j=function(a,b){return function(c){return c.map(function(c){return[a(c),b(c)].join(",")}).join(" ")}},k={points:j(d.x,d.y0)},m={fill:function(a){return d.color(a[0])},stroke:function(a){return d.color(a[0])},points:j(d.x,d.y)};return d.pathAttributesUpdateInit=null,d.pathAttributesUpdateDone=m,d.pathAttributesEnterInit=k,d.pathAttributesEnterDone=m,d.pathElement="polygon",d}}]),b}(k.BasePath)},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.ParallelLine=void 0;var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=c(6),j=c(7),k=c(3),l=d(k),m=c(2),n=d(m);b.ParallelLine=function(a){function b(a){e(this,b);var c=f(this,Object.getPrototypeOf(b).call(this,a));return c.config=a,c.config.guide=l["default"].defaults(c.config.guide||{},{}),c.on("highlight",function(a,b){return c.highlight(b)}),c}return g(b,a),h(b,[{key:"createScales",value:function(a){var b=this.config,c=b.options;this.color=a("color",b.color,{}),this.scalesMap=b.columns.reduce(function(b,d){return b[d]=a("pos",d,[c.height,0]),b},{});var d=c.width/(b.columns.length-1),e=b.columns.reduce(function(a,b,c){return a[b]=c*d,a},{});return this.xBase=function(a){return e[a]},this.regScale("columns",this.scalesMap).regScale("color",this.color)}},{key:"drawFrames",value:function(a){var b=this.config,c=this.config.options,d=this.scalesMap,e=this.xBase,f=this.color,g=n["default"].svg.line(),h=function(){
  this.attr({d:function(a){return g(b.columns.map(function(b){return[e(b),d[b](a[d[b].dim])]}))}})},j=function(){this.attr({stroke:function(a){return f.toColor(f(a[f.dim]))},"class":function(a){return i.CSS_PREFIX+"__line line "+f.toClass(f(a[f.dim]))+" foreground"}})},k=function(){var a=this.selectAll(".background").data(function(a){return a.part()});a.exit().remove(),a.call(h),a.enter().append("path").attr("class","background line").call(h);var b=this.selectAll(".foreground").data(function(a){return a.part()});b.exit().remove(),b.call(function(){h.call(this),j.call(this)}),b.enter().append("path").call(function(){h.call(this),j.call(this)})},l=c.container.selectAll(".lines-frame").data(a,function(a){return a.hash()});l.exit().remove(),l.call(k),l.enter().append("g").attr("class","lines-frame").call(k),this.subscribe(c.container.selectAll(".lines-frame .foreground"))}},{key:"highlight",value:function(a){this.config.options.container.selectAll(".lines-frame .foreground").style("visibility",function(b){return a(b)?"":"hidden"})}}]),b}(j.Element)},function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.IdentityScale=void 0;var g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=c(121);b.IdentityScale=function(a){function b(a,c){d(this,b);var f=e(this,Object.getPrototypeOf(b).call(this,a,c));return f._references=c.references,f._refCounter=c.refCounter,f.addField("scaleType","identity"),f}return f(b,a),g(b,[{key:"create",value:function(){var a=this._references,b=this._refCounter;return this.toBaseScale(function(c,d){if(null==c){var e=a.get(d);null==e&&(e=b(),a.set(d,e))}else e=c;return e})}}]),b}(h.BaseScale)},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0}),b.BaseScale=void 0;var f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=c(4),h=c(3),i=d(h),j=function(a){return"date"===a?function(a){return new Date(a).getTime()}:function(a){return a}},k=function(a,b){return g.utils.generateHash([a,b].map(JSON.stringify).join(""))};b.BaseScale=function(){function a(b,c){var d=this;e(this,a),this._fields={};var f;if(i["default"].isArray(c.fitToFrameByDims)&&c.fitToFrameByDims.length){var g=function(a){var b={};return"where"===a.type&&a.args?(b.type=a.type,b.args=c.fitToFrameByDims.reduce(function(b,c){return a.args.hasOwnProperty(c)&&(b[c]=a.args[c]),b},{})):b=a,b};f=b.part(g)}else f=b.full();var h=this.getVarSet(f,c);c.order&&(h=i["default"].union(i["default"].intersection(c.order,h),h)),this.vars=h;var j=h.map(function(a){return a});this.scaleConfig=c,this.scaleConfig.nice=this.scaleConfig.hasOwnProperty("nice")?this.scaleConfig.nice:this.scaleConfig.autoScale,this.addField("dim",this.scaleConfig.dim).addField("scaleDim",this.scaleConfig.dim).addField("scaleType",this.scaleConfig.type).addField("source",this.scaleConfig.source).addField("domain",function(){return d.vars}).addField("originalSeries",function(){return j}).addField("isContains",function(a){return d.isInDomain(a)}).addField("fixup",function(a){var b=d.scaleConfig;b.__fixup__=b.__fixup__||{},b.__fixup__=i["default"].extend(b.__fixup__,a(i["default"].extend({},b,b.__fixup__)))}).addField("commit",function(){d.scaleConfig=i["default"].extend(d.scaleConfig,d.scaleConfig.__fixup__),delete d.scaleConfig.__fixup__})}return f(a,[{key:"isInDomain",value:function(a){return this.domain().indexOf(a)>=0}},{key:"addField",value:function(a,b){return this._fields[a]=b,this[a]=b,this}},{key:"getField",value:function(a){return this._fields[a]}},{key:"toBaseScale",value:function(a){var b=this,c=arguments.length<=1||void 0===arguments[1]?null:arguments[1],d=Object.keys(this._fields).reduce(function(a,c){return a[c]=b._fields[c],a},a);return d.getHash=function(){return k(b.vars,c)},d.value=d,d}},{key:"getVarSet",value:function(a,b){var c=b.hasOwnProperty("series")?b.series:a.map(function(a){return a[b.dim]});return i["default"].uniq(c,j(b.dimType))}}]),a}()},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.ColorScale=void 0;var i=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),j=c(121),k=c(4),l=c(3),m=d(l),n=c(2),o=d(n);b.ColorScale=function(a){function b(a,c){f(this,b);var d=g(this,Object.getPrototypeOf(b).call(this,a,c)),h="measure"!==c.dimType,i=d.scaleConfig.brewer||(h?m["default"].times(20,function(a){return"color20-"+(1+a)}):["#eee","#000"]),j=d.scaleConfig;if(!h){var l=o["default"].extent(d.vars),n=function(a){return!isNaN(a)&&(m["default"].isNumber(a)||m["default"].isDate(a))},p=n(j.min)?j.min:l[0],q=n(j.max)?j.max:l[1],r=[p,l[0]].filter(n),s=[q,l[1]].filter(n);if(l=[r.sort(function(a,b){return a-b})[0],s.sort(function(a,b){return b-a})[0]],j.nice&&l[0]<0&&l[1]>0){var t=Math.max.apply(Math,e(l.map(Math.abs)));l=[-t,t]}d.vars=l}return d.addField("scaleType","color").addField("discrete",h).addField("brewer",i).addField("toColor",k.utils.extRGBColor).addField("toClass",k.utils.extCSSClass),d}return h(b,a),i(b,[{key:"create",value:function(){var a=this.discrete,b=this.vars,c=this.getField("brewer"),d=a?this.createDiscreteScale(b,c):this.createContinuesScale(b,c);return this.toBaseScale(d)}},{key:"createDiscreteScale",value:function(a,b){var c,d=m["default"].constant("color-default"),e=function(a,b){var c=a.map(function(a){return String(a).toString()});return o["default"].scale.ordinal().range(b).domain(c)},f=function(a,b){var c=m["default"].keys(a),d=m["default"].values(a),e=o["default"].scale.ordinal().range(d).domain(c);return function(c){return a.hasOwnProperty(c)?e(c):b(c)}},g=function(a){return function(b){return a(String(b).toString())}};if(m["default"].isArray(b))c=g(e(a,b));else if(m["default"].isFunction(b))c=function(c){return b(c,g(e(a,m["default"].times(20,function(a){return"color20-"+(1+a)}))))};else{if(!m["default"].isObject(b))throw new Error("This brewer is not supported");c=f(b,d)}return c}},{key:"createContinuesScale",value:function(a,b){var c;if(!m["default"].isArray(b))throw new Error("This brewer is not supported");return c=o["default"].scale.linear().domain(k.utils.splitEvenly(a.map(function(a){return a-0}),b.length)).range(b)}}]),b}(j.BaseScale)},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.SizeScale=void 0;var i=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),j=c(121),k=c(3),l=d(k),m=c(2),n=d(m),o={sqrt:function(a){return Math.sqrt(a)},linear:function(a){return a}};b.SizeScale=function(a){function b(a,c){f(this,b);var d=g(this,Object.getPrototypeOf(b).call(this,a,c)),h=function(a){return!isNaN(a)&&l["default"].isNumber(a)},i=d.scaleConfig,j=n["default"].extent(d.vars),k=h(i.min)?i.min:j[0],m=h(i.max)?i.max:j[1];return d.vars=[Math.min.apply(Math,e([k,j[0]].filter(h))),Math.max.apply(Math,e([m,j[1]].filter(h)))],d.addField("scaleType","size"),d}return h(b,a),i(b,[{key:"isInDomain",value:function(a){var b=this.domain().sort(),c=b[0],d=b[b.length-1];return!isNaN(c)&&!isNaN(d)&&d>=a&&a>=c}},{key:"create",value:function(){var a,b=this.scaleConfig,c=this.vars,d=l["default"].defaults({},b,{func:"sqrt",minSize:0,maxSize:1}),f=d.func,g=d.minSize,h=d.maxSize,i=o[f],j=l["default"].filter(c,l["default"].isFinite);if(0===j.length)a=function(){return h};else{var k=1,m=0,n=Math.min.apply(Math,e(j)),p=Math.max.apply(Math,e(j)),q=i(Math.max(Math.abs(n),Math.abs(p),p-n));m=0>n?n:0,k=0===q?1:(h-g)/q,a=function(a){var b=null!==a?parseFloat(a):0;if(!l["default"].isFinite(b))return h;var c=b-m;return g+i(c)*k}}return this.toBaseScale(a)}}]),b}(j.BaseScale)},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.OrdinalScale=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},j=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),k=c(121),l=c(2),m=d(l);b.OrdinalScale=function(a){function b(a,c){f(this,b);var d=g(this,Object.getPrototypeOf(b).call(this,a,c));return d.addField("scaleType","ordinal").addField("discrete",!0),d}return h(b,a),j(b,[{key:"create",value:function(a){var b=this.scaleConfig,c=this.vars,d=m["default"].scale.ordinal().domain(c),f=d.rangePoints(a,1),g=Math.max.apply(Math,e(a)),h=function(a){var d=i(b.ratio);return"function"===d?b.ratio(a,g,c):"object"===d?b.ratio[a]:1/c.length},j=function(a){var d;return d=b.ratio?g-c.slice(c.indexOf(a)+1).reduce(function(a,b){return a+g*h(b)},g*h(a)*.5):f(a)};return Object.keys(f).forEach(function(a){return j[a]=f[a]}),j.stepSize=function(a){return h(a)*g},this.toBaseScale(j,a)}}]),b}(k.BaseScale)},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.PeriodScale=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},j=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),k=c(121),l=c(26),m=c(3),n=d(m),o=c(2),p=d(o);b.PeriodScale=function(a){function b(a,c){f(this,b);var d=g(this,Object.getPrototypeOf(b).call(this,a,c)),e=d.scaleConfig,h=d.vars,i=p["default"].extent(h),j=n["default"].isNull(e.min)||n["default"].isUndefined(e.min)?i[0]:new Date(e.min).getTime(),k=n["default"].isNull(e.max)||n["default"].isUndefined(e.max)?i[1]:new Date(e.max).getTime(),m=[new Date(Math.min(j,i[0])),new Date(Math.max(k,i[1]))],o=l.UnitDomainPeriodGenerator.get(e.period);return e.fitToFrameByDims||null===o?d.vars=(0,n["default"])(h).chain().uniq(function(a){return new Date(a).getTime()}).map(function(a){return new Date(a)}).sortBy(function(a){return-a}).value():d.vars=l.UnitDomainPeriodGenerator.generate(m[0],m[1],e.period),d.addField("scaleType","period").addField("period",d.scaleConfig.period).addField("discrete",!0),d}return h(b,a),j(b,[{key:"isInDomain",value:function(a){var b=l.UnitDomainPeriodGenerator.get(this.scaleConfig.period),c=b.cast(new Date(a)).getTime();return this.domain().map(function(a){return a.getTime()}).indexOf(c)>=0}},{key:"create",value:function(a){var b=this.vars,c=this.vars.map(function(a){return a.getTime()}),d=this.scaleConfig,f=p["default"].scale.ordinal().domain(b),g=f.rangePoints(a,1),h=p["default"].scale.ordinal().domain(c.map(String)),j=h.rangePoints(a,1),k=Math.max.apply(Math,e(a)),l=function(a){var e=new Date(a).getTime(),f=i(d.ratio);return"function"===f?d.ratio(e,k,c):"object"===f?d.ratio[e]:1/b.length},m=function(a){var b,e=new Date(a),f=e.getTime();return b=d.ratio?k-c.slice(c.indexOf(f)+1).reduce(function(a,b){return a+k*l(b)},k*l(a)*.5):j(String(f))};return Object.keys(g).forEach(function(a){return m[a]=g[a]}),m.stepSize=function(a){return l(a)*k},this.toBaseScale(m,a)}}]),b}(k.BaseScale)},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.TimeScale=void 0;var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=c(121),j=c(3),k=d(j),l=c(2),m=d(l);b.TimeScale=function(a){function b(a,c){e(this,b);var d=f(this,Object.getPrototypeOf(b).call(this,a,c)),g=d.scaleConfig,h=d.vars,i=m["default"].extent(h).map(function(a){return new Date(a)}),j=k["default"].isNull(g.min)||k["default"].isUndefined(g.min)?i[0]:new Date(g.min).getTime(),l=k["default"].isNull(g.max)||k["default"].isUndefined(g.max)?i[1]:new Date(g.max).getTime();if(h=[new Date(Math.min(j,i[0])),new Date(Math.max(l,i[1]))],d.niceIntervalFn=null,g.nice){var n=g.niceInterval;if(m["default"].time[n]?d.niceIntervalFn=m["default"].time[n]:d.niceIntervalFn=null,h[0]-h[1]===0){var o=864e5;h=[new Date(h[0].getTime()-o),new Date(h[1].getTime()+o)]}d.vars=m["default"].time.scale().domain(h).nice(d.niceIntervalFn).domain()}else d.vars=h;return d.addField("scaleType","time"),d}return g(b,a),h(b,[{key:"isInDomain",value:function(a){var b=new Date(a),c=this.domain(),d=c[0],e=c[c.length-1];return!isNaN(d)&&!isNaN(e)&&e>=b&&b>=d}},{key:"create",value:function(a){var b=this.vars,c=m["default"].time.scale().domain(b);this.scaleConfig.nice&&(c=c.nice(this.niceIntervalFn));var d=c.range(a),e=function(a){var c=b[0],e=b[1];return a>e&&(a=e),c>a&&(a=c),d(new Date(a))};return Object.keys(d).forEach(function(a){return e[a]=d[a]}),e.stepSize=function(){return 0},this.toBaseScale(e,a)}}]),b}(i.BaseScale)},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.LinearScale=void 0;var i=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),j=c(121),k=c(4),l=c(3),m=d(l),n=c(2),o=d(n);b.LinearScale=function(a){function b(a,c){f(this,b);var d=g(this,Object.getPrototypeOf(b).call(this,a,c)),h=function(a){return!isNaN(a)&&m["default"].isNumber(a)},i=d.scaleConfig,j=o["default"].extent(d.vars),l=h(i.min)?i.min:j[0],n=h(i.max)?i.max:j[1];return j=[Math.min.apply(Math,e([l,j[0]].filter(h))),Math.max.apply(Math,e([n,j[1]].filter(h)))],d.vars=i.nice?k.utils.niceZeroBased(j):o["default"].extent(j),d.addField("scaleType","linear").addField("discrete",!1),d}return h(b,a),i(b,[{key:"isInDomain",value:function(a){var b=this.domain(),c=b[0],d=b[b.length-1];return!isNaN(c)&&!isNaN(d)&&d>=a&&a>=c}},{key:"create",value:function(a){var b=this.vars,c=o["default"].scale.linear().domain(b),d=c.rangeRound(a,1),e=function(a){var c=b[0],e=b[1],f=a;return f>e&&(f=e),c>f&&(f=c),d(f)};return Object.keys(d).forEach(function(a){return e[a]=d[a]}),e.stepSize=function(){return 0},this.toBaseScale(e,a)}}]),b}(j.BaseScale)},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function g(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function h(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}function i(a){return Math.log(a)/Math.LN10}function j(a){if(a[0]*a[1]<=0)throw new o.TauChartError("Logarithmic scale domain cannot cross zero.",o.errorCodes.INVALID_LOG_DOMAIN)}function k(a){var b=a.copy;return a.ticks=function(b){for(var c=10,d=[],e=s["default"].extent(a.domain()),f=Math.floor(i(e[0])),g=Math.ceil(i(e[1])),h=Math.ceil((g-f)*c/(Math.ceil(b/c)*c)),j=f;g>=j;j+=h)for(var k=1;c>=k;k++){var l=Math.pow(k,h)*Math.pow(10,j);l=parseFloat(l.toExponential(0)),l>=e[0]&&l<=e[1]&&d.push(l)}return d},a.copy=function(){var c=b.call(a);return k(c),c},a}function l(a){var b=a[0]>0,c=a.map(function(a){return Math.abs(a)}),d=Math.max.apply(null,c),e=Math.min.apply(null,c),f=e.toExponential().split("e"),g=d.toExponential().split("e"),h=parseFloat(Math.floor(f[0])+"e"+f[1]),i=parseFloat(Math.ceil(g[0])+"e"+g[1]);return b?[h,i]:[-i,-h]}Object.defineProperty(b,"__esModule",{value:!0}),b.LogarithmicScale=void 0;var m=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),n=c(121),o=c(10),p=c(3),q=d(p),r=c(2),s=d(r);b.LogarithmicScale=function(a){function b(a,c){f(this,b);var d=g(this,Object.getPrototypeOf(b).call(this,a,c)),h=function(a){return!isNaN(a)&&q["default"].isNumber(a)},i=d.scaleConfig,k=s["default"].extent(d.vars),m=h(i.min)?i.min:k[0],n=h(i.max)?i.max:k[1];return k=[Math.min.apply(Math,e([m,k[0]].filter(h))),Math.max.apply(Math,e([n,k[1]].filter(h)))],j(k),i.nice&&(k=l(k)),d.vars=k,d.addField("scaleType","logarithmic").addField("discrete",!1),d}return h(b,a),m(b,[{key:"isInDomain",value:function(a){var b=this.domain(),c=b[0],d=b[b.length-1];return!isNaN(c)&&!isNaN(d)&&d>=a&&a>=c}},{key:"create",value:function(a){var b=this.vars;j(b);var c=k(s["default"].scale.log()).domain(b).rangeRound(a,1);return c.stepSize=function(){return 0},this.toBaseScale(c,a)}}]),b}(n.BaseScale)},function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.ValueScale=void 0;var g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=c(121);b.ValueScale=function(a){function b(a,c){d(this,b);var f=e(this,Object.getPrototypeOf(b).call(this,a,c));return f.addField("scaleType","value").addField("georole",c.georole),f}return f(b,a),g(b,[{key:"create",value:function(){return this.toBaseScale(function(a){return a})}}]),b}(h.BaseScale)},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(b,"__esModule",{value:!0}),b.FillScale=void 0;var h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=c(121),j=c(4),k=c(3),l=d(k),m=c(2),n=d(m);b.FillScale=function(a){function b(a,c){e(this,b);var d=f(this,Object.getPrototypeOf(b).call(this,a,c)),g=d.scaleConfig,h=n["default"].extent(d.vars),i=l["default"].isNumber(g.min)?g.min:h[0],k=l["default"].isNumber(g.max)?g.max:h[1];h=[Math.min(i,h[0]),Math.max(k,h[1])],d.vars=g.nice?j.utils.niceZeroBased(h):n["default"].extent(h);var m=.8/9,o=l["default"].times(10,function(a){return"rgba(90,180,90,"+(.2+a*m).toFixed(2)+")"}),p=g.brewer||o;return d.addField("scaleType","fill").addField("brewer",p),d}return g(b,a),h(b,[{key:"isInDomain",value:function(a){var b=this.domain(),c=b[0],d=b[b.length-1];return!isNaN(c)&&!isNaN(d)&&d>=a&&a>=c}},{key:"create",value:function(){var a=this.vars,b=this.getField("brewer");if(!l["default"].isArray(b))throw new Error("This brewer is not supported");var c=b.length,d=(a[1]-a[0])/c,e=l["default"].times(c-1,function(a){return a+1}).reduce(function(b,c){return b.concat([a[0]+c*d])},[]),f=n["default"].scale.threshold().domain(e).range(b);return this.toBaseScale(f)}}]),b}(i.BaseScale)},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(b,"__esModule",{value:!0}),b.ChartMap=void 0;var e=c(3),f=d(e),g=function(a){var b=f["default"].extend({sourcemap:a.settings.defaultSourceMap},a.guide||{});b.size=f["default"].defaults(b.size||{},{min:1,max:10}),b.code=f["default"].defaults(b.code||{},{georole:"countries"});var c={},d=function(a,b){var d,e,g=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],h=b;return b?(d=a+"_"+b,e="/"):(d=a+":default",e="?"),c.hasOwnProperty(d)||(c[d]=f["default"].extend({type:a,source:e,dim:h},g)),d};return{sources:{"?":{dims:{},data:[{}]},"/":{dims:Object.keys(a.dimensions).reduce(function(b,c){return b[c]={type:a.dimensions[c].type},b},{}),data:a.data}},scales:c,unit:{type:"COORDS.MAP",expression:{operator:"none",source:"/"},code:d("value",a.code,b.code),fill:d("fill",a.fill,b.fill),size:d("size",a.size,b.size),color:d("color",a.color,b.color),latitude:d("linear",a.latitude,{nice:!1}),longitude:d("linear",a.longitude,{nice:!1}),guide:b},plugins:a.plugins||[]}};b.ChartMap=g},function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.ChartInterval=void 0;var d=c(133),e=function(a){var b=a.flip?a.y:a.x,c=b.indexOf(a.color)>=0,d=a.guide[a.guide.length-1];return c&&!d.hasOwnProperty("enableColorToBarPosition")&&(d.enableColorToBarPosition=!1),a},f=function(a){var b=(0,d.normalizeConfig)(a);return b=e(b),(0,d.transformConfig)("ELEMENT.INTERVAL",b)};b.ChartInterval=f},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function f(a,b,c){return b.reduce(function(b,d,e){var f=a[d];return f?b.status!=p.FAIL&&("measure"===f.type&&(b.countMeasureAxis++,b.indexMeasureAxis.push(e)),"measure"!==f.type&&1===b.countMeasureAxis?b.status=p.WARNING:b.countMeasureAxis>1&&(b.status=p.FAIL,b.messages.push('There is more than one measure dimension for "'+c+'" axis'))):(b.status=p.FAIL,d?b.messages.push('"'+d+'" dimension is undefined for "'+c+'" axis'):b.messages.push('"'+c+'" axis should be specified')),b},{status:p.SUCCESS,countMeasureAxis:0,indexMeasureAxis:[],messages:[],axis:c})}function g(a){var b=n(a.x),c=n(a.y),d=Math.max(b.length,c.length),e=n(a.guide||{},{});l["default"].times(d-e.length,function(){return e.push({})}),e=e.slice(0,d);var g=f(a.dimensions,b,"x"),h=f(a.dimensions,c,"y");return b=q[g.status](b,g,e),c=q[h.status](c,h,e),l["default"].extend({},a,{x:b,y:c,guide:e})}function h(a,b){for(var c=b.x,d=b.y,e=b.guide,f=Math.max(c.length,d.length),g={type:"COORDS.RECT",unit:[]},h=[].concat(c),i=[].concat(d),j=[].concat(e),k=f;k>0;k--){var n=h.pop(),p=i.pop(),q=j.pop()||{};k===f?(g.x=n,g.y=p,g.unit.push(o(a,{x:m(n),y:m(p),identity:b.identity,split:b.split,color:b.color,label:b.label,size:b.size,flip:b.flip,stack:b.stack,colorGuide:q.color,sizeGuide:q.size})),g.guide=l["default"].defaults(q,{x:{label:n},y:{label:p}})):g={type:"COORDS.RECT",x:m(n),y:m(p),unit:[g],guide:l["default"].defaults(q,{x:{label:n},y:{label:p}})}}return b.spec={dimensions:b.dimensions,unit:g},b}Object.defineProperty(b,"__esModule",{value:!0}),b.transformConfig=b.normalizeConfig=void 0;var i,j=c(4),k=c(3),l=d(k),m=function(a){return a?a:null},n=function(a){var b=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return j.utils.isArray(a)?0===a.length?[b]:a:[a]},o=function(a,b){return{type:a,x:b.x,y:b.y,identity:b.identity,size:b.size,color:b.color,split:b.split,label:b.label,guide:{color:b.colorGuide,size:b.sizeGuide},flip:b.flip,stack:b.stack}},p={SUCCESS:"SUCCESS",WARNING:"WARNING",FAIL:"FAIL"},q=(i={},e(i,p.SUCCESS,function(a){return a}),e(i,p.FAIL,function(a,b){throw new Error((b.messages||[]).join("\n")||"This configuration is not supported, See http://api.taucharts.com/basic/facet.html#easy-approach-for-creating-facet-chart")}),e(i,p.WARNING,function(a,b,c){var d=b.axis,e=b.indexMeasureAxis[0],f=a[e],g=l["default"].without(a,f);g.push(f);var h=c[e][d]||{},i=c[c.length-1][d]||{};return c[c.length-1][d]=h,c[e][d]=i,g}),i);b.normalizeConfig=g,b.transformConfig=h},function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.ChartScatterplot=void 0;var d=c(133),e=function(a){var b=(0,d.normalizeConfig)(a);return(0,d.transformConfig)("ELEMENT.POINT",b)};b.ChartScatterplot=e},function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.ChartLine=void 0;var d=c(35),e=c(133),f=function(a){var b=(0,e.normalizeConfig)(a),c=b.data,f=b.settings.log,g={none:function(){return null},horizontal:function(a){return a.x[a.x.length-1]},vertical:function(a){return a.y[a.y.length-1]},auto:function(a){var b,e=a.x,g=a.y,h=e[e.length-1],i=e.slice(0,e.length-1),j=g[g.length-1],k=g.slice(0,g.length-1),l=a.color,m=i.concat(k).concat([l]).filter(function(a){return null!==a}),n=-1,o=[[[h].concat(m),j],[[j].concat(m),h]],p=o.some(function(a,b){var e=a[0],g=a[1],h=d.DataProcessor.isYFunctionOfX(c,e,[g]);return h.result?n=b:f(["Attempt to find a functional relation between",a[0]+" and "+a[1]+" is failed.","There are several "+h.error.keyY+" values (e.g. "+h.error.errY.join(",")+")","for ("+h.error.keyX+" = "+h.error.valX+")."].join(" ")),h.result});return p?b=o[n][0][0]:(f(["All attempts are failed.","Will orient line horizontally by default.","NOTE: the [scatterplot] chart is more convenient for that data."].join(" ")),b=h),b}},h=(b.lineOrientation||"").toLowerCase(),i=g.hasOwnProperty(h)?g[h]:g.auto,j=i(b);return null!==j&&(b.data=d.DataProcessor.sortByDim(c,j,b.dimensions[j])),(0,e.transformConfig)("ELEMENT.LINE",b)};b.ChartLine=f},function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.ChartArea=void 0;var d=c(35),e=c(133),f=function(a){var b=(0,e.normalizeConfig)(a),c=b.data,f=b.settings.log,g={horizontal:function(a){return{prop:a.x[a.x.length-1],flip:!1}},vertical:function(a){return{prop:a.y[a.y.length-1],flip:!0}},auto:function(a){var b,e=a.x,g=a.y,h=e[e.length-1],i=e.slice(0,e.length-1),j=g[g.length-1],k=g.slice(0,g.length-1),l=a.color,m=i.concat(k).concat([l]).filter(function(a){
  return null!==a}),n=-1,o=[[[h].concat(m),j],[[j].concat(m),h]],p=o.some(function(a,b){var e=a[0],g=a[1],h=d.DataProcessor.isYFunctionOfX(c,e,[g]);return h.result?n=b:f(["Attempt to find a functional relation between",a[0]+" and "+a[1]+" is failed.","There are several "+h.error.keyY+" values (e.g. "+h.error.errY.join(",")+")","for ("+h.error.keyX+" = "+h.error.valX+")."].join(" ")),h.result}),q=null;return p?(b=o[n][0][0],q=0!==n):(f("All attempts are failed. Gonna transform AREA to general PATH."),b=null),{prop:b,flip:q}}},h="boolean"!=typeof b.flip?"auto":b.flip?"vertical":"horizontal",i=g[h],j=i(b),k="ELEMENT.AREA";return null!==j.prop&&(b.data=d.DataProcessor.sortByDim(c,j.prop,b.dimensions[j.prop]),b.flip=j.flip),(0,e.transformConfig)(k,b)};b.ChartArea=f},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}Object.defineProperty(b,"__esModule",{value:!0}),b.ChartParallel=void 0;var e=c(3),f=d(e),g=function(a){var b=f["default"].extend({columns:{}},a.guide||{}),c={},d=function(a,b){var d,e,g=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],h=b;return b?(d=a+"_"+b,e="/"):(d=a+":default",e="?"),c.hasOwnProperty(d)||(c[d]=f["default"].extend({type:a,source:e,dim:h},g)),d},e=a.columns.map(function(c){return d(a.dimensions[c].scale,c,b.columns[c])});return{sources:{"?":{dims:{},data:[{}]},"/":{dims:Object.keys(a.dimensions).reduce(function(b,c){return b[c]={type:a.dimensions[c].type},b},{}),data:a.data}},scales:c,unit:{type:"COORDS.PARALLEL",expression:{operator:"none",source:"/"},columns:e,guide:b,units:[{type:"PARALLEL/ELEMENT.LINE",color:d("color",a.color,b.color),columns:e,expression:{operator:"none",source:"/"}}]},plugins:a.plugins||[]}};b.ChartParallel=g},function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0}),b.PluginsSDK=void 0;var f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=c(3),h=d(g),i=c(16),j=c(139),k=c(140),l={},m=function(){function a(){e(this,a)}return f(a,null,[{key:"unit",value:function(a){return new j.Unit(a)}},{key:"spec",value:function(a){return new k.Spec(a)}},{key:"cloneObject",value:function(a){return JSON.parse(JSON.stringify(a))}},{key:"depthFirstSearch",value:function(b,c){if(c(b))return b;for(var d=b.hasOwnProperty("frames")?b.frames:[{units:b.units}],e=0;e<d.length;e++)for(var f=d[e].units||[],g=0;g<f.length;g++){var h=a.depthFirstSearch(f[g],c);if(h)return h}}},{key:"traverseSpec",value:function(a,b){var c=function d(a,b,c){b(a,c),(a.units||[]).map(function(c){return d(c,b,a)})};c(a.unit,b,null)}},{key:"extractFieldsFormatInfo",value:function(b){var c=b.scales,d=function(a){return!c[a].dim},e=function(a,b,d){var e=b.guide||{},f=c[b[d]],g=e[d]||{};a[f.dim]=a[f.dim]||{label:[],format:[],nullAlias:[],tickLabel:[]};var i=g.label,j=g.label||{};a[f.dim].label.push(h["default"].isString(i)?i:j._original_text||j.text);var k=g.tickFormat||g.tickPeriod;a[f.dim].format.push(k),a[f.dim].nullAlias.push(g.tickFormatNullAlias),a[f.dim].tickLabel.push(g.tickLabel)},f=[];a.traverseSpec(b,function(a){f.push(a)});var g=f.reduce(function(a,b){return"COORDS.RECT"===b.type&&b.hasOwnProperty("x")&&!d(b.x)&&e(a,b,"x"),"COORDS.RECT"===b.type&&b.hasOwnProperty("y")&&!d(b.y)&&e(a,b,"y"),b.hasOwnProperty("color")&&!d(b.color)&&e(a,b,"color"),b.hasOwnProperty("size")&&!d(b.size)&&e(a,b,"size"),b.hasOwnProperty("label")&&!d(b.label)&&e(a,b,"label"),a},{}),j=function(a,b){var c=(0,h["default"])(a).chain().filter(h["default"].identity).uniq().first().value();return c||b};return Object.keys(g).reduce(function(a,b){a[b].label=j(a[b].label,b),a[b].format=j(a[b].format,null),a[b].nullAlias=j(a[b].nullAlias,"No "+a[b].label),a[b].tickLabel=j(a[b].tickLabel,null);var c="x-time-auto"===a[b].format?"day":a[b].format,d=a[b].nullAlias,e=c?i.FormatterRegistry.get(c,d):function(a){return null===a?d:a};if(a[b].format=e,a[b].tickLabel){var f=b.replace("."+a[b].tickLabel,"");a[f]={label:a[b].label,nullAlias:a[b].nullAlias,tickLabel:a[b].tickLabel,format:function(b){return e(b&&b[a[f].tickLabel])},isComplexField:!0},a[b].parentField=f}return a},g)}},{key:"tokens",value:function(){return{reg:function(a,b){return l[a]=b,this},get:function(a){return l[a]||a}}}}]),a}();b.PluginsSDK=m},function(a,b){"use strict";function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0});var d=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),e=function(){function a(b){c(this,a),this.unitRef=b}return d(a,[{key:"value",value:function(){return this.unitRef}},{key:"clone",value:function(){return JSON.parse(JSON.stringify(this.unitRef))}},{key:"traverse",value:function(a){var b=function c(a,b,d){b(a,d),(a.units||[]).map(function(d){return c(d,b,a)})};return b(this.unitRef,a,null),this}},{key:"reduce",value:function(a,b){var c=b;return this.traverse(function(b,d){return c=a(c,b,d)}),c}},{key:"addFrame",value:function(a){return this.unitRef.frames=this.unitRef.frames||[],a.key.__layerid__=["L",(new Date).getTime(),this.unitRef.frames.length].join(""),a.source=a.hasOwnProperty("source")?a.source:this.unitRef.expression.source,a.pipe=a.pipe||[],this.unitRef.frames.push(a),this}},{key:"addTransformation",value:function(a,b){return this.unitRef.transformation=this.unitRef.transformation||[],this.unitRef.transformation.push({type:a,args:b}),this}},{key:"isCoordinates",value:function(){return 0===(this.unitRef.type||"").toUpperCase().indexOf("COORDS.")}},{key:"isElementOf",value:function(a){if(this.isCoordinates())return!1;var b=this.unitRef.type||"",c=b.split("/");return 1===c.length&&c.unshift("RECT"),c[0].toUpperCase()===a.toUpperCase()}}]),a}();b.Unit=e},function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(b,"__esModule",{value:!0}),b.Spec=void 0;var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=c(139),g=function(){function a(b){d(this,a),this.specRef=b}return e(a,[{key:"value",value:function(){return this.specRef}},{key:"unit",value:function(a){return a&&(this.specRef.unit=a),new f.Unit(this.specRef.unit)}},{key:"addTransformation",value:function(a,b){return this.specRef.transformations=this.specRef.transformations||{},this.specRef.transformations[a]=b,this}},{key:"getSettings",value:function(a){return this.specRef.settings[a]}},{key:"setSettings",value:function(a,b){return this.specRef.settings=this.specRef.settings||{},this.specRef.settings[a]=b,this}},{key:"getScale",value:function(a){return this.specRef.scales[a]}},{key:"addScale",value:function(a,b){return this.specRef.scales[a]=b,this}},{key:"regSource",value:function(a,b){return this.specRef.sources[a]=b,this}},{key:"getSourceData",value:function(a){var b=this.specRef.sources[a]||{data:[]};return b.data}},{key:"getSourceDim",value:function(a,b){var c=this.specRef.sources[a]||{dims:{}};return c.dims[b]||{}}}]),a}();b.Spec=g}])}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){var b={YlGn:{3:["#f7fcb9","#addd8e","#31a354"],4:["#ffffcc","#c2e699","#78c679","#238443"],5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]},YlGnBu:{3:["#edf8b1","#7fcdbb","#2c7fb8"],4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]},GnBu:{3:["#e0f3db","#a8ddb5","#43a2ca"],4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],5:["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],6:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],7:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],8:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],9:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"]},BuGn:{3:["#e5f5f9","#99d8c9","#2ca25f"],4:["#edf8fb","#b2e2e2","#66c2a4","#238b45"],5:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],6:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],7:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],8:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],9:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"]},PuBuGn:{3:["#ece2f0","#a6bddb","#1c9099"],4:["#f6eff7","#bdc9e1","#67a9cf","#02818a"],5:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],6:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],7:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],8:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],9:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"]},PuBu:{3:["#ece7f2","#a6bddb","#2b8cbe"],4:["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],5:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],6:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],7:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],8:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],9:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"]},BuPu:{3:["#e0ecf4","#9ebcda","#8856a7"],4:["#edf8fb","#b3cde3","#8c96c6","#88419d"],5:["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],6:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],7:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],8:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],9:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"]},RdPu:{3:["#fde0dd","#fa9fb5","#c51b8a"],4:["#feebe2","#fbb4b9","#f768a1","#ae017e"],5:["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],6:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],7:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],8:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],9:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"]},PuRd:{3:["#e7e1ef","#c994c7","#dd1c77"],4:["#f1eef6","#d7b5d8","#df65b0","#ce1256"],5:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],6:["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],7:["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],8:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],9:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"]},OrRd:{3:["#fee8c8","#fdbb84","#e34a33"],4:["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],5:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],6:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],7:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],8:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],9:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"]},YlOrRd:{3:["#ffeda0","#feb24c","#f03b20"],4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]},YlOrBr:{3:["#fff7bc","#fec44f","#d95f0e"],4:["#ffffd4","#fed98e","#fe9929","#cc4c02"],5:["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],6:["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],7:["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],8:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],9:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"]},Purples:{3:["#efedf5","#bcbddc","#756bb1"],4:["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],5:["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],6:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],7:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],8:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],9:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]},Blues:{3:["#deebf7","#9ecae1","#3182bd"],4:["#eff3ff","#bdd7e7","#6baed6","#2171b5"],5:["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],6:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],7:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],8:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],9:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]},Greens:{3:["#e5f5e0","#a1d99b","#31a354"],4:["#edf8e9","#bae4b3","#74c476","#238b45"],5:["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],6:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],7:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],8:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],9:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]},Oranges:{3:["#fee6ce","#fdae6b","#e6550d"],4:["#feedde","#fdbe85","#fd8d3c","#d94701"],5:["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],6:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],7:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],8:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],9:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]},Reds:{3:["#fee0d2","#fc9272","#de2d26"],4:["#fee5d9","#fcae91","#fb6a4a","#cb181d"],5:["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],6:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],7:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],8:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],9:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]},Greys:{3:["#f0f0f0","#bdbdbd","#636363"],4:["#f7f7f7","#cccccc","#969696","#525252"],5:["#f7f7f7","#cccccc","#969696","#636363","#252525"],6:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],7:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],8:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],9:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]},PuOr:{3:["#f1a340","#f7f7f7","#998ec3"],4:["#e66101","#fdb863","#b2abd2","#5e3c99"],5:["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],6:["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],7:["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],8:["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],9:["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],10:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],11:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"]},BrBG:{3:["#d8b365","#f5f5f5","#5ab4ac"],4:["#a6611a","#dfc27d","#80cdc1","#018571"],5:["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],6:["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],7:["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],8:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],9:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],10:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],11:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]},PRGn:{3:["#af8dc3","#f7f7f7","#7fbf7b"],4:["#7b3294","#c2a5cf","#a6dba0","#008837"],5:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],6:["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],7:["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],8:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],9:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],10:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],11:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]},PiYG:{3:["#e9a3c9","#f7f7f7","#a1d76a"],4:["#d01c8b","#f1b6da","#b8e186","#4dac26"],5:["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],6:["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],7:["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],8:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],9:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],10:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],11:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]},RdBu:{3:["#ef8a62","#f7f7f7","#67a9cf"],4:["#ca0020","#f4a582","#92c5de","#0571b0"],5:["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],6:["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],7:["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]},RdGy:{3:["#ef8a62","#ffffff","#999999"],4:["#ca0020","#f4a582","#bababa","#404040"],5:["#ca0020","#f4a582","#ffffff","#bababa","#404040"],6:["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],7:["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"]},RdYlBu:{3:["#fc8d59","#ffffbf","#91bfdb"],4:["#d7191c","#fdae61","#abd9e9","#2c7bb6"],5:["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],6:["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],7:["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],8:["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],9:["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]},Spectral:{3:["#fc8d59","#ffffbf","#99d594"],4:["#d7191c","#fdae61","#abdda4","#2b83ba"],5:["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],6:["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],7:["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],8:["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],9:["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],10:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],11:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]},RdYlGn:{3:["#fc8d59","#ffffbf","#91cf60"],4:["#d7191c","#fdae61","#a6d96a","#1a9641"],5:["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],6:["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],7:["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],8:["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],9:["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]},Accent:{3:["#7fc97f","#beaed4","#fdc086"],4:["#7fc97f","#beaed4","#fdc086","#ffff99"],5:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],6:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],7:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],8:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"]},Dark2:{3:["#1b9e77","#d95f02","#7570b3"],4:["#1b9e77","#d95f02","#7570b3","#e7298a"],5:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],6:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],7:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],8:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"]},Paired:{3:["#a6cee3","#1f78b4","#b2df8a"],4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"]},Pastel1:{3:["#fbb4ae","#b3cde3","#ccebc5"],4:["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],5:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],6:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],7:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],8:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],9:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Pastel2:{3:["#b3e2cd","#fdcdac","#cbd5e8"],4:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],5:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],6:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],7:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],8:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"]},Set1:{3:["#e41a1c","#377eb8","#4daf4a"],4:["#e41a1c","#377eb8","#4daf4a","#984ea3"],5:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],6:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],7:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],8:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],9:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},Set2:{3:["#66c2a5","#fc8d62","#8da0cb"],4:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],5:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],6:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],7:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],8:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"]},Set3:{3:["#8dd3c7","#ffffb3","#bebada"],4:["#8dd3c7","#ffffb3","#bebada","#fb8072"],5:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],6:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],7:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],8:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],9:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],10:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],11:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],12:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]}},c=function(a,c){return b[a][c].map(function(b,d){return a+" q"+d+"-"+c})};return a.api.colorBrewers.add("tauBrewer",c),c}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){function b(b){var h=c.defaults(b||{},{}),i="annotation_text";return{init:function(b){this._chart=b;var c=b.getSpec();c.scales[i]={type:"value",dim:"text",source:"?"},c.transformations=c.transformations||{},c.transformations.dataRange=function(c,d){var e=d.from,f=d.to,g=b.getScaleInfo(d.primaryScale);if("period"===g.scaleType){var h=a.api.tickPeriod.get(g.period);e=h.cast(new Date(d.from)),f=h.cast(new Date(d.to))}var i=!g.isInDomain(e),j=!g.isInDomain(f),k=g.discrete?i||j:i&&j;if(k)return console.log("Annotation is out of domain"),[];var l=b.getScaleInfo(d.secondaryScale),m=l.domain(),n=[m[0],m[m.length-1]],o=g.dim,p=l.dim,q="__pos__",r={},s={},t={},u={};return r[q]="l",r[o]=e,r[p]=n[0],s[q]="l",s[o]=f,s[p]=n[0],t[q]="r",t[o]=f,t[p]=n[1],u[q]="r",u[o]=e,u[p]=n[1],("y"===d.axis?t:u).text=d.text,[r,s,t,u]},c.transformations.dataLimit=function(c,d){var e=d.primaryScale,f=d.secondaryScale,g=b.getScaleInfo(e),h="period"===g.scaleType?a.api.tickPeriod.get(g.period).cast(new Date(d.from)):d.from,i=!g.isInDomain(h);if(i)return console.log("Annotation is out of domain"),[];var j=b.getScaleInfo(f),k=j.domain(),l=[k[0],k[k.length-1]],m={},n={},o=g.dim,p=j.dim,q="__pos__";return m[o]=h,m[p]=l[0],m[q]="l",n[o]=h,n[p]=l[1],n[q]="r",n.text=d.text,[m,n]}},addAreaNote:function(a,b,c){var d=a.scales[b.x],e=a.scales[b.y],h=c.dim===d.dim?["x","y"]:c.dim===e.dim?["y","x"]:null;if(null===h)return void console.log("Annotation doesn't match any data field");var j=c.val[0],k=c.val[1],l={type:"ELEMENT.PATH",namespace:"annotations",x:b.x,y:b.y,color:c.colorScaleName,label:i,expression:{inherit:!1,operator:"none",params:[],source:"/"},transformModel:[g(c)],transformation:[{type:"dataRange",args:{axis:h[0],text:c.text,from:j,to:k,primaryScale:b[h[0]],secondaryScale:b[h[1]]}}],guide:{showAnchors:!1,cssClass:"graphical-report__annotation-area",label:{fontColor:c.color,position:["r","b","keep-in-box"]}}};f(b.units,l,c.position)},addLineNote:function(a,b,c){var d=a.scales[b.x],e=a.scales[b.y],h=c.dim===d.dim?["x","y"]:c.dim===e.dim?["y","x"]:null;if(null===h)return void console.log("Annotation doesn't match any field");var j=c.text,k=c.val,l={type:"ELEMENT.LINE",namespace:"annotations",x:b.x,y:b.y,label:i,color:c.colorScaleName,transformModel:[g(c)],expression:{inherit:!1,operator:"none",params:[],source:"/"},transformation:[{type:"dataLimit",args:{from:k,text:j,primaryScale:b[h[0]],secondaryScale:b[h[1]]}}],guide:{showAnchors:!1,widthCssClass:"graphical-report__line-width-2",cssClass:"graphical-report__annotation-line",label:{fontColor:c.color,position:["r","b","keep-in-box"]}}};f(b.units,l,c.position)},onSpecReady:function(a,b){var f=this,g=[];a.traverseSpec(b,function(a){a&&"COORDS.RECT"===a.type&&a.units&&g.push(a)});var i=e.spec(b);g.forEach(function(a){h.items.map(function(a,b){var c=(a.color||"#BD10E0").toLowerCase(),e=d.rgb(c).toString().toUpperCase();"black"!==c&&"#000000"===e&&(e=null);var f=e||c,g="annotation_color_"+b;return i.addScale(g,{type:"color",source:"?",brewer:[f]}),{dim:a.dim,val:a.val,text:a.text,color:f,position:a.position,colorScaleName:g}}).forEach(function(d){c.isArray(d.val)?f.addAreaNote(b,a,d):f.addLineNote(b,a,d)})})}}}var c=a.api._,d=a.api.d3,e=a.api.pluginsSDK,f=function(a,b,c){"front"===c?a.push(b):a.unshift(b)},g=function(a){return function(b){var d={},e=c.find([{dim:b.scaleX.dim,scale:b.scaleY,method:"yi",k:-1},{dim:b.scaleY.dim,scale:b.scaleX,method:"xi",k:1},{dim:null,scale:null,method:null}],function(b){return b.dim===a.dim});if(null===e.method)return d;var f="__pos__",g=e.k,h={l:-.5,r:.5},i=e.method,j=e.scale;return d[i]=function(a){var c=(h[a[f]]||0)*g;return j.discrete?b[i](a)+j.stepSize(a[j.dim])*c:b[i](a)},d}};return a.api.plugins.add("annotations",b),b}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){function b(a,b){var c=a.length-1,d=b/100*c,e=Math.floor(d);if(0===e)return{pos:0,value:a[0]};if(e===c)return{pos:c,value:a[c]};var f=d-e;return f?{pos:d,value:a[e]+f*(a[e+1]-a[e])}:{pos:d,value:a[d]}}function c(a,c,d){for(var e=a.sort(function(a,b){return a-b}),f=b(e,25),g=b(e,50),h=b(e,75),i=h.value-f.value,j=f.value-1.5*i,k=h.value+1.5*i,l=e[0],m=e[e.length-1],n=0;n<=f.pos;n++){var o=e[n];if(o>j){l=o;break}}for(var p=e.length-1;p>=h.pos;p--){var q=e[p];if(k>q){m=q;break}}return c[d.MIN]=l,c[d.MAX]=m,c[d.MEDIAN]=g.value,c[d.Q1]=f.value,c[d.Q3]=h.value,c}function d(a){return _.defaults(a,{mode:"outliers-only"}),{init:function(a){this._chart=a},onSpecReady:function(b,d){var e=a.flip===!0;d.transformations=d.transformations||{},d.transformations.empty=function(){return[]},d.transformations.outliers=function(a,b){var d=b.x.dim,e=b.y.dim,f=a.reduce(function(a,b){var c=b[d];return a[c]=a[c]||[],a[c].push(b[e]),a},{}),g=Object.keys(f).reduce(function(a,b){var g=c(f[b],{},j),h=g[j.MAX],i=g[j.MIN];return a.concat(function(a){return a[d]===b?a[e]>h||a[e]<i:!0})},[]);return a.filter(function(a){var b=g.some(function(b){return!b(a)});return!b})},b.traverseSpec(d,function(b,c){if("ELEMENT.POINT"===b.type){var f=JSON.parse(JSON.stringify(b));f.type="ELEMENT.BOX-WHISKERS",f.flip=e,f.namespace="boxwhiskers",f.guide=f.guide||{},f.guide.fitScale="hide-scatter"===a.mode;var g={"show-scatter":[],"hide-scatter":[{type:"empty"}],"outliers-only":[{type:"outliers",args:{x:d.scales[e?b.y:b.x],y:d.scales[e?b.x:b.y]}}]};b.transformation=b.transformation||[],
  b.transformation=b.transformation.concat(g[a.mode]),c.units.push(f)}})}}}var e="minimum",f="maximum",g="median",h="Q1",i="Q3",j={MIN:e,MAX:f,MEDIAN:g,Q1:h,Q3:i};return a.api.unitsRegistry.reg("ELEMENT.BOX-WHISKERS",{init:function(){var a=this.node();a.init();var b=this.calcStat();a.config.adjustPhase&&a.config.guide.fitScale&&this.fixScale(a,b)},fixScale:function(a,b){var c=b.reduce(function(a,b){return a.concat([b[j.MIN],b[j.MAX]])},[]).sort(function(a,b){return a-b}),d=c[0],e=c[c.length-1];a.screenModel.model.scaleY.fixup(function(a){var b={};if(a.hasOwnProperty("series")){var c=Math.min(a.series[0],d),f=Math.max(a.series[1],e);b.series=[c,f]}else b.series=[d,e];return b})},calcStat:function(){var a=this.node().screenModel,b=a.model,d=this.node().data().reduce(function(a,c){var d=c[b.scaleX.dim];return a[d]=a[d]||[],a[d].push(c[b.scaleY.dim]),a},{});return Object.keys(d).reduce(function(a,e){var f={};return f[b.scaleX.dim]=e,a.concat(c(d[e],f,j))},[])},buildRangeModel:function(a,b){var c=a.flip,d=c?"y":"x",e=c?"x":"y",f=c?"height":"width",g=c?"width":"height",h=c?b.y1:b.y0,i=c?b.y0:b.y1,j=b.size,k=a.model.scaleX,l=a.model.scaleY,m={"class":b["class"]};return m[d]=function(a){return k(a[k.dim])-.5*j},m[e]=function(a){return l(a[i])},m[f]=function(){return j},m[g]=function(a){return Math.max(b.minHeight||1,Math.abs(l(a[h])-l(a[i])))},_.extend(m,{fill:function(){return b.color||"rgba(0,0,256, 0.5)"}})},draw:function(){var a=this.node().config,b=a.options.slot(a.uid),c=this.calcStat();this.drawElement(b,c)},drawElement:function(b,c){var d=this,j=this.node().screenModel,k=a.api.d3_animationInterceptor,l=function(a,b){var c=d.node().config.guide.animationSpeed,e=a.selectAll("."+b["class"]).data(function(a){return[a]},j.id);e.exit().call(k(c,null,{width:0},function(a){d3.select(a).remove()})),e.call(k(c,null,b)),e.enter().append("rect").style("stroke-width",0).call(k(c,{width:0},b))},m=function(){l(this,d.buildRangeModel(j,{size:2,y0:e,y1:h,"class":"range-min-Q1"})),l(this,d.buildRangeModel(j,{size:2,y0:i,y1:f,"class":"range-Q3-max"})),l(this,d.buildRangeModel(j,{size:20,y0:h,y1:i,"class":"range-Q1-Q3"})),l(this,d.buildRangeModel(j,{size:20,minHeight:1,y0:f,y1:f,"class":"limit-max"})),l(this,d.buildRangeModel(j,{size:20,minHeight:1,y0:e,y1:e,"class":"limit-min"})),l(this,d.buildRangeModel(j,{size:20,minHeight:2,y0:g,y1:g,color:"#ff0000","class":"limit-median"}))},n=b.selectAll(".box-whiskers-node").data(c);n.exit().remove(),n.call(m),n.enter().append("g").attr("class","box-whiskers-node").call(m)}},"ELEMENT.GENERIC.CARTESIAN"),a.api.plugins.add("box-whiskers",d),d}),function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b(require("tauCharts")):"function"==typeof define&&define.amd?define(["tauCharts"],b):"object"==typeof exports?exports.exportTo=b(require("tauCharts")):a.exportTo=b(a.tauCharts)}(this,function(a){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){var d,e;!function(f){d=[c(1),c(2),c(5),c(6),c(10),c(11)],e=function(a,b,c,d,e){return window.Promise=window.Promise||d.Promise,f(a,b,c,window.Promise,e)}.apply(b,d),!(void 0!==e&&(a.exports=e))}(function(a,b,c,d,e){function f(a){return Math.log(a)/Math.LN10}function g(e){return{onRender:function(){this._info=k.extractFieldsFormatInfo(this._chart.getSpec())},_normalizeExportFields:function(a,b){var c=this._info;return a.map(function(a){var b=a,d=c[a]||{};return j.isString(a)&&(b={field:a,title:d.label||a}),j.isFunction(b.value)||(b.value=function(a){var b=a[this.field];return d.isComplexField?(b||{})[d.tickLabel]:b}),b}).filter(function(a){return!j.any(b,function(b){return a.field===b})})},_createDataUrl:function(c){var e=this._cssPaths.map(function(a){return fetch(a).then(function(a){return a.text()})});return d.all(e).then(function(a){return a.join(" ").replace(/&/g,"")}).then(function(e){var f=q(e),g=document.createElement("div");c.fire("beforeExportSVGNode");var h=c.getSVG().cloneNode(!0);c.fire("afterExportSVGNode"),g.appendChild(v(h)),i.select(h).attr("version",1.1).attr("xmlns","http://www.w3.org/2000/svg"),h.insertBefore(f,h.firstChild),this._renderAdditionalInfo(h,c);var j=document.createElement("canvas");return j.height=h.getAttribute("height"),j.width=h.getAttribute("width"),new d(function(c){b(j,h.parentNode.innerHTML,{renderCallback:function(b){var d=(new XMLSerializer).serializeToString(b),e="<html"===d.substring(0,5).toLowerCase();e&&(a.api.globalSettings.log("[export plugin]: canvg error","error"),a.api.globalSettings.log(d,"error")),c(j.toDataURL("image/png"))}})})}.bind(this))},_findUnit:function(a){var b=a.getSpec(),c=a.getSpec(),d=function(a){var b=c.scales[a];return b&&b.dim&&b.source&&c.sources[b.source].dims[b.dim]};return k.depthFirstSearch(b.unit,function(a){if(d(a.color))return!0;if(d(a.size)){var b=c.scales[a.size];return"measure"===c.sources[b.source].dims[b.dim].type}})},_toPng:function(a){this._createDataUrl(a).then(function(a){for(var b=atob(a.substring("data:image/png;base64,".length)),d=new Uint8Array(b.length),e=0,f=b.length;f>e;++e)d[e]=b.charCodeAt(e);var g=new Blob([d.buffer],{type:"image/png"});c(g,(this._fileName||"export")+".png")}.bind(this))},_toPrint:function(a){this._createDataUrl(a).then(function(a){h=document.createElement("img"),h.classList.add("graphical-report__print-block");var b=h;document.body.appendChild(b),b.src=a,document.head.appendChild(r),b.onload=function(){window.print()}})},_toJson:function(a){var b=this._exportFields,c=a.getData(),d=a.getDataDims(),e=b.length?b:Object.keys(d),f=this._normalizeExportFields(e.concat(this._appendFields),this._excludeFields),g=c.map(function(a){return f.reduce(function(b,c){return b[c.title]=c.value(a),b},{})}),h=JSON.stringify(g,null,2),i=(this._fileName||"export")+".json";u(i,"application/json",h)},_toCsv:function(a){var b=this._csvSeparator,c=this._exportFields,d=a.getData(),e=a.getDataDims(),f=c.length?c:Object.keys(e),g=this._normalizeExportFields(f.concat(this._appendFields),this._excludeFields),h=d.reduce(function(a,c){return a.concat(g.reduce(function(a,b){var d=b.value(c),e=JSON.stringify(d);if(!j.isDate(d)&&j.isObject(d))e='"'+e.replace(/"/g,'""')+'"';else{var f=m(e,'"').replace(/"/g,'""'),g=j.any(['"',",",";","\n","\r"],function(a){return f.indexOf(a)>=0});e=g?'"'+f+'"':f}return a.concat(e)},[]).join(b))},[g.map(function(a){return a.title}).join(b)]).join("\r\n"),i=(this._fileName||"export")+".csv";u(i,"text/csv",h)},_renderFillLegend:function(a,b,c,d){var f=function(a,b){var c=a[0],d=a[1],e=(d-c)/(b-1),f=j.times(b-2,function(a){return c+e*(a+1)});return[c].concat(f).concat(d)},g=this._unit.getScale("color"),h=w(a.guide,"color",g.dim).toUpperCase(),i="text-transform:uppercase;font-weight:600;font-size:"+e.fontSize+"px",k=j(g.domain()).sortBy(),l=g.brewer.length,m=3,n=120,o=e.fontSize,p=20,q=f(k,l).reverse().map(function(a,b){var c=b/(l-1)*100;return'<stop offset="'+c+'%"      style="stop-color:'+g(a)+';stop-opacity:1" />'}),r=f(k,m).reverse().map(function(a,b,c){var d=b/(m-1),e=.5*(0===b?o:b===c.length-1?-o:0),f=(n-p)*d+e+o/2;return'<text x="25" y="'+f+'">'+a+"</text>"}),s=['<svg version="1.1" xmlns="http://www.w3.org/2000/svg" height="'+n+'" width="100%">',"   <defs>",'       <linearGradient id="grad1" x1="0%" y1="0%" x2="0%" y2="100%">',q.join(""),"       </linearGradient>","   </defs>",'   <text x="0" y="10" style="'+i+'">'+h+"</text>",'   <g transform="translate(0,20)">','       <rect x="0" y="0" height="'+(n-p)+'" width="20" fill="url(#grad1)">',"       </rect>",r.join(""),"   </g>","   Sorry, your browser does not support inline SVG.","</svg>"].join(""),t=(new DOMParser).parseFromString(s,"application/xml").documentElement;return document.body.appendChild(t),b.append("g").attr("class","legend").attr("transform","translate("+(d+10)+","+e.paddingTop+")").node().appendChild(t),{h:n,w:0}},_renderColorLegend:function(a,b,c,d){var f=this._unit.getScale("color"),g=w(a.guide,"color",f.dim).toUpperCase(),h=this._getColorMap(c.getChartModelData({excludeFilter:["legend"]}),f,f.dim).values,i=function(){this.attr("transform",function(a,b){return"translate(5,"+20*(b+1)+")"}),this.append("circle").attr("r",6).attr("fill",function(a){return f.toColor(a.color)}).attr("class",function(a){return f.toClass(a.color)}),this.append("text").attr("x",12).attr("y",5).text(function(a){return j.escape(o(a.label)?"No "+g:a.label)}).style({"font-size":e.fontSize+"px"})},k=b.append("g").attr("class","legend").attr("transform","translate("+(d+10)+","+e.paddingTop+")");return k.append("text").text(g.toUpperCase()).style({"text-transform":"uppercase","font-weight":"600","font-size":e.fontSize+"px"}),k.selectAll("g").data(h).enter().append("g").call(i),{h:20*h.length,w:0}},_renderSizeLegend:function(a,b,c,d,g){var h,i=this._unit.getScale("size"),k=w(a.guide,"size",i.dim).toUpperCase(),l=j.sortBy(c.getChartModelData(),function(a){return i(a[i.dim])}),m=l.length,o=l[0][i.dim],p=l[m-1][i.dim];if(p-o){var q=f(p-o),r=0>4-q?0:Math.round(4-q),s=Math.pow(10,r),t=(p-o)/5;h=j([o,o+t,o+2*t,o+3*t,p]).chain().map(function(a){return a===p||a===o?a:Math.round(a*s)/s}).unique().value()}else h=[o];var u=h.map(function(b){var c=i(b),d=c/2;return{diameter:n(c+2),radius:d,value:b,className:a.color?"color-definite":""}}.bind(this)).reverse(),v=Math.max.apply(null,j.pluck(u,"diameter")),x=e.fontSize,y=0,z=function(){this.attr("transform",function(){y+=v;var a="translate(5,"+y+")";return y+=10,a}),this.append("circle").attr({r:function(a){return a.radius},"class":function(a){return a.className}}).style({opacity:.4}),this.append("g").attr("transform",function(){return"translate("+v+","+x/2+")"}).append("text").attr({x:0,y:0}).text(function(a){return a.value}).style({"font-size":x+"px"})},A=b.append("g").attr("class","legend").attr("transform","translate("+(d+10)+","+(e.paddingTop+g.h+20)+")");A.append("text").text(k.toUpperCase()).style({"text-transform":"uppercase","font-weight":"600","font-size":x+"px"}),A.selectAll("g").data(u).enter().append("g").call(z)},_renderAdditionalInfo:function(a,b){var c=this._findUnit(b);if(c){var d={h:0,w:0};a=i.select(a);var e=parseInt(a.attr("width"),10);a.attr("height");a.attr("width",e+160);var f=b.getScaleInfo(c.color);if(f.dim&&!f.discrete){var g=this._renderFillLegend(c,a,b,e);d.h=g.h+20,d.w=g.w}if(f.dim&&f.discrete){var h=this._renderColorLegend(c,a,b,e);d.h=h.h+20,d.w=h.w}var j=b.getScaleInfo(c.size);j.dim&&!j.discrete&&this._renderSizeLegend(c,a,b,e,d)}},onUnitDraw:function(b,c){a.api.isChartElement(c)&&(this._unit=c)},_getColorMap:function(a,b,c){return j(a).chain().map(function(a){var d=a[c];return{color:b(d),value:d,label:d}}).uniq(function(a){return a.value}).value().reduce(function(a,b){return a.brewer[b.value]=b.color,a.values.push(b),a},{brewer:{},values:[]})},_select:function(a,b){a=a||"";var c=this["_to"+a.charAt(0).toUpperCase()+a.slice(1)];c&&c.call(this,b)},_handleMenu:function(a,b,c){a.addEventListener("click",function(a){if("a"===a.target.tagName.toLowerCase()){var d=a.target.getAttribute("data-value");this._select(d,b),c.hide()}}.bind(this)),a.addEventListener("mouseover",function(a){"a"===a.target.tagName.toLowerCase()&&a.target.focus()}.bind(this)),a.addEventListener("keydown",function(a){if(a.keyCode===p.ESCAPE&&c.hide(),a.keyCode===p.DOWN&&(a.target.parentNode.nextSibling?a.target.parentNode.nextSibling.childNodes[0].focus():a.target.parentNode.parentNode.firstChild.childNodes[0].focus()),a.keyCode===p.UP&&(a.target.parentNode.previousSibling?a.target.parentNode.previousSibling.childNodes[0].focus():a.target.parentNode.parentNode.lastChild.childNodes[0].focus()),a.keyCode===p.ENTER){var d=a.target.getAttribute("data-value");this._select(d,b)}a.preventDefault()}.bind(this));var d=null;a.addEventListener("blur",function(){d=setTimeout(function(){c.hide()},100)},!0),a.addEventListener("focus",function(){clearTimeout(d)},!0),this._container.addEventListener("click",function(){c.toggle(),c.hidden||a.querySelectorAll("a")[0].focus()})},init:function(b){e=e||{},this._chart=b,this._info={},this._cssPaths=e.cssPaths,this._fileName=e.fileName,this._csvSeparator=e.csvSeparator||",",this._exportFields=e.exportFields||[],this._appendFields=e.appendFields||[],this._excludeFields=e.excludeFields||[],this._cssPaths||(this._cssPaths=[],a.api.globalSettings.log('[export plugin]: the "cssPath" parameter should be specified for correct operation',"warn")),e=j.defaults(e,{visible:!0,fontSize:13,paddingTop:30});var c=e.visible?"":"display:none";this._container=b.insertToHeader('<a class="graphical-report__export" style="'+c+'">Export</a>');var d=b.addBalloon({place:"bottom-left"});this._popup=d,d.content(['<ul class="graphical-report__export__list">','<li class="graphical-report__export__item">','   <a data-value="print" tabindex="1">'+l.get("Print")+"</a>","</li>",'<li class="graphical-report__export__item">','   <a data-value="png" tabindex="2">'+l.get("Export to png")+"</a>","</li>",'<li class="graphical-report__export__item">','   <a data-value="csv" tabindex="3">'+l.get("Export to CSV")+"</a>","</li>",'<li class="graphical-report__export__item">','   <a data-value="json" tabindex="4">'+l.get("Export to JSON")+"</a>","</li>","</ul>"].join("")),d.attach(this._container);var f=d.getElement();f.setAttribute("tabindex","-1"),this._handleMenu(f,b,d),b.on("exportTo",function(a,b){this._select(b,a)}.bind(this))},destroy:function(){this._popup&&this._popup.destroy()}}}var h,i=a.api.d3,j=a.api._,k=a.api.pluginsSDK,l=k.tokens(),m=function(a,b){return a.replace(new RegExp("^"+b+"+|"+b+"+$","g"),"")},n=function(a){return a=Math.round(a),a%2?a+1:a},o=function(a){return null===a||""===a||"undefined"==typeof a},p={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},q=function(a,b){b=b||"all";var c=document.createElement("style");return c.setAttribute("media",b),c.innerHTML=a,c},r=q(e,"print"),s=function(){r&&r.parentNode&&r.parentNode.removeChild(r),h&&h.parentNode&&h.parentNode.removeChild(h)},t=/PhantomJS/.test(navigator.userAgent);t||("onafterprint"in window?window.addEventListener("afterprint",s):window.matchMedia("screen").addListener(function(a){a.matches&&s()}));var u=function(a,b,c){var d="%ef%bb%bf",e="data:"+b+";charset=UTF-8,"+d+encodeURIComponent(c),f=document.createElement("a");f.setAttribute("href",e),f.setAttribute("download",a),f.setAttribute("target","_new"),document.body.appendChild(f),f.click(),document.body.removeChild(f),f=null},v=function(a){return[].slice.call(a.querySelectorAll("text.label")).forEach(function(a){a.innerHTML=[].slice.call(a.querySelectorAll("tspan")).reduce(function(a,b){var c=b.value||b.text||b.textContent||"";return c=c.charAt(0).toUpperCase()+c.substr(1),a+c},"")}),a},w=function(a,b,c){var d=(a||{})[b]||{},e=j.isObject(d.label)?d.label.text:d.label;return e||c};return a.api.plugins.add("exportTo",g),g})},function(b,c){b.exports=a},function(a,b,c){var d,e,f;!function(g,h){"use strict";e=[c(3),c(4)],d=h,f="function"==typeof d?d.apply(b,e):d,!(void 0!==f&&(a.exports=f)),g.canvg=h(g.RGBColor,g.stackBlur)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b=[0,0,0],c=function(c,d){var e=a.match(c);null!=e&&(b[d]+=e.length,a=a.replace(c," "))};return a=a.replace(/:not\(([^\)]*)\)/g,"     $1 "),a=a.replace(/{[^]*/gm," "),c(g,1),c(h,0),c(j,1),c(k,2),c(l,1),c(m,1),a=a.replace(/[\*\s\+>~]/g," "),a=a.replace(/[#\.]/g," "),c(n,2),b.join("")}function d(d){var f={opts:d};f.FRAMERATE=30,f.MAX_VIRTUAL_PIXELS=3e4,f.log=function(a){},1==f.opts.log&&"undefined"!=typeof console&&(f.log=function(a){console.log(a)}),f.init=function(a){var b=0;f.UniqueId=function(){return b++,"canvg"+b},f.Definitions={},f.Styles={},f.StylesSpecificity={},f.Animations=[],f.Images=[],f.ctx=a,f.ViewPort=new function(){this.viewPorts=[],this.Clear=function(){this.viewPorts=[]},this.SetCurrent=function(a,b){this.viewPorts.push({width:a,height:b})},this.RemoveCurrent=function(){this.viewPorts.pop()},this.Current=function(){return this.viewPorts[this.viewPorts.length-1]},this.width=function(){return this.Current().width},this.height=function(){return this.Current().height},this.ComputeSize=function(a){return null!=a&&"number"==typeof a?a:"x"==a?this.width():"y"==a?this.height():Math.sqrt(Math.pow(this.width(),2)+Math.pow(this.height(),2))/Math.sqrt(2)}}},f.init(),f.ImagesLoaded=function(){for(var a=0;a<f.Images.length;a++)if(!f.Images[a].loaded)return!1;return!0},f.trim=function(a){return a.replace(/^\s+|\s+$/g,"")},f.compressSpaces=function(a){return a.replace(/[\s\r\t\n]+/gm," ")},f.ajax=function(a){var b;return b=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),b?(b.open("GET",a,!1),b.send(null),b.responseText):null},f.parseXml=function(a){if("undefined"!=typeof Windows&&"undefined"!=typeof Windows.Data&&"undefined"!=typeof Windows.Data.Xml){var b=new Windows.Data.Xml.Dom.XmlDocument,c=new Windows.Data.Xml.Dom.XmlLoadSettings;return c.prohibitDtd=!1,b.loadXml(a,c),b}if(window.DOMParser){var d=new DOMParser;return d.parseFromString(a,"text/xml")}a=a.replace(/<!DOCTYPE svg[^>]*>/,"");var b=new ActiveXObject("Microsoft.XMLDOM");return b.async="false",b.loadXML(a),b},f.Property=function(a,b){this.name=a,this.value=b},f.Property.prototype.getValue=function(){return this.value},f.Property.prototype.hasValue=function(){return null!=this.value&&""!==this.value},f.Property.prototype.numValue=function(){if(!this.hasValue())return 0;var a=parseFloat(this.value);return(this.value+"").match(/%$/)&&(a/=100),a},f.Property.prototype.valueOrDefault=function(a){return this.hasValue()?this.value:a},f.Property.prototype.numValueOrDefault=function(a){return this.hasValue()?this.numValue():a},f.Property.prototype.addOpacity=function(b){var c=this.value;if(null!=b.value&&""!=b.value&&"string"==typeof this.value){var d=new a(this.value);d.ok&&(c="rgba("+d.r+", "+d.g+", "+d.b+", "+b.numValue()+")")}return new f.Property(this.name,c)},f.Property.prototype.getDefinition=function(){var a=this.value.match(/#([^\)'"]+)/);return a&&(a=a[1]),a||(a=this.value),f.Definitions[a]},f.Property.prototype.isUrlDefinition=function(){return 0==this.value.indexOf("url(")},f.Property.prototype.getFillStyleDefinition=function(a,b){var c=this.getDefinition();if(null!=c&&c.createGradient)return c.createGradient(f.ctx,a,b);if(null!=c&&c.createPattern){if(c.getHrefAttribute().hasValue()){var d=c.attribute("patternTransform");c=c.getHrefAttribute().getDefinition(),d.hasValue()&&(c.attribute("patternTransform",!0).value=d.value)}return c.createPattern(f.ctx,a)}return null},f.Property.prototype.getDPI=function(a){return 96},f.Property.prototype.getEM=function(a){var b=12,c=new f.Property("fontSize",f.Font.Parse(f.ctx.font).fontSize);return c.hasValue()&&(b=c.toPixels(a)),b},f.Property.prototype.getUnits=function(){var a=this.value+"";return a.replace(/[0-9\.\-]/g,"")},f.Property.prototype.toPixels=function(a,b){if(!this.hasValue())return 0;var c=this.value+"";if(c.match(/em$/))return this.numValue()*this.getEM(a);if(c.match(/ex$/))return this.numValue()*this.getEM(a)/2;if(c.match(/px$/))return this.numValue();if(c.match(/pt$/))return this.numValue()*this.getDPI(a)*(1/72);if(c.match(/pc$/))return 15*this.numValue();if(c.match(/cm$/))return this.numValue()*this.getDPI(a)/2.54;if(c.match(/mm$/))return this.numValue()*this.getDPI(a)/25.4;if(c.match(/in$/))return this.numValue()*this.getDPI(a);if(c.match(/%$/))return this.numValue()*f.ViewPort.ComputeSize(a);var d=this.numValue();return b&&1>d?d*f.ViewPort.ComputeSize(a):d},f.Property.prototype.toMilliseconds=function(){if(!this.hasValue())return 0;var a=this.value+"";return a.match(/s$/)?1e3*this.numValue():a.match(/ms$/)?this.numValue():this.numValue()},f.Property.prototype.toRadians=function(){if(!this.hasValue())return 0;var a=this.value+"";return a.match(/deg$/)?this.numValue()*(Math.PI/180):a.match(/grad$/)?this.numValue()*(Math.PI/200):a.match(/rad$/)?this.numValue():this.numValue()*(Math.PI/180)};var g={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};return f.Property.prototype.toTextBaseline=function(){return this.hasValue()?g[this.value]:null},f.Font=new function(){this.Styles="normal|italic|oblique|inherit",this.Variants="normal|small-caps|inherit",this.Weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit",this.CreateFont=function(a,b,c,d,e,g){var h=null!=g?this.Parse(g):this.CreateFont("","","","","",f.ctx.font);return{fontFamily:e||h.fontFamily,fontSize:d||h.fontSize,fontStyle:a||h.fontStyle,fontWeight:c||h.fontWeight,fontVariant:b||h.fontVariant,toString:function(){return[this.fontStyle,this.fontVariant,this.fontWeight,this.fontSize,this.fontFamily].join(" ")}}};var a=this;this.Parse=function(b){for(var c={},d=f.trim(f.compressSpaces(b||"")).split(" "),e={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1},g="",h=0;h<d.length;h++)e.fontStyle||-1==a.Styles.indexOf(d[h])?e.fontVariant||-1==a.Variants.indexOf(d[h])?e.fontWeight||-1==a.Weights.indexOf(d[h])?e.fontSize?"inherit"!=d[h]&&(g+=d[h]):("inherit"!=d[h]&&(c.fontSize=d[h].split("/")[0]),e.fontStyle=e.fontVariant=e.fontWeight=e.fontSize=!0):("inherit"!=d[h]&&(c.fontWeight=d[h]),e.fontStyle=e.fontVariant=e.fontWeight=!0):("inherit"!=d[h]&&(c.fontVariant=d[h]),e.fontStyle=e.fontVariant=!0):("inherit"!=d[h]&&(c.fontStyle=d[h]),e.fontStyle=!0);return""!=g&&(c.fontFamily=g),c}},f.ToNumberArray=function(a){for(var b=f.trim(f.compressSpaces((a||"").replace(/,/g," "))).split(" "),c=0;c<b.length;c++)b[c]=parseFloat(b[c]);return b},f.Point=function(a,b){this.x=a,this.y=b},f.Point.prototype.angleTo=function(a){return Math.atan2(a.y-this.y,a.x-this.x)},f.Point.prototype.applyTransform=function(a){var b=this.x*a[0]+this.y*a[2]+a[4],c=this.x*a[1]+this.y*a[3]+a[5];this.x=b,this.y=c},f.CreatePoint=function(a){var b=f.ToNumberArray(a);return new f.Point(b[0],b[1])},f.CreatePath=function(a){for(var b=f.ToNumberArray(a),c=[],d=0;d<b.length;d+=2)c.push(new f.Point(b[d],b[d+1]));return c},f.BoundingBox=function(a,b,c,d){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN,this.x=function(){return this.x1},this.y=function(){return this.y1},this.width=function(){return this.x2-this.x1},this.height=function(){return this.y2-this.y1},this.addPoint=function(a,b){null!=a&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=a,this.x2=a),a<this.x1&&(this.x1=a),a>this.x2&&(this.x2=a)),null!=b&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=b,this.y2=b),b<this.y1&&(this.y1=b),b>this.y2&&(this.y2=b))},this.addX=function(a){this.addPoint(a,null)},this.addY=function(a){this.addPoint(null,a)},this.addBoundingBox=function(a){this.addPoint(a.x1,a.y1),this.addPoint(a.x2,a.y2)},this.addQuadraticCurve=function(a,b,c,d,e,f){var g=a+2/3*(c-a),h=b+2/3*(d-b),i=g+1/3*(e-a),j=h+1/3*(f-b);this.addBezierCurve(a,b,g,i,h,j,e,f)},this.addBezierCurve=function(a,b,c,d,e,f,g,h){var j=[a,b],k=[c,d],l=[e,f],m=[g,h];for(this.addPoint(j[0],j[1]),this.addPoint(m[0],m[1]),i=0;i<=1;i++){var n=function(a){return Math.pow(1-a,3)*j[i]+3*Math.pow(1-a,2)*a*k[i]+3*(1-a)*Math.pow(a,2)*l[i]+Math.pow(a,3)*m[i]},o=6*j[i]-12*k[i]+6*l[i],p=-3*j[i]+9*k[i]-9*l[i]+3*m[i],q=3*k[i]-3*j[i];if(0!=p){var r=Math.pow(o,2)-4*q*p;if(!(0>r)){var s=(-o+Math.sqrt(r))/(2*p);s>0&&1>s&&(0==i&&this.addX(n(s)),1==i&&this.addY(n(s)));var t=(-o-Math.sqrt(r))/(2*p);t>0&&1>t&&(0==i&&this.addX(n(t)),1==i&&this.addY(n(t)))}}else{if(0==o)continue;var u=-q/o;u>0&&1>u&&(0==i&&this.addX(n(u)),1==i&&this.addY(n(u)))}}},this.isPointInBox=function(a,b){return this.x1<=a&&a<=this.x2&&this.y1<=b&&b<=this.y2},this.addPoint(a,b),this.addPoint(c,d)},f.Transform=function(a){var b=this;this.Type={},this.Type.translate=function(a){this.p=f.CreatePoint(a),this.apply=function(a){a.translate(this.p.x||0,this.p.y||0)},this.unapply=function(a){a.translate(-1*this.p.x||0,-1*this.p.y||0)},this.applyToPoint=function(a){a.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0])}},this.Type.rotate=function(a){var b=f.ToNumberArray(a);this.angle=new f.Property("angle",b[0]),this.cx=b[1]||0,this.cy=b[2]||0,this.apply=function(a){a.translate(this.cx,this.cy),a.rotate(this.angle.toRadians()),a.translate(-this.cx,-this.cy)},this.unapply=function(a){a.translate(this.cx,this.cy),a.rotate(-1*this.angle.toRadians()),a.translate(-this.cx,-this.cy)},this.applyToPoint=function(a){var b=this.angle.toRadians();a.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0]),a.applyTransform([Math.cos(b),Math.sin(b),-Math.sin(b),Math.cos(b),0,0]),a.applyTransform([1,0,0,1,-this.p.x||0,-this.p.y||0])}},this.Type.scale=function(a){this.p=f.CreatePoint(a),this.apply=function(a){a.scale(this.p.x||1,this.p.y||this.p.x||1)},this.unapply=function(a){a.scale(1/this.p.x||1,1/this.p.y||this.p.x||1)},this.applyToPoint=function(a){a.applyTransform([this.p.x||0,0,0,this.p.y||0,0,0])}},this.Type.matrix=function(a){this.m=f.ToNumberArray(a),this.apply=function(a){a.transform(this.m[0],this.m[1],this.m[2],this.m[3],this.m[4],this.m[5])},this.unapply=function(a){var b=this.m[0],c=this.m[2],d=this.m[4],e=this.m[1],f=this.m[3],g=this.m[5],h=0,i=0,j=1,k=1/(b*(f*j-g*i)-c*(e*j-g*h)+d*(e*i-f*h));a.transform(k*(f*j-g*i),k*(g*h-e*j),k*(d*i-c*j),k*(b*j-d*h),k*(c*g-d*f),k*(d*e-b*g))},this.applyToPoint=function(a){a.applyTransform(this.m)}},this.Type.SkewBase=function(a){this.base=b.Type.matrix,this.base(a),this.angle=new f.Property("angle",a)},this.Type.SkewBase.prototype=new this.Type.matrix,this.Type.skewX=function(a){this.base=b.Type.SkewBase,this.base(a),this.m=[1,0,Math.tan(this.angle.toRadians()),1,0,0]},this.Type.skewX.prototype=new this.Type.SkewBase,this.Type.skewY=function(a){this.base=b.Type.SkewBase,this.base(a),this.m=[1,Math.tan(this.angle.toRadians()),0,1,0,0]},this.Type.skewY.prototype=new this.Type.SkewBase,this.transforms=[],this.apply=function(a){for(var b=0;b<this.transforms.length;b++)this.transforms[b].apply(a)},this.unapply=function(a){for(var b=this.transforms.length-1;b>=0;b--)this.transforms[b].unapply(a)},this.applyToPoint=function(a){for(var b=0;b<this.transforms.length;b++)this.transforms[b].applyToPoint(a)};for(var c=f.trim(f.compressSpaces(a)).replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/),d=0;d<c.length;d++){var e=f.trim(c[d].split("(")[0]),g=c[d].split("(")[1].replace(")",""),h=new this.Type[e](g);h.type=e,this.transforms.push(h)}},f.AspectRatio=function(a,b,c,d,e,g,h,i,j,k){b=f.compressSpaces(b),b=b.replace(/^defer\s/,"");var l=b.split(" ")[0]||"xMidYMid",m=b.split(" ")[1]||"meet",n=c/d,o=e/g,p=Math.min(n,o),q=Math.max(n,o);"meet"==m&&(d*=p,g*=p),"slice"==m&&(d*=q,g*=q),j=new f.Property("refX",j),k=new f.Property("refY",k),j.hasValue()&&k.hasValue()?a.translate(-p*j.toPixels("x"),-p*k.toPixels("y")):(l.match(/^xMid/)&&("meet"==m&&p==o||"slice"==m&&q==o)&&a.translate(c/2-d/2,0),l.match(/YMid$/)&&("meet"==m&&p==n||"slice"==m&&q==n)&&a.translate(0,e/2-g/2),l.match(/^xMax/)&&("meet"==m&&p==o||"slice"==m&&q==o)&&a.translate(c-d,0),l.match(/YMax$/)&&("meet"==m&&p==n||"slice"==m&&q==n)&&a.translate(0,e-g)),"none"==l?a.scale(n,o):"meet"==m?a.scale(p,p):"slice"==m&&a.scale(q,q),a.translate(null==h?0:-h,null==i?0:-i)},f.Element={},f.EmptyProperty=new f.Property("EMPTY",""),f.Element.ElementBase=function(a){if(this.attributes={},this.styles={},this.stylesSpecificity={},this.children=[],this.attribute=function(a,b){var c=this.attributes[a];return null!=c?c:(1==b&&(c=new f.Property(a,""),this.attributes[a]=c),c||f.EmptyProperty)},this.getHrefAttribute=function(){for(var a in this.attributes)if("href"==a||a.match(/:href$/))return this.attributes[a];return f.EmptyProperty},this.style=function(a,b,c){var d=this.styles[a];if(null!=d)return d;var e=this.attribute(a);if(null!=e&&e.hasValue())return this.styles[a]=e,e;if(1!=c){var g=this.parent;if(null!=g){var h=g.style(a);if(null!=h&&h.hasValue())return h}}return 1==b&&(d=new f.Property(a,""),this.styles[a]=d),d||f.EmptyProperty},this.render=function(a){if("none"!=this.style("display").value&&"hidden"!=this.style("visibility").value){if(a.save(),this.style("mask").hasValue()){var b=this.style("mask").getDefinition();null!=b&&b.apply(a,this)}else if(this.style("filter").hasValue()){var c=this.style("filter").getDefinition();null!=c&&c.apply(a,this)}else this.setContext(a),this.renderChildren(a),this.clearContext(a);a.restore()}},this.setContext=function(a){},this.clearContext=function(a){},this.renderChildren=function(a){for(var b=0;b<this.children.length;b++)this.children[b].render(a)},this.addChild=function(a,b){var c=a;b&&(c=f.CreateElement(a)),c.parent=this,"title"!=c.type&&this.children.push(c)},this.addStylesFromStyleDefinition=function(){for(var b in f.Styles)if("@"!=b[0]&&e(a,b)){var c=f.Styles[b],d=f.StylesSpecificity[b];if(null!=c)for(var g in c){var h=this.stylesSpecificity[g];"undefined"==typeof h&&(h="000"),d>h&&(this.styles[g]=c[g],this.stylesSpecificity[g]=d)}}},null!=a&&1==a.nodeType){for(var b=0;b<a.attributes.length;b++){var c=a.attributes[b];this.attributes[c.nodeName]=new f.Property(c.nodeName,c.value)}if(this.addStylesFromStyleDefinition(),this.attribute("style").hasValue())for(var d=this.attribute("style").value.split(";"),b=0;b<d.length;b++)if(""!=f.trim(d[b])){var g=d[b].split(":"),h=f.trim(g[0]),i=f.trim(g[1]);this.styles[h]=new f.Property(h,i)}this.attribute("id").hasValue()&&null==f.Definitions[this.attribute("id").value]&&(f.Definitions[this.attribute("id").value]=this);for(var b=0;b<a.childNodes.length;b++){var j=a.childNodes[b];if(1==j.nodeType&&this.addChild(j,!0),this.captureTextNodes&&(3==j.nodeType||4==j.nodeType)){var k=j.value||j.text||j.textContent||"";""!=f.compressSpaces(k)&&this.addChild(new f.Element.tspan(j),!1)}}}},f.Element.RenderedElementBase=function(a){this.base=f.Element.ElementBase,this.base(a),this.setContext=function(a){if(this.style("fill").isUrlDefinition()){var b=this.style("fill").getFillStyleDefinition(this,this.style("fill-opacity"));null!=b&&(a.fillStyle=b)}else if(this.style("fill").hasValue()){var c=this.style("fill");"currentColor"==c.value&&(c.value=this.style("color").value),"inherit"!=c.value&&(a.fillStyle="none"==c.value?"rgba(0,0,0,0)":c.value)}if(this.style("fill-opacity").hasValue()){var c=new f.Property("fill",a.fillStyle);c=c.addOpacity(this.style("fill-opacity")),a.fillStyle=c.value}if(this.style("stroke").isUrlDefinition()){var b=this.style("stroke").getFillStyleDefinition(this,this.style("stroke-opacity"));null!=b&&(a.strokeStyle=b)}else if(this.style("stroke").hasValue()){var d=this.style("stroke");"currentColor"==d.value&&(d.value=this.style("color").value),"inherit"!=d.value&&(a.strokeStyle="none"==d.value?"rgba(0,0,0,0)":d.value)}if(this.style("stroke-opacity").hasValue()){var d=new f.Property("stroke",a.strokeStyle);d=d.addOpacity(this.style("stroke-opacity")),a.strokeStyle=d.value}if(this.style("stroke-width").hasValue()){var e=this.style("stroke-width").toPixels();a.lineWidth=0==e?.001:e}if(this.style("stroke-linecap").hasValue()&&(a.lineCap=this.style("stroke-linecap").value),this.style("stroke-linejoin").hasValue()&&(a.lineJoin=this.style("stroke-linejoin").value),this.style("stroke-miterlimit").hasValue()&&(a.miterLimit=this.style("stroke-miterlimit").value),this.style("stroke-dasharray").hasValue()&&"none"!=this.style("stroke-dasharray").value){var g=f.ToNumberArray(this.style("stroke-dasharray").value);"undefined"!=typeof a.setLineDash?a.setLineDash(g):"undefined"!=typeof a.webkitLineDash?a.webkitLineDash=g:"undefined"==typeof a.mozDash||1==g.length&&0==g[0]||(a.mozDash=g);var h=this.style("stroke-dashoffset").numValueOrDefault(1);"undefined"!=typeof a.lineDashOffset?a.lineDashOffset=h:"undefined"!=typeof a.webkitLineDashOffset?a.webkitLineDashOffset=h:"undefined"!=typeof a.mozDashOffset&&(a.mozDashOffset=h);
  }if("undefined"!=typeof a.font&&(a.font=f.Font.CreateFont(this.style("font-style").value,this.style("font-variant").value,this.style("font-weight").value,this.style("font-size").hasValue()?this.style("font-size").toPixels()+"px":"",this.style("font-family").value).toString()),this.style("transform",!1,!0).hasValue()){var i=new f.Transform(this.style("transform",!1,!0).value);i.apply(a)}if(this.style("clip-path",!1,!0).hasValue()){var j=this.style("clip-path",!1,!0).getDefinition();null!=j&&j.apply(a)}this.style("opacity").hasValue()&&(a.globalAlpha=this.style("opacity").numValue())}},f.Element.RenderedElementBase.prototype=new f.Element.ElementBase,f.Element.PathElementBase=function(a){this.base=f.Element.RenderedElementBase,this.base(a),this.path=function(a){return null!=a&&a.beginPath(),new f.BoundingBox},this.renderChildren=function(a){this.path(a),f.Mouse.checkPath(this,a),""!=a.fillStyle&&("inherit"!=this.style("fill-rule").valueOrDefault("inherit")?a.fill(this.style("fill-rule").value):a.fill()),""!=a.strokeStyle&&a.stroke();var b=this.getMarkers();if(null!=b){if(this.style("marker-start").isUrlDefinition()){var c=this.style("marker-start").getDefinition();c.render(a,b[0][0],b[0][1])}if(this.style("marker-mid").isUrlDefinition())for(var c=this.style("marker-mid").getDefinition(),d=1;d<b.length-1;d++)c.render(a,b[d][0],b[d][1]);if(this.style("marker-end").isUrlDefinition()){var c=this.style("marker-end").getDefinition();c.render(a,b[b.length-1][0],b[b.length-1][1])}}},this.getBoundingBox=function(){return this.path()},this.getMarkers=function(){return null}},f.Element.PathElementBase.prototype=new f.Element.RenderedElementBase,f.Element.svg=function(a){this.base=f.Element.RenderedElementBase,this.base(a),this.baseClearContext=this.clearContext,this.clearContext=function(a){this.baseClearContext(a),f.ViewPort.RemoveCurrent()},this.baseSetContext=this.setContext,this.setContext=function(a){a.strokeStyle="rgba(0,0,0,0)",a.lineCap="butt",a.lineJoin="miter",a.miterLimit=4,"undefined"!=typeof a.font&&"undefined"!=typeof window.getComputedStyle&&(a.font=window.getComputedStyle(a.canvas).getPropertyValue("font")),this.baseSetContext(a),this.attribute("x").hasValue()||(this.attribute("x",!0).value=0),this.attribute("y").hasValue()||(this.attribute("y",!0).value=0),a.translate(this.attribute("x").toPixels("x"),this.attribute("y").toPixels("y"));var b=f.ViewPort.width(),c=f.ViewPort.height();if(this.attribute("width").hasValue()||(this.attribute("width",!0).value="100%"),this.attribute("height").hasValue()||(this.attribute("height",!0).value="100%"),"undefined"==typeof this.root){b=this.attribute("width").toPixels("x"),c=this.attribute("height").toPixels("y");var d=0,e=0;this.attribute("refX").hasValue()&&this.attribute("refY").hasValue()&&(d=-this.attribute("refX").toPixels("x"),e=-this.attribute("refY").toPixels("y")),"visible"!=this.attribute("overflow").valueOrDefault("hidden")&&(a.beginPath(),a.moveTo(d,e),a.lineTo(b,e),a.lineTo(b,c),a.lineTo(d,c),a.closePath(),a.clip())}if(f.ViewPort.SetCurrent(b,c),this.attribute("viewBox").hasValue()){var g=f.ToNumberArray(this.attribute("viewBox").value),h=g[0],i=g[1];b=g[2],c=g[3],f.AspectRatio(a,this.attribute("preserveAspectRatio").value,f.ViewPort.width(),b,f.ViewPort.height(),c,h,i,this.attribute("refX").value,this.attribute("refY").value),f.ViewPort.RemoveCurrent(),f.ViewPort.SetCurrent(g[2],g[3])}}},f.Element.svg.prototype=new f.Element.RenderedElementBase,f.Element.rect=function(a){this.base=f.Element.PathElementBase,this.base(a),this.path=function(a){var b=this.attribute("x").toPixels("x"),c=this.attribute("y").toPixels("y"),d=this.attribute("width").toPixels("x"),e=this.attribute("height").toPixels("y"),g=this.attribute("rx").toPixels("x"),h=this.attribute("ry").toPixels("y");return this.attribute("rx").hasValue()&&!this.attribute("ry").hasValue()&&(h=g),this.attribute("ry").hasValue()&&!this.attribute("rx").hasValue()&&(g=h),g=Math.min(g,d/2),h=Math.min(h,e/2),null!=a&&(a.beginPath(),a.moveTo(b+g,c),a.lineTo(b+d-g,c),a.quadraticCurveTo(b+d,c,b+d,c+h),a.lineTo(b+d,c+e-h),a.quadraticCurveTo(b+d,c+e,b+d-g,c+e),a.lineTo(b+g,c+e),a.quadraticCurveTo(b,c+e,b,c+e-h),a.lineTo(b,c+h),a.quadraticCurveTo(b,c,b+g,c),a.closePath()),new f.BoundingBox(b,c,b+d,c+e)}},f.Element.rect.prototype=new f.Element.PathElementBase,f.Element.circle=function(a){this.base=f.Element.PathElementBase,this.base(a),this.path=function(a){var b=this.attribute("cx").toPixels("x"),c=this.attribute("cy").toPixels("y"),d=this.attribute("r").toPixels();return null!=a&&(a.beginPath(),a.arc(b,c,d,0,2*Math.PI,!0),a.closePath()),new f.BoundingBox(b-d,c-d,b+d,c+d)}},f.Element.circle.prototype=new f.Element.PathElementBase,f.Element.ellipse=function(a){this.base=f.Element.PathElementBase,this.base(a),this.path=function(a){var b=4*((Math.sqrt(2)-1)/3),c=this.attribute("rx").toPixels("x"),d=this.attribute("ry").toPixels("y"),e=this.attribute("cx").toPixels("x"),g=this.attribute("cy").toPixels("y");return null!=a&&(a.beginPath(),a.moveTo(e,g-d),a.bezierCurveTo(e+b*c,g-d,e+c,g-b*d,e+c,g),a.bezierCurveTo(e+c,g+b*d,e+b*c,g+d,e,g+d),a.bezierCurveTo(e-b*c,g+d,e-c,g+b*d,e-c,g),a.bezierCurveTo(e-c,g-b*d,e-b*c,g-d,e,g-d),a.closePath()),new f.BoundingBox(e-c,g-d,e+c,g+d)}},f.Element.ellipse.prototype=new f.Element.PathElementBase,f.Element.line=function(a){this.base=f.Element.PathElementBase,this.base(a),this.getPoints=function(){return[new f.Point(this.attribute("x1").toPixels("x"),this.attribute("y1").toPixels("y")),new f.Point(this.attribute("x2").toPixels("x"),this.attribute("y2").toPixels("y"))]},this.path=function(a){var b=this.getPoints();return null!=a&&(a.beginPath(),a.moveTo(b[0].x,b[0].y),a.lineTo(b[1].x,b[1].y)),new f.BoundingBox(b[0].x,b[0].y,b[1].x,b[1].y)},this.getMarkers=function(){var a=this.getPoints(),b=a[0].angleTo(a[1]);return[[a[0],b],[a[1],b]]}},f.Element.line.prototype=new f.Element.PathElementBase,f.Element.polyline=function(a){this.base=f.Element.PathElementBase,this.base(a),this.points=f.CreatePath(this.attribute("points").value),this.path=function(a){var b=new f.BoundingBox(this.points[0].x,this.points[0].y);null!=a&&(a.beginPath(),a.moveTo(this.points[0].x,this.points[0].y));for(var c=1;c<this.points.length;c++)b.addPoint(this.points[c].x,this.points[c].y),null!=a&&a.lineTo(this.points[c].x,this.points[c].y);return b},this.getMarkers=function(){for(var a=[],b=0;b<this.points.length-1;b++)a.push([this.points[b],this.points[b].angleTo(this.points[b+1])]);return a.push([this.points[this.points.length-1],a[a.length-1][1]]),a}},f.Element.polyline.prototype=new f.Element.PathElementBase,f.Element.polygon=function(a){this.base=f.Element.polyline,this.base(a),this.basePath=this.path,this.path=function(a){var b=this.basePath(a);return null!=a&&(a.lineTo(this.points[0].x,this.points[0].y),a.closePath()),b}},f.Element.polygon.prototype=new f.Element.polyline,f.Element.path=function(a){this.base=f.Element.PathElementBase,this.base(a);var b=this.attribute("d").value;b=b.replace(/,/gm," ");for(var c=0;2>c;c++)b=b.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2");b=b.replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2"),b=b.replace(/([0-9])([+\-])/gm,"$1 $2");for(var c=0;2>c;c++)b=b.replace(/(\.[0-9]*)(\.)/gm,"$1 $2");b=b.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 "),b=f.compressSpaces(b),b=f.trim(b),this.PathParser=new function(a){this.tokens=a.split(" "),this.reset=function(){this.i=-1,this.command="",this.previousCommand="",this.start=new f.Point(0,0),this.control=new f.Point(0,0),this.current=new f.Point(0,0),this.points=[],this.angles=[]},this.isEnd=function(){return this.i>=this.tokens.length-1},this.isCommandOrEnd=function(){return this.isEnd()?!0:null!=this.tokens[this.i+1].match(/^[A-Za-z]$/)},this.isRelativeCommand=function(){switch(this.command){case"m":case"l":case"h":case"v":case"c":case"s":case"q":case"t":case"a":case"z":return!0}return!1},this.getToken=function(){return this.i++,this.tokens[this.i]},this.getScalar=function(){return parseFloat(this.getToken())},this.nextCommand=function(){this.previousCommand=this.command,this.command=this.getToken()},this.getPoint=function(){var a=new f.Point(this.getScalar(),this.getScalar());return this.makeAbsolute(a)},this.getAsControlPoint=function(){var a=this.getPoint();return this.control=a,a},this.getAsCurrentPoint=function(){var a=this.getPoint();return this.current=a,a},this.getReflectedControlPoint=function(){if("c"!=this.previousCommand.toLowerCase()&&"s"!=this.previousCommand.toLowerCase()&&"q"!=this.previousCommand.toLowerCase()&&"t"!=this.previousCommand.toLowerCase())return this.current;var a=new f.Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y);return a},this.makeAbsolute=function(a){return this.isRelativeCommand()&&(a.x+=this.current.x,a.y+=this.current.y),a},this.addMarker=function(a,b,c){null!=c&&this.angles.length>0&&null==this.angles[this.angles.length-1]&&(this.angles[this.angles.length-1]=this.points[this.points.length-1].angleTo(c)),this.addMarkerAngle(a,null==b?null:b.angleTo(a))},this.addMarkerAngle=function(a,b){this.points.push(a),this.angles.push(b)},this.getMarkerPoints=function(){return this.points},this.getMarkerAngles=function(){for(var a=0;a<this.angles.length;a++)if(null==this.angles[a])for(var b=a+1;b<this.angles.length;b++)if(null!=this.angles[b]){this.angles[a]=this.angles[b];break}return this.angles}}(b),this.path=function(a){var b=this.PathParser;b.reset();var c=new f.BoundingBox;for(null!=a&&a.beginPath();!b.isEnd();)switch(b.nextCommand(),b.command){case"M":case"m":var d=b.getAsCurrentPoint();for(b.addMarker(d),c.addPoint(d.x,d.y),null!=a&&a.moveTo(d.x,d.y),b.start=b.current;!b.isCommandOrEnd();){var d=b.getAsCurrentPoint();b.addMarker(d,b.start),c.addPoint(d.x,d.y),null!=a&&a.lineTo(d.x,d.y)}break;case"L":case"l":for(;!b.isCommandOrEnd();){var e=b.current,d=b.getAsCurrentPoint();b.addMarker(d,e),c.addPoint(d.x,d.y),null!=a&&a.lineTo(d.x,d.y)}break;case"H":case"h":for(;!b.isCommandOrEnd();){var g=new f.Point((b.isRelativeCommand()?b.current.x:0)+b.getScalar(),b.current.y);b.addMarker(g,b.current),b.current=g,c.addPoint(b.current.x,b.current.y),null!=a&&a.lineTo(b.current.x,b.current.y)}break;case"V":case"v":for(;!b.isCommandOrEnd();){var g=new f.Point(b.current.x,(b.isRelativeCommand()?b.current.y:0)+b.getScalar());b.addMarker(g,b.current),b.current=g,c.addPoint(b.current.x,b.current.y),null!=a&&a.lineTo(b.current.x,b.current.y)}break;case"C":case"c":for(;!b.isCommandOrEnd();){var h=b.current,i=b.getPoint(),j=b.getAsControlPoint(),k=b.getAsCurrentPoint();b.addMarker(k,j,i),c.addBezierCurve(h.x,h.y,i.x,i.y,j.x,j.y,k.x,k.y),null!=a&&a.bezierCurveTo(i.x,i.y,j.x,j.y,k.x,k.y)}break;case"S":case"s":for(;!b.isCommandOrEnd();){var h=b.current,i=b.getReflectedControlPoint(),j=b.getAsControlPoint(),k=b.getAsCurrentPoint();b.addMarker(k,j,i),c.addBezierCurve(h.x,h.y,i.x,i.y,j.x,j.y,k.x,k.y),null!=a&&a.bezierCurveTo(i.x,i.y,j.x,j.y,k.x,k.y)}break;case"Q":case"q":for(;!b.isCommandOrEnd();){var h=b.current,j=b.getAsControlPoint(),k=b.getAsCurrentPoint();b.addMarker(k,j,j),c.addQuadraticCurve(h.x,h.y,j.x,j.y,k.x,k.y),null!=a&&a.quadraticCurveTo(j.x,j.y,k.x,k.y)}break;case"T":case"t":for(;!b.isCommandOrEnd();){var h=b.current,j=b.getReflectedControlPoint();b.control=j;var k=b.getAsCurrentPoint();b.addMarker(k,j,j),c.addQuadraticCurve(h.x,h.y,j.x,j.y,k.x,k.y),null!=a&&a.quadraticCurveTo(j.x,j.y,k.x,k.y)}break;case"A":case"a":for(;!b.isCommandOrEnd();){var h=b.current,l=b.getScalar(),m=b.getScalar(),n=b.getScalar()*(Math.PI/180),o=b.getScalar(),p=b.getScalar(),k=b.getAsCurrentPoint(),q=new f.Point(Math.cos(n)*(h.x-k.x)/2+Math.sin(n)*(h.y-k.y)/2,-Math.sin(n)*(h.x-k.x)/2+Math.cos(n)*(h.y-k.y)/2),r=Math.pow(q.x,2)/Math.pow(l,2)+Math.pow(q.y,2)/Math.pow(m,2);r>1&&(l*=Math.sqrt(r),m*=Math.sqrt(r));var s=(o==p?-1:1)*Math.sqrt((Math.pow(l,2)*Math.pow(m,2)-Math.pow(l,2)*Math.pow(q.y,2)-Math.pow(m,2)*Math.pow(q.x,2))/(Math.pow(l,2)*Math.pow(q.y,2)+Math.pow(m,2)*Math.pow(q.x,2)));isNaN(s)&&(s=0);var t=new f.Point(s*l*q.y/m,s*-m*q.x/l),u=new f.Point((h.x+k.x)/2+Math.cos(n)*t.x-Math.sin(n)*t.y,(h.y+k.y)/2+Math.sin(n)*t.x+Math.cos(n)*t.y),v=function(a){return Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2))},w=function(a,b){return(a[0]*b[0]+a[1]*b[1])/(v(a)*v(b))},x=function(a,b){return(a[0]*b[1]<a[1]*b[0]?-1:1)*Math.acos(w(a,b))},y=x([1,0],[(q.x-t.x)/l,(q.y-t.y)/m]),z=[(q.x-t.x)/l,(q.y-t.y)/m],A=[(-q.x-t.x)/l,(-q.y-t.y)/m],B=x(z,A);w(z,A)<=-1&&(B=Math.PI),w(z,A)>=1&&(B=0);var C=1-p?1:-1,D=y+C*(B/2),E=new f.Point(u.x+l*Math.cos(D),u.y+m*Math.sin(D));if(b.addMarkerAngle(E,D-C*Math.PI/2),b.addMarkerAngle(k,D-C*Math.PI),c.addPoint(k.x,k.y),null!=a){var w=l>m?l:m,F=l>m?1:l/m,G=l>m?m/l:1;a.translate(u.x,u.y),a.rotate(n),a.scale(F,G),a.arc(0,0,w,y,y+B,1-p),a.scale(1/F,1/G),a.rotate(-n),a.translate(-u.x,-u.y)}}break;case"Z":case"z":null!=a&&a.closePath(),b.current=b.start}return c},this.getMarkers=function(){for(var a=this.PathParser.getMarkerPoints(),b=this.PathParser.getMarkerAngles(),c=[],d=0;d<a.length;d++)c.push([a[d],b[d]]);return c}},f.Element.path.prototype=new f.Element.PathElementBase,f.Element.pattern=function(a){this.base=f.Element.ElementBase,this.base(a),this.createPattern=function(a,b){var c=this.attribute("width").toPixels("x",!0),d=this.attribute("height").toPixels("y",!0),e=new f.Element.svg;e.attributes.viewBox=new f.Property("viewBox",this.attribute("viewBox").value),e.attributes.width=new f.Property("width",c+"px"),e.attributes.height=new f.Property("height",d+"px"),e.attributes.transform=new f.Property("transform",this.attribute("patternTransform").value),e.children=this.children;var g=document.createElement("canvas");g.width=c,g.height=d;var h=g.getContext("2d");this.attribute("x").hasValue()&&this.attribute("y").hasValue()&&h.translate(this.attribute("x").toPixels("x",!0),this.attribute("y").toPixels("y",!0));for(var i=-1;1>=i;i++)for(var j=-1;1>=j;j++)h.save(),e.attributes.x=new f.Property("x",i*g.width),e.attributes.y=new f.Property("y",j*g.height),e.render(h),h.restore();var k=a.createPattern(g,"repeat");return k}},f.Element.pattern.prototype=new f.Element.ElementBase,f.Element.marker=function(a){this.base=f.Element.ElementBase,this.base(a),this.baseRender=this.render,this.render=function(a,b,c){a.translate(b.x,b.y),"auto"==this.attribute("orient").valueOrDefault("auto")&&a.rotate(c),"strokeWidth"==this.attribute("markerUnits").valueOrDefault("strokeWidth")&&a.scale(a.lineWidth,a.lineWidth),a.save();var d=new f.Element.svg;d.attributes.viewBox=new f.Property("viewBox",this.attribute("viewBox").value),d.attributes.refX=new f.Property("refX",this.attribute("refX").value),d.attributes.refY=new f.Property("refY",this.attribute("refY").value),d.attributes.width=new f.Property("width",this.attribute("markerWidth").value),d.attributes.height=new f.Property("height",this.attribute("markerHeight").value),d.attributes.fill=new f.Property("fill",this.attribute("fill").valueOrDefault("black")),d.attributes.stroke=new f.Property("stroke",this.attribute("stroke").valueOrDefault("none")),d.children=this.children,d.render(a),a.restore(),"strokeWidth"==this.attribute("markerUnits").valueOrDefault("strokeWidth")&&a.scale(1/a.lineWidth,1/a.lineWidth),"auto"==this.attribute("orient").valueOrDefault("auto")&&a.rotate(-c),a.translate(-b.x,-b.y)}},f.Element.marker.prototype=new f.Element.ElementBase,f.Element.defs=function(a){this.base=f.Element.ElementBase,this.base(a),this.render=function(a){}},f.Element.defs.prototype=new f.Element.ElementBase,f.Element.GradientBase=function(a){this.base=f.Element.ElementBase,this.base(a),this.stops=[];for(var b=0;b<this.children.length;b++){var c=this.children[b];"stop"==c.type&&this.stops.push(c)}this.getGradient=function(){},this.gradientUnits=function(){return this.attribute("gradientUnits").valueOrDefault("objectBoundingBox")},this.attributesToInherit=["gradientUnits"],this.inheritStopContainer=function(a){for(var b=0;b<this.attributesToInherit.length;b++){var c=this.attributesToInherit[b];!this.attribute(c).hasValue()&&a.attribute(c).hasValue()&&(this.attribute(c,!0).value=a.attribute(c).value)}},this.createGradient=function(a,b,c){var d=this;this.getHrefAttribute().hasValue()&&(d=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(d));var e=function(a){if(c.hasValue()){var b=new f.Property("color",a);return b.addOpacity(c).value}return a},g=this.getGradient(a,b);if(null==g)return e(d.stops[d.stops.length-1].color);for(var h=0;h<d.stops.length;h++)g.addColorStop(d.stops[h].offset,e(d.stops[h].color));if(this.attribute("gradientTransform").hasValue()){var i=f.ViewPort.viewPorts[0],j=new f.Element.rect;j.attributes.x=new f.Property("x",-f.MAX_VIRTUAL_PIXELS/3),j.attributes.y=new f.Property("y",-f.MAX_VIRTUAL_PIXELS/3),j.attributes.width=new f.Property("width",f.MAX_VIRTUAL_PIXELS),j.attributes.height=new f.Property("height",f.MAX_VIRTUAL_PIXELS);var k=new f.Element.g;k.attributes.transform=new f.Property("transform",this.attribute("gradientTransform").value),k.children=[j];var l=new f.Element.svg;l.attributes.x=new f.Property("x",0),l.attributes.y=new f.Property("y",0),l.attributes.width=new f.Property("width",i.width),l.attributes.height=new f.Property("height",i.height),l.children=[k];var m=document.createElement("canvas");m.width=i.width,m.height=i.height;var n=m.getContext("2d");return n.fillStyle=g,l.render(n),n.createPattern(m,"no-repeat")}return g}},f.Element.GradientBase.prototype=new f.Element.ElementBase,f.Element.linearGradient=function(a){this.base=f.Element.GradientBase,this.base(a),this.attributesToInherit.push("x1"),this.attributesToInherit.push("y1"),this.attributesToInherit.push("x2"),this.attributesToInherit.push("y2"),this.getGradient=function(a,b){var c="objectBoundingBox"==this.gradientUnits()?b.getBoundingBox():null;this.attribute("x1").hasValue()||this.attribute("y1").hasValue()||this.attribute("x2").hasValue()||this.attribute("y2").hasValue()||(this.attribute("x1",!0).value=0,this.attribute("y1",!0).value=0,this.attribute("x2",!0).value=1,this.attribute("y2",!0).value=0);var d="objectBoundingBox"==this.gradientUnits()?c.x()+c.width()*this.attribute("x1").numValue():this.attribute("x1").toPixels("x"),e="objectBoundingBox"==this.gradientUnits()?c.y()+c.height()*this.attribute("y1").numValue():this.attribute("y1").toPixels("y"),f="objectBoundingBox"==this.gradientUnits()?c.x()+c.width()*this.attribute("x2").numValue():this.attribute("x2").toPixels("x"),g="objectBoundingBox"==this.gradientUnits()?c.y()+c.height()*this.attribute("y2").numValue():this.attribute("y2").toPixels("y");return d==f&&e==g?null:a.createLinearGradient(d,e,f,g)}},f.Element.linearGradient.prototype=new f.Element.GradientBase,f.Element.radialGradient=function(a){this.base=f.Element.GradientBase,this.base(a),this.attributesToInherit.push("cx"),this.attributesToInherit.push("cy"),this.attributesToInherit.push("r"),this.attributesToInherit.push("fx"),this.attributesToInherit.push("fy"),this.getGradient=function(a,b){var c=b.getBoundingBox();this.attribute("cx").hasValue()||(this.attribute("cx",!0).value="50%"),this.attribute("cy").hasValue()||(this.attribute("cy",!0).value="50%"),this.attribute("r").hasValue()||(this.attribute("r",!0).value="50%");var d="objectBoundingBox"==this.gradientUnits()?c.x()+c.width()*this.attribute("cx").numValue():this.attribute("cx").toPixels("x"),e="objectBoundingBox"==this.gradientUnits()?c.y()+c.height()*this.attribute("cy").numValue():this.attribute("cy").toPixels("y"),f=d,g=e;this.attribute("fx").hasValue()&&(f="objectBoundingBox"==this.gradientUnits()?c.x()+c.width()*this.attribute("fx").numValue():this.attribute("fx").toPixels("x")),this.attribute("fy").hasValue()&&(g="objectBoundingBox"==this.gradientUnits()?c.y()+c.height()*this.attribute("fy").numValue():this.attribute("fy").toPixels("y"));var h="objectBoundingBox"==this.gradientUnits()?(c.width()+c.height())/2*this.attribute("r").numValue():this.attribute("r").toPixels();return a.createRadialGradient(f,g,0,d,e,h)}},f.Element.radialGradient.prototype=new f.Element.GradientBase,f.Element.stop=function(a){this.base=f.Element.ElementBase,this.base(a),this.offset=this.attribute("offset").numValue(),this.offset<0&&(this.offset=0),this.offset>1&&(this.offset=1);var b=this.style("stop-color",!0);""===b.value&&(b.value="#000"),this.style("stop-opacity").hasValue()&&(b=b.addOpacity(this.style("stop-opacity"))),this.color=b.value},f.Element.stop.prototype=new f.Element.ElementBase,f.Element.AnimateBase=function(a){this.base=f.Element.ElementBase,this.base(a),f.Animations.push(this),this.duration=0,this.begin=this.attribute("begin").toMilliseconds(),this.maxDuration=this.begin+this.attribute("dur").toMilliseconds(),this.getProperty=function(){var a=this.attribute("attributeType").value,b=this.attribute("attributeName").value;return"CSS"==a?this.parent.style(b,!0):this.parent.attribute(b,!0)},this.initialValue=null,this.initialUnits="",this.removed=!1,this.calcValue=function(){return""},this.update=function(a){if(null==this.initialValue&&(this.initialValue=this.getProperty().value,this.initialUnits=this.getProperty().getUnits()),this.duration>this.maxDuration){if("indefinite"==this.attribute("repeatCount").value||"indefinite"==this.attribute("repeatDur").value)this.duration=0;else if("freeze"!=this.attribute("fill").valueOrDefault("remove")||this.frozen){if("remove"==this.attribute("fill").valueOrDefault("remove")&&!this.removed)return this.removed=!0,this.getProperty().value=this.parent.animationFrozen?this.parent.animationFrozenValue:this.initialValue,!0}else this.frozen=!0,this.parent.animationFrozen=!0,this.parent.animationFrozenValue=this.getProperty().value;return!1}this.duration=this.duration+a;var b=!1;if(this.begin<this.duration){var c=this.calcValue();if(this.attribute("type").hasValue()){var d=this.attribute("type").value;c=d+"("+c+")"}this.getProperty().value=c,b=!0}return b},this.from=this.attribute("from"),this.to=this.attribute("to"),this.values=this.attribute("values"),this.values.hasValue()&&(this.values.value=this.values.value.split(";")),this.progress=function(){var a={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(this.values.hasValue()){var b=a.progress*(this.values.value.length-1),c=Math.floor(b),d=Math.ceil(b);a.from=new f.Property("from",parseFloat(this.values.value[c])),a.to=new f.Property("to",parseFloat(this.values.value[d])),a.progress=(b-c)/(d-c)}else a.from=this.from,a.to=this.to;return a}},f.Element.AnimateBase.prototype=new f.Element.ElementBase,f.Element.animate=function(a){this.base=f.Element.AnimateBase,this.base(a),this.calcValue=function(){var a=this.progress(),b=a.from.numValue()+(a.to.numValue()-a.from.numValue())*a.progress;return b+this.initialUnits}},f.Element.animate.prototype=new f.Element.AnimateBase,f.Element.animateColor=function(b){this.base=f.Element.AnimateBase,this.base(b),this.calcValue=function(){var b=this.progress(),c=new a(b.from.value),d=new a(b.to.value);if(c.ok&&d.ok){var e=c.r+(d.r-c.r)*b.progress,f=c.g+(d.g-c.g)*b.progress,g=c.b+(d.b-c.b)*b.progress;return"rgb("+parseInt(e,10)+","+parseInt(f,10)+","+parseInt(g,10)+")"}return this.attribute("from").value}},f.Element.animateColor.prototype=new f.Element.AnimateBase,f.Element.animateTransform=function(a){this.base=f.Element.AnimateBase,this.base(a),this.calcValue=function(){for(var a=this.progress(),b=f.ToNumberArray(a.from.value),c=f.ToNumberArray(a.to.value),d="",e=0;e<b.length;e++)d+=b[e]+(c[e]-b[e])*a.progress+" ";return d}},f.Element.animateTransform.prototype=new f.Element.animate,f.Element.font=function(a){this.base=f.Element.ElementBase,this.base(a),this.horizAdvX=this.attribute("horiz-adv-x").numValue(),this.isRTL=!1,this.isArabic=!1,this.fontFace=null,this.missingGlyph=null,this.glyphs=[];for(var b=0;b<this.children.length;b++){var c=this.children[b];"font-face"==c.type?(this.fontFace=c,c.style("font-family").hasValue()&&(f.Definitions[c.style("font-family").value]=this)):"missing-glyph"==c.type?this.missingGlyph=c:"glyph"==c.type&&(""!=c.arabicForm?(this.isRTL=!0,this.isArabic=!0,"undefined"==typeof this.glyphs[c.unicode]&&(this.glyphs[c.unicode]=[]),this.glyphs[c.unicode][c.arabicForm]=c):this.glyphs[c.unicode]=c)}},f.Element.font.prototype=new f.Element.ElementBase,f.Element.fontface=function(a){this.base=f.Element.ElementBase,this.base(a),this.ascent=this.attribute("ascent").value,this.descent=this.attribute("descent").value,this.unitsPerEm=this.attribute("units-per-em").numValue()},f.Element.fontface.prototype=new f.Element.ElementBase,f.Element.missingglyph=function(a){this.base=f.Element.path,this.base(a),this.horizAdvX=0},f.Element.missingglyph.prototype=new f.Element.path,f.Element.glyph=function(a){this.base=f.Element.path,this.base(a),this.horizAdvX=this.attribute("horiz-adv-x").numValue(),this.unicode=this.attribute("unicode").value,this.arabicForm=this.attribute("arabic-form").value},f.Element.glyph.prototype=new f.Element.path,f.Element.text=function(a){this.captureTextNodes=!0,this.base=f.Element.RenderedElementBase,this.base(a),this.baseSetContext=this.setContext,this.setContext=function(a){this.baseSetContext(a);var b=this.style("dominant-baseline").toTextBaseline();null==b&&(b=this.style("alignment-baseline").toTextBaseline()),null!=b&&(a.textBaseline=b)},this.getBoundingBox=function(){var a=this.attribute("x").toPixels("x"),b=this.attribute("y").toPixels("y"),c=this.parent.style("font-size").numValueOrDefault(f.Font.Parse(f.ctx.font).fontSize);return new f.BoundingBox(a,b-c,a+Math.floor(2*c/3)*this.children[0].getText().length,b)},this.renderChildren=function(a){this.x=this.attribute("x").toPixels("x"),this.y=this.attribute("y").toPixels("y"),this.attribute("dx").hasValue()&&(this.x+=this.attribute("dx").toPixels("x")),this.attribute("dy").hasValue()&&(this.y+=this.attribute("dy").toPixels("y")),this.x+=this.getAnchorDelta(a,this,0);for(var b=0;b<this.children.length;b++)this.renderChild(a,this,b)},this.getAnchorDelta=function(a,b,c){var d=this.style("text-anchor").valueOrDefault("start");if("start"!=d){for(var e=0,f=c;f<b.children.length;f++){var g=b.children[f];if(f>c&&g.attribute("x").hasValue())break;e+=g.measureTextRecursive(a)}return-1*("end"==d?e:e/2)}return 0},this.renderChild=function(a,b,c){var d=b.children[c];d.attribute("x").hasValue()?(d.x=d.attribute("x").toPixels("x")+b.getAnchorDelta(a,b,c),d.attribute("dx").hasValue()&&(d.x+=d.attribute("dx").toPixels("x"))):(d.attribute("dx").hasValue()&&(b.x+=d.attribute("dx").toPixels("x")),d.x=b.x),b.x=d.x+d.measureText(a),d.attribute("y").hasValue()?(d.y=d.attribute("y").toPixels("y"),d.attribute("dy").hasValue()&&(d.y+=d.attribute("dy").toPixels("y"))):(d.attribute("dy").hasValue()&&(b.y+=d.attribute("dy").toPixels("y")),d.y=b.y),b.y=d.y,d.render(a);for(var c=0;c<d.children.length;c++)b.renderChild(a,d,c)}},f.Element.text.prototype=new f.Element.RenderedElementBase,f.Element.TextElementBase=function(a){this.base=f.Element.RenderedElementBase,this.base(a),this.getGlyph=function(a,b,c){var d=b[c],e=null;if(a.isArabic){var f="isolated";(0==c||" "==b[c-1])&&c<b.length-2&&" "!=b[c+1]&&(f="terminal"),c>0&&" "!=b[c-1]&&c<b.length-2&&" "!=b[c+1]&&(f="medial"),c>0&&" "!=b[c-1]&&(c==b.length-1||" "==b[c+1])&&(f="initial"),"undefined"!=typeof a.glyphs[d]&&(e=a.glyphs[d][f],null==e&&"glyph"==a.glyphs[d].type&&(e=a.glyphs[d]))}else e=a.glyphs[d];return null==e&&(e=a.missingGlyph),e},this.renderChildren=function(a){var b=this.parent.style("font-family").getDefinition();if(null==b)""!=a.fillStyle&&a.fillText(f.compressSpaces(this.getText()),this.x,this.y),""!=a.strokeStyle&&a.strokeText(f.compressSpaces(this.getText()),this.x,this.y);else{var c=this.parent.style("font-size").numValueOrDefault(f.Font.Parse(f.ctx.font).fontSize),d=this.parent.style("font-style").valueOrDefault(f.Font.Parse(f.ctx.font).fontStyle),e=this.getText();b.isRTL&&(e=e.split("").reverse().join(""));for(var g=f.ToNumberArray(this.parent.attribute("dx").value),h=0;h<e.length;h++){var i=this.getGlyph(b,e,h),j=c/b.fontFace.unitsPerEm;a.translate(this.x,this.y),a.scale(j,-j);var k=a.lineWidth;a.lineWidth=a.lineWidth*b.fontFace.unitsPerEm/c,"italic"==d&&a.transform(1,0,.4,1,0,0),i.render(a),"italic"==d&&a.transform(1,0,-.4,1,0,0),a.lineWidth=k,a.scale(1/j,-1/j),a.translate(-this.x,-this.y),this.x+=c*(i.horizAdvX||b.horizAdvX)/b.fontFace.unitsPerEm,"undefined"==typeof g[h]||isNaN(g[h])||(this.x+=g[h])}}},this.getText=function(){},this.measureTextRecursive=function(a){for(var b=this.measureText(a),c=0;c<this.children.length;c++)b+=this.children[c].measureTextRecursive(a);return b},this.measureText=function(a){var b=this.parent.style("font-family").getDefinition();if(null!=b){var c=this.parent.style("font-size").numValueOrDefault(f.Font.Parse(f.ctx.font).fontSize),d=0,e=this.getText();b.isRTL&&(e=e.split("").reverse().join(""));for(var g=f.ToNumberArray(this.parent.attribute("dx").value),h=0;h<e.length;h++){var i=this.getGlyph(b,e,h);d+=(i.horizAdvX||b.horizAdvX)*c/b.fontFace.unitsPerEm,"undefined"==typeof g[h]||isNaN(g[h])||(d+=g[h])}return d}var j=f.compressSpaces(this.getText());if(!a.measureText)return 10*j.length;a.save(),this.setContext(a);var k=a.measureText(j).width;return a.restore(),k}},f.Element.TextElementBase.prototype=new f.Element.RenderedElementBase,f.Element.tspan=function(a){this.captureTextNodes=!0,this.base=f.Element.TextElementBase,this.base(a),this.text=f.compressSpaces(a.value||a.text||a.textContent||""),this.getText=function(){return this.children.length>0?"":this.text}},f.Element.tspan.prototype=new f.Element.TextElementBase,f.Element.tref=function(a){this.base=f.Element.TextElementBase,this.base(a),this.getText=function(){var a=this.getHrefAttribute().getDefinition();return null!=a?a.children[0].getText():void 0}},f.Element.tref.prototype=new f.Element.TextElementBase,f.Element.a=function(a){this.base=f.Element.TextElementBase,this.base(a),this.hasText=a.childNodes.length>0;for(var b=0;b<a.childNodes.length;b++)3!=a.childNodes[b].nodeType&&(this.hasText=!1);this.text=this.hasText?a.childNodes[0].value:"",this.getText=function(){return this.text},this.baseRenderChildren=this.renderChildren,this.renderChildren=function(a){if(this.hasText){this.baseRenderChildren(a);var b=new f.Property("fontSize",f.Font.Parse(f.ctx.font).fontSize);f.Mouse.checkBoundingBox(this,new f.BoundingBox(this.x,this.y-b.toPixels("y"),this.x+this.measureText(a),this.y))}else if(this.children.length>0){var c=new f.Element.g;c.children=this.children,c.parent=this,c.render(a)}},this.onclick=function(){window.open(this.getHrefAttribute().value)},this.onmousemove=function(){f.ctx.canvas.style.cursor="pointer"}},f.Element.a.prototype=new f.Element.TextElementBase,f.Element.image=function(a){this.base=f.Element.RenderedElementBase,this.base(a);var b=this.getHrefAttribute().value;if(""!=b){var c=b.match(/\.svg$/);if(f.Images.push(this),this.loaded=!1,c)this.img=f.ajax(b),this.loaded=!0;else{this.img=document.createElement("img"),1==f.opts.useCORS&&(this.img.crossOrigin="Anonymous");var d=this;this.img.onload=function(){d.loaded=!0},this.img.onerror=function(){f.log('ERROR: image "'+b+'" not found'),d.loaded=!0},this.img.src=b}this.renderChildren=function(a){var b=this.attribute("x").toPixels("x"),d=this.attribute("y").toPixels("y"),e=this.attribute("width").toPixels("x"),g=this.attribute("height").toPixels("y");0!=e&&0!=g&&(a.save(),c?a.drawSvg(this.img,b,d,e,g):(a.translate(b,d),f.AspectRatio(a,this.attribute("preserveAspectRatio").value,e,this.img.width,g,this.img.height,0,0),a.drawImage(this.img,0,0)),a.restore())},this.getBoundingBox=function(){var a=this.attribute("x").toPixels("x"),b=this.attribute("y").toPixels("y"),c=this.attribute("width").toPixels("x"),d=this.attribute("height").toPixels("y");return new f.BoundingBox(a,b,a+c,b+d)}}},f.Element.image.prototype=new f.Element.RenderedElementBase,f.Element.g=function(a){this.base=f.Element.RenderedElementBase,this.base(a),this.getBoundingBox=function(){for(var a=new f.BoundingBox,b=0;b<this.children.length;b++)a.addBoundingBox(this.children[b].getBoundingBox());
  return a}},f.Element.g.prototype=new f.Element.RenderedElementBase,f.Element.symbol=function(a){this.base=f.Element.RenderedElementBase,this.base(a),this.render=function(a){}},f.Element.symbol.prototype=new f.Element.RenderedElementBase,f.Element.style=function(a){this.base=f.Element.ElementBase,this.base(a);for(var b="",d=0;d<a.childNodes.length;d++)b+=a.childNodes[d].data;b=b.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,""),b=f.compressSpaces(b);for(var e=b.split("}"),d=0;d<e.length;d++)if(""!=f.trim(e[d]))for(var g=e[d].split("{"),h=g[0].split(","),i=g[1].split(";"),j=0;j<h.length;j++){var k=f.trim(h[j]);if(""!=k){for(var l=f.Styles[k]||{},m=0;m<i.length;m++){var n=i[m].indexOf(":"),o=i[m].substr(0,n),p=i[m].substr(n+1,i[m].length-n);null!=o&&null!=p&&(l[f.trim(o)]=new f.Property(f.trim(o),f.trim(p)))}if(f.Styles[k]=l,f.StylesSpecificity[k]=c(k),"@font-face"==k)for(var q=l["font-family"].value.replace(/"/g,""),r=l.src.value.split(","),s=0;s<r.length;s++)if(r[s].indexOf('format("svg")')>0)for(var t=r[s].indexOf("url"),u=r[s].indexOf(")",t),v=r[s].substr(t+5,u-t-6),w=f.parseXml(f.ajax(v)),x=w.getElementsByTagName("font"),y=0;y<x.length;y++){var z=f.CreateElement(x[y]);f.Definitions[q]=z}}}},f.Element.style.prototype=new f.Element.ElementBase,f.Element.use=function(a){this.base=f.Element.RenderedElementBase,this.base(a),this.baseSetContext=this.setContext,this.setContext=function(a){this.baseSetContext(a),this.attribute("x").hasValue()&&a.translate(this.attribute("x").toPixels("x"),0),this.attribute("y").hasValue()&&a.translate(0,this.attribute("y").toPixels("y"))};var b=this.getHrefAttribute().getDefinition();this.path=function(a){null!=b&&b.path(a)},this.getBoundingBox=function(){return null!=b?b.getBoundingBox():void 0},this.renderChildren=function(a){if(null!=b){var c=b;"symbol"==b.type&&(c=new f.Element.svg,c.type="svg",c.attributes.viewBox=new f.Property("viewBox",b.attribute("viewBox").value),c.attributes.preserveAspectRatio=new f.Property("preserveAspectRatio",b.attribute("preserveAspectRatio").value),c.attributes.overflow=new f.Property("overflow",b.attribute("overflow").value),c.children=b.children),"svg"==c.type&&(this.attribute("width").hasValue()&&(c.attributes.width=new f.Property("width",this.attribute("width").value)),this.attribute("height").hasValue()&&(c.attributes.height=new f.Property("height",this.attribute("height").value)));var d=c.parent;c.parent=null,c.render(a),c.parent=d}}},f.Element.use.prototype=new f.Element.RenderedElementBase,f.Element.mask=function(a){this.base=f.Element.ElementBase,this.base(a),this.apply=function(a,b){var c=this.attribute("x").toPixels("x"),d=this.attribute("y").toPixels("y"),e=this.attribute("width").toPixels("x"),g=this.attribute("height").toPixels("y");if(0==e&&0==g){for(var h=new f.BoundingBox,i=0;i<this.children.length;i++)h.addBoundingBox(this.children[i].getBoundingBox());var c=Math.floor(h.x1),d=Math.floor(h.y1),e=Math.floor(h.width()),g=Math.floor(h.height())}var j=b.attribute("mask").value;b.attribute("mask").value="";var k=document.createElement("canvas");k.width=c+e,k.height=d+g;var l=k.getContext("2d");this.renderChildren(l);var m=document.createElement("canvas");m.width=c+e,m.height=d+g;var n=m.getContext("2d");b.render(n),n.globalCompositeOperation="destination-in",n.fillStyle=l.createPattern(k,"no-repeat"),n.fillRect(0,0,c+e,d+g),a.fillStyle=n.createPattern(m,"no-repeat"),a.fillRect(0,0,c+e,d+g),b.attribute("mask").value=j},this.render=function(a){}},f.Element.mask.prototype=new f.Element.ElementBase,f.Element.clipPath=function(a){this.base=f.Element.ElementBase,this.base(a),this.apply=function(a){var b=CanvasRenderingContext2D.prototype.beginPath;CanvasRenderingContext2D.prototype.beginPath=function(){};var c=CanvasRenderingContext2D.prototype.closePath;CanvasRenderingContext2D.prototype.closePath=function(){},b.call(a);for(var d=0;d<this.children.length;d++){var e=this.children[d];if("undefined"!=typeof e.path){var g=null;e.style("transform",!1,!0).hasValue()&&(g=new f.Transform(e.style("transform",!1,!0).value),g.apply(a)),e.path(a),CanvasRenderingContext2D.prototype.closePath=c,g&&g.unapply(a)}}c.call(a),a.clip(),CanvasRenderingContext2D.prototype.beginPath=b,CanvasRenderingContext2D.prototype.closePath=c},this.render=function(a){}},f.Element.clipPath.prototype=new f.Element.ElementBase,f.Element.filter=function(a){this.base=f.Element.ElementBase,this.base(a),this.apply=function(a,b){var c=b.getBoundingBox(),d=Math.floor(c.x1),e=Math.floor(c.y1),f=Math.floor(c.width()),g=Math.floor(c.height()),h=b.style("filter").value;b.style("filter").value="";for(var i=0,j=0,k=0;k<this.children.length;k++){var l=this.children[k].extraFilterDistance||0;i=Math.max(i,l),j=Math.max(j,l)}var m=document.createElement("canvas");m.width=f+2*i,m.height=g+2*j;var n=m.getContext("2d");n.translate(-d+i,-e+j),b.render(n);for(var k=0;k<this.children.length;k++)"function"==typeof this.children[k].apply&&this.children[k].apply(n,0,0,f+2*i,g+2*j);a.drawImage(m,0,0,f+2*i,g+2*j,d-i,e-j,f+2*i,g+2*j),b.style("filter",!0).value=h},this.render=function(a){}},f.Element.filter.prototype=new f.Element.ElementBase,f.Element.feMorphology=function(a){this.base=f.Element.ElementBase,this.base(a),this.apply=function(a,b,c,d,e){}},f.Element.feMorphology.prototype=new f.Element.ElementBase,f.Element.feComposite=function(a){this.base=f.Element.ElementBase,this.base(a),this.apply=function(a,b,c,d,e){}},f.Element.feComposite.prototype=new f.Element.ElementBase,f.Element.feColorMatrix=function(a){function b(a,b,c,d,e,f){return a[c*d*4+4*b+f]}function c(a,b,c,d,e,f,g){a[c*d*4+4*b+f]=g}function d(a,b){var c=e[a];return c*(0>c?b-255:b)}this.base=f.Element.ElementBase,this.base(a);var e=f.ToNumberArray(this.attribute("values").value);switch(this.attribute("type").valueOrDefault("matrix")){case"saturate":var g=e[0];e=[.213+.787*g,.715-.715*g,.072-.072*g,0,0,.213-.213*g,.715+.285*g,.072-.072*g,0,0,.213-.213*g,.715-.715*g,.072+.928*g,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var h=e[0]*Math.PI/180,i=function(a,b,c){return a+Math.cos(h)*b+Math.sin(h)*c};e=[i(.213,.787,-.213),i(.715,-.715,-.715),i(.072,-.072,.928),0,0,i(.213,-.213,.143),i(.715,.285,.14),i(.072,-.072,-.283),0,0,i(.213,-.213,-.787),i(.715,-.715,.715),i(.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1]}this.apply=function(a,e,f,g,h){for(var i=a.getImageData(0,0,g,h),f=0;h>f;f++)for(var e=0;g>e;e++){var j=b(i.data,e,f,g,h,0),k=b(i.data,e,f,g,h,1),l=b(i.data,e,f,g,h,2),m=b(i.data,e,f,g,h,3);c(i.data,e,f,g,h,0,d(0,j)+d(1,k)+d(2,l)+d(3,m)+d(4,1)),c(i.data,e,f,g,h,1,d(5,j)+d(6,k)+d(7,l)+d(8,m)+d(9,1)),c(i.data,e,f,g,h,2,d(10,j)+d(11,k)+d(12,l)+d(13,m)+d(14,1)),c(i.data,e,f,g,h,3,d(15,j)+d(16,k)+d(17,l)+d(18,m)+d(19,1))}a.clearRect(0,0,g,h),a.putImageData(i,0,0)}},f.Element.feColorMatrix.prototype=new f.Element.ElementBase,f.Element.feGaussianBlur=function(a){this.base=f.Element.ElementBase,this.base(a),this.blurRadius=Math.floor(this.attribute("stdDeviation").numValue()),this.extraFilterDistance=this.blurRadius,this.apply=function(a,c,d,e,g){return"undefined"==typeof b.canvasRGBA?void f.log("ERROR: StackBlur.js must be included for blur to work"):(a.canvas.id=f.UniqueId(),a.canvas.style.display="none",document.body.appendChild(a.canvas),b.canvasRGBA(a.canvas.id,c,d,e,g,this.blurRadius),void document.body.removeChild(a.canvas))}},f.Element.feGaussianBlur.prototype=new f.Element.ElementBase,f.Element.title=function(a){},f.Element.title.prototype=new f.Element.ElementBase,f.Element.desc=function(a){},f.Element.desc.prototype=new f.Element.ElementBase,f.Element.MISSING=function(a){f.log("ERROR: Element '"+a.nodeName+"' not yet implemented.")},f.Element.MISSING.prototype=new f.Element.ElementBase,f.CreateElement=function(a){var b=a.nodeName.replace(/^[^:]+:/,"");b=b.replace(/\-/g,"");var c=null;return c="undefined"!=typeof f.Element[b]?new f.Element[b](a):new f.Element.MISSING(a),c.type=a.nodeName,c},f.load=function(a,b){f.loadXml(a,f.ajax(b))},f.loadXml=function(a,b){f.loadXmlDoc(a,f.parseXml(b))},f.loadXmlDoc=function(a,b){f.init(a);var c=function(b){for(var c=a.canvas;c;)b.x-=c.offsetLeft,b.y-=c.offsetTop,c=c.offsetParent;return window.scrollX&&(b.x+=window.scrollX),window.scrollY&&(b.y+=window.scrollY),b};1!=f.opts.ignoreMouse&&(a.canvas.onclick=function(a){var b=c(new f.Point(null!=a?a.clientX:event.clientX,null!=a?a.clientY:event.clientY));f.Mouse.onclick(b.x,b.y)},a.canvas.onmousemove=function(a){var b=c(new f.Point(null!=a?a.clientX:event.clientX,null!=a?a.clientY:event.clientY));f.Mouse.onmousemove(b.x,b.y)});var d=f.CreateElement(b.documentElement);d.root=!0,d.addStylesFromStyleDefinition();var e=!0,g=function(){f.ViewPort.Clear(),a.canvas.parentNode&&f.ViewPort.SetCurrent(a.canvas.parentNode.clientWidth,a.canvas.parentNode.clientHeight),1!=f.opts.ignoreDimensions&&(d.style("width").hasValue()&&(a.canvas.width=d.style("width").toPixels("x"),a.canvas.style.width=a.canvas.width+"px"),d.style("height").hasValue()&&(a.canvas.height=d.style("height").toPixels("y"),a.canvas.style.height=a.canvas.height+"px"));var c=a.canvas.clientWidth||a.canvas.width,g=a.canvas.clientHeight||a.canvas.height;if(1==f.opts.ignoreDimensions&&d.style("width").hasValue()&&d.style("height").hasValue()&&(c=d.style("width").toPixels("x"),g=d.style("height").toPixels("y")),f.ViewPort.SetCurrent(c,g),null!=f.opts.offsetX&&(d.attribute("x",!0).value=f.opts.offsetX),null!=f.opts.offsetY&&(d.attribute("y",!0).value=f.opts.offsetY),null!=f.opts.scaleWidth||null!=f.opts.scaleHeight){var h=null,i=null,j=f.ToNumberArray(d.attribute("viewBox").value);null!=f.opts.scaleWidth&&(d.attribute("width").hasValue()?h=d.attribute("width").toPixels("x")/f.opts.scaleWidth:isNaN(j[2])||(h=j[2]/f.opts.scaleWidth)),null!=f.opts.scaleHeight&&(d.attribute("height").hasValue()?i=d.attribute("height").toPixels("y")/f.opts.scaleHeight:isNaN(j[3])||(i=j[3]/f.opts.scaleHeight)),null==h&&(h=i),null==i&&(i=h),d.attribute("width",!0).value=f.opts.scaleWidth,d.attribute("height",!0).value=f.opts.scaleHeight,d.style("transform",!0,!0).value+=" scale("+1/h+","+1/i+")"}1!=f.opts.ignoreClear&&a.clearRect(0,0,c,g),d.render(a),e&&(e=!1,"function"==typeof f.opts.renderCallback&&f.opts.renderCallback(b))},h=!0;f.ImagesLoaded()&&(h=!1,g()),f.intervalID=setInterval(function(){var a=!1;if(h&&f.ImagesLoaded()&&(h=!1,a=!0),1!=f.opts.ignoreMouse&&(a|=f.Mouse.hasEvents()),1!=f.opts.ignoreAnimation)for(var b=0;b<f.Animations.length;b++)a|=f.Animations[b].update(1e3/f.FRAMERATE);"function"==typeof f.opts.forceRedraw&&1==f.opts.forceRedraw()&&(a=!0),a&&(g(),f.Mouse.runEvents())},1e3/f.FRAMERATE)},f.stop=function(){f.intervalID&&clearInterval(f.intervalID)},f.Mouse=new function(){this.events=[],this.hasEvents=function(){return 0!=this.events.length},this.onclick=function(a,b){this.events.push({type:"onclick",x:a,y:b,run:function(a){a.onclick&&a.onclick()}})},this.onmousemove=function(a,b){this.events.push({type:"onmousemove",x:a,y:b,run:function(a){a.onmousemove&&a.onmousemove()}})},this.eventElements=[],this.checkPath=function(a,b){for(var c=0;c<this.events.length;c++){var d=this.events[c];b.isPointInPath&&b.isPointInPath(d.x,d.y)&&(this.eventElements[c]=a)}},this.checkBoundingBox=function(a,b){for(var c=0;c<this.events.length;c++){var d=this.events[c];b.isPointInBox(d.x,d.y)&&(this.eventElements[c]=a)}},this.runEvents=function(){f.ctx.canvas.style.cursor="";for(var a=0;a<this.events.length;a++)for(var b=this.events[a],c=this.eventElements[a];c;)b.run(c),c=c.parent;this.events=[],this.eventElements=[]}},f}var e,f=function(a,b,c){if(null!=a||null!=b||null!=c){"string"==typeof a&&(a=document.getElementById(a)),null!=a.svg&&a.svg.stop();var e=d(c||{});1==a.childNodes.length&&"OBJECT"==a.childNodes[0].nodeName||(a.svg=e);var g=a.getContext("2d");"undefined"!=typeof b.documentElement?e.loadXmlDoc(g,b):"<"==b.substr(0,1)?e.loadXml(g,b):e.load(g,b)}else for(var h=document.querySelectorAll("svg"),i=0;i<h.length;i++){var j=h[i],k=document.createElement("canvas");k.width=j.clientWidth,k.height=j.clientHeight,j.parentNode.insertBefore(k,j),j.parentNode.removeChild(j);var l=document.createElement("div");l.appendChild(j),f(k,l.innerHTML)}};"undefined"!=typeof Element.prototype.matches?e=function(a,b){return a.matches(b)}:"undefined"!=typeof Element.prototype.webkitMatchesSelector?e=function(a,b){return a.webkitMatchesSelector(b)}:"undefined"!=typeof Element.prototype.mozMatchesSelector?e=function(a,b){return a.mozMatchesSelector(b)}:"undefined"!=typeof Element.prototype.msMatchesSelector?e=function(a,b){return a.msMatchesSelector(b)}:"undefined"!=typeof Element.prototype.oMatchesSelector?e=function(a,b){return a.oMatchesSelector(b)}:("function"!=typeof jQuery&&"function"!=typeof Zepto||(e=function(a,b){return $(a).is(b)}),"undefined"==typeof e&&(e=Sizzle.matchesSelector));var g=/(\[[^\]]+\])/g,h=/(#[^\s\+>~\.\[:]+)/g,j=/(\.[^\s\+>~\.\[:]+)/g,k=/(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi,l=/(:[\w-]+\([^\)]*\))/gi,m=/(:[^\s\+>~\.\[:]+)/g,n=/([^\s\+>~\.\[:]+)/g;return"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.drawSvg=function(a,b,c,d,e){f(this.canvas,a,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:b,offsetY:c,scaleWidth:d,scaleHeight:e})}),f})},function(a,b,c){var d;!function(e){function f(a){this.ok=!1,"#"==a.charAt(0)&&(a=a.substr(1,6)),a=a.replace(/ /g,""),a=a.toLowerCase();var b={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};for(var c in b)a==c&&(a=b[c]);for(var d=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(a){return[parseInt(a[1]),parseInt(a[2]),parseInt(a[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}}],e=0;e<d.length;e++){var g=d[e].re,h=d[e].process,i=g.exec(a);i&&(channels=h(i),this.r=channels[0],this.g=channels[1],this.b=channels[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var a=this.r.toString(16),b=this.g.toString(16),c=this.b.toString(16);return 1==a.length&&(a="0"+a),1==b.length&&(b="0"+b),1==c.length&&(c="0"+c),"#"+a+b+c},this.getHelpXML=function(){for(var a=new Array,c=0;c<d.length;c++)for(var e=d[c].example,g=0;g<e.length;g++)a[a.length]=e[g];for(var h in b)a[a.length]=h;var i=document.createElement("ul");i.setAttribute("id","rgbcolor-examples");for(var c=0;c<a.length;c++)try{var j=document.createElement("li"),k=new f(a[c]),l=document.createElement("div");l.style.cssText="margin: 3px; border: 1px solid black; background:"+k.toHex()+"; color:"+k.toHex(),l.appendChild(document.createTextNode("test"));var m=document.createTextNode(" "+a[c]+" -> "+k.toRGB()+" -> "+k.toHex());j.appendChild(l),j.appendChild(m),i.appendChild(j)}catch(n){}return i}}d=function(){return f}.call(b,c,b,a),!(void 0!==d&&(a.exports=d)),e.RGBColor=f}("undefined"!=typeof window?window:this)},function(a,b,c){var d;!function(e){function f(a){for(var b=a.data,c=a.width*a.height*4,d=0;c>d;d+=4){var e=b[d+3]/255;b[d]*=e,b[d+1]*=e,b[d+2]*=e}}function g(a){for(var b=a.data,c=a.width*a.height*4,d=0;c>d;d+=4){var e=b[d+3];0!=e&&(e=255/e,b[d]*=e,b[d+1]*=e,b[d+2]*=e)}}function h(a,b,c,d){var e=document.getElementById(a),f=e.naturalWidth,g=e.naturalHeight,h=document.getElementById(b);h.style.width=f+"px",h.style.height=g+"px",h.width=f,h.height=g;var k=h.getContext("2d");k.clearRect(0,0,f,g),k.drawImage(e,0,0),isNaN(c)||1>c||(d?i(b,0,0,f,g,c):j(b,0,0,f,g,c))}function i(a,b,c,d,e,h){if(!(isNaN(h)||1>h)){h|=0;var i,j=document.getElementById(a),n=j.getContext("2d");try{try{i=n.getImageData(b,c,d,e)}catch(o){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"),i=n.getImageData(b,c,d,e)}catch(o){throw alert("Cannot access local image"),new Error("unable to access local image data: "+o)}}}catch(o){throw alert("Cannot access image"),new Error("unable to access image data: "+o)}f(i);var p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N=i.data,O=h+h+1,P=d-1,Q=e-1,R=h+1,S=R*(R+1)/2,T=new k,U=T;for(r=1;O>r;r++)if(U=U.next=new k,r==R)var V=U;U.next=T;var W=null,X=null;v=u=0;var Y=l[h],Z=m[h];for(q=0;e>q;q++){for(E=F=G=H=w=x=y=z=0,A=R*(I=N[u]),B=R*(J=N[u+1]),C=R*(K=N[u+2]),D=R*(L=N[u+3]),w+=S*I,x+=S*J,y+=S*K,z+=S*L,U=T,r=0;R>r;r++)U.r=I,U.g=J,U.b=K,U.a=L,U=U.next;for(r=1;R>r;r++)s=u+((r>P?P:r)<<2),w+=(U.r=I=N[s])*(M=R-r),x+=(U.g=J=N[s+1])*M,y+=(U.b=K=N[s+2])*M,z+=(U.a=L=N[s+3])*M,E+=I,F+=J,G+=K,H+=L,U=U.next;for(W=T,X=V,p=0;d>p;p++)N[u]=w*Y>>Z,N[u+1]=x*Y>>Z,N[u+2]=y*Y>>Z,N[u+3]=z*Y>>Z,w-=A,x-=B,y-=C,z-=D,A-=W.r,B-=W.g,C-=W.b,D-=W.a,s=v+((s=p+h+1)<P?s:P)<<2,E+=W.r=N[s],F+=W.g=N[s+1],G+=W.b=N[s+2],H+=W.a=N[s+3],w+=E,x+=F,y+=G,z+=H,W=W.next,A+=I=X.r,B+=J=X.g,C+=K=X.b,D+=L=X.a,E-=I,F-=J,G-=K,H-=L,X=X.next,u+=4;v+=d}for(p=0;d>p;p++){for(F=G=H=E=x=y=z=w=0,u=p<<2,A=R*(I=N[u]),B=R*(J=N[u+1]),C=R*(K=N[u+2]),D=R*(L=N[u+3]),w+=S*I,x+=S*J,y+=S*K,z+=S*L,U=T,r=0;R>r;r++)U.r=I,U.g=J,U.b=K,U.a=L,U=U.next;for(t=d,r=1;h>=r;r++)u=t+p<<2,w+=(U.r=I=N[u])*(M=R-r),x+=(U.g=J=N[u+1])*M,y+=(U.b=K=N[u+2])*M,z+=(U.a=L=N[u+3])*M,E+=I,F+=J,G+=K,H+=L,U=U.next,Q>r&&(t+=d);for(u=p,W=T,X=V,q=0;e>q;q++)s=u<<2,N[s]=w*Y>>Z,N[s+1]=x*Y>>Z,N[s+2]=y*Y>>Z,N[s+3]=z*Y>>Z,w-=A,x-=B,y-=C,z-=D,A-=W.r,B-=W.g,C-=W.b,D-=W.a,s=p+((s=q+R)<Q?s:Q)*d<<2,w+=E+=W.r=N[s],x+=F+=W.g=N[s+1],y+=G+=W.b=N[s+2],z+=H+=W.a=N[s+3],W=W.next,A+=I=X.r,B+=J=X.g,C+=K=X.b,D+=L=X.a,E-=I,F-=J,G-=K,H-=L,X=X.next,u+=d}g(i),n.putImageData(i,b,c)}}function j(a,b,c,d,e,f){if(!(isNaN(f)||1>f)){f|=0;var g,h=document.getElementById(a),i=h.getContext("2d");try{try{g=i.getImageData(b,c,d,e)}catch(j){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"),g=i.getImageData(b,c,d,e)}catch(j){throw alert("Cannot access local image"),new Error("unable to access local image data: "+j)}}}catch(j){throw alert("Cannot access image"),new Error("unable to access image data: "+j)}var n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H=g.data,I=f+f+1,J=d-1,K=e-1,L=f+1,M=L*(L+1)/2,N=new k,O=N;for(p=1;I>p;p++)if(O=O.next=new k,p==L)var P=O;O.next=N;var Q=null,R=null;t=s=0;var S=l[f],T=m[f];for(o=0;e>o;o++){for(A=B=C=u=v=w=0,x=L*(D=H[s]),y=L*(E=H[s+1]),z=L*(F=H[s+2]),u+=M*D,v+=M*E,w+=M*F,O=N,p=0;L>p;p++)O.r=D,O.g=E,O.b=F,O=O.next;for(p=1;L>p;p++)q=s+((p>J?J:p)<<2),u+=(O.r=D=H[q])*(G=L-p),v+=(O.g=E=H[q+1])*G,w+=(O.b=F=H[q+2])*G,A+=D,B+=E,C+=F,O=O.next;for(Q=N,R=P,n=0;d>n;n++)H[s]=u*S>>T,H[s+1]=v*S>>T,H[s+2]=w*S>>T,u-=x,v-=y,w-=z,x-=Q.r,y-=Q.g,z-=Q.b,q=t+((q=n+f+1)<J?q:J)<<2,A+=Q.r=H[q],B+=Q.g=H[q+1],C+=Q.b=H[q+2],u+=A,v+=B,w+=C,Q=Q.next,x+=D=R.r,y+=E=R.g,z+=F=R.b,A-=D,B-=E,C-=F,R=R.next,s+=4;t+=d}for(n=0;d>n;n++){for(B=C=A=v=w=u=0,s=n<<2,x=L*(D=H[s]),y=L*(E=H[s+1]),z=L*(F=H[s+2]),u+=M*D,v+=M*E,w+=M*F,O=N,p=0;L>p;p++)O.r=D,O.g=E,O.b=F,O=O.next;for(r=d,p=1;f>=p;p++)s=r+n<<2,u+=(O.r=D=H[s])*(G=L-p),v+=(O.g=E=H[s+1])*G,w+=(O.b=F=H[s+2])*G,A+=D,B+=E,C+=F,O=O.next,K>p&&(r+=d);for(s=n,Q=N,R=P,o=0;e>o;o++)q=s<<2,H[q]=u*S>>T,H[q+1]=v*S>>T,H[q+2]=w*S>>T,u-=x,v-=y,w-=z,x-=Q.r,y-=Q.g,z-=Q.b,q=n+((q=o+L)<K?q:K)*d<<2,u+=A+=Q.r=H[q],v+=B+=Q.g=H[q+1],w+=C+=Q.b=H[q+2],Q=Q.next,x+=D=R.r,y+=E=R.g,z+=F=R.b,A-=D,B-=E,C-=F,R=R.next,s+=d}i.putImageData(g,b,c)}}function k(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var l=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],m=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24],n={image:h,canvasRGBA:i,canvasRGB:j};d=function(){return n}.call(b,c,b,a),!(void 0!==d&&(a.exports=d)),e.stackBlur=n}("undefined"!=typeof window?window:this)},function(a,b,c){var d,e;d=[],e=function(){return window.saveAs||"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(a){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var b=a.document,c=function(){return a.URL||a.webkitURL||a},d=b.createElementNS("http://www.w3.org/1999/xhtml","a"),e="download"in d,f=function(c){var d=b.createEvent("MouseEvents");d.initMouseEvent("click",!0,!1,a,0,0,0,0,0,!1,!1,!1,!1,0,null),c.dispatchEvent(d)},g=a.webkitRequestFileSystem,h=a.requestFileSystem||g||a.mozRequestFileSystem,i=function(b){(a.setImmediate||a.setTimeout)(function(){throw b},0)},j="application/octet-stream",k=0,l=500,m=function(b){var d=function(){"string"==typeof b?c().revokeObjectURL(b):b.remove()};a.chrome?d():setTimeout(d,l)},n=function(a,b,c){b=[].concat(b);for(var d=b.length;d--;){var e=a["on"+b[d]];if("function"==typeof e)try{e.call(a,c||a)}catch(f){i(f)}}},o=function(b,i){var l,o,p,q=this,r=b.type,s=!1,t=function(){n(q,"writestart progress write writeend".split(" "))},u=function(){if(!s&&l||(l=c().createObjectURL(b)),o)o.location.href=l;else{var d=a.open(l,"_blank");void 0==d&&"undefined"!=typeof safari&&(a.location.href=l)}q.readyState=q.DONE,t(),m(l)},v=function(a){return function(){return q.readyState!==q.DONE?a.apply(this,arguments):void 0}},w={create:!0,exclusive:!1};return q.readyState=q.INIT,i||(i="download"),e?(l=c().createObjectURL(b),d.href=l,d.download=i,f(d),q.readyState=q.DONE,t(),void m(l)):(a.chrome&&r&&r!==j&&(p=b.slice||b.webkitSlice,b=p.call(b,0,b.size,j),s=!0),g&&"download"!==i&&(i+=".download"),(r===j||g)&&(o=a),h?(k+=b.size,void h(a.TEMPORARY,k,v(function(a){a.root.getDirectory("saved",w,v(function(a){var c=function(){a.getFile(i,w,v(function(a){a.createWriter(v(function(c){c.onwriteend=function(b){o.location.href=a.toURL(),q.readyState=q.DONE,n(q,"writeend",b),m(a)},c.onerror=function(){var a=c.error;a.code!==a.ABORT_ERR&&u()},"writestart progress write abort".split(" ").forEach(function(a){c["on"+a]=q["on"+a]}),c.write(b),q.abort=function(){c.abort(),q.readyState=q.DONE},q.readyState=q.WRITING}),u)}),u)};a.getFile(i,{create:!1},v(function(a){a.remove(),c()}),v(function(a){a.code===a.NOT_FOUND_ERR?c():u()}))}),u)}),u)):void u())},p=o.prototype,q=function(a,b){return new o(a,b)};return p.abort=function(){var a=this;a.readyState=a.DONE,n(a,"abort")},p.readyState=p.INIT=0,p.WRITING=1,p.DONE=2,p.error=p.onwritestart=p.onprogress=p.onwrite=p.onabort=p.onerror=p.onwriteend=null,q}}(window)}.apply(b,d),!(void 0!==e&&(a.exports=e))},function(a,b,c){var d;(function(a,e,f){(function(){"use strict";function g(a){return"function"==typeof a||"object"==typeof a&&null!==a}function h(a){return"function"==typeof a}function i(a){return"object"==typeof a&&null!==a}function j(){}function k(){return function(){a.nextTick(o)}}function l(){var a=0,b=new R(o),c=document.createTextNode("");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2}}function m(){var a=new MessageChannel;return a.port1.onmessage=o,function(){a.port2.postMessage(0)}}function n(){return function(){setTimeout(o,1)}}function o(){for(var a=0;O>a;a+=2){var b=T[a],c=T[a+1];b(c),T[a]=void 0,T[a+1]=void 0}O=0}function p(){}function q(){return new TypeError("You cannot resolve a promise with itself")}function r(){return new TypeError("A promises callback cannot return that same promise.")}function s(a){try{return a.then}catch(b){return X.error=b,X}}function t(a,b,c,d){try{a.call(b,c,d)}catch(e){return e}}function u(a,b,c){P(function(a){var d=!1,e=t(c,b,function(c){d||(d=!0,b!==c?x(a,c):z(a,c))},function(b){d||(d=!0,A(a,b))},"Settle: "+(a._label||" unknown promise"));!d&&e&&(d=!0,A(a,e))},a)}function v(a,b){b._state===V?z(a,b._result):a._state===W?A(a,b._result):B(b,void 0,function(b){x(a,b)},function(b){A(a,b)})}function w(a,b){if(b.constructor===a.constructor)v(a,b);else{var c=s(b);c===X?A(a,X.error):void 0===c?z(a,b):h(c)?u(a,b,c):z(a,b)}}function x(a,b){a===b?A(a,q()):g(b)?w(a,b):z(a,b)}function y(a){a._onerror&&a._onerror(a._result),C(a)}function z(a,b){a._state===U&&(a._result=b,a._state=V,0===a._subscribers.length||P(C,a))}function A(a,b){a._state===U&&(a._state=W,a._result=b,P(y,a))}function B(a,b,c,d){var e=a._subscribers,f=e.length;a._onerror=null,e[f]=b,e[f+V]=c,e[f+W]=d,0===f&&a._state&&P(C,a)}function C(a){var b=a._subscribers,c=a._state;if(0!==b.length){for(var d,e,f=a._result,g=0;g<b.length;g+=3)d=b[g],e=b[g+c],d?F(c,d,e,f):e(f);a._subscribers.length=0}}function D(){this.error=null}function E(a,b){try{return a(b)}catch(c){return Y.error=c,Y}}function F(a,b,c,d){var e,f,g,i,j=h(c);if(j){if(e=E(c,d),e===Y?(i=!0,f=e.error,e=null):g=!0,b===e)return void A(b,r())}else e=d,g=!0;b._state!==U||(j&&g?x(b,e):i?A(b,f):a===V?z(b,e):a===W&&A(b,e))}function G(a,b){try{b(function(b){x(a,b)},function(b){A(a,b)})}catch(c){A(a,c)}}function H(a,b,c,d){this._instanceConstructor=a,this.promise=new a(p,d),this._abortOnReject=c,this._validateInput(b)?(this._input=b,this.length=b.length,this._remaining=b.length,this._init(),0===this.length?z(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&z(this.promise,this._result))):A(this.promise,this._validationError())}function I(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function J(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function K(a){this._id=ca++,this._state=void 0,this._result=void 0,this._subscribers=[],p!==a&&(h(a)||I(),this instanceof K||J(),G(this,a))}var L;L=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)};var M,N=L,O=(Date.now||function(){return(new Date).getTime()},Object.create||function(a){if(arguments.length>1)throw new Error("Second argument not supported");if("object"!=typeof a)throw new TypeError("Argument must be an object");return j.prototype=a,new j},0),P=function(a,b){T[O]=a,T[O+1]=b,O+=2,2===O&&M()},Q="undefined"!=typeof window?window:{},R=Q.MutationObserver||Q.WebKitMutationObserver,S="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,T=new Array(1e3);M="undefined"!=typeof a&&"[object process]"==={}.toString.call(a)?k():R?l():S?m():n();var U=void 0,V=1,W=2,X=new D,Y=new D;H.prototype._validateInput=function(a){return N(a)},H.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},H.prototype._init=function(){this._result=new Array(this.length)};var Z=H;H.prototype._enumerate=function(){for(var a=this.length,b=this.promise,c=this._input,d=0;b._state===U&&a>d;d++)this._eachEntry(c[d],d)},H.prototype._eachEntry=function(a,b){var c=this._instanceConstructor;i(a)?a.constructor===c&&a._state!==U?(a._onerror=null,this._settledAt(a._state,b,a._result)):this._willSettleAt(c.resolve(a),b):(this._remaining--,this._result[b]=this._makeResult(V,b,a))},H.prototype._settledAt=function(a,b,c){var d=this.promise;d._state===U&&(this._remaining--,this._abortOnReject&&a===W?A(d,c):this._result[b]=this._makeResult(a,b,c)),0===this._remaining&&z(d,this._result)},H.prototype._makeResult=function(a,b,c){return c},H.prototype._willSettleAt=function(a,b){var c=this;B(a,void 0,function(a){c._settledAt(V,b,a)},function(a){c._settledAt(W,b,a)})};var $=function(a,b){return new Z(this,a,!0,b).promise},_=function(a,b){function c(a){x(f,a)}function d(a){A(f,a)}var e=this,f=new e(p,b);if(!N(a))return A(f,new TypeError("You must pass an array to race.")),f;for(var g=a.length,h=0;f._state===U&&g>h;h++)B(e.resolve(a[h]),void 0,c,d);
  return f},aa=function(a,b){var c=this;if(a&&"object"==typeof a&&a.constructor===c)return a;var d=new c(p,b);return x(d,a),d},ba=function(a,b){var c=this,d=new c(p,b);return A(d,a),d},ca=0,da=K;K.all=$,K.race=_,K.resolve=aa,K.reject=ba,K.prototype={constructor:K,then:function(a,b){var c=this,d=c._state;if(d===V&&!a||d===W&&!b)return this;var e=new this.constructor(p),f=c._result;if(d){var g=arguments[d-1];P(function(){F(d,e,g,f)})}else B(c,e,a,b);return e},"catch":function(a){return this.then(null,a)}};var ea=function(){var a;a="undefined"!=typeof e?e:"undefined"!=typeof window&&window.document?window:self;var b="Promise"in a&&"resolve"in a.Promise&&"reject"in a.Promise&&"all"in a.Promise&&"race"in a.Promise&&function(){var b;return new a.Promise(function(a){b=a}),h(b)}();b||(a.Promise=da)},fa={Promise:da,polyfill:ea};c(9).amd?(d=function(){return fa}.call(b,c,b,f),!(void 0!==d&&(f.exports=d))):"undefined"!=typeof f&&f.exports?f.exports=fa:"undefined"!=typeof this&&(this.ES6Promise=fa)}).call(this)}).call(b,c(7),function(){return this}(),c(8)(a))},function(a,b){function c(){j=!1,g.length?i=g.concat(i):k=-1,i.length&&d()}function d(){if(!j){var a=setTimeout(c);j=!0;for(var b=i.length;b;){for(g=i,i=[];++k<b;)g&&g[k].run();k=-1,b=i.length}g=null,j=!1,clearTimeout(a)}}function e(a,b){this.fun=a,this.array=b}function f(){}var g,h=a.exports={},i=[],j=!1,k=-1;h.nextTick=function(a){var b=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];i.push(new e(a,b)),1!==i.length||j||setTimeout(d,0)},e.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=f,h.addListener=f,h.once=f,h.off=f,h.removeListener=f,h.removeAllListeners=f,h.emit=f,h.binding=function(a){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(a){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(a,b){a.exports=function(a){return a.webpackPolyfill||(a.deprecate=function(){},a.paths=[],a.children=[],a.webpackPolyfill=1),a}},function(a,b){a.exports=function(){throw new Error("define cannot be used indirect")}},function(a,b){a.exports="body > * {\r\n    visibility: hidden;\r\n}\r\nbody {\r\n    overflow: hidden;\r\n}\r\nbody * {\r\n    visibility: hidden !important;\r\n}\r\n\r\n.graphical-report__print-block {\r\n    position: absolute;\r\n    top: 0;\r\n    left: 0;\r\n    visibility: visible !important;\r\n    display: block !important;\r\n    width: 100%;\r\n    /*height: 100%;*/\r\n}\r\n"},function(a,b){!function(){"use strict";function a(b){this.map={};var c=this;b instanceof a?b.forEach(function(a,b){b.forEach(function(b){c.append(a,b)})}):b&&Object.getOwnPropertyNames(b).forEach(function(a){c.append(a,b[a])})}function b(a){return a.bodyUsed?Promise.reject(new TypeError("Already read")):void(a.bodyUsed=!0)}function c(a){return new Promise(function(b,c){a.onload=function(){b(a.result)},a.onerror=function(){c(a.error)}})}function d(a){var b=new FileReader;return b.readAsArrayBuffer(a),c(b)}function e(a){var b=new FileReader;return b.readAsText(a),c(b)}function f(){return this.bodyUsed=!1,l?(this.blob=function(){var a=b(this);return a?a:Promise.resolve(this._bodyBlob)},this.arrayBuffer=function(){return this.blob().then(d)},this.text=function(){return this.blob().then(e)}):this.text=function(){var a=b(this);return a?a:Promise.resolve(this._bodyText)},"FormData"in self&&(this.formData=function(){return this.text().then(i)}),this.json=function(){return this.text().then(JSON.parse)},this}function g(a){var b=a.toUpperCase();return m.indexOf(b)>-1?b:a}function h(b,c){c=c||{},this.url=b,this._body=c.body,this.credentials=c.credentials||"omit",this.headers=new a(c.headers),this.method=g(c.method||"GET"),this.mode=c.mode||null,this.referrer=null}function i(a){var b=new FormData;return a.trim().split("&").forEach(function(a){if(a){var c=a.split("="),d=c.shift().replace(/\+/g," "),e=c.join("=").replace(/\+/g," ");b.append(decodeURIComponent(d),decodeURIComponent(e))}}),b}function j(b){var c=new a,d=b.getAllResponseHeaders().trim().split("\n");return d.forEach(function(a){var b=a.trim().split(":"),d=b.shift().trim(),e=b.join(":").trim();c.append(d,e)}),c}function k(a,b){b||(b={}),l?"string"==typeof a?this._bodyBlob=new Blob([a]):this._bodyBlob=a:this._bodyText=a,this.type="default",this.url=null,this.status=b.status,this.statusText=b.statusText,this.headers=b.headers,this.url=b.url||""}if(!self.fetch){a.prototype.append=function(a,b){a=a.toLowerCase();var c=this.map[a];c||(c=[],this.map[a]=c),c.push(b)},a.prototype["delete"]=function(a){delete this.map[a.toLowerCase()]},a.prototype.get=function(a){var b=this.map[a.toLowerCase()];return b?b[0]:null},a.prototype.getAll=function(a){return this.map[a.toLowerCase()]||[]},a.prototype.has=function(a){return this.map.hasOwnProperty(a.toLowerCase())},a.prototype.set=function(a,b){this.map[a.toLowerCase()]=[b]},a.prototype.forEach=function(a){var b=this;Object.getOwnPropertyNames(this.map).forEach(function(c){a(c,b.map[c])})};var l="FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(a){return!1}}(),m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.fetch=function(){var a=this;return new Promise(function(b,c){function d(){return"responseURL"in e?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):void 0}var e=new XMLHttpRequest;e.onload=function(){var a=1223===e.status?204:e.status;if(100>a||a>599)return void c(new TypeError("Network request failed"));var f={status:a,statusText:e.statusText,headers:j(e),url:d()},g="response"in e?e.response:e.responseText;b(new k(g,f))},e.onerror=function(){c(new TypeError("Network request failed"))},e.open(a.method,a.url),"responseType"in e&&l&&(e.responseType="blob"),a.headers.forEach(function(a,b){b.forEach(function(b){e.setRequestHeader(a,b)})}),e.send(void 0===a._body?null:a._body)})},f.call(h.prototype),f.call(k.prototype),self.Headers=a,self.Request=h,self.Response=k,self.fetch=function(a,b){return new h(a,b).fetch()},self.fetch.polyfill=!0}}()}])}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){function b(b){var e=c.defaults(b||{},{bgcolor:"#fff"}),f=2,g=a.api.globalSettings.getScrollBarWidth(),h=function(a){return Math.min.apply(null,a)},i=function(a){return Math.max.apply(null,a)},j=function(a,b){return"translate("+a+","+b+")"},k=function(a){var b="transform",c=[],d=[],e=[];return a.each(function(){for(var a=this,f=this.cloneNode(!0),g=0,h=0;"SVG"!==a.nodeName.toUpperCase();){var i=(a.attributes[b]||{}).value||"";if(0===i.indexOf("translate(")){var j=i.replace("translate(","").replace(")","").replace(" ",",").split(",").concat(0).map(function(a){return a-0||0});g+=j[0]-0,h+=j[1]-0}a=a.parentNode}d.push(g),e.push(h),c.push(f)}),{xs:d,ys:e,axes:c}},l=function(a){var b=a.append("g");return b.attr("class","floating-axes"),b},m=function(a,b,c,d,e){var f=e?{}:{filter:"url(#drop-shadow)"},g=2,h=g+1,i=-g;return a.append("rect").attr({"class":"i-role-bg",x:0,y:i,width:b+h,height:c+g,fill:d}).style(f),a},n=function(a,b){return b.reduce(function(a,b){return a.appendChild(b),a},a.node()),a},o=function(a,b,c){var f=b.attr("height"),i=b.attr("width"),o=k(c),p=o.axes,q=o.xs,r=o.ys,s=h(r),t=f-s+1+g;p.forEach(function(a,b){d.select(a).attr("transform",j(q[b],r[b]-s))});var u=n(m(l(b),i,t,e.bgcolor),p),v=u.select(".i-role-bg"),w=function(a,b){var c=b-t,d=s-1,e=Math.min(c,d);u.attr("transform",j(a,e));var f=d>c?{filter:"url(#drop-shadow)"}:{filter:""};v.style(f)},x=a.getBoundingClientRect().height;return w(0,x),{element:u,handler:function(){var b=x+a.scrollTop;w(0,b)}}},p=function(a,b,c){var f=(b.attr("width"),b.attr("height")),g=k(c),h=g.axes,o=g.xs,p=g.ys;h.forEach(function(a,b){d.select(a).attr("transform",j(o[b],p[b]))});var q=i(o),r=n(m(l(b),q,f,e.bgcolor),h),s=r.select(".i-role-bg"),t=function(a,b){var c=0,d=Math.max(a,c);r.attr("transform",j(d,b));var e=d>c?{filter:"url(#drop-shadow)"}:{filter:""};s.style(e)};return t(0,0),{element:r,handler:function(){var b=a.scrollLeft;t(b,0)}}},q=function(a,b,c,d){var n=(b.attr("width"),b.attr("height")),o=i(k(d).xs)+1,p=h(k(c).ys),q=n-p+1+g,r=0,s=2*f,t=m(l(b),o+s,q+s,e.bgcolor,!0),u=function(a,b){var c=Math.max(a,0),d=Math.min(b-q,p-1);t.attr("transform",j(c,d))},v=a.getBoundingClientRect().height;return u(r,v),{element:t,handler:function(){var b=a.scrollLeft,c=v+a.scrollTop;u(b,c)}}},r=function(a){a.style("visibility","")},s=function(a){a.style("visibility","hidden")};return{init:function(a){this._chart=a,this.rootNode=a.getLayout().content.parentNode,this.handlers=[]},recycle:function(){var a=this.rootNode;this.handlers.forEach(function(b){a.removeEventListener("scroll",b.handler),b.element.remove()});var b=d.select(this._chart.getSVG());b.selectAll(".floating-axes").remove()},destroy:function(){this.recycle()},onRender:function(){var a=this,b=this._chart;this.recycle();var c=!0;if(b.traverseSpec(b.getSpec(),function(a){var b=a&&0===a.type.indexOf("COORDS.");if(b)if("COORDS.RECT"!==a.type)c=!1;else{var d=a.guide||{};"extract-axes"!==d.autoLayout&&(c=!1)}}),c){var e=this.rootNode,g=d.select(b.getSVG()),h=g.append("defs");h.attr("class","floating-axes");var i=h.append("filter").attr("id","drop-shadow").attr("height","130%");i.append("feGaussianBlur").attr("in","SourceAlpha").attr("stdDeviation",f).attr("result","blur"),i.append("feOffset").attr("in","blur").attr("dx",0).attr("dy",0).attr("result","offsetBlur");var j=i.append("feMerge");j.append("feMergeNode").attr("in","offsetBlur"),j.append("feMergeNode").attr("in","SourceGraphic");var k=g.selectAll(".cell .x.axis"),l=g.selectAll(".cell .y.axis");r(k),r(l),this.handlers=[o(e,g,k),p(e,g,l),q(e,g,k,l)],s(k),s(l),this.handlers.forEach(function(a){e.addEventListener("scroll",a.handler,!1)}),b.on("beforeExportSVGNode",function(){a.handlers.forEach(function(a){s(a.element)}),r(k),r(l)}),b.on("afterExportSVGNode",function(){a.handlers.forEach(function(a){r(a.element)}),s(k),s(l)})}}}}var c=a.api._,d=a.api.d3;return a.api.plugins.add("floating-axes",b),b}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){function b(a){var b=c.defaults(a||{},{title:"Layers",label:"Layer Type",showPanel:!0,showLayers:!0,mode:"merge",axisWidth:45});b.layers.forEach(function(a){a.guide=c.defaults(a.guide||{},{scaleOrient:"left",textAnchor:"end",hide:!1})});var f={line:"ELEMENT.LINE",area:"ELEMENT.AREA",dots:"ELEMENT.POINT",scatterplot:"ELEMENT.POINT",bar:"ELEMENT.INTERVAL","stacked-bar":"ELEMENT.INTERVAL.STACKED"};return{init:function(a){this._chart=a;var e=d.spec(this._chart.getSpec()),f=this.checkIfApplicable(e);if(this._isApplicable=0===f.length,e.addTransformation("defined-only",function(a,b){var d=b.key;return c(a).chain().filter(function(a){return null!==a[d]&&"undefined"!=typeof a[d]}).value()}),!this._isApplicable){var g=e.getSettings("log");return void g("[layers plugin]: is not applicable. "+f.join(" / "))}this.isFacet=this.checkIsFacet(e),this.primaryY=this.findPrimaryLayer(e);var h=this.getLayersText(),i=this.getLayersGroup(),j=b.label;this.fieldColorScale=j,e.setSettings("excludeNull",!1).setSettings("fitModel",null).addScale(j,{type:"color",source:"/",dim:j,brewer:b.brewer}).addTransformation("slice-layer",function(a,b){var d=b.key,e=b.group;return e?c(a).filter(function(a){var b=a[e],c=a[b];return b&&null!==c&&"undefined"!=typeof c}):c(a).filter(function(a){return a[j]===h[d]&&null!==a[d]&&"undefined"!=typeof a[d]})});var k=[this.primaryY].concat(b.layers).reduce(function(a,b){return a.concat(b.y)},[]);a.setupChartSourceModel(function(a){var b={};b[j]={type:"category"};var d={"/":{dims:b,data:[]}};return d["/"].dims=c.extend(b,a["/"].dims),d["/"].data=a["/"].data.reduce(function(a,b){return a.concat(k.map(function(a){var d={};d[j]=h[a];var e=i[a];return e&&(d[e]=b[a],d.subLayer=e),c.extend(d,b)}))},[]),c.extend(d,c.omit(a,"/"))}),b.showPanel&&(this._container=a.insertToRightSidebar(this.containerTemplate),this._container.classList.add("applicable-true"),this.uiChangeEventsDispatcher=function(a){var c=a.target,d=c.classList;d.contains("i-role-show-layers")&&(b.showLayers=c.checked),d.contains("i-role-change-mode")&&(b.mode=c.value),this._chart.refresh()}.bind(this),this._container.addEventListener("change",this.uiChangeEventsDispatcher,!1))},getLayersText:function(){return[this.primaryY].concat(b.layers).reduce(function(a,b){var d=c.isArray(b.y)?b.y:[b.y];return d.reduce(function(a,c){return a[c]=this.extractLabelForKey(b,c),a}.bind(this),a)}.bind(this),{})},getLayersGroup:function(){return[this.primaryY].concat(b.layers).reduce(function(a,b){var d=null;return c.isArray(b.y)&&(d=b.y.join(", ")),c.flatten([b.y]).reduce(function(a,b){return a[b]=d,a},a)}.bind(this),{})},checkIsFacet:function(a){return a.unit().reduce(function(a,b,c){return a?a:c&&"COORDS.RECT"===c.type&&"COORDS.RECT"===b.type?a=!0:a},!1)},checkIfApplicable:function(a){return a.unit().reduce(function(b,c,d){if(d&&"COORDS.RECT"!==d.type)return b.concat("Chart specification contains non-rectangular coordinates");if(d&&"COORDS.RECT"===d.type&&"COORDS.RECT"!==c.type){var e=a.getScale(c.y);if("measure"!==a.getSourceDim(e.source,e.dim).type)return b.concat("Y scale is not a measure")}return b},[])},isLeafElement:function(a,b){return b&&"COORDS.RECT"===b.type&&"COORDS.RECT"!==a.type},isFirstCoordNode:function(a,b){return!b&&a&&"COORDS.RECT"===a.type},isFinalCoordNode:function(a,b){return a&&"COORDS.RECT"===a.type&&c.every(a.units,function(a){return"COORDS.RECT"!==a.type})},buildLayersLayout:function(a){return a.regSource("$",{dims:{x:{type:"category"},y:{type:"category"}},data:[{x:1,y:1}]}).addScale("xLayoutScale",{type:"ordinal",source:"$",dim:"x"}).addScale("yLayoutScale",{type:"ordinal",source:"$",dim:"y"}).unit({type:"COORDS.RECT",x:"xLayoutScale",y:"yLayoutScale",expression:{source:"$",inherit:!1,operator:!1},guide:{showGridLines:"",x:{cssClass:"facet-axis"},y:{cssClass:"facet-axis"}}})},findPrimaryLayer:function(a){var b=this,c=a.unit().reduce(function(c,d){return c.concat(b.isFinalCoordNode(d)?{y:a.getScale(d.y).dim,isPrimary:!0,guide:d.guide.y,scaleName:d.y}:[])},[]);return d.cloneObject(c[0])},createPrimaryUnitReducer:function(a,d,e,f){var g=this;return function(h,i,j){var k=function(a){return a.guide.hide!==!0};if(g.isFacet&&g.isFirstCoordNode(i,j)){i.guide.y.label=i.guide.y.label||{};var l=i.guide.y.label._original_text||i.guide.y.label.text;i.guide.y.label.text=[l,c(d).filter(k).map(g.extractLayerLabel.bind(g)).join(", ")].join(a.getSettings("facetLabelDelimiter")),"dock"===b.mode&&(i.guide.y.label.padding-=15,i.guide.y.padding+=15,i.guide.y.rotate=-90,i.guide.y.textAnchor="middle")}return g.isLeafElement(i,j)&&(j.units=j.units.filter(function(a){return a!==i})),g.isFinalCoordNode(i)&&(i.guide.y.label=i.guide.y.label||{},"dock"===b.mode&&(i.guide.padding.l=e,i.guide.padding.r=f,i.guide.y.hide=!0),"merge"===b.mode&&(i.guide.y.label.text=g.isFacet?"":c(d).filter(k).map(g.extractLayerLabel.bind(g)).join(", "))),h}},createSecondaryUnitReducer:function(a,e,g,h,i,j,k,l){var m=this,n=m.getScaleName(e.scaleName||e.y),o=e.guide.scaleOrient,p=c.isArray(e.y),q=e.isPrimary;return function(r,s,t){if(m.isFacet&&m.isFirstCoordNode(s,t)&&(s.guide.y.label.text="",s.guide.x.hide=!0,s.guide.y.hide=!0),m.isLeafElement(s,t)){s.type=e.type?f[e.type]:s.type,s.y=n;var u="size_null"+l;a.addScale(u,{type:"size",source:"?",mid:1}),s.size=u;var v=a.getScale(s.color).dim;q&&v||(s.color=m.fieldColorScale,s.expression.operator="groupBy",s.expression.params=p?["subLayer"]:[m.fieldColorScale]);var w=p?{group:"subLayer"}:{key:e.y};d.unit(s).addTransformation("slice-layer",w)}var x=m.isFinalCoordNode(s);if(x){if(s.y=n,s.guide.y=c.extend(s.guide.y,e.guide||{}),s.guide.y.label=s.guide.y.label||{},s.guide.y.label.text=m.extractLayerLabel(e),s.guide.x.hide=!0,"dock"===b.mode){s.guide.showGridLines="",s.guide.padding.l=g,s.guide.padding.r=h,s.guide.y.label.textAnchor="end",s.guide.y.label.dock="right",s.guide.y.label.padding="right"===o?1:-10,s.guide.y.label.cssClass="label inline";var y="right"===o?k:j;s.guide.y.padding+=i*y}"merge"===b.mode&&(s.guide.showGridLines="",s.guide.y.hide=!0)}return r}},getScaleName:function(a){return c.isArray(a)?a.join(", "):a},extractLabelForKey:function(a,b){var d=a.guide||{};d.label=c.isString(d.label)?{text:d.label}:d.label;var e=d.label||{},f=e.byKeys||{};return c.isArray(a.y)?f[b]||b:e.text||e._original_text||a.y},extractLayerLabel:function(a){var b=this,d=c.isArray(a.y)?a.y:[a.y];return d.map(function(c){return b.extractLabelForKey(a,c)}).join(", ")},onSpecReady:function(a,e){var f=this,g=d.spec(e);if(!b.showLayers||!f._isApplicable)return void g.unit().traverse(function(a,b){f.isLeafElement(a,b)&&d.unit(a).addTransformation("defined-only",{key:g.getScale(a.y).dim})});g=b.layers.reduce(function(a,b){var d=f.getScaleName(b.y);return a.addScale(d,c.extend({type:"linear",source:"/",dim:d,autoScale:!0},c.pick(b.guide||{},"min","max","autoScale","nice","niceInterval")))},g);var h,i=[this.primaryY].concat(b.layers).sort(function(a,b){var c=a.guide.zIndex||0,d=b.guide.zIndex||0;return c-d}),j=g.unit(),k=b.axisWidth,l=function(a){return function(b){var c=b.guide.scaleOrient||"left";return b.guide.hide!==!0&&c===a}},m=l("left"),n=l("right"),o=i.filter(m).length*k,p=i.filter(n).length*k,q=f.buildLayersLayout(g).addFrame({key:{x:1,y:1},units:[(h=d.unit(j.clone())).reduce(f.createPrimaryUnitReducer(g,i,o,p),h).value()]}),r=-1,s=-1;i.reduce(function(a,b,c){return r=m(b)?r+1:r,s=n(b)?s+1:s,a.addFrame({key:{x:1,y:1},units:[(h=d.unit(j.clone())).reduce(f.createSecondaryUnitReducer(g,b,o,p,k,r,s,c),h).value()]})},q)},onUnitsStructureExpanded:function(){var a=this;if(a._isApplicable&&"merge"===b.mode){var e=d.spec(a._chart.getSpec()),f=a.primaryY.scaleName,g=c(b.layers).map(function(b){return a.getScaleName(b.y)}).filter(function(a){return e.getScale(a)}).concat(f),h=g.reduce(function(b,d){var e=a._chart.getScaleInfo(d);return b[d]=e.domain().filter(function(a){return!isNaN(a)&&c.isNumber(a)}),b},{}),i=d3.extent(c(h).chain().values().flatten().value());g.forEach(function(a){var b=e.getScale(a);b.min=i[0],b.max=i[1],b.nice=!1})}},containerTemplate:'<div class="graphical-report__trendlinepanel"></div>',template:c.template(['<label class="graphical-report__trendlinepanel__title graphical-report__checkbox">','   <input type="checkbox"','          class="graphical-report__checkbox__input i-role-show-layers"','          <%= (showLayers ? "checked" : "") %>',"   />",'   <span class="graphical-report__checkbox__icon"></span>','   <span class="graphical-report__checkbox__text"><%= title %></span>',"</label>","<div>",'<select class="i-role-change-mode graphical-report__select graphical-report__trendlinepanel__control">','   <option <%= ((mode === "dock")  ? "selected" : "") %> value="dock">'+e.get("Dock")+"</option>",'   <option <%= ((mode === "merge") ? "selected" : "") %> value="merge">'+e.get("Merge")+"</option>","</select>","</div>"].join("")),onRender:function(){this._isApplicable&&b.showPanel&&(this._container.innerHTML=this.template({title:b.title,mode:b.mode,showLayers:b.showLayers}))}}}var c=a.api._,d=a.api.pluginsSDK,e=d.tokens();return a.api.plugins.add("layers",b),b}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){function b(a){var b=c.defaults(a||{},{}),f=function(a){return Math.log(a)/Math.LN10},g=function(a){return a=Math.round(a),a%2?a+1:a},h=function(a){return null===a||""===a||"undefined"==typeof a},i=function(a,b){return function(c){var d=c[a],e=JSON.stringify(h(d)?null:d);return b===e}},j=function(a,b,c,d){a.addEventListener(b,function(a){for(var b=a.target;b!==a.currentTarget&&null!==b;)b.classList.contains(c)&&d(a,b),b=b.parentNode})};return{init:function(a){this._chart=a,this._currentFilters={},this._legendColorByScaleId={},this._legendOrderState={};var c=this._chart.getSpec(),d=function(a){return function(b,d){var e=c.scales[d];return e.type===a&&e.dim&&b.push(d),b}};this._color=Object.keys(c.scales).reduce(d("color"),[]).filter(function(b){return a.getScaleInfo(b).discrete}),this._fill=Object.keys(c.scales).reduce(d("color"),[]).filter(function(b){return!a.getScaleInfo(b).discrete}),this._size=Object.keys(c.scales).reduce(d("size"),[]);var e=this._color.length>0,f=this._fill.length>0,g=this._size.length>0;if(this._assignStaticBrewersOrEx(),e||f||g){switch(b.position){case"left":this._container=this._chart.insertToLeftSidebar(this._containerTemplate);break;case"right":this._container=this._chart.insertToRightSidebar(this._containerTemplate);break;case"top":this._container=this._chart.insertToHeader(this._containerTemplate);break;case"bottom":this._container=this._chart.insertToFooter(this._containerTemplate);break;default:this._container=this._chart.insertToRightSidebar(this._containerTemplate)}e&&(j(this._container,"click","graphical-report__legend__item-color",function(a,b){this._toggleLegendItem(b)}.bind(this)),j(this._container,"mouseover","graphical-report__legend__item-color",function(a,b){this._highlightToggle(b,!0)}.bind(this)),j(this._container,"mouseout","graphical-report__legend__item-color",function(a,b){this._highlightToggle(b,!1)}.bind(this)))}},onRender:function(){this._clearPanel(),this._drawColorLegend(),this._drawFillLegend(),this._drawSizeLegend()},_containerTemplate:'<div class="graphical-report__legend"></div>',_template:c.template('<div class="graphical-report__legend__wrap"><div class="graphical-report__legend__title"><%=name%></div><%=items%></div>'),_itemTemplate:c.template(["<div data-scale-id='<%= scaleId %>' data-dim='<%= dim %>' data-value='<%= value %>' class=\"graphical-report__legend__item graphical-report__legend__item-color <%=classDisabled%>\">",'   <div class="graphical-report__legend__guide__wrap">','   <div class="graphical-report__legend__guide <%=cssClass%>"','        style="background-color: <%=cssColor%>">',"   </div>","   </div>","   <%=label%>","</div>"].join("")),_itemFillTemplate:c.template(['<div data-value=\'<%=value%>\' class="graphical-report__legend__item graphical-report__legend__item-color" style="padding: 6px 0px 10px 40px;margin-left:10px;">','<div class="graphical-report__legend__guide__wrap" style="top:0;left:0;">','   <span class="graphical-report__legend__guide" style="background-color:<%=color%>;border-radius:0"></span>','   <span style="padding-left: 20px"><%=label%></span>',"</div>","</div>"].join("")),_itemSizeTemplate:c.template(['<div class="graphical-report__legend__item graphical-report__legend__item--size">','<div class="graphical-report__legend__guide__wrap">','<svg class="graphical-report__legend__guide graphical-report__legend__guide--size  <%=className%>" style="width: <%=diameter%>px;height: <%=diameter%>px;"><circle cx="<%=radius%>" cy="<%=radius%>" class="graphical-report__dot" r="<%=radius%>"></circle></svg>',"</div><%=value%>","</div>"].join("")),_clearPanel:function(){this._container&&(this._container.innerHTML="")},_drawFillLegend:function(){var a=this;a._fill.forEach(function(b){var f=a._chart.select(function(a){return a.config.color===b})[0];if(f){var g=f.config.guide||{},h=f.getScale("color"),i=c(h.domain()).sortBy(),j=i.reduce(function(a,b){return a&&c.isDate(b)},!0),k=j?i.map(function(a){return a-0}):i,l=e(k[0],k[k.length-1]),m=j?function(a){return new Date(a)}:function(a){return l(a)},n=h.brewer.length,o=120,p=13,q=d(k,n).reverse().map(function(a,b){var c=b/(n-1)*100;return'<stop offset="'+c+'%"      style="stop-color:'+h(a)+';stop-opacity:1" />'}),r=3,s=d(k,r).reverse().map(function(a,b,c){var d=b/(r-1),e=.5*(0===b?p:b===c.length-1?-p:0),f=o*d+e+p/2;return'<text x="25" y="'+f+'">'+m(a)+"</text>"}),t=((g.color||{}).label||{}).text||h.dim,u=['<svg height="'+o+'" width="100%" style="margin: 0 0 10px 10px">',"   <defs>",'       <linearGradient id="grad1" x1="0%" y1="0%" x2="0%" y2="100%">',q.join(""),"       </linearGradient>","   </defs>",'   <rect x="0" y="0" height="100%" width="20" fill="url(#grad1)"></rect>',s.join(""),"   Sorry, your browser does not support inline SVG.","</svg>"].join("");a._container.insertAdjacentHTML("beforeend",a._template({name:t,items:u}))}})},_drawSizeLegend:function(){var a=this;a._size.forEach(function(b){var d=a._chart.select(function(a){return a.config.size===b})[0];if(d){var e=d.config.guide||{},h=d.getScale("size"),i=c(h.domain()).sortBy(),j=((e.size||{}).label||{}).text||h.dim,k=i[0],l=i[i.length-1],m=[k];if(l-k){var n=f(l-k),o=Math.round(4-n),p=Math.pow(10,o),q=(l-k)/5,r=[k,k+q,k+2*q,k+3*q,l];m=c(r).chain().map(function(a){return a===l||a===k?a:Math.round(a*p)/p}).unique().value()}a._container.insertAdjacentHTML("beforeend",a._template({name:j,items:m.map(function(b){var c=h(b);return a._itemSizeTemplate({diameter:g(c+2),radius:c/2,value:b,className:d.config.color?"color-definite":"color-default-size"})}).reverse().join("")}))}})},_drawColorLegend:function(){var a=this;a._color.forEach(function(b){var d=a._chart.select(function(a){return a.config.color===b})[0];if(d){var e=d.config.guide||{},f=d.getScale("color"),g=a._chart.getDataSources({excludeFilter:["legend"]}),i=c(g[f.source].data).chain().pluck(f.dim).uniq().value(),j=a._chart.getSpec().scales[b];if(j.order)i=c.union(c.intersection(j.order,i),i);else{var k=a._legendOrderState[b];i=i.sort(function(a,b){var c=k[a]-k[b];return c&&c/Math.abs(c)})}var l=((e.color||{}).label||{}).text||f.dim,m=(e.color||{}).tickFormatNullAlias||"No "+l,n=i.map(function(c){var d=JSON.stringify(h(c)?null:c),e=f.dim+d;return{scaleId:b,dim:f.dim,color:f(c),disabled:a._currentFilters.hasOwnProperty(e),label:c,value:d}});a._legendColorByScaleId[b]=n,a._container.insertAdjacentHTML("beforeend",a._template({name:l,items:n.map(function(b){return a._itemTemplate({scaleId:b.scaleId,dim:c.escape(b.dim),color:b.color,cssClass:f.toClass(b.color),cssColor:f.toColor(b.color),classDisabled:b.disabled?"disabled":"",label:c.escape(h(b.label)?m:b.label),value:c.escape(b.value)})}).join("")}))}})},_toggleLegendItem:function(a){var b=a.getAttribute("data-scale-id"),c=a.getAttribute("data-dim"),d=a.getAttribute("data-value"),e=c+d,f=this._legendColorByScaleId[b],g=f.filter(function(a){return!a.disabled});if(1!==g.length||b!==g[0].scaleId||d!==g[0].value){var h=this._currentFilters;if(h.hasOwnProperty(e)){var j=h[e];delete h[e],a.classList.remove("disabled"),this._chart.removeFilter(j)}else{a.classList.add("disabled");var k=i(c,d);h[e]=this._chart.addFilter({tag:"legend",predicate:function(a){return!k(a)}})}this._chart.refresh()}},_highlightToggle:function(a,b){if(!a.classList.contains("disabled")){var c=a.getAttribute("data-dim"),d=a.getAttribute("data-value"),e=b?i(c,d):function(a){return null};this._chart.select(function(a){return!0}).forEach(function(a){a.fire("highlight",e)})}},_generateColorMap:function(a){var b=20,d=c.times(b,function(a){return"color20-"+(1+a)});return a.reduce(function(a,c,e){return a[c]=d[e%b],a},{})},_assignStaticBrewersOrEx:function(){var a=this;a._color.forEach(function(b){var d=a._chart.getSpec().scales[b],e=a._chart.getDataSources({excludeFilter:["legend"]}),f=a._chart.getScaleFactory(e).createScaleInfoByName(b).domain();d.brewer&&!c.isArray(d.brewer)||(d.brewer=a._generateColorMap(f)),a._legendOrderState[b]=f.reduce(function(a,b,c){return a[b]=c,a},{})})}}}var c=a.api._,d=function(a,b){var d=a[0],e=a[1],f=(e-d)/(b-1),g=c.times(b-2,function(a){return d+f*(a+1)});return[d].concat(g).concat(e)},e=function(a,b){var d=Math.abs(b-a),e=2;return 1>d&&(e+=c.findIndex(String(d).split(".")[1].split(0),function(a){return""!==a})),function(a){return String(parseFloat(a.toFixed(e)))}};return a.api.plugins.add("legend",b),b}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){function b(a){var b=function(a){return Math.log(a)/Math.LN10},d=function(a,b,c){return function(d){var e=d[a];return b>e||e>c}};return{init:function(b){this._chart=b,this._currentFilters={},this._data={},this._bounds={},this._filter={},this._container={},this._layout=this._chart.getLayout().layout;var d=this,e=this._chart.getSpec(),f=e.sources["/"];this._fields=c.isArray(a)&&a.length>0?a:c(f.dims).keys();var g=d._chart.getChartModelData();this._filtersContainer=d._chart.insertToRightSidebar(d._filtersContainer),this._filtersContainer.style.maxHeight="0px",d._fields.filter(function(a){var b="measure"===f.dims[a].type;return b||e.settings.log("The ["+a+"] isn't measure so Quick Filter plugin skipped it"),b}).forEach(function(a){d._data[a]=c(g).pluck(a),d._bounds[a]=d3.extent(d._data[a]),d._filter[a]=d._bounds[a],d._filtersContainer.insertAdjacentHTML("beforeend",d._filterWrapper({name:a})),d._container[a]=d._filtersContainer.lastChild,d._drawFilter(a)})},onRender:function(){this._filtersContainer.style.maxHeight="none"},_filtersContainer:'<div class="graphical-report__filter"></div>',_filterWrapper:c.template('<div class="graphical-report__filter__wrap"><div class="graphical-report__legend__title"><%=name%></div></div>'),_drawFilter:function(a){function d(a){var b=c(a).findIndex(function(a){var b=d3.time.format(a);return b(new Date(g[0]))!==b(new Date(g[1]))});return b=0>b?a.length:b,{comm:a.slice(0,b),diff:a.slice(b)}}function e(){var b=j._filter[a]=p.extent(),c=i?new Date(b[0]).getTime():b[0],d=i?new Date(b[1]).getTime():b[1],e=Math.round(parseFloat(c)*v)/v,f=Math.round(parseFloat(d)*v)/v,g=r.selectAll(".w text"),h=r.selectAll(".e text");if(i){var k=d3.time.format(x.comm.join("")),l=d3.time.format(x.diff.join(""));s.html(l(new Date(e))+"&thinsp;..&thinsp;"+l(new Date(f))+' <tspan class="common">'+k(new Date(f))+"</tspan>")}else g.text(e),h.text(f);j._applyFilter(a)}var f=this._data[a],g=this._bounds[a],h=this._filter[a],i=c.isDate(g[0])||c.isDate(g[1]),j=this,k={top:0,right:24,bottom:21,left:12},l=4,m=180-k.left-k.right,n=41-k.top-k.bottom-2*l,o=d3.scale.linear().domain(g).range([0,m]),p=d3.svg.brush().x(o).extent(h).on("brushstart",function(){j._layout.style["overflow-y"]="hidden",e()}).on("brush",e).on("brushend",function(){j._layout.style["overflow-y"]="",e()}),q=d3.select(this._container[a]).append("svg").attr("width",m+k.left+k.right).attr("height",n+k.top+k.bottom+4).append("g").attr("transform","translate("+k.left+","+k.top+")"),r=(q.append("g").selectAll("rect").data(f).enter().append("rect").attr("transform",function(a){return"translate("+o(a)+","+(k.top+l)+")"}).attr("height",n).attr("width",1),q.append("g").attr("class","brush").call(p));r.selectAll(".resize").append("line").attr("transform","translate(0, 0)").attr("x1",0).attr("x2",0).attr("y1",0).attr("y2",n+2*l),r.selectAll(".resize").append("text").attr("x",0).attr("y",2*(n+l)),r.selectAll("rect").attr("height",n+2*l);var s=q.append("text").attr("x",m/2).attr("y",2*(n+l)).attr("class","date-label"),t=b(j._filter[a][1]-j._filter[a][0]),u=Math.round(3-t),v=Math.pow(10,u),w=["’%y","&thinsp;%b","%d","%H",":%M",":%S"];if(i){var x=d(w);x.comm.length<3?(x.diff.splice(-3),x.diff.reverse(),x.comm.reverse()):(x.comm.length<5&&x.diff.pop(),x.diff=x.comm.splice(3,x.comm.length-3).concat(x.diff),x.comm.reverse())}e()},_applyFilter:function(a){var b=this._currentFilters,c=this._filter[a][0],e=this._filter[a][1],f=d(a,c,e),g=b[a];delete b[a],this._chart.removeFilter(g),b[a]=this._chart.addFilter({tag:"quick-filter",predicate:function(a){return!f(a);
  }}),this._chart.refresh()}}}var c=a.api._;return a.api.plugins.add("quick-filter",b),b}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){function b(b){function e(a){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,f=window.pageXOffset||d.scrollLeft||c.scrollLeft,g=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-g,j=b.left+f-h;return{top:Math.round(i),left:Math.round(j)}}var f=c.defaults(b||{},{fields:null,formatters:{},dockToData:!1,aggregationGroupFields:[],onRevealAggregation:function(a,b){console.log("Setup [onRevealAggregation] callback and filter original data by the following criteria: ",JSON.stringify(a,null,2))}}),g={init:function(a){this._currentData=null,this._currentUnit=null,this._chart=a,this._metaInfo={},this._skipInfo={},c.extend(this,c.omit(f,"fields","getFields")),this._tooltip=this._chart.addBalloon({spacing:3,auto:!0,effectClass:"fade"});var b=f.aggregationGroupFields.length>0?this.templateRevealAggregation:"",d=c.template(this.template);this._tooltip.content(d({revealTemplate:b,excludeTemplate:this.templateExclude})),this._tooltip.getElement().addEventListener("click",function(a){for(var b=a.target;b!==a.currentTarget&&null!==b;)b.classList.contains("i-role-exclude")&&g._exclude(),b.classList.contains("i-role-reveal")&&g._reveal(),b=b.parentNode;g._tooltip.hide()},!1);var e,g=this;this.showTooltip=function(a,b){clearTimeout(e),g._currentData=a;var d=g._tooltip.getElement().querySelectorAll(".i-role-content");if(d[0]){var h=f.fields||c.isFunction(f.getFields)&&f.getFields(g._chart)||Object.keys(a);d[0].innerHTML=this.render(a,h)}g._tooltip.show(b.x,b.y).updateSize()},this.hideTooltip=function(a){e=setTimeout(function(){g._tooltip.hide(),g._removeFocus()},300)},this._tooltip.getElement().addEventListener("mouseover",function(a){clearTimeout(e),g._accentFocus()},!1),this._tooltip.getElement().addEventListener("mouseleave",function(a){g._tooltip.hide(),g._removeFocus()},!1),this.afterInit(this._tooltip.getElement())},destroy:function(){this._removeFocus(),this._tooltip.destroy()},afterInit:function(a){},render:function(a,b){var c=this;return b.filter(function(a){var b=a.split("."),d=2===b.length&&c._skipInfo[b[0]];return!d}).map(function(b){var d=b,e=a[b];return c.renderItem(c._getLabel(d),c._getFormat(d)(e),d,e)}).join("")},renderItem:function(a,b,c,d){return this.itemTemplate({label:a,value:b})},_getFormat:function(a){var b=this._metaInfo[a]||{format:c.identity};return b.format},_getLabel:function(a){var b=this._metaInfo[a]||{label:a};return b.label},_appendFocus:function(a,b,c){return this.circle&&this.circle.remove(),this.circle=d3.select(a).append("circle").attr({r:0,cx:b,cy:c}),this.circle},_removeFocus:function(){return this.circle&&this.circle.remove(),this._currentUnit&&this._currentUnit.fire("highlight-data-points",function(a){return!1}),this},_accentFocus:function(){var a=this;return a._currentUnit&&a._currentData&&a._currentUnit.fire("highlight-data-points",function(b){return b===a._currentData}),this},_reveal:function(){var a=this._currentData,b=f.aggregationGroupFields||[],c=b.reduce(function(b,c){return a.hasOwnProperty(c)&&(b[c]=a[c]),b},{});f.onRevealAggregation(c,a)},_exclude:function(){this._chart.addFilter({tag:"exclude",predicate:function(a){return function(b){return JSON.stringify(b)!==JSON.stringify(a)}}(this._currentData)}),this._chart.refresh()},onRender:function(){var a=this._getFormatters();this._metaInfo=a.meta,this._skipInfo=a.skip,this._subscribeToHover()},templateRevealAggregation:['<div class="i-role-reveal graphical-report__tooltip__vertical">','   <div class="graphical-report__tooltip__vertical__wrap">',"       Reveal","   </div>","</div>"].join(""),templateExclude:['<div class="i-role-exclude graphical-report__tooltip__exclude">','   <div class="graphical-report__tooltip__exclude__wrap">','       <span class="tau-icon-close-gray"></span>',"       Exclude","   </div>","</div>"].join(""),template:['<div class="i-role-content graphical-report__tooltip__content"></div>',"<%= revealTemplate %>","<%= excludeTemplate %>"].join(""),itemTemplate:c.template(['<div class="graphical-report__tooltip__list__item">','<div class="graphical-report__tooltip__list__elem"><%=label%></div>','<div class="graphical-report__tooltip__list__elem"><%=value%></div>',"</div>"].join("")),_subscribeToHover:function(){var a=this,b=["ELEMENT.LINE","ELEMENT.AREA","ELEMENT.PATH","ELEMENT.INTERVAL","ELEMENT.INTERVAL.STACKED"],c=function(b,c){var d=c.data,e=a._getMouseCoordinates(b,c);a._currentUnit=b,a.showTooltip(d,{x:e.left,y:e.top})};this._chart.select(function(a){return!0}).forEach(function(d){d.on("mouseout.chart",function(b,c){a.hideTooltip(c)}),d.on("mouseover.chart",c),b.indexOf(d.config.type)>-1&&d.on("mousemove.chart",c)})},_getNearestDataCoordinates:function(a,b){var c=b.data,d=a.getScale("x"),f=a.getScale("y"),g=d(c[d.dim]),h=f(c[f.dim]),i=b.event.target.parentNode,j=this._appendFocus(i,g,h);return e(j.node())},_getMouseCoordinates:function(a,b){var c=b.event.pageX,d=b.event.pageY;return{left:c,top:d}},_getFormatters:function(){var b=d.extractFieldsFormatInfo(this._chart.getSpec()),e={};Object.keys(b).forEach(function(a){b[a].isComplexField&&(e[a]=!0),b[a].parentField&&delete b[a]});var g=function(a){var b={};return c.isFunction(a)||c.isString(a)?b={format:a}:c.isObject(a)&&(b=c.pick(a,"label","format","nullAlias")),b};return Object.keys(f.formatters).forEach(function(d){var e=g(f.formatters[d]);b[d]=c.extend({label:d,nullAlias:"No "+d},b[d]||{},c.pick(e,"label","nullAlias")),e.hasOwnProperty("format")?b[d].format=c.isFunction(e.format)?e.format:a.api.tickFormat.get(e.format,b[d].nullAlias):b[d].format=b[d].hasOwnProperty("format")?b[d].format:a.api.tickFormat.get(null,b[d].nullAlias)}),{meta:b,skip:e}}};return g}var c=a.api._,d=a.api.pluginsSDK;return a.api.plugins.add("tooltip",b),b}),function(a){if("function"==typeof define&&define.amd)define(["tauCharts"],function(b){return a(b)});else if("object"==typeof module&&module.exports){var b=require("tauCharts");module.exports=a(b)}else a(this.tauCharts)}(function(a){function b(b){var f=d.defaults(b||{},{type:"linear",hideError:!1,showPanel:!0,showTrend:!0,models:["linear","exponential","logarithmic"]});return{init:function(a){if(this._chart=a,this._applicableElements=["ELEMENT.POINT","ELEMENT.LINE","ELEMENT.AREA","ELEMENT.INTERVAL"],this._isApplicable=this.checkIfApplicable(a),f.showPanel){this._container=a.insertToRightSidebar(this.containerTemplate);var b="applicable-true";this._isApplicable||(b="applicable-false",this._error=["Trend line can't be computed for categorical data.","Each axis should be either a measure or a date."].join(" ")),this._container.classList.add(b),f.hideError&&this._container.classList.add("hide-trendline-error"),this.uiChangeEventsDispatcher=function(a){var b=a.target,c=b.classList;c.contains("i-role-show-trend")&&(f.showTrend=b.checked),c.contains("i-role-change-model")&&(f.type=b.value),this._chart.refresh()}.bind(this),this._container.addEventListener("change",this.uiChangeEventsDispatcher,!1)}},checkIfApplicable:function(a){var b=this,c=a.getSpec(),d=!1;return a.traverseSpec(c,function(a,e){b.predicateIsApplicable(c,a,e)&&(d=!0)}),d},predicateIsApplicable:function(a,b,c){if(c&&"COORDS.RECT"!==c.type)return!1;if(c&&!c.units)return!1;if(-1===this._applicableElements.indexOf(b.type)||b.stack)return!1;var d=a.scales[b.x],e=a.scales[b.y];return!("ordinal"===d.type||"ordinal"===e.type)},onSpecReady:function(b,e){var g=this;if(f.showTrend){var h=a.api.tickPeriod,i=function(a){var b=h.get(a);return function(a){return b.cast(new Date(a))}};e.transformations=e.transformations||{},e.transformations.regression=function(a,b){var e=b.x.dim,f=b.y.dim,g=b.g.dim,h="period"===b.x.type&&b.x.period,j="period"===b.y.type&&b.y.period,k=h?i(b.x.period):d.identity,l=j?i(b.y.period):d.identity,m=a.map(function(a){var b=d.isDate(a[e])?a[e].getTime():a[e],c=d.isDate(a[f])?a[f].getTime():a[f],h=a[g];return[b,c,h]}),n=d.groupBy(m,"2");return Object.keys(n).reduce(function(a,i){var m=n[i],o=c(b.type,m),p=d(o.points).chain().filter(function(a){return null!==a[0]&&null!==a[1]}).sortBy(function(a){return a[0]}).map(function(a){var b={};return b[e]=k(a[0]),b[f]=l(a[1]),g&&(b[g]=i),b}).value();return p.length>1&&(h||j)&&(p=[p[0],p[p.length-1]]),a.concat(p.length>1?p:[])},[])},b.traverseSpec(e,function(a,b){if(g.predicateIsApplicable(e,a,b)){var c=e.scales[a.x],h=e.scales[a.y],i=e.scales[a.color]||{},j=JSON.parse(JSON.stringify(a));j.type="ELEMENT.LINE",j.size="size_null",j.namespace="trendline",j.transformation=j.transformation||[],j.transformation.push({type:"regression",args:{type:f.type,x:c,y:h,g:i}});var k={};j.guide=d.defaults(k,j.guide||{}),j.guide.interpolate="linear",j.guide.showAnchors=!1,j.guide.cssClass="graphical-report__trendline",j.guide.widthCssClass="graphical-report__line-width-1",b.units.push(j)}})}},containerTemplate:'<div class="graphical-report__trendlinepanel"></div>',template:d.template(['<label class="graphical-report__trendlinepanel__title graphical-report__checkbox">','<input type="checkbox" class="graphical-report__checkbox__input i-role-show-trend" <%= showTrend %> />','<span class="graphical-report__checkbox__icon"></span>','<span class="graphical-report__checkbox__text">',"<%= title %>","</span>","</label>","<div>",'<select class="i-role-change-model graphical-report__select graphical-report__trendlinepanel__control">',"<%= models %>","</select>","</div>",'<div class="graphical-report__trendlinepanel__error-message"><%= error %></div>'].join("")),onRender:function(a){if(this._container){this._container.innerHTML=this.template({title:"Trend line",error:this._error,showTrend:f.showTrend&&this._isApplicable?"checked":"",models:f.models.map(function(a){var b=f.type===a?"selected":"";return"<option "+b+' value="'+a+'">'+a+"</option>"})});var b=function(a){return function(){e.select(this).classed({active:a,"graphical-report__line-width-1":!a,"graphical-report__line-width-3":a})}},c=e.select(a.getSVG());c.selectAll(".graphical-report__trendline").on("mouseenter",b(!0)).on("mouseleave",b(!1))}}}}var c=function(){"use strict";var a=function(a,b){var c=0,d=0,e=0,f=0,g=0,h=a.length-1,i=new Array(b);for(c=0;h>c;c++){for(f=c,d=c+1;h>d;d++)Math.abs(a[c][d])>Math.abs(a[c][f])&&(f=d);for(e=c;h+1>e;e++)g=a[e][c],a[e][c]=a[e][f],a[e][f]=g;for(d=c+1;h>d;d++)for(e=h;e>=c;e--)a[e][d]-=a[e][c]*a[c][d]/a[c][c]}for(d=h-1;d>=0;d--){for(g=0,e=d+1;h>e;e++)g+=a[e][d]*i[e];i[d]=(a[h][d]-g)/a[d][d]}return i},b={linear:function(a){for(var b=[0,0,0,0,0],c=0,d=[];c<a.length;c++)a[c][1]&&(b[0]+=a[c][0],b[1]+=a[c][1],b[2]+=a[c][0]*a[c][0],b[3]+=a[c][0]*a[c][1],b[4]+=a[c][1]*a[c][1]);var e=(c*b[3]-b[0]*b[1])/(c*b[2]-b[0]*b[0]);e=isNaN(e)?0:e;for(var f=b[1]/c-e*b[0]/c,g=0,h=a.length;h>g;g++){var i=[a[g][0],a[g][0]*e+f];d.push(i)}var j="y = "+Math.round(100*e)/100+"x + "+Math.round(100*f)/100;return{equation:[e,f],points:d,string:j}},exponential:function(a){var b=[0,0,0,0,0,0],c=0,d=[];for(i=a.length;i>c;c++)a[c][1]&&(b[0]+=a[c][0],b[1]+=a[c][1],b[2]+=a[c][0]*a[c][0]*a[c][1],b[3]+=a[c][1]*Math.log(a[c][1]),b[4]+=a[c][0]*a[c][1]*Math.log(a[c][1]),b[5]+=a[c][0]*a[c][1]);for(var e=b[1]*b[2]-b[5]*b[5],f=Math.pow(Math.E,(b[2]*b[3]-b[5]*b[4])/e),g=(b[1]*b[4]-b[5]*b[3])/e,h=0,i=a.length;i>h;h++){var j=[a[h][0],f*Math.pow(Math.E,g*a[h][0])];d.push(j)}var k="y = "+Math.round(100*f)/100+"e^("+Math.round(100*g)/100+"x)";return{equation:[f,g],points:d,string:k}},logarithmic:function(a){var b=[0,0,0,0],c=0,d=[];for(h=a.length;h>c;c++)a[c][1]&&(b[0]+=Math.log(a[c][0]),b[1]+=a[c][1]*Math.log(a[c][0]),b[2]+=a[c][1],b[3]+=Math.pow(Math.log(a[c][0]),2));for(var e=(c*b[1]-b[2]*b[0])/(c*b[3]-b[0]*b[0]),f=(b[2]-e*b[0])/c,g=0,h=a.length;h>g;g++){var i=[a[g][0],f+e*Math.log(a[g][0])];d.push(i)}var j="y = "+Math.round(100*f)/100+" + "+Math.round(100*e)/100+" ln(x)";return{equation:[f,e],points:d,string:j}},power:function(a){var b=[0,0,0,0],c=0,d=[];for(h=a.length;h>c;c++)a[c][1]&&(b[0]+=Math.log(a[c][0]),b[1]+=Math.log(a[c][1])*Math.log(a[c][0]),b[2]+=Math.log(a[c][1]),b[3]+=Math.pow(Math.log(a[c][0]),2));for(var e=(c*b[1]-b[2]*b[0])/(c*b[3]-b[0]*b[0]),f=Math.pow(Math.E,(b[2]-e*b[0])/c),g=0,h=a.length;h>g;g++){var i=[a[g][0],f*Math.pow(a[g][0],e)];d.push(i)}var j="y = "+Math.round(100*f)/100+"x^"+Math.round(100*e)/100;return{equation:[f,e],points:d,string:j}},polynomial:function(b,c){"undefined"==typeof c&&(c=2);for(var d=[],e=[],f=[],g=0,h=0,i=0,j=c+1;j>i;i++){for(var k=0,l=b.length;l>k;k++)b[k][1]&&(g+=Math.pow(b[k][0],i)*b[k][1]);d.push(g),g=0;for(var m=[],n=0;j>n;n++){for(var k=0,l=b.length;l>k;k++)b[k][1]&&(h+=Math.pow(b[k][0],i+n));m.push(h),h=0}e.push(m)}e.push(d);for(var o=a(e,j),i=0,l=b.length;l>i;i++){for(var p=0,q=0;q<o.length;q++)p+=o[q]*Math.pow(b[i][0],q);f.push([b[i][0],p])}for(var r="y = ",i=o.length-1;i>=0;i--)r+=i>1?Math.round(100*o[i])/100+"x^"+i+" + ":1==i?Math.round(100*o[i])/100+"x + ":Math.round(100*o[i])/100;return{equation:o,points:f,string:r}},lastvalue:function(a){for(var b=[],c=null,d=0;d<a.length;d++)a[d][1]?(c=a[d][1],b.push([a[d][0],a[d][1]])):b.push([a[d][0],c]);return{equation:[c],points:b,string:""+c}},loess:function(a){function b(a,b){var d=a.map(function(a){return a[0]}),e=a.map(function(a){return a[1]}),f=c(d,e,b);return d.map(function(a,b){return[a,f[b]]})}function c(a,b,c){function d(a){var b=1-a*a*a;return b*b*b}for(var e=[],f=0,g=Math.floor(c*a.length)-1,h=0;h<a.length;h++){var i=a[h];h>0&&g<a.length-1&&a[g+1]-a[h]<a[h]-a[f]&&(f++,g++);var j;j=a[h]-a[f]>a[g]-a[h]?f:g;for(var k=Math.abs(1/(a[j]-i)),l=0,m=0,n=0,o=0,p=0,q=f;g>=q;){var r,s=a[q],t=b[q];r=h>q?i-s:s-i;var u=d(r*k),v=s*u;l+=u,m+=v,n+=s*v,o+=t*u,p+=t*v,q++}var w,x=m/l,y=o/l,z=p/l,A=n/l;w=A==x*x?0:(z-x*y)/(A-x*x);var B=y-w*x;e[h]=w*i+B}return e}return{equation:"loess",points:b(a,.5),string:"loess"}}};return function(a,c,d){return"string"==typeof a?b[a](c,d):void 0}}(),d=a.api._,e=a.api.d3;return a.api.plugins.add("trendline",b),b});