webpackJsonp([1],{1079:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this._levels=[],this._invalidated=!0,this._baseTrendRenderer=new a,this._edgeTrendRenderer=new a}var r=i(8).Point,s=i(371).LineSourcePaneView,a=i(110).TrendLineRenderer,o=i(375),l=i(11),h=i(53).CompositeRenderer,d=i(1236).ArcWedgeRenderer,c=i(74).LineEnd;inherit(n,s),n.prototype.update=function(){this._invalidated=!0},n.prototype._updateImpl=function(){var e,t,i,n,a,o,l,h,d,c,p,_,u,f,g,v,w,y,m;if(s.prototype._updateImpl.call(this),this._cacheState=this._source.getCache().updateSource(this._source),this._levels=[],!(this._points.length<3))for(e=this._points,t=e[0],i=e[1],n=e[2],a=i.subtract(t).normalized(),o=n.subtract(t).normalized(),l=new r(1,0),h=new r(0,1),d=Math.acos(a.dotProduct(l)),a.dotProduct(h)<0&&(d=2*Math.PI-d),this._edge1=d,c=Math.acos(o.dotProduct(l)),o.dotProduct(h)<0&&(c=2*Math.PI-c),this._edge2=c,dMath.PI&&(this._edge1=Math.min(d,c),this._edge2=Math.max(d,c)-2*Math.PI),p=this._source.properties(),_=1;_<=this._source.getCache().levelsCount();_++)u="level"+_,f=p[u],f.visible.value()&&(g=f.coeff.value(),v=f.color.value(),w=i.subtract(t).length()*g,y=a.add(o).scaled(.5).normalized().scaled(w),m=t.add(y),this._levels.push({coeff:g,color:v,radius:w,labelPoint:m,p1:t.add(a.scaled(w)),p2:t.add(o.scaled(w)),linewidth:f.linewidth.value(),linestyle:f.linestyle.value(),index:_}))},n.prototype.renderer=function(){var e,t,i,n,r,s,a,p,_,u,f,g,v,w,y,m,x,b,S,P;if(this._invalidated&&(this._updateImpl(),this._invalidated=!1),e=new h,this._points.length<2)return e;if(t=this._source.properties(),i=this._points,n=i[0],r=i[1],s={points:[n,r],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:t.trendline.color.value(),linewidth:t.trendline.visible.value()?t.trendline.linewidth.value():0,linestyle:t.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:c.Normal,rightend:c.Normal},this._baseTrendRenderer.setData(s),e.append(this._baseTrendRenderer),this._points.length<3)return this.addAnchors(e),e;for(a=i[2],p=a.data,_=r.subtract(n).length(),u=a.subtract(n).normalized(),a=n.add(u.scaled(_)),a.data=p,s={points:[n,a],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:t.trendline.color.value(),linewidth:t.trendline.visible.value()?t.trendline.linewidth.value():0,linestyle:t.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:c.Normal,rightend:c.Normal},this._edgeTrendRenderer.setData(s),e.append(this._edgeTrendRenderer),f=this._model._fibWedgeLabelsCache,g=f.canvas().get(0),v=this._levels.length-1;v>=0;v--)if(w=this._levels[v],y={},y.center=this._points[0],y.radius=w.radius,y.prevRadius=v>0?this._levels[v-1].radius:0,y.edge=this._edge,y.color=w.color,y.linewidth=w.linewidth,y.edge1=this._edge1,y.edge2=this._edge2,y.p1=w.p1,y.p2=w.p2,y.fillBackground=t.fillBackground.value(),y.transparency=t.transparency.value(),m=new d,m.setData(y), m.setHitTest(new l(l.MOVEPOINT,null,w.index)),e.append(m),t.showCoeffs.value()){if(!(x=this._cacheState.preparedCells.cells[this._levels[v].index-1]))continue;b={left:x.left,top:f.topByRow(this._cacheState.row),width:x.width,height:f.rowHeight(this._cacheState.row)},S={left:Math.round(w.labelPoint.x-b.width),top:Math.round(w.labelPoint.y-b.height/2),width:x.width,height:b.height},P=new o(g,b,S),e.append(P)}return this.isAnchorsRequired()&&(i=[n,r],this._model.lineBeingCreated()!==this._source&&i.push(a),e.append(this.createLineAnchor({points:i}))),e},t.FibWedgePaneView=n},1080:function(e,t,i){"use strict";function n(e,t){r.call(this,e,t),this._numericFormatter=new h,this._invalidated=!0,this._bcRetracementTrend=new s,this._xdRetracementTrend=new s,this._mainTriangleRenderer=new a,this._triangleRendererPoints234=new a,this._abLabelRenderer=new o({}),this._bcLabelRenderer=new o({}),this._cdLabelRenderer=new o({}),this._xdLabelRenderer=new o({}),this._textRendererALabel=new o({}),this._textRendererBLabel=new o({}),this._textRendererCLabel=new o({}),this._textRendererDLabel=new o({}),this._textRendererXLabel=new o({})}var r=i(371).LineSourcePaneView,s=i(110).TrendLineRenderer,a=i(1217).TriangleRenderer,o=i(166).TextRenderer,l=i(53).CompositeRenderer,h=i(89).NumericFormatter,d=i(74).LineEnd;inherit(n,r),n.prototype.renderer=function(){var e,t,i,n,r,s,a,o,h,c;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._points.length<2?null:(e=this._source.properties(),t=new l,i=[this._points[0],this._points[1],this._points.length<3?this._points[1]:this._points[2]],n=this,r=function(t,i){return{points:[t],text:i,color:e.textcolor.value(),vertAlign:"middle",horzAlign:"center",font:e.font.value(),offsetX:0,offsetY:0,bold:e.bold&&e.bold.value(),italic:e.italic&&e.italic.value(),fontsize:e.fontsize.value(),backgroundColor:n._source.properties().color.value(),backgroundRoundRect:4}},s=function(e,t){return{points:[e,t],width:n._model.timeScale().width(),height:n._source.priceScale().height(),color:n._source.properties().color.value(),linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:d.Normal,rightend:d.Normal}},a={},a.points=i,a.color=e.color.value(),a.linewidth=e.linewidth.value(),a.backcolor=e.backgroundColor.value(),a.fillBackground=e.fillBackground.value(),a.transparency=e.transparency.value(),this._mainTriangleRenderer.setData(a),t.append(this._mainTriangleRenderer),this._points.length>3&&(i=[this._points[2],this._points[3],5===this._points.length?this._points[4]:this._points[3]],a={},a.points=i,a.color=e.color.value(),a.linewidth=e.linewidth.value(),a.backcolor=e.backgroundColor.value(),a.fillBackground=e.fillBackground.value(),a.transparency=e.transparency.value(),this._triangleRendererPoints234.setData(a),t.append(this._triangleRendererPoints234)),this._points.length>=3&&(o=this._points[0].add(this._points[2]).scaled(.5),h=r(o,this._numericFormatter.format(this._ABRetracement)),this._abLabelRenderer.setData(h),t.append(this._abLabelRenderer)), this._points.length>=4&&(o=this._points[1].add(this._points[3]).scaled(.5),c=s(this._points[1],this._points[3]),this._bcRetracementTrend.setData(c),t.append(this._bcRetracementTrend),h=r(o,this._numericFormatter.format(this._BCRetracement)),this._bcLabelRenderer.setData(h),t.append(this._bcLabelRenderer)),this._points.length>=5&&(o=this._points[2].add(this._points[4]).scaled(.5),h=r(o,this._numericFormatter.format(this._CDRetracement)),this._cdLabelRenderer.setData(h),t.append(this._cdLabelRenderer),c=s(this._points[0],this._points[4]),this._xdRetracementTrend.setData(c),t.append(this._xdRetracementTrend),o=this._points[0].add(this._points[4]).scaled(.5),h=r(o,this._numericFormatter.format(this._XDRetracement)),this._xdLabelRenderer.setData(h),t.append(this._xdLabelRenderer)),h=r(this._points[0],"X"),this._points[1].y>this._points[0].y?(h.vertAlign="bottom",h.offsetY=-10):(h.vertAlign="top",h.offsetY=5),this._textRendererXLabel.setData(h),t.append(this._textRendererXLabel),h=r(this._points[1],"A"),this._points[1].y2&&(h=r(this._points[2],"B"),this._points[2].y3&&(h=r(this._points[3],"C"),this._points[3].y4&&(h=r(this._points[4],"D"),this._points[4].y=3&&(e=this._source.points()[0],t=this._source.points()[1],i=this._source.points()[2],this._ABRetracement=Math.round(1e3*Math.abs((i.price-t.price)/(t.price-e.price)))/1e3),this._source.points().length>=4&&(n=this._source.points()[3],this._BCRetracement=Math.round(1e3*Math.abs((n.price-i.price)/(i.price-t.price)))/1e3),this._source.points().length>=5&&(s=this._source.points()[4],this._CDRetracement=Math.round(1e3*Math.abs((s.price-n.price)/(n.price-i.price)))/1e3,this._XDRetracement=Math.round(1e3*Math.abs((s.price-t.price)/(t.price-e.price)))/1e3)},t.Pattern5PaneView=n},1135:function(e,t,i){"use strict";function n(e,t){a.call(this,e,t),this._rendererCache={},this._invalidated=!0,this._trendLineRenderer=new o}var r=i(8).Point,s=i(373).RectangleRenderer,a=i(371).LineSourcePaneView,o=i(110).TrendLineRenderer,l=i(375),h=i(11),d=i(53).CompositeRenderer,c=i(74).LineEnd;inherit(n,a),n.prototype.update=function(){this._invalidated=!0},n.prototype._updateImpl=function(){var e,t,i,n,r,s,o,l,h,d,c,p,_,u,f ;if(a.prototype._updateImpl.call(this),this._cacheState=this._model._fibRetracementLabelsCache.updateSource(this._source),!(this._source.points().length<2)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty()&&(e=this._source.points()[0],t=this._source.points()[1],i=!1,n=this._source.properties(),n.reverse&&n.reverse.value()&&(i=n.reverse.value()),this._levels=[],r=i?t.price-e.price:e.price-t.price,s=i?e.price:t.price,!this._source.priceScale().isPercent()||null!==(o=this._source.ownerSource().firstValue())))for(l=this._source.levelsCount(),h=1;h<=l;h++)d="level"+h,c=n[d],c.visible.value()&&(p=c.coeff.value(),_=c.color.value(),u=s+p*r,this._source.priceScale().isPercent()&&(u=this._source.priceScale().priceRange().convertToPercent(u,o)),f=this._source.priceScale().priceToCoordinate(u),this._levels.push({color:_,y:f,linewidth:n.levelsStyle.linewidth.value(),linestyle:n.levelsStyle.linestyle.value(),index:h}))},n.prototype.renderer=function(){var e,t,i,n,a,p,_,u,f,g,v,w,y,m,x,b,S,P,R,T,L,C;if(this._invalidated&&(this._updateImpl(),this._invalidated=!1),e=new d,this._points.length<2)return e;for(t=this._points[0],i=this._points[1],n=Math.min(t.x,i.x),a=Math.max(t.x,i.x),p=this._source.properties(),_=p.fillBackground.value(),u=p.transparency.value(),f=p.extendLines.value()?this._model.timeScale().width():a,g=this._model._fibRetracementLabelsCache,v=g.canvas().get(0),w=0;w0&&_&&(y=this._levels[w-1],t=new r(n,this._levels[w].y),i=new r(f,y.y),m={},m.points=[t,i],m.color=this._levels[w].color,m.linewidth=0,m.backcolor=this._levels[w].color,m.fillBackground=!0,m.transparency=u,x=new s(void 0,void 0,!0),x.setData(m),e.append(x)),t=new r(n,this._levels[w].y),i=new r(a,this._levels[w].y),b={points:[t,i],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._levels[w].color,linewidth:this._levels[w].linewidth,linestyle:this._levels[w].linestyle,extendleft:!1,extendright:p.extendLines.value(),leftend:c.Normal,rightend:c.Normal},x=new o,x.setData(b),x.setHitTest(new h(h.MOVEPOINT,null,this._levels[w].index)),e.append(x),p.showCoeffs.value()||p.showPrices.value()){if(!this._cacheState.preparedCells)continue;if(!(S=this._cacheState.preparedCells.cells[this._levels[w].index-1]))continue;switch(p.horzLabelsAlign.value()){case"left":P=t;break;case"center":P=t.add(i).scaled(.5),P.x+=S.width/2,P.x=Math.round(P.x);break;case"right":p.extendLines.value()?P=new r(f-4,this._levels[w].y):(P=new r(f+4,this._levels[w].y),P.x+=S.width,P.x=Math.round(P.x))}R={left:S.left,top:g.topByRow(this._cacheState.row),width:S.width,height:g.rowHeight(this._cacheState.row)},T={left:P.x-R.width,top:P.y,width:S.width,height:R.height},L=p.vertLabelsAlign.value(),"middle"===L&&(T.top-=T.height/2),"bottom"===L&&(T.top-=T.height),C=new l(v,R,T),e.append(C)}return p.trendline.visible.value()&&(b={points:[this._points[0],this._points[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:p.trendline.color.value(), linewidth:p.trendline.linewidth.value(),linestyle:p.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:c.Normal,rightend:c.Normal},this._trendLineRenderer.setData(b),e.append(this._trendLineRenderer)),this.addAnchors(e),e},t.FibRetracementPaneView=n},1136:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t)}function r(e,t){a.call(this,e,t),this._rendererCache={},this._invalidated=!0,this._baseLineRenderer=new o,this._lastLevelTrendRenderer=new o}var s=i(1219).ParallelChannelRenderer,a=i(371).LineSourcePaneView,o=i(110).TrendLineRenderer,l=i(375),h=i(53).CompositeRenderer,d=i(30),c=i(74).LineEnd;inherit(n,s),n.prototype._getColor=function(){return d.generateColor(this._data.backcolor,this._data.transparency,!0)},inherit(r,a),r.prototype.update=function(){this._invalidated=!0},r.prototype._updateImpl=function(){a.prototype._updateImpl.call(this),this._cacheState=this._model._fibChannelLabelsCache.updateSource(this._source),this._floatPoints.length<3||this._source.points().length<3||(this.norm=this._floatPoints[2].subtract(this._floatPoints[0]))},r.prototype.renderer=function(){function e(e,n,r){var s,a,h,c,_;switch(i.horzLabelsAlign.value()){case"left":s=e;break;case"center":s=e.add(n).scaled(.5),s.x+=r.width/2,s.x=Math.round(s.x);break;case"right":s=n.clone(),s.x+=r.width,s.x=Math.round(s.x)}a={left:r.left,top:o.topByRow(p._cacheState.row),width:r.width,height:o.rowHeight(p._cacheState.row)},h={left:Math.round(s.x-a.width),top:Math.round(s.y),width:r.width,height:a.height},c=i.vertLabelsAlign.value(),"middle"===c&&(h.top-=h.height/2),"bottom"===c&&(h.top-=h.height),_=new l(d,a,h),t.append(_)}var t,i,r,s,a,o,d,p,_,u,f,g,v,w,y,m,x,b,S,P,R,T,L,C;if(this._invalidated&&(this._updateImpl(),this._invalidated=!1),t=new h,this._floatPoints.length<2)return this.addAnchors(t),t;if(i=this._source.properties(),r=this._floatPoints[0],s=this._floatPoints[1],this._floatPoints.length<3)return a={points:[r,s],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:i.level1.color.value(),linewidth:i.levelsStyle.linewidth.value(),linestyle:i.levelsStyle.linestyle.value(),extendleft:i.extendLeft.value(),extendright:i.extendRight.value(),leftend:c.Normal,rightend:c.Normal},this._baseLineRenderer.setData(a),t.append(this._baseLineRenderer),this.addAnchors(t),t;for(o=this._model._fibChannelLabelsCache,d=o.canvas().get(0),p=this,_=this._source.levelsCount(),u=1;u<_;u++)if(f=i["level"+u],f.visible.value()){for(g=null,v=u+1;v<=_;v++)if(w=i["level"+v],w.visible.value()){g=w;break}if(!g)break;y=this.norm.scaled(f.coeff.value()),m=r.add(y),x=s.add(y),b=this.norm.scaled(g.coeff.value()),S=r.add(b),P=s.add(b),R={},R.points=[m,x,S,P],R.color=f.color.value(),R.width=this._model.timeScale().width(),R.height=this._source.priceScale().height(),R.linewidth=i.levelsStyle.linewidth.value(),R.linestyle=i.levelsStyle.linestyle.value(),R.extendleft=i.extendLeft.value(),R.extendright=i.extendRight.value(),R.backcolor=f.color.value(),R.transparency=i.transparency.value(),R.skipTopLine=!0, R.fillBackground=i.fillBackground.value(),R.hittestOnBackground=!0,T=new n,T.setData(R),t.append(T),(i.showCoeffs.value()||i.showPrices.value())&&(L=this._cacheState.preparedCells.cells[u-1],e(m,x,L))}for(C=null,u=_;u>=1;u--)if(f=i["level"+u],f.visible.value()){C=u;break}return null!=C&&(f=i["level"+C],f.visible.value()&&(y=this.norm.scaled(f.coeff.value()),m=r.add(y),x=s.add(y),a={points:[m,x],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:f.color.value(),linewidth:i.levelsStyle.linewidth.value(),linestyle:i.levelsStyle.linestyle.value(),extendleft:i.extendLeft.value(),extendright:i.extendRight.value(),leftend:c.Normal,rightend:c.Normal},this._lastLevelTrendRenderer.setData(a),t.append(this._lastLevelTrendRenderer),(i.showCoeffs.value()||i.showPrices.value())&&e(m,x,this._cacheState.preparedCells.cells[C-1]))),this.addAnchors(t),t},t.FibChannelPaneView=r},1137:function(e,t,i){"use strict";function n(e,t,i){this._data=e,this._hittest=t||new d(d.MOVEPOINT),this._backHittest=i||new d(d.MOVEPOINT_BACKGROUND)}function r(e,t){o.call(this,e,t),this._rendererCache={},this._invalidated=!0,this._trendLineRenderer=new l}var s=i(8).Point,a=i(54),o=i(371).LineSourcePaneView,l=i(110).TrendLineRenderer,h=i(375),d=i(11),c=i(53).CompositeRenderer,p=i(30),_=i(74).LineEnd;n.prototype.draw=function(e){e.lineCap="butt",e.strokeStyle=this._data.color,e.lineWidth=this._data.linewidth,e.translate(this._data.center.x,this._data.center.y),e.beginPath(),this._data.fullCircles?e.arc(0,0,this._data.radius,2*Math.PI,0,!1):this._data.dir>0?e.arc(0,0,this._data.radius,0,Math.PI,!1):e.arc(0,0,this._data.radius,Math.PI,0,!1),e.stroke(),this._data.fillBackground&&(this._data.radius2&&(this._data.fullCircles?e.arc(0,0,this._data.radius2,2*Math.PI,0,!0):this._data.dir>0?e.arc(0,0,this._data.radius2,Math.PI,0,!0):e.arc(0,0,this._data.radius2,0,Math.PI,!0)),e.fillStyle=p.generateColor(this._data.color,this._data.transparency,!0),e.fill())},n.prototype.hitTest=function(e){var t,i,n;return a.sign(e.y-this._data.center.y)===this._data.dir||this._data.fullCircles?(t=e.subtract(this._data.center),i=t.length(),n=3,Math.abs(i-this._data.radius)0&&(u.radius2=this._levels[l-1].radius),f=new d(d.MOVEPOINT,null,p.index),e.append(new n(u,f)),i.showCoeffs.value()){if(!(g=this._cacheState.preparedCells.cells[this._levels[l].index-1]))continue;v={left:g.left,top:a.topByRow(this._cacheState.row),width:g.width,height:a.rowHeight(this._cacheState.row)},w={left:Math.round(p.labelPoint.x-v.width),top:Math.round(p.labelPoint.y-v.height/2),width:g.width,height:v.height},y=new h(o,v,w),e.append(y)}return i.trendline.visible.value()&&(m={points:[this._floatPoints[0],this._floatPoints[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:i.trendline.color.value(),linewidth:i.trendline.linewidth.value(),linestyle:i.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:_.Normal,rightend:_.Normal},this._trendLineRenderer.setData(m),e.append(this._trendLineRenderer)),this.addAnchors(e),e},t.FibSpeedResistanceArcsPaneView=r},1138:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this._baseTrendRenderer=new a,this._edgeTrendRenderer=new a,this._arcWedgeRenderer=new r}var r=i(1236).ArcWedgeRenderer,s=i(1079).FibWedgePaneView,a=i(110).TrendLineRenderer,o=i(53).CompositeRenderer,l=i(74).LineEnd;inherit(n,s),n.prototype.update=function(){s.prototype.update.call(this)},n.prototype.renderer=function(){var e,t,i,n,r,s,a,h,d,c,p,_;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),e=new o,this._points.length<2?e:(t=this._source.properties(),i=this._points,n=i[0],r=i[1],s={points:[n,r],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:t.trendline.color.value(),linewidth:t.linewidth.value(),linestyle:t.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:l.Normal,rightend:l.Normal},this._baseTrendRenderer.setData(s),e.append(this._baseTrendRenderer),this._points.length<3?(this.addAnchors(e),e):(a=i[2],h=a.data,d=r.subtract(n).length(),c=a.subtract(n).normalized(),a=n.add(c.scaled(d)),a.data=h,s={points:[n,a],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:t.trendline.color.value(),linewidth:t.linewidth.value(),linestyle:t.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:l.Normal,rightend:l.Normal},this._edgeTrendRenderer.setData(s),e.append(this._edgeTrendRenderer),p=this._levels[0],_={},_.center=this._points[0],_.radius=p.radius,_.prevRadius=0,_.edge=this._edge,_.color=t.trendline.color.value(), _.color1=t.color1.value(),_.color2=t.color2.value(),_.linewidth=t.linewidth.value(),_.edge1=this._edge1,_.edge2=this._edge2,_.p1=p.p1,_.p2=p.p2,_.fillBackground=t.fillBackground.value(),_.transparency=t.transparency.value(),_.gradient=!0,this._arcWedgeRenderer.setData(_),e.append(this._arcWedgeRenderer),this.addAnchors(e),e))},t.ProjectionLinePaneView=n},1139:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this._rendererCache={},this._trendLineRendererPoints12=new o,this._trendLineRendererPoints23=new o}var r=i(8).Point,s=i(371).LineSourcePaneView,a=i(373).RectangleRenderer,o=i(110).TrendLineRenderer,l=i(375),h=i(11),d=i(53).CompositeRenderer,c=i(74).LineEnd;inherit(n,s),n.prototype.update=function(){this._invalidated=!0},n.prototype._updateImpl=function(){var e,t,i,n,r,a,o,l,h,d,c,p,_,u,f;if(s.prototype._updateImpl.call(this),this._cacheState=this._model._trendBasedFibExtensionLabelsCache.updateSource(this._source),!(this._source.points().length<3)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty())for(e=this._source.points()[0],t=this._source.points()[1],i=this._source.points()[2],n=!1,r=this._source.properties(),r.reverse&&r.reverse.value()&&(n=r.reverse.value()),this._levels=[],a=n?e.price-t.price:t.price-e.price,this._source.priceScale().isPercent()&&(o=this._source.ownerSource().firstValue()),l=this._source.levelsCount(),h=1;h<=l;h++)d="level"+h,c=r[d],c.visible.value()&&(p=c.coeff.value(),_=c.color.value(),u=i.price+p*a,this._source.priceScale().isPercent()&&(u=this._source.priceScale().priceRange().convertToPercent(u,o)),f=this._source.priceScale().priceToCoordinate(u),this._levels.push({color:_,y:f,linewidth:r.levelsStyle.linewidth.value(),linestyle:r.levelsStyle.linestyle.value(),index:h}))},n.prototype.renderer=function(){var e,t,i,n,s,p,_,u,f,g,v,w,y,m,x,b,S,P,R,T,L,C,k,I;if(this._invalidated&&(this._updateImpl(),this._invalidated=!1),e=new d,this._points.length<2)return e;if(t=this._points[0],i=this._points[1],n=this._source.properties(),n.trendline.visible.value()&&(s={points:[t,i],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:n.trendline.color.value(),linewidth:n.trendline.linewidth.value(),linestyle:n.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:c.Normal,rightend:c.Normal},this._trendLineRendererPoints12.setData(s),e.append(this._trendLineRendererPoints12)),this._points.length<3)return this.addAnchors(e),e;for(p=this._points[2],n.trendline.visible.value()&&(s={points:[i,p],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:n.trendline.color.value(),linewidth:n.trendline.linewidth.value(),linestyle:n.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:c.Normal,rightend:c.Normal},this._trendLineRendererPoints23.setData(s),e.append(this._trendLineRendererPoints23)),_=Math.min(p.x,i.x),u=Math.max(p.x,i.x),f=n.fillBackground.value(),g=n.transparency.value(),v=n.extendLines.value()?this._model.timeScale().width():u, w=this._model._trendBasedFibExtensionLabelsCache,y=w.canvas().get(0),m=0;m0&&f&&(x=this._levels[m-1],t=new r(_,this._levels[m].y),i=new r(v,x.y),b={},b.points=[t,i],b.color=this._levels[m].color,b.linewidth=0,b.backcolor=this._levels[m].color,b.fillBackground=!0,b.transparency=g,S=new a(void 0,void 0,!0),S.setData(b),e.append(S)),t=new r(_,this._levels[m].y),i=new r(u,this._levels[m].y),s={points:[t,i],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._levels[m].color,linewidth:this._levels[m].linewidth,linestyle:this._levels[m].linestyle,extendleft:!1,extendright:n.extendLines.value(),leftend:c.Normal,rightend:c.Normal},P=new o,P.setData(s),P.setHitTest(new h(h.MOVEPOINT,null,this._levels[m].index)),e.append(P),n.showCoeffs.value()||n.showPrices.value()){if(!(R=this._cacheState.preparedCells.cells[this._levels[m].index-1]))continue;switch(n.horzLabelsAlign.value()){case"left":T=t;break;case"center":T=t.add(i).scaled(.5),T.x+=R.width/2,T.x=Math.round(T.x);break;case"right":n.extendLines.value()?T=new r(v-4,this._levels[m].y):(T=new r(v+4,this._levels[m].y),T.x+=R.width,T.x=Math.round(T.x))}L={left:R.left,top:w.topByRow(this._cacheState.row),width:R.width,height:w.rowHeight(this._cacheState.row)},C={left:T.x-L.width,top:T.y,width:R.width,height:L.height},k=n.vertLabelsAlign.value(),"middle"===k&&(C.top-=C.height/2),"bottom"===k&&(C.top-=C.height),I=new l(y,L,C),e.append(I)}return this.addAnchors(e),e},t.TrendBasedFibExtensionPaneView=n},1140:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this._rendererCache={},this._invalidated=!0,this._numericFormatter=new d,this._trendLineRenderer=new a}var r=i(8).Point,s=i(371).LineSourcePaneView,a=i(110).TrendLineRenderer,o=i(375),l=i(11),h=i(53).CompositeRenderer,d=i(89).NumericFormatter,c=i(1237).EllipseRendererSimple,p=i(74).LineEnd;inherit(n,s),n.prototype.update=function(){this._invalidated=!0},n.prototype._updateImpl=function(){var e,t,i,n,a,o,l,h,d,c,p,_,u;if(s.prototype._updateImpl.call(this),this._cacheState=this._model._fibCirclesLabelsCache.updateSource(this._source),!(this._source.points().length<2)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty())for(e=this._points[0],t=this._points[1],this._center=e.add(t).scaled(.5),i=Math.abs(t.x-e.x),n=Math.abs(t.y-e.y),this._levels=[],a=this._source.properties(),o=this._source.levelsCount(),l=1;l<=o;l++)h="level"+l,d=a[h],d.visible.value()&&(c=d.coeff.value(),p=d.color.value(),_=[],_.push(new r(this._center.x-.5*i*c,this._center.y-.5*n*c)),_.push(new r(this._center.x+.5*i*c,this._center.y+.5*n*c)),u=new r(this._center.x,this._center.y+.5*n*c),this._levels.push({color:p,points:_,labelPoint:u,linewidth:d.linewidth.value(),linestyle:d.linestyle.value(),index:l}))},n.prototype.renderer=function(){var e,t,i,n,r,s,a,d,_,u,f,g,v,w,y;if(this._invalidated&&(this._updateImpl(),this._invalidated=!1),e=new h,this._points.length<2)return e;for(t=this._source.properties(),i=t.fillBackground.value(), n=t.transparency.value(),r=this._model._fibCirclesLabelsCache,s=r.canvas().get(0),a=0;a0&&(_.wholePoints=this._levels[a-1].points),_.fillBackground=i,_.transparency=n,u=new l(l.MOVEPOINT,null,d.index),e.append(new c(_,u)),t.showCoeffs.value()){if(!(f=this._cacheState.preparedCells.cells[this._levels[a].index-1]))continue;g={left:f.left,top:r.topByRow(this._cacheState.row),width:f.width,height:r.rowHeight(this._cacheState.row)},v={left:Math.round(d.labelPoint.x-g.width),top:Math.round(d.labelPoint.y-g.height/2),width:f.width,height:g.height},w=new o(s,g,v),e.append(w)}return t.trendline.visible.value()&&(y={points:[this._points[0],this._points[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:t.trendline.color.value(),linewidth:t.trendline.linewidth.value(),linestyle:t.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:p.Normal,rightend:p.Normal},this._trendLineRenderer.setData(y),e.append(this._trendLineRenderer)),this.addAnchors(e),e},t.FibCirclesPaneView=n},1141:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this._invalidated=!0,this._lineRenderer=new l}var r=i(8).Point,s=i(371).LineSourcePaneView,a=i(1199).PaneRendererClockIcon,o=i(53).CompositeRenderer,l=i(376).VerticalLineRenderer;inherit(n,s),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){s.prototype._updateImpl.call(this),this._invalidated=!1},n.prototype.renderer=function(){var e,t,i;return this._invalidated&&this.updateImpl(),e={},e.width=this._model.timeScale().width(),e.height=this._source.priceScale().height(),e.points=this._points,e.color=this._source.properties().linecolor.value(),e.linewidth=this._source.properties().linewidth.value(),e.linestyle=this._source.properties().linestyle.value(),this._lineRenderer.setData(e),t=new o,t.append(this._lineRenderer),this.addAnchors(t),TradingView.printing||!this._source.hasAlert.value()||this._model.readOnly()||1!==e.points.length||(i=new r(this._points[0].x,this._source.priceScale().height()/2),this._source.getAlertIsActive(function(n){t.append(new a({point1:i,color:n?e.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))})),t},t.VertLinePaneView=n},1142:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this._invalidated=!0,this._vertLineRenderer1=new a,this._vertLineRenderer2=new a,this._medianRenderer=new l}var r=i(8).Point,s=i(371).LineSourcePaneView,a=i(376).VerticalLineRenderer,o=i(373).RectangleRenderer,l=i(110).TrendLineRenderer,h=i(11),d=i(176).PaneRendererLine,c=i(53).CompositeRenderer,p=i(30),_=i(245).LineToolBarsPatternMode,u=i(74).LineEnd;inherit(n,s),n.prototype.renderer=function(){var e,t,i,n,s,a,l,f,g,v,w,y,m,x,b,S,P,R,T,L,C,k;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._pattern&&2===this._source.points().length){if(e=this._source.points()[0].index,t=this._source.points()[1].index, !(i=e0&&2===this._source.points().length?(e=this._source.priceScale(),t=this._source.firstPatternPrice(),i=this._source.pressCoeff(),e=this._source.priceScale(),n=this._source.ownerSource().firstValue(),s=e.priceRange(),e.isPercent()?(o=s.convertToPercent(t,n),a=e.priceToCoordinate(o)):a=e.priceToCoordinate(t),l=function(r){var o=(r-t)*i+t;return e.isPercent()&&(o=s.convertToPercent(o,n)),e.priceToCoordinate(o)-a},h=parseInt(this._source.properties().mode.value()),d=this._source.points()[0].index,c=this._source.points()[1].index,p=d>c?1:0,_=this._points[p],u=_.x,f=Math.abs((this._points[0].x-this._points[1].x)/(this._source._pattern.length-1)),g={0:function(e){return{high:l(e[TradingView.HIGH_PLOT]),low:l(e[TradingView.LOW_PLOT])}},1:function(e,t){return new r(u+t*f,l(e[TradingView.CLOSE_PLOT])+_.y)},2:function(e){return{open:l(e[TradingView.OPEN_PLOT]),close:l(e[TradingView.CLOSE_PLOT])}}, 3:function(e,t){return new r(u+t*f,l(e[TradingView.OPEN_PLOT])+_.y)},4:function(e,t){return new r(u+t*f,l(e[TradingView.HIGH_PLOT])+_.y)},5:function(e,t){return new r(u+t*f,l(e[TradingView.LOW_PLOT])+_.y)},6:function(e,t){return new r(u+t*f,l((e[TradingView.HIGH_PLOT]+e[TradingView.LOW_PLOT])/2)+_.y)}},this._pattern=this._source._pattern.map(g[h])):delete this._pattern)},t.BarsPatternPaneView=n},1143:function(e,t,i){"use strict";function n(e,t){a.call(this,e,t),this._invalidated=!0,this._trendLineRendererPoints12=new h,this._trendLineRendererPoints23=new h}var r=i(8).Point,s=i(376).VerticalLineRenderer,a=i(371).LineSourcePaneView,o=i(166).TextRenderer,l=i(373).RectangleRenderer,h=i(110).TrendLineRenderer,d=i(11),c=i(53).CompositeRenderer,p=i(74).LineEnd;inherit(n,a),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var e,t,i,n,r,s,o,l,h,d,c,p,_,u;if(a.prototype._updateImpl.call(this),!(this._source.points().length<3)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty()&&(e=this._source.points()[0],t=this._source.points()[1],i=this._source.points()[2],this._levels=[],t.index!==e.index&&(n=t.index-e.index,r=this._source.properties(),s=i.index,null!==this._model.timeScale().visibleBars())))for(o=1;o<=11;o++)l="level"+o,h=r[l],h.visible.value()&&(d=h.coeff.value(),c=h.color.value(),p=Math.round(s+d*n),_=this._model.timeScale().indexToCoordinate(p),u={x:_,coeff:d,color:c,linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),index:o},r.showCoeffs.value()&&(u.text=d,u.y=this._source.priceScale().height()),this._levels.push(u))},n.prototype.renderer=function(){var e,t,i,n,a,h,_,u,f,g,v,w,y,m,x,b,S,P,R,T,L;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new c,this._points.length<2)return e;if(t=this._points[0],i=this._points[1],n=this._source.properties(),n.trendline.visible.value()&&(a={points:[t,i],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:n.trendline.color.value(),linewidth:n.trendline.linewidth.value(),linestyle:n.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:p.Normal,rightend:p.Normal},this._trendLineRendererPoints12.setData(a),e.append(this._trendLineRendererPoints12)),this._points.length<3)return this.addAnchors(e),e;for(h=this._points[2],n.trendline.visible.value()&&(a={points:[i,h],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:n.trendline.color.value(),linewidth:n.trendline.linewidth.value(),linestyle:n.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:p.Normal,rightend:p.Normal},this._trendLineRendererPoints23.setData(a),e.append(this._trendLineRendererPoints23)),_=n.fillBackground.value(),u=n.transparency.value(),f=this._model.timeScale().width(),g=this._source.priceScale().height(),v=0;v0&&_&&(w=this._levels[v-1],t=new r(w.x,0),i=new r(this._levels[v].x,this._source.priceScale().height()),y={},y.points=[t,i],y.color=this._levels[v].color,y.linewidth=0, y.backcolor=this._levels[v].color,y.fillBackground=!0,y.transparency=u,m=new l(void 0,void 0,!0),m.setData(y),e.append(m)),void 0!==this._levels[v].text){switch(P=n.horzLabelsAlign.value(),P="left"===P?"right":"right"===P?"left":"center"){case"left":b=3;break;case"center":b=0;break;case"right":b=-3}switch(n.vertLabelsAlign.value()){case"top":x=new r(this._levels[v].x,0),S=5;break;case"middle":x=new r(this._levels[v].x,.5*this._levels[v].y),S=0;break;case"bottom":x=new r(this._levels[v].x,this._levels[v].y),S=-10}R={points:[x],text:""+this._levels[v].text,color:this._levels[v].color,vertAlign:"middle",horzAlign:P,font:n.font.value(),offsetX:b,offsetY:S,fontsize:12},e.append(new o(R))}T={},T.width=f,T.height=g,T.points=[new r(this._levels[v].x,0)],T.color=this._levels[v].color,T.linewidth=this._levels[v].linewidth,T.linestyle=this._levels[v].linestyle,L=new d(d.MOVEPOINT,null,this._levels[v].index),m=new s,m.setData(T),m.setHitTest(L),e.append(m)}return this.addAnchors(e),e},t.TrendBasedFibTimePaneView=n},1144:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this._levels=[],this._invalidated=!0,this._trendRenderer=new h}var r=i(8).Point,s=i(371).LineSourcePaneView,a=i(376).VerticalLineRenderer,o=i(166).TextRenderer,l=i(373).RectangleRenderer,h=i(110).TrendLineRenderer,d=i(11),c=i(53).CompositeRenderer,p=i(74).LineEnd;inherit(n,s),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var e,t,i,n,r,a,o,l,h,d;if(s.prototype._updateImpl.call(this),!(this._source.points().length<1)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty()&&(e=this._source.points()[0],2===this._source.points().length&&(t=this._source.points()[1]),i=this._source.properties(),n=this._source.points()[0].index,null!==this._model.timeScale().visibleBars()))for(this._levels=[],r=t?t.index-e.index:1,a=1;a<=11;a++)o=i["level"+a],o.visible.value()&&(l=Math.round(n+o.coeff.value()*r),h=this._model.timeScale().indexToCoordinate(l),d={index:a,x:h,color:o.color.value(),width:o.linewidth.value(),style:o.linestyle.value()},i.showLabels.value()&&(d.text=o.coeff.value(),d.y=this._source.priceScale().height()),this._levels.push(d))},n.prototype.renderer=function(){var e,t,i,n,s,h,_,u,f,g,v,w,y,m,x,b,S,P;for(this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=this._model.timeScale().width(),t=this._source.priceScale().height(),i=new c,n=this._source.properties(),s=0;s0&&n.fillBackground.value()&&(f=this._levels[s-1],g=new r(this._levels[s].x,0),v=new r(f.x,this._source.priceScale().height()),w={},w.points=[g,v],w.color=this._levels[s].color,w.linewidth=0,w.backcolor=this._levels[s].color,w.fillBackground=!0,w.transparency=n.transparency.value(),u=new l(void 0,void 0,!0), u.setData(w),i.append(u)),void 0!==this._levels[s].text){switch(b=n.horzLabelsAlign.value(),b="left"===b?"right":"right"===b?"left":"center"){case"left":m=3;break;case"center":m=0;break;case"right":m=-3}switch(n.vertLabelsAlign.value()){case"top":y=new r(this._levels[s].x,0),x=5;break;case"middle":y=new r(this._levels[s].x,.5*this._levels[s].y),x=0;break;case"bottom":y=new r(this._levels[s].x,this._levels[s].y),x=-10}S={points:[y],text:""+this._levels[s].text,color:h.color,vertAlign:"middle",horzAlign:b,font:n.font.value(),offsetX:m,offsetY:x,fontsize:12},i.append(new o(S))}return 2===this._points.length&&(P={points:[this._points[0],this._points[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:n.trendline.color.value(),linewidth:n.trendline.linewidth.value(),linestyle:n.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:p.Normal,rightend:p.Normal},this._trendRenderer.setData(P),i.append(this._trendRenderer)),this.isAnchorsRequired()&&(2===this._source.points().length?i.append(this.createLineAnchor({points:this._points})):this._points.length>0&&i.append(this.createLineAnchor({points:[new r(this._points[0].x,this._source.priceScale().height()/2)],hittestResult:d.MOVEPOINT}))),i},t.FibTimeZonePaneView=n},1145:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this._lines=[],this._invalidated=!0,this._trendRenderer=new o}var r=i(8).Point,s=i(371).LineSourcePaneView,a=i(376).VerticalLineRenderer,o=i(110).TrendLineRenderer,l=i(11),h=i(53).CompositeRenderer,d=i(74).LineEnd;inherit(n,s),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var e,t,i,n,r,a,o;if(s.prototype._updateImpl.call(this),!(this._source.points().length<2)&&(e=this._model.timeScale(),this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!e.isEmpty()&&(t=this._source.points()[0],i=this._source.points()[1],n=i?i.index-t.index:1,this._lines=[],0!==n)))if(r=e.visibleBars(),n>0)for(a=t.index,o=a;o<=r.lastBar();o+=n)this._lines.push({x:e.indexToCoordinate(o)});else for(a=t.index,o=a;o>=r.firstBar();o+=n)this._lines.push({x:e.indexToCoordinate(o)})},n.prototype.renderer=function(){var e,t,i,n,s,o,c,p,_,u,f;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new h,this._points.length<2)return e;for(t=this._points[0],i=this._points[1],n=this._source.properties(),s={points:[t,i],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:n.trendline.color.value(),linewidth:n.trendline.linewidth.value(),linestyle:n.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.Normal,rightend:d.Normal},this._trendRenderer.setData(s),e.append(this._trendRenderer),o=this._model.timeScale().width(),c=this._source.priceScale().height(),n=this._source.properties(),p=0;po.y?I.y-B.height-2*B.textBgPadding-L.y>0?k-B.height-L.y-2*B.textBgPadding:L.y-2*B.textBgPadding:I.y+B.height+B.textBgPadding+L.y>_.height?_.height-B.height-L.y:k+B.textBgPadding},this._textRenderer.setPoints([new r(C,M.y)]),t.append(this._textRenderer),this.addAnchors(t),t)},t.DateRangePaneView=n},1147:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this._invalidated=!0,this._percentageFormatter=new d,this._pipFormatter=null,this._lastSymbolInfo=null,this._topBorderRenderer=new l,this._bottomBorderRenderer=new l,this._distanceRenderer=new l,this._backgroundRenderer=new o,this._labelRenderer=new a({})}var r=i(8).Point,s=i(371).LineSourcePaneView,a=i(166).TextRenderer,o=i(373).RectangleRenderer,l=i(110).TrendLineRenderer,h=i(53).CompositeRenderer,d=i(167).PercentageFormatter,c=i(377).PipFormatter,p=i(74).LineEnd;inherit(n,s),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){s.prototype._updateImpl.call(this)},n.prototype.renderer=function(){var e,t,i,n,s,a,o,l,d,_,u,f,g,v,w,y,m,x,b,S,P,R,T,L,C,k,I,B;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new h,this._points.length<2||this._source.points().length<2?e:(t=this._source.properties(),i=t.extendLeft.value(),n=t.extendRight.value(),s=this._model.timeScale().width(),a=this._points[0],o=this._points[1],l=i?0:Math.min(a.x,o.x),d=n?s:Math.max(a.x,o.x),t.fillBackground&&t.fillBackground.value()&&(_={},_.points=[new r(l,a.y),new r(d,o.y)],_.color="white",_.linewidth=0,_.backcolor=t.backgroundColor.value(),_.fillBackground=!0,_.transparency=t.backgroundTransparency.value(),this._backgroundRenderer.setData(_),e.append(this._backgroundRenderer)),u=this,f=function(t,i,n){var r={};r.points=[i,n],r.width=u._model.timeScale().width(),r.height=u._source.priceScale().height(),r.color=u._source.properties().linecolor.value(),r.linewidth=u._source.properties().linewidth.value(),r.linestyle=CanvasEx.LINESTYLE_SOLID,r.extendleft=!1,r.extendright=!1,r.leftend=p.Normal,r.rightend=p.Normal,t.setData(r),e.append(t)},f(this._topBorderRenderer,new r(l,a.y),new r(d,a.y)),f(this._bottomBorderRenderer,new r(l,o.y),new r(d,o.y)),a=this._points[0],o=this._points[1],g=(a.x+o.x)/2,v=new r(g,a.y),w=new r(g,o.y),_={},_.points=[v,w],_.width=u._model.timeScale().width(),_.height=u._source.priceScale().height(),_.color=u._source.properties().linecolor.value(),_.linewidth=u._source.properties().linewidth.value(),_.linestyle=CanvasEx.LINESTYLE_DASHED,_.extendleft=!1,_.extendright=!1,_.leftend=p.Normal,_.rightend=p.Arrow,this._distanceRenderer.setData(_),e.append(this._distanceRenderer),y=this._source.points()[0].price, m=this._source.points()[1].price,x=m-y,b=100*x/y,S=this._model.mainSeries().symbolInfo(),S&&S!==this._lastSymbolInfo&&(this._pipFormatter=new c(S.pricescale,S.minmov,S.type,S.minmove2),this._lastSymbolInfo=S),P=this._source.priceScale().formatter().format(x)+" ("+this._percentageFormatter.format(b)+") "+(this._pipFormatter?this._pipFormatter.format(x):""),_={},m>y?(R=o.clone(),R.y-=2*t.fontsize.value(),R.x=.5*(a.x+o.x),_.points=[R]):(R=o.clone(),R.x=.5*(a.x+o.x),R.y+=.7*t.fontsize.value(),_.points=[R]),T={x:0,y:10},_.text=P,_.color=t.textcolor.value(),_.height=u._source.priceScale().height(),_.font=t.font.value(),_.offsetX=T.x,_.offsetY=T.y,_.vertAlign="middle",_.horzAlign="center",_.fontsize=t.fontsize.value(),_.backgroundRoundRect=4,_.backgroundHorzInflate=.4*t.fontsize.value(),_.backgroundVertInflate=.2*t.fontsize.value(),t.fillLabelBackground&&t.fillLabelBackground.value()&&(_.backgroundColor=t.labelBackgroundColor.value(),_.backgroundTransparency=1-t.labelBackgroundTransparency.value()/100||0),t.drawBorder&&t.drawBorder.value()&&(_.borderColor=t.borderColor.value()),L=.5*(a.x+o.x),C=o.y,k=new r(L,C),this._labelRenderer.setData(_),I=this._labelRenderer.measure(),B={x:L+_.backgroundHorzInflate+I.textBgPadding-I.width/I.textBgPadding,y:a.y>o.y?k.y-I.height-2*I.textBgPadding-T.y>0?C-I.height-T.y-2*I.textBgPadding:T.y-2*I.textBgPadding:k.y+I.height+I.textBgPadding+T.y>_.height?_.height-I.height-T.y:C+I.textBgPadding},this._labelRenderer.setPoints([new r(L,B.y)]),e.append(this._labelRenderer),this.addAnchors(e),e)},t.PriceRangePaneView=n},1148:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this._invalidated=!0,this._percentageFormatter=new d,this._pipFormatter=null,this._lastSymbolInfo=null,this._topBorderRenderer=new l,this._bottomBorderRenderer=new l,this._leftBorderRenderer=new l,this._rightBorderRenderer=new l,this._distanceLineRenderer=new l,this._distancePriceRenderer=new l,this._backgroundRenderer=new o,this._textRenderer=new a({})}var r=i(8).Point,s=i(371).LineSourcePaneView,a=i(166).TextRenderer,o=i(373).RectangleRenderer,l=i(110).TrendLineRenderer,h=i(53).CompositeRenderer,d=i(167).PercentageFormatter,c=i(379).TimeSpanFormatter,p=i(377).PipFormatter,_=i(74).LineEnd;inherit(n,s),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){s.prototype._updateImpl.call(this),this._invalidated=!1},n.prototype.renderer=function(){var e,t,i,n,s,a,o,l,d,u,f,g,v,w,y,m,x,b,S,P,R,T,L,C,k,I,B,M,A,D,E;return this._invalidated&&this.updateImpl(),e=new h,this._points.length<2||this._source.points().length<2?e:(t=this._source.properties(),t.fillBackground&&t.fillBackground.value()&&(i={},i.points=this._points,i.color="white",i.linewidth=0,i.backcolor=t.backgroundColor.value(),i.fillBackground=!0,i.transparency=t.backgroundTransparency.value(),this._backgroundRenderer.setData(i),e.append(this._backgroundRenderer)),n=this,s=function(t,i,r){var s={};s.points=[i,r],s.width=n._model.timeScale().width(),s.height=n._source.priceScale().height(), s.color=n._source.properties().linecolor.value(),s.linewidth=n._source.properties().linewidth.value(),s.linestyle=CanvasEx.LINESTYLE_SOLID,s.extendleft=!1,s.extendright=!1,s.leftend=_.Normal,s.rightend=_.Normal,t.setData(s),e.append(t)},a=this._points[0],o=this._points[1],s(this._topBorderRenderer,a,new r(o.x,a.y)),s(this._bottomBorderRenderer,new r(a.x,o.y),o),s(this._leftBorderRenderer,a,new r(a.x,o.y)),s(this._rightBorderRenderer,new r(o.x,a.y),o),l=(a.y+o.y)/2,d=new r(a.x,l),u=new r(o.x,l),i={},i.points=[d,u],i.width=n._model.timeScale().width(),i.height=n._source.priceScale().height(),i.color=n._source.properties().linecolor.value(),i.linewidth=n._source.properties().linewidth.value(),i.linestyle=CanvasEx.LINESTYLE_DASHED,i.extendleft=!1,i.extendright=!1,i.leftend=_.Normal,i.rightend=_.Arrow,this._distanceLineRenderer.setData(i),e.append(this._distanceLineRenderer),a=this._points[0],o=this._points[1],f=(a.x+o.x)/2,d=new r(f,a.y),u=new r(f,o.y),i={},i.points=[d,u],i.width=n._model.timeScale().width(),i.height=n._source.priceScale().height(),i.color=n._source.properties().linecolor.value(),i.linewidth=n._source.properties().linewidth.value(),i.linestyle=CanvasEx.LINESTYLE_DASHED,i.extendleft=!1,i.extendright=!1,i.leftend=_.Normal,i.rightend=_.Arrow,this._distancePriceRenderer.setData(i),e.append(this._distancePriceRenderer),g=this._source.points()[0].price,v=this._source.points()[1].price,w=v-g,y=100*w/g,m=this._source.points()[0].index,x=this._source.points()[1].index,b=x-m,S=this._model.timeScale().indexToUserTime(m),P=this._model.timeScale().indexToUserTime(x),R="",S&&P&&(T=(P.valueOf()-S.valueOf())/1e3,R=", "+(new c).format(T)),L=this._model.mainSeries().symbolInfo(),L&&L!==this._lastSymbolInfo&&(this._pipFormatter=new p(L.pricescale,L.minmov,L.type,L.minmove2),this._lastSymbolInfo=L),C=this._source.priceScale().formatter().format(w)+" ("+this._percentageFormatter.format(Math.round(100*y)/100)+") "+(this._pipFormatter?this._pipFormatter.format(w):"")+"\n"+$.t("{0} bars").format(b)+R,i={},v>g?(k=o.clone(),k.y-=2*t.fontsize.value(),k.x=.5*(a.x+o.x),i.points=[k]):(k=o.clone(),k.x=.5*(a.x+o.x),k.y+=.7*t.fontsize.value(),i.points=[k]),I={x:0,y:10},i.text=C,i.color=t.textcolor.value(),i.height=n._source.priceScale().height(),i.font=t.font.value(),i.offsetX=I.x,i.offsetY=I.y,i.padding=5,i.vertAlign="middle",i.horzAlign="center",i.fontsize=t.fontsize.value(),i.backgroundRoundRect=4,i.backgroundHorzInflate=.4*t.fontsize.value(),i.backgroundVertInflate=.2*t.fontsize.value(),t.fillLabelBackground&&t.fillLabelBackground.value()&&(i.backgroundColor=t.labelBackgroundColor.value(),i.backgroundTransparency=1-t.labelBackgroundTransparency.value()/100||0),t.drawBorder&&t.drawBorder.value()&&(i.borderColor=t.borderColor.value()),B=.5*(a.x+o.x),M=o.y,A=new r(B,M),this._textRenderer.setData(i),D=this._textRenderer.measure(),E={x:B+i.backgroundHorzInflate+D.textBgPadding-D.width/D.textBgPadding, y:a.y>o.y?A.y-D.height-2*D.textBgPadding-I.y>0?M-D.height-I.y+D.textBgPadding:I.y-2*D.textBgPadding:A.y+D.height+D.textBgPadding+I.y>i.height?i.height-D.height-I.y:M+D.textBgPadding},this._textRenderer.setPoints([new r(B,E.y)]),e.append(this._textRenderer),this.addAnchors(e),e)},t.DateAndPriceRangePaneView=n},1149:function(e,t,i){"use strict";function n(e,t){r.call(this,e,t),this._invalidated=!0,this._renderer=new s,this._p3=null,this._p4=null}var r=i(371).LineSourcePaneView,s=i(1219).ParallelChannelRenderer,a=i(1199).PaneRendererClockIcon,o=i(53).CompositeRenderer;inherit(n,r),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var e,t,i,n,s,a,o,l,h,d,c;r.prototype._updateImpl.call(this),this._source.priceScale()&&!this._source.priceScale().isEmpty()&&0!==this._source.points().length&&(this._source._priceOffset||this._source.calculatePriceDiff(),3===this._points.length&&this._source._priceOffset&&(e=this._points[0],t=this._points[1],i=this._source._priceOffset+this._source.points()[0].price,n=this._source._priceOffset+this._source.points()[1].price,this._p3=e.clone(),this._p4=t.clone(),s=this._source.priceScale(),s.isLog()?(a=.5*(i+n)-this._source._priceOffset,o=.5*(i+n),l=this._source.priceScale().priceToCoordinate(a),h=this._source.priceScale().priceToCoordinate(o),d=h-l,this._p3.y+=d,this._p4.y+=d):(s.isPercent()&&(c=this._source.ownerSource().firstValue(),i=s.priceRange().convertToPercent(i,c),n=s.priceRange().convertToPercent(n,c)),this._p3.y=this._source.priceScale().priceToCoordinate(i),this._p4.y=this._source.priceScale().priceToCoordinate(n))))},n.prototype.renderer=function(){var e,t,i,n,r,s;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),e={},e.points=[],this._points.length>1&&(e.points.push(this._points[0]),e.points.push(this._points[1])),this._points.length>2&&null!==this._p3&&null!==this._p4&&(e.points.push(this._p3),e.points.push(this._p4)),e.color=this._source.properties().linecolor.value(),e.width=this._model.timeScale().width(),e.height=this._source.priceScale().height(),t=this._source.properties(),e.linewidth=t.linewidth.value(),e.linestyle=t.linestyle.value(),e.extendleft=t.extendLeft.value(),e.extendright=t.extendRight.value(),e.fillBackground=t.fillBackground.value(),e.backcolor=t.backgroundColor.value(),e.transparency=t.transparency.value(),e.showMidline=t.showMidline.value(),e.midlinewidth=t.midlinewidth.value(),e.midlinestyle=t.midlinestyle.value(),e.midcolor=t.midlinecolor.value(),e.fillBackground=t.fillBackground.value(),e.hittestOnBackground=!0,this._renderer.setData(e),i=new o,i.append(this._renderer),this.isAnchorsRequired()&&(n=[],this._points[0]&&n.push(this._points[0]),this._points[1]&&n.push(this._points[1]),this._p3&&(n.push(this._p3.add(this._p4).scaled(.5)),n[n.length-1].data=n.length-1),r=3===this._points.length&&!this._p3,this._model.lineBeingCreated()!==this._source||r||n.pop(),i.append(this.createLineAnchor({points:n}))), !TradingView.printing&&this._source.hasAlert.value()&&!this._model.readOnly()&&this._points.length>=2&&(s=this._points,this._source.getAlertIsActive(function(e){i.append(new a({point1:s[0],point2:s[1],color:e?t.linecolor.value():defaults("chartproperties.alertsProperties.drawingIcon.color")}))})),i},t.ParallelChannelPaneView=n},1150:function(e,t,i){"use strict";function n(){this._data=null}function r(e,t){a.call(this,e,t),this._label=null,this._rendererCache={},this._invalidated=!0,this._pipFormatter=null,this._lastSymbolInfo=null,this._trendLineRenderer=new h,this._angleRenderer=new n,this._angleLabelRenderer=new l({})}var s=i(8).Point,a=i(371).LineSourcePaneView,o=i(405).TrendLineStatsRenderer,l=i(166).TextRenderer,h=i(110).TrendLineRenderer,d=i(53).CompositeRenderer,c=i(167).PercentageFormatter,p=i(131).SelectionRenderer,_=i(377).PipFormatter,u=i(74).LineEnd,f=i(386).LabelSettings,g=i(1199).PaneRendererClockIcon;n.prototype.setData=function(e){this._data=e},n.prototype.hitTest=function(){return null},n.prototype.draw=function(e){var t,i;null!==this._data&&(e.save(),e.translate(this._data.point.x,this._data.point.y),e.strokeStyle=this._data.color,t=[1,2],"function"==typeof e.setLineDash?e.setLineDash(t):void 0!==e.mozDash?e.mozDash=t:void 0!==e.webkitLineDash&&(e.webkitLineDash=t),i=this._data.size,e.beginPath(),e.moveTo(0,0),e.lineTo(i,0),e.arc(0,0,i,0,-this._data.angle,this._data.angle>0),e.stroke(),e.restore())},inherit(r,a),r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){var e,t,i,n,r,o,l,h,d,p,u,f,g;a.prototype._updateImpl.call(this),this._points.length>0&&void 0!==this._source._angle&&(e=this._points[0],t=Math.cos(this._source._angle),i=-Math.sin(this._source._angle),n=new s(t,i),this._secondPoint=e.addScaled(n,this._source._distance),this._secondPoint.data=1,this._middlePoint=this._source.calcMiddlePoint(this._points[0],this._secondPoint)),this._label=null,this._source.points().length<2||(e=this._source.points()[0],r=this._source.points()[1],o=[],this._source.properties().showPriceRange.value()&&this._source.priceScale()&&(d=r.price-e.price,p=d/e.price,l=this._source.priceScale().formatter().format(d)+" ("+(new c).format(100*p)+")",u=this._model.mainSeries().symbolInfo(),u&&u!==this._lastSymbolInfo&&(this._pipFormatter=new _(u.pricescale,u.minmov,u.type,u.minmove2),this._lastSymbolInfo=u),l+=this._pipFormatter?", "+this._pipFormatter.format(d):"",o.push("priceRange")),f=this._source.properties().showBarsRange.value(),f&&(h="",g=r.index-e.index,h+=$.t("{0} bars").format(g),o.push("barsRange")),this._label=[l,h].filter(function(e){return e}).join("\n")||null,this._icons=o)},r.prototype.renderer=function(){var e,t,i,n,r,s,a,l,h,c,_;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new d,t={},i=this.isAnchorsRequired(),n=i||this._source.properties().alwaysShowStats.value(),r=(this.isHoveredSource()||this.isSelectedSource())&&this._source.properties().showMiddlePoint.value(), this._secondPoint&&this._points.length>0&&(t.points=[this._points[0],this._secondPoint],t.width=this._model.timeScale().width(),t.height=this._source.priceScale().height(),t.color=this._source.properties().linecolor.value(),t.linewidth=this._source.properties().linewidth.value(),t.linestyle=this._source.properties().linestyle.value(),t.extendleft=this._source.properties().extendLeft.value(),t.extendright=this._source.properties().extendRight.value(),t.leftend=u.Normal,t.rightend=u.Normal,this._trendLineRenderer.setData(t),e.append(this._trendLineRenderer),n&&this._label&&2===this._points.length&&(s={points:[this._secondPoint],text:this._label,color:this._source.properties().textcolor.value(),font:f.font,fontsize:f.fontSize,lineSpacing:f.lineSpacing,backgroundColor:f.bgColor,borderColor:f.borderColor,borderWidth:1,padding:f.padding,paddingLeft:30,doNotAlignText:!0,icons:this._icons},a=f.offset,this._points[1].y=2&&this._source.getAlertIsActive(function(i){e.append(new g({point1:t.points[0],point2:t.points[1],color:i?t.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))}),this._secondPoint&&this._points.length>0&&i&&e.append(this.createLineAnchor({points:[this._points[0],this._secondPoint]})),e},t.TrendAnglePaneView=r},1151:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this._label=null,this._rendererCache={},this._invalidated=!0,this._labelDataInvalidated=!0,this._percentageFormatter=new h,this._numericFormatter=new d,this._pipFormatter=null,this._lastSymbolInfo=null,this._trendRenderer=new u}var r=i(8).Point,s=i(371).LineSourcePaneView,a=i(375),o=i(1199).PaneRendererClockIcon,l=i(53).CompositeRenderer,h=i(167).PercentageFormatter,d=i(89).NumericFormatter,c=i(379).TimeSpanFormatter,p=i(377).PipFormatter,_=i(131).SelectionRenderer,u=i(110).TrendLineRenderer,f=i(386).LabelSettings;inherit(n,s),n.prototype.update=function(){this._invalidated=!0,this._labelDataInvalidated=!0},n.prototype.updateImpl=function(){var e,t,i,n,r,a,o,l,h,d,c=this._source.points();c.length<2||(e=c[0],t=c[1], null!==(i=this._model.timeScale().visibleBars())&&(n=this._source.properties(),e.index0&&(k=k.normalized(),C=Math.acos(k.x),k.y>0&&(C=-C))),"number"!=typeof C||TradingView.isNaN(C)||(l=Math.round(180*C/Math.PI)+"ยบ",s.push("angle"))),this._label=[a,o,l].filter(function(e){return e}).join("\n")||null,this._icons=s,this._labelDataInvalidated=!1),I={points:[this._points[1]],text:this._label,color:this._source.properties().textcolor.value(),font:f.font,fontsize:f.fontSize,lineSpacing:f.lineSpacing,backgroundColor:f.bgColor,borderColor:f.borderColor,borderWidth:1,padding:f.padding,paddingLeft:30,doNotAlignText:!0,icons:this._icons},this._points[1].y=2&&this._source.getAlertIsActive(function(i){e.append(new o({point1:t.points[0],point2:t.points[1],color:i?t.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))}),e):e},t.TrendLinePaneView=n},1152:function(e,t,i){"use strict";function n(e,t){this._data=e,this._adapter=t}function r(e,t){a.call(this,e,t),this._invalidated=!0}var s=i(8).Point,a=i(371).LineSourcePaneView,o=i(170),l=i(11);n.prototype._textWidth=function(e){var t,i;return 0===this._adapter.getText().length?0:(e.save(),e.font=this._adapter.getFont(),t=5,i=e.measureText(this._adapter.getText()).width,e.restore(),t+i)},n.prototype._drawArrow=function(e,t,i){var n,r;e.save(),e.strokeStyle=this._adapter.getArrowColor(),e.fillStyle=this._adapter.getArrowColor(),n=this._adapter.getArrowHeight(),r=this._adapter.getDirection(),e.translate(t,i),"buy"!==r&&e.rotate(Math.PI),CanvasEx.drawArrow(e,0,0,0,n),e.restore()},n.prototype._drawText=function(e,t,i){var n,r,s=this._adapter.getText();s&&(e.save(),e.textAlign="center",e.textBaseline="middle",e.font=this._adapter.getFont(),e.fillStyle=this._adapter.getTextColor(),n=t+this._textWidth(e)/2,r=i+o.fontHeight(this._adapter.getFont())/2,e.fillText(s,n,r-1),e.restore())},n.prototype.draw=function(e){var t,i,n,r,s,a,l=Math.round(this._data.points[0].x+.5),h=Math.round(this._data.points[0].y);this._drawArrow(e,l,h),0!==(t=this._textWidth(e))&&(i=this._adapter.getArrowHeight(),n=this._adapter.getArrowSpacing(),r=o.fontHeight(this._adapter.getFont()),s=this._adapter.getDirection(),a="buy"===s?h+i+n:h-i-n-r,this._drawText(e,Math.round(l-t/2),a))},n.prototype.hitTest=function(e){ var t,i,n,r=Math.round(this._data.points[0].x),s=Math.round(this._data.points[0].y),a=this._adapter.getArrowHeight();return"buy"===this._adapter.getDirection()?(t=s,i=s+a):(t=s-a,i=s),e.x>=r-2&&e.x<=r+2&&e.y>=t&&e.y<=i?(n=this._adapter.getTooltip(),new l(l.CUSTOM,{mouseDownHandler:function(){TradingView.TradingWidget&&TradingView.TradingWidget.journalDialog()},tooltip:""!==n?{text:n,rect:{x:r,y:t,w:2,h:i-t}}:null})):null},inherit(r,a),r.prototype._renderer=null,r.prototype._rendererCached=!1,r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){a.prototype._updateImpl.call(this),this._renderer=null,this._rendererCached=!1,this._invalidated=!1},r.prototype.renderer=function(e){var t,i,r,a,o,l,h,d;return this._invalidated&&this.updateImpl(),this._rendererCached?this._renderer:(this._rendererCached=!0,t=this._source,i=t.points(),0===i.length?null:(r=t._adapter,a=t._model.timeScale(),o=this._source._model.paneForSource(this._source).executionsPositionController(),l=o.getXYCoordinate(r,a,i[0].index),!isFinite(l.y)||l.y<0||l.y>e||l.x<0?(this._renderer=null,null):(h=[new s(l.x,l.y)],d={points:h},this._renderer=new n(d,r),this._renderer)))},t.ExecutionPaneView=r},1153:function(e,t,i){"use strict";function n(e,t){r.call(this,e,t),this._invalidated=!0,this._medianRenderer=new a,this._sideRenderer=new a}var r=i(371).LineSourcePaneView,s=i(1216).ChannelRenderer,a=i(110).TrendLineRenderer,o=i(11),l=i(53).CompositeRenderer,h=i(74).LineEnd;inherit(n,r),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){r.prototype._updateImpl.call(this),0!==this._floatPoints.length&&(3===this._floatPoints.length?(this._medianPoint=this._floatPoints[1].add(this._floatPoints[2]).scaled(.5),this._medianPoint.data=3):2===this._floatPoints.length?(this._medianPoint=this._floatPoints[1],this._medianPoint.data=3):(this._medianPoint=this._floatPoints[0],this._medianPoint.data=3))},n.prototype.renderer=function(){var e,t,i,n,r,d,c,p,_,u,f,g,v,w,y,m;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new l,this._floatPoints.length<2)return e;if(!this._medianPoint)return e;if(t={points:[this._floatPoints[0],this._medianPoint],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:h.Normal,rightend:h.Normal},this._medianRenderer.setData(t),e.append(this._medianRenderer),this._floatPoints.length<3)return this.addAnchors(e),e;for(i={points:[this._floatPoints[1],this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:h.Normal,rightend:h.Normal},this._sideRenderer.setData(i), e.append(this._sideRenderer),n=0,r=this._floatPoints[2].subtract(this._floatPoints[1]).scaled(.5),d=this._source.properties().fillBackground.value(),c=this._source.properties().transparency.value(),p=0;p<=8;p++)_="level"+p,u=this._source.properties()[_],u.visible.value()&&(f=this._medianPoint.addScaled(r,u.coeff.value()),g=this._medianPoint.addScaled(r,-u.coeff.value()),d&&(v={},v.width=this._model.timeScale().width(),v.height=this._source.priceScale().height(),v.p1=this._floatPoints[0],v.p2=f,v.p3=this._floatPoints[0],v.p4=this._medianPoint.addScaled(r,n),v.color=u.color.value(),v.transparency=c,v.hittestOnBackground=!0,w=new s,w.setData(v),e.append(w),v={},v.width=this._model.timeScale().width(),v.height=this._source.priceScale().height(),v.p1=this._floatPoints[0],v.p2=g,v.p3=this._floatPoints[0],v.p4=this._medianPoint.addScaled(r,-n),v.color=u.color.value(),v.transparency=c,v.hittestOnBackground=!0,w=new s,w.setData(v),e.append(w)),n=u.coeff.value(),y={points:[this._floatPoints[0],f],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:u.color.value(),linewidth:u.linewidth.value(),linestyle:u.linestyle.value(),extendleft:!1,extendright:!0,leftend:h.Normal,rightend:h.Normal},w=new a,w.setData(y),w.setHitTest(new o(o.MOVEPOINT,null,p)),e.append(w),m={points:[this._floatPoints[0],g],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:u.color.value(),linewidth:u.linewidth.value(),linestyle:u.linestyle.value(),extendleft:!1,extendright:!0,leftend:h.Normal,rightend:h.Normal},w=new a,w.setData(m),w.setHitTest(new o(o.MOVEPOINT,null,p)),e.append(w));return this.addAnchors(e),e},t.PitchfanLinePaneView=n},1154:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this._numericFormatter=new d,this._invalidated=!0}var r=i(8).Point,s=i(371).LineSourcePaneView,a=i(166).TextRenderer,o=i(373).RectangleRenderer,l=i(110).TrendLineRenderer,h=i(53).CompositeRenderer,d=i(89).NumericFormatter,c=i(74).LineEnd;inherit(n,s),n.prototype.renderer=function(){function e(e,t,i){function n(t){var i=new l;i.setData(Object.assign({},R,{points:t})),e.append(i)}var a,o,h,f,g,v,w,y,m,x=new r(s,d),b=new r(p,d),S=new r(s,_),P=new r(p,_),R={width:k._model.timeScale().width(),height:k._source.priceScale().height(),color:u.fans.color.value(),linewidth:u.linewidth.value(),linestyle:u.linestyle.value(),extendleft:!1,extendright:!1,leftend:c.Normal,rightend:c.Normal};for(a=0;a0&&f&&(m=this._hlevels[y-1],i=new r(s,this._hlevels[y].y),n=new r(p,m.y),x={},x.points=[i,n],x.color=this._hlevels[y].color,x.linewidth=0,x.backcolor=this._hlevels[y].color,x.fillBackground=!0,x.transparency=g,b=new o(void 0,void 0,!0),b.setData(x),t.append(b)),i=new r(s,this._hlevels[y].y),n=new r(p,this._hlevels[y].y),S={points:[i,n],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._hlevels[y].color,linewidth:u.linewidth.value(),linestyle:u.linestyle.value(),extendleft:!1,extendright:!1,leftend:c.Normal,rightend:c.Normal},b=new l,b.setData(S),t.append(b),u.showLeftLabels.value()&&(P={points:[i],text:this._numericFormatter.format(this._hlevels[y].coeff),color:this._hlevels[y].color,vertAlign:"middle",horzAlign:"right",font:u.font.value(),offsetX:-5,offsetY:0,fontsize:12},t.append(new a(P))),u.showRightLabels.value()&&(R={points:[n],text:this._numericFormatter.format(this._hlevels[y].coeff),color:this._hlevels[y].color,vertAlign:"middle",horzAlign:"left",font:u.font.value(),offsetX:5,offsetY:0,fontsize:12},t.append(new a(R)));for(y=0;y0&&v&&(m=this._vlevels[y-1],T=new r(m.x,d),x={},x.points=[T,n],x.color=this._vlevels[y].color,x.linewidth=0,x.backcolor=this._vlevels[y].color,x.fillBackground=!0,x.transparency=w,b=new o(void 0,void 0,!0),b.setData(x),t.append(b)),S={points:[i,n],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._vlevels[y].color,linewidth:u.linewidth.value(),linestyle:u.linestyle.value(),extendleft:!1,extendright:!1,leftend:c.Normal,rightend:c.Normal},b=new l,b.setData(S),t.append(b),u.showTopLabels.value()&&(L={points:[i],text:this._numericFormatter.format(this._vlevels[y].coeff),color:this._vlevels[y].color,vertAlign:"bottom",horzAlign:"center",font:u.font.value(),offsetX:0,offsetY:-5,fontsize:12},t.append(new a(L))),u.showBottomLabels.value()&&(C={points:[n],text:this._numericFormatter.format(this._vlevels[y].coeff),color:this._vlevels[y].color,vertAlign:"top",horzAlign:"center",font:u.font.value(),offsetX:0,offsetY:5,fontsize:12},t.append(new a(C)));return k=this,e(t,this._hfans,!0),e(t,this._vfans,!1),this.addAnchors(t),t},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var e,t,i,n,r,a,o,l,h,d,c,p,_,u,f,g,v,w;if(s.prototype._updateImpl.call(this),!(this._source.points().length<2)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty()){for(e=this._source.points()[0],t=this._source.points()[1],i=this._source.properties(),n=i.reverse&&i.reverse.value(),this._hlevels=[],r=n?e.price-t.price:t.price-e.price,a=n?t.price:e.price,this._source.priceScale().isPercent()&&(o=this._source.ownerSource().firstValue()),l=1;l<=7;l++)h="hlevel"+l,d=i[h],d.visible.value()&&(c=d.coeff.value(),p=d.color.value(),_=a+c*r, this._source.priceScale().isPercent()&&(_=this._source.priceScale().priceRange().convertToPercent(_,o)),u=this._source.priceScale().priceToCoordinate(_),this._hlevels.push({coeff:c,color:p,y:u}));for(this._vlevels=[],f=n?e.index-t.index:t.index-e.index,g=n?t.index:e.index,l=1;l<=7;l++)h="vlevel"+l,d=i[h],d.visible.value()&&(c=d.coeff.value(),p=d.color.value(),v=Math.round(g+c*f),w=this._model.timeScale().indexToCoordinate(v),this._vlevels.push({coeff:c,color:p,x:w}));if(this._hfans=[],this._vfans=[],i.fans.visible.value())for(l=1;l<=7;l++)v=Math.round(g+i["hlevel"+l].coeff.value()*f),_=a+i["vlevel"+l].coeff.value()*r,this._source.priceScale().isPercent()&&(_=this._source.priceScale().priceRange().convertToPercent(_,o)),this._hfans.push(this._model.timeScale().indexToCoordinate(v)),this._vfans.push(this._source.priceScale().priceToCoordinate(_))}},t.GannSquarePaneView=n},1155:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this._numericFormatter=new c,this._invalidated=!0}var r=i(8).Point,s=i(371).LineSourcePaneView,a=i(1216).ChannelRenderer,o=i(166).TextRenderer,l=i(110).TrendLineRenderer,h=i(11),d=i(53).CompositeRenderer,c=i(89).NumericFormatter,p=i(74).LineEnd;inherit(n,s),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var e,t,i,n,r,a,o,l,h,d,c,p,_,u;if(s.prototype._updateImpl.call(this),!(this._source.points().length<2)&&this._source.priceScale()&&!this._source.priceScale().isEmpty()&&!this._model.timeScale().isEmpty()){for(e=this._source.points()[0],t=this._source.points()[1],this._hlevels=[],i=t.price-e.price,this._source.priceScale().isPercent()&&(n=this._source.ownerSource().firstValue()),r=1;r<=7;r++)a="hlevel"+r,o=this._source.properties()[a],o.visible.value()&&(l=o.coeff.value(),h=o.color.value(),d=e.price+l*i,this._source.priceScale().isPercent()&&(d=this._source.priceScale().priceRange().convertToPercent(d,n)),c=this._source.priceScale().priceToCoordinate(d,!0),this._hlevels.push({coeff:l,color:h,y:c,index:r}));for(this._vlevels=[],p=t.index-e.index,r=1;r<=7;r++)a="vlevel"+r,o=this._source.properties()[a],o.visible.value()&&(l=o.coeff.value(),h=o.color.value(),_=Math.round(e.index+l*p),u=this._model.timeScale().indexToCoordinate(_,!0),this._vlevels.push({coeff:l,color:h,x:u,index:r}))}},n.prototype.renderer=function(){var e,t,i,n,s,c,_,u,f,g,v,w,y,m,x,b,S,P,R,T,L,C,k,I;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new d,this._floatPoints.length<2)return e;for(t=this._floatPoints[0],i=this._floatPoints[1],n=Math.min(t.x,i.x),s=Math.min(t.y,i.y),c=Math.max(t.x,i.x),_=Math.max(t.y,i.y),u=this._source.properties(),f=u.grid.color.value(),g=u.grid.linewidth.value(),v=u.grid.linestyle.value(),w=0;w0&&R&&(C=new r(i.x,this._hlevels[w-1].y),k={},k.width=this._model.timeScale().width(),k.height=this._source.priceScale().height(),k.p1=t,k.p2=L,k.p3=t,k.p4=C,k.color=this._hlevels[w].color,k.transparency=T,k.hittestOnBackground=!0,m=new a,m.setData(k),e.append(m)),y={points:[t,L],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._hlevels[w].color,linewidth:u.linewidth.value(),linestyle:u.linestyle.value(),extendleft:!1,extendright:!0,leftend:p.Normal,rightend:p.Normal},m=new l,m.setData(y),m.setHitTest(new h(h.MOVEPOINT,null,{type:"h",index:this._hlevels[w].index})),e.append(m);for(w=0;w0&&R&&(C=new r(this._vlevels[w-1].x,i.y),k={},k.width=this._model.timeScale().width(),k.height=this._source.priceScale().height(),k.p1=t,k.p2=I,k.p3=t,k.p4=C,k.color=this._vlevels[w].color,k.transparency=T,k.hittestOnBackground=!0,m=new a,m.setData(k),e.append(m)),y={points:[t,I],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._vlevels[w].color,linewidth:u.linewidth.value(),linestyle:u.linestyle.value(),extendleft:!1,extendright:!0,leftend:p.Normal,rightend:p.Normal},m=new l,m.setData(y),m.setHitTest(new h(h.MOVEPOINT,null,{type:"v",index:this._vlevels[w].index})),e.append(m);return this.addAnchors(e),e},t.FibSpeedResistanceFanPaneView=n},1156:function(e,t,i){"use strict";var n,r,s,a,o,l,h,d,c,p;Object.defineProperty(t,"__esModule",{value:!0}),n=i(0),r=i(8),s=i(371),a=i(110),o=i(166),l=i(53),h=i(74),d=i(240),c=i(1238),p=function(e){function t(t,i){ var n=e.call(this,t,i)||this;return n._verticalLevelsRenderers=[],n._horizontalLevelsRenderers=[],n._fanRenderers=[],n._arcRenderers=[],n._priceDiffTextRenderer=new o.TextRenderer({}),n._indexDiffTextRenderer=new o.TextRenderer({}),n._ratioTextRenderer=new o.TextRenderer({}),n._initRenderers(),n}return n.__extends(t,e),t.prototype.renderer=function(e){var t,i,n,r,s,a,o,h,d,c,p,_,u,f,g,v;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t=new l.CompositeRenderer,i=this._getPoints(),i.length<2?(this.addAnchors(t),t):(n=i[0],r=i[1],s=this._getSource(),a=s.isReversed(),a&&(r=i[0],n=i[1]),o=r.x-n.x,h=r.y-n.y,d=n,c=r,p=this._getModel(),_=p.timeScale(),u=_.width(),f=s.isLabelsVisible(),g={paneHeight:e,paneWidth:u,barsCoordsRange:o,priceCoordsRange:h,startPoint:d,endPoint:c,p1:n,p2:r,isLabelsVisible:f,reversed:a},this._prepareLevels(t,g),this._prepareFanLines(t,g),this._prepareArcs(t,g),this._prepareLabels(t,g),this.isAnchorsRequired()&&(v=[n,r],p.lineBeingCreated()===s&&v.pop(),t.append(this.createLineAnchor({points:v}))),t)},t.prototype._initRenderers=function(){var e,t,i,n=this._getSource(),r=n.levelsCount();for(e=0;eo?(l=v.x,p=o/a,c=g.y+p*x):(c=v.y,p=a/o,l=g.x+p*m),_={points:[f,new r.Point(l,c)],width:y,height:w,color:s.color,linewidth:s.width,linestyle:d.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:h.LineEnd.Normal,rightend:h.LineEnd.Normal},u=this._fanRenderers[s.index],u.setData(_),e.append(u))},t.prototype._prepareArcs=function(e,t){ var i,n,s,a,o,l,h,d,c,p=t.p1,_=t.startPoint,u=t.endPoint,f=t.barsCoordsRange,g=t.priceCoordsRange,v=p,w=this._getSource(),y=w.isArcsBackgroundFilled(),m=w.arcsBackgroundTransparency(),x=w.arcs();for(i=0,n=x;i0?"right":"left",_.vertAlign=n>0?"bottom":"top",_.offsetX=s>0?-10:10,_.offsetY=n>0?-10:10,this._priceDiffTextRenderer.setData(_),e.append(this._priceDiffTextRenderer),u=new r.Point(x.x,m.y),f=""+s,g=this._getLabelData(u,f),g.horzAlign=s>0?"left":"right",g.vertAlign=n>0?"top":"bottom",g.offsetX=s>0?10:-10,g.offsetY=n>0?10:-10,this._indexDiffTextRenderer.setData(g),e.append(this._indexDiffTextRenderer),null!==(v=i.getScaleRatio())&&(w=i.getScaleRatioFormatter(),y=this._getLabelData(x,w.format(v)),y.horzAlign=s>0?"left":"right",y.vertAlign=n>0?"bottom":"top",y.offsetX=s>0?10:-10,y.offsetY=n>0?-10:10,this._ratioTextRenderer.setData(y),e.append(this._ratioTextRenderer))))},t.prototype._getLabelData=function(e,t){var i=this._getSource(),n=i.getLabelsStyle(),r=n.textColor,s=n.font,a=n.fontSize;return{points:[e],backgroundColor:"transparent",text:t,font:s,bold:n.bold,italic:n.italic,fontsize:a,color:r,vertAlign:"top",horzAlign:"center",offsetX:0,offsetY:0,backgroundRoundRect:4}},t}(s.LineSourcePaneView),t.GannComplexPaneView=p},1157:function(e,t,i){"use strict";var n,r,s,a,o,l,h,d,c;Object.defineProperty(t,"__esModule",{value:!0}),n=i(0),r=i(8),s=i(371),a=i(110),o=i(53),l=i(74),h=i(240),d=i(1238),c=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._verticalLevelsRenderers=[],n._horizontalLevelsRenderers=[],n._fanRenderers=[],n._arcRenderers=[],n._initRenderers(),n}return n.__extends(t,e),t.prototype.renderer=function(e){var t,i,n,r,s,a,l,h,d,c,p,_,u,f;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t=this._getSource(),i=this._getPoints(),n=new o.CompositeRenderer,i.length<2?(this.addAnchors(n),n):(r=i[0],s=3===i.length?i[2]:i[1],a=s.x-r.x,l=s.y-r.y,h=r,d=s,c=this._getModel(),p=c.timeScale(),_=p.width(),u={paneHeight:e,paneWidth:_,barsCoordsRange:a,priceCoordsRange:l,startPoint:h,endPoint:d,p1:r,p2:s},this._prepareLevels(n,u),this._prepareFanLines(n,u),this._prepareArcs(n,u),this.isAnchorsRequired()&&(f=[r,i[1]],c.lineBeingCreated()===t&&f.pop(),n.append(this.createLineAnchor({points:f}))),n)},t.prototype._updateImpl=function(){var t,i,n,r,s;e.prototype._updateImpl.call(this),t=this._getSource(),i=this._getPoints(), n=t.getScreenPoints(),i.length<2||n.length<2||(r=n[0],s=n[1],i[1]=r,i[1].data=1,i[2]=s)},t.prototype._initRenderers=function(){var e,t,i,n=this._getSource(),r=n.levelsCount();for(e=0;eo?(d=v.x,p=o/a,c=g.y+p*x):(c=v.y,p=a/o,d=g.x+p*m),_={points:[f,new r.Point(d,c)],width:y,height:w,color:s.color,linewidth:s.width,linestyle:h.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:l.LineEnd.Normal,rightend:l.LineEnd.Normal},u=this._fanRenderers[s.index],u.setData(_),e.append(u))},t.prototype._prepareArcs=function(e,t){var i,n,s,a,o,l,h,d,c,p=t.p1,_=t.startPoint,u=t.endPoint,f=t.barsCoordsRange,g=t.priceCoordsRange,v=p,w=this._getSource(),y=w.isArcsBackgroundFilled(),m=w.arcsBackgroundTransparency(),x=w.arcs();for(i=0,n=x;ic?(r=t.x,a=e.y+n/p):(r=e.x+i*p,a=t.y),this._fans.push({label:u,color:_,x:r,y:a,linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),index:o}))},n.prototype.renderer=function(){var e,t,i,n,s,p,_,u,f,g,v,w;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new d,this._floatPoints.length<2)return e;for(t=this._floatPoints[0],i=this._source.properties(),n=this._source.properties().fillBackground.value(),s=this._source.properties().transparency.value(),p=0;p4&&p>0&&(u=new r(this._fans[p-1].x,this._fans[p-1].y),f={},f.width=this._model.timeScale().width(),f.height=this._source.priceScale().height(),f.p1=t,f.p2=_,f.p3=t,f.p4=u,f.color=this._fans[p].color,f.transparency=s,f.hittestOnBackground=!0,g=new a,g.setData(f),e.append(g))),v={points:[t,_],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._fans[p].color,linewidth:this._fans[p].linewidth,linestyle:this._fans[p].linestyle,extendleft:!1,extendright:!0,leftend:c.Normal,rightend:c.Normal},g=new l,g.setData(v),g.setHitTest(new h(h.MOVEPOINT,null,this._fans[p].index)),e.append(g),i.showLabels.value()&&(w={points:[_],text:this._fans[p].label,color:this._fans[p].color,vertAlign:"middle",horzAlign:"left",font:i.font.value(),offsetX:0,offsetY:-5,fontsize:12},e.append(new o(w)));return this.addAnchors(e),e},t.GannFanPaneView=n},1159:function(e,t,i){"use strict";function n(e,t){l.call(this,e,t),this._invalidated=!0,this._medianRenderer=new h,this._sideRenderer=new h}function r(e,t){n.call(this,e,t),this._invalidated=!0,this._backSideRenderer=new h}function s(e,t){r.call(this,e,t),this._invalidated=!0}function a(e,t){n.call(this,e,t),this._invalidated=!0,this._backSideRenderer=new h,this._centerRenderer=new h}var o=i(8).Point,l=i(371).LineSourcePaneView,h=i(110).TrendLineRenderer,d=i(1216).ChannelRenderer,c=i(11),p=i(53).CompositeRenderer,_=i(74).LineEnd;inherit(n,l),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){l.prototype._updateImpl.call(this),0!==this._floatPoints.length&&(3===this._floatPoints.length?(this._medianPoint=this._floatPoints[1].add(this._floatPoints[2]).scaled(.5),this._medianPoint.data=3):2===this._floatPoints.length?(this._medianPoint=this._floatPoints[1],this._medianPoint.data=3):(this._medianPoint=this._floatPoints[0],this._medianPoint.data=3))},n.prototype.renderer=function(){var e,t,i,n,r,s,a,o,l,u,f,g,v,w,y,m,x,b,S,P,R;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new p,this._floatPoints.length<2)return e ;if(!this._medianPoint)return e;if(t={points:[this._floatPoints[0],this._medianPoint],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:_.Normal,rightend:_.Normal},this._medianRenderer.setData(t),e.append(this._medianRenderer),this._floatPoints.length<3)return this.addAnchors(e),e;for(i={points:[this._floatPoints[1],this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:_.Normal,rightend:_.Normal},this._sideRenderer.setData(i),e.append(this._sideRenderer),n=this._floatPoints[2].subtract(this._floatPoints[1]).scaled(.5),r=this._medianPoint.subtract(this._floatPoints[0]),s=0,a=this._source.properties().fillBackground.value(),o=this._source.properties().transparency.value(),l=0;l<=8;l++)u="level"+l,f=this._source.properties()[u],f.visible.value()&&(g=this._medianPoint.addScaled(n,f.coeff.value()),v=g.add(r),w=this._medianPoint.addScaled(n,-f.coeff.value()),y=w.add(r),a&&(m={},m.p1=g,m.p2=v,m.p3=this._medianPoint.addScaled(n,s),m.p4=m.p3.add(r),m.color=f.color.value(),m.width=this._model.timeScale().width(),m.height=this._source.priceScale().height(),m.transparency=o,m.hittestOnBackground=!0,x=new d,x.setData(m),e.append(x),m={},m.p1=w,m.p2=y,m.p3=this._medianPoint.addScaled(n,-s),m.p4=m.p3.add(r),m.color=f.color.value(),m.width=this._model.timeScale().width(),m.height=this._source.priceScale().height(),m.transparency=o,m.hittestOnBackground=!0,x=new d,x.setData(m),e.append(x)),s=f.coeff.value(),b={points:[g,v],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:f.color.value(),linewidth:f.linewidth.value(),linestyle:f.linestyle.value(),extendleft:!1,extendright:!0,leftend:_.Normal,rightend:_.Normal},S=new h,S.setData(b),S.setHitTest(new c(c.MOVEPOINT,null,l)),e.append(S),P={points:[w,y],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:f.color.value(),linewidth:f.linewidth.value(),linestyle:f.linestyle.value(),extendleft:!1,extendright:!0,leftend:_.Normal,rightend:_.Normal},R=new h,R.setData(P),R.setHitTest(new c(c.MOVEPOINT,null,l)),e.append(R));return this.addAnchors(e),e},inherit(r,n),r.prototype.renderer=function(){var e,t,i,n,r,s,a,o,l,u,f,g,v,w,y,m,x,b,S,P;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new p,this._floatPoints.length<2)return e;if(t={points:[this._floatPoints[0],this._floatPoints[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(), linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:_.Normal,rightend:_.Normal},this._backSideRenderer.setData(t),e.append(this._backSideRenderer),!this._medianPoint||!this._modifiedBase)return this.addAnchors(e),e;if(i={points:[this._modifiedBase,this._medianPoint],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:_.Normal,rightend:_.Normal},this._medianRenderer.setData(i),e.append(this._medianRenderer),this._floatPoints.length<3)return this.addAnchors(e),e;for(n={points:[this._floatPoints[1],this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:_.Normal,rightend:_.Normal},this._sideRenderer.setData(n),e.append(this._sideRenderer),r=this._floatPoints[2].subtract(this._floatPoints[1]).scaled(.5),s=this._medianPoint.subtract(this._modifiedBase),a=0,o=this._source.properties().fillBackground.value(),l=this._source.properties().transparency.value(),u=0;u<=8;u++)f="level"+u,g=this._source.properties()[f],g.visible.value()&&(v=this._medianPoint.addScaled(r,g.coeff.value()),w=v.add(s),y=this._medianPoint.addScaled(r,-g.coeff.value()),m=y.add(s),o&&(t={},t.p1=v,t.p2=w,t.p3=this._medianPoint.addScaled(r,a),t.p4=t.p3.add(s),t.color=g.color.value(),t.width=this._model.timeScale().width(),t.height=this._source.priceScale().height(),t.transparency=l,t.hittestOnBackground=!0,x=new d,x.setData(t),e.append(x),t={},t.p1=y,t.p2=m,t.p3=this._medianPoint.addScaled(r,-a),t.p4=t.p3.add(s),t.color=g.color.value(),t.width=this._model.timeScale().width(),t.height=this._source.priceScale().height(),t.transparency=l,t.hittestOnBackground=!0,x=new d,x.setData(t),e.append(x)),a=g.coeff.value(),b={points:[v,w],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:g.color.value(),linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),extendleft:!1,extendright:!0,leftend:_.Normal,rightend:_.Normal},S=new h,S.setData(b),S.setHitTest(new c(c.MOVEPOINT,null,u)),e.append(S),P={points:[y,m],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:g.color.value(),linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),extendleft:!1,extendright:!0,leftend:_.Normal,rightend:_.Normal},x=new h,x.setData(P),x.setHitTest(new c(c.MOVEPOINT,null,u)),e.append(x));return this.addAnchors(e),e},r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){n.prototype.updateImpl.call(this),this._floatPoints.length>1&&(this._modifiedBase=this._floatPoints[0].add(this._floatPoints[1]).scaled(.5))},inherit(s,r), s.prototype.update=function(){this._invalidated=!0},s.prototype.updateImpl=function(){var e,t,i;n.prototype.updateImpl.call(this),this._floatPoints.length>2&&(e=this._floatPoints[0].x,t=.5*(this._floatPoints[0].y+this._floatPoints[1].y),i=new o(e,t),this._modifiedBase=i)},inherit(a,n),a.prototype.update=function(){this._invalidated=!0},a.prototype.updateImpl=function(){n.prototype.updateImpl.call(this),this._floatPoints.length>1&&(this._modifiedBase=this._floatPoints[0].add(this._floatPoints[1]).scaled(.5))},a.prototype.renderer=function(){var e,t,i,n,r,s,a,o,l,u,f,g,v,w,y,m,x,b,S,P,R;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new p,this._floatPoints.length<2)return e;if(!this._medianPoint||!this._modifiedBase)return this.addAnchors(e),e;if(3===this._floatPoints.length&&(t={points:[this._modifiedBase,this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:_.Normal,rightend:_.Normal},this._medianRenderer.setData(t),e.append(this._medianRenderer)),i={points:[this._floatPoints[0],this._floatPoints[1]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:_.Normal,rightend:_.Normal},this._backSideRenderer.setData(i),e.append(this._backSideRenderer),this._floatPoints.length<3)return this.addAnchors(e),e;for(n={points:[this._floatPoints[1],this._floatPoints[2]],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:_.Normal,rightend:_.Normal},this._sideRenderer.setData(n),e.append(this._sideRenderer),r=this._floatPoints[2].subtract(this._floatPoints[1]).scaled(.5),s=this._floatPoints[2].subtract(this._modifiedBase),a=0,o=this._source.properties().fillBackground.value(),l=this._source.properties().transparency.value(),u={points:[this._medianPoint,this._medianPoint.add(s)],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:this._source.properties().median.color.value(),linewidth:this._source.properties().median.linewidth.value(),linestyle:this._source.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:_.Normal,rightend:_.Normal},this._centerRenderer.setData(u),e.append(this._centerRenderer),f=0;f<=8;f++)g="level"+f,v=this._source.properties()[g],v.visible.value()&&(w=this._medianPoint.addScaled(r,v.coeff.value()),y=w.add(s),m=this._medianPoint.addScaled(r,-v.coeff.value()),x=m.add(s),o&&(i={},i.p1=w,i.p2=y, i.p3=this._medianPoint.addScaled(r,a),i.p4=i.p3.add(s),i.color=v.color.value(),i.width=this._model.timeScale().width(),i.height=this._source.priceScale().height(),i.transparency=l,i.hittestOnBackground=!0,b=new d,b.setData(i),e.append(b),i={},i.p1=m,i.p2=x,i.p3=this._medianPoint.addScaled(r,-a),i.p4=i.p3.add(s),i.color=v.color.value(),i.width=this._model.timeScale().width(),i.height=this._source.priceScale().height(),i.transparency=l,i.hittestOnBackground=!0,b=new d,b.setData(i),e.append(b)),a=v.coeff.value(),S={points:[w,y],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:v.color.value(),linewidth:v.linewidth.value(),linestyle:v.linestyle.value(),extendleft:!1,extendright:!0,leftend:_.Normal,rightend:_.Normal},P=new h,P.setData(S),P.setHitTest(new c(c.MOVEPOINT,null,f)),e.append(P),R={points:[m,x],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:v.color.value(),linewidth:v.linewidth.value(),linestyle:v.linestyle.value(),extendleft:!1,extendright:!0,leftend:_.Normal,rightend:_.Normal},b=new h,b.setData(R),b.setHitTest(new c(c.MOVEPOINT,null,f)),e.append(b));return this.addAnchors(e),e},t.PitchforkLinePaneView=n,t.SchiffPitchforkLinePaneView=r,t.SchiffPitchfork2LinePaneView=s,t.InsidePitchforkLinePaneView=a},1160:function(e,t,i){"use strict";function n(e,t){r.call(this,e,t),this._label=null,this._invalidated=!0,this._trendLineRendererPoints12=new a,this._trendLineRendererPoints43=new a,this._disjointAngleRenderer=new s,this._p1LabelRenderer=new o({}),this._p2LabelRenderer=new o({}),this._p3LabelRenderer=new o({}),this._p4LabelRenderer=new o({})}var r=i(371).LineSourcePaneView,s=i(1239).DisjointAngleRenderer,a=i(110).TrendLineRenderer,o=i(166).TextRenderer,l=i(53).CompositeRenderer,h=i(1199).PaneRendererClockIcon;inherit(n,r),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var e,t,i,n;r.prototype._updateImpl.call(this),this._label=null,this._source.points().length<2||this._source.priceScale()&&(e=this._source.points()[0],t=this._source.points()[1],this._price1=this._source.priceScale().formatter().format(e.price),this._price2=this._source.priceScale().formatter().format(t.price),3===this._source.points().length&&(i=this._source.points()[2],this._price3=this._source.priceScale().formatter().format(i.price),n=t.price-e.price,this._price4=this._source.priceScale().formatter().format(i.price+n)))},n.prototype.renderer=function(){var e,t,i,n,r,s,a,o,d,c,p,_,u,f,g,v,w;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new l,this._points.length<2?e:(t=this._points[0],i=this._points[1],s=this._source.properties(),a=this._model,o=this._source,this._points.length>=3&&(n=this._points[2],n.x=i.x,d=i.y-t.y,r=t.clone(),r.y=n.y+d,r.data=3,s.fillBackground.value()&&(c=a.timeScale().width(),p=o.priceScale().height(),_=s.extendLeft.value(),u=s.extendRight.value(),this._disjointAngleRenderer.setData({width:c,height:p,extendleft:_,extendright:u,points:[t,i,n,r],backcolor:s.backgroundColor.value(), transparency:s.transparency.value(),hittestOnBackground:TradingView.isMobile.any()}),e.append(this._disjointAngleRenderer))),f=function(e,t){return{points:[e,t],width:a.timeScale().width(),height:o.priceScale().height(),color:s.linecolor.value(),linewidth:s.linewidth.value(),linestyle:s.linestyle.value(),extendleft:s.extendLeft.value(),extendright:s.extendRight.value(),leftend:s.leftEnd.value(),rightend:s.rightEnd.value()}},g=this,v=function(t,i,n,r,s,a){var o;g._source.properties().showPrices.value()&&(o={points:[n],text:s,color:g._source.properties().textcolor.value(),horzAlign:n.x>r.x?"left":"right",vertAlign:"middle",font:g._source.properties().font.value(),offsetX:n.x>r.x?-5:5,offsetY:-5,bold:g._source.properties().bold.value(),italic:g._source.properties().italic.value(),fontsize:g._source.properties().fontsize.value()},t.setData(o),e.append(t),o={points:[r],text:a,color:g._source.properties().textcolor.value(),horzAlign:n.xr.x?-5:5,offsetY:-5,bold:g._source.properties().bold.value(),italic:g._source.properties().italic.value(),fontsize:g._source.properties().fontsize.value()},i.setData(o),e.append(i))},this._trendLineRendererPoints12.setData(f(t,i)),e.append(this._trendLineRendererPoints12),v(this._p1LabelRenderer,this._p2LabelRenderer,t,i,this._price1,this._price2),2===this._points.length?(this.addAnchors(e),e):(this._trendLineRendererPoints43.setData(f(r,n)),e.append(this._trendLineRendererPoints43),v(this._p3LabelRenderer,this._p4LabelRenderer,n,r,this._price3,this._price4),this.isAnchorsRequired()&&(w=[t,i,n,r],this._model.lineBeingCreated()===this._source&&w.pop(),e.append(this.createLineAnchor({points:w}))),!TradingView.printing&&this._source.hasAlert.value()&&!this._model.readOnly()&&t&&i&&this._source.getAlertIsActive(function(n){e.append(new h({point1:t,point2:i,color:n?s.linecolor.value():defaults("chartproperties.alertsProperties.drawingIcon.color")}))}),e))},t.DisjointAnglePaneView=n},1161:function(e,t,i){"use strict";function n(e,t){r.call(this,e,t),this._label1=null,this._label2=null,this._invalidated=!0,this._trendLineRendererPoints12=new a,this._trendLineRendererPoints43=new a,this._disjointAngleRenderer=new s,this._p1LabelRenderer=new o({}),this._p2LabelRenderer=new o({}),this._p3LabelRenderer=new o({}),this._p4LabelRenderer=new o({})}var r=i(371).LineSourcePaneView,s=i(1239).DisjointAngleRenderer,a=i(110).TrendLineRenderer,o=i(166).TextRenderer,l=i(53).CompositeRenderer,h=i(1199).PaneRendererClockIcon;inherit(n,r),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var e,t,i;r.prototype._updateImpl.call(this),this._label1=null,this._label2=null,this._source.points().length<2||this._source.priceScale()&&(e=this._source.points()[0],t=this._source.points()[1],this._price1=this._source.priceScale().formatter().format(e.price),this._price2=this._source.priceScale().formatter().format(t.price),3===this._source.points().length&&(i=this._source.points()[2], this._price3=this._source.priceScale().formatter().format(i.price)))},n.prototype.renderer=function(){var e,t,i,n,r,s,a,o,d,c,p,_,u,f,g,v;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new l,this._points.length<2?e:(t=this._points[0],i=this._points[1],s=this._source.properties(),a=this._model,o=this._source,3===this._points.length&&(n=this._points[2],n.x=i.x,r=t.clone(),r.y=n.y,r.data=3,s.fillBackground.value()&&(d=a.timeScale().width(),c=o.priceScale().height(),p=s.extendLeft.value(),_=s.extendRight.value(),this._disjointAngleRenderer.setData({width:d,height:c,extendleft:p,extendright:_,points:[t,i,n,r],backcolor:s.backgroundColor.value(),transparency:s.transparency.value(),hittestOnBackground:TradingView.isMobile.any()}),e.append(this._disjointAngleRenderer))),u=function(e,t){return{points:[e,t],width:a.timeScale().width(),height:o.priceScale().height(),color:s.linecolor.value(),linewidth:s.linewidth.value(),linestyle:s.linestyle.value(),extendleft:s.extendLeft.value(),extendright:s.extendRight.value(),leftend:s.leftEnd.value(),rightend:s.rightEnd.value()}},this._trendLineRendererPoints12.setData(u(t,i)),e.append(this._trendLineRendererPoints12),2===this._points.length?(this.addAnchors(e),e):(f=this,g=function(t,i,n,r,s,a){var o;f._source.properties().showPrices.value()&&(o={points:[n],text:s,color:f._source.properties().textcolor.value(),horzAlign:n.x>r.x?"left":"right",vertAlign:"middle",font:f._source.properties().font.value(),offsetX:n.x>r.x?-5:5,offsetY:-5,bold:f._source.properties().bold.value(),italic:f._source.properties().italic.value(),fontsize:f._source.properties().fontsize.value()},t.setData(o),e.append(t),o={points:[r],text:a,color:f._source.properties().textcolor.value(),horzAlign:n.xr.x?-5:5,offsetY:-5,bold:f._source.properties().bold.value(),italic:f._source.properties().italic.value(),fontsize:f._source.properties().fontsize.value()},i.setData(o),e.append(i))},g(this._p1LabelRenderer,this._p2LabelRenderer,t,i,this._price1,this._price2),this._trendLineRendererPoints43.setData(u(r,n)),e.append(this._trendLineRendererPoints43),g(this._p3LabelRenderer,this._p4LabelRenderer,n,r,this._price3,this._price3),this.isAnchorsRequired()&&(v=[t,i,n,r],this._model.lineBeingCreated()===this._source&&v.pop(),e.append(this.createLineAnchor({points:v}))),!TradingView.printing&&this._source.hasAlert.value()&&!this._model.readOnly()&&t&&i&&this._source.getAlertIsActive(function(n){e.append(new h({point1:t,point2:i,color:n?s.linecolor.value():defaults("chartproperties.alertsProperties.drawingIcon.color")}))}),e))},t.FlatBottomPaneView=n},1162:function(e,t,i){"use strict";function n(e){this._data=null,this._cache=e}function r(e,t){h.call(this,e,t),this._cache={},this._invalidated=!0,this._dashRenderer=new d,this._dashRenderer.setHitTest(null),this._iconRenderer=new n(this._cache)} var s=i(8).Point,a=i(382),o=a.rotationMatrix,l=a.transformPoint,h=i(371).LineSourcePaneView,d=i(110).TrendLineRenderer,c=i(11),p=i(53).CompositeRenderer,_=i(74).LineEnd;n.prototype.setData=function(e){this._data=e},n.prototype.draw=function(e){var t,i,n,r;null!=this._data&&(t=String.fromCharCode(this._data.icon),e.font=this._data.size+"px FontAwesome",i=e.measureText(t).width,e.textBaseline="middle",n=this._data.point,e.translate(n.x,n.y),e.rotate(this._data.angle-Math.PI/2),e.scale(this._data.scale,1),r=65536*this._data.icon+this._data.size,this._cache[r]=i,this._data.selected&&(e.fillStyle="rgba(80, 80, 80, 0.2)",e.fillRect(-this._cache[r]/2,-this._data.size/2,this._cache[r],this._data.size)),e.fillStyle=this._data.color,e.fillText(t,-this._cache[r]/2,0))},n.prototype.hitTest=function(e){var t,i,n,r;return null===this._data?null:(t=65536*this._data.icon+this._data.size,i=this._cache[t]*this._data.scale,n=o(-this._data.angle),r=e.subtract(this._data.point),r=l(n,r),Math.abs(r.y)<=i/2&&Math.abs(r.x)<=this._data.size/2?new c(c.MOVEPOINT):null)},inherit(r,h),r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){h.prototype._updateImpl.call(this),this._invalidated=!1},r.prototype.renderer=function(){var e,t,i,n,r,a,h,d,c,u,f,g,v,w,y,m,x,b;return this._invalidated&&this.updateImpl(),e=new p,this._points.length<1?e:(t=this._source.properties(),i={point:this._points[0],color:t.color.value(),size:t.size.value(),icon:t.icon.value(),angle:t.angle.value(),scale:t.scale.value(),selected:this.isAnchorsRequired()},n=this._model,r=this._source,this._iconRenderer.setData(i),e.append(this._iconRenderer),this.isAnchorsRequired()&&(a=65536*i.icon+i.size,h=this._cache[a],d=i.size,c=this._points[0],u=t.scale.value(),f=this._source.getAnchorLimit(),g=new s(Math.max(f,d)/2,0),v=new s(0,Math.max(f,u*h)/2),w=o(t.angle.value()),g=l(w,g),v=l(w,v),y=c.add(g),y.data=0,m=c.subtract(g),m.data=1,x=c.add(v),x.data=2,x.square=!0,b=c.subtract(v),b.data=3,b.square=!0,i={points:[y,m],width:n.timeScale().width(),height:r.priceScale().height(),color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:_.Normal,rightend:_.Normal},this._dashRenderer.setData(i),e.append(this._dashRenderer),e.append(this.createLineAnchor({points:[y,m,x,b]}))),e)},t.IconPaneView=r},1163:function(e,t,i){"use strict";function n(e,t){a.call(this,e,t),this._invalidated=!0,this._poligonRenderer=new l}var r=i(8).Point,s=i(44).distanceToLine,a=i(371).LineSourcePaneView,o=i(110).TrendLineRenderer,l=i(380),h=i(53).CompositeRenderer,d=i(74).LineEnd;inherit(n,a),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){a.prototype._updateImpl.call(this),this._distance=0,3===this._points.length&&(this._distance=s(this._points[0],this._points[1],this._points[2]).distance)},n.prototype.renderer=function(){var e,t,i,n,s,a,l,c,p,_,u,f,g,v;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new h,t=this._source.properties(),i=this._points[0],n=this._points[1], 2===this._points.length?(p={},p.points=this._points,p.floatPoints=this._floatPoints,p.width=this._model.timeScale().width(),p.height=this._source.priceScale().height(),p.color=t.color.value(),p.linewidth=1,p.linestyle=CanvasEx.LINESTYLE_SOLID,p.extendleft=!1,p.extendright=!1,p.leftend=d.Normal,p.rightend=d.Normal,_=new o,_.setData(p),e.append(_)):3===this._points.length&&(u=n.subtract(i),f=new r(u.y,-u.x).normalized().scaled(this._distance),g=f.scaled(-1),s=i.add(f),a=n.add(f),l=i.add(g),c=n.add(g),p={},p.points=[s,a,c,l],p.color=t.color.value(),p.linewidth=this._source.properties().linewidth.value(),p.linestyle=CanvasEx.LINESTYLE_SOLID,p.filled=!0,p.backcolor=t.backgroundColor.value(),p.fillBackground=t.fillBackground.value(),p.transparency=t.transparency.value(),this._poligonRenderer.setData(p),e.append(this._poligonRenderer)),this.isAnchorsRequired()&&(v=[],v.push(i),this._points.length>=2&&v.push(n),3===this._points.length&&(s.data=2,l.data=2,a.data=2,c.data=2,v.push(s),v.push(l),v.push(a),v.push(c)),e.append(this.createLineAnchor({points:v}))),e},t.RotatedRectanglePaneView=n},1164:function(e,t,i){"use strict";function n(){this._data=null}function r(e,t){s.call(this,e,t),this._invalidated=!0,this._trendLineRenderer=new a,this._spiralRenderer=new n}var s=i(371).LineSourcePaneView,a=i(110).TrendLineRenderer,o=i(11),l=i(53).CompositeRenderer,h=i(74).LineEnd;n.prototype.setData=function(e){this._data=e},n.prototype._fibNumbers=function(){return[0,1,2,3,5,8,13,21,34,55,89]},n.prototype._continiusFib=function(e){var t,i,n=this._fibNumbers(),r=Math.floor(e),s=Math.ceil(e);return s>=n.length?null:(t=e-r,t=Math.pow(t,1.15),i=n[s]-n[r],n[r]+i*t)},n.prototype.hitTest=function(e){var t,i,n,r,s,a,l,h,d,c,p,_,u;if(null===this._data)return null;for(t=this._data.points[0],i=this._data.points[1],n=i.subtract(t),r=e.subtract(t),s=n.normalized(),a=s.transposed(),l=r.normalized(),h=Math.acos(s.dotProduct(l)),d=Math.asin(a.dotProduct(l)),d<0&&(h=2*Math.PI-h),c=r.length(),p=0;p<4;p++)if(_=h/(.5*Math.PI),u=this._continiusFib(_+4*p),null!==(u=u*n.length()/5)&&Math.abs(u-c)<5)return new o(o.MOVEPOINT);return null},n.prototype.draw=function(e){var t,i,n,r,s,a,o,l,h,d,c,p;if(null!==this._data){for(e.lineCap="round",e.strokeStyle=this._data.color,t=this._data.points[0],i=this._data.points[1],e.translate(t.x,t.y),n=i.subtract(t),r=n.length(),n=n.normalized(),s=Math.acos(n.x),Math.asin(n.y)<0&&(s=2*Math.PI-s),e.rotate(s),e.scale(r/5,r/5),e.lineWidth=this._data.linewidth,CanvasEx.setLineStyle(e,this._data.linestyle),a=50,o=Math.PI/(2*a),e.moveTo(0,0),l=0;l<(this._fibNumbers().length-1)*a;l++)h=l*o,d=this._continiusFib(l/a),c=Math.cos(h)*d,p=Math.sin(h)*d,e.lineTo(c,p);e.scale(5/r,5/r),e.rotate(-s),e.stroke()}},inherit(r,s),r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){s.prototype._updateImpl.call(this),this._invalidated=!1},r.prototype.renderer=function(){var e,t;return this._invalidated&&this.updateImpl(),e=new l,this._floatPoints.length<2?e:(t={},t.points=this._floatPoints, t.width=this._model.timeScale().width(),t.height=this._source.priceScale().height(),t.color=this._source.properties().linecolor.value(),t.linewidth=this._source.properties().linewidth.value(),t.linestyle=this._source.properties().linestyle.value(),t.extendleft=!1,t.extendright=!0,t.leftend=h.Normal,t.rightend=h.Normal,this._trendLineRenderer.setData(t),e.append(this._trendLineRenderer),t={},t.points=this._floatPoints,t.width=this._model.timeScale().width(),t.height=this._source.priceScale().height(),t.color=this._source.properties().linecolor.value(),t.linewidth=this._source.properties().linewidth.value(),t.linestyle=this._source.properties().linestyle.value(),this._spiralRenderer.setData(t),e.append(this._spiralRenderer),this.isAnchorsRequired()&&this.addAnchors(e),e)},t.FibSpiralPaneView=r},1165:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this._invalidated=!0,this._trendLineRenderer=new a,this._triangleRendererPoints234=new o,this._intersect1Renderer=new o,this._intersect2Renderer=new o,this._leftShoulderLabelRenderer=new l({}),this._headLabelRenderer=new l({}),this._rightShoulderLabelRenderer=new l({})}var r=i(132).intersectLineSegments,s=i(371).LineSourcePaneView,a=i(110).TrendLineRenderer,o=i(1217).TriangleRenderer,l=i(166).TextRenderer,h=i(53).CompositeRenderer,d=i(30),c=i(74).LineEnd;inherit(n,s),n.prototype._i18nCache=function(){return{leftShoulder:$.t("Left Shoulder"),rightShoulder:$.t("Right Shoulder"),head:$.t("Head")}},n.prototype.renderer=function(){var e,t,i,n,r,s,o,l,p,_,u,f,g,v,w,y,m;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._points.length<2)return null;for(e=this._source.properties(),t=new h,i=this,n=function(t,n){return{points:[t],text:$.t(n),color:e.textcolor.value(),horzAlign:"center",font:e.font.value(),offsetX:0,offsetY:0,bold:e.bold&&e.bold.value(),italic:e.italic&&e.italic.value(),fontsize:e.fontsize.value(),backgroundColor:i._source.properties().color.value(),backgroundRoundRect:4}},r=function(t,n,r,s){return{points:[t,n],width:i._model.timeScale().width(),height:i._source.priceScale().height(),color:d.generateColor(i._source.properties().color.value(),r),linewidth:s||e.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:c.Normal,rightend:c.Normal}},s=function(t,i,n){var r=[t,i,n],s={};return s.points=r,s.color=e.color.value(),s.linewidth=0,s.backcolor=e.backgroundColor.value(),s.fillBackground=e.fillBackground.value(),s.transparency=e.transparency.value(),s},o=1;o=5&&(f=!1,g=!1,this._intersect1?_=this._intersect1:(_=this._points[2],f=!0),this._intersect2?u=this._intersect2:(u=this._points[4],g=!0),l=r(_,u,0),l.extendleft=f,l.extendright=g,this._trendLineRenderer.setData(l),t.append(this._trendLineRenderer),v=s(this._points[2],this._points[3],this._points[4]),this._triangleRendererPoints234.setData(v),t.append(this._triangleRendererPoints234)), this._intersect1&&(v=s(this._intersect1,this._points[1],this._points[2]),this._intersect1Renderer.setData(v),t.append(this._intersect1Renderer)),this._intersect2&&(v=s(this._points[4],this._points[5],this._intersect2),this._intersect2Renderer.setData(v),t.append(this._intersect2Renderer)),w=this._i18nCache(),this._points.length>=2&&(y=this._points[1],m=n(y,w.leftShoulder),this._points[1].y=4&&(y=this._points[3],m=n(y,w.head),this._points[3].y=6&&(y=this._points[5],m=n(y,w.rightShoulder),this._points[5].y=5&&(e=this._points[0],t=this._points[1],i=this._points[2],n=this._points[4],a=r(i,n,e,t),null!==a&&(o=n.subtract(i),this._intersect1=i.add(o.scaled(a))),7===this._points.length&&(l=this._points[5],h=this._points[6],null!==(a=r(i,n,l,h))&&(o=n.subtract(i),this._intersect2=i.add(o.scaled(a)))))},t.LineToolHeadAndShouldersPaneView=n},1166:function(e,t,i){"use strict";function n(e,t){r.call(this,e,t),this._invalidated=!0,this._renderer=new a}var r=i(371).LineSourcePaneView,s=i(53).CompositeRenderer,a=i(1217).TriangleRenderer;inherit(n,r),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){r.prototype._updateImpl.call(this),this._invalidated=!1},n.prototype.renderer=function(){var e,t;return this._invalidated&&this.updateImpl(),e={},e.points=this._points,e.color=this._source.properties().color.value(),e.linewidth=this._source.properties().linewidth.value(),e.backcolor=this._source.properties().backgroundColor.value(),e.fillBackground=this._source.properties().fillBackground.value(),e.transparency=this._source.properties().transparency.value(),this._renderer.setData(e),this.isAnchorsRequired()?(t=new s,t.append(this._renderer),this.addAnchors(t),t):this._renderer},t.TrianglePaneView=n},1167:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this._invalidated=!0,this._trendLineRendererPoints01=new o,this._trendLineRendererPoints12=new o,this._trendLineRendererPoints23=new o,this._intersectionRenderer=new a,this._poligonRenderer=new h,this._aLabelRenderer=new l({}),this._bLabelRenderer=new l({}),this._cLabelRenderer=new l({}),this._dLabelRenderer=new l({})} var r=i(8).Point,s=i(371).LineSourcePaneView,a=i(1217).TriangleRenderer,o=i(110).TrendLineRenderer,l=i(166).TextRenderer,h=i(380),d=i(53).CompositeRenderer,c=i(74).LineEnd;inherit(n,s),n.prototype.renderer=function(){var e,t,i,n,r,s,a,o,l;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._points.length<2?null:(e=this._source.properties(),t=new d,i=this,n=function(t,n){return{points:[t],text:n,color:e.textcolor.value(),vertAlign:"middle",horzAlign:"center",font:e.font.value(),offsetX:0,offsetY:0,bold:e.bold&&e.bold.value(),italic:e.italic&&e.italic.value(),fontsize:e.fontsize.value(),backgroundColor:i._source.properties().color.value(),backgroundRoundRect:4}},r=function(t,n){return{points:[t,n],width:i._model.timeScale().width(),height:i._source.priceScale().height(),color:i._source.properties().color.value(),linewidth:e.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:c.Normal,rightend:c.Normal}},s=r(this._points[0],this._points[1]),this._trendLineRendererPoints01.setData(s),t.append(this._trendLineRendererPoints01),this._points.length>=3&&(s=r(this._points[1],this._points[2]),this._trendLineRendererPoints12.setData(s),t.append(this._trendLineRendererPoints12)),4===this._points.length&&(s=r(this._points[2],this._points[3]),this._trendLineRendererPoints23.setData(s),t.append(this._trendLineRendererPoints23),this._intersectPoint?(a=[this._startPoint1,this._startPoint2,this._intersectPoint],o={},o.points=a,o.color=e.color.value(),o.linewidth=e.linewidth.value(),o.backcolor=e.backgroundColor.value(),o.fillBackground=e.fillBackground.value(),o.transparency=e.transparency.value(),this._intersectionRenderer.setData(o),t.append(this._intersectionRenderer)):this._intersectPoint1&&this._intersectPoint2&&(a=[this._startPoint1,this._startPoint2,this._intersectPoint2,this._intersectPoint1],o={},o.filled=!0,o.fillBackground=!0,o.points=a,o.color=e.color.value(),o.linewidth=e.linewidth.value(),o.backcolor=e.backgroundColor.value(),o.transparency=e.transparency.value(),this._poligonRenderer.setData(o),t.append(this._poligonRenderer))),l=n(this._points[0],"A"),this._points[1].y>this._points[0].y?(l.vertAlign="bottom",l.offsetY=-10):(l.vertAlign="top",l.offsetY=5),this._aLabelRenderer.setData(l),t.append(this._aLabelRenderer),l=n(this._points[1],"B"),this._points[1].y2&&(l=n(this._points[2],"C"),this._points[2].y3&&(l=n(this._points[3],"D"),this._points[3].y=4&&(e=this._source.points()[1],t=this._source.points()[2],i=this._source.points()[3],this._retrace1=Math.round(100*Math.abs((i.price-t.price)/(t.price-e.price)))/100), this._source.points().length>=6&&(i=this._source.points()[3],n=this._source.points()[4],s=this._source.points()[5],this._retrace2=Math.round(100*Math.abs((s.price-n.price)/(n.price-i.price)))/100)},t.LineToolThreeDrivesPaneView=n},1169:function(e,t,i){"use strict";function n(e,t){r.call(this,e,t),this._numericFormatter=new l,this._invalidated=!0,this._lineRendererPoints01=new s,this._lineRendererPoints12=new s,this._lineRendererPoints23=new s,this._abRetracementTrend=new s,this._cdRetracementTrend=new s,this._abLabelRenderer=new a({}),this._cdLabelRenderer=new a({}),this._textRendererALabel=new a({}),this._textRendererBLabel=new a({}),this._textRendererCLabel=new a({}),this._textRendererDLabel=new a({})}var r=i(371).LineSourcePaneView,s=i(110).TrendLineRenderer,a=i(166).TextRenderer,o=i(53).CompositeRenderer,l=i(89).NumericFormatter,h=i(30),d=i(74).LineEnd;inherit(n,r),n.prototype.renderer=function(){var e,t,i,n,r,s,a,l,c;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._points.length<2?null:(e=this._source.properties(),t=new o,i=this._points,n=this,r=function(t,i){return{points:[t],text:i,color:e.textcolor.value(),vertAlign:"middle",horzAlign:"center",font:e.font.value(),offsetX:0,offsetY:0,bold:e.bold&&e.bold.value(),italic:e.italic&&e.italic.value(),fontsize:e.fontsize.value(),backgroundColor:n._source.properties().color.value(),backgroundRoundRect:4}},s=function(t,i,r,s){return{points:[t,i],width:n._model.timeScale().width(),height:n._source.priceScale().height(),color:h.generateColor(n._source.properties().color.value(),r),linewidth:s||e.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:d.Normal,rightend:d.Normal}},a=s(i[0],i[1],0),this._lineRendererPoints01.setData(a),t.append(this._lineRendererPoints01),i.length>=3&&(a=s(i[1],i[2],0),this._lineRendererPoints12.setData(a),t.append(this._lineRendererPoints12)),4===i.length&&(a=s(i[2],i[3],0),this._lineRendererPoints23.setData(a),t.append(this._lineRendererPoints23)),l=r(this._points[0],"A"),this._points[1].y>this._points[0].y?(l.vertAlign="bottom",l.offsetY=-10):(l.vertAlign="top",l.offsetY=5),this._textRendererALabel.setData(l),t.append(this._textRendererALabel),l=r(this._points[1],"B"),this._points[1].y2&&(l=r(this._points[2],"C"),this._points[2].y3&&(l=r(this._points[3],"D"),this._points[3].y=3&&(c=this._points[0].add(this._points[2]).scaled(.5),a=s(this._points[0],this._points[2],70,1),this._abRetracementTrend.setData(a),t.append(this._abRetracementTrend), l=r(c,this._numericFormatter.format(this._ABRetracement)),this._abLabelRenderer.setData(l),t.append(this._abLabelRenderer)),this._points.length>=4&&(c=this._points[1].add(this._points[3]).scaled(.5),a=s(this._points[1],this._points[3],70,1),this._cdRetracementTrend.setData(a),t.append(this._cdRetracementTrend),l=r(c,this._numericFormatter.format(this._CDRetracement)),this._cdLabelRenderer.setData(l),t.append(this._cdLabelRenderer)),this.addAnchors(t),t)},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var e,t,i,n;r.prototype._updateImpl.call(this),this._source.points().length>=3&&(e=this._source.points()[0],t=this._source.points()[1],i=this._source.points()[2],this._ABRetracement=Math.round(1e3*Math.abs((i.price-t.price)/(t.price-e.price)))/1e3),4===this._source.points().length&&(n=this._source.points()[3],this._CDRetracement=Math.round(1e3*Math.abs((n.price-i.price)/(i.price-t.price)))/1e3)},t.ABCDPaneView=n},1170:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this._invalidated=!0,this._percentageFormatter=new c,this._numericFormatter=new p,this._pipFormatter=null,this._lastSymbolInfo=null,this._entryLineRenderer=new a,this._stopLineRenderer=new a,this._targetLineRenderer=new a,this._positionLineRenderer=new a,this._fullStopBgRenderer=new l(new h(h.MOVEPOINT),new h(h.MOVEPOINT)),this._stopBgRenderer=new l(new h(h.MOVEPOINT),new h(h.MOVEPOINT)),this._fullTargetBgRenderer=new l(new h(h.MOVEPOINT),new h(h.MOVEPOINT)),this._targetBgRenderer=new l(new h(h.MOVEPOINT),new h(h.MOVEPOINT)),this._stopLabelRenderer=new o({}),this._middleLabelRenderer=new o({}),this._profitLabelRenderer=new o({})}var r=i(8).Point,s=i(371).LineSourcePaneView,a=i(110).TrendLineRenderer,o=i(166).TextRenderer,l=i(373).RectangleRenderer,h=i(11),d=i(53).CompositeRenderer,c=i(167).PercentageFormatter,p=i(89).NumericFormatter,_=i(377).PipFormatter,u=i(30),f=i(74).LineEnd,g=i(408).RiskRewardPointIndex;inherit(n,s),n.prototype.i18nCache={pnl:$.t("{0} P&L: {1}"),open:$.t("Open",{context:"line_tool_position"}),closed:$.t("Closed",{context:"line_tool_position"}),ratio:$.t("Risk/Reward Ratio: {0}"),stop:$.t("Stop: {0} ({1}) {2}, Amount: {3}"),target:$.t("Target: {0} ({1}) {2}, Amount: {3}"),qty:$.t("Qty: {0}")},n.prototype._formatInTicks=function(e){var t=this._model.mainSeries().base();return Math.round(e*t)},n.prototype.isLabelVisible=function(){return this.isHoveredSource()||this.isSelectedSource()},n.prototype.update=function(){this._invalidated=!0},n.prototype._updateImpl=function(){var e,t,i,n,r,a,o;s.prototype._updateImpl.call(this),this._stopLevel=null,this._profitLevel=null,e=this._model.timeScale(),!(t=this._source.priceScale())||t.isEmpty()||e.isEmpty()||0!==this._source.points().length&&0!==this._points.length&&null!==this._model.mainSeries().bars().last()&&(this._source.points().length<2||0!==this._model.mainSeries().bars().length&&(this._isClosed=4===this._source.points().length,(i=this._source.lastBarData())&&(n=this._source.priceScale(),r=this._source.stopPrice(), a=this._source.profitPrice(),this._pl=this._source.points().length>1?this._source.calculatePL(i.closePrice):0,n.isPercent()&&(o=this._source.ownerSource().firstValue(),r=n.priceRange().convertToPercent(r,o),a=n.priceRange().convertToPercent(a,o),i.closePrice=n.priceRange().convertToPercent(i.closePrice,o)),this._entryLevel=this._points[g.Entry].y,this._stopLevel=t.priceToCoordinate(r),this._profitLevel=t.priceToCoordinate(a),this._closeLevel=t.priceToCoordinate(i.closePrice),this._closeBar=this._source._model.timeScale().indexToCoordinate(i.index))))},n.prototype.renderer=function(){var e,t,i,n,s,a,o,l,h,c,p,v,w,y,m,x,b,S,P,R,T,L,C,k,I,B,M,A,D,E,O,N,V,z,F,W,H,Y;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),e=new d,this._points.length<2||this._source.points().length<2?e:(t=this,i=this._source.properties(),n=this._points[g.Entry].x,s=this._points[g.ActualEntry]?this._points[g.ActualEntry].x:this._points[g.Close].x,a=this._points[g.ActualClose]?this._points[g.ActualClose].x:this._points[g.Close].x,o=this._points[g.Close].x,l=new r(n,this._entryLevel),h=new r(o,this._stopLevel),c={},c.points=[l,h],c.color="white",c.linewidth=0,c.backcolor=i.stopBackground.value(),c.fillBackground=!0,c.transparency=i.stopBackgroundTransparency.value(),this._fullStopBgRenderer.setData(c),e.append(this._fullStopBgRenderer),this._pl<0&&(l=new r(s,this._entryLevel),h=new r(a,this._closeLevel),c={},c.points=[l,h],c.color="white",c.linewidth=0,c.backcolor=i.stopBackground.value(),c.fillBackground=!0,p=.01*i.stopBackgroundTransparency.value(),v=100*(1-p*p*p),w=100-v,c.transparency=w,this._stopBgRenderer.setData(c),e.append(this._stopBgRenderer)),l=new r(n,this._entryLevel),h=new r(o,this._profitLevel),c={},c.points=[l,h],c.color="white",c.linewidth=0,c.backcolor=i.profitBackground.value(),c.fillBackground=!0,c.transparency=i.profitBackgroundTransparency.value(),this._fullTargetBgRenderer.setData(c),e.append(this._fullTargetBgRenderer),this._pl>0&&(l=new r(s,this._entryLevel),h=new r(a,this._closeLevel),c={},c.points=[l,h],c.color="white",c.linewidth=0,c.backcolor=i.profitBackground.value(),c.fillBackground=!0,p=.01*i.profitBackgroundTransparency.value(),y=100*(1-p*p*p),m=100-y,c.transparency=m,this._targetBgRenderer.setData(c),e.append(this._targetBgRenderer)),x=function(i,n,r,s){var a={};a.points=[n,r],a.width=t._model.timeScale().width(),a.height=t._source.priceScale().height(),a.color=s||t._source.properties().linecolor.value(),a.linewidth=t._source.properties().linewidth.value(),a.linestyle=CanvasEx.LINESTYLE_SOLID,a.extendleft=!1,a.extendright=!1,a.leftend=f.Normal,a.rightend=f.Normal,i.setData(a),e.append(i)},this._points[g.ActualEntry]&&(l=this._points[g.ActualEntry],h=this._isClosed?this._points[g.ActualClose]:new r(this._closeBar,this._closeLevel),c={},c.points=[l,h],c.width=t._model.timeScale().width(),c.height=t._source.priceScale().height(),c.color=t._source.properties().linecolor.value(),c.linewidth=1,c.linestyle=CanvasEx.LINESTYLE_DASHED,c.extendleft=!1,c.extendright=!1,c.leftend=f.Normal,c.rightend=f.Arrow, this._positionLineRenderer.setData(c),e.append(this._positionLineRenderer)),t=this,b=function(n,r,s,a,o,l,h){if(t.isLabelVisible()||TradingView.printing){var d={};d.points=[r],d.text=s,d.color=i.textcolor.value(),d.font=i.font.value(),d.offsetX=3,d.offsetY=l,d.vertAlign=o,d.horzAlign="center",d.backgroundRoundRect=4,d.backgroundColor=u.resetTransparency(a),d.fontsize=i.fontsize.value(),d.backgroundHorzInflate=4,d.backgroundVertInflate=2,h&&(d.borderColor=h),n.setData(d),e.append(n)}},S=this._source.entryPrice(),P=this._source.stopPrice(),R=this._source.profitPrice(),T=Math.abs(P-S),L=Math.round(1e4*T/S)/100,C=Math.abs(R-S),k=Math.round(1e4*C/S)/100,I=Math.abs(S-R)/Math.abs(S-P),l=new r(n,this._points[g.Entry].y),h=new r(o,this._points[g.Entry].y),x(this._entryLineRenderer,l,h),B=new r((n+o)/2,Math.round(this._points[0].y)+.5),M="",A="",D=this._numericFormatter.format(Math.round(100*I)/100),this._points[1]&&void 0!==this._pl&&(A=this._source.priceScale().formatter().format(this._pl)),i.compact.value()?(M+=A?A+" ~ ":"",M+=i.qty.value()+"\n",M+=D):(E=this._isClosed?this.i18nCache.closed:this.i18nCache.open,M+=A?this.i18nCache.pnl.format(E,A)+", ":"",M+=this.i18nCache.qty.format(i.qty.value())+"\n",M+=this.i18nCache.ratio.format(D)+" "),O=i.linecolor.value(),this._pl<0?O=i.stopBackground.value():this._pl>0&&(O=i.profitBackground.value()),b(this._middleLabelRenderer,B,M,O,"middle",0,"white"),l=new r(n,this._stopLevel),h=new r(o,this._stopLevel),x(this._stopLineRenderer,l,h,i.stopBackground.value()),N=this._model.mainSeries().symbolInfo(),N&&N!==this._lastSymbolInfo&&(this._pipFormatter=new _(N.pricescale,N.minmov,N.type,N.minmove2),this._lastSymbolInfo=N),B=new r((n+o)/2,this._stopLevel),M="",V=this._source.priceScale().formatter().format(T),z=this._percentageFormatter.format(L),M=i.compact.value()?V+" ("+z+") "+i.amountStop.value():this.i18nCache.stop.format(this._source.priceScale().formatter().format(T),this._percentageFormatter.format(L),this._pipFormatter?this._pipFormatter.format(T):"",i.amountStop.value()),b(this._stopLabelRenderer,B,M,i.stopBackground.value(),Sr)for(;;){if(p=o*Math.sin(c),_=l*(1-Math.cos(c)),u=Math.sqrt((p-o)*(p-o)+(_-l)*(_-l)),Math.abs(u-r)<1)break;u>r?h=c:d=c,c=(h+d)/2}a=Math.atan((o-p)/(l-_)),n.x*n.y<0&&(a=-a)}e.save(),e.beginPath(),e.translate(i.x,i.y),e.rotate(-a),e.moveTo(0,0),e.lineTo(-r/2,s*r),e.lineTo(r/2,s*r),e.lineTo(0,0),e.restore(),e.fill()}},n.prototype.targetLabelHitTest=function(e){var t,i,n,r,s,a,o,l,h,d=this._data.points[1],p=1.5*this._targetFontSize1+1.5*this._targetFontSize2,_=this._targetFontSize1*this._data.targetLine1.length,u=this._targetFontSize1*this._data.targetLine2.length,f=this._targetFontSize2*this._data.targetLine3.length,g=this._targetFontSize2*this._data.targetLine4.length;return this._data.status&&(p+=1.5*this._targetFontSize1),t=Math.max(_+u,f+g)-20,i=20,n=5,r="up"===this._data.direction?-1:1,s=d.x-i,a=d.y+n*r,o=d.y+(n+p)*r,l=Math.min(a,o),h=Math.max(a,o),e.x>=s&&e.x<=s+t&&e.y>=l&&e.y<=h?new c(c.MOVEPOINT):null},n.prototype.sourceLabelHitTest=function(e){var t=1.5*this._sourceFontSize1+1.5*this._sourceFontSize2,i=this._sourceFontSize1*this._data.sourceLine1.length,n=this._sourceFontSize2*this._data.sourceLine2.length,r=Math.max(i,n),s=this._data.points[0],a=20,o=5,l="up"===this._data.direction?1:-1,h=s.x-a,d=s.y+o*l,p=s.y+(o+t)*l,_=Math.min(d,p),u=Math.max(d,p);return e.x>=h&&e.x<=h+r&&e.y>=_&&e.y<=u?new c(c.MOVEPOINT):null},n.prototype.hitTest=function(e){var t,i,n,r,s,a,o,l;return null===this._data||this._data.points.length<2?null:(t=this._data.points[0],i=this._data.points[1],n=i.subtract(t),n=i.subtract(t),r=e.subtract(t),s=Math.abs(n.x),a=Math.abs(n.y),o=u.sign(n.y)*(a-a*Math.sqrt(1-r.x*r.x/(s*s))),l=3,Math.abs(o-r.y)0){if(e=this._source.points()[0].price,!(t=this._source.priceScale())||t.isEmpty())return;t.isPercent()&&(i=this._source.ownerSource().firstValue(),e=t.priceRange().convertToPercent(e,i)),this._priceLabel=t.formatter().format(e)}},r.prototype.renderer=function(){var e,t;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),e={},e.points=this._points,e.borderColor=this._source.properties().borderColor.value(),e.backgroundColor=this._source.properties().backgroundColor.value(),e.color=this._source.properties().color.value(), e.fontWeight=this._source.properties().fontWeight.value(),e.fontSize=this._source.properties().fontsize.value(),e.fontFamily=this._source.properties().font.value(),e.transparency=this._source.properties().transparency.value(),e.label=this._priceLabel,e.image=this._image,this._renderer.setData(e),this.isAnchorsRequired()&&1===e.points.length?(t=new d,t.append(this._renderer),t.append(new l({points:e.points})),t):this._renderer},t.PriceLabelPaneView=r},1174:function(e,t,i){"use strict";function n(){}function r(e){this._source=e,this._data=null}function s(e,t){l.call(this,e,t),this._rendererSource=new n,this._invalidated=!0,this._renderer=new r(this._rendererSource)}var a=i(8).Point,o=i(60).pointInRectangle,l=i(371).LineSourcePaneView,h=i(166).TextRenderer,d=i(131).SelectionRenderer,c=i(11),p=i(53).CompositeRenderer,_=i(30);n.prototype.update=function(e){this._data&&(!this._data||e.markerColor===this._data.markerColor&&e.width===this._data.width&&e.height===this._data.height)||this._createSource(e.width,e.height,e.markerColor),this._data=e},n.prototype._createSource=function(e,t,i){var n,r;this._sourceCanvas=document.createElement("canvas"),this._sourceCanvas.width=e,this._sourceCanvas.height=t,this._translate=new a(-e/2,.5-t),this._translate.x%1==0&&(this._translate.x+=.5),n=this._sourceCanvas.getContext("2d"),r=.6*e,n.fillStyle=i,n.beginPath(),n.moveTo(e/2,t),n.quadraticCurveTo(e,e/1.15,e,e/2),n.arc(e/2,e/2,e/2,0,Math.PI,!0),n.quadraticCurveTo(0,e/1.15,e/2,t),n.fill(),n.globalCompositeOperation="destination-out",n.beginPath(),n.moveTo((e-r)/2,e/2),n.arc(e/2,e/2,r/2,0,2*Math.PI),n.fill()},n.prototype.drawOn=function(e){var t=new a(Math.round(this._data.point.x),Math.round(this._data.point.y)).add(this._translate);e.drawImage(this._sourceCanvas,t.x,t.y)},n.prototype.hasPoint=function(e){var t=this._data.point.add(this._translate),i=new a(this._data.point.x-this._translate.x,this._data.point.y);return o(e,t,i)},r.prototype.setData=function(e){this._data=e},r.prototype.draw=function(e){null!==this._data&&(this._source.drawOn(e),this._data.tooltipVisible&&this.drawTooltipOn(e))},r.prototype.drawTooltipOn=function(e){var t,i,n,r,s,a,o,l,d,c,p,u,f,g,v;for(e.save(),t=(this._data.text+"").replace(/^\s+|\s+$/g,"").replace(/[\r\n]+/g,"\n"),e.font=(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font,i=this._data.tooltipWidth-2*this._data.tooltipPadding,n=h.prototype.wordWrap(t,i,e.font),r=this._data.point,s=this._data.tooltipLineSpacing,a=this._data.tooltipWidth,o=n.length*this._data.fontSize+2*this._data.tooltipPadding,n.length>1&&(o+=(n.length-1)*s),l=Math.round(r.x-a/2),d=Math.round(r.y-this._data.height-o-8),c=r.x<20||r.x+20>this._data.vpWidth,p=c?null:"top",u=c?null:Math.round(r.x),d<10?d=r.y+13:p="bottom",l<10?l+=Math.abs(l-10):l+a+10>this._data.vpWidth&&(l-=l+a+10-this._data.vpWidth),e.fillStyle=_.generateColor(this._data.backgroundColor,this._data.backgroundTransparency),e.strokeStyle=this._data.markerColor,e.lineWidth=1,e.beginPath(),e.moveTo(l,d), c||"top"!==p||(e.lineTo(u-7,d),e.lineTo(u,d-7),e.lineTo(u+7,d)),e.lineTo(l+a,d),e.lineTo(l+a,d+o),c||"bottom"!==p||(e.lineTo(u+7,d+o),e.lineTo(u,d+o+7),e.lineTo(u-7,d+o)),e.lineTo(l,d+o),e.closePath(),e.fill(),e.stroke(),e.textBaseline="middle",e.fillStyle=this._data.textColor,f=l+this._data.tooltipPadding,g=d+this._data.tooltipPadding+this._data.fontSize/2,v=0;v0&&(n=[e.points[0],e.points[e.points.length-1]],i.append(new o({points:n}))),i):this._poligonRenderer},t.BrushPaneView=n},1176:function(e,t,i){"use strict";function n(){this._data=null}function r(e,t){p.call(this,e,t),this._invalidated=!0,this._renderer=new n}var s=i(8).Point,a=i(44).distanceToLine,o=i(382),l=o.rotationMatrix,h=o.scalingMatrix,d=o.translationMatrix,c=o.transformPoint,p=i(371).LineSourcePaneView,_=i(11),u=i(53).CompositeRenderer,f=i(30);n.prototype.setData=function(e){this._data=e,this._data.angleFrom=0,this._data.angleTo=Math.PI,this._data.clockwise=!1},n.prototype.draw=function(e){var t,i,n,r,o,p,_,u,g,v,w,y,m,x;if(!(null===this._data||this._data.points.length<2)){if(t=this._data.points[0],i=this._data.points[1],this._data.points.length<3)return e.strokeStyle=this._data.color,e.lineWidth=this._data.linewidth,e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(i.x,i.y),void e.stroke();if(n=this._data.points[2],(r=a(t,i,n).distance)<1)return e.strokeStyle=this._data.color,e.lineWidth=this._data.linewidth,e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(i.x,i.y),void e.stroke();o=i.subtract(t),p=t.add(i).scaled(.5),_=new s(-o.y,o.x),_=_.normalized(),n=p.add(_.scaled(r)),e.strokeStyle=this._data.color,e.lineWidth=this._data.linewidth,u=o.length(),g=o.x/u,v=o.y/u,w=Math.acos(g),v<0&&(w=-w),y=this._data.points[2],m=d(-p.x,-p.y),y=c(m,y),m=l(-w),y=c(m,y),m=h(1,u/(2*r)),y=c(m,y),y.y<0?this._data.clockwise=!0:this._data.clockwise=!1,e.save(),e.beginPath(),e.translate(t.x,t.y),e.rotate(w),x=1-Math.sqrt(3)/2,e.scale(1,r/(u*x)),this._data.clockwise?e.arc(.5*u,u*Math.sqrt(3)/2,u,-2*Math.PI/3,-Math.PI/3,!1):e.arc(.5*u,-u*Math.sqrt(3)/2,u,Math.PI/3,2*Math.PI/3,!1),e.restore(),e.stroke(),this._data.fillBackground&&(e.fillStyle=f.generateColor(this._data.backcolor,this._data.transparency),e.fill())}},n.prototype.hitTest=function(e){var t,i,n,r,o,p,u,f,g,v,w,y,m,x,b,S,P;return null===this._data||this._data.points.length<3?null:(t=5,i=this._data.points[0],n=this._data.points[1],r=this._data.points[2],(o=a(i,n,r).distance)<1?(o=a(i,n,e).distance,o=0?new s(_.x,_.y):new s(y.x,y.y),T.data=2,i.push(T),t.append(this.createLineAnchor({points:i})),t))):this._renderer},t.ArcPaneView=r},1177:function(e,t,i){"use strict";function n(e){this._data=null,this._textSizeCache=e}function r(e,t){a.call(this,e,t),this._textSizeCache={},this._invalidated=!0,this._renderer=new n(this._textSizeCache)}var s=i(8).Point,a=i(371).LineSourcePaneView,o=i(11),l=i(53).CompositeRenderer,h=i(30),d=i(410).CalloutConsts;!function(){function e(){var e=document.createElement("canvas");e.width=0,e.height=0,t=e.getContext("2d"),e=null}var t;n.prototype.wordWrap=function(i,n){var r,s,a,o,l,h,d,c,p;if(t||e(),n=+n,i+="",r=i.split(/[^\S\r\n]*(?:\r\n|\r|\n|$)/),r[r.length-1]||r.pop(),!isFinite(n)||n<=0)return r;for(t.font=this.fontStyle(),s=[],a=0;a0&&t.measureText(h.slice(0,3*--d-1).join("")).width>n;);if(d>0)s.push(h.slice(0,3*d-1).join("")),h.splice(0,3*d);else{if(c=h[0]+(h[1]||""),p=1===p?1:~~(n/t.measureText(c)*c.length),t.measureText(c.substr(0,p)).width<=n)for(;t.measureText(c.substr(0,p+1)).width<=n;)p++;else for(;p>1&&t.measureText(c.substr(0,--p)).width>n;);p<1&&(p=1),s.push(c.substr(0,p)),h[0]=c.substr(p),h[1]=""}if((l=t.measureText(h.join("")).width)<=n){s.push(h.join(""));break}}return s}}(),n.prototype.setData=function(e){this._data=e,this._data.lines=this.wordWrap(e.text,e.wordWrapWidth)},n.prototype.hitTest=function(e){var t,i,n,r,s;return null===this._data||this._data.points.length<2?null:(t=this._data.points[0],i=this._data.points[1],n=3,t.subtract(e).length()=r&&e.x<=r+this._textSizeCache.totalWidth&&e.y>=s&&e.y<=s+this._textSizeCache.totalHeight?new o(o.MOVEPOINT):null))},n.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font},n.prototype.draw=function(e){var t,i,n,r,s,a,o,l,c,p,_,u,f,g;if(!(null===this._data||this._data.points.length<2)){for(t=this._data.points[0].clone(), i=this._data.points[1].clone(),e.lineCap="butt",e.strokeStyle=this._data.bordercolor,e.lineWidth=this._data.linewidth,e.textBaseline="bottom",e.font=this.fontStyle(),n=this._data.fontSize*this._data.lines.length,r=this._data.wordWrapWidth||this._data.lines.reduce(function(t,i){return Math.max(t,e.measureText(i).width)},0),this._textSizeCache.textHeight=n,this._textSizeCache.textHeight=r,s=d.RoundRadius,a=d.TextMargins,o=r+2*a+2*s,l=n+2*a+2*s,this._textSizeCache.totalWidth=o,this._textSizeCache.totalHeight=l,c=i.x-o/2,p=i.y-l/2,_=0,u=r+2*a>2*s,f=n+2*a>2*s,t.x>c+o?_=20:t.x>c&&(_=10),t.y>p+l?_+=2:t.y>p&&(_+=1),e.save(),e.translate(c,p),t.x-=c,t.y-=p,i.x-=c,i.y-=p,e.beginPath(),e.moveTo(s,0),10===_?u?(e.lineTo(i.x-s,0),e.lineTo(t.x,t.y),e.lineTo(i.x+s,0),e.lineTo(o-s,0)):(e.lineTo(t.x,t.y),e.lineTo(o-s,0)):e.lineTo(o-s,0),20===_?(e.lineTo(t.x,t.y),e.lineTo(o,s)):e.arcTo(o,0,o,s,s),21===_?f?(e.lineTo(o,i.y-s),e.lineTo(t.x,t.y),e.lineTo(o,i.y+s),e.lineTo(o,l-s)):(e.lineTo(t.x,t.y),e.lineTo(o,l-s)):e.lineTo(o,l-s),22===_?(e.lineTo(t.x,t.y),e.lineTo(o-s,l)):e.arcTo(o,l,o-s,l,s),12===_?u?(e.lineTo(i.x+s,l),e.lineTo(t.x,t.y),e.lineTo(i.x-s,l),e.lineTo(s,l)):(e.lineTo(t.x,t.y),e.lineTo(s,l)):e.lineTo(s,l),2===_?(e.lineTo(t.x,t.y),e.lineTo(0,l-s)):e.arcTo(0,l,0,l-s,s),1===_?f?(e.lineTo(0,i.y+s),e.lineTo(t.x,t.y),e.lineTo(0,i.y-s),e.lineTo(0,s)):(e.lineTo(t.x,t.y),e.lineTo(0,s)):e.lineTo(0,s),0===_?(e.lineTo(t.x,t.y),e.lineTo(s,0)):e.arcTo(0,0,s,0,s),e.stroke(),e.fillStyle=h.generateColor(this._data.backcolor,this._data.transparency),e.fill(),e.fillStyle=this._data.color,p=s+a+this._data.fontSize,c=s+a,g=0;g>1)+d.RoundRadius+d.TextMargins,r.y),o.data=1,n.append(this.createLineAnchor({points:[o]}))),n):this._renderer):new l},t.CalloutPaneView=r},1178:function(e,t,i){"use strict";function n(e){ this._measureCache=e,this._data=null}function r(e,t){o.call(this,e,t),this._rendererCache={},this._invalidated=!0,this._renderer=new n(this._rendererCache)}var s=i(8).Point,a=i(60).pointInRectangle,o=i(371).LineSourcePaneView,l=i(131).SelectionRenderer,h=i(11),d=i(53).CompositeRenderer,c=i(30);n.prototype.setData=function(e){this._data=e},n.prototype.draw=function(e){var t,i,n,r,s,a,o;null!==this._data&&0!==this._data.points.length&&(e.font=[this._data.fontWeight,this._data.fontSize+"px",this._data.fontFamily].join(" "),t=e.measureText(this._data.label),t.height=this._data.fontSize,i=15,n={left:i,top:(2*i-t.height)/2},r=t.width+2*n.left,s=2*i,a=this._data.points[0].x-(n.left+20),o=this._data.points[0].y-(s+9),this._measureCache&&$.extend(this._measureCache,{innerWidth:r,innerHeight:s,padding:n}),e.translate(.5+a,.5+o),e.beginPath(),e.moveTo(i+9,s),e.lineTo(i,s),e.arcTo(-1e3,0,1e3,0,i),e.lineTo(r-i,0),e.arcTo(1e3,s,-1e3,s,i),e.lineTo(i+18,s),e.quadraticCurveTo(i+18,s+4,i+20,s+9),e.quadraticCurveTo(i+12,s+6,i+9,s),e.fillStyle=c.generateColor(this._data.backgroundColor,this._data.transparency),e.fill(),e.strokeStyle=this._data.borderColor,e.lineWidth=2,e.stroke(),e.closePath(),e.textBaseline="top",e.fillStyle=this._data.color,e.fillText(this._data.label,n.left,n.top-1))},n.prototype.hitTest=function(e){var t,i;return null!==this._data&&0!==this._data.points.length&&this._measureCache.padding?(t=this._data.points[0].x-(this._measureCache.padding.left+20),i=this._data.points[0].y-(this._measureCache.innerHeight+9),a(e,new s(t,i),new s(t+this._measureCache.innerWidth,i+this._measureCache.innerHeight))?new h(h.MOVEPOINT):null):null},inherit(r,o),r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){o.prototype._updateImpl.call(this),this._invalidated=!1},r.prototype.renderer=function(){var e,t;return this._invalidated&&this.updateImpl(),e={},e.points=this._points,e.color=this._source.properties().color.value(),e.borderColor=this._source.properties().borderColor.value(),e.backgroundColor=this._source.properties().backgroundColor.value(),e.transparency=this._source.properties().transparency.value(),e.fontWeight=this._source.properties().fontWeight.value(),e.fontSize=this._source.properties().fontsize.value(),e.fontFamily=this._source.properties().font.value(),e.label=this._source.properties().text.value(),this._renderer.setData(e),this.isAnchorsRequired()&&1===e.points.length?(t=new d,t.append(this._renderer),t.append(new l({points:e.points})),t):this._renderer},t.BalloonPaneView=r},1179:function(e,t,i){"use strict";function n(e,t){s.call(this,e,t),this._rendererCache={},this._labelRenderer=new a({}),this._lineRenderer=new h,this._lineRenderer.setHitTest(new o(o.MOVEPOINT))}var r=i(8).Point,s=i(371).LineSourcePaneView,a=i(166).TextRenderer,o=i(11),l=i(53).CompositeRenderer,h=i(94).HorizontalLineRenderer,d=i(1199).PaneRendererClockIcon;inherit(n,s),n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){s.prototype._updateImpl.call(this)}, n.prototype.renderer=function(){var e,t,i,n,s,a,o,h,c,p,_;return this._invalidated&&(this.updateImpl(),this._invalidated=!1),e=new l,t={},t.width=this._model.timeScale().width(),t.height=this._source.priceScale().height(),t.points=this._points,t.color=this._source.properties().linecolor.value(),t.linewidth=this._source.properties().linewidth.value(),t.linestyle=this._source.properties().linestyle.value(),this._lineRenderer.setData(t),i=this._source.properties(),e.append(this._lineRenderer),this._source.properties().showLabel.value()&&1===this._points.length&&(n=i.vertLabelsAlign.value(),s=i.horzLabelsAlign.value(),a=this._points[0],o=0,h=0,"left"===s?a.x=3:"right"===s?(a.x=this._model.timeScale().width(),h=-5):a.x=this._model.timeScale().width()/2,"middle"===n?o=-this._source.properties().fontsize.value()/6:"bottom"===n&&(o=-4),c={points:[a],text:i.text.value(),color:i.textcolor.value(),vertAlign:n,horzAlign:s,font:i.font.value(),offsetX:h,offsetY:o,bold:this._source.properties().bold.value(),italic:this._source.properties().italic.value(),fontsize:this._source.properties().fontsize.value()},this._labelRenderer.setData(c),e.append(this._labelRenderer)),1===this._points.length&&this.isAnchorsRequired()&&(p=new r(this._model.timeScale().width()/2,this._points[0].y),p.data=0,e.append(this.createLineAnchor({points:[p]}))),TradingView.printing||!this._source.hasAlert.value()||this._model.readOnly()||1!==this._points.length||(_=new r(this._model.timeScale().width()/2,this._points[0].y),this._source.getAlertIsActive(function(i){e.append(new d({point1:_,color:i?t.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))})),e},t.HorzLinePaneView=n},1180:function(e,t,i){"use strict";function n(){this._data=null}function r(e,t){s.call(this,e,t),this._invalidated=!0,this._renderer=new n,this._labelRenderer=new a({})}var s=i(371).LineSourcePaneView,a=i(166).TextRenderer,o=i(11),l=i(53).CompositeRenderer,h=i(1199).PaneRendererClockIcon;n.prototype.setData=function(e){this._data=e},n.prototype.draw=function(e){var t,i,n,r;if(null===this._data||0===this._data.points.length)return null;t=e.canvas.width,i=this._data.points[0].y,n=Math.max(0,this._data.points[0].x),r=Math.max(t,this._data.points[0].x),e.lineCap="square",e.strokeStyle=this._data.color,e.lineWidth=this._data.linewidth,e.lineStyle=this._data.linestyle,CanvasEx.drawLine(e,n,i,r,i)},n.prototype.hitTest=function(e){return null===this._data||0===this._data.points.length?null:e.xthis._data.point.y?null:e.xthis._data.point.x+this._data.width?null:(t=new s(this._data.point.x+this._data.width/2,this._data.point.y),i=e.subtract(t),n=this._data.height/this._data.width,i.y/=n,r=i.length(),a=3,Math.abs(r-this._data.width/2)-c;v-=o)f=u.indexToCoordinate(v),g.push(f);for(f=Math.max(h.x,d.x),v=a;fthis._data.point.x+2*this._data.width?null:(t=e.x-this._data.point.x,i=t*Math.PI/this._data.width,n=Math.sin(i-Math.PI/2)*this._data.height/2,n=this._data.point.y+n+this._data.height/2,r=3,Math.abs(n-e.y)<=r?new o(o.MOVEPOINT):null)},inherit(r,a),r.prototype.update=function(){this._invalidated=!0},r.prototype.updateImpl=function(){a.prototype._updateImpl.call(this),this._invalidated=!1},r.prototype.renderer=function(){var e,t,i,r,a,o,h,d,c,p,_,u,f,g,v,w,y,m,x,b;if(this._invalidated&&this.updateImpl(),this._points.length<2)return null;if(e=this._source.points(),t=e[0],i=e[1],r=Math.min(t.index,i.index),a=Math.max(t.index,i.index),o=2*(a-r),h=this._points[0],d=this._points[1],c=Math.abs(h.x-d.x),p=d.y-h.y,_=new l,u=this._source.properties(),f=this._model.timeScale(),0===o)return null;for(g=f.indexToCoordinate(r),v=[], w=r;g>-c;w-=o)g=f.indexToCoordinate(w),v.push(g);for(g=g=f.indexToCoordinate(r+o),w=r+o;g=e._points.length-1?null:(n=e._points[i].x,s=f[i].price,a=f[i+1].price,o=f[i+1].index-f[i].index,l=e._model.timeScale().barSpacing()*r.sign(o),h=(a-s)/(t.bars().length-1),d=e._source.properties(),c=d.candleStyle.upColor.value(),p=d.candleStyle.downColor.value(),_=d.candleStyle.borderUpColor.value(),u=d.candleStyle.borderDownColor.value(),{bars:t.bars().map(function(t,i){var r=t.c>=t.o;return{time:n+i*l,open:e.priceToCoordinate(t.o+s+i*h),high:e.priceToCoordinate(t.h+s+i*h),low:e.priceToCoordinate(t.l+s+i*h),close:e.priceToCoordinate(t.c+s+i*h),color:r?c:p,borderColor:r?_:u,hollow:!1}})})}).filter(function(e){return!!e}))},n.prototype.renderer=function(){var e,t,i,n,r,s,c,p,_,u,f,g,v;for(this._invalidated&&(this.udpateImpl(),this._invalidated=!1),e=new h,t=1;t2&&(e.fillStyle=d.generateColor(this._data.backcolor,this._data.transparency),e.beginPath(),e.moveTo(t.x,t.y),e.quadraticCurveTo(s.x,s.y,n.x,n.y),e.quadraticCurveTo(a.x,a.y,i.x,i.y),e.fill()),e.beginPath(),e.moveTo(t.x,t.y),this._data.extendLeftPoints.length>0)for(l=this._data.extendLeftPoints[this._data.extendLeftPoints.length-1],e.moveTo(l.x,l.y),h=this._data.extendLeftPoints.length-2;h>=0;h--)p=this._data.extendLeftPoints[h],e.lineTo(p.x,p.y);for(e.quadraticCurveTo(s.x,s.y,n.x,n.y),e.quadraticCurveTo(a.x,a.y,i.x,i.y),h=0;h2&&(e.fillStyle=d.generateColor(this._data.backcolor,this._data.transparency),e.beginPath(),e.moveTo(t.x,t.y),e.quadraticCurveTo(a.x,a.y,n.x,n.y),e.bezierCurveTo(l.x,l.y,p.x,p.y,r.x,r.y),e.quadraticCurveTo(_.x,_.y,i.x,i.y),e.fill()),e.beginPath(),this._data.extendLeftPoints.length>0)for(u=this._data.extendLeftPoints[this._data.extendLeftPoints.length-1],e.moveTo(u.x,u.y),f=this._data.extendLeftPoints.length-2;f>=0;f--)g=this._data.extendLeftPoints[f],e.lineTo(g.x,g.y);for(e.moveTo(t.x,t.y),e.quadraticCurveTo(a.x,a.y,n.x,n.y),e.bezierCurveTo(l.x,l.y,p.x,p.y,r.x,r.y),e.quadraticCurveTo(_.x,_.y,i.x,i.y),f=0;f=3&&(e=this._source.points()[0],t=this._source.points()[1],i=this._source.points()[2],this._ABRetracement=Math.round(1e3*Math.abs((i.price-t.price)/(t.price-e.price)))/1e3),this._source.points().length>=4&&(n=this._source.points()[3],this._BCRetracement=Math.round(1e3*Math.abs((n.price-e.price)/(t.price-e.price)))/1e3),this._source.points().length>=5&&(s=this._source.points()[4],this._CDRetracement=Math.round(1e3*Math.abs((s.price-n.price)/(n.price-i.price)))/1e3,this._XDRetracement=Math.round(1e3*Math.abs((s.price-n.price)/(e.price-n.price)))/1e3)},t.CypherPaneView=n},1189:function(e,t,i){"use strict";function n(e,t){this._data=null,this._cache=e,this._adapter=t}function r(e,t){s.call(this,e,t),this._rendererCache={},this._renderer=new n(this._rendererCache,e._adapter)}var s=i(371).LineSourcePaneView,a=i(170),o=i(11),l=i(1242).splitThousands;n.prototype.setData=function(e){this._data=e},n.prototype._height=function(){return Math.max(20,1+Math.max(a.fontHeight(this._adapter.getBodyFont()),a.fontHeight(this._adapter.getQuantityFont())))},n.prototype._bodyWidth=function(e){var t,i ;return 0===this._adapter.getText().length?0:(e.save(),e.font=this._adapter.getBodyFont(),t=10,i=e.measureText(this._adapter.getText()).width,e.restore(),Math.round(t+i))},n.prototype._getQuantity=function(){return l(this._adapter.getQuantity()," ")},n.prototype._quantityWidth=function(e){var t,i;return 0===this._getQuantity().length?0:(e.save(),e.font=this._adapter.getQuantityFont(),t=10,i=e.measureText(this._getQuantity()).width,e.restore(),Math.round(Math.max(this._height(),t+i)))},n.prototype._reverseButtonWidth=function(){return this._adapter.isOnReverseCallbackPresent()?this._height():0},n.prototype._closeButtonWidth=function(){return this._adapter.isOnCloseCallbackPresent()?this._height():0},n.prototype._drawLines=function(e,t,i,n,r){e.save(),e.strokeStyle=this._adapter.getLineColor(),e.lineStyle=this._adapter.getLineStyle(),e.lineWidth=this._adapter.getLineWidth(),CanvasEx.drawLine(e,i,n,r,n),this._adapter.getExtendLeft()&&CanvasEx.drawLine(e,0,n,t,n),e.restore()},n.prototype._drawBody=function(e,t,i){var n,r;e.strokeStyle=this._adapter.getBodyBorderColor(),e.fillStyle=this._adapter.getBodyBackgroundColor(),n=this._bodyWidth(e),r=this._height(),e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r)},n.prototype._drawBodyText=function(e,t,i){var n,r;e.save(),e.textAlign="center",e.textBaseline="middle",e.font=this._adapter.getBodyFont(),e.fillStyle=this._adapter.getBodyTextColor(),n=t+this._bodyWidth(e)/2,r=i+this._height()/2,e.fillText(this._adapter.getText(),n,r),e.restore()},n.prototype._drawQuantity=function(e,t,i){var n,r;e.strokeStyle=this._adapter.getQuantityBorderColor(),e.fillStyle=this._adapter.getQuantityBackgroundColor(),n=this._quantityWidth(e),r=this._height(),e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r)},n.prototype._drawQuantityText=function(e,t,i){var n,r;e.save(),e.textAlign="center",e.textBaseline="middle",e.font=this._adapter.getQuantityFont(),e.fillStyle=this._adapter.getQuantityTextColor(),n=t+this._quantityWidth(e)/2,r=i+this._height()/2,e.fillText(this._getQuantity(),n,r),e.restore()},n.prototype._drawReverseButton=function(e,t,i){var n,r,s,a,o,l,h;e.save(),e.strokeStyle=this._adapter.getReverseButtonBorderColor(),e.fillStyle=this._adapter.getReverseButtonBackgroundColor(),n=this._reverseButtonWidth(),r=this._height(),e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r),e.strokeStyle=this._adapter.getReverseButtonIconColor(),s=function(e,t){CanvasEx.drawLine(e,0,0,0,t),CanvasEx.drawLine(e,-1,1,1,1),CanvasEx.drawLine(e,-2,2,2,2)},a=6,o=10,l=t+Math.round((this._reverseButtonWidth()-a)/2),h=i+5,e.save(),e.translate(l,h),s(e,o),e.translate(a,o),e.rotate(Math.PI),s(e,o),e.restore(),this._adapter._blocked&&(e.fillStyle="rgba(140, 140, 140, 0.75)",e.fillRect(t+.5,i+.5,n-1,r-1)),e.restore()},n.prototype._drawCloseButton=function(e,t,i){var n,r,s,a,o,l,h;e.save(),e.strokeStyle=this._adapter.getCloseButtonBorderColor(),e.fillStyle=this._adapter.getCloseButtonBackgroundColor(),n=this._closeButtonWidth(),r=this._height(),e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r),s=t+n,a=i+r, e.strokeStyle=this._adapter.getCloseButtonIconColor(),o=8,l=(this._closeButtonWidth()-o)/2,h=(this._height()-o)/2,CanvasEx.drawPoly(e,[{x:t+l,y:i+h},{x:s-l,y:a-h}],!0),CanvasEx.drawPoly(e,[{x:s-l,y:i+h},{x:t+l,y:a-h}],!0),this._adapter._blocked&&(e.fillStyle="rgba(140, 140, 140, 0.75)",e.fillRect(t+.5,i+.5,n-1,r-1)),e.restore()},n.prototype.draw=function(e){var t,i,n,r,s,a,o,l,h,d,c;null===this._data||!this._data.points||this._data.points.length<1||(t=this._data.width,i=this._bodyWidth(e),n=this._quantityWidth(e),r=this._reverseButtonWidth(e),s=i+n+r+this._closeButtonWidth(),a=t-s,o=Math.max(this._adapter.getLineLength()/100*t,1),l=Math.round(t-Math.min(a,o)),h=l-s,d=Math.round(this._data.points[0].y),c=Math.round(d-(this._height()+1)/2),this._cache.bodyRight=h+i,this._cache.quantityRight=this._cache.bodyRight+n,this._cache.reverseButtonRight=this._cache.quantityRight+r,this._cache.top=c,this._cache.bottom=c+this._height(),this._cache.left=h,this._cache.right=l,this._drawLines(e,h,l,d,t),0!==i&&(this._drawBody(e,h,c),this._drawBodyText(e,h,c)),0!==n&&(this._drawQuantity(e,this._cache.bodyRight,c),this._drawQuantityText(e,this._cache.bodyRight,c)),0!==r&&this._drawReverseButton(e,this._cache.quantityRight,c),0!==this._closeButtonWidth()&&this._drawCloseButton(e,this._cache.reverseButtonRight,c))},n.prototype.hitTest=function(e){return null===this._data||0===this._data.points.length?null:e.ythis._cache.bottom||e.x=this._cache.bodyRight&&e.x=this._cache.quantityRight&&e.x=this._cache.reverseButtonRight&&e.xthis._cache.bottom?null:this._adapter._blocked&&e.x>=this._cache.left&&e.x=this._cache.left&&e.x=this._cache.bodyRight&&e.x=this._cache.quantityRight&&e.xp?null:e.y>=d&&e.y<=h?this._backHittestResult:null)},e}(),t.ParallelChannelRenderer=p},1236:function(e,t,i){"use strict";var n,r,s;Object.defineProperty(t,"__esModule",{value:!0}),n=i(11),r=i(30),s=function(){function e(){this._data=null,this._hitTest=new n(n.MOVEPOINT),this._backHitTest=new n(n.MOVEPOINT_BACKGROUND)}return e.prototype.setData=function(e){this._data=e},e.prototype.setHitTest=function(e){this._hitTest=e},e.prototype.draw=function(e){if(null!==this._data&&(e.strokeStyle=this._data.color,e.lineWidth=this._data.linewidth,e.beginPath(),e.arc(this._data.center.x,this._data.center.y,this._data.radius,this._data.edge1,this._data.edge2,!0),e.stroke(),this._data.fillBackground)){if(e.arc(this._data.center.x,this._data.center.y,this._data.prevRadius,this._data.edge2,this._data.edge1,!1),this._data.gradient){var t=e.createRadialGradient(this._data.center.x,this._data.center.y,this._data.prevRadius,this._data.center.x,this._data.center.y,this._data.radius);t.addColorStop(0,r.generateColor(this._data.color1,this._data.transparency)),t.addColorStop(1,r.generateColor(this._data.color2,this._data.transparency)),e.fillStyle=t}else e.fillStyle=r.generateColor(this._data.color,this._data.transparency,!0);e.fill()}},e.prototype.hitTest=function(e){var t,i,n,r,s,a,o,l,h,d,c,p;return null===this._data?null:(t=e.subtract(this._data.center),i=t.length(),Math.abs(i-this._data.radius)<=4&&(n=e.subtract(this._data.p1).length(),r=e.subtract(this._data.p2).length(),s=Math.max(n,r),a=this._data.p1.subtract(this._data.p2).length(),s<=a)?this._hitTest:this._data.fillBackground&&i<=this._data.radius&&(o=this._data.p1.subtract(this._data.center).normalized(),l=this._data.p2.subtract(this._data.center).normalized(),h=t.normalized(),d=o.dotProduct(l),c=h.dotProduct(o),p=h.dotProduct(l),c>=d&&p>=d)?this._backHitTest:null)},e}(),t.ArcWedgeRenderer=s},1237:function(e,t,i){"use strict";var n,r,s,a,o,l;Object.defineProperty(t,"__esModule",{value:!0}),n=i(11),r=i(54),s=i(8),a=i(30),o=i(90),l=function(){function e(e,t,i){this._data=e,this._hitTest=t||new n(n.MOVEPOINT),this._backgroundHitTest=i||new n(n.MOVEPOINT_BACKGROUND)}return e.prototype.draw=function(e){var t,i,n,r,s,l,h,d;e.lineCap="butt",e.strokeStyle=this._data.color,e.lineWidth=this._data.linewidth,void 0!==this._data.linestyle&&o.setLineStyle(e,this._data.linestyle),t=this._data.points[0],i=this._data.points[1],n=Math.abs(t.x-i.x),r=Math.abs(t.y-i.y),s=t.add(i).scaled(.5),n<1||r<1||(l=0,this._data.wholePoints&&(h=this._data.wholePoints[0],d=this._data.wholePoints[1],l=Math.abs(h.x-d.x)),e.save(),e.translate(s.x,s.y),e.scale(1,r/n),e.beginPath(),e.arc(0,0,n/2,0,2*Math.PI,!1),e.restore(),e.stroke(),this._data.fillBackground&&(this._data.wholePoints&&(e.translate(s.x,s.y),e.scale(1,r/n),e.arc(0,0,l/2,0,2*Math.PI,!0)),e.fillStyle=a.generateColor(this._data.backcolor,this._data.transparency,!0),e.fill()))},e.prototype.hitTest=function(e){var t,i,n,a,o,l,h,d,c,p;return this._data.points.length<2?null:(t=this._data.points[0], i=this._data.points[1],n=.5*Math.abs(t.x-i.x),a=Math.abs(t.x-i.x),o=Math.abs(t.y-i.y),l=t.add(i).scaled(.5),h=e.subtract(l),a<1||o<1?null:(d=(i.y-t.y)/(i.x-t.x),h=new s.Point(h.x,h.y/d),c=h.x*h.x+h.y*h.y,p=c-n*n,p=r.sign(p)*Math.sqrt(Math.abs(p/n)),Math.abs(p)<3?this._hitTest:this._data.fillBackground&&!this._data.noHitTestOnBackground&&p<3?this._backgroundHitTest:null))},e}(),t.EllipseRendererSimple=l},1238:function(e,t,i){"use strict";var n,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),n=i(8),r=i(30),s=i(11),a=function(){function e(){this._data=null}return e.prototype.setData=function(e){this._data=e},e.prototype.draw=function(e){var t,i,s,a,o,l;null!==this._data&&(e.lineCap="butt",e.strokeStyle=this._data.color,e.lineWidth=this._data.linewidth,e.translate(this._data.center.x,this._data.center.y),t=this._data.edge.subtract(this._data.center),i=t.y/t.x,s=this._data.point.subtract(this._data.center),s=new n.Point(s.x,s.y/i),a=s.length(),o=this._data.prevPoint.subtract(this._data.center),o=new n.Point(o.x,o.y/i),l=o.length(),e.scale(1,i),this._data.fillBack&&(this._data.point.xthis._data.center.x?e.arc(0,0,Math.abs(a),0,Math.PI/2,!1):e.arc(0,0,Math.abs(a),-Math.PI/2,-Math.PI,!0),e.scale(1,1/i),e.stroke())},e.prototype.hitTest=function(e){var t,i,r,a,o,l,h;return null===this._data?null:(e=e.subtract(this._data.center),t=this._data.edge.subtract(this._data.center),i=t.y/t.x,e=new n.Point(e.x,e.y/i),r=this._data.point.subtract(this._data.center),r=new n.Point(r.x,r.y/i),a=r.length(),o=e.length(),l=this._data.prevPoint.subtract(this._data.center),l=new n.Point(l.x,l.y/i),h=l.length(),Math.abs(o-a)<5&&t.x*e.x>=0&&t.y*e.y>=0?new s(s.MOVEPOINT):this._data.fillBack&&o>=h&&o<=a&&t.x*e.x>=0&&t.y*e.y>=0?new s(s.MOVEPOINT_BACKGROUND):null)},e}(),t.GannArcRenderer=a},1239:function(e,t,i){"use strict";function n(e,t,i,n){var r=l.equalPoints(i,n[0])?l.equalPoints(i,n[1])?null:n[1]:n[0];return null!==e&&null!==r?c.intersectPolygonAndHalfplane(e,l.halfplaneThroughPoint(l.lineThroughPoints(t,i),r)):null}function r(e){return l.line(1,0,-e)}function s(e,t,i){return null!==e?c.intersectPolygonAndHalfplane(e,l.halfplaneThroughPoint(r(t),new l.Point(i,0))):null}function a(e,t){var i=t.points,n=i[0],r=i[1];return t.extendleft||(e=s(e,n.x,r.x)),t.extendright||(e=s(e,r.x,n.x)),e}var o,l,h,d,c,p,_,u,f,g,v;Object.defineProperty(t,"__esModule",{value:!0}),o=i(9),l=i(8),h=i(60),d=i(44),c=i(132),p=i(240),_=i(11),u=i(1219),f=i(30),g=function(){function e(){this._parallelChannelRenderer=new u.ParallelChannelRenderer,this._disjointAngleIntersectionRenderer=new v,this._selectedRenderer=this._disjointAngleIntersectionRenderer}return e.prototype.setData=function(e){var t,i,n,r,s,a,o;e.points.length<4||(t=e.points,i=t[0],n=t[1],r=t[2],s=t[3], a=l.equalPoints(i,n)||l.equalPoints(r,s)||d.distanceToLine(i,n,r).distance<1e-6&&d.distanceToLine(i,n,s).distance<1e-6,a?this._selectedRenderer=null:(o=c.intersectLines(l.lineThroughPoints(i,n),l.lineThroughPoints(r,s)),null!==o?(this._disjointAngleIntersectionRenderer.setData(e),this._selectedRenderer=this._disjointAngleIntersectionRenderer):(this._parallelChannelRenderer.setData({width:e.width,height:e.height,extendleft:e.extendleft,extendright:e.extendright,points:[i,n,s,r],fillBackground:!0,backcolor:e.backcolor,transparency:e.transparency,color:"rgba(0,0,0,0)",linestyle:p.LINESTYLE_SOLID,linewidth:0,showMidline:!1,midcolor:"rgba(0,0,0,0)",midlinestyle:0,midlinewidth:0,hittestOnBackground:e.hittestOnBackground}),this._selectedRenderer=this._parallelChannelRenderer)))},e.prototype.draw=function(e){null!==this._selectedRenderer&&this._selectedRenderer.draw(e)},e.prototype.hitTest=function(e){return null!==this._selectedRenderer?this._selectedRenderer.hitTest(e):null},e}(),t.DisjointAngleRenderer=g,v=function(){function e(){this._data=null}return e.prototype.setData=function(e){this._data=e},e.prototype.draw=function(e){var t,i,n,r;if(!(null===this._data||this._data.points.length<4))for(e.fillStyle=f.generateColor(this._data.backcolor,this._data.transparency),t=0,i=this._visiblePolygons();t0&&(_=o[o.length-1],_.subtract(p).length()<2&&(s*=2)),o.push(p);return o}Object.defineProperty(t,"__esModule",{value:!0}),t.quadroBezierHitTest=n,t.cubicBezierHitTest=r,t.extendQuadroBezier=s},1242:function(e,t,i){"use strict";function n(e,t){void 0===t&&(t=" ");var i=(e+"").split(".");return i[0].replace(/\B(?=(\d{3})+(?!\d))/g,t)+(i[1]?"."+i[1]:"")}Object.defineProperty(t,"__esModule",{value:!0}),t.splitThousands=n},249:function(e,t,i){"use strict";function n(e,t){p.call(this,e,t),this._invalidated=!0}var r=i(8).Point,s=i(32),a=s.parseRgb,o=s.darkenRgb,l=s.rgbToHexString,h=s.rgbToBlackWhiteString,d=i(1237).EllipseRendererSimple,c=i(166).TextRenderer,p=i(371).LineSourcePaneView,_=i(110).TrendLineRenderer,u=i(11),f=i(53).CompositeRenderer,g=i(54),v=i(30),w=i(74).LineEnd;inherit(n,p),n.prototype.renderer=function(){var e,t,i,n,s,p,v,w,y,m,x,b,S,P,R,T,L,C,k,I,B,M,A;if(this._invalidated&&(this.updateImpl(),this._invalidated=!1),!this._wave)return null;for(e=this.isAnchorsRequired()?0:1,t=new f,i=this._source.properties(),n=0;n2&&(v=this._points[2],w=this._points[1],p=g.sign(v.y-w.y)),y=[],m=0,this._model.lineBeingCreated()===this._source&&(m=1),x=h(a(this._model.backgroundColor()),150),b="black"===x?"white":"black",S=i.color.value(),n=0;n