!function(a){"use strict";function b(a){return a||0===a}function c(a){return"undefined"==typeof a}function d(a){return"undefined"!=typeof a}function e(a,b){function c(a,b){a.attr("transform",function(a){return"translate("+Math.ceil(b(a)+s)+", 0)"})}function d(a,b){a.attr("transform",function(a){return"translate(0,"+Math.ceil(b(a))+")"})}function e(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function f(a){var b,c,d=[];if(a.ticks)return a.ticks.apply(a,k);for(c=a.domain(),b=Math.ceil(c[0]);b0&&d[0]>0&&d.unshift(d[0]-(d[1]-d[0])),d}function g(){var a,c=m.copy();return b&&(a=m.domain(),c.domain([a[0],a[1]-1])),c}function h(a){var c=b&&a=0;return"url("+(c?"":document.URL.split("#")[0])+"#"+b+")"}function k(a){return Math.ceil(a)+.5}function l(a,b){var c,d,e;b&&b.axisX?c=b.axisX:(c=Gj.select("."+g.axisX),a&&(c=c.transition())),b&&b.axisY?d=b.axisY:(d=Gj.select("."+g.axisY),a&&(d=d.transition())),b&&b.axisY2?e=b.axisY2:(e=Gj.select("."+g.axisY2),a&&(e=e.transition())),Gj.attr("transform",qj.main),c.attr("transform",qj.x),d.attr("transform",qj.y),e.attr("transform",qj.y2),Gj.select("."+g.chartArcs).attr("transform",qj.arc)}function m(a,b){var c;b&&b.axisSubX?c=b.axisSubX:(c=Hj.select("."+g.axisX),a&&(c=c.transition())),Hj.attr("transform",qj.context),c.attr("transform",qj.subx)}function n(a){(a?Ij.transition():Ij).attr("transform",qj.legend)}function o(a,b){l(a,b),rh&&m(a,b),n(a)}function p(){var a=V(),b=U(),c=rj?0:a,d=me(Rf.data.targets),e=Ah||d?0:A("x"),f=rh&&!d?sh+e:0;og=t(),pg=u(),Ah?(hg={top:A("y2")+v(),right:d?0:y(),bottom:A("y")+c+w(),left:f+(d?0:x())},ig={top:hg.top,right:0/0,bottom:20+c,left:wj}):(hg={top:4+v(),right:d?0:y(),bottom:e+f+c+w(),left:d?0:x()},ig={top:pg-f-c,right:0/0,bottom:e+c,left:hg.left}),jg={top:rj?0:pg-a,right:0/0,bottom:0,left:rj?og-b:0},kg=og-hg.left-hg.right,mg=pg-hg.top-hg.bottom,0>kg&&(kg=0),0>mg&&(mg=0),lg=Ah?hg.left-wj-xj:kg,ng=Ah?mg:pg-ig.top-ig.bottom,0>lg&&(lg=0),0>ng&&(ng=0),tg=kg-(rj?b+10:0),ug=mg-(rj?0:10),r(),rj&&d&&(jg.left=tg/2+1.1*rg)}function q(){Gj.select("line."+g.xgridFocus).attr("x1",Ah?0:-10).attr("x2",Ah?kg:-10).attr("y1",Ah?-10:hg.top).attr("y2",Ah?-10:mg)}function r(){rg=Math.min(tg,ug)/2,qg=.95*rg,sg=le(Rf.data.targets)?.6*qg:0}function s(){var a=Ah?g.axisX:g.axisY,b=Gj.select("."+a).node(),c=b?b.getBoundingClientRect():{right:0},d=Kj.node().getBoundingClientRect(),e=me(Rf.data.targets),f=c.right-d.left-(e?0:x());return f>0?f:0}function t(){return Uf?Uf:C()}function u(){var a=Vf?Vf:D();return a>0?a:320}function v(){return Yf?Yf:0}function w(){return Zf?Zf:0}function x(){return Wf?Wf:Ah?Bh?Math.max(Le(z("x")),40):1:!Th||Yh?1:Le(z("y"))}function y(){var a=10,b=rj?U()+20:0;return Xf?Xf:Ah?a+b:(!ai||fi?a:Le(z("y2")))+b}function z(a){var b=pb(a);return b.isInner?20+Ib(a):40+Ib(a)}function A(a){return"x"!==a||Bh?"x"===a&&Qh?Qh:"y"!==a||Th?"y2"!==a||ai?(pb(a).isInner?30:40)+("y2"===a?-10:0):yj:uh&&!rj?10:1:0}function B(a){for(var b,c=Kj.node();c&&"BODY"!==c.tagName&&!(b=c.getBoundingClientRect()[a]);)c=c.parentNode;return b}function C(){return B("width")}function D(){var a=Kj.style("height");return a.indexOf("px")>0?+a.replace("px",""):0}function E(a){return a?-31:-(hg.left-1)}function F(a){return a?-20:-4}function G(){return E(!Ah)}function H(){return F(!Ah)}function I(){return E(Ah)}function J(){return F(Ah)}function K(a){return a?kg+2+30+30:hg.left+20}function L(a){return a?(Qh?Qh:0)+80:mg+8}function M(){return K(!Ah)}function N(){return L(!Ah)}function O(){return K(Ah)}function P(){return L(Ah)}function Q(){var a,b,c,d,e,f,g=Fc(Rf.data.targets);return g?(a=g.values[0],b=g.values[g.values.length-1],c=Hg(b.x)-Hg(a.x),0===c?Ah?mg:kg:(d=Ec(),e=ie(Rf.data.targets)?(d-($i?.25:1))/d:1,f=d>1?c*e/(d-1):c,1>f?1:f)):0}function R(a){sj=a}function S(a){tj=a}function T(a){uj=a}function U(){return uh?rj?tj*(sj+1):og:0}function V(){return uh?rj?pg:uj*(sj+1):0}function W(){var a,b,c=!Hg;zg=Ah?1:0,Ag=Ah?mg:kg,Bg=Ah?0:mg,Cg=Ah?kg:1,Dg=zg,Eg=Ag,Fg=Ah?0:ng,Gg=Ah?lg:1,Hg=Z(zg,Ag,c?void 0:Hg.domain(),function(){return Ng.tickOffset()}),Ig=$(Bg,Cg,c?void 0:Ig.domain()),Jg=$(Bg,Cg,c?void 0:Jg.domain()),Kg=Z(zg,Ag,Lj,function(a){return a%1?0:Qg.tickOffset()}),Lg=$(Fg,Gg,c?void 0:Lg.domain()),Mg=$(Fg,Gg,c?void 0:Mg.domain()),a=eb(),b=Lh?Lh:c?void 0:Ng.tickValues(),Ng=bb(Hg,mj,a,b),Qg=bb(Kg,pj,a,b),Og=cb(Ig,nj,Zh,_h),Pg=cb(Jg,oj,gi,ii),c||(zj.scale(Kg),$f&&Dj.scale(Hg)),X()}function X(){vg=Lb(),wg=Mb(),xg=Mb(.98)}function Y(a,b,c){return(c?Qf.time.scale():Qf.scale.linear()).range([a,b])}function Z(a,b,c,d){var e,f=Y(a,b,Zi),g=c?f.domain(c):f;$i?(d=d||function(){return 0},f=function(a,b){var c=g(a)+d(a);return b?c:Math.ceil(c)}):f=function(a,b){var c=g(a);return b?c:Math.ceil(c)};for(e in g)f[e]=g[e];return f.orgDomain=function(){var a=g.domain();return Lj&&Lj[0]===a[0]&&Lj[1]a?a.toFixed(0):a};return Gh&&("function"==typeof Gh?a=Gh:Zi&&(a=function(a){return a?hj(Gh)(a):""})),a}function fb(a){var b;return"y"===a?b=Xh:"y2"===a?b=ei:"x"===a&&(b=Sh),b}function gb(a){var b=fb(a);return"string"==typeof b?b:b?b.text:null}function hb(a,b){var c=fb(a);"string"==typeof c?"y"===a?Xh=b:"y2"===a?ei=b:"x"===a&&(Sh=b):c&&(c.text=b)}function ib(a){return 10*Math.sin(Math.PI*(a/180))}function jb(a){return 11.5-2.5*(a/15)}function kb(a,b,c){a.selectAll(".tick text").style("text-anchor","start"),b.selectAll(".tick text").attr("y",jb(c)).attr("x",ib(c)).attr("transform","rotate("+c+")")}function lb(a,b){var c=fb(a),d=c&&"object"==typeof c&&c.position?c.position:b;return{isInner:d.indexOf("inner")>=0,isOuter:d.indexOf("outer")>=0,isLeft:d.indexOf("left")>=0,isCenter:d.indexOf("center")>=0,isRight:d.indexOf("right")>=0,isTop:d.indexOf("top")>=0,isMiddle:d.indexOf("middle")>=0,isBottom:d.indexOf("bottom")>=0}}function mb(){return lb("x",Ah?"inner-top":"inner-right")}function nb(){return lb("y",Ah?"inner-right":"inner-top")}function ob(){return lb("y2",Ah?"inner-right":"inner-top")}function pb(a){return"y2"===a?ob():"y"===a?nb():mb()}function qb(){return gb("x")}function rb(){return gb("y")}function sb(){return gb("y2")}function tb(a,b){return a?b.isLeft?0:b.isCenter?kg/2:kg:b.isBottom?-mg:b.isMiddle?-mg/2:0}function ub(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"}function vb(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"}function wb(){return tb(!Ah,mb())}function xb(){return tb(Ah,nb())}function yb(){return tb(Ah,ob())}function zb(){return ub(!Ah,mb())}function Ab(){return ub(Ah,nb())}function Bb(){return ub(Ah,ob())}function Cb(){var a=mb();return Ah?a.isInner?"1.2em":-25-Ib("x"):a.isInner?"-0.5em":Qh?Qh-10:"3em"}function Db(){var a=nb();return Ah?a.isInner?"-0.5em":"3em":a.isInner?"1.2em":-20-Ib("y")}function Eb(){var a=ob();return Ah?a.isInner?"1.2em":"-2.2em":a.isInner?"-0.5em":30+Ib("y2")}function Fb(){return vb(!Ah,mb())}function Gb(){return vb(Ah,nb())}function Hb(){return vb(Ah,ob())}function Ib(a){var b=0,c="x"===a?g.axisX:"y"===a?g.axisY:g.axisY2;return Qf.selectAll("."+c+" .tick text").each(function(){var a=this.getBoundingClientRect();bb?0:b}function Jb(a){var b=Gj.select("."+g.axisX+" ."+g.axisXLabel),c=Gj.select("."+g.axisY+" ."+g.axisYLabel),d=Gj.select("."+g.axisY2+" ."+g.axisY2Label);(a?b.transition():b).attr("x",wb).attr("dx",zb).attr("dy",Cb).text(qb),(a?c.transition():c).attr("x",xb).attr("dx",Ab).attr("dy",Db).attr("dy",Db).text(rb),(a?d.transition():d).attr("x",yb).attr("dx",Bb).attr("dy",Eb).text(sb)}function Kb(a){var b=!1;return yg(Mc(Rf.data.targets)).forEach(function(c){b||c.data.id!==a.data.id||(b=!0,a=c)}),b?a:null}function Lb(){var a=Qf.svg.arc().outerRadius(qg).innerRadius(sg),b=function(b,c){var d;return c?a(b):(d=Kb(b),d?a(d):"M 0 0")};return b.centroid=a.centroid,b}function Mb(a){var b=Qf.svg.arc().outerRadius(rg*(a?a:1)).innerRadius(sg);return function(a){var c=Kb(a);return c?b(c):"M 0 0"}}function Nb(a,b){return te(a.data)?vg(a,b):"M 0 0"}function Ob(a){var b,c,d,e,f,g=Kb(a),h="";return g&&(b=vg.centroid(g),c=b[0],d=b[1],e=Math.sqrt(c*c+d*d),f=(36/qg>.375?1.175-36/qg:.8)*qg/e,h="translate("+c*f+","+d*f+")"),h}function Pb(a){return a?(a.endAngle-a.startAngle)/(2*Math.PI):null}function Qb(a){return uc({id:a.data.id,value:a.value,ratio:Pb(a)})}function Rb(a){var b,c,d,e;return Ub()?(b=Kb(a),c=b?b.value:null,d=Pb(b),e=Vb(),e?e(c,d):Hd(c,d)):""}function Sb(a,b){var c=Ej.selectAll("."+g.chartArc+td(a)),d=Ej.selectAll("."+g.arc).filter(function(b){return b.data.id!==a});ze(a)&&c.selectAll("path").transition().duration(50).attr("d",wg).transition().duration(100).attr("d",xg).each(function(a){se(a.data)}),b||d.style("opacity",.3)}function Tb(a){var b=Ej.selectAll("."+g.chartArc+td(a));b.selectAll("path").transition().duration(50).attr("d",vg),Ej.selectAll("."+g.arc).style("opacity",1)}function Ub(){return le(Rf.data.targets)?Ei:yi}function Vb(){return le(Rf.data.targets)?Fi:zi}function Wb(){return le(Rf.data.targets)?Hi:""}function Xb(){var a=le(Rf.data.targets)?Ii:Bi;return"function"==typeof a?a:function(){}}function Yb(){var a=le(Rf.data.targets)?Ji:Ci;return"function"==typeof a?a:function(){}}function Zb(){var a=le(Rf.data.targets)?Ki:Di;return"function"==typeof a?a:function(){}}function $b(a){var b,c,d,e,f,g,h=Hc(a),i=Tc(a);if(Xg.length>0)for(g=Vc(a),b=0;b=0}),0!==e.length)for(d=e[0],g&&i[d]&&i[d].forEach(function(a,b){i[d][b]=0>a?a:0}),c=1;c0||(i[d][b]+=+a)});return Qf.min(Object.keys(i).map(function(a){return Qf.min(i[a])}))}function _b(a){var b,c,d,e,f,g,h=Hc(a),i=Tc(a);if(Xg.length>0)for(g=Wc(a),b=0;b=0}),0!==e.length)for(d=e[0],g&&i[d]&&i[d].forEach(function(a,b){i[d][b]=a>0?a:0}),c=1;c+a||(i[d][b]+=+a)});return Qf.max(Object.keys(i).map(function(a){return Qf.max(i[a])}))}function ac(a,c){var d,e,f,g,h,i,j,k,l=a.filter(function(a){return db(a.id)===c}),m="y2"===c?ci:Vh,n="y2"===c?bi:Uh,o=b(m)?m:$b(l),p=b(n)?n:_b(l),q="y2"===c?di:Wh,r=Bd()&&Ah;return 0===l.length?"y2"===c?Jg.domain():Ig.domain():(o===p&&(0>o?p=0:o=0),d=Math.abs(p-o),e=f=g=r?0:.1*d,q&&(h=Math.max(Math.abs(o),Math.abs(p)),p=h-q,o=q-h),r&&(i=Cd(o,p),j=fc(Ig.range()),k=[i[0]/j,i[1]/j],f+=d*(k[1]/(1-k[0]-k[1])),g+=d*(k[0]/(1-k[0]-k[1]))),"y"===c&&$h&&(f=b($h.top)?$h.top:e,g=b($h.bottom)?$h.bottom:e),"y2"===c&&hi&&(f=b(hi.top)?hi.top:e,g=b(hi.bottom)?hi.bottom:e),ie(l)&&!Vc(l)&&(g=o),[o-g,p+f])}function bc(a){return Oh?Zi?Be(Oh):Oh:Qf.min(a,function(a){return Qf.min(a.values,function(a){return a.x})})}function cc(a){return Nh?Zi?Be(Nh):Nh:Qf.max(a,function(a){return Qf.max(a.values,function(a){return a.x})})}function dc(a){var c,d,e,f,g=Gc(a),h=g[1]-g[0];return $i?d=0:ie(a)?(c=Ec(),d=c>1?h/(c-1)/2:.5):d=.01*h,"object"==typeof Ph&&Ge(Ph)?(e=b(Ph.left)?Ph.left:d,f=b(Ph.right)?Ph.right:d):e=f="number"==typeof Ph?Ph:d,{left:e,right:f}}function ec(a){var b=[bc(a),cc(a)],c=b[0],d=b[1],e=dc(a),f=0,g=0;return c-d!==0||$i||(c=Zi?new Date(.5*c.getTime()):-.5,d=Zi?new Date(1.5*d.getTime()):.5),(c||0===c)&&(f=Zi?new Date(c.getTime()-e.left):c-e.left),(d||0===d)&&(g=Zi?new Date(d.getTime()+e.right):d+e.right),[f,g]}function fc(a){return a[1]-a[0]}function gc(a){for(var b=0;bb?0:b-c}function mc(a){var b,c=kc(a),d="y"===a.axis?Ig:Jg;return b="y"===a.axis||"y2"===a.axis?Ah?mg:"start"in a?d(a.start):mg:Ah?"end"in a?Hg(Zi?Be(a.end):a.end):mg:mg,c>b?0:b-c}function nc(a){return Rg&&a===Rg||Ge(Sg)&&He(Sg,a)}function oc(a){return!nc(a)}function pc(a){return Rg?Rg:Ge(Sg)?Sg[a]:null}function qc(a,b){var c,d=b&&Ge(b)?Hc(b):[];return d.forEach(function(b){pc(b)===a&&(c=Rf.data.xs[b])}),c}function rc(a,b){return a in Rf.data.xs&&Rf.data.xs[a]&&Rf.data.xs[a][b]?Rf.data.xs[a][b]:b}function sc(a){Object.keys(a).forEach(function(b){Sg[b]=a[b]})}function tc(a){return 1===Qf.set(Object.keys(a).map(function(b){return a[b]})).size()}function uc(a){var b;return a&&(b=Vg[a.id],a.name=b?b:a.id),a}function vc(a,b){a.forEach(function(a){a.values.forEach(function(c,d){c.x=xc(b[d],a.id,d)}),Rf.data.xs[a.id]=b})}function wc(a,b){a.forEach(function(a){b[a.id]&&vc([a],b[a.id])})}function xc(a,c,d){var e;return e=Zi?a?a instanceof Date?a:Be(a):Be(rc(c,d)):_i&&!$i?b(a)?+a:rc(c,d):d}function yc(a){var b,c,d=a[0],e={},f=[];for(b=1;b=0?Rf.data.xs[c]=a.map(function(a){return a[f]}).filter(b).map(function(a,b){return xc(a,c,b)}):Rg?(d=Object.keys(Rf.data.xs),Rf.data.xs[c]=d.length>0?Rf.data.xs[d[0]]:void 0):Ge(Sg)&&(Rf.data.xs[c]=qc(f,Rf.data.targets)):Rf.data.xs[c]=a.map(function(a,b){return b})}),d.forEach(function(a){if(!Rf.data.xs[a])throw new Error('x is not defined for id = "'+a+'".')}),c=d.map(function(b,c){var d=Ug(b);return{id:d,id_org:b,values:a.map(function(a,e){var f=pc(b),g=a[f],h=xc(g,b,e);return _i&&$i&&0===c&&g&&(0===e&&(Eh=[]),Eh.push(g)),("undefined"==typeof a[b]||Rf.data.xs[b].length<=e)&&(h=void 0),{x:h,value:null===a[b]||isNaN(a[b])?null:+a[b],id:d}}).filter(function(a){return"undefined"!=typeof a.x})}}),c.forEach(function(a){var b;a.values=a.values.sort(function(a,b){var c=a.x||0===a.x?a.x:1/0,d=b.x||0===b.x?b.x:1/0;return c-d}),b=0,a.values.forEach(function(a){a.index=b++})}),Zg&&ge(Hc(c).filter(function(a){return!(a in $g)}),Zg),c.forEach(function(a){hc(a.id_org,a)}),c}function Bc(a){return{id:a.id,id_org:a.id_org,values:a.values.map(function(a){return{x:a.x,value:a.value,id:a.id}})}}function Cc(a){return a>0&&Rf.data.targets[0].values[a-1]?Rf.data.targets[0].values[a-1].x:void 0}function Dc(a){return a1?a.forEach(function(a){a.values.length>d&&(b=a,d=a.values.length)}):b=c?a[0]:null,b}function Gc(a){var b,c,d=Fc(a);return d?(b=d.values[0],c=d.values[d.values.length-1],[b.x,c.x]):[0,0]}function Hc(a){return a.map(function(a){return a.id})}function Ic(a){return a?"string"==typeof a?[a]:a:Hc(Rf.data.targets)}function Jc(a,b){var c,d=Hc(a);for(c=0;c2){for(f=c-2,d=a[0],e=a[a.length-1],g=(e-d)/(f+1),j=[d],h=0;f>h;h++)i=+d+g*(h+1),j.push(Zi?new Date(i):i);j.push(e)}return Zi||(j=j.sort(function(a,b){return a-b})),j}function Pc(a){jj=jj.concat(a)}function Qc(a){jj=jj.filter(function(b){return a.indexOf(b)<0})}function Rc(a){kj=kj.concat(a)}function Sc(a){kj=kj.filter(function(b){return a.indexOf(b)<0})}function Tc(a){var b={};return a.forEach(function(a){b[a.id]=[],a.values.forEach(function(c){b[a.id].push(c.value)})}),b}function Uc(a,b){var c,d,e,f=Object.keys(a);for(c=0;ca})}function Wc(a){return Uc(a,function(a){return a>0})}function Xc(a){return a=0&&d===a[c].x;c--)e.push(a[c]);for(c=b;c0?g=h:f=h,g-f===1||0===f&&0===g?(e=[],(a[f].x||0===a[f].x)&&(e=e.concat(Nd(a,f))),(a[g].x||0===a[g].x)&&(e=e.concat(Nd(a,g))),Qd(e,b)):Od(a,b,f,g)}function Pd(a,b){var c;return c=a.map(function(a){return Od(a.values,b)}),Qd(c,b)}function Qd(a,b){var c,d;return a.forEach(function(a){var e=Ie(a,b);(c>e||!c)&&(c=e,d=a)}),d}function Rd(a,b){return Qf.merge(a.map(function(a){return a.values})).filter(function(a){return a.x-b===0})}function Sd(a){var b=a.getBoundingClientRect(),c=[a.pathSegList.getItem(0),a.pathSegList.getItem(1)],d=c[0].x,e=Math.min(c[0].y,c[1].y);return{x:d,y:e,width:b.width,height:b.height}}function Td(){return ah&&"desc"===ah.toLowerCase()}function Ud(){return ah&&"asc"===ah.toLowerCase()}function Vd(a){var b=Ud(),c=Td();return b||c?a.sort(function(a,c){var d=function(a,b){return a+Math.abs(b.value)},e=a.values.reduce(d,0),f=c.values.reduce(d,0);return b?f-e:e-f}):"function"==typeof ah&&a.sort(ah),a}function Wd(a,c){var d,e,f,g,h,i,j,k=me(Rf.data.targets),l=a.filter(function(a){return a&&b(a.value)});0!==l.length&&Mi&&(Jj.html(Pi(a,eb(),Dd(k),gj)).style("display","block"),d=Jj.property("offsetWidth"),e=Jj.property("offsetHeight"),k?(g=kg/2+c[0],i=mg/2+c[1]+20):(Ah?(f=s(),g=f+c[0]+100,h=g+d,j=t()-y(),i=Hg(l[0].x)+20):(f=s(),g=f+x()+Hg(l[0].x)+20,h=g+d,j=f+t()-y(),i=c[1]+15),h>j&&(g-=h-j),i+e>u()&&(i-=e+30)),Jj.style("top",i+"px").style("left",g+"px"))}function Xd(){Jj.style("display","none")}function Yd(a){var c=a.filter(function(a){return a&&b(a.value)});if(Mi&&!je(Rf.data.targets)&&!me(Rf.data.targets)){var d=Gj.selectAll("line."+g.xgridFocus);d.style("visibility","visible").data([c[0]]).attr(Ah?"y1":"x1",Jd).attr(Ah?"y2":"x2",Jd),tf(d,"grid")}}function Zd(){Gj.select("line."+g.xgridFocus).style("visibility","hidden")}function $d(a,b){var c,d,e,f,h=[],i=Gj.select("."+g.axisX).selectAll(".tick").size();if("year"===a)for(c=ec(),d=c[0].getFullYear(),e=c[1].getFullYear(),f=d;e>=f;f++)h.push(new Date(f+"-01-01 00:00:00"));else h=b.ticks(10);return h.slice(0,i)}function _d(a){return a.x||0===a.x?Hg(a.x):null}function ae(a){return _(a.id)(a.value)}function be(){var a,b,d={},e=0;return Mc(Rf.data.targets.filter(pe)).forEach(function(f){for(a=0;a0&&(i+=g(b.values[f].value)-h)}),i}}function fe(a,b){return"number"==typeof wi?wi:b?2*a.tickOffset()*xi/b:0}function ge(a,b){Ic(a).forEach(function(a){Nj[a]=b===$g[a],$g[a]=b})}function he(a,b){var c=!1;return a.forEach(function(a){$g[a.id]===b&&(c=!0),a.id in $g||"line"!==b||(c=!0)}),c}function ie(a){return he(a,"bar")}function je(a){return he(a,"scatter")}function ke(a){return"pie"===Zg||he(a,"pie")}function le(a){return"donut"===Zg||he(a,"donut")}function me(a){return ke(a)||le(a)}function ne(a){var b="string"==typeof a?a:a.id;return!(b in $g)||"line"===$g[b]||"spline"===$g[b]||"area"===$g[b]||"area-spline"===$g[b]}function oe(a){var b="string"==typeof a?a:a.id;return"spline"===$g[b]||"area-spline"===$g[b]}function pe(a){var b="string"==typeof a?a:a.id;return"bar"===$g[b]}function qe(a){var b="string"==typeof a?a:a.id;return"scatter"===$g[b]}function re(a){var b="string"==typeof a?a:a.id;return"pie"===$g[b]}function se(a){var b="string"==typeof a?a:a.id;return"donut"===$g[b]}function te(a){return re(a)||se(a)}function ue(a){return ne(a)?[a]:[]}function ve(a){return te(a.data)?[a]:[]}function we(a){return pe(a)?a.values:[]}function xe(a){return ne(a)||qe(a)?a.values:[]}function ye(a){return pe(a)||ne(a)?a.values:[]}function ze(a){return se(a)&&Gi||re(a)&&Ai}function Ae(a,b,c){var d=[];return function(e){var f,g=e.id||e;return a[g]instanceof Function?f=a[g](e):a[g]?f=a[g]:(d.indexOf(g)<0&&d.push(g),f=b[d.indexOf(g)%b.length]),c instanceof Function?c(f,e):f}}function Be(b){var c;try{c=Tg?Qf.time.format(Tg).parse(b):new Date(b)}catch(d){a.console.error("Failed to parse x '"+b+"' to Date with format "+Tg)}return c}function Ce(a,b){var c=Qf.mouse(a),d=Qf.select(a),e=1*d.attr("cx"),f=1*d.attr("cy");return Math.sqrt(Math.pow(e-c[0],2)+Math.pow(f-c[1],2))0}function He(a,b){var c=!1;return Object.keys(a).forEach(function(d){a[d]===b&&(c=!0)}),c}function Ie(a,b){var c="y"===db(a.id)?Ig:Jg,d=Ah?1:0,e=Ah?0:1;return Math.pow(Hg(a.x)-b[d],2)+Math.pow(c(a.value)-b[e],2)}function Je(a,b){var c=0;a.each(function(){++c}).each("end",function(){--c||b.apply(this,arguments)})}function Ke(a,b,c){return d(a[b])?a[b]:c}function Le(a){return 10*Math.ceil(a/10)}function Me(a,b){var c;return Qf.select("body").selectAll(".dummy").data([a]).enter().append("text").classed(b?b:"",!0).text(a).each(function(){c=this.getBoundingClientRect()}).remove(),c}function Ne(a,b,c){nh(b,a.node()),Gj.select("."+g.selectedCircles+sd(b.id)).selectAll("."+g.selectedCircle+"-"+c).data([b]).enter().append("circle").attr("class",function(){return Yc(g.selectedCircle,c)}).attr("cx",Ah?ae:_d).attr("cy",Ah?_d:ae).attr("stroke",function(){return gj(b)}).attr("r",1.4*Ye(b)).transition().duration(100).attr("r",Ye)}function Oe(a,b,c){oh(b,a.node()),Gj.select("."+g.selectedCircles+sd(b.id)).selectAll("."+g.selectedCircle+"-"+c).transition().duration(100).attr("r",0).remove()}function Pe(a,b,c,d){a?Ne(b,c,d):Oe(b,c,d)}function Qe(a,b){nh(b,a.node()),a.transition().duration(100).style("fill",function(){return Qf.rgb(gj(b)).brighter(.75)})}function Re(a,b){oh(b,a.node()),a.transition().duration(100).style("fill",function(){return gj(b)})}function Se(a,b,c,d){a?Qe(b,c,d):Re(b,c,d)}function Te(a,b,c,d){Se(a,b,c.data,d)}function Ue(a){return"circle"===a.nodeName?Pe:Qf.select(a).classed(g.bar)?Se:Te}function Ve(a){return a.filter(function(a){return b(a.value)})}function We(a){return pi?"function"==typeof qi?qi(a):qi:0}function Xe(a){return si?ti?ti:1.75*We(a):We(a)}function Ye(a){return ui?ui:4*We(a)}function Ze(a,c){return(c?Gj.selectAll("."+g.circles+sd(c)):Gj).selectAll("."+g.circle+(b(a)?"-"+a:""))}function $e(a,b){Ze(a,b).classed(g.EXPANDED,!0).attr("r",Xe)}function _e(a){Ze(a).filter(function(){return Qf.select(this).classed(g.EXPANDED)}).classed(g.EXPANDED,!1).attr("r",We)}function af(a){return Gj.selectAll("."+g.bar+(b(a)?"-"+a:""))}function bf(a){af(a).classed(g.EXPANDED,!0)}function cf(a){af(a).classed(g.EXPANDED,!1)}function df(a){var b=a?ab:_,c=a?Jd:Md,d=function(a){return b(a.id)(a.value)},e=Qf.svg.line().x(Ah?d:c).y(Ah?c:d);return vi||(e=e.defined(function(a){return null!=a.value})),function(c){var d=vi?Ve(c.values):c.values,f=a?f:Kg,g=b(c.id),h=0,i=0;return ne(c)?bh[c.id]?kf(d,f,g,bh[c.id]):(e.interpolate(oe(c)?"cardinal":"linear"),e(d)):(d[0]&&(h=f(d[0].x),i=g(d[0].value)),Ah?"M "+i+" "+h:"M "+h+" "+i)}}function ef(a,b){var c=jf(a,b);return function(a,b){var d=c(a,b),e=Ah?1:0,f=Ah?0:1,g="M "+d[0][e]+","+d[0][f]+" L"+d[1][e]+","+d[1][f]+" L"+d[2][e]+","+d[2][f]+" L"+d[3][e]+","+d[3][f]+" z"; return g}}function ff(a,b){var c=jf(a,!1),d=b?gf:hf;return function(a,b){return d(c(a,b),a,this)}}function gf(a,b){var c;return Ah?(c=pe(b)?4:6,a[2][1]+c*(b.value<0?-1:1)):a[0][0]+(a[2][0]-a[0][0])/2}function hf(a,b,c){var d=c.getBoundingClientRect();return Ah?(a[0][0]+a[2][0]+.6*d.height)/2:a[2][1]+(b.value<0?d.height:pe(b)?-3:-6)}function jf(a,b){var c=a.__max__+1,d=fe(Ng,c),e=ce(d,c,a,!!b),f=de(!!b),g=ee(a,!!b),h=b?ab:_;return function(a,b){var c=h(a.id)(0),i=g(a,b)||c,j=e(a),k=f(a);return Ah&&(0k||a.value<0&&k>c)&&(k=c),[[j,i],[j,k-(c-i)],[j+d,k-(c-i)],[j+d,i]]}}function kf(a,b,e,f){var g,h,i,j,k,l,m,n,o,p,q,r,s=-1,t="M",u=[];if(d(f))for(g=0;g=h;h+=p)t+=i(a[g-1],a[g],h,o);s=a[g].x}return t}function lf(b){var c=new MutationObserver(function(d){d.forEach(function(d){if("childList"===d.type&&d.previousSibling){c.disconnect();var e=a.setInterval(function(){b.node().parentNode&&(a.clearInterval(e),uf({withUpdateTranslate:!0,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),b.transition().style("opacity",1))},10)}})});c.observe(b.node(),{attributes:!0,childList:!0,characterData:!0})}function mf(b){var c,d,e,f=!0;if(Kj=Qf.select(Tf),Kj.empty()&&(Kj=Qf.select(document.createElement("div")).style("opacity",0),lf(Kj),f=!1),Kj.html("").classed("c3",!0),Rf.data.xs={},Rf.data.targets=Ac(b),fh&&(Rf.data.targets=Rf.data.targets.filter(fh)),eh&&Pc(eh===!0?Hc(Rf.data.targets):eh),p(),W(),Hg.domain(Qf.extent(ec(Rf.data.targets))),Ig.domain(ac(Rf.data.targets,"y")),Jg.domain(ac(Rf.data.targets,"y2")),Kg.domain(Hg.domain()),Lg.domain(Ig.domain()),Mg.domain(Jg.domain()),Lj=Hg.domain(),zj.scale(Kg),$f&&Dj.scale(Hg),Ej=Kj.append("svg").style("overflow","hidden").on("mouseenter",cg).on("mouseleave",dg),Fj=Ej.append("defs"),Fj.append("clipPath").attr("id",Ti).append("rect"),Fj.append("clipPath").attr("id",Ui).append("rect"),Fj.append("clipPath").attr("id",Vi).append("rect"),yf(),Gj=Ej.append("g").attr("transform",qj.main),Hj=Ej.append("g").attr("transform",qj.context),Ij=Ej.append("g").attr("transform",qj.legend),rh||Hj.style("visibility","hidden"),uh||(Ij.style("visibility","hidden"),kj=Hc(Rf.data.targets)),Jj=Kj.style("position","relative").append("div").style("position","absolute").style("pointer-events","none").style("z-index","10").style("display","none"),Lf(Hc(Rf.data.targets),{withTransform:!1,withTransitionForTransform:!1}),d=Gj.append("g").attr("clip-path",Wi).attr("class",g.grid),ji&&d.append("g").attr("class",g.xgrids),Ge(li)&&d.append("g").attr("class",g.xgridLines),ri&&d.append("g").attr("class",g.xgridFocus).append("line").attr("class",g.xgridFocus),mi&&d.append("g").attr("class",g.ygrids),Ge(ni)&&d.append("g").attr("class",g.ygridLines),Gj.append("g").attr("clip-path",Wi).attr("class",g.regions),Gj.append("g").attr("clip-path",Wi).attr("class",g.chart),c=Gj.select("."+g.chart).append("g").attr("class",g.eventRects).style("fill-opacity",0).style("cursor",$f?Ah?"ns-resize":"ew-resize":null),Gj.select("."+g.chart).append("g").attr("class",g.chartBars),Gj.select("."+g.chart).append("g").attr("class",g.chartLines),Gj.select("."+g.chart).append("g").attr("class",g.chartArcs).attr("transform",qj.arc).append("text").attr("class",g.chartArcsTitle).style("text-anchor","middle").text(Wb()),Gj.select("."+g.chart).append("g").attr("class",g.chartTexts),$f&&Gj.insert("rect",ag?null:"g."+g.grid).attr("class",g.zoomRect).attr("width",kg).attr("height",mg).style("opacity",0).style("cursor",Ah?"ns-resize":"ew-resize").call(Dj).on("dblclick.zoom",null),Rh&&zj.extent("function"!=typeof Rh?Rh:Rh(ec())),lj.x=Gj.append("g").attr("class",g.axisX).attr("clip-path",Xi).attr("transform",qj.x).style("visibility",Bh?"visible":"hidden"),lj.x.append("text").attr("class",g.axisXLabel).attr("transform",Ah?"rotate(-90)":"").style("text-anchor",Fb),lj.y=Gj.append("g").attr("class",g.axisY).attr("clip-path",Yi).attr("transform",qj.y).style("visibility",Th?"visible":"hidden"),lj.y.append("text").attr("class",g.axisYLabel).attr("transform",Ah?"":"rotate(-90)").style("text-anchor",Gb),lj.y2=Gj.append("g").attr("class",g.axisY2).attr("transform",qj.y2).style("visibility",ai?"visible":"hidden"),lj.y2.append("text").attr("class",g.axisY2Label).attr("transform",Ah?"":"rotate(-90)").style("text-anchor",Hb),Hj.append("g").attr("clip-path",Wi).attr("class",g.chart),Hj.select("."+g.chart).append("g").attr("class",g.chartBars),Hj.select("."+g.chart).append("g").attr("class",g.chartLines),Hj.append("g").attr("clip-path",Wi).attr("class",g.brush).call(zj).selectAll("rect").attr(Ah?"width":"height",Ah?lg:ng),lj.subx=Hj.append("g").attr("class",g.axisX).attr("transform",qj.subx).attr("clip-path",Ah?"":Xi),Bf(Rf.data.targets),f&&uf({withUpdateTranslate:!0,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1}),Qi){if(Zi&&"string"==typeof Ri){for(Ri=Be(Ri),e=0;ef&&h>c&&d>i&&j>d;else{if(!n.classed(g.bar))return;m=Sd(this),c=m.x,d=m.y,e=m.width,k=m.height,l=Se,q=!(c>h||f>c+e||d>j||i>d+k)}q^p&&(n.classed(g.INCLUDED,!p),n.classed(g.SELECTED,!o),l(!o,n,a,b))}))}function rf(a){me(Rf.data.targets)||gh&&(aj=a,Gj.select("."+g.chart).append("rect").attr("class",g.dragarea).style("opacity",.1),bj=!0,ph())}function sf(){me(Rf.data.targets)||gh&&(Gj.select("."+g.dragarea).transition().duration(100).style("opacity",0).remove(),Gj.selectAll("."+g.shape).classed(g.INCLUDED,!1),bj=!1,qh())}function tf(a,b){"grid"===b&&a.each(function(){var a=Qf.select(this),b=a.attr("x1"),c=a.attr("x2"),d=a.attr("y1"),e=a.attr("y2");a.attr({x1:Math.ceil(b),x2:Math.ceil(c),y1:Math.ceil(d),y2:Math.ceil(e)})})}function uf(a,c){var d,e,f,h,i,j,k,l,m,n,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,R,S,T,U,V,X,Y,Z,$=be(),_=me(Rf.data.targets),ab=Mc(Rf.data.targets);if(a=a||{},E=Ke(a,"withY",!0),F=Ke(a,"withSubchart",!0),G=Ke(a,"withTransition",!0),J=Ke(a,"withTransform",!1),K=Ke(a,"withUpdateXDomain",!1),L=Ke(a,"withUpdateOrgXDomain",!1),N=Ke(a,"withUpdateTranslate",!1),M=Ke(a,"withLegend",!1),H=Ke(a,"withTransitionForExit",G),I=Ke(a,"withTransitionForAxis",G),T=G?gg:0,U=H?T:0,V=I?T:0,c=c||zf(V),N&&(Ah?(lj.x.call(Ng),lj.subx.call(Qg)):(lj.y.call(Og),lj.y2.call(Pg)),p(),W(),yf(),o(!1)),M&&uh&&Lf(Hc(Rf.data.targets),a,c),$i&&0===ab.length&&Hg.domain([0,lj.x.selectAll(".tick").size()]),ab.length&&(L&&(Hg.domain(Qf.extent(ec(ab))),Lj=Hg.domain(),$f&&Dj.scale(Hg).updateScaleExtent(),Kg.domain(Hg.domain()),zj.scale(Kg)),K&&(Hg.domain(zj.empty()?Lj:zj.extent()),$f&&Dj.scale(Hg).updateScaleExtent()),Lh||!Kh&&!Jh||(X=Oc(Nc(ab),Jh),Ng.tickValues(X),Qg.tickValues(X))),Ig.domain(ac(ab,"y")),Jg.domain(ac(ab,"y2")),lj.x.style("opacity",_?0:1),lj.y.style("opacity",_?0:1),lj.y2.style("opacity",_?0:1),lj.subx.style("opacity",_?0:1),c.axisX.call(Ng),c.axisY.call(Og),c.axisY2.call(Pg),c.axisSubX.call(Qg),Jb(G),K&&ab.length)if(Hh&&X){for(Y=1;Y=0&&Qf.select(this).style("display",b%Z?"none":"block")})}else Ej.selectAll("."+g.axisX+" .tick text").style("display","block");!Ah&&Mh&&kb(lj.x,c.axisX,Mh),O=ef($),R=ff($,!0),S=ff($,!1),Lg.domain(Ig.domain()),Mg.domain(Jg.domain()),Jj.style("display","none"),q(),Gj.select("line."+g.xgridFocus).style("visibility","hidden"),ji&&(f=$d(ki,Hg),B=$i?Ng.tickOffset():0,e=Ah?{x1:0,x2:kg,y1:function(a){return Hg(a)-B},y2:function(a){return Hg(a)-B}}:{x1:function(a){return Hg(a)+B},x2:function(a){return Hg(a)+B},y1:hg.top,y2:mg},d=Gj.select("."+g.xgrids).selectAll("."+g.xgrid).data(f),d.enter().append("line").attr("class",g.xgrid),d.attr(e).style("opacity",function(){return+Qf.select(this).attr(Ah?"y1":"x1")===(Ah?mg:0)?0:1}),d.exit().remove()),Ge(li)&&(h=Gj.select("."+g.xgridLines).selectAll("."+g.xgridLine).data(li),i=h.enter().append("g").attr("class",function(a){return g.xgridLine+(a.class?a.class:"")}),i.append("line").style("opacity",0),i.append("text").attr("text-anchor","end").attr("transform",Ah?"":"rotate(-90)").attr("dx",Ah?0:-hg.top).attr("dy",-5).style("opacity",0),h.select("line").transition().duration(T).attr("x1",Ah?0:Kd).attr("x2",Ah?kg:Kd).attr("y1",Ah?Kd:hg.top).attr("y2",Ah?Kd:mg).style("opacity",1),h.select("text").transition().duration(T).attr("x",Ah?kg:0).attr("y",Kd).text(function(a){return a.text}).style("opacity",1),h.exit().transition().duration(T).style("opacity",0).remove()),E&&mi&&(j=Gj.select("."+g.ygrids).selectAll("."+g.ygrid).data(Ig.ticks(oi)),j.enter().append("line").attr("class",g.ygrid),j.attr("x1",Ah?Ig:0).attr("x2",Ah?Ig:kg).attr("y1",Ah?0:Ig).attr("y2",Ah?mg:Ig),j.exit().remove(),tf(j,"grid")),E&&Ge(ni)&&(k=Gj.select("."+g.ygridLines).selectAll("."+g.ygridLine).data(ni),l=k.enter().append("g").attr("class",function(a){return g.ygridLine+(a.class?a.class:"")}),l.append("line").style("opacity",0),l.append("text").attr("text-anchor","end").attr("transform",Ah?"rotate(-90)":"").attr("dx",Ah?0:-hg.top).attr("dy",-5).style("opacity",0),k.select("line").transition().duration(T).attr("x1",Ah?Ld:0).attr("x2",Ah?Ld:kg).attr("y1",Ah?0:Ld).attr("y2",Ah?mg:Ld).style("opacity",1),k.select("text").transition().duration(T).attr("x",Ah?0:kg).attr("y",Ld).text(function(a){return a.text}).style("opacity",1),k.exit().transition().duration(T).style("opacity",0).remove()),u=Gj.select("."+g.regions).selectAll("."+g.region).data(Li),u.enter().append("g").attr("class",ld).append("rect").style("fill-opacity",0),u.selectAll("rect").transition().duration(T).attr("x",jc).attr("y",kc).attr("width",lc).attr("height",mc).style("fill-opacity",function(a){return b(a.opacity)?a.opacity:.1}),u.exit().transition().duration(T).style("opacity",0).remove(),s=Gj.selectAll("."+g.bars).selectAll("."+g.bar).data(we),s.enter().append("path").attr("class",fd).style("stroke","none").style("fill",gj),s.style("opacity",xd).transition().duration(T).attr("d",O).style("fill",gj).style("opacity",1),s.exit().transition().duration(U).style("opacity",0).remove(),m=Gj.selectAll("."+g.lines).selectAll("."+g.line).data(ue),m.enter().append("path").attr("class",bd).style("stroke",gj),m.style("opacity",xd).transition().duration(T).attr("d",Aj).style("stroke",gj).style("opacity",1),m.exit().transition().duration(U).style("opacity",0).remove(),n=Gj.selectAll("."+g.areas).selectAll("."+g.area).data(ue),n.enter().append("path").attr("class",jd).style("fill",gj).style("opacity",function(){return Mj=+Qf.select(this).style("opacity"),0}),n.style("opacity",0).transition().duration(T).attr("d",Cj).style("fill",gj).style("opacity",Mj),n.exit().transition().duration(U).style("opacity",0).remove(),pi&&(r=Gj.selectAll("."+g.circles).selectAll("."+g.circle).data(xe),r.enter().append("circle").attr("class",dd).attr("r",We).style("fill",gj),r.style("opacity",xd).transition().duration(T).style("opacity",zd).style("fill",gj).attr("cx",Ah?ae:_d).attr("cy",Ah?_d:ae),r.exit().remove()),Bd()&&(v=Gj.selectAll("."+g.texts).selectAll("."+g.text).data(ye),v.enter().append("text").attr("class",Zc).attr("text-anchor",function(a){return Ah?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill",gj).style("fill-opacity",0),v.text(function(a){return Id(a.id)(a.value,a.id)}).style("fill-opacity",yd).transition().duration(T).attr("x",R).attr("y",S).style("fill",gj).style("fill-opacity",Ad),v.exit().transition().duration(U).style("fill-opacity",0).remove()),t=Gj.selectAll("."+g.arcs).selectAll("."+g.arc).data(ve),t.enter().append("path").attr("class",hd).style("fill",function(a){return gj(a.data)}).style("cursor",function(a){return ih(a)?"pointer":null}).style("opacity",0).each(function(a){this._current=a}).on("mouseover",function(a,b){var c,d,e;ej||(c=Kb(a),d=Qb(c),e=Yb(),Sb(c.data.id),Hf(c.data.id,!0),e(d,b))}).on("mousemove",function(a){var b=Kb(a),c=Qb(b),d=[c];Wd(d,Qf.mouse(this))}).on("mouseout",function(a,b){var c,d,e;ej||(c=Kb(a),d=Qb(c),e=Zb(),Tb(c.data.id),If(),Xd(),e(d,b))}).on("click",function(a,b){var c=Kb(a),d=Qb(c),e=Xb();pf(this,a,b),e(d,b)}),t.attr("transform",J?"scale(0)":"").style("opacity",function(a){return a===this._current?0:1}).each(function(){ej=!0}).transition().duration(T).attrTween("d",function(a){var b,c=Kb(a);return c?(b=Qf.interpolate(this._current,c),this._current=b(0),function(a){return Nb(b(a),!0)}):function(){return"M 0 0"}}).attr("transform",J?"scale(1)":"").style("fill",function(a){return gj(a.data)}).style("opacity",1).call(Je,function(){ej=!1}),t.exit().transition().duration(U).style("opacity",0).remove(),Gj.selectAll("."+g.chartArc).select("text").style("opacity",0).text(Rb).attr("transform",Ob).transition().duration(T).style("opacity",function(a){return Kc(a.data.id)&&te(a.data)?1:0}),Gj.select("."+g.chartArcsTitle).style("opacity",le(Rf.data.targets)?1:0),rh&&(Qf.event&&"zoom"===Qf.event.type&&zj.extent(Hg.orgDomain()).update(),F&&(!Ah&&Mh&&kb(lj.subx,c.axisSubX,Mh),zj.empty()||zj.extent(Hg.orgDomain()).update(),P=ef($,!0),x=Hj.selectAll("."+g.bars).selectAll("."+g.bar).data(we),x.enter().append("path").attr("class",fd).style("stroke","none").style("fill",gj),x.style("opacity",xd).transition().duration(T).attr("d",P).style("opacity",1),x.exit().transition().duration(T).style("opacity",0).remove(),w=Hj.selectAll("."+g.lines).selectAll("."+g.line).data(ue),w.enter().append("path").attr("class",bd).style("stroke",gj),w.style("opacity",xd).transition().duration(T).attr("d",Bj).style("opacity",1),w.exit().transition().duration(T).style("opacity",0).remove())),Gj.selectAll("."+g.selectedCircles).filter(function(a){return pe(a)}).selectAll("circle").remove(),Gj.selectAll("."+g.selectedCircle).transition().duration(T).attr("cx",Ah?ae:_d).attr("cy",Ah?_d:ae),bg&&(y=Gj.select("."+g.eventRects),Ge(Sg)&&!tc(Sg)?(y.classed(g.eventRectsMultiple)||y.classed(g.eventRectsMultiple,!0).classed(g.eventRectsSingle,!1).selectAll("."+g.eventRect).remove(),z=Gj.select("."+g.eventRects).selectAll("."+g.eventRect).data([0]),of(z.enter()),z.attr("x",0).attr("y",0).attr("width",kg).attr("height",mg)):(y.classed(g.eventRectsSingle)||y.classed(g.eventRectsMultiple,!1).classed(g.eventRectsSingle,!0).selectAll("."+g.eventRect).remove(),!_i&&!Zi||$i?(D=Q(),C=function(a){return Hg(a.x)-D/2}):(D=function(a,b){var c=Cc(b),d=Dc(b),e=Rf.data.xs[a.id][b];return(Hg(d?d:1.1*e)-Hg(c?c:.9*e))/2},C=function(a,b){var c=Cc(b),d=Rf.data.xs[a.id][b];return(Hg(d)+Hg(c?c:.9*d))/2}),A=Fc(Rf.data.targets),Gj.select("."+g.eventRects).datum(A?A.values:[]),z=Gj.select("."+g.eventRects).selectAll("."+g.eventRect).data(function(a){return a}),nf(z.enter()),z.attr("class",md).attr("x",Ah?0:C).attr("y",Ah?C:0).attr("width",Ah?kg:D).attr("height",Ah?D:mg),z.exit().remove())),Hc(Rf.data.targets).forEach(function(a){Nj[a]=!0})}function vf(){uf({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}function wf(){if(0!==Mc(Rf.data.targets).length){if("mousemove"===Qf.event.sourceEvent.type&&Dj.altDomain)return Hg.domain(Dj.altDomain),void Dj.scale(Hg).updateScaleExtent();$i&&Hg.orgDomain()[0]===Lj[0]&&Hg.domain([Lj[0]-1e-10,Hg.orgDomain()[1]]),uf({withTransition:!1,withY:!1,withSubchart:!1}),"mousemove"===Qf.event.sourceEvent.type&&(cj=!0)}}function xf(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a}function yf(){Ej.attr("width",og).attr("height",pg),Ej.select("#"+Ti).select("rect").attr("width",kg).attr("height",mg),Ej.select("#"+Ui).select("rect").attr("x",G).attr("y",H).attr("width",M).attr("height",N),Ej.select("#"+Vi).select("rect").attr("x",I).attr("y",J).attr("width",O).attr("height",P),Ej.select("."+g.zoomRect).attr("width",kg).attr("height",mg),Kj.style("max-height",pg+"px")}function zf(a){return{axisX:a?lj.x.transition().duration(a):lj.x,axisY:a?lj.y.transition().duration(a):lj.y,axisY2:a?lj.y2.transition().duration(a):lj.y2,axisSubX:a?lj.subx.transition().duration(a):lj.subx}}function Af(a){var b;a=a||{},a.withTransition=Ke(a,"withTransition",!0),a.withTransform=Ke(a,"withTransform",!1),a.withLegend=Ke(a,"withLegend",!1),a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.withTransitionForExit=!1,a.withLegend&&uh||(b=zf(a.withTransitionForAxis?gg:0),p(),W(),yf(),o(a.withTransition,b)),uf(a,b)}function Bf(a){var b,c,d,e,f,h,i,j,k,l,m,n;i=Gj.select("."+g.chartTexts).selectAll("."+g.chartText).data(a).attr("class",od),j=i.enter().append("g").attr("class",od).style("opacity",0).style("pointer-events","none"),j.append("g").attr("class",$c),e=Gj.select("."+g.chartBars).selectAll("."+g.chartBar).data(a).attr("class",qd),d=e.enter().append("g").attr("class",qd).style("opacity",0).style("pointer-events","none"),d.append("g").attr("class",gd).style("cursor",function(a){return ih(a)?"pointer":null}),c=Gj.select("."+g.chartLines).selectAll("."+g.chartLine).data(a).attr("class",pd),b=c.enter().append("g").attr("class",pd).style("opacity",0).style("pointer-events","none"),b.append("g").attr("class",cd),b.append("g").attr("class",kd),b.append("g").attr("class",function(a){return Yc(g.selectedCircles,a.id)}),b.append("g").attr("class",ed).style("cursor",function(a){return ih(a)?"pointer":null}),a.forEach(function(a){Gj.selectAll("."+g.selectedCircles+sd(a.id)).selectAll("."+g.selectedCircle).each(function(b){b.value=a.values[b.index].value})}),h=Gj.select("."+g.chartArcs).selectAll("."+g.chartArc).data(yg(a)).attr("class",rd),f=h.enter().append("g").attr("class",rd),f.append("g").attr("class",id),f.append("text").attr("dy",".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none"),rh&&(n=Hj.select("."+g.chartBars).selectAll("."+g.chartBar).data(a).attr("class",qd),m=n.enter().append("g").style("opacity",0).attr("class",qd),m.append("g").attr("class",gd),l=Hj.select("."+g.chartLines).selectAll("."+g.chartLine).data(a).attr("class",pd),k=l.enter().append("g").style("opacity",0).attr("class",pd),k.append("g").attr("class",cd)),Ej.selectAll("."+g.target).filter(function(a){return Kc(a.id)}).transition().duration(gg).style("opacity",1)}function Cf(a,b){b.filter&&(a=a.filter(b.filter)),(b.type||b.types)&&a.forEach(function(a){b.types?ge(a.id,b.types[a.id]):ge(a.id,b.type)}),Rf.data.targets.forEach(function(b){for(var c=0;cf&&(f=(m-l)/2,z=0,F++)),E[a]=F,D[F]=f,A[a]=z,z+=l}var f,h,i=Me(b.textContent,g.legendItem),j=10*Math.ceil((i.width+v)/10),k=10*Math.ceil((i.height+u)/10),l=rj?k:j,m=rj?V():U();return d&&(z=0,F=0,w=0,x=0),uh&&!Lc(c)?void(B[c]=C[c]=E[c]=A[c]=0):(B[c]=j,C[c]=k,(!w||j>=w)&&(w=j),(!x||k>=x)&&(x=k),h=rj?x:w,void(zh?(Object.keys(B).forEach(function(a){B[a]=w}),Object.keys(C).forEach(function(a){C[a]=x}),f=(m-h*a.length)/2,y>f?(z=0,F=0,a.forEach(function(a){e(a)})):e(c,!0)):e(c)))}var f,h,i,j,k,l,m,n,q,r,s,t,u=4,v=26,w=0,x=0,y=10,z=0,A={},B={},C={},D=[0],E={},F=0,G=Ij.selectAll("."+g.legendItemFocused).size();b=b||{},n=Ke(b,"withTransition",!0),q=Ke(b,"withTransitionForTransform",!0),rj?(f=function(a){return w*E[a]},j=function(a){return D[E[a]]+A[a]}):(f=function(a){return D[E[a]]+A[a]},j=function(a){return x*E[a]}),h=function(a,b){return f(a,b)+14},k=function(a,b){return j(a,b)+9},i=function(a,b){return f(a,b)-4},l=function(a,b){return j(a,b)-7},m=Ij.selectAll("."+g.legendItem).data(a).enter().append("g").attr("class",function(a){return Yc(g.legendItem,a)}).style("visibility",function(a){return Lc(a)?"visible":"hidden"}).style("cursor","pointer").on("click",function(a){"function"==typeof wh?wh(a):Rf.toggle(a)}).on("mouseover",function(a){Qf.select(this).classed(g.legendItemFocused,!0),ej||Rf.focus(a),"function"==typeof xh&&xh(a)}).on("mouseout",function(a){Qf.select(this).classed(g.legendItemFocused,!1),ej||Rf.revert(),"function"==typeof yh&&yh(a)}),m.append("text").text(function(a){return d(Vg[a])?Vg[a]:a}).each(function(a,b){e(this,a,0===b)}).style("pointer-events","none").attr("x",rj?h:-200).attr("y",rj?-200:k),m.append("rect").attr("class",g.legendItemEvent).style("fill-opacity",0).attr("x",rj?i:-200).attr("y",rj?-200:l),m.append("rect").attr("class",g.legendItemTile).style("pointer-events","none").style("fill",gj).attr("x",rj?h:-200).attr("y",rj?-200:j).attr("width",10).attr("height",10),r=Ij.selectAll("text").data(a).text(function(a){return d(Vg[a])?Vg[a]:a}).each(function(a,b){e(this,a,0===b)}),(n?r.transition():r).attr("x",h).attr("y",k),s=Ij.selectAll("rect."+g.legendItemEvent).data(a),(n?s.transition():s).attr("width",function(a){return B[a]}).attr("height",function(a){return C[a]}).attr("x",i).attr("y",l),t=Ij.selectAll("rect."+g.legendItemTile).data(a),(n?t.transition():t).style("fill",gj).attr("x",f).attr("y",j),Ij.selectAll("."+g.legendItem).classed(g.legendItemHidden,function(a){return!Kc(a)}).transition().style("opacity",function(a){var b=Qf.select(this);return Kc(a)?!G||b.classed(g.legendItemFocused)?Ff(b):Gf(b):vj}),S(w),T(x),R(F),p(),W(),yf(),o(q,c)}function Mf(a){return Jc(Rf.data.targets,a.id)}function Nf(a){return"data"in a&&Jc(Rf.data.targets,a.data.id)}function Of(a){var b=a&&a.value?a.value:null,c=a&&a["class"]?a["class"]:null;return b?function(a){return a.value!==b}:c?function(a){return a["class"]!==c}:function(){return!0}}function Pf(a,b,c){var d=!me(Rf.data.targets);ej=!1,ge(a,b),Af(c||{withTransitionForAxis:d})}var Qf=a.d3?a.d3:"undefined"!=typeof require?require("d3"):void 0,Rf={data:{},axis:{},legend:{}},Sf={},Tf=i(["bindto"],"#chart"),Uf=i(["size","width"]),Vf=i(["size","height"]),Wf=i(["padding","left"]),Xf=i(["padding","right"]),Yf=i(["padding","top"]),Zf=i(["padding","bottom"]),$f=i(["zoom","enabled"],!1),_f=i(["zoom","extent"]),ag=i(["zoom","privileged"],!1),bg=i(["interaction","enabled"],!0),cg=i(["onenter"],function(){}),dg=i(["onleave"],function(){}),eg=i(["onresize"],function(){}),fg=i(["onresized"],function(){}),gg=i(["transition","duration"],350);h("data","data is required in config");var hg,ig,jg,kg,lg,mg,ng,og,pg,qg,rg,sg,tg,ug,vg,wg,xg,yg,zg,Ag,Bg,Cg,Dg,Eg,Fg,Gg,Hg,Ig,Jg,Kg,Lg,Mg,Ng,Og,Pg,Qg,Rg=i(["data","x"]),Sg=i(["data","xs"],{}),Tg=i(["data","x_format"]),Ug=i(["data","id_converter"],function(a){return a}),Vg=i(["data","names"],{}),Wg=i(["data","classes"],{}),Xg=i(["data","groups"],[]),Yg=i(["data","axes"],{}),Zg=i(["data","type"]),$g=i(["data","types"],{}),_g=i(["data","labels"],{}),ah=i(["data","order"]),bh=i(["data","regions"],{}),ch=i(["data","color"]),dh=i(["data","colors"],{}),eh=i(["data","hide"],!1),fh=i(["data","filter"]),gh=i(["data","selection","enabled"],!1),hh=i(["data","selection","grouped"],!1),ih=i(["data","selection","isselectable"],function(){return!0}),jh=i(["data","selection","multiple"],!0),kh=i(["data","onclick"],function(){}),lh=i(["data","onenter"],function(){}),mh=i(["data","onleave"],function(){}),nh=i(["data","onselected"],function(){}),oh=i(["data","onunselected"],function(){}),ph=i(["data","ondragstart"],function(){}),qh=i(["data","ondragend"],function(){}),rh=i(["subchart","show"],!1),sh=i(["subchart","size","height"],60),th=i(["color","pattern"],[]),uh=i(["legend","show"],!0),vh=i(["legend","position"],"bottom"),wh=i(["legend","item","onclick"]),xh=i(["legend","item","onmouseover"]),yh=i(["legend","item","onmouseout"]),zh=i(["legend","equally"],!1),Ah=i(["axis","rotated"],!1),Bh=i(["axis","x","show"],!0),Ch=i(["axis","x","type"],"indexed"),Dh=i(["axis","x","localtime"],!0),Eh=i(["axis","x","categories"],[]),Fh=i(["axis","x","tick","centered"],!1),Gh=i(["axis","x","tick","format"]),Hh=i(["axis","x","tick","culling"],{}),Ih=i(["axis","x","tick","culling","max"],10),Jh=i(["axis","x","tick","count"]),Kh=i(["axis","x","tick","fit"],!0),Lh=i(["axis","x","tick","values"],null),Mh=i(["axis","x","tick","rotate"]),Nh=i(["axis","x","max"],null),Oh=i(["axis","x","min"],null),Ph=i(["axis","x","padding"],{}),Qh=i(["axis","x","height"]),Rh=i(["axis","x","default"]),Sh=i(["axis","x","label"],{}),Th=i(["axis","y","show"],!0),Uh=i(["axis","y","max"]),Vh=i(["axis","y","min"]),Wh=i(["axis","y","center"]),Xh=i(["axis","y","label"],{}),Yh=i(["axis","y","inner"],!1),Zh=i(["axis","y","tick","format"]),$h=i(["axis","y","padding"]),_h=i(["axis","y","ticks"],10),ai=i(["axis","y2","show"],!1),bi=i(["axis","y2","max"]),ci=i(["axis","y2","min"]),di=i(["axis","y2","center"]),ei=i(["axis","y2","label"],{}),fi=i(["axis","y2","inner"],!1),gi=i(["axis","y2","tick","format"]),hi=i(["axis","y2","padding"]),ii=i(["axis","y2","ticks"],10),ji=i(["grid","x","show"],!1),ki=i(["grid","x","type"],"tick"),li=i(["grid","x","lines"],[]),mi=i(["grid","y","show"],!1),ni=i(["grid","y","lines"],[]),oi=i(["grid","y","ticks"],10),pi=i(["point","show"],!0),qi=i(["point","r"],2.5),ri=i(["point","focus","line","enabled"],!0),si=i(["point","focus","expand","enabled"],!0),ti=i(["point","focus","expand","r"]),ui=i(["point","focus","select","r"]),vi=i(["line","connect_null"],!1),wi=i(["bar","width"]),xi=i(["bar","width","ratio"],.6),yi=i(["pie","label","show"],!0),zi=i(["pie","label","format"]),Ai=i(["pie","expand"],!0),Bi=i(["pie","onclick"],function(){}),Ci=i(["pie","onmouseover"],function(){}),Di=i(["pie","onmouseout"],function(){}),Ei=i(["donut","label","show"],!0),Fi=i(["donut","label","format"]),Gi=i(["donut","expand"],!0),Hi=i(["donut","title"],""),Ii=i(["donut","onclick"],function(){}),Ji=i(["donut","onmouseover"],function(){}),Ki=i(["donut","onmouseout"],function(){}),Li=i(["regions"],[]),Mi=i(["tooltip","show"],!0),Ni=i(["tooltip","format","title"]),Oi=i(["tooltip","format","value"]),Pi=i(["tooltip","contents"],function(a,b,c,d){var e,f,h,i,j,k=Ni?Ni:b,l=Oi?Oi:c;for(f=0;f"+(h||0===h?""+h+"":"")),j=a[f].name,i=l(a[f].value,a[f].ratio,a[f].id,a[f].index),e+="",e+=""+j+"",e+=""+i+"",e+=""); return e+""}),Qi=i(["tooltip","init","show"],!1),Ri=i(["tooltip","init","x"],0),Si=i(["tooltip","init","position"],{top:"0px",left:"50px"}),Ti="c3-"+ +new Date+"-clip",Ui=Ti+"-xaxis",Vi=Ti+"-yaxis",Wi=j(Ti),Xi=j(Ui),Yi=j(Vi),Zi="timeseries"===Ch,$i="categorized"===Ch,_i=!Zi&&(Rg||Ge(Sg)),aj=null,bj=!1,cj=!1,dj=!1,ej=!1,fj=Qf.scale.category10().range(),gj=Ae(dh,Ge(th)?th:fj,ch),hj=Dh?Qf.time.format:Qf.time.format.utc,ij=hj.multi([[".%L",function(a){return a.getMilliseconds()}],[":%S",function(a){return a.getSeconds()}],["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%-m/%-d",function(a){return a.getDay()&&1!==a.getDate()}],["%-m/%-d",function(a){return 1!==a.getDate()}],["%-m/%-d",function(a){return a.getMonth()}],["%Y/%-m/%-d",function(){return!0}]]),jj=[],kj=[],lj={},mj=Ah?"left":"bottom",nj=Ah?Yh?"top":"bottom":Yh?"right":"left",oj=Ah?fi?"bottom":"top":fi?"left":"right",pj=Ah?"left":"bottom",qj={main:function(){return"translate("+k(hg.left)+","+k(hg.top)+")"},context:function(){return"translate("+k(ig.left)+","+k(ig.top)+")"},legend:function(){return"translate("+jg.left+","+jg.top+")"},x:function(){return"translate(0,"+(Ah?0:mg)+")"},y:function(){return"translate(0,"+(Ah?mg:0)+")"},y2:function(){return"translate("+(Ah?0:kg)+","+(Ah?1:0)+")"},subx:function(){return"translate(0,"+(Ah?0:ng)+")"},arc:function(){return"translate("+tg/2+","+ug/2+")"}},rj="right"===vh,sj=0,tj=0,uj=0,vj=.15,wj=30,xj=Ah&&!Bh?0:30,yj=5;yg=Qf.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)});var zj,Aj=df(!1),Bj=df(!0),Cj=function(){var a;return a=Ah?Qf.svg.area().x0(function(a){return _(a.id)(0)}).x1(function(a){return _(a.id)(a.value)}).y(Jd):Qf.svg.area().x(Jd).y0(function(a){return _(a.id)(0)}).y1(function(a){return _(a.id)(a.value)}),function(b){var c,d,e=Ve(b.values);return he([b],"area")||he([b],"area-spline")?(a.interpolate(oe(b)?"cardinal":"linear"),a(e)):(c=e[0]?Hg(e[0].x):0,d=e[0]?_(b.id)(e[0].value):0,Ah?"M "+d+" "+c:"M "+c+" "+d)}}(),Dj=function(){};zj=Qf.svg.brush().on("brush",vf),zj.update=function(){return Hj&&Hj.select("."+g.brush).call(this),this},zj.scale=function(a){return Ah?this.y(a):this.x(a)},$f&&(Dj=Qf.behavior.zoom().on("zoomstart",function(){Dj.altDomain=Qf.event.sourceEvent.altKey?Hg.orgDomain():null}).on("zoom",$f?wf:null),Dj.scale=function(a){return Ah?this.y(a):this.x(a)},Dj.orgScaleExtent=function(){var a=_f?_f:[1,10];return[a[0],Math.max(Ec()/a[1],a[1])]},Dj.updateScaleExtent=function(){var a=fc(Hg.orgDomain())/fc(Lj),b=this.orgScaleExtent();return this.scaleExtent([b[0]*a,b[1]*a]),this});var Ej,Fj,Gj,Hj,Ij,Jj,Kj,Lj,Mj,Nj={};if(Rf.focus=function(a){function b(a){Mc(a).transition().duration(100).style("opacity",1)}var c=Ej.selectAll(td(a)),d=c.filter(Mf),e=c.filter(Nf);Rf.revert(),Rf.defocus(),b(d.classed(g.focused,!0)),b(e),me(Rf.data.targets)&&Sb(a,!0),Hf(a,!0)},Rf.defocus=function(a){function b(a){Mc(a).transition().duration(100).style("opacity",.3)}var c=Ej.selectAll(td(a)),d=c.filter(Mf),e=c.filter(Nf);Rf.revert(),b(d.classed(g.focused,!1)),b(e),me(Rf.data.targets)&&Tb(a),Hf(a,!1)},Rf.revert=function(a){function b(a){Mc(a).transition().duration(100).style("opacity",1)}var c=Ej.selectAll(td(a)),d=c.filter(Mf),e=c.filter(Nf);b(d.classed(g.focused,!1)),b(e),me(Rf.data.targets)&&Tb(a),If()},Rf.show=function(a,b){a=Ic(a),b=b||{},Qc(a),Ej.selectAll(ud(a)).transition().style("opacity",1),b.withLegend&&Jf(a),uf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},Rf.hide=function(a,b){a=Ic(a),b=b||{},Pc(a),Ej.selectAll(ud(a)).transition().style("opacity",0),b.withLegend&&Kf(a),uf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},Rf.toggle=function(a){Kc(a)?Rf.hide(a):Rf.show(a)},Rf.unzoom=function(){zj.clear().update(),uf({withUpdateXDomain:!0})},Rf.load=function(a){return a.xs&&sc(a.xs),"classes"in a&&Object.keys(a.classes).forEach(function(b){Wg[b]=a.classes[b]}),"categories"in a&&$i&&(Eh=a.categories,Ng.categories(Eh)),"cacheIds"in a&&gc(a.cacheIds)?void Cf(ic(a.cacheIds),a.done):void("unload"in a?Ef(Ic("boolean"==typeof a.unload&&a.unload?null:a.unload),function(){Df(a)}):Df(a))},Rf.unload=function(a,b){Ef(Ic(a),function(){uf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),"function"==typeof b&&b()})},Rf.selected=function(a){return Qf.merge(Gj.selectAll("."+g.shapes+sd(a)).selectAll("."+g.shape).filter(function(){return Qf.select(this).classed(g.SELECTED)}).map(function(a){return a.map(function(a){var b=a.__data__;return b.data?b.data:b})}))},Rf.select=function(a,b,c){gh&&Gj.selectAll("."+g.shapes).selectAll("."+g.shape).each(function(e,f){var h=Qf.select(this),i=e.data?e.data.id:e.id,j=Ue(this),k=hh||!a||a.indexOf(i)>=0,l=!b||b.indexOf(f)>=0,m=h.classed(g.SELECTED);h.classed(g.line)||h.classed(g.area)||(k&&l?ih(e)&&!m&&j(!0,h.classed(g.SELECTED,!0),e,f):d(c)&&c&&m&&j(!1,h.classed(g.SELECTED,!1),e,f))})},Rf.unselect=function(a,b){gh&&Gj.selectAll("."+g.shapes).selectAll("."+g.shape).each(function(c,d){var e=Qf.select(this),f=c.data?c.data.id:c.id,h=Ue(this),i=hh||!a||a.indexOf(f)>=0,j=!b||b.indexOf(d)>=0,k=e.classed(g.SELECTED);e.classed(g.line)||e.classed(g.area)||i&&j&&ih(c)&&k&&h(!1,e.classed(g.SELECTED,!1),c,d)})},Rf.toLine=function(a){Pf(a,"line")},Rf.toSpline=function(a){Pf(a,"spline")},Rf.toBar=function(a){Pf(a,"bar")},Rf.toScatter=function(a){Pf(a,"scatter")},Rf.toArea=function(a){Pf(a,"area")},Rf.toAreaSpline=function(a){Pf(a,"area-spline")},Rf.toPie=function(a){Pf(a,"pie",{withTransform:!0})},Rf.toDonut=function(a){Pf(a,"donut",{withTransform:!0})},Rf.groups=function(a){return c(a)?Xg:(Xg=a,uf(),Xg)},Rf.xgrids=function(a){return a?(li=a,uf(),li):li},Rf.xgrids.add=function(a){return a?Rf.xgrids(li.concat(a)):void 0},Rf.xgrids.remove=function(a){var b=Of(a);return Rf.xgrids(li.filter(b))},Rf.ygrids=function(a){return a?(ni=a,uf(),ni):ni},Rf.ygrids.add=function(a){return a?Rf.ygrids(ni.concat(a)):void 0},Rf.ygrids.remove=function(a){var b=Of(a);return Rf.ygrids(ni.filter(b))},Rf.regions=function(a){return a?(Li=a,uf(),Li):Li},Rf.regions.add=function(a){return a?(Li=Li.concat(a),uf(),Li):Li},Rf.regions.remove=function(a){var b,c,d;return a=a||{},b=Ke(a,"duration",gg),c=Ke(a,"classes",[g.region]),d=Gj.select("."+g.regions).selectAll(c.map(function(a){return"."+a})),(b?d.transition().duration(b):d).style("opacity",0).remove(),Li=Li.filter(function(a){var b=!1;return a.class?(a.class.split(" ").forEach(function(a){c.indexOf(a)>=0&&(b=!0)}),!b):!0})},Rf.data.get=function(a){var b=Rf.data.getAsTarget(a);return d(b)?b.values.map(function(a){return a.value}):void 0},Rf.data.getAsTarget=function(a){var b=Rf.data.targets.filter(function(b){return b.id===a});return b.length>0?b[0]:void 0},Rf.data.names=function(a){return arguments.length?(Object.keys(a).forEach(function(b){Vg[b]=a[b]}),uf({withLegend:!0}),Vg):Vg},Rf.data.colors=function(a){return arguments.length?(Object.keys(a).forEach(function(b){dh[b]=a[b]}),uf({withLegend:!0}),dh):dh},Rf.x=function(a){return arguments.length&&(vc(Rf.data.targets,a),uf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),Rf.data.xs},Rf.xs=function(a){return arguments.length&&(wc(Rf.data.targets,a),uf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),Rf.data.xs},Rf.axis.labels=function(a){arguments.length&&(Object.keys(a).forEach(function(b){hb(b,a[b])}),Jb())},Rf.axis.max=function(a){arguments.length&&("object"==typeof a?(b(a.x)&&(Nh=+a.x),b(a.y)&&(Uh=+a.y),b(a.y2)&&(bi=+a.y2)):Uh=bi=+a,uf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))},Rf.axis.min=function(a){arguments.length&&("object"==typeof a?(b(a.x)&&(Oh=+a.x),b(a.y)&&(Vh=+a.y),b(a.y2)&&(ci=+a.y2)):Vh=ci=+a,uf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))},Rf.axis.range=function(a){arguments.length&&("undefined"!=typeof a.max&&Rf.axis.max(a.max),"undefined"!=typeof a.min&&Rf.axis.min(a.min))},Rf.legend.show=function(a){Jf(Ic(a)),uf({withLegend:!0})},Rf.legend.hide=function(a){Kf(Ic(a)),uf({withLegend:!0})},Rf.resize=function(a){Uf=a?a.width:null,Vf=a?a.height:null,Rf.flush(),Rf.flush()},Rf.flush=function(){Af({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},Rf.destroy=function(){Rf.data.targets=void 0,Rf.data.xs={},Kj.classed("c3",!1).html(""),a.onresize=null},"url"in f.data)Qf.xhr(f.data.url,function(a,b){var c,d=Qf.csv.parseRows(b.response);1===d.length?(c=[{}],d[0].forEach(function(a){c[0][a]=null})):c=Qf.csv.parse(b.response),mf(c)});else if("rows"in f.data)mf(yc(f.data.rows));else{if(!("columns"in f.data))throw Error("url or rows or columns is required.");mf(zc(f.data.columns))}return Rf},"function"==typeof define&&define.amd?define("c3",["d3"],f):"undefined"!=typeof exports&&"undefined"!=typeof module?module.exports=f:a.c3=f}(window);