!function(a){"use strict";functionb(a){returna||0===a}functionc(a){return"undefined"==typeofa}functiond(a){return"undefined"!=typeofa}vare={version:"0.1.33"},f={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",region:"c3-region",regions:"c3-regions",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",area:"c3-area",text:"c3-text",texts:"c3-texts",grid:"c3-grid",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",legendItemHidden:"c3-legend-item-hidden",legendItemFocused:"c3-legend-item-focused",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"};e.generate=function(e){functiong(a,b){if(!(aine))throwError(b)}functionh(a,b){varc,d,f,g=e;for(c=0;c<a.length;c++){if("object"==typeofg&&!(a[c]ing))returnb;if(d=c===a.length-1,f=g[a[c]],!d&&"object"!=typeoff)returnb;g=f}returng}functioni(a){return"url("+document.URL.split("#")[0]+"#"+a+")"}functionj(a,b){varc,d,e;b&&b.axisX?c=b.axisX:(c=gj.select("."+f.axisX),a&&(c=c.transition())),b&&b.axisY?d=b.axisY:(d=gj.select("."+f.axisY),a&&(d=d.transition())),b&&b.axisY2?e=b.axisY2:(e=gj.select("."+f.axisY2),a&&(e=e.transition())),gj.attr("transform",Si.main),c.attr("transform",Si.x),d.attr("transform",Si.y),e.attr("transform",Si.y2),gj.select("."+f.chartArcs).attr("transform",Si.arc)}functionk(a,b){varc;b&&b.axisSubX?c=b.axisSubX:(c=hj.select("."+f.axisX),a&&(c=c.transition())),hj.attr("transform",Si.context),c.attr("transform",Si.subx)}functionl(a){(a?ij.transition():ij).attr("transform",Si.legend)}functionm(a,b){j(a,b),Ug&&k(a,b),l(a)}functionn(){vara=Q(),b=P(),c=Ti?0:a,d=bh?0:w("x"),e=Ug?Vg+d:0;Uf=r(),Vf=s(),bh?(Nf={top:w("y2"),right:u(),bottom:w("y")+c,left:e+t()},Of={top:Nf.top,right:0/0,bottom:20+c,left:Yi}):(Nf={top:4,right:u(),bottom:d+e+c,left:t()},Of={top:Vf-e-c,right:0/0,bottom:d+c,left:Nf.left}),Pf={top:Ti?0:Vf-a,right:0/0,bottom:0,left:Ti?Uf-b:0},Qf=Uf-Nf.left-Nf.right,Sf=Vf-Nf.top-Nf.bottom,0>Qf&&(Qf=0),0>Sf&&(Sf=0),Rf=bh?Nf.left-Yi-Zi:Qf,Tf=bh?Sf:Vf-Of.top-Of.bottom,0>Rf&&(Rf=0),0>Tf&&(Tf=0),p(),Ti&&ee(yf.data.targets)&&(Pf.left=Qf/2+Xf)}functiono(){gj.select("line."+f.xgridFocus).attr("x1",bh?0:-10).attr("x2",bh?Qf:-10).attr("y1",bh?-10:Nf.top).attr("y2",bh?-10:Sf)}functionp(){Xf=Sf/2,Wf=.95*Xf,Yf=de(yf.data.targets)?.6*Wf:0}functionq(){vara=bh?f.axisX:f.axisY,b=gj.select("."+a).node(),c=b?b.getBoundingClientRect():{right:0},d=xf.select(Af).node().getBoundingClientRect(),e=c.right-d.left-t();returne>0?e:0}functionr(){returnBf?Bf:x()}functions(){vara=Cf?Cf:y();returna>0?a:320}functiont(){returnee(yf.data.targets)?0:Df?Df:bh?ch?v("x"):1:!uh||zh?1:v("y")}functionu(){vara=1;returnee(yf.data.targets)?0:Ef?Ef:Ti?P()+(Dh&&!bh?v("y2"):a):Dh?Ih||bh?a:v("y2"):a}functionv(a){varb=jb(a);returnb.isInner?20+Cb(a):40+Cb(a)}functionw(a){return"x"!==a||ch?"x"===a&&rh?rh:"y"!==a||uh?"y2"!==a||Dh?(jb(a).isInner?30:40)+("y2"===a?-10:0):$i:Xg&&!Ti?10:1:0}functionx(){return+xf.select(Af).style("width").replace("px","")}functiony(){return+xf.select(Af).style("height").replace("px","")}functionz(a){returna?-5:-(Nf.left-1)}functionA(a){returna?-20:-4}functionB(){returnz(!bh)}functionC(){returnA(!bh)}functionD(){returnz(bh)}functionE(){returnA(bh)}functionF(a){returna?Qf+2+4:Nf.left+20}functionG(a){returna?(rh?rh:0)+80:Sf+8}functionH(){returnF(!bh)}functionI(){returnG(!bh)}functionJ(){returnF(bh)}functionK(){returnG(bh)}functionL(){vara,b,c,d,e,f=Ac(yf.data.targets);returnf?(a=f.values[0],b=f.values[f.values.length-1],c=jg(b.x)-jg(a.x),0===c?bh?Sf:Qf:(d=zc(),e=ae(yf.data.targets)?(d-(Bi?.25:1))/d:1,d>1?c*e/(d-1):c)):0}functionM(a){Ui=a}functionN(a){Vi=a}functionO(a){Wi=a}functionP(){returnXg?Ti?Vi*(Ui+1):Uf:0}functionQ(){returnXg?Ti?Vf:Wi*(Ui+1):0}functionR(){vara,b,c=!jg;bg=bh?1:0,cg=bh?Sf:Qf,dg=bh?0:Sf,eg=bh?Qf:1,fg=bg,gg=cg,hg=bh?0:Tf,ig=bh?Rf:1,jg=T(bg,cg,c?void0:jg.domain(),function(){returnpg.tickOffset()}),kg=U(dg,eg,c?void0:kg.domain()),lg=U(dg,eg,c?void0:lg.domain()),mg=T(bg,cg,lj,function(a){returna%1?0:sg.tickOffset()}),ng=U(hg,ig,c?void0:ng.domain()),og=U(hg,ig,c?void0:og.domain()),a=$(),b=mh?mh:c?void0:pg.tickValues(),pg=X(jg,Oi,a,b),sg=X(mg,Ri,a,b),qg=Y(kg,Pi,Ah,Ch),rg=Y(lg,Qi,Jh,Lh),c||(_i.scale(mg),Ff&&dj.scale(jg)),S()}functionS(){Zf=Gb(),$f=Hb(),_f=Hb(.98)}functionT(a,b,d,e){varf=(Ai?xf.time.scale():xf.scale.linear()).range([a,b]);if(f.orgDomain=function(){returnf.domain()},d&&f.domain(d),c(e)&&(e=function(){return0}),Bi){varg,h=f;f=function(a){returnh(a)+e(a)};for(ginh)f[g]=h[g];f.orgDomain=function(){returnh.domain()},f.domain=function(a){returnarguments.length?(h.domain(a),f):(a=h.domain(),[a[0],a[1]+1])}}returnf}functionU(a,b,c){vard=xf.scale.linear().range([a,b]);returnc&&d.domain(c),d}functionV(a){return"y2"===Z(a)?lg:kg}functionW(a){return"y2"===Z(a)?og:ng}functionX(a,b,c,d){vare=(Bi?Eb():xf.svg.axis()).scale(a).orient(b);returne.tickFormat(c).tickValues(d),Bi?(e.tickCentered(gh),ve(ih)&&(ih=!1)):e.tickOffset=function(){vara=Bc(yf.data.targets),b=jg(a[1])-jg(a[0]),c=b?b:bh?Sf:Qf;returnc/zc()/2},Bi&&e.categories(fh),e}functionY(a,b,c,d){returnxf.svg.axis().scale(a).orient(b).tickFormat(c).ticks(d).outerTickSize(0)}functionZ(a){returnainAg?Ag[a]:"y"}function$(){vara=Ai?Li:Bi?Tc:function(a){return0>a?a.toFixed(0):a};returnhh&&("function"==typeofhh?a=hh:Ai&&(a=function(a){returna?Ki(hh)(a):""})),a}function_(a){varb;return"y"===a?b=yh:"y2"===a?b=Hh:"x"===a&&(b=th),b}functionab(a){varb=_(a);return"string"==typeofb?b:b?b.text:null}functionbb(a,b){varc=_(a);"string"==typeofc?"y"===a?yh=b:"y2"===a?Hh=b:"x"===a&&(th=b):c&&(c.text=b)}functioncb(a){return10*Math.sin(Math.PI*(a/180))}functiondb(a){return11.5-2.5*(a/15)}functioneb(a,b,c){a.selectAll(".tick text").style("text-anchor","start"),b.selectAll(".tick text").attr("y",db(c)).attr("x",cb(c)).attr("transform","rotate("+c+")")}functionfb(a,b){varc=_(a),d=c&&"object"==typeofc&&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}}functiongb(){returnfb("x",bh?"inner-top":"inner-right")}functionhb(){returnfb("y",bh?"inner-right":"inner-top")}functionib(){returnfb("y2",bh?"inner-right":"inner-top")}functionjb(a){return"y2"===a?ib():"y"===a?hb():gb()}functionkb(){returnab("x")}functionlb(){returnab("y")}functionmb(){returnab("y2")}functionnb(a,b){returna?b.isLeft?0:b.isCenter?Qf/2:Qf:b.isBottom?-Sf:b.isMiddle?-Sf/2:0}functionob(a,b){returna?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"}functionpb(a,b){returna?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"}functionqb(){returnnb(!bh,gb())}functionrb(){returnnb(bh,hb())}functionsb(){returnnb(bh,ib())}functiontb(){returnob(!bh,gb())}functionub(){returnob(bh,hb())}functionvb(){returnob(bh,ib())}functionwb(){vara=gb();returnbh?a.isInner?"1.2em":-25-Cb("x"):a.isInner?"-0.5em":rh?rh-10:"3em"}functionxb(){vara=hb();returnbh?a.isInner?"-0.5em":"3em":a.isInner?"1.2em":-20-Cb("y")}functionyb(){vara=ib();returnbh?a.isInner?"1.2em":"-2.2em":a.isInner?"-0.5em":30+Cb("y2")}functionzb(){returnpb(!bh,gb())}functionAb(){returnpb(bh,hb())}functionBb(){returnpb(bh,ib())}functionCb(a){varb=0,c="x"===a?f.axisX:"y"===a?f.axisY:f.axisY2;returnxf.selectAll("."+c+" .tick text").each(function(){vara=this.getBoundingClientRect();b<a.width&&(b=a.width)}),0>b?0:b}functionDb(){gj.select("."+f.axisX+" ."+f.axisXLabel).transition().attr("x",qb).attr("dx",tb).attr("dy",wb).text(kb),gj.select("."+f.axisY+" ."+f.axisYLabel).transition().attr("x",rb).attr("dx",ub).attr("dy",xb).attr("dy",xb).text(lb),gj.select("."+f.axisY2+" ."+f.axisY2Label).transition().attr("x",sb).attr("dx",vb).attr("dy",yb).text(mb)}functionEb(){functiona(a,b){a.attr("transform",function(a){return"translate("+(b(a)+p)+", 0)"})}functionb(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}functionc(a){varb=a[0],c=a[a.length-1];returnc>b?[b,c]:[c,b]}functiond(a){for(varb=[],c=Math.ceil(a[0]);c<a[1];c++)b.push(c);returnb.length>0&&b[0]>0&&b.unshift(b[0]-(b[1]-b[0])),b}functione(a){returna<s.length?s[a]:a}functionf(a){varb=e(a);returnq?q(b):b}functiong(){vara=i.copy(),b=i.domain();returna.domain([b[0],b[1]-1]),a}functionh(e){e.each(function(){vare,h,o,q,r,s,t,u,v=xf.select(this),w=g(),x=this.__chart__||w,y=v.selectAll(".tick.major").data(d(w.domain()),String),z=y.enter().insert("g","path").attr("class","tick major").style("opacity",1e-6),A=xf.transition(y.exit()).style("opacity",1e-6).remove(),B=xf.transition(y).style("opacity",1),C=i.rangeExtent?i.rangeExtent():c(i.range()),D=v.selectAll(".domain").data([0]);switch(D.enter().append("path").attr("class","domain"),o=xf.transition(D),z.append("line"),z.append("text"),q=z.select("line"),r=B.select("line"),s=y.select("text"),t=z.select("text"),u=B.select("text"),p=(w(1)-w(0))/2,h=n?0:p,this.__chart__=w,j){case"bottom":e=a,q.attr("y2",k),t.attr("y",Math.max(k,0)+m),r.attr("x1",h).attr("x2",h).attr("y2",k),u.attr("x",0).attr("y",Math.max(k,0)+m),s.attr("dy",".71em").style("text-anchor","middle"),s.text(f),o.attr("d","M"+C[0]+","+l+"V0H"+C[1]+"V"+l);break;case"left":e=b,q.attr("x2",-k),t.attr("x",-(Math.max(k,0)+m)),r.attr("x2",-k).attr("y2",0),u.attr("x",-(Math.max(k,0)+m)).attr("y",p),s.attr("dy",".32em").style("text-anchor","end"),s.text(f),o.attr("d","M"+-l+","+C[0]+"H0V"+C[1]+"H"+-l)}if(i.ticks)z.call(e,x),B.call(e,w),A.call(e,w);else{varE=w.rangeBand()/2,F=function(a){returnw(a)+E};z.call(e,F),B.call(e,F)}})}vari=xf.scale.linear(),j="bottom",k=6,l=6,m=3,n=!1,o=10,p=0,q=null,r=!0,s=[];returnh.scale=function(a){returnarguments.length?(i=a,h):i},h.orient=function(a){returnarguments.length?(j=ain{top:1,right:1,bottom:1,left:1}?a+"":"bottom",h):j},h.categories=function(a){returnarguments.length?(s=a,h):s},h.tickCentered=function(a){returnarguments.length?(n=a,h):n},h.tickFormat=function(a){returnarguments.length?(q=a,h):q},h.tickOffset=function(){returnp},h.ticks=function(a){returnarguments.length?(o=a,h):o},h.tickCulling=function(a){returnarguments.length?(r=a,h):r},h.tickValues=function(){},h}functionFb(a){varb=!1;returnag(Ic(yf.data.targets)).forEach(function(c){returnb||c.data.id!==a.data.id?void0:(b=!0,void(a=c))}),b?a:null}functionGb(){vara=xf.svg.arc().outerRadius(Wf).innerRadius(Yf),b=function(b,c){vard;returnc?a(b):(d=Fb(b),d?a(d):"M 0 0")};returnb.centroid=a.centroid,b}functionHb(a){varb=xf.svg.arc().outerRadius(Xf*(a?a:1)).innerRadius(Yf);returnfunction(a){varc=Fb(a);returnc?b(c):"M 0 0"}}functionIb(a,b){returnle(a.data)?Zf(a,b):"M 0 0"}functionJb(a){varb,c,d,e,f=Fb(a),g="";returnf&&(b=Zf.centroid(f),c=b[0],d=b[1],e=Math.sqrt(c*c+d*d),g="translate("+c/e*Wf*.8+","+d/e*Wf*.8+")"),g}functionKb(a){returna?(a.endAngle-a.startAngle)/(2*Math.PI):null}functionLb(a){returnpc({id:a.data.id,value:a.value,ratio:Kb(a)})}functionMb(a){varb,c,d,e;returnPb()?(b=Fb(a),c=b?b.value:null,d=Kb(b),e=Qb(),e?e(c,d):Ad(c,d)):""}functionNb(a,b){varc=ej.selectAll("."+f.chartArc+md(a)),d=ej.selectAll("."+f.arc).filter(function(b){returnb.data.id!==a});pe(a)&&c.selectAll("path").transition().duration(50).attr("d",$f).transition().duration(100).attr("d",_f).each(function(a){ke(a.data)}),b||d.style("opacity",.3)}functionOb(a){varb=ej.selectAll("."+f.chartArc+md(a));b.selectAll("path").transition().duration(50).attr("d",Zf),ej.selectAll("."+f.arc).style("opacity",1)}functionPb(){returnde(yf.data.targets)?fi:_h}functionQb(){returnde(yf.data.targets)?gi:ai}functionRb(){returnde(yf.data.targets)?ii:""}functionSb(){vara=de(yf.data.targets)?ji:ci;return"function"==typeofa?a:function(){}}functionTb(){vara=de(yf.data.targets)?ki:di;return"function"==typeofa?a:function(){}}functionUb(){vara=de(yf.data.targets)?li:ei;return"function"==typeofa?a:function(){}}functionVb(a){varb,c,d,e,f,g,h=Cc(a),i=Pc(a);if(zg.length>0)for(g=Rc(a),b=0;b<zg.length;b++)if(e=zg[b].filter(function(a){returnh.indexOf(a)>=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;c<e.length;c++)f=e[c],i[f]&&i[f].forEach(function(a,b){Z(f)!==Z(d)||!i[d]||g&&+a>0||(i[d][b]+=+a)});returnxf.min(Object.keys(i).map(function(a){returnxf.min(i[a])}))}functionWb(a){varb,c,d,e,f,g,h=Cc(a),i=Pc(a);if(zg.length>0)for(g=Sc(a),b=0;b<zg.length;b++)if(e=zg[b].filter(function(a){returnh.indexOf(a)>=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<e.length;c++)f=e[c],i[f]&&i[f].forEach(function(a,b){Z(f)!==Z(d)||!i[d]||g&&0>+a||(i[d][b]+=+a)});returnxf.max(Object.keys(i).map(function(a){returnxf.max(i[a])}))}functionXb(a,c){vard,e,f,g,h,i,j,k,l=a.filter(function(a){returnZ(a.id)===c}),m="y2"===c?Fh:wh,n="y2"===c?Eh:vh,o=b(m)?m:Vb(l),p=b(n)?n:Wb(l),q="y2"===c?Gh:xh,r=ud()&&bh;return0===l.length?"y2"===c?lg.domain():kg.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=vd(o,p),j=ac(kg.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&&Bh&&(f=b(Bh.top)?Bh.top:e,g=b(Bh.bottom)?Bh.bottom:e),"y2"===c&&Kh&&(f=b(Kh.top)?Kh.top:e,g=b(Kh.bottom)?Kh.bottom:e),ae(l)&&!Rc(l)&&(g=o),[o-g,p+f])}functionYb(a){returnph?Ai?re(ph):ph:xf.min(a,function(a){returnxf.min(a.values,function(a){returna.x})})}functionZb(a){returnoh?Ai?re(oh):oh:xf.max(a,function(a){returnxf.max(a.values,function(a){returna.x})})}function$b(a){varc,d,e,f,g=Bc(a),h=g[1]-g[0];returnBi?d=0:ae(a)?(c=zc(),d=c>1?h/(c-1)/2:.5):d=.01*h,"object"==typeofqh&&we(qh)?(e=b(qh.left)?qh.left:d,f=b(qh.right)?qh.right:d):e=f="number"==typeofqh?qh:d,{left:e,right:f}}function_b(a){varb=[Yb(a),Zb(a)],c=b[0],d=b[1],e=$b(a),f=0,g=0;returnc-d===0&&(c=Ai?newDate(.5*c.getTime()):-.5,d=Ai?newDate(1.5*d.getTime()):.5),(c||0===c)&&(f=Ai?newDate(c.getTime()-e.left):c-e.left),(d||0===d)&&(g=Ai?newDate(d.getTime()+e.right):d+e.right),[f,g]}functionac(a){returna[1]-a[0]}functionbc(a){for(varb=0;b<a.length;b++)if(!(a[b]inzf))return!1;return!0}functioncc(a,b){zf[a]=wc(b)}functiondc(a){for(varb=[],c=0;c<a.length;c++)a[c]inzf&&b.push(wc(zf[a[c]]));returnb}functionec(a){varb,c="y"===a.axis?kg:lg;returnb="y"===a.axis||"y2"===a.axis?bh?"start"ina?c(a.start):0:0:bh?0:"start"ina?jg(Ai?re(a.start):a.start):0}functionfc(a){varb,c="y"===a.axis?kg:lg;returnb="y"===a.axis||"y2"===a.axis?bh?0:"end"ina?c(a.end):0:bh?"start"ina?jg(Ai?re(a.start):a.start):0:0}functiongc(a){varb,c=ec(a),d="y"===a.axis?kg:lg;returnb="y"===a.axis||"y2"===a.axis?bh?"end"ina?d(a.end):Qf:Qf:bh?Qf:"end"ina?jg(Ai?re(a.end):a.end):Qf,c>b?0:b-c}functionhc(a){varb,c=fc(a),d="y"===a.axis?kg:lg;returnb="y"===a.axis||"y2"===a.axis?bh?Sf:"start"ina?d(a.start):Sf:bh?"end"ina?jg(Ai?re(a.end):a.end):Sf:Sf,c>b?0:b-c}functionic(a){returntg&&a===tg||we(ug)&&xe(ug,a)}functionjc(a){return!ic(a)}functionkc(a){returntg?tg:we(ug)?ug[a]:null}functionlc(a,b){varc,d=b&&we(b)?Cc(b):[];returnd.forEach(function(b){kc(b)===a&&(c=yf.data.xs[b])}),c}functionmc(a,b){returnainyf.data.xs&&yf.data.xs[a]&&yf.data.xs[a][b]?yf.data.xs[a][b]:b}functionnc(a){Object.keys(a).forEach(function(b){ug[b]=a[b]})}functionoc(a){return1===xf.set(Object.keys(a).map(function(b){returna[b]})).size()}functionpc(a){varb;returna&&(b=xg[a.id],a.name=b?b:a.id),a}functionqc(a,b){a.forEach(function(a){a.values.forEach(function(c,d){c.x=sc(b[d],a.id,d)}),yf.data.xs[a.id]=b})}functionrc(a,b){a.forEach(function(a){b[a.id]&&qc([a],b[a.id])})}functionsc(a,c,d){vare;returne=Ai?a?ainstanceofDate?a:re(a):re(mc(c,d)):Ci&&!Bi?b(a)?+a:mc(c,d):d}functiontc(a){varb,c,d=a[0],e={},f=[];for(b=1;b<a.length;b++){for(e={},c=0;c<a[b].length;c++)e[d[c]]=a[b][c];f.push(e)}returnf}functionuc(a){varb,d,e,f=[];for(b=0;b<a.length;b++)for(e=a[b][0],d=1;d<a[b].length;d++)c(f[d-1])&&(f[d-1]={}),f[d-1][e]=a[b][d];returnf}functionvc(a){varc,d=xf.keys(a[0]).filter(jc),e=xf.keys(a[0]).filter(ic);returnd.forEach(function(c){vard,f=kc(c);Ci||Ai?e.indexOf(f)>=0?yf.data.xs[c]=a.map(function(a){returna[f]}).filter(b):tg?(d=Object.keys(yf.data.xs),yf.data.xs[c]=d.length>0?yf.data.xs[d[0]]:void0):we(ug)&&(yf.data.xs[c]=lc(f,yf.data.targets)):yf.data.xs[c]=a.map(function(a,b){returnb})}),d.forEach(function(a){if(!yf.data.xs[a])thrownewError('x is not defined for id = "'+a+'".')}),c=d.map(function(b,c){vard=wg(b);return{id:d,id_org:b,values:a.map(function(a,e){varf=kc(b),g=a[f],h=sc(g,b,e);returnCi&&Bi&&0===c&&g&&(0===e&&(fh=[]),fh.push(g)),("undefined"==typeofa[b]||yf.data.xs[b].length<=e)&&(h=void0),{x:h,value:null===a[b]||isNaN(a[b])?null:+a[b],id:d}}).filter(function(a){return"undefined"!=typeofa.x})}}),c.forEach(function(a){varb;a.values=a.values.sort(function(a,b){varc=a.x||0===a.x?a.x:1/0,d=b.x||0===b.x?b.x:1/0;returnc-d}),b=0,a.values.forEach(function(a){a.index=b++})}),Bg&&$d(Cc(c).filter(function(a){return!(ainCg)}),Bg),c.forEach(function(a){cc(a.id_org,a)}),c}functionwc(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}})}}functionxc(a){returna>0&&yf.data.targets[0].values[a-1]?yf.data.targets[0].values[a-1].x:void0}functionyc(a){returna<zc()-1?yf.data.targets[0].values[a+1].x:void0}functionzc(){returnxf.max(yf.data.targets,function(a){returna.values.length})}functionAc(a){varb,c=a.length,d=0;returnc>1?a.forEach(function(a){a.values.length>d&&(b=a,d=a.values.length)}):b=c?a[0]:null,b}functionBc(a){varb,c,d=Ac(a);returnd?(b=d.values[0],c=d.values[d.values.length-1],[b.x,c.x]):[0,0]}functionCc(a){returna.map(function(a){returna.id})}functionDc(a){returna?"string"==typeofa?[a]:a:Cc(yf.data.targets)}functionEc(a,b){varc,d=Cc(a);for(c=0;c<d.length;c++)if(d[c]===b)return!0;return!1}functionFc(a){returnd(a)?yf.data.targets.filter(a):yf.data.targets}functionGc(a){returnMi.indexOf(a)<0}functionHc(a){returnNi.indexOf(a)<0}functionIc(a){returna.filter(function(a){returnGc(a.id)})}functionJc(a){varb=xf.set(xf.merge(a.map(function(a){returna.values.map(function(a){returna.x})}))).values();returnb.map(Ai?function(a){returnnewDate(a)}:function(a){return+a})}functionKc(a,b){varc,d,e,f,g,h,i,j=a;if(b)if(c="function"==typeofb?b():b,1===c)j=[a[0]];elseif(2===c)j=[a[0],a[a.length-1]];elseif(c>2){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(Ai?newDate(i):i);j.push(e)}returnAi||(j=j.sort(function(a,b){returna-b})),j}functionLc(a){Mi=Mi.concat(a)}functionMc(a){Mi=Mi.filter(function(b){returna.indexOf(b)<0})}functionNc(a){Ni=Ni.concat(a)}functionOc(a){Ni=Ni.filter(function(b){returna.indexOf(b)<0})}functionPc(a){varb={};returna.forEach(function(a){b[a.id]=[],a.values.forEach(function(c){b[a.id].push(c.value)})}),b}functionQc(a,b){varc,d,e,f=Object.keys(a);for(c=0;c<f.length;c++)for(e=a[f[c]].values,d=0;d<e.length;d++)if(b(e[d].value))return!0;return!1}functionRc(a){returnQc(a,function(a){return0>a})}functionSc(a){returnQc(a,function(a){returna>0})}functionTc(a){returna<fh.length?fh[a]:a}functionUc(a,b){return" "+a+" "+a+ld(b)}functionVc(a){returnUc(f.text,a.id)}functionWc(a){returnUc(f.texts,a.id)}functionXc(a,b){returnUc(f.shape,b)}functionYc(a){returnUc(f.shapes,a.id)}functionZc(a){returnYc(a)+Uc(f.line,a.id)}function$c(a,b){returnXc(a,b)+Uc(f.circle,b)}function_c(a){returnYc(a)+Uc(f.circles,a.id)}functionad(a,b){returnXc(a,b)+Uc(f.bar,b)}functionbd(a){returnYc(a)+Uc(f.bars,a.id)}functioncd(a){returnYc(a.data)+Uc(f.arc,a.data.id)}functiondd(a){returnYc(a)+Uc(f.area,a.id)}functioned(a,b){returnUc(f.region,b)+" "+("class"ina?a.class:"")}functionfd(a,b){returnUc(f.eventRect,b)}functiongd(a){varb=yg[a],c="";returnb&&(c=" "+f.target+"-"+b),Uc(f.target,a)+c}functionhd(a){returnf.chartText+gd(a.id)}functionid(a){returnf.chartLine+gd(a.id)}functionjd(a){returnf.chartBar+gd(a.id)}functionkd(a){returnf.chartArc+gd(a.data.id)}functionld(a){returna||0===a?"-"+(a.replace?a.replace(/([^a-zA-Z0-9-_])/g,"-"):a):""}functionmd(a){return"."+f.target+ld(a)}functionnd(a){returna.length?a.map(function(a){returnmd(a)}):null}functionod(a){return"."+f.legendItem+ld(a)}functionpd(a){returna.length?a.map(function(a){returnod(a)}):null}functionqd(a){returnnull!==a.value&&nj[a.id]?1:0}functionrd(a){varb=td(a);returnqd(a)*b}functionsd(a){returnb(a.value)?ie(a)?.5:1:0}functiontd(){returnud()?1:0}functionud(){return"boolean"==typeofDg&&Dg?!0:"object"==typeofDg&&we(Dg)?!0:!1}functionvd(a,b){varc=[],d=1.3;returnkj.select("svg").selectAll(".dummy").data([a,b]).enter().append("text").text(function(a){returna}).each(function(a,b){c[b]=this.getBoundingClientRect().width*d}).remove(),c}functionwd(a){varb=a?Ad:xd,c=a?Ad:yd;returnfunction(a,d,e){varf="y2"===Z(e)?c:b;returnf(a,d)}}functionxd(a){varb=Ah?Ah:zd;returnb(a)}functionyd(a){varb=Jh?Jh:zd;returnb(a)}functionzd(a){returnb(a)?+a:""}functionAd(a,b){return(100*b).toFixed(1)+"%"}functionBd(a){varc=function(a){returnb(a)?+a:""},d=Z(a),e=c;return"function"==typeofDg.format?e=Dg.format:"object"==typeofDg.format&&"function"==typeofDg.format[d]&&(e=Dg.format[d]),e}functionCd(a){returna?jg(a.x):null}functionDd(a){returnjg(Ai?re(a.value):a.value)}functionEd(a){varb=a.axis&&"y2"===a.axis?lg:kg;returnb(a.value)}functionFd(a){returnmg(a.x)}functionGd(a,b){varc,d=a[b].x,e=[];for(c=b-1;c>=0&&d===a[c].x;c--)e.push(a[c]);for(c=b;c<a.length&&d===a[c].x;c++)e.push(a[c]);returne}functionHd(a,b,c,d){vare,f=c?c:0,g=d?d:a.length-1,h=Math.floor((g-f)/2)+f,i=a[h],j=jg(i.x)-b[bh?1:0];returnj>0?g=h:f=h,g-f===1||0===f&&0===g?(e=[],(a[f].x||0===a[f].x)&&(e=e.concat(Gd(a,f))),(a[g].x||0===a[g].x)&&(e=e.concat(Gd(a,g))),Jd(e,b)):Hd(a,b,f,g)}functionId(a,b){varc;returnc=a.map(function(a){returnHd(a.values,b)}),Jd(c,b)}functionJd(a,b){varc,d;returna.forEach(function(a){vare=ye(a,b);(c>e||!c)&&(c=e,d=a)}),d}functionKd(a,b){returnxf.merge(a.map(function(a){returna.values})).filter(function(a){returna.x-b===0})}functionLd(a){varb=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}}functionMd(){returnEg&&"desc"===Eg.toLowerCase()}functionNd(){returnEg&&"asc"===Eg.toLowerCase()}functionOd(a){varb=Nd(),c=Md();returnb||c?a.sort(function(a,c){vard=function(a,b){returna+Math.abs(b.value)},e=a.values.reduce(d,0),f=c.values.reduce(d,0);returnb?f-e:e-f}):"function"==typeofEg&&a.sort(Eg),a}functionPd(a,c){vard,e,f,g,h,i,j,k=ee(yf.data.targets),l=a.filter(function(a){returna&&b(a.value)});0!==l.length&&ni&&(jj.html(qi(a,$(),wd(k),Ji)).style("display","block"),d=jj.property("offsetWidth"),e=jj.property("offsetHeight"),k?(g=Qf/2+c[0],i=Sf/2+c[1]+20):(bh?(f=q(),g=f+c[0]+100,h=g+d,j=r()-u(),i=jg(l[0].x)+20):(f=q(),g=f+t()+jg(l[0].x)+20,h=g+d,j=f+r()-u(),i=c[1]+15),h>j&&(g-=d+60),i+e>s()&&(i-=e+30)),jj.style("top",i+"px").style("left",g+"px"))}functionQd(){jj.style("display","none")}functionRd(a){varc=a.filter(function(a){returna&&b(a.value)});ni&&(be(yf.data.targets)||ee(yf.data.targets)||gj.selectAll("line."+f.xgridFocus).style("visibility","visible").data([c[0]]).attr(bh?"y1":"x1",Cd).attr(bh?"y2":"x2",Cd))}functionSd(){gj.select("line."+f.xgridFocus).style("visibility","hidden")}functionTd(a){returna.x||0===a.x?jg(a.x):null}functionUd(a){returnV(a.id)(a.value)}functionVd(){vara,b,d={},e=0;returnIc(Fc(he)).forEach(function(f){for(a=0;a<zg.length;a++)if(!(zg[a].indexOf(f.id)<0))for(b=0;b<zg[a].length;b++)if(zg[a][b]ind){d[f.id]=d[zg[a][b]];break}c(d[f.id])&&(d[f.id]=e++)}),d.__max__=e-1,d}functionWd(a,b,c,d){vare=d?mg:jg;returnfunction(d){varf=d.idinc?c[d.id]:0;returnd.x||0===d.x?e(d.x)-a*(b/2-f):0}}functionXd(a){returnfunction(b){varc=a?W(b.id):V(b.id);returnc(b.value)}}functionYd(a,b){varc=Od(Ic(Fc(he))),d=c.map(function(a){returna.id});returnfunction(e,f){varg=b?W(e.id):V(e.id),h=g(0),i=h;returnc.forEach(function(b){b.id!==e.id&&a[b.id]===a[e.id]&&d.indexOf(b.id)<d.indexOf(e.id)&&b.values[f].value*e.value>0&&(i+=g(b.values[f].value)-h)}),i}}functionZd(a,b){return"number"==typeofZh?Zh:b?2*a.tickOffset()*$h/b:0}function$d(a,b){Dc(a).forEach(function(a){nj[a]=b===Cg[a],Cg[a]=b})}function_d(a,b){varc=!1;returna.forEach(function(a){Cg[a.id]===b&&(c=!0),a.idinCg||"line"!==b||(c=!0)}),c}functionae(a){return_d(a,"bar")}functionbe(a){return_d(a,"scatter")}functionce(a){return_d(a,"pie")}functionde(a){return_d(a,"donut")}functionee(a){returnce(a)||de(a)}functionfe(a){varb="string"==typeofa?a:a.id;return!(binCg)||"line"===Cg[b]||"spline"===Cg[b]||"area"===Cg[b]||"area-spline"===Cg[b]}functionge(a){varb="string"==typeofa?a:a.id;return"spline"===Cg[b]||"area-spline"===Cg[b]}functionhe(a){varb="string"==typeofa?a:a.id;return"bar"===Cg[b]}functionie(a){varb="string"==typeofa?a:a.id;return"scatter"===Cg[b]}functionje(a){varb="string"==typeofa?a:a.id;return"pie"===Cg[b]}functionke(a){varb="string"==typeofa?a:a.id;return"donut"===Cg[b]}functionle(a){returnje(a)||ke(a)}functionme(a){returnhe(a)?a.values:[]}functionne(a){returnfe(a)||ie(a)?a.values:[]}functionoe(a){returnhe(a)||fe(a)?a.values:[]}functionpe(a){returnke(a)&&hi||je(a)&&bi}functionqe(a,b,c){vard=[];returnfunction(e){varf,g=e.id||e;returna[g]instanceofFunction?f=a[g](e):gina?f=a[g]:(d.indexOf(g)<0&&d.push(g),f=b[d.indexOf(g)%b.length]),cinstanceofFunction?c(f,e):f}}functionre(b){varc;try{c=vg?xf.time.format(vg).parse(b):newDate(b)}catch(d){a.console.error("Failed to parse x '"+b+"' to Date with format "+vg)}returnc}functionse(a,b){varc=xf.mouse(a),d=xf.select(a),e=1*d.attr("cx"),f=1*d.attr("cy");returnMath.sqrt(Math.pow(e-c[0],2)+Math.pow(f-c[1],2))<b}functionte(a){varb=xf.mouse(a),c=a.getBoundingClientRect(),d=a.pathSegList.getItem(0),e=a.pathSegList.getItem(1),f=d.x,g=Math.min(d.y,e.y),h=c.width,i=c.height,j=2,k=f-j,l=f+h+j,m=g+i+j,n=g-j;returnk<b[0]&&b[0]<l&&n<b[1]&&b[1]<m}functionue(a,b){varc;for(c=0;c<b.length;c++)if(b[c].start<a&&a<=b[c].end)return!0;return!1}functionve(a){return!a||"string"==typeofa&&0===a.length||"object"==typeofa&&0===Object.keys(a).length}functionwe(a){returnObject.keys(a).length>0}functionxe(a,b){varc=!1;returnObject.keys(a).forEach(function(d){a[d]===b&&(c=!0)}),c}functionye(a,b){varc="y"===Z(a.id)?kg:lg,d=bh?1:0,e=bh?0:1;returnMath.pow(jg(a.x)-b[d],2)+Math.pow(c(a.value)-b[e],2)}functionze(a,b){varc=0;a.each(function(){++c}).each("end",function(){--c||b.apply(this,arguments)})}functionAe(a,b,c){Qg(b,a.node()),gj.select("."+f.selectedCircles+ld(b.id)).selectAll("."+f.selectedCircle+"-"+c).data([b]).enter().append("circle").attr("class",function(){returnUc(f.selectedCircle,c)}).attr("cx",bh?Ud:Td).attr("cy",bh?Td:Ud).attr("stroke",function(){returnJi(b)}).attr("r",1.4*Je(b)).transition().duration(100).attr("r",Je)}functionBe(a,b,c){Rg(b,a.node()),gj.select("."+f.selectedCircles+ld(b.id)).selectAll("."+f.selectedCircle+"-"+c).transition().duration(100).attr("r",0).remove()}functionCe(a,b,c,d){a?Ae(b,c,d):Be(b,c,d)}functionDe(a,b){Qg(b,a.node()),a.transition().duration(100).style("fill",function(){returnxf.rgb(Ji(b)).darker(1)})}functionEe(a,b){Rg(b,a.node()),a.transition().duration(100).style("fill",function(){returnJi(b)})}functionFe(a,b,c,d){a?De(b,c,d):Ee(b,c,d)}functionGe(a){returna.filter(function(a){returnb(a.value)})}functionHe(a){returnSh?"function"==typeofTh?Th(a):Th:0}functionIe(a){returnVh?Wh?Wh:1.75*He(a):He(a)}functionJe(a){returnXh?Xh:4*He(a)}functionKe(a,c){return(c?gj.selectAll("."+f.circles+ld(c)):gj).selectAll("."+f.circle+(b(a)?"-"+a:""))}functionLe(a,b){Ke(a,b).classed(f.EXPANDED,!0).attr("r",Ie)}functionMe(a){Ke(a).filter(function(){returnxf.select(this).classed(f.EXPANDED)}).classed(f.EXPANDED,!1).attr("r",He)}functionNe(a){returngj.selectAll("."+f.bar+(b(a)?"-"+a:""))}functionOe(a){Ne(a).classed(f.EXPANDED,!0)}functionPe(a){Ne(a).classed(f.EXPANDED,!1)}functionQe(a,b){varc=Ue(a,b);returnfunction(a,b){vard=c(a,b),e=bh?1:0,f=bh?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";returng}}functionRe(a,b){varc=Ue(a,!1),d=b?Se:Te;returnfunction(a,b){returnd(c(a,b),a,this)}}functionSe(a,b){varc;returnbh?(c=he(b)?4:6,a[2][1]+c*(b.value<0?-1:1)):a[0][0]+(a[2][0]-a[0][0])/2}functionTe(a,b,c){vard=c.getBoundingClientRect();returnbh?(a[0][0]+a[2][0]+.6*d.height)/2:a[2][1]+(b.value<0?d.height:he(b)?-3:-6)}functionUe(a,b){varc=a.__max__+1,d=Zd(pg,c),e=Wd(d,c,a,!!b),f=Xd(!!b),g=Yd(a,!!b),h=b?W:V;returnfunction(a,b){varc=h(a.id)(0),i=g(a,b)||c,j=e(a),k=f(a);returnbh&&(0<a.value&&c>k||a.value<0&&k>c)&&(k=c),[[j,i],[j,k-(c-i)],[j+d,k-(c-i)],[j+d,i]]}}functionVe(a,b,e,f){varg,h,i,j,k,l,m,n,o,p,q,r=-1,s="M",t=[];if(d(f))for(g=0;g<f.length;g++)t[g]={},t[g].start=c(f[g].start)?a[0].x:Ai?re(f[g].start):f[g].start,t[g].end=c(f[g].end)?a[a.length-1].x:Ai?re(f[g].end):f[g].end;for(p=bh?function(a){returne(a.value)}:function(a){returnb(a.x)},q=bh?function(a){returnb(a.x)}:function(a){returne(a.value)},i=Ai?function(a,c,d,f){varg=a.x.getTime(),h=c.x-a.x,i=newDate(g+h*d),j=newDate(g+h*(d+f));return"M"+b(i)+" "+e(k(d))+" "+b(j)+" "+e(k(d+f))}:function(a,c,d,f){return"M"+b(j(d))+" "+e(k(d))+" "+b(j(d+f))+" "+e(k(d+f))},g=0;g<a.length;g++){if(c(t)||!ue(a[g].x,t))s+=" "+p(a[g])+" "+q(a[g]);else{j=T(a[g-1].x,a[g].x),k=U(a[g-1].value,a[g].value),l=b(a[g].x)-b(a[g-1].x),m=e(a[g].value)-e(a[g-1].value),n=Math.sqrt(Math.pow(l,2)+Math.pow(m,2)),o=2/n;varu=2*o;for(h=o;1>=h;h+=u)s+=i(a[g-1],a[g],h,o)}r=a[g].x}returns}functionWe(b){varc,d,e;if(kj=xf.select(Af),kj.empty())thrownewError('Bind element not found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');if(kj.html("").classed("c3",!0),yf.data.xs={},yf.data.targets=vc(b),Ig&&Lc(Ig===!0?Cc(yf.data.targets):Ig),n(),R(),jg.domain(xf.extent(_b(yf.data.targets))),kg.domain(Xb(yf.data.targets,"y")),lg.domain(Xb(yf.data.targets,"y2")),mg.domain(jg.domain()),ng.domain(kg.domain()),og.domain(lg.domain()),lj=jg.domain(),_i.scale(mg),Ff&&dj.scale(jg),ej=kj.append("svg").attr("width",Qf+Nf.left+Nf.right).attr("height",Sf+Nf.top+Nf.bottom).on("mouseenter",If).on("mouseleave",Jf),fj=ej.append("defs"),fj.append("clipPath").attr("id",ui).append("rect").attr("width",Qf).attr("height",Sf),fj.append("clipPath").attr("id",vi).append("rect").attr("x",B).attr("y",C).attr("width",H).attr("height",I),fj.append("clipPath").attr("id",wi).append("rect").attr("x",D).attr("y",E).attr("width",J).attr("height",K),gj=ej.append("g").attr("transform",Si.main),hj=ej.append("g").attr("transform",Si.context),ij=ej.append("g").attr("transform",Si.legend),Ug||hj.style("visibility","hidden"),Xg||(ij.style("visibility","hidden"),Ni=Cc(yf.data.targets)),jj=xf.select(Af).style("position","relative").append("div").style("position","absolute").style("pointer-events","none").style("z-index","10").style("display","none"),sf(Cc(yf.data.targets),{withTransform:!1,withTransitionForTransform:!1}),d=gj.append("g").attr("clip-path",xi).attr("class",f.grid),Mh&&d.append("g").attr("class",f.xgrids),we(Oh)&&d.append("g").attr("class",f.xgridLines),Uh&&d.append("g").attr("class",f.xgridFocus).append("line").attr("class",f.xgridFocus),Ph&&d.append("g").attr("class",f.ygrids),we(Qh)&&d.append("g").attr("class",f.ygridLines),ch&&gj.append("g").attr("class",f.axisX).attr("clip-path",yi).attr("transform",Si.x).append("text").attr("class",f.axisXLabel).attr("transform",bh?"rotate(-90)":"").style("text-anchor",zb),uh&&gj.append("g").attr("class",f.axisY).attr("clip-path",zi).attr("transform",Si.y).append("text").attr("class",f.axisYLabel).attr("transform",bh?"":"rotate(-90)").style("text-anchor",Ab),Dh&&gj.append("g").attr("class",f.axisY2).attr("transform",Si.y2).append("text").attr("class",f.axisY2Label).attr("transform",bh?"":"rotate(-90)").style("text-anchor",Bb),gj.append("g").attr("clip-path",xi).attr("class",f.regions),gj.append("g").attr("clip-path",xi).attr("class",f.chart),c=gj.select("."+f.chart).append("g").attr("class",f.eventRects).style("fill-opacity",0).style("cursor",Ff?bh?"ns-resize":"ew-resize":null),gj.select("."+f.chart).append("g").attr("class",f.chartBars),gj.select("."+f.chart).append("g").attr("class",f.chartLines),gj.select("."+f.chart).append("g").attr("class",f.chartArcs).attr("transform",Si.arc).append("text").attr("class",f.chartArcsTitle).style("text-anchor","middle").text(Rb()),gj.select("."+f.chart).append("g").attr("class",f.chartTexts),Ff&&gj.insert("rect",Hf?null:"g."+f.grid).attr("class",f.zoomRect).attr("width",Qf).attr("height",Sf).style("opacity",0).style("cursor",bh?"ns-resize":"ew-resize").call(dj).on("dblclick.zoom",null),sh&&_i.extent("function"!=typeofsh?sh:sh(_b())),hj.append("g").attr("clip-path",xi).attr("class",f.chart),hj.select("."+f.chart).append("g").attr("class",f.chartBars),hj.select("."+f.chart).append("g").attr("class",f.chartLines),hj.append("g").attr("clip-path",xi).attr("class",f.brush).call(_i).selectAll("rect").attr(bh?"width":"height",bh?Rf:Tf),hj.append("g").attr("class",f.axisX).attr("transform",Si.subx).attr("clip-path",bh?"":yi),hf(yf.data.targets),bh?gj.select("."+f.axisX).style("opacity",0).call(pg):(gj.select("."+f.axisY).style("opacity",0).call(qg),gj.select("."+f.axisY2).style("opacity",0).call(rg)),n(),R(),ff(),m(!1),bf({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1}),ri){if(Ai&&"string"==typeofsi){for(si=re(si),e=0;e<yf.data.targets[0].values.length&&yf.data.targets[0].values[e].x-si!==0;e++);si=e
}jj.html(qi(yf.data.targets.map(function(a){returnpc(a.values[si])}),$(),wd(ee(yf.data.targets)),Ji)),jj.style("top",ti.top).style("left",ti.left).style("display","block")}null==a.onresize&&(a.onresize=ef()),a.onresize.add&&(a.onresize.add(Kf),a.onresize.add(function(){gf({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})}),a.onresize.add(Lf))}functionXe(a){a.append("rect").attr("class",fd).style("cursor",Jg&&Kg?"pointer":null).on("mouseover",function(a,b){if(!Ei&&!ee(yf.data.targets)){varc,d,e=yf.data.targets.map(function(a){returnpc(a.values[b])});if(Object.keys(xg).length>0){d=[];for(varginxg)for(c=0;c<e.length;c++)if(e[c].id===g){d.push(e[c]),e.shift(c);break}e=d.concat(e)}Vh&&Le(b),Oe(b),gj.selectAll("."+f.shape+"-"+b).each(function(a){Og(a)})}}).on("mouseout",function(a,b){ee(yf.data.targets)||(Sd(),Qd(),Me(b),Pe(),gj.selectAll("."+f.shape+"-"+b).each(function(a){Pg(a)}))}).on("mousemove",function(a,b){varc;Ei||ee(yf.data.targets)||(c=Ic(yf.data.targets).map(function(a){returnpc(a.values[b])}),Pd(c,xf.mouse(this)),Rd(c),Jg&&(Kg||gj.selectAll("."+f.shape+"-"+b).filter(function(a){returnLg(a)}).each(function(){vara=xf.select(this).classed(f.EXPANDED,!0);"circle"===this.nodeName&&a.attr("r",Ie),ej.select("."+f.eventRect+"-"+b).style("cursor",null)}).filter(function(a){return"circle"===this.nodeName?se(this,Je(a)):"path"===this.nodeName?te(this):void0}).each(function(){vara=xf.select(this);a.classed(f.EXPANDED)||(a.classed(f.EXPANDED,!0),"circle"===this.nodeName&&a.attr("r",Je)),ej.select("."+f.eventRect+"-"+b).style("cursor","pointer")})))}).on("click",function(a,b){returnee(yf.data.targets)?void0:Fi?void(Fi=!1):voidgj.selectAll("."+f.shape+"-"+b).each(function(a){Ze(this,a,b)})}).call(xf.behavior.drag().origin(Object).on("drag",function(){$e(xf.mouse(this))}).on("dragstart",function(){_e(xf.mouse(this))}).on("dragend",function(){af()})).call(dj).on("dblclick.zoom",null)}functionYe(a){a.append("rect").attr("x",0).attr("y",0).attr("width",Qf).attr("height",Sf).attr("class",f.eventRect).on("mouseout",function(){ee(yf.data.targets)||(Sd(),Qd(),Me())}).on("mousemove",function(){vara,b,c,d,e=Ic(yf.data.targets);Ei||ee(e)||(a=xf.mouse(this),b=Id(e,a),b&&(c=ie(b)?[b]:Kd(e,b.x),d=c.map(function(a){returnpc(a)}),Pd(d,a),Vh&&(Me(),Le(b.index,b.id)),Rd(d),ye(b,a)<100?(ej.select("."+f.eventRect).style("cursor","pointer"),Gi||(Og(b),Gi=!0)):(ej.select("."+f.eventRect).style("cursor",null),Pg(b),Gi=!1)))}).on("click",function(){vara,b,c=Ic(yf.data.targets);ee(c)||(a=xf.mouse(this),b=Id(c,a),b&&ye(b,a)<100&&gj.select("."+f.circles+"-"+ld(b.id)).select("."+f.circle+"-"+b.index).each(function(){Ze(this,b,b.index)}))}).call(xf.behavior.drag().origin(Object).on("drag",function(){$e(xf.mouse(this))}).on("dragstart",function(){_e(xf.mouse(this))}).on("dragend",function(){af()})).call(dj).on("dblclick.zoom",null)}functionZe(a,b,c){vard,e=xf.select(a),g=e.classed(f.SELECTED),h=!1;"circle"===a.nodeName?(h=se(a,1.5*Je(b)),d=Ce):"path"===a.nodeName&&(h=te(a),d=Fe),(Kg||h)&&(Jg&&Lg(b)&&(Mg||gj.selectAll("."+f.shapes+(Kg?ld(b.id):"")).selectAll("."+f.shape).each(function(a,b){varc=xf.select(this);c.classed(f.SELECTED)&&d(!1,c.classed(f.SELECTED,!1),a,b)}),e.classed(f.SELECTED,!g),d(!g,e,b,c)),Ng(b,a))}function$e(a){varb,c,d,e,g,h,i,j;ee(yf.data.targets)||Jg&&(!Ff||dj.altDomain)&&Mg&&(b=Di[0],c=Di[1],d=a[0],e=a[1],g=Math.min(b,d),h=Math.max(b,d),i=Kg?Nf.top:Math.min(c,e),j=Kg?Sf:Math.max(c,e),gj.select("."+f.dragarea).attr("x",g).attr("y",i).attr("width",h-g).attr("height",j-i),gj.selectAll("."+f.shapes).selectAll("."+f.shape).filter(function(a){returnLg(a)}).each(function(a,b){varc,d,e,k,l,m,n=xf.select(this),o=n.classed(f.SELECTED),p=n.classed(f.INCLUDED),q=!1;"circle"===this.nodeName?(c=1*n.attr("cx"),d=1*n.attr("cy"),l=Ce,q=c>g&&h>c&&d>i&&j>d):"path"===this.nodeName&&(m=Ld(this),c=m.x,d=m.y,e=m.width,k=m.height,l=Fe,q=!(c>h||g>c+e||d>j||i>d+k)),q^p&&(n.classed(f.INCLUDED,!p),n.classed(f.SELECTED,!o),l(!o,n,a,b))}))}function_e(a){ee(yf.data.targets)||Jg&&(Di=a,gj.select("."+f.chart).append("rect").attr("class",f.dragarea).style("opacity",.1),Ei=!0,Sg())}functionaf(){ee(yf.data.targets)||Jg&&(gj.select("."+f.dragarea).transition().duration(100).style("opacity",0).remove(),gj.selectAll("."+f.shape).classed(f.INCLUDED,!1),Ei=!1,Tg())}functionbf(a){varc,e,g,h,i,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,M,N,O,P,Q,R,S,T,U,V=Vd(),W=ee(yf.data.targets),X=Ic(yf.data.targets);if(a=d(a)?a:{},A=d(a.withY)?a.withY:!0,B=d(a.withSubchart)?a.withSubchart:!0,C=d(a.withTransition)?a.withTransition:!0,F=d(a.withTransform)?a.withTransform:!1,G=d(a.withUpdateXDomain)?a.withUpdateXDomain:!1,H=d(a.withUpdateOrgXDomain)?a.withUpdateOrgXDomain:!1,I=d(a.withLegend)?a.withLegend:!1,D=d(a.withTransitionForExit)?a.withTransitionForExit:C,E=d(a.withTransitionForAxis)?a.withTransitionForAxis:C,P=C?Mf:0,Q=D?P:0,R=E?P:0,c=gj.select("."+f.axisX).style("opacity",W?0:1),g=gj.select("."+f.axisY).style("opacity",W?0:1),h=gj.select("."+f.axisY2).style("opacity",W?0:1),e=hj.select("."+f.axisX).style("opacity",W?0:1),O={axisX:c.transition().duration(R),axisY:g.transition().duration(R),axisY2:h.transition().duration(R),axisSubX:e.transition().duration(R)},I&&Xg&&sf(Cc(yf.data.targets),a,O),Bi&&(0!==X.length&&H&&G||jg.domain([0,c.selectAll(".tick").size()])),X.length&&(H&&(jg.domain(xf.extent(_b(X))),lj=jg.domain(),Ff&&dj.scale(jg).updateScaleExtent(),mg.domain(jg.domain()),_i.scale(mg)),G&&(jg.domain(_i.empty()?lj:_i.extent()),Ff&&dj.scale(jg).updateScaleExtent()),mh||!lh&&!kh||(S=Kc(Jc(X),kh),pg.tickValues(S),sg.tickValues(S))),kg.domain(Xb(X,"y")),lg.domain(Xb(X,"y2")),O.axisX.call(pg),O.axisY.call(qg),O.axisY2.call(rg),O.axisSubX.call(sg),G&&X.length)if(ih&&S){for(T=1;T<S.length;T++)if(S.length/T<jh){U=T;break}xf.selectAll("."+f.axisX+" .tick text").each(function(a){varb=S.indexOf(a);b>=0&&xf.select(this).style("display",b%U?"none":"block")})}elsexf.selectAll("."+f.axisX+" .tick text").style("display","block");if(!bh&&nh&&eb(c,O.axisX,nh),J=Qe(V),M=Re(V,!0),N=Re(V,!1),Db(),ng.domain(kg.domain()),og.domain(lg.domain()),jj.style("display","none"),o(),gj.select("line."+f.xgridFocus).style("visibility","hidden"),Mh){if("year"===Nh){j=[];for(varY=_b(),Z=Y[0].getFullYear(),$=Y[1].getFullYear(),_=Z;$>=_;_++)j.push(newDate(_+"-01-01 00:00:00"))}elsej=jg.ticks(10);i=gj.select("."+f.xgrids).selectAll("."+f.xgrid).data(j),i.enter().append("line").attr("class",f.xgrid),i.attr("x1",bh?0:function(a){returnjg(a)-pg.tickOffset()}).attr("x2",bh?Qf:function(a){returnjg(a)-pg.tickOffset()}).attr("y1",bh?function(a){returnjg(a)-pg.tickOffset()}:Nf.top).attr("y2",bh?function(a){returnjg(a)-pg.tickOffset()}:Sf).style("opacity",function(){return+xf.select(this).attr(bh?"y1":"x1")===(bh?Sf:0)?0:1}),i.exit().remove()}we(Oh)&&(k=gj.select("."+f.xgridLines).selectAll("."+f.xgridLine).data(Oh),l=k.enter().append("g").attr("class",function(a){returnf.xgridLine+(a.class?a.class:"")}),l.append("line").style("opacity",0),l.append("text").attr("text-anchor","end").attr("transform",bh?"":"rotate(-90)").attr("dx",bh?0:-Nf.top).attr("dy",-5).style("opacity",0),k.select("line").transition().duration(P).attr("x1",bh?0:Dd).attr("x2",bh?Qf:Dd).attr("y1",bh?Dd:Nf.top).attr("y2",bh?Dd:Sf).style("opacity",1),k.select("text").transition().duration(P).attr("x",bh?Qf:0).attr("y",Dd).text(function(a){returna.text}).style("opacity",1),k.exit().transition().duration(P).style("opacity",0).remove()),A&&Ph&&(m=gj.select("."+f.ygrids).selectAll("."+f.ygrid).data(kg.ticks(Rh)),m.enter().append("line").attr("class",f.ygrid),m.attr("x1",bh?kg:0).attr("x2",bh?kg:Qf).attr("y1",bh?0:kg).attr("y2",bh?Sf:kg),m.exit().remove()),A&&we(Qh)&&(n=gj.select("."+f.ygridLines).selectAll("."+f.ygridLine).data(Qh),p=n.enter().append("g").attr("class",function(a){returnf.ygridLine+(a.class?a.class:"")}),p.append("line").style("opacity",0),p.append("text").attr("text-anchor","end").attr("transform",bh?"rotate(-90)":"").attr("dx",bh?0:-Nf.top).attr("dy",-5).style("opacity",0),n.select("line").transition().duration(P).attr("x1",bh?Ed:0).attr("x2",bh?Ed:Qf).attr("y1",bh?0:Ed).attr("y2",bh?Sf:Ed).style("opacity",1),n.select("text").transition().duration(P).attr("x",bh?0:Qf).attr("y",Ed).text(function(a){returna.text}).style("opacity",1),n.exit().transition().duration(P).style("opacity",0).remove()),s=gj.select("."+f.regions).selectAll("rect."+f.region).data(mi),s.enter().append("rect").style("fill-opacity",0),s.attr("class",ed).attr("x",ec).attr("y",fc).attr("width",gc).attr("height",hc).transition().duration(P).style("fill-opacity",function(a){returnb(a.opacity)?a.opacity:.1}),s.exit().transition().duration(P).style("fill-opacity",0).remove(),r=gj.selectAll("."+f.bars).selectAll("."+f.bar).data(me),r.enter().append("path").attr("d",J).style("stroke","none").style("opacity",0).style("fill",function(a){returnJi(a)}).attr("class",ad),r.style("opacity",qd).transition().duration(P).attr("d",J).style("opacity",1),r.exit().transition().duration(Q).style("opacity",0).remove(),t=gj.selectAll("."+f.texts).selectAll("."+f.text).data(oe),t.enter().append("text").attr("class",Vc).attr("text-anchor",function(a){returnbh?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill-opacity",0),t.text(function(a){returnBd(a.id)(a.value)}).style("fill-opacity",rd).transition().duration(P).attr("x",M).attr("y",N).style("fill-opacity",td),t.exit().transition().duration(Q).style("fill-opacity",0).remove(),gj.selectAll("."+f.line).style("opacity",qd).transition().duration(P).attr("d",aj).style("opacity",1),gj.selectAll("."+f.area).style("opacity",0).transition().duration(P).attr("d",bj).style("opacity",mj),q=gj.selectAll("."+f.circles).selectAll("."+f.circle).data(ne),q.enter().append("circle").attr("class",$c).style("opacity",0).attr("r",He),q.style("opacity",qd).transition().duration(P).style("opacity",sd).attr("cx",bh?Ud:Td).attr("cy",bh?Td:Ud),q.exit().remove(),gj.each(function(){Hi=!0}).selectAll("."+f.chartArc).select("."+f.arc).attr("transform",F?"scale(0)":"").style("opacity",function(a){returna===this._current?0:1}).transition().duration(P).attrTween("d",function(a){varb,c=Fb(a);returnc?(b=xf.interpolate(this._current,c),this._current=b(0),function(a){returnIb(b(a),!0)}):function(){return"M 0 0"}}).attr("transform",F?"scale(1)":"").style("opacity",1).call(ze,function(){Hi=!1}),gj.selectAll("."+f.chartArc).select("text").attr("transform",Jb).style("opacity",0).transition().duration(P).text(Mb).style("opacity",function(a){returnGc(a.data.id)&&le(a.data)?1:0}),gj.select("."+f.chartArcsTitle).style("opacity",de(yf.data.targets)?1:0),Ug&&(null!==xf.event&&"zoom"===xf.event.type&&_i.extent(jg.orgDomain()).update(),B&&(!bh&&nh&&eb(e,O.axisSubX,nh),_i.empty()||_i.extent(jg.orgDomain()).update(),K=Qe(V,!0),u=hj.selectAll("."+f.bars).selectAll("."+f.bar).data(me),u.enter().append("path").attr("d",K).style("stroke","none").style("fill",function(a){returnJi(a)}).attr("class",ad),u.style("opacity",qd).transition().duration(P).attr("d",K).style("opacity",1),u.exit().transition().duration(P).style("opacity",0).remove(),hj.selectAll("."+f.line).style("opacity",qd).transition().duration(P).attr("d",cj).style("opacity",1))),gj.selectAll("."+f.selectedCircles).filter(function(a){returnhe(a)}).selectAll("circle").remove(),gj.selectAll("."+f.selectedCircle).transition().duration(P).attr("cx",bh?Ud:Td).attr("cy",bh?Td:Ud),v=gj.select("."+f.eventRects),we(ug)&&!oc(ug)?(v.classed(f.eventRectsMultiple)||v.classed(f.eventRectsMultiple,!0).classed(f.eventRectsSingle,!1).selectAll("."+f.eventRect).remove(),w=gj.select("."+f.eventRects).selectAll("."+f.eventRect).data([0]),Ye(w.enter()),w.attr("x",0).attr("y",0).attr("width",Qf).attr("height",Sf)):(v.classed(f.eventRectsSingle)||v.classed(f.eventRectsMultiple,!1).classed(f.eventRectsSingle,!0).selectAll("."+f.eventRect).remove(),Ci&&!Bi?(z=function(a,b){varc=xc(b),d=yc(b),e=yf.data.xs[a.id][b];return(jg(d?d:e+50)-jg(c?c:e-50))/2},y=function(a,b){varc=xc(b),d=yf.data.xs[a.id][b];return(jg(d)+jg(c?c:d-50))/2}):(z=L(),y=function(a){returnjg(a.x)-z/2}),x=Ac(yf.data.targets),gj.select("."+f.eventRects).datum(x?x.values:[]),w=gj.select("."+f.eventRects).selectAll("."+f.eventRect).data(function(a){returna}),Xe(w.enter()),w.attr("class",fd).attr("x",bh?0:y).attr("y",bh?y:0).attr("width",bh?Qf:z).attr("height",bh?z:Sf),w.exit().remove()),Cc(yf.data.targets).forEach(function(a){nj[a]=!0})}functioncf(){bf({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}functiondf(){return"mousemove"===xf.event.sourceEvent.type&&dj.altDomain?(jg.domain(dj.altDomain),voiddj.scale(jg).updateScaleExtent()):(Bi&&jg.orgDomain()[0]===lj[0]&&jg.domain([lj[0]-1e-10,jg.orgDomain()[1]]),bf({withTransition:!1,withY:!1,withSubchart:!1}),void("mousemove"===xf.event.sourceEvent.type&&(Fi=!0)))}functionef(){functiona(){b.forEach(function(a){a()})}varb=[];returna.add=function(a){b.push(a)},a}functionff(){ej.attr("width",Uf).attr("height",Vf),ej.select("#"+ui).select("rect").attr("width",Qf).attr("height",Sf),ej.select("#"+vi).select("rect").attr("x",B).attr("y",C).attr("width",H).attr("height",I),ej.select("#"+wi).select("rect").attr("x",D).attr("y",E).attr("width",J).attr("height",K),ej.select("."+f.zoomRect).attr("width",Qf).attr("height",Sf),kj.style("max-height",Vf+"px")}functiongf(a){a=a||{},a.withTransition=d(a.withTransition)?a.withTransition:!0,a.withTransform=d(a.withTransform)?a.withTransform:!1,a.withLegend=d(a.withLegend)?a.withLegend:!1,a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.withTransitionForExit=!1,n(),R(),ff(),m(a.withTransition),bf(a)}functionhf(a){varb,c,d,e,g,h,i,j,k,l,m,n;i=gj.select("."+f.chartTexts).selectAll("."+f.chartText).data(a).attr("class",hd),j=i.enter().append("g").attr("class",hd).style("opacity",0).style("pointer-events","none"),j.append("g").attr("class",Wc).style("fill",function(a){returnJi(a)}),e=gj.select("."+f.chartBars).selectAll("."+f.chartBar).data(a).attr("class",jd),d=e.enter().append("g").attr("class",jd).style("opacity",0).style("pointer-events","none"),d.append("g").attr("class",bd).style("stroke","none").style("cursor",function(a){returnLg(a)?"pointer":null}),c=gj.select("."+f.chartLines).selectAll("."+f.chartLine).data(a).attr("class",id),b=c.enter().append("g").attr("class",id).style("opacity",0).style("pointer-events","none"),b.append("path").attr("class",Zc).style("opacity",0).style("stroke",function(a){returnJi(a)}),b.append("path").attr("class",dd).style("opacity",function(){returnmj=+xf.select(this).style("opacity"),0}).style("fill",function(a){returnJi(a)}),b.append("g").attr("class",function(a){returnUc(f.selectedCircles,a.id)}),b.append("g").attr("class",_c).style("fill",function(a){returnJi(a)}).style("cursor",function(a){returnLg(a)?"pointer":null}),a.forEach(function(a){gj.selectAll("."+f.selectedCircles+ld(a.id)).selectAll("."+f.selectedCircle).each(function(b,c){b.value=a.values[c].value})}),h=gj.select("."+f.chartArcs).selectAll("."+f.chartArc).data(ag(a)).attr("class",kd),g=h.enter().append("g").attr("class",kd),g.append("path").attr("class",cd).style("opacity",0).style("fill",function(a){returnJi(a.data)}).style("cursor",function(a){returnLg(a)?"pointer":null}).each(function(a){this._current=a}).on("mouseover",function(a,b){varc,d,e;Hi||(c=Fb(a),d=Lb(c),e=Tb(),Nb(c.data.id),of(c.data.id,!0),e(d,b))}).on("mousemove",function(a){varb=Fb(a),c=Lb(b),d=[c];Pd(d,xf.mouse(this))}).on("mouseout",function(a,b){varc,d,e;Hi||(c=Fb(a),d=Lb(c),e=Ub(),Ob(c.data.id),pf(),Qd(),e(d,b))}).on("click",function(a,b){varc=Fb(a),d=Lb(c),e=Sb();e(d,b)}),g.append("text").attr("dy",".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none"),Ug&&(n=hj.select("."+f.chartBars).selectAll("."+f.chartBar).data(a).attr("class",jd),m=n.enter().append("g").style("opacity",0).attr("class",jd),m.append("g").attr("class",bd).style("fill",function(a){returnJi(a)}),l=hj.select("."+f.chartLines).selectAll("."+f.chartLine).data(a).attr("class",id),k=l.enter().append("g").style("opacity",0).attr("class",id),k.append("path").attr("class",Zc).style("opacity",0).style("stroke",function(a){returnJi(a)})),ej.selectAll("."+f.target).filter(function(a){returnGc(a.id)}).transition().duration(Mf).style("opacity",1)}functionjf(a,b){(b.type||b.types)&&a.forEach(function(a){b.types?$d(a.id,b.types[a.id]):$d(a.id,b.type)}),yf.data.targets.forEach(function(b){for(varc=0;c<a.length;c++)if(b.id===a[c].id){b.values=a[c].values,a.splice(c,1);break}}),yf.data.targets=yf.data.targets.concat(a),hf(yf.data.targets),bf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),"function"==typeofb.done&&b.done()}functionkf(a){if("data"ina)jf(vc(a.data),a);elseif("url"ina)xf.csv(a.url,function(b,c){jf(vc(c),a)});elseif("rows"ina)jf(vc(tc(a.rows)),a);else{if(!("columns"ina))throwError("url or rows or columns is required.");jf(vc(uc(a.columns)),a)}}functionlf(a,b){return"function"!=typeofb&&(b=function(){}),a=a.filter(function(a){returnEc(yf.data.targets,a)}),a&&0!==a.length?(ej.selectAll(a.map(function(a){returnmd(a)})).transition().style("opacity",0).remove().call(ze,b),voida.forEach(function(a){nj[a]=!1,ij.selectAll("."+f.legendItem+ld(a)).remove(),yf.data.targets=yf.data.targets.filter(function(b){returnb.id!==a})})):voidb()}functionmf(a){returna.classed(f.legendItemHidden)?Xi:1}functionnf(a){returna.classed(f.legendItemHidden)?Xi:.3}functionof(a,b){ij.selectAll("."+f.legendItem).transition().duration(100).style("opacity",function(c){vard=xf.select(this);returna&&c!==a?b?nf(d):mf(d):b?mf(d):nf(d)})}functionpf(){ij.selectAll("."+f.legendItem).transition().duration(100).style("opacity",function(){returnmf(xf.select(this))})}functionqf(a){Xg||(Xg=!0,ij.style("visibility","visible")),Oc(a),ij.selectAll(pd(a)).style("visibility","visible").transition().style("opacity",function(){returnmf(xf.select(this))})}functionrf(a){Xg&&ve(a)&&(Xg=!1,ij.style("visibility","hidden")),Nc(a),ij.selectAll(pd(a)).style("opacity",0).style("visibility","hidden")}functionsf(a,b,c){functione(b,c,d){functione(a,b){b||(f=(l-w-k)/2,v>f&&(f=(l-k)/2,w=0,C++)),B[a]=C,A[C]=f,x[a]=w,w+=k}varf,g,h=b.getBoundingClientRect(),i=10*Math.ceil((h.width+s)/10),j=10*Math.ceil((h.height+r)/10),k=Ti?j:i,l=Ti?Q():P();returnd&&(w=0,C=0,t=0,u=0),Xg&&!Hc(c)?void(y[c]=z[c]=B[c]=x[c]=0):(y[c]=i,z[c]=j,(!t||i>=t)&&(t=i),(!u||j>=u)&&(u=j),g=Ti?u:t,void(ah?(Object.keys(y).forEach(function(a){y[a]=t}),Object.keys(z).forEach(function(a){z[a]=u}),f=(l-g*a.length)/2,v>f?(w=0,C=0,a.forEach(function(a){e(a)})):e(c,!0)):e(c)))}varg,h,i,j,k,l,o,p,q,r=4,s=26,t=0,u=0,v=10,w=0,x={},y={},z={},A=[0],B={},C=0,D=ij.selectAll("."+f.legendItemFocused).size();b=b||{},p=d(b.withTransition)?b.withTransition:!0,q=d(b.withTransitionForTransform)?b.withTransitionForTransform:!0,Ti?(g=function(a){returnt*(.2+B[a])},j=function(a){returnA[B[a]]+x[a]}):(g=function(a){returnA[B[a]]+x[a]},j=function(a){returnu*(.2+B[a])}),h=function(a,b){returng(a,b)+14},k=function(a,b){returnj(a,b)+9},i=function(a,b){returng(a,b)-4},l=function(a,b){returnj(a,b)-7},o=ij.selectAll("."+f.legendItem).data(a).enter().append("g").attr("class",function(a){returnUc(f.legendItem,a)}).style("visibility",function(a){returnHc(a)?"visible":"hidden"}).style("cursor","pointer").on("click",function(a){"function"==typeofZg?Zg(a):yf.toggle(a)}).on("mouseover",function(a){xf.select(this).classed(f.legendItemFocused,!0),Hi||yf.focus(a),"function"==typeof$g&&$g(a)}).on("mouseout",function(a){xf.select(this).classed(f.legendItemFocused,!1),Hi||yf.revert(),"function"==typeof_g&&_g(a)}),o.append("text").text(function(a){returnd(xg[a])?xg[a]:a}).each(function(a,b){e(this,a,0===b)}).style("pointer-events","none").attr("x",Ti?h:-200).attr("y",Ti?-200:k),o.append("rect").attr("class",f.legendItemEvent).style("fill-opacity",0).attr("x",Ti?i:-200).attr("y",Ti?-200:l).attr("width",function(a){returny[a]}).attr("height",function(a){returnz[a]}),o.append("rect").attr("class",f.legendItemTile).style("pointer-events","none").style("fill",function(a){returnJi(a)}).attr("x",Ti?h:-200).attr("y",Ti?-200:j).attr("width",10).attr("height",10),ij.selectAll("text").data(a).text(function(a){returnd(xg[a])?xg[a]:a}).each(function(a,b){e(this,a,0===b)}).transition().duration(p?250:0).attr("x",h).attr("y",k),ij.selectAll("rect."+f.legendItemEvent).data(a).transition().duration(p?250:0).attr("x",i).attr("y",l),ij.selectAll("rect."+f.legendItemTile).data(a).transition().duration(p?250:0).attr("x",g).attr("y",j),ij.selectAll("."+f.legendItem).classed(f.legendItemHidden,function(a){return!Gc(a)}).transition().style("opacity",function(a){varb=xf.select(this);returnGc(a)?!D||b.classed(f.legendItemFocused)?mf(b):nf(b):Xi}),N(t),O(u),M(C),n(),R(),ff(),m(q,c)}functiontf(a){returnEc(yf.data.targets,a.id)}functionuf(a){return"data"ina&&Ec(yf.data.targets,a.data.id)}functionvf(a){varb=a&&a.value?a.value:null,c=a&&a["class"]?a["class"]:null;returnb?function(a){returna.value!==b}:c?function(a){returna["class"]!==c}:function(){return!0}}functionwf(a,b,c){vard=!ee(yf.data.targets);Hi=!1,$d(a,b),gf(c||{withTransitionForAxis:d})}varxf=a.d3?a.d3:a.require?a.require("d3"):void0,yf={data:{},axis:{},legend:{}},zf={},Af=h(["bindto"],"#chart"),Bf=h(["size","width"]),Cf=h(["size","height"]),Df=h(["padding","left"],50),Ef=h(["padding","right"]),Ff=h(["zoom","enabled"],!1),Gf=h(["zoom","extent"]),Hf=h(["zoom","privileged"],!1),If=h(["onenter"],function(){}),Jf=h(["onleave"],function(){}),Kf=h(["onresize"],function(){}),Lf=h(["onresized"],function(){}),Mf=h(["transition","duration"],350);g("data","data is required in config");varNf,Of,Pf,Qf,Rf,Sf,Tf,Uf,Vf,Wf,Xf,Yf,Zf,$f,_f,ag,bg,cg,dg,eg,fg,gg,hg,ig,jg,kg,lg,mg,ng,og,pg,qg,rg,sg,tg=h(["data","x"]),ug=h(["data","xs"],{}),vg=h(["data","x_format"]),wg=h(["data","id_converter"],function(a){returna}),xg=h(["data","names"],{}),yg=h(["data","classes"],{}),zg=h(["data","groups"],[]),Ag=h(["data","axes"],{}),Bg=h(["data","type"]),Cg=h(["data","types"],{}),Dg=h(["data","labels"],{}),Eg=h(["data","order"]),Fg=h(["data","regions"],{}),Gg=h(["data","color"]),Hg=h(["data","colors"],{}),Ig=h(["data","hide"],!1),Jg=h(["data","selection","enabled"],!1),Kg=h(["data","selection","grouped"],!1),Lg=h(["data","selection","isselectable"],function(){return!0}),Mg=h(["data","selection","multiple"],!0),Ng=h(["data","onclick"],function(){}),Og=h(["data","onenter"],function(){}),Pg=h(["data","onleave"],function(){}),Qg=h(["data","onselected"],function(){}),Rg=h(["data","onunselected"],function(){}),Sg=h(["data","ondragstart"],function(){}),Tg=h(["data","ondragend"],function(){}),Ug=h(["subchart","show"],!1),Vg=h(["subchart","size","height"],60),Wg=h(["color","pattern"],[]),Xg=h(["legend","show"],!0),Yg=h(["legend","position"],"bottom"),Zg=h(["legend","item","onclick"]),$g=h(["legend","item","onmouseover"]),_g=h(["legend","item","onmouseout"]),ah=h(["legend","equally"],!1),bh=h(["axis","rotated"],!1),ch=h(["axis","x","show"],!0),dh=h(["axis","x","type"],"indexed"),eh=h(["axis","x","localtime"],!0),fh=h(["axis","x","categories"],[]),gh=h(["axis","x","tick","centered"],!1),hh=h(["axis","x","tick","format"]),ih=h(["axis","x","tick","culling"],{}),jh=h(["axis","x","tick","culling","max"],10),kh=h(["axis","x","tick","count"]),lh=h(["axis","x","tick","fit"],!0),mh=h(["axis","x","tick","values"],null),nh=h(["axis","x","tick","rotate"]),oh=h(["axis","x","max"],null),ph=h(["axis","x","min"],null),qh=h(["axis","x","padding"],{}),rh=h(["axis","x","height"]),sh=h(["axis","x","default"]),th=h(["axis","x","label"],{}),uh=h(["axis","y","show"],!0),vh=h(["axis","y","max"]),wh=h(["axis","y","min"]),xh=h(["axis","y","center"]),yh=h(["axis","y","label"],{}),zh=h(["axis","y","inner"],!1),Ah=h(["axis","y","tick","format"]),Bh=h(["axis","y","padding"]),Ch=h(["axis","y","ticks"],10),Dh=h(["axis","y2","show"],!1),Eh=h(["axis","y2","max"]),Fh=h(["axis","y2","min"]),Gh=h(["axis","y2","center"]),Hh=h(["axis","y2","label"],{}),Ih=h(["axis","y2","inner"],!1),Jh=h(["axis","y2","tick","format"]),Kh=h(["axis","y2","padding"]),Lh=h(["axis","y2","ticks"],10),Mh=h(["grid","x","show"],!1),Nh=h(["grid","x","type"],"tick"),Oh=h(["grid","x","lines"],[]),Ph=h(["grid","y","show"],!1),Qh=h(["grid","y","lines"],[]),Rh=h(["grid","y","ticks"],10),Sh=h(["point","show"],!0),Th=h(["point","r"],2.5),Uh=h(["point","focus","line","enabled"],!0),Vh=h(["point","focus","expand","enabled"],!0),Wh=h(["point","focus","expand","r"]),Xh=h(["point","focus","select","r"]),Yh=h(["line","connect_null"],!1),Zh=h(["bar","width"]),$h=h(["bar","width","ratio"],.6),_h=h(["pie","label","show"],!0),ai=h(["pie","label","format"]),bi=h(["pie","expand"],!0),ci=h(["pie","onclick"],function(){}),di=h(["pie","onmouseover"],function(){}),ei=h(["pie","onmouseout"],function(){}),fi=h(["donut","label","show"],!0),gi=h(["donut","label","format"]),hi=h(["donut","expand"],!0),ii=h(["donut","title"],""),ji=h(["donut","onclick"],function(){}),ki=h(["donut","onmouseover"],function(){}),li=h(["donut","onmouseout"],function(){}),mi=h(["regions"],[]),ni=h(["tooltip","show"],!0),oi=h(["tooltip","format","title"]),pi=h(["tooltip","format","value"]),qi=h(["tooltip","contents"],function(a,b,c,d){vare,g,h,i,j,k=oi?oi:b,l=pi?pi:c;for(g=0;g<a.length;g++)a[g]&&(a[g].value||0===a[g].value)&&(e||(h=k?k(a[g].x):a[g].x,e="<table class='"+f.tooltip+"'>"+(h||0===h?"<tr><th colspan='2'>"+h+"</th></tr>":"")),j=a[g].name,i=l(a[g].value,a[g].ratio,a[g].id,a[g].index),e+="<tr class='"+f.tooltipName+"-"+a[g].id+"'>",e+="<td class='name'><span style='background-color:"+d(a[g].id)+"'></span>"+j+"</td>",e+="<td class='value'>"+i+"</td>",e+="</tr>");returne+"</table>"}),ri=h(["tooltip","init","show"],!1),si=h(["tooltip","init","x"],0),ti=h(["tooltip","init","position"],{top:"0px",left:"50px"}),ui=("string"==typeofAf?Af.replace("#",""):Af.id)+"-clip",vi=ui+"-xaxis",wi=ui+"-yaxis",xi=i(ui),yi=i(vi),zi=i(wi),Ai="timeseries"===dh,Bi="categorized"===dh,Ci=!Ai&&(tg||we(ug)),Di=null,Ei=!1,Fi=!1,Gi=!1,Hi=!1,Ii=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Ji=qe(Hg,we(Wg)?Wg:Ii,Gg),Ki=eh?xf.time.format:xf.time.format.utc,Li=function(){vara=[[Ki("%Y/%-m/%-d"),function(){return!0}],[Ki("%-m/%-d"),function(a){returna.getMonth()}],[Ki("%-m/%-d"),function(a){return1!==a.getDate()}],[Ki("%-m/%-d"),function(a){returna.getDay()&&1!==a.getDate()}],[Ki("%I %p"),function(a){returna.getHours()}],[Ki("%I:%M"),function(a){returna.getMinutes()}],[Ki(":%S"),function(a){returna.getSeconds()}],[Ki(".%L"),function(a){returna.getMilliseconds()}]];returnfunction(b){for(varc=a.length-1,d=a[c];!d[1](b);)d=a[--c];returnd[0](b)}}(),Mi=[],Ni=[],Oi=bh?"left":"bottom",Pi=bh?zh?"top":"bottom":zh?"right":"left",Qi=bh?Ih?"bottom":"top":Ih?"left":"right",Ri=bh?"left":"bottom",Si={main:function(){return"translate("+Nf.left+","+Nf.top+")"},context:function(){return"translate("+Of.left+","+Of.top+")"},legend:function(){return"translate("+Pf.left+","+Pf.top+")"},x:function(){return"translate(0,"+(bh?0:Sf)+")"},y:function(){return"translate(0,"+(bh?Sf:0)+")"},y2:function(){return"translate("+(bh?0:Qf)+","+(bh?1:0)+")"},subx:function(){return"translate(0,"+(bh?0:Tf)+")"},arc:function(){return"translate("+Qf/2+","+Sf/2+")"}},Ti="right"===Yg,Ui=0,Vi=0,Wi=0,Xi=.15,Yi=30,Zi=bh&&!ch?0:30,$i=5;ag=xf.layout.pie().value(function(a){returna.values.reduce(function(a,b){returna+b.value},0)});var_i,aj=function(){vara=xf.svg.line().x(bh?function(a){returnV(a.id)(a.value)}:Cd).y(bh?Cd:function(a){returnV(a.id)(a.value)});returnYh||(a=a.defined(function(a){returnnull!=a.value})),function(b){varc,d,e=Yh?Ge(b.values):b.values;returnfe(b)?(a.interpolate(ge(b)?"cardinal":"linear"),Fg[b.id]?Ve(e,jg,V(b.id),Fg[b.id]):a(e)):(c=e[0]?jg(e[0].x):0,d=e[0]?V(b.id)(e[0].value):0,bh?"M "+d+" "+c:"M "+c+" "+d)}}(),bj=function(){vara;returna=bh?xf.svg.area().x0(function(a){returnV(a.id)(0)}).x1(function(a){returnV(a.id)(a.value)}).y(Cd):xf.svg.area().x(Cd).y0(function(a){returnV(a.id)(0)}).y1(function(a){returnV(a.id)(a.value)}),function(b){varc,d,e=Ge(b.values);return_d([b],"area")||_d([b],"area-spline")?(a.interpolate(ge(b)?"cardinal":"linear"),a(e)):(c=e[0]?jg(e[0].x):0,d=e[0]?V(b.id)(e[0].value):0,bh?"M "+d+" "+c:"M "+c+" "+d)}}(),cj=function(){vara=xf.svg.line().x(bh?function(a){returnW(a.id)(a.value)}:Fd).y(bh?Fd:function(a){returnW(a.id)(a.value)});returnfunction(b){varc=Ge(b.values);returnfe(b)?a(c):"M "+mg(c[0].x)+" "+W(b.id)(c[0].value)}}(),dj=function(){};_i=xf.svg.brush().on("brush",cf),_i.update=function(){returnhj&&hj.select("."+f.brush).call(this),this},_i.scale=function(a){returnbh?this.y(a):this.x(a)},Ff&&(dj=xf.behavior.zoom().on("zoomstart",function(){dj.altDomain=xf.event.sourceEvent.altKey?jg.orgDomain():null}).on("zoom",Ff?df:null),dj.scale=function(a){returnbh?this.y(a):this.x(a)},dj.orgScaleExtent=function(){vara=Gf?Gf:[1,10];return[a[0],Math.max(zc()/a[1],a[1])]},dj.updateScaleExtent=function(){vara=ac(jg.orgDomain())/ac(lj),b=this.orgScaleExtent();returnthis.scaleExtent([b[0]*a,b[1]*a]),this});varej,fj,gj,hj,ij,jj,kj,lj,mj,nj={};if(yf.focus=function(a){functionb(a){Ic(a).transition().duration(100).style("opacity",1)}varc=ej.selectAll(md(a)),d=c.filter(tf),e=c.filter(uf);yf.revert(),yf.defocus(),b(d.classed(f.focused,!0)),b(e),ee(yf.data.targets)&&Nb(a,!0),of(a,!0)},yf.defocus=function(a){functionb(a){Ic(a).transition().duration(100).style("opacity",.3)}varc=ej.selectAll(md(a)),d=c.filter(tf),e=c.filter(uf);yf.revert(),b(d.classed(f.focused,!1)),b(e),ee(yf.data.targets)&&Ob(a),of(a,!1)},yf.revert=function(a){functionb(a){Ic(a).transition().duration(100).style("opacity",1)}varc=ej.selectAll(md(a)),d=c.filter(tf),e=c.filter(uf);b(d.classed(f.focused,!1)),b(e),ee(yf.data.targets)&&Ob(a),pf()},yf.show=function(a,b){a=Dc(a),b=b||{},Mc(a),ej.selectAll(nd(a)).transition().style("opacity",1),b.withLegend&&qf(a),bf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},yf.hide=function(a,b){a=Dc(a),b=b||{},Lc(a),ej.selectAll(nd(a)).transition().style("opacity",0),b.withLegend&&rf(a),bf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},yf.toggle=function(a){Gc(a)?yf.hide(a):yf.show(a)},yf.unzoom=function(){_i.clear().update(),bf({withUpdateXDomain:!0})},yf.load=function(a){returna.xs&&nc(a.xs),"classes"ina&&Object.keys(a.classes).forEach(function(b){yg[b]=a.classes[b]}),"categories"ina&&Bi&&(fh=a.categories,pg.categories(fh)),"cacheIds"ina&&bc(a.cacheIds)?voidjf(dc(a.cacheIds),a.done):void("unload"ina?lf(Dc("boolean"==typeofa.unload&&a.unload?null:a.unload),function(){kf(a)}):kf(a))},yf.unload=function(a,b){lf(Dc(a),function(){bf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),"function"==typeofb&&b()})},yf.selected=function(a){returnxf.merge(gj.selectAll("."+f.shapes+ld(a)).selectAll("."+f.shape).filter(function(){returnxf.select(this).classed(f.SELECTED)}).map(function(a){returna.map(function(a){returna.__data__})}))},yf.select=function(a,b,c){Jg&&gj.selectAll("."+f.shapes).selectAll("."+f.shape).each(function(e,g){varh=xf.select(this),i="circle"===this.nodeName?Ae:De,j="circle"===this.nodeName?Be:Ee,k=Kg||!a||a.indexOf(e.id)>=0,l=!b||b.indexOf(g)>=0,m=h.classed(f.SELECTED);k&&l?Lg(e)&&!m&&i(h.classed(f.SELECTED,!0),e,g):d(c)&&c&&m&&j(h.classed(f.SELECTED,!1),e,g)})},yf.unselect=function(a,b){Jg&&gj.selectAll("."+f.shapes).selectAll("."+f.shape).each(function(c,d){vare=xf.select(this),g="circle"===this.nodeName?Be:Ee,h=Kg||!a||a.indexOf(c.id)>=0,i=!b||b.indexOf(d)>=0,j=e.classed(f.SELECTED);h&&i&&Lg(c)&&j&&g(e.classed(f.SELECTED,!1),c,d)})},yf.toLine=function(a){wf(a,"line")},yf.toSpline=function(a){wf(a,"spline")},yf.toBar=function(a){wf(a,"bar")},yf.toScatter=function(a){wf(a,"scatter")},yf.toArea=function(a){wf(a,"area")},yf.toAreaSpline=function(a){wf(a,"area-spline")
}jj.html(qi(yf.data.targets.map(function(a){returnpc(a.values[si])}),$(),wd(ee(yf.data.targets)),Ji)),jj.style("top",ti.top).style("left",ti.left).style("display","block")}null==a.onresize&&(a.onresize=ef()),a.onresize.add&&(a.onresize.add(Kf),a.onresize.add(function(){gf({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})}),a.onresize.add(Lf))}functionXe(a){a.append("rect").attr("class",fd).style("cursor",Jg&&Kg?"pointer":null).on("mouseover",function(a,b){if(!Ei&&!ee(yf.data.targets)){varc,d,e=yf.data.targets.map(function(a){returnpc(a.values[b])});if(Object.keys(xg).length>0){d=[];for(varginxg)for(c=0;c<e.length;c++)if(e[c].id===g){d.push(e[c]),e.shift(c);break}e=d.concat(e)}Vh&&Le(b),Oe(b),gj.selectAll("."+f.shape+"-"+b).each(function(a){Og(a)})}}).on("mouseout",function(a,b){ee(yf.data.targets)||(Sd(),Qd(),Me(b),Pe(),gj.selectAll("."+f.shape+"-"+b).each(function(a){Pg(a)}))}).on("mousemove",function(a,b){varc;Ei||ee(yf.data.targets)||(c=Ic(yf.data.targets).map(function(a){returnpc(a.values[b])}),Pd(c,xf.mouse(this)),Rd(c),Jg&&(Kg||gj.selectAll("."+f.shape+"-"+b).filter(function(a){returnLg(a)}).each(function(){vara=xf.select(this).classed(f.EXPANDED,!0);"circle"===this.nodeName&&a.attr("r",Ie),ej.select("."+f.eventRect+"-"+b).style("cursor",null)}).filter(function(a){return"circle"===this.nodeName?se(this,Je(a)):"path"===this.nodeName?te(this):void0}).each(function(){vara=xf.select(this);a.classed(f.EXPANDED)||(a.classed(f.EXPANDED,!0),"circle"===this.nodeName&&a.attr("r",Je)),ej.select("."+f.eventRect+"-"+b).style("cursor","pointer")})))}).on("click",function(a,b){returnee(yf.data.targets)?void0:Fi?void(Fi=!1):voidgj.selectAll("."+f.shape+"-"+b).each(function(a){Ze(this,a,b)})}).call(xf.behavior.drag().origin(Object).on("drag",function(){$e(xf.mouse(this))}).on("dragstart",function(){_e(xf.mouse(this))}).on("dragend",function(){af()})).call(dj).on("dblclick.zoom",null)}functionYe(a){a.append("rect").attr("x",0).attr("y",0).attr("width",Qf).attr("height",Sf).attr("class",f.eventRect).on("mouseout",function(){ee(yf.data.targets)||(Sd(),Qd(),Me())}).on("mousemove",function(){vara,b,c,d,e=Ic(yf.data.targets);Ei||ee(e)||(a=xf.mouse(this),b=Id(e,a),b&&(c=ie(b)?[b]:Kd(e,b.x),d=c.map(function(a){returnpc(a)}),Pd(d,a),Vh&&(Me(),Le(b.index,b.id)),Rd(d),ye(b,a)<100?(ej.select("."+f.eventRect).style("cursor","pointer"),Gi||(Og(b),Gi=!0)):(ej.select("."+f.eventRect).style("cursor",null),Pg(b),Gi=!1)))}).on("click",function(){vara,b,c=Ic(yf.data.targets);ee(c)||(a=xf.mouse(this),b=Id(c,a),b&&ye(b,a)<100&&gj.select("."+f.circles+"-"+ld(b.id)).select("."+f.circle+"-"+b.index).each(function(){Ze(this,b,b.index)}))}).call(xf.behavior.drag().origin(Object).on("drag",function(){$e(xf.mouse(this))}).on("dragstart",function(){_e(xf.mouse(this))}).on("dragend",function(){af()})).call(dj).on("dblclick.zoom",null)}functionZe(a,b,c){vard,e=xf.select(a),g=e.classed(f.SELECTED),h=!1;"circle"===a.nodeName?(h=se(a,1.5*Je(b)),d=Ce):"path"===a.nodeName&&(h=te(a),d=Fe),(Kg||h)&&(Jg&&Lg(b)&&(Mg||gj.selectAll("."+f.shapes+(Kg?ld(b.id):"")).selectAll("."+f.shape).each(function(a,b){varc=xf.select(this);c.classed(f.SELECTED)&&d(!1,c.classed(f.SELECTED,!1),a,b)}),e.classed(f.SELECTED,!g),d(!g,e,b,c)),Ng(b,a))}function$e(a){varb,c,d,e,g,h,i,j;ee(yf.data.targets)||Jg&&(!Ff||dj.altDomain)&&Mg&&(b=Di[0],c=Di[1],d=a[0],e=a[1],g=Math.min(b,d),h=Math.max(b,d),i=Kg?Nf.top:Math.min(c,e),j=Kg?Sf:Math.max(c,e),gj.select("."+f.dragarea).attr("x",g).attr("y",i).attr("width",h-g).attr("height",j-i),gj.selectAll("."+f.shapes).selectAll("."+f.shape).filter(function(a){returnLg(a)}).each(function(a,b){varc,d,e,k,l,m,n=xf.select(this),o=n.classed(f.SELECTED),p=n.classed(f.INCLUDED),q=!1;"circle"===this.nodeName?(c=1*n.attr("cx"),d=1*n.attr("cy"),l=Ce,q=c>g&&h>c&&d>i&&j>d):"path"===this.nodeName&&(m=Ld(this),c=m.x,d=m.y,e=m.width,k=m.height,l=Fe,q=!(c>h||g>c+e||d>j||i>d+k)),q^p&&(n.classed(f.INCLUDED,!p),n.classed(f.SELECTED,!o),l(!o,n,a,b))}))}function_e(a){ee(yf.data.targets)||Jg&&(Di=a,gj.select("."+f.chart).append("rect").attr("class",f.dragarea).style("opacity",.1),Ei=!0,Sg())}functionaf(){ee(yf.data.targets)||Jg&&(gj.select("."+f.dragarea).transition().duration(100).style("opacity",0).remove(),gj.selectAll("."+f.shape).classed(f.INCLUDED,!1),Ei=!1,Tg())}functionbf(a){varc,e,g,h,i,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,M,N,O,P,Q,R,S,T,U,V=Vd(),W=ee(yf.data.targets),X=Ic(yf.data.targets);if(a=d(a)?a:{},A=d(a.withY)?a.withY:!0,B=d(a.withSubchart)?a.withSubchart:!0,C=d(a.withTransition)?a.withTransition:!0,F=d(a.withTransform)?a.withTransform:!1,G=d(a.withUpdateXDomain)?a.withUpdateXDomain:!1,H=d(a.withUpdateOrgXDomain)?a.withUpdateOrgXDomain:!1,I=d(a.withLegend)?a.withLegend:!1,D=d(a.withTransitionForExit)?a.withTransitionForExit:C,E=d(a.withTransitionForAxis)?a.withTransitionForAxis:C,P=C?Mf:0,Q=D?P:0,R=E?P:0,c=gj.select("."+f.axisX).style("opacity",W?0:1),g=gj.select("."+f.axisY).style("opacity",W?0:1),h=gj.select("."+f.axisY2).style("opacity",W?0:1),e=hj.select("."+f.axisX).style("opacity",W?0:1),O={axisX:c.transition().duration(R),axisY:g.transition().duration(R),axisY2:h.transition().duration(R),axisSubX:e.transition().duration(R)},I&&Xg&&sf(Cc(yf.data.targets),a,O),Bi&&(0!==X.length&&H&&G||jg.domain([0,c.selectAll(".tick").size()])),X.length&&(H&&(jg.domain(xf.extent(_b(X))),lj=jg.domain(),Ff&&dj.scale(jg).updateScaleExtent(),mg.domain(jg.domain()),_i.scale(mg)),G&&(jg.domain(_i.empty()?lj:_i.extent()),Ff&&dj.scale(jg).updateScaleExtent()),mh||!lh&&!kh||(S=Kc(Jc(X),kh),pg.tickValues(S),sg.tickValues(S))),kg.domain(Xb(X,"y")),lg.domain(Xb(X,"y2")),O.axisX.call(pg),O.axisY.call(qg),O.axisY2.call(rg),O.axisSubX.call(sg),G&&X.length)if(ih&&S){for(T=1;T<S.length;T++)if(S.length/T<jh){U=T;break}ej.selectAll("."+f.axisX+" .tick text").each(function(a){varb=S.indexOf(a);b>=0&&xf.select(this).style("display",b%U?"none":"block")})}elseej.selectAll("."+f.axisX+" .tick text").style("display","block");if(!bh&&nh&&eb(c,O.axisX,nh),J=Qe(V),M=Re(V,!0),N=Re(V,!1),Db(),ng.domain(kg.domain()),og.domain(lg.domain()),jj.style("display","none"),o(),gj.select("line."+f.xgridFocus).style("visibility","hidden"),Mh){if("year"===Nh){j=[];for(varY=_b(),Z=Y[0].getFullYear(),$=Y[1].getFullYear(),_=Z;$>=_;_++)j.push(newDate(_+"-01-01 00:00:00"))}elsej=jg.ticks(10);i=gj.select("."+f.xgrids).selectAll("."+f.xgrid).data(j),i.enter().append("line").attr("class",f.xgrid),i.attr("x1",bh?0:function(a){returnjg(a)-pg.tickOffset()}).attr("x2",bh?Qf:function(a){returnjg(a)-pg.tickOffset()}).attr("y1",bh?function(a){returnjg(a)-pg.tickOffset()}:Nf.top).attr("y2",bh?function(a){returnjg(a)-pg.tickOffset()}:Sf).style("opacity",function(){return+xf.select(this).attr(bh?"y1":"x1")===(bh?Sf:0)?0:1}),i.exit().remove()}we(Oh)&&(k=gj.select("."+f.xgridLines).selectAll("."+f.xgridLine).data(Oh),l=k.enter().append("g").attr("class",function(a){returnf.xgridLine+(a.class?a.class:"")}),l.append("line").style("opacity",0),l.append("text").attr("text-anchor","end").attr("transform",bh?"":"rotate(-90)").attr("dx",bh?0:-Nf.top).attr("dy",-5).style("opacity",0),k.select("line").transition().duration(P).attr("x1",bh?0:Dd).attr("x2",bh?Qf:Dd).attr("y1",bh?Dd:Nf.top).attr("y2",bh?Dd:Sf).style("opacity",1),k.select("text").transition().duration(P).attr("x",bh?Qf:0).attr("y",Dd).text(function(a){returna.text}).style("opacity",1),k.exit().transition().duration(P).style("opacity",0).remove()),A&&Ph&&(m=gj.select("."+f.ygrids).selectAll("."+f.ygrid).data(kg.ticks(Rh)),m.enter().append("line").attr("class",f.ygrid),m.attr("x1",bh?kg:0).attr("x2",bh?kg:Qf).attr("y1",bh?0:kg).attr("y2",bh?Sf:kg),m.exit().remove()),A&&we(Qh)&&(n=gj.select("."+f.ygridLines).selectAll("."+f.ygridLine).data(Qh),p=n.enter().append("g").attr("class",function(a){returnf.ygridLine+(a.class?a.class:"")}),p.append("line").style("opacity",0),p.append("text").attr("text-anchor","end").attr("transform",bh?"rotate(-90)":"").attr("dx",bh?0:-Nf.top).attr("dy",-5).style("opacity",0),n.select("line").transition().duration(P).attr("x1",bh?Ed:0).attr("x2",bh?Ed:Qf).attr("y1",bh?0:Ed).attr("y2",bh?Sf:Ed).style("opacity",1),n.select("text").transition().duration(P).attr("x",bh?0:Qf).attr("y",Ed).text(function(a){returna.text}).style("opacity",1),n.exit().transition().duration(P).style("opacity",0).remove()),s=gj.select("."+f.regions).selectAll("rect."+f.region).data(mi),s.enter().append("rect").style("fill-opacity",0),s.attr("class",ed).attr("x",ec).attr("y",fc).attr("width",gc).attr("height",hc).transition().duration(P).style("fill-opacity",function(a){returnb(a.opacity)?a.opacity:.1}),s.exit().transition().duration(P).style("fill-opacity",0).remove(),r=gj.selectAll("."+f.bars).selectAll("."+f.bar).data(me),r.enter().append("path").attr("d",J).style("stroke","none").style("opacity",0).style("fill",function(a){returnJi(a)}).attr("class",ad),r.style("opacity",qd).transition().duration(P).attr("d",J).style("opacity",1),r.exit().transition().duration(Q).style("opacity",0).remove(),t=gj.selectAll("."+f.texts).selectAll("."+f.text).data(oe),t.enter().append("text").attr("class",Vc).attr("text-anchor",function(a){returnbh?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill-opacity",0),t.text(function(a){returnBd(a.id)(a.value)}).style("fill-opacity",rd).transition().duration(P).attr("x",M).attr("y",N).style("fill-opacity",td),t.exit().transition().duration(Q).style("fill-opacity",0).remove(),gj.selectAll("."+f.line).style("opacity",qd).transition().duration(P).attr("d",aj).style("opacity",1),gj.selectAll("."+f.area).style("opacity",0).transition().duration(P).attr("d",bj).style("opacity",mj),q=gj.selectAll("."+f.circles).selectAll("."+f.circle).data(ne),q.enter().append("circle").attr("class",$c).style("opacity",0).attr("r",He),q.style("opacity",qd).transition().duration(P).style("opacity",sd).attr("cx",bh?Ud:Td).attr("cy",bh?Td:Ud),q.exit().remove(),gj.each(function(){Hi=!0}).selectAll("."+f.chartArc).select("."+f.arc).attr("transform",F?"scale(0)":"").style("opacity",function(a){returna===this._current?0:1}).transition().duration(P).attrTween("d",function(a){varb,c=Fb(a);returnc?(b=xf.interpolate(this._current,c),this._current=b(0),function(a){returnIb(b(a),!0)}):function(){return"M 0 0"}}).attr("transform",F?"scale(1)":"").style("opacity",1).call(ze,function(){Hi=!1}),gj.selectAll("."+f.chartArc).select("text").attr("transform",Jb).style("opacity",0).transition().duration(P).text(Mb).style("opacity",function(a){returnGc(a.data.id)&&le(a.data)?1:0}),gj.select("."+f.chartArcsTitle).style("opacity",de(yf.data.targets)?1:0),Ug&&(null!==xf.event&&"zoom"===xf.event.type&&_i.extent(jg.orgDomain()).update(),B&&(!bh&&nh&&eb(e,O.axisSubX,nh),_i.empty()||_i.extent(jg.orgDomain()).update(),K=Qe(V,!0),u=hj.selectAll("."+f.bars).selectAll("."+f.bar).data(me),u.enter().append("path").attr("d",K).style("stroke","none").style("fill",function(a){returnJi(a)}).attr("class",ad),u.style("opacity",qd).transition().duration(P).attr("d",K).style("opacity",1),u.exit().transition().duration(P).style("opacity",0).remove(),hj.selectAll("."+f.line).style("opacity",qd).transition().duration(P).attr("d",cj).style("opacity",1))),gj.selectAll("."+f.selectedCircles).filter(function(a){returnhe(a)}).selectAll("circle").remove(),gj.selectAll("."+f.selectedCircle).transition().duration(P).attr("cx",bh?Ud:Td).attr("cy",bh?Td:Ud),v=gj.select("."+f.eventRects),we(ug)&&!oc(ug)?(v.classed(f.eventRectsMultiple)||v.classed(f.eventRectsMultiple,!0).classed(f.eventRectsSingle,!1).selectAll("."+f.eventRect).remove(),w=gj.select("."+f.eventRects).selectAll("."+f.eventRect).data([0]),Ye(w.enter()),w.attr("x",0).attr("y",0).attr("width",Qf).attr("height",Sf)):(v.classed(f.eventRectsSingle)||v.classed(f.eventRectsMultiple,!1).classed(f.eventRectsSingle,!0).selectAll("."+f.eventRect).remove(),Ci&&!Bi?(z=function(a,b){varc=xc(b),d=yc(b),e=yf.data.xs[a.id][b];return(jg(d?d:e+50)-jg(c?c:e-50))/2},y=function(a,b){varc=xc(b),d=yf.data.xs[a.id][b];return(jg(d)+jg(c?c:d-50))/2}):(z=L(),y=function(a){returnjg(a.x)-z/2}),x=Ac(yf.data.targets),gj.select("."+f.eventRects).datum(x?x.values:[]),w=gj.select("."+f.eventRects).selectAll("."+f.eventRect).data(function(a){returna}),Xe(w.enter()),w.attr("class",fd).attr("x",bh?0:y).attr("y",bh?y:0).attr("width",bh?Qf:z).attr("height",bh?z:Sf),w.exit().remove()),Cc(yf.data.targets).forEach(function(a){nj[a]=!0})}functioncf(){bf({withTransition:!1,withY:!1,withSubchart:!1,withUpdateXDomain:!0})}functiondf(){return"mousemove"===xf.event.sourceEvent.type&&dj.altDomain?(jg.domain(dj.altDomain),voiddj.scale(jg).updateScaleExtent()):(Bi&&jg.orgDomain()[0]===lj[0]&&jg.domain([lj[0]-1e-10,jg.orgDomain()[1]]),bf({withTransition:!1,withY:!1,withSubchart:!1}),void("mousemove"===xf.event.sourceEvent.type&&(Fi=!0)))}functionef(){functiona(){b.forEach(function(a){a()})}varb=[];returna.add=function(a){b.push(a)},a}functionff(){ej.attr("width",Uf).attr("height",Vf),ej.select("#"+ui).select("rect").attr("width",Qf).attr("height",Sf),ej.select("#"+vi).select("rect").attr("x",B).attr("y",C).attr("width",H).attr("height",I),ej.select("#"+wi).select("rect").attr("x",D).attr("y",E).attr("width",J).attr("height",K),ej.select("."+f.zoomRect).attr("width",Qf).attr("height",Sf),kj.style("max-height",Vf+"px")}functiongf(a){a=a||{},a.withTransition=d(a.withTransition)?a.withTransition:!0,a.withTransform=d(a.withTransform)?a.withTransform:!1,a.withLegend=d(a.withLegend)?a.withLegend:!1,a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.withTransitionForExit=!1,n(),R(),ff(),m(a.withTransition),bf(a)}functionhf(a){varb,c,d,e,g,h,i,j,k,l,m,n;i=gj.select("."+f.chartTexts).selectAll("."+f.chartText).data(a).attr("class",hd),j=i.enter().append("g").attr("class",hd).style("opacity",0).style("pointer-events","none"),j.append("g").attr("class",Wc).style("fill",function(a){returnJi(a)}),e=gj.select("."+f.chartBars).selectAll("."+f.chartBar).data(a).attr("class",jd),d=e.enter().append("g").attr("class",jd).style("opacity",0).style("pointer-events","none"),d.append("g").attr("class",bd).style("stroke","none").style("cursor",function(a){returnLg(a)?"pointer":null}),c=gj.select("."+f.chartLines).selectAll("."+f.chartLine).data(a).attr("class",id),b=c.enter().append("g").attr("class",id).style("opacity",0).style("pointer-events","none"),b.append("path").attr("class",Zc).style("opacity",0).style("stroke",function(a){returnJi(a)}),b.append("path").attr("class",dd).style("opacity",function(){returnmj=+xf.select(this).style("opacity"),0}).style("fill",function(a){returnJi(a)}),b.append("g").attr("class",function(a){returnUc(f.selectedCircles,a.id)}),b.append("g").attr("class",_c).style("fill",function(a){returnJi(a)}).style("cursor",function(a){returnLg(a)?"pointer":null}),a.forEach(function(a){gj.selectAll("."+f.selectedCircles+ld(a.id)).selectAll("."+f.selectedCircle).each(function(b,c){b.value=a.values[c].value})}),h=gj.select("."+f.chartArcs).selectAll("."+f.chartArc).data(ag(a)).attr("class",kd),g=h.enter().append("g").attr("class",kd),g.append("path").attr("class",cd).style("opacity",0).style("fill",function(a){returnJi(a.data)}).style("cursor",function(a){returnLg(a)?"pointer":null}).each(function(a){this._current=a}).on("mouseover",function(a,b){varc,d,e;Hi||(c=Fb(a),d=Lb(c),e=Tb(),Nb(c.data.id),of(c.data.id,!0),e(d,b))}).on("mousemove",function(a){varb=Fb(a),c=Lb(b),d=[c];Pd(d,xf.mouse(this))}).on("mouseout",function(a,b){varc,d,e;Hi||(c=Fb(a),d=Lb(c),e=Ub(),Ob(c.data.id),pf(),Qd(),e(d,b))}).on("click",function(a,b){varc=Fb(a),d=Lb(c),e=Sb();e(d,b)}),g.append("text").attr("dy",".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none"),Ug&&(n=hj.select("."+f.chartBars).selectAll("."+f.chartBar).data(a).attr("class",jd),m=n.enter().append("g").style("opacity",0).attr("class",jd),m.append("g").attr("class",bd).style("fill",function(a){returnJi(a)}),l=hj.select("."+f.chartLines).selectAll("."+f.chartLine).data(a).attr("class",id),k=l.enter().append("g").style("opacity",0).attr("class",id),k.append("path").attr("class",Zc).style("opacity",0).style("stroke",function(a){returnJi(a)})),ej.selectAll("."+f.target).filter(function(a){returnGc(a.id)}).transition().duration(Mf).style("opacity",1)}functionjf(a,b){(b.type||b.types)&&a.forEach(function(a){b.types?$d(a.id,b.types[a.id]):$d(a.id,b.type)}),yf.data.targets.forEach(function(b){for(varc=0;c<a.length;c++)if(b.id===a[c].id){b.values=a[c].values,a.splice(c,1);break}}),yf.data.targets=yf.data.targets.concat(a),hf(yf.data.targets),bf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),"function"==typeofb.done&&b.done()}functionkf(a){if("data"ina)jf(vc(a.data),a);elseif("url"ina)xf.csv(a.url,function(b,c){jf(vc(c),a)});elseif("rows"ina)jf(vc(tc(a.rows)),a);else{if(!("columns"ina))throwError("url or rows or columns is required.");jf(vc(uc(a.columns)),a)}}functionlf(a,b){return"function"!=typeofb&&(b=function(){}),a=a.filter(function(a){returnEc(yf.data.targets,a)}),a&&0!==a.length?(ej.selectAll(a.map(function(a){returnmd(a)})).transition().style("opacity",0).remove().call(ze,b),voida.forEach(function(a){nj[a]=!1,ij.selectAll("."+f.legendItem+ld(a)).remove(),yf.data.targets=yf.data.targets.filter(function(b){returnb.id!==a})})):voidb()}functionmf(a){returna.classed(f.legendItemHidden)?Xi:1}functionnf(a){returna.classed(f.legendItemHidden)?Xi:.3}functionof(a,b){ij.selectAll("."+f.legendItem).transition().duration(100).style("opacity",function(c){vard=xf.select(this);returna&&c!==a?b?nf(d):mf(d):b?mf(d):nf(d)})}functionpf(){ij.selectAll("."+f.legendItem).transition().duration(100).style("opacity",function(){returnmf(xf.select(this))})}functionqf(a){Xg||(Xg=!0,ij.style("visibility","visible")),Oc(a),ij.selectAll(pd(a)).style("visibility","visible").transition().style("opacity",function(){returnmf(xf.select(this))})}functionrf(a){Xg&&ve(a)&&(Xg=!1,ij.style("visibility","hidden")),Nc(a),ij.selectAll(pd(a)).style("opacity",0).style("visibility","hidden")}functionsf(a,b,c){functione(b,c,d){functione(a,b){b||(f=(l-w-k)/2,v>f&&(f=(l-k)/2,w=0,C++)),B[a]=C,A[C]=f,x[a]=w,w+=k}varf,g,h=b.getBoundingClientRect(),i=10*Math.ceil((h.width+s)/10),j=10*Math.ceil((h.height+r)/10),k=Ti?j:i,l=Ti?Q():P();returnd&&(w=0,C=0,t=0,u=0),Xg&&!Hc(c)?void(y[c]=z[c]=B[c]=x[c]=0):(y[c]=i,z[c]=j,(!t||i>=t)&&(t=i),(!u||j>=u)&&(u=j),g=Ti?u:t,void(ah?(Object.keys(y).forEach(function(a){y[a]=t}),Object.keys(z).forEach(function(a){z[a]=u}),f=(l-g*a.length)/2,v>f?(w=0,C=0,a.forEach(function(a){e(a)})):e(c,!0)):e(c)))}varg,h,i,j,k,l,o,p,q,r=4,s=26,t=0,u=0,v=10,w=0,x={},y={},z={},A=[0],B={},C=0,D=ij.selectAll("."+f.legendItemFocused).size();b=b||{},p=d(b.withTransition)?b.withTransition:!0,q=d(b.withTransitionForTransform)?b.withTransitionForTransform:!0,Ti?(g=function(a){returnt*(.2+B[a])},j=function(a){returnA[B[a]]+x[a]}):(g=function(a){returnA[B[a]]+x[a]},j=function(a){returnu*(.2+B[a])}),h=function(a,b){returng(a,b)+14},k=function(a,b){returnj(a,b)+9},i=function(a,b){returng(a,b)-4},l=function(a,b){returnj(a,b)-7},o=ij.selectAll("."+f.legendItem).data(a).enter().append("g").attr("class",function(a){returnUc(f.legendItem,a)}).style("visibility",function(a){returnHc(a)?"visible":"hidden"}).style("cursor","pointer").on("click",function(a){"function"==typeofZg?Zg(a):yf.toggle(a)}).on("mouseover",function(a){xf.select(this).classed(f.legendItemFocused,!0),Hi||yf.focus(a),"function"==typeof$g&&$g(a)}).on("mouseout",function(a){xf.select(this).classed(f.legendItemFocused,!1),Hi||yf.revert(),"function"==typeof_g&&_g(a)}),o.append("text").text(function(a){returnd(xg[a])?xg[a]:a}).each(function(a,b){e(this,a,0===b)}).style("pointer-events","none").attr("x",Ti?h:-200).attr("y",Ti?-200:k),o.append("rect").attr("class",f.legendItemEvent).style("fill-opacity",0).attr("x",Ti?i:-200).attr("y",Ti?-200:l).attr("width",function(a){returny[a]}).attr("height",function(a){returnz[a]}),o.append("rect").attr("class",f.legendItemTile).style("pointer-events","none").style("fill",function(a){returnJi(a)}).attr("x",Ti?h:-200).attr("y",Ti?-200:j).attr("width",10).attr("height",10),ij.selectAll("text").data(a).text(function(a){returnd(xg[a])?xg[a]:a}).each(function(a,b){e(this,a,0===b)}).transition().duration(p?250:0).attr("x",h).attr("y",k),ij.selectAll("rect."+f.legendItemEvent).data(a).transition().duration(p?250:0).attr("x",i).attr("y",l),ij.selectAll("rect."+f.legendItemTile).data(a).transition().duration(p?250:0).attr("x",g).attr("y",j),ij.selectAll("."+f.legendItem).classed(f.legendItemHidden,function(a){return!Gc(a)}).transition().style("opacity",function(a){varb=xf.select(this);returnGc(a)?!D||b.classed(f.legendItemFocused)?mf(b):nf(b):Xi}),N(t),O(u),M(C),n(),R(),ff(),m(q,c)}functiontf(a){returnEc(yf.data.targets,a.id)}functionuf(a){return"data"ina&&Ec(yf.data.targets,a.data.id)}functionvf(a){varb=a&&a.value?a.value:null,c=a&&a["class"]?a["class"]:null;returnb?function(a){returna.value!==b}:c?function(a){returna["class"]!==c}:function(){return!0}}functionwf(a,b,c){vard=!ee(yf.data.targets);Hi=!1,$d(a,b),gf(c||{withTransitionForAxis:d})}varxf=a.d3?a.d3:a.require?a.require("d3"):void0,yf={data:{},axis:{},legend:{}},zf={},Af=h(["bindto"],"#chart"),Bf=h(["size","width"]),Cf=h(["size","height"]),Df=h(["padding","left"],50),Ef=h(["padding","right"]),Ff=h(["zoom","enabled"],!1),Gf=h(["zoom","extent"]),Hf=h(["zoom","privileged"],!1),If=h(["onenter"],function(){}),Jf=h(["onleave"],function(){}),Kf=h(["onresize"],function(){}),Lf=h(["onresized"],function(){}),Mf=h(["transition","duration"],350);g("data","data is required in config");varNf,Of,Pf,Qf,Rf,Sf,Tf,Uf,Vf,Wf,Xf,Yf,Zf,$f,_f,ag,bg,cg,dg,eg,fg,gg,hg,ig,jg,kg,lg,mg,ng,og,pg,qg,rg,sg,tg=h(["data","x"]),ug=h(["data","xs"],{}),vg=h(["data","x_format"]),wg=h(["data","id_converter"],function(a){returna}),xg=h(["data","names"],{}),yg=h(["data","classes"],{}),zg=h(["data","groups"],[]),Ag=h(["data","axes"],{}),Bg=h(["data","type"]),Cg=h(["data","types"],{}),Dg=h(["data","labels"],{}),Eg=h(["data","order"]),Fg=h(["data","regions"],{}),Gg=h(["data","color"]),Hg=h(["data","colors"],{}),Ig=h(["data","hide"],!1),Jg=h(["data","selection","enabled"],!1),Kg=h(["data","selection","grouped"],!1),Lg=h(["data","selection","isselectable"],function(){return!0}),Mg=h(["data","selection","multiple"],!0),Ng=h(["data","onclick"],function(){}),Og=h(["data","onenter"],function(){}),Pg=h(["data","onleave"],function(){}),Qg=h(["data","onselected"],function(){}),Rg=h(["data","onunselected"],function(){}),Sg=h(["data","ondragstart"],function(){}),Tg=h(["data","ondragend"],function(){}),Ug=h(["subchart","show"],!1),Vg=h(["subchart","size","height"],60),Wg=h(["color","pattern"],[]),Xg=h(["legend","show"],!0),Yg=h(["legend","position"],"bottom"),Zg=h(["legend","item","onclick"]),$g=h(["legend","item","onmouseover"]),_g=h(["legend","item","onmouseout"]),ah=h(["legend","equally"],!1),bh=h(["axis","rotated"],!1),ch=h(["axis","x","show"],!0),dh=h(["axis","x","type"],"indexed"),eh=h(["axis","x","localtime"],!0),fh=h(["axis","x","categories"],[]),gh=h(["axis","x","tick","centered"],!1),hh=h(["axis","x","tick","format"]),ih=h(["axis","x","tick","culling"],{}),jh=h(["axis","x","tick","culling","max"],10),kh=h(["axis","x","tick","count"]),lh=h(["axis","x","tick","fit"],!0),mh=h(["axis","x","tick","values"],null),nh=h(["axis","x","tick","rotate"]),oh=h(["axis","x","max"],null),ph=h(["axis","x","min"],null),qh=h(["axis","x","padding"],{}),rh=h(["axis","x","height"]),sh=h(["axis","x","default"]),th=h(["axis","x","label"],{}),uh=h(["axis","y","show"],!0),vh=h(["axis","y","max"]),wh=h(["axis","y","min"]),xh=h(["axis","y","center"]),yh=h(["axis","y","label"],{}),zh=h(["axis","y","inner"],!1),Ah=h(["axis","y","tick","format"]),Bh=h(["axis","y","padding"]),Ch=h(["axis","y","ticks"],10),Dh=h(["axis","y2","show"],!1),Eh=h(["axis","y2","max"]),Fh=h(["axis","y2","min"]),Gh=h(["axis","y2","center"]),Hh=h(["axis","y2","label"],{}),Ih=h(["axis","y2","inner"],!1),Jh=h(["axis","y2","tick","format"]),Kh=h(["axis","y2","padding"]),Lh=h(["axis","y2","ticks"],10),Mh=h(["grid","x","show"],!1),Nh=h(["grid","x","type"],"tick"),Oh=h(["grid","x","lines"],[]),Ph=h(["grid","y","show"],!1),Qh=h(["grid","y","lines"],[]),Rh=h(["grid","y","ticks"],10),Sh=h(["point","show"],!0),Th=h(["point","r"],2.5),Uh=h(["point","focus","line","enabled"],!0),Vh=h(["point","focus","expand","enabled"],!0),Wh=h(["point","focus","expand","r"]),Xh=h(["point","focus","select","r"]),Yh=h(["line","connect_null"],!1),Zh=h(["bar","width"]),$h=h(["bar","width","ratio"],.6),_h=h(["pie","label","show"],!0),ai=h(["pie","label","format"]),bi=h(["pie","expand"],!0),ci=h(["pie","onclick"],function(){}),di=h(["pie","onmouseover"],function(){}),ei=h(["pie","onmouseout"],function(){}),fi=h(["donut","label","show"],!0),gi=h(["donut","label","format"]),hi=h(["donut","expand"],!0),ii=h(["donut","title"],""),ji=h(["donut","onclick"],function(){}),ki=h(["donut","onmouseover"],function(){}),li=h(["donut","onmouseout"],function(){}),mi=h(["regions"],[]),ni=h(["tooltip","show"],!0),oi=h(["tooltip","format","title"]),pi=h(["tooltip","format","value"]),qi=h(["tooltip","contents"],function(a,b,c,d){vare,g,h,i,j,k=oi?oi:b,l=pi?pi:c;for(g=0;g<a.length;g++)a[g]&&(a[g].value||0===a[g].value)&&(e||(h=k?k(a[g].x):a[g].x,e="<table class='"+f.tooltip+"'>"+(h||0===h?"<tr><th colspan='2'>"+h+"</th></tr>":"")),j=a[g].name,i=l(a[g].value,a[g].ratio,a[g].id,a[g].index),e+="<tr class='"+f.tooltipName+"-"+a[g].id+"'>",e+="<td class='name'><span style='background-color:"+d(a[g].id)+"'></span>"+j+"</td>",e+="<td class='value'>"+i+"</td>",e+="</tr>");returne+"</table>"}),ri=h(["tooltip","init","show"],!1),si=h(["tooltip","init","x"],0),ti=h(["tooltip","init","position"],{top:"0px",left:"50px"}),ui=("string"==typeofAf?Af.replace("#",""):Af.id)+"-clip",vi=ui+"-xaxis",wi=ui+"-yaxis",xi=i(ui),yi=i(vi),zi=i(wi),Ai="timeseries"===dh,Bi="categorized"===dh,Ci=!Ai&&(tg||we(ug)),Di=null,Ei=!1,Fi=!1,Gi=!1,Hi=!1,Ii=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Ji=qe(Hg,we(Wg)?Wg:Ii,Gg),Ki=eh?xf.time.format:xf.time.format.utc,Li=function(){vara=[[Ki("%Y/%-m/%-d"),function(){return!0}],[Ki("%-m/%-d"),function(a){returna.getMonth()}],[Ki("%-m/%-d"),function(a){return1!==a.getDate()}],[Ki("%-m/%-d"),function(a){returna.getDay()&&1!==a.getDate()}],[Ki("%I %p"),function(a){returna.getHours()}],[Ki("%I:%M"),function(a){returna.getMinutes()}],[Ki(":%S"),function(a){returna.getSeconds()}],[Ki(".%L"),function(a){returna.getMilliseconds()}]];returnfunction(b){for(varc=a.length-1,d=a[c];!d[1](b);)d=a[--c];returnd[0](b)}}(),Mi=[],Ni=[],Oi=bh?"left":"bottom",Pi=bh?zh?"top":"bottom":zh?"right":"left",Qi=bh?Ih?"bottom":"top":Ih?"left":"right",Ri=bh?"left":"bottom",Si={main:function(){return"translate("+Nf.left+","+Nf.top+")"},context:function(){return"translate("+Of.left+","+Of.top+")"},legend:function(){return"translate("+Pf.left+","+Pf.top+")"},x:function(){return"translate(0,"+(bh?0:Sf)+")"},y:function(){return"translate(0,"+(bh?Sf:0)+")"},y2:function(){return"translate("+(bh?0:Qf)+","+(bh?1:0)+")"},subx:function(){return"translate(0,"+(bh?0:Tf)+")"},arc:function(){return"translate("+Qf/2+","+Sf/2+")"}},Ti="right"===Yg,Ui=0,Vi=0,Wi=0,Xi=.15,Yi=30,Zi=bh&&!ch?0:30,$i=5;ag=xf.layout.pie().value(function(a){returna.values.reduce(function(a,b){returna+b.value},0)});var_i,aj=function(){vara=xf.svg.line().x(bh?function(a){returnV(a.id)(a.value)}:Cd).y(bh?Cd:function(a){returnV(a.id)(a.value)});returnYh||(a=a.defined(function(a){returnnull!=a.value})),function(b){varc,d,e=Yh?Ge(b.values):b.values;returnfe(b)?(a.interpolate(ge(b)?"cardinal":"linear"),Fg[b.id]?Ve(e,jg,V(b.id),Fg[b.id]):a(e)):(c=e[0]?jg(e[0].x):0,d=e[0]?V(b.id)(e[0].value):0,bh?"M "+d+" "+c:"M "+c+" "+d)}}(),bj=function(){vara;returna=bh?xf.svg.area().x0(function(a){returnV(a.id)(0)}).x1(function(a){returnV(a.id)(a.value)}).y(Cd):xf.svg.area().x(Cd).y0(function(a){returnV(a.id)(0)}).y1(function(a){returnV(a.id)(a.value)}),function(b){varc,d,e=Ge(b.values);return_d([b],"area")||_d([b],"area-spline")?(a.interpolate(ge(b)?"cardinal":"linear"),a(e)):(c=e[0]?jg(e[0].x):0,d=e[0]?V(b.id)(e[0].value):0,bh?"M "+d+" "+c:"M "+c+" "+d)}}(),cj=function(){vara=xf.svg.line().x(bh?function(a){returnW(a.id)(a.value)}:Fd).y(bh?Fd:function(a){returnW(a.id)(a.value)});returnfunction(b){varc=Ge(b.values);returnfe(b)?a(c):"M "+mg(c[0].x)+" "+W(b.id)(c[0].value)}}(),dj=function(){};_i=xf.svg.brush().on("brush",cf),_i.update=function(){returnhj&&hj.select("."+f.brush).call(this),this},_i.scale=function(a){returnbh?this.y(a):this.x(a)},Ff&&(dj=xf.behavior.zoom().on("zoomstart",function(){dj.altDomain=xf.event.sourceEvent.altKey?jg.orgDomain():null}).on("zoom",Ff?df:null),dj.scale=function(a){returnbh?this.y(a):this.x(a)},dj.orgScaleExtent=function(){vara=Gf?Gf:[1,10];return[a[0],Math.max(zc()/a[1],a[1])]},dj.updateScaleExtent=function(){vara=ac(jg.orgDomain())/ac(lj),b=this.orgScaleExtent();returnthis.scaleExtent([b[0]*a,b[1]*a]),this});varej,fj,gj,hj,ij,jj,kj,lj,mj,nj={};if(yf.focus=function(a){functionb(a){Ic(a).transition().duration(100).style("opacity",1)}varc=ej.selectAll(md(a)),d=c.filter(tf),e=c.filter(uf);yf.revert(),yf.defocus(),b(d.classed(f.focused,!0)),b(e),ee(yf.data.targets)&&Nb(a,!0),of(a,!0)},yf.defocus=function(a){functionb(a){Ic(a).transition().duration(100).style("opacity",.3)}varc=ej.selectAll(md(a)),d=c.filter(tf),e=c.filter(uf);yf.revert(),b(d.classed(f.focused,!1)),b(e),ee(yf.data.targets)&&Ob(a),of(a,!1)},yf.revert=function(a){functionb(a){Ic(a).transition().duration(100).style("opacity",1)}varc=ej.selectAll(md(a)),d=c.filter(tf),e=c.filter(uf);b(d.classed(f.focused,!1)),b(e),ee(yf.data.targets)&&Ob(a),pf()},yf.show=function(a,b){a=Dc(a),b=b||{},Mc(a),ej.selectAll(nd(a)).transition().style("opacity",1),b.withLegend&&qf(a),bf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},yf.hide=function(a,b){a=Dc(a),b=b||{},Lc(a),ej.selectAll(nd(a)).transition().style("opacity",0),b.withLegend&&rf(a),bf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},yf.toggle=function(a){Gc(a)?yf.hide(a):yf.show(a)},yf.unzoom=function(){_i.clear().update(),bf({withUpdateXDomain:!0})},yf.load=function(a){returna.xs&&nc(a.xs),"classes"ina&&Object.keys(a.classes).forEach(function(b){yg[b]=a.classes[b]}),"categories"ina&&Bi&&(fh=a.categories,pg.categories(fh)),"cacheIds"ina&&bc(a.cacheIds)?voidjf(dc(a.cacheIds),a.done):void("unload"ina?lf(Dc("boolean"==typeofa.unload&&a.unload?null:a.unload),function(){kf(a)}):kf(a))},yf.unload=function(a,b){lf(Dc(a),function(){bf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),"function"==typeofb&&b()})},yf.selected=function(a){returnxf.merge(gj.selectAll("."+f.shapes+ld(a)).selectAll("."+f.shape).filter(function(){returnxf.select(this).classed(f.SELECTED)}).map(function(a){returna.map(function(a){returna.__data__})}))},yf.select=function(a,b,c){Jg&&gj.selectAll("."+f.shapes).selectAll("."+f.shape).each(function(e,g){varh=xf.select(this),i="circle"===this.nodeName?Ae:De,j="circle"===this.nodeName?Be:Ee,k=Kg||!a||a.indexOf(e.id)>=0,l=!b||b.indexOf(g)>=0,m=h.classed(f.SELECTED);k&&l?Lg(e)&&!m&&i(h.classed(f.SELECTED,!0),e,g):d(c)&&c&&m&&j(h.classed(f.SELECTED,!1),e,g)})},yf.unselect=function(a,b){Jg&&gj.selectAll("."+f.shapes).selectAll("."+f.shape).each(function(c,d){vare=xf.select(this),g="circle"===this.nodeName?Be:Ee,h=Kg||!a||a.indexOf(c.id)>=0,i=!b||b.indexOf(d)>=0,j=e.classed(f.SELECTED);h&&i&&Lg(c)&&j&&g(e.classed(f.SELECTED,!1),c,d)})},yf.toLine=function(a){wf(a,"line")},yf.toSpline=function(a){wf(a,"spline")},yf.toBar=function(a){wf(a,"bar")},yf.toScatter=function(a){wf(a,"scatter")},yf.toArea=function(a){wf(a,"area")},yf.toAreaSpline=function(a){wf(a,"area-spline")
},yf.toPie=function(a){wf(a,"pie",{withTransform:!0})},yf.toDonut=function(a){wf(a,"donut",{withTransform:!0})},yf.groups=function(a){returnc(a)?zg:(zg=a,bf(),zg)},yf.xgrids=function(a){returna?(Oh=a,bf(),Oh):Oh},yf.xgrids.add=function(a){returna?yf.xgrids(Oh.concat(a)):void0},yf.xgrids.remove=function(a){varb=vf(a);returnyf.xgrids(Oh.filter(b))},yf.ygrids=function(a){returna?(Qh=a,bf(),Qh):Qh},yf.ygrids.add=function(a){returna?yf.ygrids(Qh.concat(a)):void0},yf.ygrids.remove=function(a){varb=vf(a);returnyf.ygrids(Qh.filter(b))},yf.regions=function(a){returnc(a)?mi:(mi=a,bf(),mi)},yf.regions.add=function(a){returnc(a)?mi:(mi=mi.concat(a),bf(),mi)},yf.regions.remove=function(a,c){vare=[].concat(a);returnc=d(c)?c:{},e.forEach(function(a){vard=b(c.duration)?c.duration:0;ej.selectAll("."+a).transition().duration(d).style("fill-opacity",0).remove(),mi=mi.filter(function(b){returnb.classes.indexOf(a)<0})}),mi},yf.data.get=function(a){varb=yf.data.getAsTarget(a);returnd(b)?b.values.map(function(a){returna.value}):void0},yf.data.getAsTarget=function(a){varb=Fc(function(b){returnb.id===a});returnb.length>0?b[0]:void0},yf.data.names=function(a){returnarguments.length?(Object.keys(a).forEach(function(b){xg[b]=a[b]}),sf(Cc(yf.data.targets),{withTransition:!0}),xg):xg},yf.x=function(a){returnarguments.length&&(qc(yf.data.targets,a),bf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),yf.data.xs},yf.xs=function(a){returnarguments.length&&(rc(yf.data.targets,a),bf({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),yf.data.xs},yf.axis.labels=function(a){arguments.length&&(Object.keys(a).forEach(function(b){bb(b,a[b])}),Db())},yf.axis.max=function(a){arguments.length&&("object"==typeofa?(b(a.y)&&(vh=+a.y),b(a.y2)&&(Eh=+a.y2)):vh=Eh=+a,bf())},yf.axis.min=function(a){arguments.length&&("object"==typeofa?(b(a.y)&&(wh=+a.y),b(a.y2)&&(Fh=+a.y2)):wh=Fh=+a,bf())},yf.axis.range=function(a){arguments.length&&("undefined"!=typeofa.max&&yf.axis.max(a.max),"undefined"!=typeofa.min&&yf.axis.min(a.min))},yf.legend.show=function(a){qf(Dc(a)),bf({withLegend:!0})},yf.legend.hide=function(a){rf(Dc(a)),bf({withLegend:!0})},yf.resize=function(a){Bf=a?a.width:null,Cf=a?a.height:null,gf({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},yf.destroy=function(){yf.data.targets=void0,yf.data.xs={},kj.html(""),a.onresize=null},"url"ine.data)xf.xhr(e.data.url,function(a,b){varc,d=xf.csv.parseRows(b.response);1===d.length?(c=[{}],d[0].forEach(function(a){c[0][a]=null})):c=xf.csv.parse(b.response),We(c)});elseif("rows"ine.data)We(tc(e.data.rows));else{if(!("columns"ine.data))throwError("url or rows or columns is required.");We(uc(e.data.columns))}returnyf},"function"==typeofa.define&&a.define.amd?a.define("c3",["d3"],e):a.c3=e}(window);