varu=2*o;for(h=o;1>=h;h+=u)s+=i(a[g-1],a[g],h,o)}r=a[g].x}returns}functioncf(b){varc,d,e;if(vj=Gf.select(Jf),vj.empty())thrownewError('Bind element not found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');if(vj.html("").classed("c3",!0),Hf.data.xs={},Hf.data.targets=vc(b),Tg&&Lc(Tg===!0?Cc(Hf.data.targets):Tg),o(),S(),ug.domain(Gf.extent(_b(Hf.data.targets))),vg.domain(Xb(Hf.data.targets,"y")),wg.domain(Xb(Hf.data.targets,"y2")),xg.domain(ug.domain()),yg.domain(vg.domain()),zg.domain(wg.domain()),wj=ug.domain(),kj.scale(xg),Qf&&oj.scale(ug),pj=vj.append("svg").on("mouseenter",Tf).on("mouseleave",Uf),qj=pj.append("defs"),qj.append("clipPath").attr("id",Fi).append("rect"),qj.append("clipPath").attr("id",Gi).append("rect"),qj.append("clipPath").attr("id",Hi).append("rect"),pf(),rj=pj.append("g").attr("transform",bj.main),sj=pj.append("g").attr("transform",bj.context),tj=pj.append("g").attr("transform",bj.legend),dh||sj.style("visibility","hidden"),gh||(tj.style("visibility","hidden"),Yi=Cc(Hf.data.targets)),uj=Gf.select(Jf).style("position","relative").append("div").style("position","absolute").style("pointer-events","none").style("z-index","10").style("display","none"),Bf(Cc(Hf.data.targets),{withTransform:!1,withTransitionForTransform:!1}),d=rj.append("g").attr("clip-path",Ii).attr("class",g.grid),Xh&&d.append("g").attr("class",g.xgrids),Ce(Zh)&&d.append("g").attr("class",g.xgridLines),di&&d.append("g").attr("class",g.xgridFocus).append("line").attr("class",g.xgridFocus),$h&&d.append("g").attr("class",g.ygrids),Ce(_h)&&d.append("g").attr("class",g.ygridLines),nh&&rj.append("g").attr("class",g.axisX).attr("clip-path",Ji).attr("transform",bj.x).append("text").attr("class",g.axisXLabel).attr("transform",mh?"rotate(-90)":"").style("text-anchor",Ab),Fh&&rj.append("g").attr("class",g.axisY).attr("clip-path",Ki).attr("transform",bj.y).append("text").attr("class",g.axisYLabel).attr("transform",mh?"":"rotate(-90)").style("text-anchor",Bb),Oh&&rj.append("g").attr("class",g.axisY2).attr("transform",bj.y2).append("text").attr("class",g.axisY2Label).attr("transform",mh?"":"rotate(-90)").style("text-anchor",Cb),rj.append("g").attr("clip-path",Ii).attr("class",g.regions),rj.append("g").attr("clip-path",Ii).attr("class",g.chart),c=rj.select("."+g.chart).append("g").attr("class",g.eventRects).style("fill-opacity",0).style("cursor",Qf?mh?"ns-resize":"ew-resize":null),rj.select("."+g.chart).append("g").attr("class",g.chartBars),rj.select("."+g.chart).append("g").attr("class",g.chartLines),rj.select("."+g.chart).append("g").attr("class",g.chartArcs).attr("transform",bj.arc).append("text").attr("class",g.chartArcsTitle).style("text-anchor","middle").text(Rb()),rj.select("."+g.chart).append("g").attr("class",g.chartTexts),Qf&&rj.insert("rect",Sf?null:"g."+g.grid).attr("class",g.zoomRect).attr("width",_f).attr("height",bg).style("opacity",0).style("cursor",mh?"ns-resize":"ew-resize").call(oj).on("dblclick.zoom",null),Dh&&kj.extent("function"!=typeofDh?Dh:Dh(_b())),sj.append("g").attr("clip-path",Ii).attr("class",g.chart),sj.select("."+g.chart).append("g").attr("class",g.chartBars),sj.select("."+g.chart).append("g").attr("class",g.chartLines),sj.append("g").attr("clip-path",Ii).attr("class",g.brush).call(kj).selectAll("rect").attr(mh?"width":"height",mh?ag:cg),sj.append("g").attr("class",g.axisX).attr("transform",bj.subx).attr("clip-path",mh?"":Ji),rf(Hf.data.targets),mh?rj.select("."+g.axisX).style("opacity",0).call(Ag):(rj.select("."+g.axisY).style("opacity",0).call(Bg),rj.select("."+g.axisY2).style("opacity",0).call(Cg)),o(),S(),pf(),n(!1),lf({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1}),Ci){if(Li&&"string"==typeofDi){for(Di=xe(Di),e=0;e<Hf.data.targets[0].values.length&&Hf.data.targets[0].values[e].x-Di!==0;e++);Di=e}uj.html(Bi(Hf.data.targets.map(function(a){returnpc(a.values[Di])}),_(),zd(ie(Hf.data.targets)),Ui)),uj.style("top",Ei.top).style("left",Ei.left).style("display","block")}null==a.onresize&&(a.onresize=of()),a.onresize.