YUI.add("series-fill-util",function(i,t){var u=i.Lang;function e(){}e.ATTRS={area:{getter:function(){return this._defaults||this._getAreaDefaults()},setter:function(t){var e=this._defaults||this._getAreaDefaults();this._defaults=i.merge(e,t)}}},e.prototype={_getPath:function(){var t=this._path;return t||(t=this.get("graphic").addShape({type:"path"}),this._path=t),t},_toggleVisible:function(t){this._path&&this._path.set("visible",t)},drawFill:function(t,e){if(!(t.length<1)){var i,s,r=u.isNumber,o=t.length,n=t[0],h=e[0],l=!0,a=0,d=this.get("styles").area,g=this._getPath(),c=d.color||this._getDefaultColor(this.get("graphOrder"),"slice");for(g.clear(),g.set("fill",{color:c,opacity:d.alpha}),g.set("stroke",{weight:0});a<o;a=++a)i=t[a],s=e[a],r(i)&&r(s)&&(l?(this._firstValidX=i,this._firstValidY=s,l=!1,g.moveTo(i,s)):g.lineTo(i,s),n=i,h=s);this._lastValidX=n,this._lastValidY=h,g.end()}},drawAreaSpline:function(){if(!(this.get("xcoords").length<1)){var t,e,i,s,r,o,n=this.get("xcoords"),h=this.get("ycoords"),l=this.getCurveControlPoints(n,h),a=l.length,d=0,n=n[0],h=h[0],g=this.get("styles").area,c=this._getPath(),u=g.color||this._getDefaultColor(this.get("graphOrder"),"slice");for(c.set("fill",{color:u,opacity:g.alpha}),c.set("stroke",{weight:0}),c.moveTo(n,h);d<a;d=++d)r=l[d].endx,o=l[d].endy,t=l[d].ctrlx1,e=l[d].ctrlx2,i=l[d].ctrly1,s=l[d].ctrly2,c.curveTo(t,i,e,s,r,o);"vertical"===this.get("direction")?(c.lineTo(this._leftOrigin,o),c.lineTo(this._leftOrigin,h)):(c.lineTo(r,this._bottomOrigin),c.lineTo(n,this._bottomOrigin)),c.lineTo(n,h),c.end()}},drawStackedAreaSpline:function(){if(!(this.get("xcoords").length<1)){var t,e,i,s,r,o,n=this.get("xcoords"),h=this.get("ycoords"),l=this.get("order"),a=this.get("seriesTypeCollection"),d=0,g=this.get("styles").area,c=this._getPath(),u=g.color||this._getDefaultColor(this.get("graphOrder"),"slice"),_=n[0],f=h[0],p=this.getCurveControlPoints(n,h),x=p.length;for(c.set("fill",{color:u,opacity:g.alpha}),c.set("stroke",{weight:0}),c.moveTo(_,f);d<x;d=++d)r=p[d].endx,o=p[d].endy,t=p[d].ctrlx1,e=p[d].ctrlx2,i=p[d].ctrly1,s=p[d].ctrly2,c.curveTo(t,i,e,s,r,o);if(0<l)for(u=a[l-1].get("xcoords").concat().reverse(),g=a[l-1].get("ycoords").concat().reverse(),x=(p=this.getCurveControlPoints(u,g)).length,c.lineTo(u[d=0],g[0]);d<x;d=++d)r=p[d].endx,o=p[d].endy,t=p[d].ctrlx1,e=p[d].ctrlx2,i=p[d].ctrly1,s=p[d].ctrly2,c.curveTo(t,i,e,s,r,o);else"vertical"===this.get("direction")?(c.lineTo(this._leftOrigin,h[h.length-1]),c.lineTo(this._leftOrigin,f)):(c.lineTo(n[n.length-1],this._bottomOrigin),c.lineTo(_,this._bottomOrigin));c.lineTo(_,f),c.end()}},_defaults:null,_getClosingPoints:function(){var t,e,i=this.get("xcoords").concat(),s=this.get("ycoords").concat();return"vertical"===this.get("direction")?(e=this._getLastValidIndex(i),t=this._getFirstValidIndex(i),s.push(s[e]),s.push(s[t]),i.push(this._leftOrigin),i.push(this._leftOrigin)):(e=this._getLastValidIndex(s),t=this._getFirstValidIndex(s),i.push(i[e]),i.push(i[t]),s.push(this._bottomOrigin),s.push(this._bottomOrigin)),i.push(i[0]),s.push(s[0]),[i,s]},_getHighestValidOrder:function(t,e,i,s){for(var r,o="vertical"===s?"stackedXCoords":"stackedYCoords";isNaN(r)&&-1<i;)-1<(i-=1)&&(r=t[i].get(o)[e]);return i},_getCoordsByOrderAndIndex:function(t,e,i,s){var r,s="vertical"===s?(r=i<0?this._leftOrigin:t[i].get("stackedXCoords")[e],this.get("stackedYCoords")[e]):(r=this.get("stackedXCoords")[e],i<0?this._bottomOrigin:t[i].get("stackedYCoords")[e]);return[r,s]},_getStackedClosingPoints:function(){var t,e,i,s,r,o,n,h,l,a,d,g,c,u=this.get("order"),_=this.get("direction"),f=this.get("seriesTypeCollection"),p=this.get("stackedXCoords"),x=this.get("stackedYCoords");if(u<1)return this._getClosingPoints();for(o=(r=f[u-1]).get("stackedXCoords").concat(),n=r.get("stackedYCoords").concat(),r="vertical"===_?(t=this._getFirstValidIndex(p),e=this._getLastValidIndex(p),s=r._getFirstValidIndex(o),r._getLastValidIndex(o)):(t=this._getFirstValidIndex(x),e=this._getLastValidIndex(x),s=r._getFirstValidIndex(n),r._getLastValidIndex(n)),i=t<=r&&s<=e?(s=Math.max(t,s),r=Math.min(e,r),o=o.slice(s,r+1),n=n.slice(s,r+1),s):e,l=[p[t]],a=[x[t]],d=t;(isNaN(g)||g<u-1)&&d<=i;)c=g,g=this._getHighestValidOrder(f,d,u,_),!isNaN(c)&&c<g&&(h=this._getCoordsByOrderAndIndex(f,d,c,_),l.push(h[0]),a.push(h[1])),h=this._getCoordsByOrderAndIndex(f,d,g,_),l.push(h[0]),a.push(h[1]),d+=1;for(o&&0<o.length&&t<r&&s<e&&(l=l.concat(o),a=a.concat(n),g=u-1),d=Math.max(t,r),u-=1,g=NaN;d<=e;)c=g,g=this._getHighestValidOrder(f,d,u,_),isNaN(c)||(c<g?(h=this._getCoordsByOrderAndIndex(f,d,c,_),l.push(h[0]),a.push(h[1])):g<c&&(h=this._getCoordsByOrderAndIndex(f,d-1,g,_),l.push(h[0]),a.push(h[1]))),h=this._getCoordsByOrderAndIndex(f,d,g,_),l.push(h[0]),a.push(h[1]),d+=1;return l.reverse(),a.reverse(),[p.concat(l),x.concat(a)]},_getAreaDefaults:function(){return{}}},i.augment(e,i.Attribute),i.Fills=e},"patched-v3.18.7");