106 lines
317 KiB
JavaScript
106 lines
317 KiB
JavaScript
(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[1583],{25422:(e,t,i)=>{"use strict";t.transformPoint=t.translationMatrix=t.scalingMatrix=t.rotationMatrix=void 0;var n=i(86441);t.rotationMatrix=function(e){var t=Math.cos(e),i=Math.sin(e);return[[t,-i,0],[i,t,0],[0,0,1]]},t.scalingMatrix=function(e,t){return[[e,0,0],[0,t,0],[0,0,1]]},t.translationMatrix=function(e,t){return[[1,0,e],[0,1,t],[0,0,1]]},t.transformPoint=function(e,t){for(var i=[t.x,t.y,1],r=[0,0,0],s=0;s<3;s++)for(var o=0;o<3;o++)r[s]+=i[o]*e[s][o];return new n.Point(r[0],r[1])}},77142:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Pattern5pointsPaneView:()=>f});var n=i(51056),r=i(30699),s=i(49857),o=i(95201),a=i(17330),l=i(1161),d=i(91046),h=i(74079),c=i(56468),u=i(74011),p=i(27916),_=i(15938);class f extends p.LineSourcePaneView{constructor(e,t){super(e,t),this._abRetracement=NaN,this._bcRetracement=NaN,this._cdRetracement=NaN,this._xdRetracement=NaN,this._bcRetracementTrend=new d.TrendLineRenderer,this._xdRetracementTrend=new d.TrendLineRenderer,this._xbTrend=new d.TrendLineRenderer,this._bdTrend=new d.TrendLineRenderer,this._polylineRenderer=new u.PolygonRenderer(new c.HitTestResult(c.HitTarget.MovePoint)),this._mainTriangleRenderer=new l.TriangleRenderer,this._triangleRendererPoints234=new l.TriangleRenderer,this._xbLabelRenderer=new a.TextRenderer,this._acLabelRenderer=new a.TextRenderer,this._bdLabelRenderer=new a.TextRenderer,this._xdLabelRenderer=new a.TextRenderer,this._textRendererALabel=new a.TextRenderer,this._textRendererBLabel=new a.TextRenderer,this._textRendererCLabel=new a.TextRenderer,this._textRendererDLabel=new a.TextRenderer,this._textRendererXLabel=new a.TextRenderer,this._renderer=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._updateBaseData(),this._renderer=null,this._points.length<2)return;const t=this._source.properties().childs(),i=new o.CompositeRenderer,a=(e,i)=>({points:[e],text:i,color:t.textcolor.value(),vertAlign:r.VerticalAlign.Middle,horzAlign:r.HorizontalAlign.Center,font:_.CHART_FONT_FAMILY,offsetX:0,offsetY:0,bold:t.bold&&t.bold.value(),italic:t.italic&&t.italic.value(),fontsize:t.fontsize.value(),backgroundColor:t.color.value(),backgroundRoundRect:4}),l=(e,i)=>({points:[e,i],color:t.color.value(),linewidth:1,linestyle:n.LINESTYLE_DOTTED,extendleft:!1,extendright:!1,leftend:s.LineEnd.Normal,rightend:s.LineEnd.Normal}),[d,c,u,p,f]=this._points,g={points:[d,c,this._points.length<3?c:u],color:"rgba(0, 0, 0, 0)",linewidth:t.linewidth.value(),backcolor:t.backgroundColor.value(),fillBackground:t.fillBackground.value(),transparency:t.transparency.value()};if(this._mainTriangleRenderer.setData(g),i.append(this._mainTriangleRenderer),this._points.length>3){const e={points:[u,p,5===this._points.length?f:p],color:"rgba(0, 0, 0, 0)",linewidth:t.linewidth.value(),backcolor:t.backgroundColor.value(),fillBackground:t.fillBackground.value(),transparency:t.transparency.value()};this._triangleRendererPoints234.setData(e),
|
|
i.append(this._triangleRendererPoints234)}const x={points:this._points,color:t.color.value(),linewidth:t.linewidth.value(),backcolor:t.backgroundColor.value(),fillBackground:!1,linestyle:n.LINESTYLE_SOLID,filled:!1};this._polylineRenderer.setData(x),i.append(this._polylineRenderer);const v=(0,h.getNumericFormatter)();if(this._points.length>=3){const e=a(d.add(u).scaled(.5),v.format(this._abRetracement));this._xbLabelRenderer.setData(e),i.append(this._xbLabelRenderer),this._xbTrend.setData(l(d,u)),i.append(this._xbTrend)}if(this._points.length>=4){this._bcRetracementTrend.setData(l(c,p)),i.append(this._bcRetracementTrend);const e=a(c.add(p).scaled(.5),v.format(this._bcRetracement));this._acLabelRenderer.setData(e),i.append(this._acLabelRenderer)}if(this._points.length>=5){const e=a(u.add(f).scaled(.5),v.format(this._cdRetracement));this._bdLabelRenderer.setData(e),i.append(this._bdLabelRenderer),this._xdRetracementTrend.setData(l(d,f)),i.append(this._xdRetracementTrend);const t=a(d.add(f).scaled(.5),v.format(this._xdRetracement));this._xdLabelRenderer.setData(t),i.append(this._xdLabelRenderer),this._bdTrend.setData(l(u,f)),i.append(this._bdTrend)}const w=a(d,"X");c.y>d.y?(w.vertAlign=r.VerticalAlign.Bottom,w.offsetY=5):(w.vertAlign=r.VerticalAlign.Top,w.offsetY=5),this._textRendererXLabel.setData(w),i.append(this._textRendererXLabel);const R=a(c,"A");if(c.y<d.y?(R.vertAlign=r.VerticalAlign.Bottom,R.offsetY=5):(R.vertAlign=r.VerticalAlign.Top,R.offsetY=5),this._textRendererALabel.setData(R),i.append(this._textRendererALabel),this._points.length>2){const e=a(u,"B");u.y<c.y?(e.vertAlign=r.VerticalAlign.Bottom,e.offsetY=5):(e.vertAlign=r.VerticalAlign.Top,e.offsetY=5),this._textRendererBLabel.setData(e),i.append(this._textRendererBLabel)}if(this._points.length>3){const e=a(p,"C");p.y<u.y?(e.vertAlign=r.VerticalAlign.Bottom,e.offsetY=5):(e.vertAlign=r.VerticalAlign.Top,e.offsetY=5),this._textRendererCLabel.setData(e),i.append(this._textRendererCLabel)}if(this._points.length>4){const e=a(f,"D");f.y<p.y?(e.vertAlign=r.VerticalAlign.Bottom,e.offsetY=5):(e.vertAlign=r.VerticalAlign.Top,e.offsetY=5),this._textRendererDLabel.setData(e),i.append(this._textRendererDLabel)}this.addAnchors(i),this._renderer=i}_updateBaseData(){if(this._source.points().length>=3){const[e,t,i]=this._source.points();this._abRetracement=Math.round(1e3*Math.abs((i.price-t.price)/(t.price-e.price)))/1e3}if(this._source.points().length>=4){const[,e,t,i]=this._source.points();this._bcRetracement=Math.round(1e3*Math.abs((i.price-t.price)/(t.price-e.price)))/1e3}if(this._source.points().length>=5){const[e,t,i,n,r]=this._source.points();this._cdRetracement=Math.round(1e3*Math.abs((r.price-n.price)/(n.price-i.price)))/1e3,this._xdRetracement=Math.round(1e3*Math.abs((r.price-t.price)/(t.price-e.price)))/1e3}}}},76441:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ABCDPaneView:()=>_});var n=i(30699),r=i(51056),s=i(95201),o=i(74079),a=i(91046),l=i(17330),d=i(49857),h=i(74011),c=i(56468),u=i(27916),p=i(15938);class _ extends u.LineSourcePaneView{constructor(){
|
|
super(...arguments),this._abRetracementTrend=new a.TrendLineRenderer,this._cdRetracementTrend=new a.TrendLineRenderer,this._polylineRenderer=new h.PolygonRenderer(new c.HitTestResult(c.HitTarget.MovePoint)),this._abLabelRenderer=new l.TextRenderer,this._cdLabelRenderer=new l.TextRenderer,this._textRendererALabel=new l.TextRenderer,this._textRendererBLabel=new l.TextRenderer,this._textRendererCLabel=new l.TextRenderer,this._textRendererDLabel=new l.TextRenderer,this._renderer=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._points.length<2)return void(this._renderer=null);const t=this._source.properties().childs(),i=new s.CompositeRenderer,a=(e,i)=>({points:[e],text:i,color:t.textcolor.value(),vertAlign:n.VerticalAlign.Middle,horzAlign:n.HorizontalAlign.Center,font:p.CHART_FONT_FAMILY,offsetX:0,offsetY:0,bold:t.bold&&t.bold.value(),italic:t.italic&&t.italic.value(),fontsize:t.fontsize.value(),backgroundColor:t.color.value(),backgroundRoundRect:4}),l=(e,i)=>({points:[e,i],color:t.color.value(),linewidth:t.linewidth.value(),linestyle:r.LINESTYLE_DOTTED,extendleft:!1,extendright:!1,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal}),[h,c,u,_]=this._points,f={points:this._points,color:t.color.value(),linewidth:t.linewidth.value(),linestyle:r.LINESTYLE_SOLID,fillBackground:!1,filled:!1,backcolor:"rgba(0, 0, 0, 0)"};this._polylineRenderer.setData(f),i.append(this._polylineRenderer);const g=a(h,"A");c.y>h.y?(g.vertAlign=n.VerticalAlign.Bottom,g.offsetY=5):(g.vertAlign=n.VerticalAlign.Top,g.offsetY=5),this._textRendererALabel.setData(g),i.append(this._textRendererALabel);const x=a(c,"B");if(c.y<h.y?(x.vertAlign=n.VerticalAlign.Bottom,x.offsetY=5):(x.vertAlign=n.VerticalAlign.Top,x.offsetY=5),this._textRendererBLabel.setData(x),i.append(this._textRendererBLabel),this._points.length>2){const e=a(u,"C");u.y<c.y?(e.vertAlign=n.VerticalAlign.Bottom,e.offsetY=5):(e.vertAlign=n.VerticalAlign.Top,e.offsetY=5),this._textRendererCLabel.setData(e),i.append(this._textRendererCLabel)}if(this._points.length>3){const e=a(_,"D");_.y<u.y?(e.vertAlign=n.VerticalAlign.Bottom,e.offsetY=5):(e.vertAlign=n.VerticalAlign.Top,e.offsetY=5),this._textRendererDLabel.setData(e),i.append(this._textRendererDLabel)}const v=(0,o.getNumericFormatter)();if(this._points.length>=3){this._abRetracementTrend.setData(l(h,u)),i.append(this._abRetracementTrend);const e=h.add(u).scaled(.5),[t,n,r]=this._source.points(),s=Math.round(1e3*Math.abs((r.price-n.price)/(n.price-t.price)))/1e3,o=a(e,v.format(s));this._abLabelRenderer.setData(o),i.append(this._abLabelRenderer)}if(this._points.length>=4){this._cdRetracementTrend.setData(l(c,_)),i.append(this._cdRetracementTrend);const e=c.add(_).scaled(.5),[,t,n,r]=this._source.points(),s=Math.round(1e3*Math.abs((r.price-n.price)/(n.price-t.price)))/1e3,o=a(e,v.format(s));this._cdLabelRenderer.setData(o),i.append(this._cdLabelRenderer)}this.addAnchors(i),this._renderer=i}}},15190:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ArcPaneView:()=>_})
|
|
;var n=i(4652),r=i(86441),s=i(25422),o=i(95201),a=i(36036),l=i(27916),d=i(19063),h=i(56468),c=i(75919),u=i(61993);class p extends c.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data={...e,angleFrom:0,angleTo:Math.PI,clockwise:!1}}hitTest(e){if(null===this._data||this._data.points.length<3)return null;const t=(0,u.interactionTolerance)().curve,i=this._data.points[0],o=this._data.points[1];let a=this._data.points[2],l=(0,n.distanceToLine)(i,o,a).distance;if(l<1)return l=(0,n.distanceToLine)(i,o,e).distance,l<t?new h.HitTestResult(h.HitTarget.MovePoint):null;const d=o.subtract(i),c=d.length(),p=i.add(o).scaled(.5);let _=a.subtract(p).normalized();a=p.add(_.scaled(l));const f=d.x/c,g=d.y/c;let x=Math.acos(f);g<0&&(x=-x);let v=(0,s.translationMatrix)(-i.x,-i.y);e=(0,s.transformPoint)(v,e),v=(0,s.rotationMatrix)(-x),e=(0,s.transformPoint)(v,e),_=(0,s.transformPoint)(v,_);const w=1-Math.sqrt(3)/2;if(v=(0,s.scalingMatrix)(1,c*w/l),e=(0,s.transformPoint)(v,e),_=(0,s.transformPoint)(v,_),e.y*_.y<0)return null;let R;R=e.y<0?new r.Point(.5*c,c*Math.sqrt(3)/2):new r.Point(.5*c,-c*Math.sqrt(3)/2);const T=e.subtract(R).length();return Math.abs(T-c)<=t?new h.HitTestResult(h.HitTarget.MovePoint):null}_drawImpl(e){if(null===this._data||this._data.points.length<2)return;const t=e.context,i=this._data.points[0],o=this._data.points[1];if(this._data.points.length<3)return t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.beginPath(),t.moveTo(i.x,i.y),t.lineTo(o.x,o.y),void t.stroke();let a=this._data.points[2];const l=(0,n.distanceToLine)(i,o,a).distance;if(l<1)return t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.beginPath(),t.moveTo(i.x,i.y),t.lineTo(o.x,o.y),void t.stroke();const h=o.subtract(i),c=i.add(o).scaled(.5),u=new r.Point(-h.y,h.x).normalized();a=c.add(u.scaled(l)),t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth;const p=h.length(),_=h.x/p,f=h.y/p;let g=Math.acos(_);f<0&&(g=-g);let x=this._data.points[2],v=(0,s.translationMatrix)(-c.x,-c.y);x=(0,s.transformPoint)(v,x),v=(0,s.rotationMatrix)(-g),x=(0,s.transformPoint)(v,x),v=(0,s.scalingMatrix)(1,p/(2*l)),x=(0,s.transformPoint)(v,x),x.y<0?this._data.clockwise=!0:this._data.clockwise=!1,t.save(),t.beginPath(),t.translate(i.x,i.y),t.rotate(g);const w=1-Math.sqrt(3)/2;t.scale(1,l/(p*w)),this._data.clockwise?t.arc(.5*p,p*Math.sqrt(3)/2,p,-2*Math.PI/3,-Math.PI/3,!1):t.arc(.5*p,-p*Math.sqrt(3)/2,p,Math.PI/3,2*Math.PI/3,!1),t.restore(),t.stroke(),this._data.fillBackground&&(t.fillStyle=(0,d.generateColor)(this._data.backcolor,this._data.transparency),t.fill())}}class _ extends l.LineSourcePaneView{constructor(){super(...arguments),this._arcRenderer=new p,this._renderer=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer=null,0===this._points.length)return;const t=this._source.properties().childs(),i={points:this._points,color:t.color.value(),linewidth:t.linewidth.value(),backcolor:t.backgroundColor.value(),
|
|
fillBackground:t.fillBackground.value(),transparency:t.transparency.value()};this._arcRenderer.setData(i);const d=new o.CompositeRenderer;if(this._renderer=d,d.append(this._arcRenderer),1===i.points.length)return;const h=[],c=i.points[0],u=(0,a.lineSourcePaneViewPointToLineAnchorPoint)(c,0);h.push(u);const p=i.points[1],_=(0,a.lineSourcePaneViewPointToLineAnchorPoint)(p,1);if(2===i.points.length)return void this.addAnchors(d);h.push(_);let f=i.points[2];const g=(0,n.distanceToLine)(c,p,f).distance,x=p.subtract(c),v=c.add(p).scaled(.5),w=new r.Point(-x.y,x.x).normalized();f=v.add(w.scaled(g));const R=v.add(w.scaled(-g)),T=x.length(),m=x.x/T,b=x.y/T;let y=Math.acos(m);b<0&&(y=-y);let P=i.points[2],L=(0,s.translationMatrix)(-v.x,-v.y);P=(0,s.transformPoint)(L,P),L=(0,s.rotationMatrix)(-y),P=(0,s.transformPoint)(L,P),L=(0,s.scalingMatrix)(1,T/(2*g)),P=(0,s.transformPoint)(L,P);const S=(0,a.lineSourcePaneViewPointToLineAnchorPoint)(P.y>=0?f:R,2,(0,l.thirdPointCursorType)(c,p));h.push(S),d.append(this.createLineAnchor({points:h},0))}}},54176:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ArrowMarkPaneView:()=>p});var n,r=i(15938),s=i(27916),o=i(95201),a=i(11064),l=i(17330),d=i(56468),h=i(34026),c=i(9859);!function(e){e[e.ArrowHeadWidth=19.5]="ArrowHeadWidth",e[e.ArrowHeadHeight=12]="ArrowHeadHeight",e[e.ArrowTailWidth=10]="ArrowTailWidth",e[e.ArrowTailHeight=10]="ArrowTailHeight"}(n||(n={}));class u{constructor(){this._data=null}setData(e){this._data=e}draw(e,t){if(null!==this._data){switch(e.save(),e.fillStyle=this._data.color,this._data.direction){case"up":case"down":!function(e,t,i,n){const{horizontalPixelRatio:r,verticalPixelRatio:s}=n,o=Math.max(1,Math.floor(r))%2?.5:0,a="up"===i?1:-1,l=a*Math.round(12*s),d=(0,c.ceiledEven)(19.5*r)/2+o,h=a*Math.round(10*s),u=(0,c.ceiledEven)(10*r)/2+o,p=Math.round(t.x*r)+o,_=Math.round(t.y*s);e.beginPath(),e.moveTo(p,_),e.lineTo(p+d,_+l),e.lineTo(p+u,_+l),e.lineTo(p+u,_+l+h),e.lineTo(p-u,_+l+h),e.lineTo(p-u,_+l),e.lineTo(p-d,_+l),e.moveTo(p,_),e.fill()}(e,this._data.point,this._data.direction,t);break;case"left":case"right":!function(e,t,i,n){const{horizontalPixelRatio:r,verticalPixelRatio:s}=n,o=Math.max(1,Math.floor(r))%2?.5:0,a="left"===i?1:-1,l=a*Math.round(12*s)+o,d=(0,c.ceiledEven)(19.5*r)/2+o,h=a*Math.round(22*s)+o,u=(0,c.ceiledEven)(10*r)/2+o,p=Math.round(t.x*r)+o,_=Math.round(t.y*s)+o;e.beginPath(),e.moveTo(p,_),e.lineTo(p+l,_+d),e.lineTo(p+l,_+u),e.lineTo(p+h,_+u),e.lineTo(p+h,_-u),e.lineTo(p+l,_-u),e.lineTo(p+l,_-d),e.moveTo(p,_),e.fill()}(e,this._data.point,this._data.direction,t)}e.restore()}}hitTest(e){if(null===this._data)return null;let t,i,n,r;switch(this._data.direction){case"up":t=this._data.point.x-9.75,n=t+19.5,i=this._data.point.y,r=i+12+10;break;case"down":t=this._data.point.x-9.75,n=t+19.5,r=this._data.point.y,i=r-12-10;break;case"left":t=this._data.point.x,n=t+12+10,i=this._data.point.y-9.75,r=i+19.5;break;case"right":n=this._data.point.x,t=n-12-10,i=this._data.point.y-9.75,r=i+19.5}return e.x<t||e.x>n||e.y<i||e.y>r?null:new d.HitTestResult(d.HitTarget.MovePoint)}
|
|
doesIntersectWithBox(e){return null!==this._data&&(0,h.pointInBox)(this._data.point,e)}}class p extends s.LineSourcePaneView{constructor(){super(...arguments),this._arrowMarkRenderer=new u,this._textRenderer=new l.TextRenderer,this._renderer=null,this._anchorsOffset=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer=null,1!==this._points.length)return;const t=this._getSource(),i=t.properties().childs(),n=this._getModel();this._arrowMarkRenderer.setData({point:this._points[0],direction:t.direction(),color:i.arrowColor.value()}),this._renderer=new o.CompositeRenderer,this._renderer.append(this._arrowMarkRenderer),""!==i.text.value()&&i.showLabel.value()&&(this._textRenderer.setData({points:this._points,font:r.CHART_FONT_FAMILY,bold:i.bold.value(),italic:i.italic.value(),fontSize:i.fontsize.value(),text:i.text.value(),color:i.color.value(),...t.textAlignParams()}),this._renderer.append(this._textRenderer));const s=[this._anchorsOffset?this._points[0].add(this._anchorsOffset):this._points[0].clone()];this._renderer.append(new a.SelectionRenderer({points:s.map((e=>({point:e}))),bgColors:this._lineAnchorColors(s),visible:this.areAnchorsVisible(),barSpacing:n.timeScale().barSpacing(),hittestResult:d.HitTarget.MovePoint}))}}},34823:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ArrowMarkerPaneView:()=>x});var n,r=i(30699),s=i(27916),o=i(95201),a=i(17330),l=i(86441),d=i(75919),h=i(56468),c=i(61993);function u(e){if(e<92)return 18;let t=.25*e;return t=Math.min(t,106),t=Math.max(t,18),t=Math.min(t,.9*e),t}!function(e){e[e.LengthToLineWidthCoeff=.02]="LengthToLineWidthCoeff",e[e.MinLineWidth=2]="MinLineWidth",e[e.MaxLineWidth=5]="MaxLineWidth",e[e.ThresholdLineLength=92]="ThresholdLineLength",e[e.MinimalArrowLength=18]="MinimalArrowLength",e[e.MinimalLineLength=22]="MinimalLineLength",e[e.MaximumArrowLength=106]="MaximumArrowLength",e[e.LengthToArrowLengthCoeff=.25]="LengthToArrowLengthCoeff",e[e.MaximalPercentOfArrow=.9]="MaximalPercentOfArrow",e[e.ArrowWidthToHeight=1.22]="ArrowWidthToHeight",e[e.ArrowBackStep=.1]="ArrowBackStep",e[e.ArrowBackStepLengthLimit=35]="ArrowBackStepLengthLimit"}(n||(n={}));class p extends d.MediaCoordinatesPaneRenderer{constructor(e){super(),this._data=e}setData(e){this._data=e}hitTest(e){if(this._data.points.length<2)return null;let t=this._data.points[0],i=this._data.points[1].subtract(t);const n=i.length();i=this._data.points[1].subtract(this._data.points[0]);i.length()<22&&(t=this._data.points[1].addScaled(i.normalized(),-22),i=this._data.points[1].subtract(t));const r=e.subtract(t),s=i.dotProduct(r)/n;if(s<0||s>n)return null;const o=i.scaled(1/n),a=t.addScaled(o,s),l=e.subtract(a),d=(0,c.interactionTolerance)().line,u=this._hittestGeometry(n);for(let e=u.length-2;e>=0;e--){const t=u[e];if(s>=t.x){const i=u[e+1],n=i.x-t.x,r=i.y-t.y,o=(s-t.x)/n,a=t.y+r*o;return l.length()<=a+d?new h.HitTestResult(h.HitTarget.MovePoint):null}}return l.length()<3?new h.HitTestResult(h.HitTarget.MovePoint):null}_drawImpl(e){
|
|
if(this._data.points.length<2)return;const t=e.context;t.fillStyle=this._data.color,t.strokeStyle=this._data.color,t.lineJoin="round",t.lineCap="round";let i=this._data.points[1].subtract(this._data.points[0]);const n=i.length();let r=this._data.points[0];n<22&&(r=this._data.points[1].addScaled(i.normalized(),-22),i=this._data.points[1].subtract(r));const s=new l.Point(i.y,-i.x).normalized(),o=this._arrowGeometry(i.length()),a=i.normalized();t.lineWidth=function(e){let t=Math.round(.02*e);return t=Math.min(t,5),t=Math.max(t,2),t}(i.length()),t.beginPath(),t.moveTo(r.x,r.y);for(let e=0;e<o.length;e++){const i=o[e],n=r.addScaled(a,i.x).addScaled(s,i.y);t.lineTo(n.x,n.y)}t.lineTo(this._data.points[1].x,this._data.points[1].y);for(let e=o.length-1;e>=0;e--){const i=o[e],n=r.addScaled(a,i.x).addScaled(s,-i.y);t.lineTo(n.x,n.y)}t.lineTo(r.x,r.y),t.stroke(),t.fill()}_arrowGeometry(e){const t=u(e),i=[],n=e>=35?.1:0;return i.push(new l.Point(0,0)),i.push(new l.Point(e-t+t*n,1.22*t/4)),i.push(new l.Point(e-t,1.22*t/2)),i.push(new l.Point(e,0)),i}_hittestGeometry(e){const t=u(e),i=[];return i.push(new l.Point(0,0)),i.push(new l.Point(e-t,1.22*t/4)),i.push(new l.Point(e-t,1.22*t/2)),i.push(new l.Point(e,0)),i}}var _,f=i(36155),g=i(15938);!function(e){e[e.CircleRadius=9]="CircleRadius",e[e.AngleTolerance=.017444444444444446]="AngleTolerance"}(_||(_={}));class x extends s.LineSourcePaneView{constructor(e,t){super(e,t),this._textRendererData={text:"",color:"",vertAlign:r.VerticalAlign.Middle,horzAlign:r.HorizontalAlign.Center,font:"",offsetX:10,offsetY:10,points:[],forceTextAlign:!0},this._arrowRendererData={points:[],color:""},this._ellipseRendererData={color:"",linewidth:0,points:[],fillBackground:!0,backcolor:"",noHitTestOnBackground:!0},this._drawAsCircle=!1,this._textRenderer=new a.TextRenderer(this._textRendererData),this._arrowRenderer=new p(this._arrowRendererData),this._ellipseRenderer=new f.EllipseRendererSimple(this._ellipseRendererData)}renderer(e){this._invalidated&&this._updateImpl(e);const t=new o.CompositeRenderer;this._drawAsCircle?t.append(this._ellipseRenderer):t.append(this._arrowRenderer);const i=this._getSource().properties().childs();return this._textRendererData.points&&this._textRendererData.points.length>0&&i.showLabel.value()&&(this._textRenderer.setData({...this._textRendererData}),t.append(this._textRenderer)),this.addAnchors(t),t}_updateImpl(e){super._updateImpl(e);const t=this._getPoints(),i=this._getSource().properties().childs();if(this._arrowRendererData.color=i.backgroundColor.value(),this._arrowRendererData.points=t,this._textRendererData.text=i.text.value(),this._textRendererData.color=i.textColor.value(),this._textRendererData.font=g.CHART_FONT_FAMILY,this._textRendererData.bold=i.bold.value(),this._textRendererData.italic=i.italic.value(),this._textRendererData.fontsize=i.fontsize.value(),t.length>=2){const e=this._getSource().points(),n=e[0].index-e[1].index,s=e[0].price-e[1].price;if(this._drawAsCircle=0===n&&Math.abs(s)<1e-8,this._textRendererData.points=[t[0]],this._drawAsCircle){
|
|
this._textRendererData.horzAlign=r.HorizontalAlign.Left,this._textRendererData.vertAlign=r.VerticalAlign.Middle;const e=new l.Point(t[0].x-9,t[0].y-9),n=new l.Point(t[0].x+9,t[0].y+9);this._ellipseRendererData.points=[e,n],this._ellipseRendererData.backcolor=i.backgroundColor.value(),this._ellipseRendererData.color=i.backgroundColor.value()}else{let e=Math.atan2(t[1].x-t[0].x,t[1].y-t[0].y);e-=.017444444444444446*Math.sign(e);let i=r.HorizontalAlign.Center,n=r.VerticalAlign.Middle;e>-Math.PI/4&&e<Math.PI/4?n=r.VerticalAlign.Bottom:e>3*Math.PI/4||e<-3*Math.PI/4?n=r.VerticalAlign.Top:i=e<0?r.HorizontalAlign.Left:r.HorizontalAlign.Right,this._textRendererData.vertAlign=n,this._textRendererData.horzAlign=i}}}}},82462:(e,t,i)=>{"use strict";i.r(t),i.d(t,{BalloonPaneView:()=>v});var n,r=i(19063),s=i(68979),o=i(15938),a=i(27916),l=i(36036),d=i(95201),h=i(11064),c=i(56468),u=i(86441),p=i(34026),_=i(63273),f=i(7114),g=i(75919);!function(e){e[e.Radius=15]="Radius",e[e.TailApexXOffsetFromTextStart=20]="TailApexXOffsetFromTextStart",e[e.TailHeight=9]="TailHeight"}(n||(n={}));class x extends g.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._geometryCache={innerHeight:NaN,textHorizontalPadding:NaN,innerWidth:NaN,paddingLeft:NaN},this._geomertryCacheInvalidated=!0,this._data=null}setData(e){this._data=e,this._geomertryCacheInvalidated=!0}hitTest(e){if(null===this._data||0===this._data.points.length)return null;const t=this._data.points[0].x-(this._geometryCache.paddingLeft+20),i=this._data.points[0].y-(this._geometryCache.innerHeight+9),n=(0,u.box)(new u.Point(t,i),new u.Point(t+this._geometryCache.innerWidth,i+this._geometryCache.innerHeight));return(0,p.pointInBox)(e,n)?new c.HitTestResult(c.HitTarget.MovePoint,{areaName:c.AreaName.Text}):null}_drawImpl(e){if(null===this._data||0===this._data.points.length)return;const t=e.context;t.font=this._data.font;const i=this._measureInfo(t,this._data.label,this._data.fontSize),{paddingLeft:n,innerHeight:r,innerWidth:s,textHorizontalPadding:o}=i;t.textAlign=(0,_.isRtl)()?"right":"left";const a=this._data.points[0].x-(n+20),l=this._data.points[0].y-(r+9);t.translate(a,l),t.beginPath(),t.moveTo(24,r),t.lineTo(15,r),t.arcTo(-1e3,0,1e3,0,r/2),t.lineTo(s-15,0),t.arcTo(1e3,r,-1e3,r,r/2),t.lineTo(33,r),t.quadraticCurveTo(33,r+4,35,r+9),t.quadraticCurveTo(27,r+6,24,r),t.fillStyle=this._data.backgroundColor,t.fill(),t.strokeStyle=this._data.borderColor,t.lineWidth=2,t.stroke(),t.closePath(),t.textBaseline="middle",t.fillStyle=this._data.color,t.fillText(this._data.label,n+o,r/2)}_measureInfo(e,t,i){if(this._geomertryCacheInvalidated){const n=e.measureText(t),r=i,s=15,o=Math.round(r/1.3),a=n.width+2*s,l=r+2*o,d=(0,f.calcTextHorizontalShift)(e,n.width);this._geometryCache={paddingLeft:s,innerWidth:a,innerHeight:l,textHorizontalPadding:d},this._geomertryCacheInvalidated=!1}return this._geometryCache}}class v extends a.LineSourcePaneView{constructor(e,t){super(e,t),this._balloonRenderer=new x,this._renderer=null}renderer(e){return this._invalidated&&this._updateImpl(e),
|
|
this._renderer}_updateImpl(e){super._updateImpl(e);const t=this._source.properties().childs(),i={points:this._points,color:t.color.value(),borderColor:t.borderColor.value(),backgroundColor:(0,r.generateColor)(t.backgroundColor.value(),t.transparency.value()),font:(0,s.makeFont)(t.fontsize.value(),o.CHART_FONT_FAMILY),fontSize:t.fontsize.value(),label:t.text.value()};if(this._balloonRenderer.setData(i),1===i.points.length){const e=new d.CompositeRenderer;return e.append(this._balloonRenderer),e.append(new h.SelectionRenderer({points:i.points.map(l.mapLineSourcePaneViewPointToLineAnchorPoint),bgColors:this._lineAnchorColors(i.points),visible:this.areAnchorsVisible(),barSpacing:this._model.timeScale().barSpacing(),hittestResult:c.HitTarget.MovePoint})),void(this._renderer=e)}this._renderer=this._balloonRenderer}}},52666:(e,t,i)=>{"use strict";i.r(t),i.d(t,{BarsPatternPaneView:()=>R});var n=i(86441),r=i(19625),s=i(51056),o=i(19063),a=i(56468),l=i(95201),d=i(46088),h=i(49857),c=i(74010),u=i(62189),p=i(91046),_=i(95173),f=i(27916),g=i(36036),x=i(67467);const v=r.colorsPalette["color-cold-gray-500"],w={[x.LineToolBarsPatternMode.Bars]:e=>[e[2],e[3]],[x.LineToolBarsPatternMode.Line]:e=>e[4],[x.LineToolBarsPatternMode.OpenClose]:e=>[e[1],e[4]],[x.LineToolBarsPatternMode.LineOpen]:e=>e[1],[x.LineToolBarsPatternMode.LineHigh]:e=>e[2],[x.LineToolBarsPatternMode.LineLow]:e=>e[3],[x.LineToolBarsPatternMode.LineHL2]:e=>(e[2]+e[3])/2};class R extends f.LineSourcePaneView{constructor(){super(...arguments),this._vertLineRenderer1=new _.VerticalLineRenderer,this._vertLineRenderer2=new _.VerticalLineRenderer,this._medianRenderer=new p.TrendLineRenderer,this._renderer=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer=null,this._points.length<2)return;const t=this._source.priceScale(),i=this._source.ownerSource()?.firstValue()??null;if(!t||t.isEmpty()||null===i)return;const r=this._source.points(),p=this._source.pattern(),_=p.length,f=new l.CompositeRenderer;if(_>0&&2===r.length){const e=this._source.properties().childs(),l=e.mode.value(),h=e.color.value(),v=Math.abs((this._points[0].x-this._points[1].x)/(_-1)),R=this._source.getScale(),T=e=>t.priceToCoordinate(e,i)*R,[{index:m},{index:b}]=r,y=m<b?this._points[0]:this._points[1],[P,L]=this._source.points(),S=m<b?P.index:L.index,C=y.x,A=y.y-T(this._source.firstPatternPrice());if(l===x.LineToolBarsPatternMode.Bars||l===x.LineToolBarsPatternMode.OpenClose){const e=w[l];for(let t=0;t<_;t++){const i=Math.round(C+t*v+.5),r=e(p[t]).map(((e,t)=>new n.Point(i+(2*t-1),Math.round(T(e))+A))),s=new u.RectangleRenderer;s.setData({points:r,color:h,backcolor:h,linewidth:1,fillBackground:!0,transparency:10,extendLeft:!1,extendRight:!1}),f.append(s)}f.append(this.createLineAnchor({points:this._points.map(g.mapLineSourcePaneViewPointToLineAnchorPoint)},0))}else{const e=w[l],t=p.map(((t,i)=>{const n=Math.round(C+i*v+.5);return{timePointIndex:S+i,center:n,left:NaN,right:NaN,y:T(e(t))+A}}));f.append(new c.PaneRendererLine({
|
|
barSpacing:v,items:t,lineColor:{type:d.ColorType.Solid,color:(0,o.generateColor)(h,10)},lineStyle:s.LINESTYLE_SOLID,lineWidth:2,hittest:new a.HitTestResult(a.HitTarget.MovePoint),simpleMode:!0,withMarkers:!1,skipHoles:!0})),f.append(this.createLineAnchor({points:this._points.map(g.mapLineSourcePaneViewPointToLineAnchorPoint)},1))}}else this._vertLineRenderer1.setData({x:this._points[0].x,color:v,linewidth:1,linestyle:s.LINESTYLE_SOLID}),f.append(this._vertLineRenderer1),this._vertLineRenderer2.setData({x:this._points[1].x,color:v,linewidth:1,linestyle:s.LINESTYLE_SOLID}),f.append(this._vertLineRenderer2),this._medianRenderer.setData({points:this._points,color:v,linewidth:1,linestyle:s.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:h.LineEnd.Normal,rightend:h.LineEnd.Normal}),f.append(this._medianRenderer);this._renderer=f}}},12487:(e,t,i)=>{"use strict";i.r(t),i.d(t,{BezierCubicPaneView:()=>v});var n=i(19063),r=i(27916),s=i(75919),o=i(56468),a=i(64034),l=i(66825),d=i(91046),h=i(49857),c=i(82839),u=i(61993),p=i(37743);class _ extends s.MediaCoordinatesPaneRenderer{constructor(e){super(),this._data=e||null}setData(e){this._data=e}hitTest(e){const t=this._data;if(null===t)return null;if(4===t.points.length){const i=(0,u.interactionTolerance)().curve,[n,r,s,a]=t.points,d=a.subtract(n),h=s.subtract(d.scaled(.25)),p=s.add(d.scaled(.25)),_=r.subtract(s),f=a.subtract(_.scaled(.25)),g=a.add(_.scaled(.25));if((0,l.quadroBezierHitTest)(s,n,h,e,i)||(0,l.cubicBezierHitTest)(s,p,f,a,e,i)||(0,l.quadroBezierHitTest)(a,r,g,e,i))return new o.HitTestResult(o.HitTarget.MovePoint);let x=(0,c.hitTestExtendedPoints)(e,i,t.extendLeftPoints);return null===x&&(x=(0,c.hitTestExtendedPoints)(e,i,t.extendRightPoints)),x}return null}_drawImpl(e){if(null===this._data)return;const t=e.context;t.lineCap="round",t.strokeStyle=this._data.color,t.lineWidth=this._data.lineWidth,(0,p.setLineStyle)(t,this._data.lineStyle);const i=this._data.points[0],n=this._data.points[1];if(2===this._data.points.length)t.beginPath(),t.moveTo(i.x,i.y),t.lineTo(n.x,n.y),t.stroke(),this._data.leftEnd===h.LineEnd.Arrow&&(0,d.drawArrow)(n,i,t,t.lineWidth,a.dpr1PixelRatioInfo),this._data.rightEnd===h.LineEnd.Arrow&&(0,d.drawArrow)(i,n,t,t.lineWidth,a.dpr1PixelRatioInfo);else{const e=this._data.points[2],r=this._data.points[3],s=r.subtract(i),o=e.subtract(s.scaled(.25)),l=e.add(s.scaled(.25)),u=n.subtract(e),p=r.subtract(u.scaled(.25)),_=r.add(u.scaled(.25));this._data.fillBack&&this._data.points.length>2&&(t.fillStyle=this._data.backColor,t.beginPath(),t.moveTo(i.x,i.y),t.quadraticCurveTo(o.x,o.y,e.x,e.y),t.bezierCurveTo(l.x,l.y,p.x,p.y,r.x,r.y),t.quadraticCurveTo(_.x,_.y,n.x,n.y),t.fill()),t.beginPath(),(0,c.buildExtendedSegments)(t,this._data.extendLeftPoints),t.moveTo(i.x,i.y),t.quadraticCurveTo(o.x,o.y,e.x,e.y),t.bezierCurveTo(l.x,l.y,p.x,p.y,r.x,r.y),t.quadraticCurveTo(_.x,_.y,n.x,n.y),(0,c.buildExtendedSegments)(t,this._data.extendRightPoints),this._data.leftEnd===h.LineEnd.Arrow&&(0,d.drawArrow)(o,i,t,t.lineWidth,a.dpr1PixelRatioInfo),
|
|
this._data.rightEnd===h.LineEnd.Arrow&&(0,d.drawArrow)(_,n,t,t.lineWidth,a.dpr1PixelRatioInfo),t.stroke()}}}var f=i(95201),g=i(35246),x=i(50151);class v extends r.LineSourcePaneView{constructor(){super(...arguments),this._bezierCubicRenderer=new _,this._renderer=new f.CompositeRenderer,this._extendedSegmentLeftCache=null,this._extendedSegmentRightCache=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer.clear(),this._points.length<2)return;const t=this._source.properties().childs();let i=[],r=[];if(4===this._source.points().length){const n=(0,x.ensureNotNull)(this._source.pointToScreenPoint(this._source.points()[0])),s=(0,x.ensureNotNull)(this._source.pointToScreenPoint(this._source.points()[1])),o=(0,x.ensureNotNull)(this._source.pointToScreenPoint(this._source.points()[2])),a=(0,x.ensureNotNull)(this._source.pointToScreenPoint(this._source.points()[3])),l=a.subtract(n),d=o.subtract(l.scaled(.25)),h=s.subtract(o),c=a.add(h.scaled(.25)),{mediaSize:{width:u,height:p}}=e;t.extendLeft.value()&&(i=this._extendSegmentLeft(o,n,d,u,p)),t.extendRight.value()&&(r=this._extendSegmentRight(a,s,c,u,p))}const s=this._points.slice(),o=this._source.controlPoints();null!==o&&(s.push((0,x.ensureNotNull)(this._source.pointToScreenPoint(o[0]))),s.push((0,x.ensureNotNull)(this._source.pointToScreenPoint(o[1]))));const a={points:s,color:t.linecolor.value(),lineWidth:t.linewidth.value(),lineStyle:t.linestyle.value(),leftEnd:t.leftEnd.value(),rightEnd:t.rightEnd.value(),fillBack:t.fillBackground.value(),backColor:(0,n.generateColor)(t.backgroundColor.value(),t.transparency.value()),extendLeftPoints:i,extendRightPoints:r};this._bezierCubicRenderer.setData(a),this._renderer.append(this._bezierCubicRenderer),this.addAnchors(this._renderer)}_extendSegmentLeft(e,t,i,n,r){return(0,g.cacheIsValid)(this._extendedSegmentLeftCache,e,t,i,n,r)||(this._extendedSegmentLeftCache={p1:e,p2:t,p3:i,width:n,height:r,segment:(0,l.extendQuadroBezier)(e,t,i,n,r)}),(0,x.ensureNotNull)(this._extendedSegmentLeftCache).segment}_extendSegmentRight(e,t,i,n,r){return(0,g.cacheIsValid)(this._extendedSegmentRightCache,e,t,i,n,r)||(this._extendedSegmentRightCache={p1:e,p2:t,p3:i,width:n,height:r,segment:(0,l.extendQuadroBezier)(e,t,i,n,r)}),(0,x.ensureNotNull)(this._extendedSegmentRightCache).segment}}},35246:(e,t,i)=>{"use strict";i.r(t),i.d(t,{BezierQuadroPaneView:()=>h,cacheIsValid:()=>d});var n=i(50151),r=i(19063),s=i(27916),o=i(95201),a=i(66825),l=i(82839);function d(e,t,i,n,r,s){return null!==e&&e.p1.x===t.x&&e.p1.y===t.y&&e.p2.x===i.x&&e.p2.y===i.y&&e.p3.x===n.x&&e.p3.y===n.y&&e.width===r&&e.height===s}class h extends s.LineSourcePaneView{constructor(){super(...arguments),this._bezierQuadroRenderer=new l.BezierQuadroRenderer,this._renderer=null,this._extendedSegmentLeftCache=null,this._extendedSegmentRightCache=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer=null,this._points.length<2)return
|
|
;const t=this._source.properties().childs();let i=[],s=[];if(3===this._source.points().length){const r=(0,n.ensureNotNull)(this._source.pointToScreenPoint(this._source.points()[0])),o=(0,n.ensureNotNull)(this._source.pointToScreenPoint(this._source.points()[1])),a=(0,n.ensureNotNull)(this._source.pointToScreenPoint(this._source.points()[2])),l=o.subtract(r),d=a.subtract(l.scaled(.25)),h=a.add(l.scaled(.25)),{mediaSize:{width:c,height:u}}=e;t.extendLeft.value()&&(i=this._extendSegmentLeft(a,r,d,c,u)),t.extendRight.value()&&(s=this._extendSegmentRight(a,o,h,c,u))}const a=this._points.slice(),l=this._source.controlPoint();null!==l&&a.push((0,n.ensureNotNull)(this._source.pointToScreenPoint(l)));const d={points:a,color:t.linecolor.value(),lineWidth:t.linewidth.value(),lineStyle:t.linestyle.value(),leftEnd:t.leftEnd.value(),rightEnd:t.rightEnd.value(),fillBack:t.fillBackground.value(),backColor:(0,r.generateColor)(t.backgroundColor.value(),t.transparency.value()),extendLeftSegments:i,extendRightSegments:s};this._bezierQuadroRenderer.setData(d);const h=new o.CompositeRenderer;h.append(this._bezierQuadroRenderer),this.addAnchors(h),this._renderer=h}_extendSegmentLeft(e,t,i,r,s){return d(this._extendedSegmentLeftCache,e,t,i,r,s)||(this._extendedSegmentLeftCache={p1:e,p2:t,p3:i,width:r,height:s,segment:(0,a.extendQuadroBezier)(e,t,i,r,s)}),(0,n.ensureNotNull)(this._extendedSegmentLeftCache).segment}_extendSegmentRight(e,t,i,r,s){return d(this._extendedSegmentRightCache,e,t,i,r,s)||(this._extendedSegmentRightCache={p1:e,p2:t,p3:i,width:r,height:s,segment:(0,a.extendQuadroBezier)(e,t,i,r,s)}),(0,n.ensureNotNull)(this._extendedSegmentRightCache).segment}}},82839:(e,t,i)=>{"use strict";i.d(t,{BezierQuadroRenderer:()=>_,buildExtendedSegments:()=>p,hitTestExtendedPoints:()=>u});var n=i(4652),r=i(75919),s=i(49857),o=i(56468),a=i(64034),l=i(66825),d=i(91046),h=i(61993),c=i(37743);function u(e,t,i){for(const r of i)for(let i=1;i<r.length;i++){const s=r[i-1],a=r[i];if((0,n.distanceToSegment)(s,a,e).distance<t)return new o.HitTestResult(o.HitTarget.MovePoint)}return null}function p(e,t){for(let i=0;i<t.length;i++){const n=t[i],r=n[0];e.moveTo(r.x,r.y);for(let t=1;t<n.length;t++){const i=n[t];e.lineTo(i.x,i.y)}}}class _ extends r.MediaCoordinatesPaneRenderer{constructor(e){super(),this._data=e||null}setData(e){this._data=e}hitTest(e){if(null!==this._data&&3===this._data.points.length){const t=(0,h.interactionTolerance)().curve,[i,n,r]=this._data.points,s=n.subtract(i),a=r.subtract(s.scaled(.25)),d=r.add(s.scaled(.25));if((0,l.quadroBezierHitTest)(r,i,a,e,t)||(0,l.quadroBezierHitTest)(r,n,d,e,t))return new o.HitTestResult(o.HitTarget.MovePoint);let c=u(e,t,this._data.extendLeftSegments);return null===c&&(c=u(e,t,this._data.extendRightSegments)),c}return null}_drawImpl(e){if(null===this._data)return;const[t,i,n]=this._data.points,r=e.context;if(r.lineCap="round",r.strokeStyle=this._data.color,r.lineWidth=this._data.lineWidth,(0,c.setLineStyle)(r,this._data.lineStyle),2===this._data.points.length)r.beginPath(),r.moveTo(t.x,t.y),
|
|
r.lineTo(i.x,i.y),r.stroke();else{const e=i.subtract(t),o=n.subtract(e.scaled(.25)),l=n.add(e.scaled(.25));this._data.fillBack&&this._data.points.length>2&&(r.fillStyle=this._data.backColor,r.beginPath(),r.moveTo(t.x,t.y),r.quadraticCurveTo(o.x,o.y,n.x,n.y),r.quadraticCurveTo(l.x,l.y,i.x,i.y),r.fill()),r.beginPath(),p(r,this._data.extendLeftSegments),r.moveTo(t.x,t.y),r.quadraticCurveTo(o.x,o.y,n.x,n.y),r.quadraticCurveTo(l.x,l.y,i.x,i.y),p(r,this._data.extendRightSegments),this._data.leftEnd===s.LineEnd.Arrow&&(0,d.drawArrow)(o,t,r,r.lineWidth,a.dpr1PixelRatioInfo),this._data.rightEnd===s.LineEnd.Arrow&&(0,d.drawArrow)(l,i,r,r.lineWidth,a.dpr1PixelRatioInfo),r.stroke()}}}},70849:(e,t,i)=>{"use strict";i.d(t,{BrushBasePaneView:()=>h});var n=i(86441),r=i(74011),s=i(11064),o=i(95201),a=i(36036),l=i(56468),d=i(27916);class h extends d.LineSourcePaneView{constructor(){super(...arguments),this._polygonRenderer=new r.PolygonRenderer,this._renderer=new o.CompositeRenderer}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e);const t=Math.max(1,this._source.smooth()),i=this._points;if(0===i.length)return void this._renderer.clear();const n=[i[0]];for(let e=1;e<i.length;e++){const r=i[e].subtract(i[e-1]),s=r.length(),o=Math.min(5,Math.floor(s/t)),a=r.normalized().scaled(s/o);for(let t=0;t<o-1;t++)n.push(i[e-1].add(a.scaled(t)));n.push(i[e])}this._points=this._smoothArray(n,t);const r=this._createPolygonRendererData();if(this._polygonRenderer.setData(r),this._renderer=new o.CompositeRenderer,this._renderer.append(this._polygonRenderer),this._source.finished()&&this._addAnchors()){const e=r.points.length;if(e>0){const t=1!==e?[r.points[0],r.points[e-1]]:[r.points[0]],i=new s.SelectionRenderer({points:t.map(a.mapLineSourcePaneViewPointToLineAnchorPoint),bgColors:this._lineAnchorColors(t),visible:this.areAnchorsVisible(),hittestResult:l.HitTarget.Regular,barSpacing:this._getModel().timeScale().barSpacing()});this._renderer.append(i)}}}_addAnchors(){return!0}_smoothArray(e,t){if(1===e.length)return e;const i=new Array(e.length);for(let r=0;r<e.length;r++){let s=new n.Point(0,0);for(let i=0;i<t;i++){const t=Math.max(r-i,0),n=Math.min(r+i,e.length-1);s=s.add(e[t]),s=s.add(e[n])}i[r]=s.scaled(.5/t)}return i.push(e[e.length-1]),i}}},68716:(e,t,i)=>{"use strict";i.r(t),i.d(t,{BrushPaneView:()=>s});var n=i(51056),r=i(70849);class s extends r.BrushBasePaneView{_createPolygonRendererData(){const e=this._source.properties().childs(),t={points:this._points,color:e.linecolor.value(),linewidth:e.linewidth.value(),linestyle:n.LINESTYLE_SOLID,skipClosePath:!0,leftend:e.leftEnd.value(),rightend:e.rightEnd.value(),filled:!1,fillBackground:!1,backcolor:e.backgroundColor.value()};return e.fillBackground.value()&&this._model.lineBeingCreated()!==this._source&&(t.filled=!0,t.fillBackground=!0,t.transparency=e.transparency.value()),t}}},31463:(e,t,i)=>{"use strict";i.r(t),i.d(t,{CalloutPaneView:()=>T})
|
|
;var n=i(86441),r=i(50151),s=i(68979),o=i(95201),a=i(15938),l=i(36036),d=i(32211),h=i(2844),c=i(56468),u=i(17330),p=i(63273),_=i(19063),f=i(7114),g=i(75919),x=i(64034),v=i(70262);class w extends g.MediaCoordinatesPaneRenderer{constructor(e){super(),this._data=null,this._textInfoCache=null,this._hitTest=e||new c.HitTestResult(c.HitTarget.MovePoint,{areaName:c.AreaName.Text})}data(){return this._data}setData(e){null===this._data||this._data.textData.lines===e.textData.lines&&this._data.textData.font===e.textData.font&&this._data.textData.maxWidth===e.textData.maxWidth||(this._textInfoCache=null),this._data=e}setCursorType(e){this._hitTest.mergeData({cursorType:e})}hitTest(e){if(null===this._data||this._data.points.length<2)return null;const t=this._data.points[0],i=this._data.points[1];if(t.subtract(e).length()<3)return new c.HitTestResult(c.HitTarget.ChangePoint);const n=(0,r.ensureNotNull)(this._calcTextSize()),s=i.x-n.totalWidth/2,o=i.y-n.totalHeight/2;return e.x>=s&&e.x<=s+n.totalWidth&&e.y>=o&&e.y<=o+n.totalHeight?this._hitTest:null}getTextInfo(){const e=(0,r.ensureNotNull)(this._data),t=(0,p.isRtl)()?"right":"left",i=e.points[1].clone(),{totalWidth:n,totalHeight:s}=(0,r.ensureNotNull)(this._calcTextSize()),o=i.x-n/2,a=i.y-s/2;return{font:e.textData.font,fontSize:e.textData.fontSize,lineHeight:Math.ceil(e.textData.fontSize),lineSpacing:0,textTop:a+10,textBottom:a+s-10,textLeft:o+10,textRight:o+n-10,textAlign:t}}positionToCoordinate(e,t){const i=(0,r.ensureNotNull)(this._data),n=this.getTextInfo(),{x:s,y:o,lineNumber:a}=(0,v.getSymbolCoordinatesInfo)({symbolPosition:t,textWidth:n.textRight-n.textLeft,textByLines:i.textData.linesIncludingHidden,lineHeight:i.textData.fontSize,font:i.textData.font,textAlign:n.textAlign});return{x:s+n.textLeft,y:o+n.textTop,lineNumber:a}}_drawImpl(e){if(null===this._data||this._data.points.length<2)return;const t=this._data.points[0].clone(),i=this._data.points[1].clone(),n=e.context;n.lineCap="round",n.strokeStyle=this._data.bordercolor,n.lineWidth=this._data.linewidth,n.textBaseline="bottom",n.font=this._data.textData.font;const{textWidth:s,textHeight:o,totalWidth:a,totalHeight:l}=(0,r.ensureNotNull)(this._calcTextSize()),d=i.x-a/2,h=i.y-l/2;let c=0;const u=s+4>16,g=o+4>16;n.textAlign=(0,p.isRtl)()?"right":"left";const x=(0,f.calcTextHorizontalShift)(n,s);t.x>d+a?c=20:t.x>d&&(c=10),t.y>h+l?c+=2:t.y>h&&(c+=1),n.translate(d,h),t.x-=d,t.y-=h,i.x-=d,i.y-=h,n.beginPath(),n.moveTo(8,0),10===c?u?(n.lineTo(i.x-8,0),n.lineTo(t.x,t.y),n.lineTo(i.x+8,0),n.lineTo(a-8,0)):(n.lineTo(t.x,t.y),n.lineTo(a-8,0)):n.lineTo(a-8,0),20===c?(n.lineTo(t.x,t.y),n.lineTo(a,8)):n.arcTo(a,0,a,8,8),21===c?g?(n.lineTo(a,i.y-8),n.lineTo(t.x,t.y),n.lineTo(a,i.y+8),n.lineTo(a,l-8)):(n.lineTo(t.x,t.y),n.lineTo(a,l-8)):n.lineTo(a,l-8),22===c?(n.lineTo(t.x,t.y),n.lineTo(a-8,l)):n.arcTo(a,l,a-8,l,8),12===c?u?(n.lineTo(i.x+8,l),n.lineTo(t.x,t.y),n.lineTo(i.x-8,l),n.lineTo(8,l)):(n.lineTo(t.x,t.y),n.lineTo(8,l)):n.lineTo(8,l),2===c?(n.lineTo(t.x,t.y),n.lineTo(0,l-8)):n.arcTo(0,l,0,l-8,8),1===c?g?(n.lineTo(0,i.y+8),
|
|
n.lineTo(t.x,t.y),n.lineTo(0,i.y-8),n.lineTo(0,8)):(n.lineTo(t.x,t.y),n.lineTo(0,8)):n.lineTo(0,8),0===c?(n.lineTo(t.x,t.y),n.lineTo(8,0)):n.arcTo(0,0,8,0,8),n.stroke(),n.fillStyle=(0,_.generateColor)(this._data.backcolor,this._data.transparency),n.fill(),n.translate(-d,-h),this._drawSelectionIfNeeded(n),n.fillStyle=this._data.color;let v=h+8+2+this._data.textData.fontSize;const w=d+8+2+x;for(const e of this._data.textData.lines)n.fillText(e.text,w,v),v+=this._data.textData.fontSize}_calcTextSize(){if(null===this._data||this._data.points.length<2)return null;if(null===this._textInfoCache){const e=this._data.textData.fontSize*this._data.textData.lines.length,t=this._data.textData.maxWidth,i=2*2+2*8;this._textInfoCache={textWidth:t,textHeight:e,totalWidth:t+i,totalHeight:e+i}}return this._textInfoCache}_drawSelectionIfNeeded(e){const t=(0,r.ensureNotNull)(this._data),i=t.textData.fontSize;if(t.selectionHighlight){const n=this.positionToCoordinate(!1,t.selectionHighlight.start),r=this.positionToCoordinate(!1,t.selectionHighlight.end),s=this.getTextInfo();(0,v.drawSelection)(e,x.dpr1PixelRatioInfo,{lines:t.textData.lines,selectionStart:n,selectionEnd:r,left:s.textLeft,right:s.textRight,color:t.selectionHighlight.color,font:t.textData.font,lineHeight:i})}}}let R=null;class T extends d.InplaceTextLineSourcePaneView{constructor(e,t,i,n,r){super(e,t,i,n,r),this._renderer=new o.CompositeRenderer,this._textWidthCache=new h.TextWidthCache,this._calloutRenderer=new w(new c.HitTestResult(c.HitTarget.MovePoint,(0,d.inplaceEditHandlers)(this._tryActivateEditMode.bind(this,null)))),this._source.setAdditionalCursorData((()=>({color:this._source.editableTextStyle().cursorColor,...this._calloutRenderer.getTextInfo()})),this._calloutRenderer.positionToCoordinate.bind(this._calloutRenderer,!0))}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._source.calculatePoint2(),this._renderer.clear(),!this._points[0])return void this.closeTextEditor();if(this._points.length<2)return void this.closeTextEditor();const t=this._source.properties().childs(),i=this._points[0],s=i.x+this._source.getBarOffset()*this._model.timeScale().barSpacing(),o=new n.Point(s,this._points[1].y),a=this._fontStyle(),d=t.wordWrap.value()?t.wordWrapWidth.value():void 0,h=(0,u.wordWrap)(this._textData(),a,this._textWidthCache,!1,d),c=h.filter((e=>!e.hidden));let p;p=void 0!==d?d:c.reduce(((e,t)=>Math.max(e,function(e,t){if(null===R){const e=document.createElement("canvas");e.width=0,e.height=0,R=(0,r.ensureNotNull)(e.getContext("2d"))}return R.font=t,R.measureText(e).width}(t.text,a))),0);const _={points:[i,o],color:this._textColor(),linewidth:t.linewidth.value(),backcolor:t.backgroundColor.value(),transparency:t.transparency.value(),textData:{originalText:this._textData(),linesIncludingHidden:h,lines:c,maxWidth:p,font:a,fontSize:t.fontsize.value()},bordercolor:t.bordercolor.value(),...this._inplaceTextHighlight()};if(this._calloutRenderer.setData(_),this._renderer.append(this._calloutRenderer),
|
|
this._updateInplaceText(this._calloutRenderer.getTextInfo()),this._renderer.append(this.createLineAnchor({points:[(0,l.lineSourcePaneViewPointToLineAnchorPoint)(i)]},0)),void 0!==d){const e=_.points[1],t=(0,l.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(e.x+d/2+8+2,e.y),1);this._renderer.append(this.createLineAnchor({points:[t]},1))}this._calloutRenderer.setCursorType(this._textCursorType())}_fontStyle(){const e=this._source.properties().childs(),t=(e.bold.value()?"bold ":"")+(e.italic.value()?"italic ":""),i=e.fontsize.value();return(0,s.makeFont)(i,a.CHART_FONT_FAMILY,t)}}},50398:(e,t,i)=>{"use strict";i.r(t),i.d(t,{CirclePaneView:()=>u});var n=i(30699),r=i(15938),s=i(95201),o=i(56468),a=i(13075),l=i(36036),d=i(32211),h=i(62689),c=i(97435);class u extends d.InplaceTextLineSourcePaneView{constructor(e,t,i,n,r){super(e,t,i,n,r),this._circleRenderer=new c.CircleRenderer,this._renderer=new s.CompositeRenderer,this._textRenderer=new h.LineToolTextRenderer(void 0,new o.HitTestResult(o.HitTarget.MovePoint,(0,d.inplaceEditHandlers)(this._tryActivateEditMode.bind(this,null)))),this._source.setAdditionalCursorData((()=>({color:this._source.editableTextStyle().cursorColor,rotationPoint:this._textRenderer.rotation()??void 0,...this._textRenderer.getTextInfo()})),this._textRenderer.positionToCoordinate.bind(this._textRenderer))}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer.clear(),this._points.length<2)return;const t=this._source.properties().childs(),[i,s]=this._points;this._circleRenderer.setData({center:i,radius:Math.sqrt((s.x-i.x)**2+(s.y-i.y)**2),color:t.color.value(),lineWidth:t.linewidth.value(),backColor:t.fillBackground.value()?t.backgroundColor.value():"transparent",backgroundHitTarget:this._model.selection().isSelected(this._source)?o.HitTarget.MovePoint:void 0}),this._renderer.append(this._circleRenderer);const d=this._placeHolderMode();let h=!1;if(t.showLabel?.value()&&t.text.value()||d||this._isTextEditMode()){const{fontSize:t,bold:o,italic:l}=this._source.properties().childs(),c=i.subtract(s).length()*Math.sqrt(2);this._textRenderer.setData({points:[i],text:this._textData(),color:this._textColor(),fontSize:t.value(),font:r.CHART_FONT_FAMILY,bold:o.value(),italic:l.value(),wordWrapWidth:d?void 0:c,maxHeight:d?void 0:c,offsetX:0,offsetY:0,horzAlign:n.HorizontalAlign.Center,vertAlign:n.VerticalAlign.Middle,forceTextAlign:!0,decorator:d?a.PlusTextRendererDecorator.instance():void 0,...this._inplaceTextHighlight()});let u=!1;if(d&&this._textRenderer.measure().width>c&&(this._textRenderer.updateData({text:""}),u=this._textRenderer.measure().width>c),!u){this._textRenderer.setCursorType(this._textCursorType());const{mediaSize:{width:t,height:i}}=e;this._textRenderer.isOutOfScreen(t,i)?this.closeTextEditor():this._updateInplaceText(this._textRenderer.getTextInfo()),this._renderer.append(this._textRenderer),h=!0}}const c=[(0,l.lineSourcePaneViewPointToLineAnchorPoint)(s,1)];h||c.unshift((0,
|
|
l.lineSourcePaneViewPointToLineAnchorPoint)(i,0,void 0,void 0,o.HitTarget.MovePoint)),this._renderer.append(this.createLineAnchor({points:c},0))}}},39157:(e,t,i)=>{"use strict";i.r(t),i.d(t,{CommentPaneView:()=>x});var n,r=i(19063),s=i(30699),o=i(15938),a=i(56468),l=i(32211),d=i(36036),h=i(62689),c=i(95201),u=i(86441),p=i(34026),_=i(75919),f=i(37743);class g extends _.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e){if(null===this._data||0===this._data.points.length)return null;const{points:[t],innerWidth:i,innerHeight:n}=this._data,r=t.x,s=t.y-n,o=(0,u.box)(new u.Point(r,s),new u.Point(r+i,s+n));return(0,p.pointInBox)(e,o)?new a.HitTestResult(a.HitTarget.MovePoint,{areaName:a.AreaName.Text}):null}_drawImpl(e){if(null===this._data||0===this._data.points.length)return;const t=e.context,{points:[i],innerWidth:n,innerHeight:r,backgroundColor:s,borderColor:o,borderRadius:a}=this._data,l=i.x,d=i.y-r;t.translate(l,d),(0,f.drawRoundRect)(t,0,0,n,r,[a,a,a,2]),t.fillStyle=s,t.fill(),t.strokeStyle=o,t.lineWidth=2,t.stroke(),t.closePath()}}!function(e){e[e.CommentTextLeft=12]="CommentTextLeft"}(n||(n={}));class x extends l.InplaceTextLineSourcePaneView{constructor(e,t,i,n,r){super(e,t,i,n,r),this._commentRenderer=new g,this._labelRenderer=new h.LineToolTextRenderer(void 0,new a.HitTestResult(a.HitTarget.MovePoint,(0,l.inplaceEditHandlers)(this._tryActivateEditMode.bind(this,null)))),this._renderer=new c.CompositeRenderer,this._source.setAdditionalCursorData((()=>({color:this._source.editableTextStyle().cursorColor,...this._labelRenderer.getTextInfo()})),this._labelRenderer.positionToCoordinate.bind(this._labelRenderer))}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer.clear();const t=this._source.properties().childs(),i={...this._inplaceTextHighlight(),text:this._textData(),fontSize:t.fontsize.value(),offsetX:0,offsetY:0,points:this._points,vertAlign:s.VerticalAlign.Bottom,horzAlign:s.HorizontalAlign.Left,horzTextAlign:s.HorizontalAlign.Left,font:o.CHART_FONT_FAMILY,color:this._textColor(),boxPaddingVert:Math.round(t.fontsize.value()/1.3),boxPaddingHorz:12};this._labelRenderer.setData(i),this._labelRenderer.setCursorType(this._textCursorType());const{height:n,width:a}=e.mediaSize;this._labelRenderer.isOutOfScreen(a,n)?this.closeTextEditor():this._updateInplaceText(this._labelRenderer.getTextInfo());const l=this._labelRenderer.measure(),h={points:this._points,borderColor:t.borderColor.value(),backgroundColor:(0,r.generateColor)(t.backgroundColor.value(),t.transparency.value()),innerWidth:l.width,innerHeight:l.height,borderRadius:Math.min(l.width,this._labelRenderer.lineHeight()+2*Math.round(t.fontsize.value()/1.3))/2};this._commentRenderer.setData(h),this._renderer.append(this._commentRenderer),1===h.points.length&&this._renderer.append(this.createLineAnchor({points:h.points.map(d.mapLineSourcePaneViewPointToLineAnchorPoint)},0)),this._renderer.append(this._labelRenderer)}}},17551:(e,t,i)=>{
|
|
"use strict";i.r(t),i.d(t,{CrossLinePaneView:()=>l});var n=i(27916),r=i(50600),s=i(95173),o=i(95201),a=i(56468);class l extends n.LineSourcePaneView{constructor(e,t){super(e,t),this._renderer=null,this._horizLineRenderer=new r.HorizontalLineRenderer,this._vertLineRenderer=new s.VerticalLineRenderer,this._horizLineRenderer.setHitTest(new a.HitTestResult(a.HitTarget.MovePoint))}update(){this._invalidated=!0}renderer(e){return this._invalidated&&(this._updateImpl(e),this._invalidated=!1),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer=null;const t=this._getPoints();if(0===t.length)return;const i={color:this._getSource().lineColor(),linestyle:this._getSource().lineStyle(),linewidth:this._getSource().lineWidth(),x:t[0].x,y:t[0].y};this._horizLineRenderer.setData(i),this._horizLineRenderer.setHitTest(new a.HitTestResult(a.HitTarget.MovePoint,{snappingPrice:this._source.points()[0].price})),this._vertLineRenderer.setData(i),this._vertLineRenderer.setHitTest(new a.HitTestResult(a.HitTarget.MovePoint,{snappingIndex:this._source.points()[0].index}));const n=new o.CompositeRenderer;n.append(this._horizLineRenderer),n.append(this._vertLineRenderer),this.addAnchors(n),this._renderer=n}}},8198:(e,t,i)=>{"use strict";i.r(t),i.d(t,{CypherPaneView:()=>r});var n=i(77142);class r extends n.Pattern5pointsPaneView{_updateBaseData(){if(this._source.points().length>=3){const[e,t,i]=this._source.points();this._abRetracement=Math.round(1e3*Math.abs((i.price-t.price)/(t.price-e.price)))/1e3}if(this._source.points().length>=4){const[e,t,,i]=this._source.points();this._bcRetracement=Math.round(1e3*Math.abs((i.price-e.price)/(t.price-e.price)))/1e3}if(this._source.points().length>=5){const[e,,t,i,n]=this._source.points();this._cdRetracement=Math.round(1e3*Math.abs((n.price-i.price)/(i.price-t.price)))/1e3,this._xdRetracement=Math.round(1e3*Math.abs((n.price-i.price)/(e.price-i.price)))/1e3}}}},27436:(e,t,i)=>{"use strict";i.d(t,{DateAndPriceRangeBasePaneView:()=>l});var n=i(86441),r=i(15938),s=i(30699),o=i(17330),a=i(27916);class l extends a.LineSourcePaneView{constructor(){super(...arguments),this._customTextrenderer=new o.TextRenderer}_updateCustomTextRenderer(e,t){const i=this._source.properties().childs().customText.childs();if(i.visible.value()&&i.text.value().length>0){const[a,l]=this._points,d=Math.round((a.y+l.y)/2),h=new n.Point(a.x,d),c=new n.Point(l.x,d),u=h.x<c.x?h:c,p=u===h?c:h,_=s.VerticalAlign.Middle,f=s.HorizontalAlign.Center,g=new n.Point((h.x+c.x)/2,(h.y+c.y)/2),x=Math.atan((p.y-u.y)/(p.x-u.x)),v={points:[g],text:i.text.value(),color:i.color.value(),vertAlign:_,horzAlign:f,font:r.CHART_FONT_FAMILY,offsetX:0,offsetY:0,bold:i.bold.value(),italic:i.italic.value(),fontsize:i.fontsize.value(),forceTextAlign:!0,angle:x};return this._customTextrenderer.setData(v),this._needLabelExclusionPath(this._customTextrenderer,s.VerticalAlign.Middle)?(0,o.getTextBoundaries)(this._customTextrenderer,t,e):null}return this._customTextrenderer.setData(null),null}}},93955:(e,t,i)=>{"use strict";i.r(t),i.d(t,{
|
|
DateAndPriceRangePaneView:()=>b});var n=i(50151),r=i(86441),s=i(11542),o=i(63273),a=i(30699),l=i(17330),d=i(62189),h=i(91046),c=i(95201),u=i(74079),p=i(51056),_=i(49857),f=i(92953),g=i(15938),x=i(27436);const v=new f.TimeSpanFormatter,w=(0,u.getPercentageFormatter)(),R=(0,u.getVolumeFormatter)(),T=s.t(null,void 0,i(41643)),m=s.t(null,{context:"study"},i(24261));class b extends x.DateAndPriceRangeBasePaneView{constructor(){super(...arguments),this._distanceLineRenderer=new h.TrendLineRenderer,this._distancePriceRenderer=new h.TrendLineRenderer,this._backgroundRenderer=new d.RectangleRenderer,this._borderRenderer=new d.RectangleRenderer,this._textRenderer=new l.TextRenderer,this._renderer=new c.CompositeRenderer}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer.clear(),this._points.length<2||this._source.points().length<2)return;const t=this._source.properties().childs();t.fillBackground&&t.fillBackground.value()&&(this._backgroundRenderer.setData({points:this._points,color:"white",linewidth:0,backcolor:t.backgroundColor.value(),fillBackground:!0,transparency:t.backgroundTransparency.value(),extendLeft:!1,extendRight:!1}),this._renderer.append(this._backgroundRenderer));const[i,s]=this._points;t.drawBorder.value()&&(this._borderRenderer.setData({points:this._points,color:t.borderColor.value(),linewidth:t.borderWidth.value(),fillBackground:!1,extendLeft:!1,extendRight:!1,backcolor:""}),this._renderer.append(this._borderRenderer));const d=t.drawBorder.value()?t.borderWidth.value()/2:0,{mediaSize:{width:h,height:c}}=e,f=this._updateCustomTextRenderer(c,h),x=Math.round((i.y+s.y)/2),b=new r.Point(i.x+Math.sign(s.x-i.x)*d,x),y=new r.Point(s.x+Math.sign(i.x-s.x)*d,x);this._distanceLineRenderer.setData({points:[b,y],color:t.linecolor.value(),linewidth:t.linewidth.value(),linestyle:p.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:_.LineEnd.Normal,rightend:Math.abs(i.x-s.x)>=25*t.linewidth.value()?_.LineEnd.Arrow:_.LineEnd.Normal,excludeBoundaries:f?[f]:void 0}),this._renderer.append(this._distanceLineRenderer);const P=Math.round((i.x+s.x)/2),L=new r.Point(P,i.y+Math.sign(s.y-i.y)*d),S=new r.Point(P,s.y+Math.sign(i.y-s.y)*d);this._distancePriceRenderer.setData({points:[L,S],color:t.linecolor.value(),linewidth:t.linewidth.value(),linestyle:p.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:_.LineEnd.Normal,rightend:Math.abs(L.y-S.y)>=25*t.linewidth.value()?_.LineEnd.Arrow:_.LineEnd.Normal,excludeBoundaries:f?[f]:void 0}),this._renderer.append(this._distancePriceRenderer);const C=this._source.points()[0].price,A=this._source.points()[1].price,M=this._source.points()[0].index,I=this._source.points()[1].index,k=I-M,H=(0,o.forceLTRStr)(k+""),B=this._model.timeScale().indexToUserTime(M),D=this._model.timeScale().indexToUserTime(I);let z="";if(B&&D){const e=(D.valueOf()-B.valueOf())/1e3;z=", "+(0,o.startWithLTR)(v.format(e))}const E=A-C,V=100*E/Math.abs(C),N=this._model.mainSeries().symbolInfo(),W=N&&(0,u.getPipFormatter)(N),O=(0,
|
|
n.ensureNotNull)(this._source.ownerSource()).formatter(),F=(O.formatChange?.(A,C)??O.format(E))+" ("+w.format(Math.round(100*V)/100)+") "+(W?W.format(E):"");let Y,q=(0,o.forceLTRStr)(F)+"\n"+T.format({count:H})+z;if(t.showVolume.value()){const e=this._source.volume();Number.isNaN(e)||(q+=`\n${m} ${R.format(e)}`)}Y=A>C?new r.Point(.5*(i.x+s.x),s.y-2*t.fontsize.value()):new r.Point(.5*(i.x+s.x),s.y+.7*t.fontsize.value());const X={x:0,y:10},j=t.fontsize.value(),Q={points:[Y],text:q,color:t.textcolor.value(),font:g.CHART_FONT_FAMILY,offsetX:X.x,offsetY:X.y,lineSpacing:8,vertAlign:a.VerticalAlign.Middle,horzAlign:a.HorizontalAlign.Center,fontsize:j,backgroundRoundRect:4,boxPaddingHorz:.4*j+j/3,boxPaddingVert:.2*j+j/3},U=t.fillLabelBackground?.value();U&&(Q.boxShadow={shadowColor:t.shadow.value(),shadowBlur:4,shadowOffsetY:1},Q.backgroundColor=t.labelBackgroundColor.value()),this._textRenderer.setData(Q);const $=this._textRenderer.measure(),G=(0,l.calculateLabelPosition)($,i,s,X,c);this._textRenderer.setPoints([G]),this._renderer.append(this._textRenderer),this._renderer.append(this._customTextrenderer),this.addAnchors(this._renderer)}_needLabelExclusionPath(e){return e.getLinesInfo().lines.length>0}}},33406:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DateRangePaneView:()=>R});var n=i(86441),r=i(11542),s=i(63273),o=i(30699),a=i(17330),l=i(62189),d=i(91046),h=i(95201),c=i(51056),u=i(49857),p=i(92953),_=i(74079),f=i(15938),g=i(27436);const x=(0,_.getVolumeFormatter)(),v=r.t(null,void 0,i(41643)),w=r.t(null,{context:"study"},i(24261));class R extends g.DateAndPriceRangeBasePaneView{constructor(){super(...arguments),this._leftBorderRenderer=new d.TrendLineRenderer,this._rightBorderRenderer=new d.TrendLineRenderer,this._distancePriceRenderer=new d.TrendLineRenderer,this._backgroundRenderer=new l.RectangleRenderer,this._textRenderer=new a.TextRenderer,this._renderer=new h.CompositeRenderer}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer.clear(),this._points.length<2||this._source.points().length<2)return;const t=this._source.properties().childs(),i=t.extendTop.value(),r=t.extendBottom.value(),[l,d]=this._points,h=i?0:Math.min(l.y,d.y),_=r?this._height():Math.max(l.y,d.y);t.fillBackground.value()&&(this._backgroundRenderer.setData({points:[new n.Point(l.x,h),new n.Point(d.x,_)],color:"white",linewidth:0,backcolor:t.backgroundColor.value(),fillBackground:!0,transparency:t.backgroundTransparency.value(),extendLeft:!1,extendRight:!1}),this._renderer.append(this._backgroundRenderer));const g=(e,i,n)=>{e.setData({points:[i,n],color:t.linecolor.value(),linewidth:t.linewidth.value(),linestyle:c.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:u.LineEnd.Normal,rightend:u.LineEnd.Normal}),this._renderer.append(e)};g(this._leftBorderRenderer,new n.Point(l.x,h),new n.Point(l.x,_)),g(this._rightBorderRenderer,new n.Point(d.x,h),new n.Point(d.x,_))
|
|
;const R=Math.round((l.y+d.y)/2),T=new n.Point(l.x,R),m=new n.Point(d.x,R),{mediaSize:{width:b,height:y}}=e,P=this._updateCustomTextRenderer(y,b);this._distancePriceRenderer.setData({points:[T,m],color:t.linecolor.value(),linewidth:t.linewidth.value(),linestyle:c.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:u.LineEnd.Normal,rightend:Math.abs(T.x-m.x)>=15*t.linewidth.value()?u.LineEnd.Arrow:u.LineEnd.Normal,excludeBoundaries:P?[P]:void 0}),this._renderer.append(this._distancePriceRenderer);const L=this._source.points()[0].index,S=this._source.points()[1].index,C=S-L,A=this._model.timeScale().indexToUserTime(L),M=this._model.timeScale().indexToUserTime(S);let I="";if(A&&M){const e=(M.valueOf()-A.valueOf())/1e3;I=", "+(0,s.startWithLTR)((new p.TimeSpanFormatter).format(e))}const k=this._source.volume(),H=t.showVolume.value()&&!Number.isNaN(k)?`\n${w} ${x.format(k)}`:"",B=v.format({count:(0,s.forceLTRStr)(C.toString())})+I+H,D={x:0,y:10},z=t.fontsize.value(),E={text:B,color:t.textcolor.value(),font:f.CHART_FONT_FAMILY,offsetX:D.x,offsetY:D.y,lineSpacing:8,vertAlign:o.VerticalAlign.Middle,horzAlign:o.HorizontalAlign.Center,fontsize:z,backgroundRoundRect:4,boxPaddingHorz:.4*z+z/3,boxPaddingVert:.2*z+z/3},V=t.fillLabelBackground?.value();V&&(E.boxShadow={shadowColor:t.shadow.value(),shadowBlur:4,shadowOffsetY:1},E.backgroundColor=t.labelBackgroundColor.value()),this._textRenderer.setData(E);const N=this._textRenderer.measure(),W=(0,a.calculateLabelPosition)(N,l,d,D,y);this._textRenderer.setPoints([W]),this._renderer.append(this._textRenderer),this._renderer.append(this._customTextrenderer),this.addAnchors(this._renderer)}}},41376:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DisjointChannelPaneView:()=>f});var n=i(50151),r=i(86441),s=i(49483),o=i(30699),a=i(62317),l=i(91046),d=i(17330),h=i(95201),c=i(72791),u=i(15938),p=i(36036),_=i(27916);class f extends _.LineSourcePaneView{constructor(){super(...arguments),this._trendLineRendererPoints12=new l.TrendLineRenderer,this._trendLineRendererPoints43=new l.TrendLineRenderer,this._disjointChannelRenderer=new a.DisjointChannelRenderer,this._p1LabelRenderer=new d.TextRenderer,this._p2LabelRenderer=new d.TextRenderer,this._p3LabelRenderer=new d.TextRenderer,this._p4LabelRenderer=new d.TextRenderer,this._labelTextRenderer=new d.TextRenderer,this._renderer=new h.CompositeRenderer}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer.clear(),this._source.points().length<2)return;const t=this._source.priceScale(),i=this._source.ownerSource()?.firstValue();if(!t||null==i)return;const[a,l,d]=this._source.points(),h=t.formatPrice(a.price,i),_=t.formatPrice(l.price,i);let f,g;if(d){f=t.formatPrice(d.price,i);const e=l.price-a.price;g=t.formatPrice(d.price+e,i)}if(this._points.length<2)return;const x=this._source.properties().childs(),[v,w]=this._points;let R,T;if(this._points.length>=3){R=(0,r.point)(w.x,this._points[2].y);const e=w.y-v.y;if(T=(0,r.point)(v.x,R.y+e),x.fillBackground.value()){
|
|
const e=x.extendLeft.value(),t=x.extendRight.value();this._disjointChannelRenderer.setData({extendleft:e,extendright:t,points:[v,w,R,T],backcolor:x.backgroundColor.value(),transparency:x.transparency.value(),hittestOnBackground:s.CheckMobile.any()}),this._renderer.append(this._disjointChannelRenderer)}x.labelVisible.value()&&x.labelText.value()&&this._renderer.append(this._getLabelTextRenderer(v,w,T,R))}const m=(e,t)=>({points:[e,t],color:x.linecolor.value(),linewidth:x.linewidth.value(),linestyle:x.linestyle.value(),extendleft:x.extendLeft.value(),extendright:x.extendRight.value(),leftend:x.leftEnd.value(),rightend:x.rightEnd.value()}),b=(e,t,i,n,r,s)=>{x.showPrices.value()&&(e.setData({points:[i],text:r,color:x.textcolor.value(),horzAlign:i.x>n.x?o.HorizontalAlign.Left:o.HorizontalAlign.Right,vertAlign:o.VerticalAlign.Middle,font:u.CHART_FONT_FAMILY,offsetX:6,offsetY:0,boxPadding:0,bold:x.bold.value(),italic:x.italic.value(),fontsize:x.fontsize.value(),forceTextAlign:!0}),this._renderer.append(e),t.setData({points:[n],text:s,color:x.textcolor.value(),horzAlign:i.x<n.x?o.HorizontalAlign.Left:o.HorizontalAlign.Right,vertAlign:o.VerticalAlign.Middle,font:u.CHART_FONT_FAMILY,offsetX:6,offsetY:0,boxPadding:0,bold:x.bold.value(),italic:x.italic.value(),fontsize:x.fontsize.value(),forceTextAlign:!0}),this._renderer.append(t))};if(this._trendLineRendererPoints12.setData(m(v,w)),this._renderer.append(this._trendLineRendererPoints12),b(this._p1LabelRenderer,this._p2LabelRenderer,v,w,h,_),!R||!T)return void this.addAnchors(this._renderer);this._trendLineRendererPoints43.setData(m(T,R)),this._renderer.append(this._trendLineRendererPoints43),b(this._p3LabelRenderer,this._p4LabelRenderer,R,T,(0,n.ensureDefined)(f),(0,n.ensureDefined)(g));const y=[(0,p.lineSourcePaneViewPointToLineAnchorPoint)(v),(0,p.lineSourcePaneViewPointToLineAnchorPoint)(w),(0,p.lineSourcePaneViewPointToLineAnchorPoint)(R,2,c.PaneCursorType.VerticalResize,!0),(0,p.lineSourcePaneViewPointToLineAnchorPoint)(T,3)];this._model.lineBeingCreated()===this._source&&y.pop(),this._renderer.append(this.createLineAnchor({points:y},0)),v&&w&&this._addAlertRenderer(this._renderer,[v,w])}_getLabelTextRenderer(e,t,i,n){const r=this._source.properties().childs();let s,a;const l=r.labelFontSize.value()/3;let d=0;switch(r.labelVertAlign.value()){case o.VerticalAlign.Bottom:e.y<i.y?(s=e,a=t):(s=i,a=n);break;case o.VerticalAlign.Top:e.y>i.y?(s=e,a=t):(s=i,a=n);break;case o.VerticalAlign.Middle:s=e.add(i).scaled(.5),a=t.add(n).scaled(.5),d=l}const h=s.x<a.x?s:a,c=h===s?a:s;let p;switch(r.labelHorzAlign.value()){case o.HorizontalAlign.Left:p=h;break;case o.HorizontalAlign.Right:p=c;break;default:p=h.add(c).scaled(.5)}return this._labelTextRenderer.setData({points:[p],color:r.labelTextColor.value(),fontSize:r.labelFontSize.value(),text:r.labelText.value(),font:u.CHART_FONT_FAMILY,bold:r.labelBold.value(),italic:r.labelItalic.value(),vertAlign:r.labelVertAlign.value(),horzAlign:r.labelHorzAlign.value(),offsetX:0,offsetY:0,boxPaddingVert:l,boxPaddingHorz:d,forceTextAlign:!0,
|
|
angle:Math.atan((h.y-c.y)/(h.x-c.x))}),this._labelTextRenderer}}},98424:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ElliottLabelsPaneView:()=>v});var n=i(27916),r=i(95201),s=i(9859),o=i(19063),a=i(51056),l=i(56468),d=i(86441),h=i(34026),c=i(7114),u=i(68979);class p{constructor(e,t){this._data=e,this._hitTestResult=t}hitTest(e){const t=this._center(),i=this._data.circleRadius,n={min:new d.Point(t.x-i,t.y-i),max:new d.Point(t.x+i,t.y+i)};return(0,h.pointInBox)(e,n)?this._hitTestResult:null}draw(e,t){e.save();const{horizontalPixelRatio:i,verticalPixelRatio:n}=t,r=Math.max(1,Math.floor(i))%2/2,s=this._center(),o=Math.round(s.x*i)+r,a=Math.round(s.y*n)+r;if(this._data.showCircle){const t=Math.round(o+this._data.circleRadius*i)-o-this._data.circleBorderWidth*i/2;e.strokeStyle=this._data.color,e.lineWidth=this._data.circleBorderWidth*i,e.beginPath(),e.moveTo(o+t,a),e.arc(o,a,t,0,2*Math.PI,!1),e.stroke()}e.font=(0,u.makeFont)(this._data.fontSize,this._data.font,this._data.bold?"bold":void 0),e.textBaseline="middle",e.textAlign="center",e.fillStyle=this._data.color,(0,c.drawScaled)(e,i,n,(()=>{e.fillText(this._data.letter,o/i,a/n+.05*this._data.fontSize)})),e.restore()}_center(){const e="bottom"===this._data.vertAlign?-1:1,t=this._data.point.y+e*this._data.yOffset+e*this._data.circleRadius,i=this._data.point.x;return new d.Point(i,t)}}var _=i(15938),f=i(36036),g=i(74011);const x={4:{font:24,circle:36,circleBorderWidth:1,bold:!0},3:{font:20,circle:28,circleBorderWidth:1,bold:!1},2:{font:18,circle:22,circleBorderWidth:1,bold:!1},1:{font:16,circle:22,circleBorderWidth:1,bold:!1},0:{font:11,circle:14,circleBorderWidth:1,bold:!0}};class v extends n.LineSourcePaneView{constructor(e,t){super(e,t),this._renderer=null,this._polylineRenderer=new g.PolygonRenderer}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer=null;const t=this._source.properties().childs(),i=this._source.priceScale(),n=this._model.timeScale(),d=this._source.ownerSource()?.firstValue();if(!i||i.isEmpty()||n.isEmpty()||null==d)return;const h=new r.CompositeRenderer;if(t.showWave.value()){const e={points:this._points,color:(0,o.generateColor)(t.color.value(),0),linewidth:t.linewidth.value(),linestyle:a.LINESTYLE_SOLID,fillBackground:!1,filled:!1,backcolor:"rgba(0, 0, 0, 0)",linejoin:"round"};this._polylineRenderer.setData(e),h.append(this._polylineRenderer)}const c=this.areAnchorsVisible()?0:1;let u=1;if(this._points.length>2){const e=this._points[2],t=this._points[1];u=(0,s.sign)(e.y-t.y)}let g=0;this._model.lineBeingCreated()===this._source&&(g=1);const v=(0,o.resetTransparency)(t.color.value());for(let e=0;e<this._points.length-g;e++,u=-u){if(e<c)continue;const t=this._source.label(e);let i=t.label;const n="circle"===t.decoration;"brackets"===t.decoration&&(i="("+i+")");const r=x[t.group],s=new l.HitTestResult(l.HitTarget.ChangePoint,{pointIndex:e});h.append(new p({point:this._points[e],letter:i,color:v,font:_.CHART_FONT_FAMILY,fontSize:r.font,bold:r.bold,showCircle:n,circleRadius:r.circle/2,
|
|
circleBorderWidth:r.circleBorderWidth,yOffset:10,vertAlign:1===u?"top":"bottom"},s))}const w=this._points.map(((e,t)=>(0,f.lineSourcePaneViewPointToLineAnchorPoint)(e,t)));this._model.lineBeingCreated()===this._source&&w.pop(),h.append(this.createLineAnchor({points:w},0)),this._renderer=h}}},75649:(e,t,i)=>{"use strict";i.r(t),i.d(t,{EllipsePaneView:()=>R});var n=i(4652),r=i(86441),s=i(5531),o=i(30699),a=i(19063),l=i(15938),d=i(95201),h=i(56468),c=i(13075),u=i(36036),p=i(27916),_=i(32211),f=i(62689),g=i(25422),x=i(75919),v=i(61993);class w extends x.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data={...e,angleFrom:0,angleTo:2*Math.PI,clockwise:!1}}hitTest(e){if(null===this._data||this._data.points.length<3)return null;const t=this._data.points[0],i=this._data.points[1];let s=this._data.points[2];const o=(0,n.distanceToLine)(t,i,s).distance,a=i.subtract(t),l=t.add(i).scaled(.5),d=new r.Point(-a.y,a.x).normalized();s=l.add(d.scaled(o));const c=a.length(),u=a.x/c,p=a.y/c;let _=Math.acos(u);p<0&&(_=-_);let f=(0,g.translationMatrix)(-l.x,-l.y);e=(0,g.transformPoint)(f,e);let x=(0,g.transformPoint)(f,this._data.points[2]);f=(0,g.rotationMatrix)(-_),e=(0,g.transformPoint)(f,e),x=(0,g.transformPoint)(f,x),f=(0,g.scalingMatrix)(1,c/(2*o)),e=(0,g.transformPoint)(f,e),x=(0,g.transformPoint)(f,x);const w=e.length(),R=(0,v.interactionTolerance)().curve;return Math.abs(w-.5*c)<=R?new h.HitTestResult(h.HitTarget.MovePoint):!this._data.noHitTestOnBackground&&w<=.5*c?new h.HitTestResult(this._data.backgroundHitTarget??h.HitTarget.MovePointBackground):null}_drawImpl(e){if(null===this._data||this._data.points.length<2)return;const t=this._data.points[0],i=this._data.points[1],s=e.context;if(this._data.points.length<3)return s.strokeStyle=this._data.color,s.lineWidth=this._data.linewidth,s.beginPath(),s.moveTo(t.x,t.y),s.lineTo(i.x,i.y),void s.stroke();let o=this._data.points[2];const a=(0,n.distanceToLine)(t,i,o).distance;if(a<1)return s.strokeStyle=this._data.color,s.lineWidth=this._data.linewidth,s.beginPath(),s.moveTo(t.x,t.y),s.lineTo(i.x,i.y),void s.stroke();const l=i.subtract(t),d=t.add(i).scaled(.5),h=new r.Point(-l.y,l.x).normalized();o=d.add(h.scaled(a)),s.strokeStyle=this._data.color,s.lineWidth=this._data.linewidth;const c=l.length(),u=l.x/c,p=l.y/c;let _=Math.acos(u);p<0&&(_=-_);let f=this._data.points[2],x=(0,g.translationMatrix)(-d.x,-d.y);f=(0,g.transformPoint)(x,f),x=(0,g.rotationMatrix)(-_),f=(0,g.transformPoint)(x,f),x=(0,g.scalingMatrix)(1,c/(2*a)),f=(0,g.transformPoint)(x,f),f.y<0?this._data.clockwise=!0:this._data.clockwise=!1,s.save(),s.beginPath(),s.translate(d.x,d.y),s.rotate(_),s.scale(1,2*a/c),s.arc(0,0,.5*c,this._data.angleFrom,this._data.angleTo,this._data.clockwise),s.restore(),s.stroke(),s.fillStyle=this._data.backcolor,s.fill()}}class R extends _.InplaceTextLineSourcePaneView{constructor(e,t,i,n,r){super(e,t,i,n,r),this._ellipseRenderer=new w,this._renderer=null,
|
|
this._textRenderer=new f.LineToolTextRenderer(void 0,new h.HitTestResult(h.HitTarget.MovePoint,(0,_.inplaceEditHandlers)(this._tryActivateEditMode.bind(this,null)))),this._source.setAdditionalCursorData((()=>({color:this._source.editableTextStyle().cursorColor,rotationPoint:this._textRenderer.rotation()??void 0,...this._textRenderer.getTextInfo()})),this._textRenderer.positionToCoordinate.bind(this._textRenderer))}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer=null,this._points.length<2)return;const t=this._source.properties().childs(),i={points:this._points,color:t.color.value(),linewidth:t.linewidth.value(),backcolor:t.fillBackground.value()?(0,a.generateColor)(t.backgroundColor.value(),t.transparency.value()):"transparent",noHitTestOnBackground:!1,backgroundHitTarget:this._model.selection().isSelected(this._source)?h.HitTarget.MovePoint:void 0};this._ellipseRenderer.setData(i);const s=new d.CompositeRenderer;s.append(this._ellipseRenderer);const o=i.points[0],l=i.points[1];if(2===this._points.length)return this.addAnchors(s),void(this._renderer=s);let c=i.points[2];const _=(0,n.distanceToLine)(o,l,c).distance,f=l.subtract(o),g=o.add(l).scaled(.5),x=new r.Point(-f.y,f.x).normalized();c=g.add(x.scaled(_));const v=g.add(x.scaled(-_)),w=this._placeHolderMode();(t.showLabel.value()&&t.text.value()||w||this._isTextEditMode())&&this._updateTextRenderer([o,l,c,v],w,e)&&s.append(this._textRenderer);const R=(0,p.thirdPointCursorType)(o,l),T=[(0,u.lineSourcePaneViewPointToLineAnchorPoint)(o,0),(0,u.lineSourcePaneViewPointToLineAnchorPoint)(l,1),(0,u.lineSourcePaneViewPointToLineAnchorPoint)(c,2,R),(0,u.lineSourcePaneViewPointToLineAnchorPoint)(v,3,R)];s.append(this.createLineAnchor({points:T},0)),this._renderer=s}_updateTextRenderer([e,t,i,n],a,d){if(t.subtract(e).length()<1e-5||n.subtract(i).length()<1e-5)return!1;const h=(0,s.intersectLines)((0,r.lineThroughPoints)(e,t),(0,r.lineThroughPoints)(i,n));if(!h)return!1;const{fontSize:u,bold:p,italic:_}=this._source.properties().childs(),f=Math.sqrt(2),g=e.subtract(t).length()/f;if(this._textRenderer.setData({points:[h],text:this._textData(),color:this._textColor(),fontSize:u.value(),font:l.CHART_FONT_FAMILY,bold:p.value(),italic:_.value(),wordWrapWidth:a?void 0:g,maxHeight:a?void 0:n.subtract(i).length()/f,angle:Math.atan((e.y-t.y)/(e.x-t.x)),offsetX:0,offsetY:0,horzAlign:o.HorizontalAlign.Center,vertAlign:o.VerticalAlign.Middle,forceTextAlign:!0,decorator:a?c.PlusTextRendererDecorator.instance():void 0,...this._inplaceTextHighlight()}),a&&this._textRenderer.measure().width>g&&(this._textRenderer.updateData({text:""}),this._textRenderer.measure().width>g))return!1;this._textRenderer.setCursorType(this._textCursorType());const{mediaSize:{width:x,height:v}}=d;return this._textRenderer.isOutOfScreen(x,v)?this.closeTextEditor():this._updateInplaceText(this._textRenderer.getTextInfo()),!0}}},98633:(e,t,i)=>{"use strict";i.r(t),i.d(t,{EmojiPaneView:()=>r});var n=i(68498);class r extends n.SvgIconPaneView{
|
|
_iconColor(){return null}}},256:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ExecutionPaneView:()=>h});var n,r=i(86441),s=i(27916),o=i(56468),a=i(75919);!function(e){e[e.ArrowWidth=4]="ArrowWidth"}(n||(n={}));class l extends a.MediaCoordinatesPaneRenderer{constructor(e){super(),this._data=e??null}hitTest(e){if(null===this._data)return null;const t=Math.round(this._data.point.x),i=Math.round(this._data.point.y),n=this._data.arrowHeight;let r,s;if("buy"===this._data.direction?(r=i,s=i+n):(r=i-n,s=i),e.x>=t-2&&e.x<=t+2&&e.y>=r&&e.y<=s){const e=this._data.tooltip;return new o.HitTestResult(o.HitTarget.Custom,{tooltip:""!==e?{text:e,rect:{x:t,y:r,w:2,h:s-r}}:void 0})}return null}setData(e){this._data=e}_drawImpl(e){const t=e.context;if(null===this._data)return;const i=Math.round(this._data.point.x),n=Math.round(this._data.point.y);!function(e,t,i,n,r,s){e.save(),e.strokeStyle=n,e.fillStyle=n,e.translate(t-2,i),"buy"!==r&&(e.rotate(Math.PI),e.translate(-4,0)),e.beginPath(),e.moveTo(2,s),e.lineTo(2,0),e.moveTo(0,2),e.lineTo(2,0),e.lineTo(4,2),e.stroke(),e.restore()}(t,i,n,this._data.arrowColor,this._data.direction,this._data.arrowHeight);const{arrowHeight:r,arrowSpacing:s,fontHeight:o,direction:a,text:l,font:d,textColor:h}=this._data,c=function(e,t,i){if(0===t.length)return 0;e.save(),e.font=i;const n=e.measureText(t).width;return e.restore(),5+n}(t,l,d);if(0!==c){const e="buy"===a?n+r+s:n-r-s-o;!function(e,t,i,n,r,s,o,a){if(!s)return;e.save(),e.textAlign="center",e.textBaseline="middle",e.font=o,e.fillStyle=a;const l=t+n/2,d=i+r/2;e.fillText(s,l,d-1),e.restore()}(t,Math.round(i+.5-c/2),e,c,o,l,d,h)}}}var d=i(91920);class h extends s.LineSourcePaneView{constructor(){super(...arguments),this._executionRenderer=new l,this._renderer=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer=null;const t=this._source,i=t.points();if(0===i.length)return;const n=t.adapter(),s=t.model().timeScale(),o=t.model().paneForSource(t)?.executionsPositionController();if(!o)return;const a=o.getXYCoordinate(n,s,i[0].index);!isFinite(a.y)||a.y<0||a.y>e.mediaSize.height||a.x<0||(this._executionRenderer.setData({point:new r.Point(a.x,a.y),arrowColor:n.getArrowColor(),arrowHeight:n.getArrowHeight(),direction:n.getDirection(),tooltip:n.getTooltip(),arrowSpacing:n.getArrowSpacing(),fontHeight:d.fontHeight(n.getFont()),text:n.getText(),textColor:n.getTextColor(),font:n.getFont()}),this._renderer=this._executionRenderer)}}},23033:(e,t,i)=>{"use strict";i.d(t,{FibHorizontalLevelsPaneViewBase:()=>A});var n=i(50151),r=i(86441),s=i(11542),o=i(30699),a=i(69186),l=i(91046),d=i(17330),h=i(13075);class c{geometry(e){const t=(0,d.fontSize)(e);return{decoratorAndTextMargin:t/3,width:Math.round(t/8),ignoreRtl:!0}}draw(e,t,i,n){const{horizontalPixelRatio:r,verticalPixelRatio:s}=t,o=Math.max(1,Math.round(r*n.decoratorWidth/2)),a=Math.round((n.textTop+n.textBottom)/2*s),l=Math.round((n.decoratorLeft+n.decoratorWidth/2)*r);e.fillStyle=i.color,e.beginPath(),e.arc(l,a,o,0,2*Math.PI),e.fill()}
|
|
static instance(){return this._instance=this._instance??new c,this._instance}}c._instance=null;var u,p=i(56468),_=i(95201),f=i(49857),g=i(72609),x=i(9859);function v(e,t,i,n){if(null!==e&&t===o.VerticalAlign.Middle){const t=(0,d.getTextBoundaries)(e,i,n);if(t)return[t]}return[]}function w(e){return"left"===e?0:"center"===e?1:2}function R(e){const{labelAndTextHaveSameAlign:t,labelAndTextHaveSameVertAlign:i,labelRenderer:s,textRenderer:o,horzTextAlign:a,horzLabelsAlign:l,textMaxWidth:d}=e;if(t)return function(e){const{labelRenderer:t,textRenderer:i,horzTextAlign:n,textMaxWidth:s,extendLeft:o,extendRight:a}=e,l=T(t),d=T(i);switch(n){case"left":o?m(l,d):b(l,d);break;case"center":if(y(d,s))return{hideText:!0};!function(e,t,i,n){const s=i-n/2,o=e?.rect.width,a=t?.rect.width;e&&e.renderer.setPoint((0,r.point)(s+o/2,e.point.y));t&&t.renderer.setPoint((0,r.point)(s+o+a/2,t.point.y))}(l,d,l.rect.x+l.rect.width/2,l.rect.width+d.rect.width);break;case"right":a?b(l,d):m(l,d)}return{hideText:!1}}(e);if(null!==d){if(y(T(o),d))return{hideText:!0}}if(i){const e=s.rect(),t=o.rect(),i=(0,n.ensureNotNull)(o.point());if(w(a)<w(l)){const n=t.x+t.width+g.labelEdgeOffset-e.x;n>0&&o.setPoint((0,r.point)(i.x-n,i.y))}else{const n=e.x+e.width+g.labelEdgeOffset-t.x;n>0&&o.setPoint((0,r.point)(i.x+n,i.y))}}return{hideText:!1}}function T(e){return{renderer:e,rect:e.rect(),point:(0,n.ensureNotNull)(e.point()),horzAlign:(0,n.ensureNotNull)(e.data()).horzAlign}}function m(e,t){var i,n;t.renderer.setPoint((0,r.point)(e.rect.x+e.rect.width+(i=t.horzAlign,n=t.rect.width,"right"===i?n:0),t.point.y),0)}function b(e,t){var i,n;e.renderer.setPoint((0,r.point)(t.rect.x-(i=e.horzAlign,n=e.rect.width,"left"===i?n:0),e.point.y),0)}function y(e,t){return null!==t&&(e.rect.width>t&&(e.renderer.setData({...(0,n.ensureNotNull)(e.renderer.data()),text:""}),e.rect=e.renderer.rect(),e.rect.width>t))}function P(e){const{leftAnchorX:t,rightAnchorX:i,extendLeft:n,extendRight:r,screenWidth:s,labelRenderer:o,horzLabelsAlign:a,labelAndTextHaveSameVertAlign:l}=e;let d;const h=l?function(e,t){return e?(0,x.clamp)(e.x+e.width,0,t)-(0,x.clamp)(e.x,0,t):0}(o?.rect(),s):0;return d=n||r?n&&r?s-h:n?i-("left"===a?h:0):s-t-("right"===a?h:0):i-t-("center"===a?h:0),d-8}!function(e){e[e.LevelHitTestTolerance=4]="LevelHitTestTolerance",e[e.CenterTextMinHorzMargins=4]="CenterTextMinHorzMargins"}(u||(u={}));const L=s.t(null,void 0,i(6060));function S(e){if(!e)return;const t=(0,n.ensureNotNull)(e.data()),i=t.vertAlign;if("middle"!==i){const s=(0,n.ensureDefined)(t.points)[0],a=("top"===i?1:-1)*((0,d.fontSize)(t)+(0,d.lineSpacing)(t));e.setData({...t,vertAlign:o.VerticalAlign.Middle,points:[(0,r.point)(s.x,s.y+a)]})}}const C=[o.HorizontalAlign.Center,o.VerticalAlign.Middle];class A extends g.LineToolPaneViewFibWithLabels{constructor(){super(...arguments),this._renderer=new _.CompositeRenderer,this._levelLineRenderers=new Map,this._lastEditableLevelIndex=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateTextWasEditable(){
|
|
const e=this._isTextEditMode()?this._inplaceEditLevelIndex:null;null!==e&&this._lastEditableLevelIndex===e?super._updateTextWasEditable():this._lastEditableLevelIndex=e}_addLevels(e){const{mediaSize:t,levels:i,showLabel:s,showText:o,labelAlign:d,textAlign:u,extendLeft:_,extendRight:g,isOnScreen:x,trendLineRenderer:w}=e;let{left:T,right:m}=e;T===m&&(_&&(T-=1),g&&(m+=1));const{width:b,height:y}=t,A=this._model.hoveredSource()===this._source?this._model.lastHittestData()?.activeItem:null,M=[],I=[],k=this._model.selection().isSelected(this._source),H=this._textCursorType(),[B,D]=d;for(const e of i){const t=new r.Point(T,e.y),i=new r.Point(m,e.y),d=Boolean(e.text),w=this._isTextEditMode()&&this._inplaceEditLevelIndex===e.index,z=!d&&!w,[E,V]=z?C:u,N=B===E&&D===V,W={levelIndex:e.index,leftPoint:t,rightPoint:i,color:e.color,extendLeft:_,extendRight:g},O=e.index===A;let F,Y=null;const q=o&&(d||O&&k||w),X=q&&!d&&!w;!q||X&&(0,a.lastMouseOrTouchEventInfo)().isTouch||(F=X?h.PlusTextRendererDecorator.instance():s&&N?c.instance():void 0,Y=(0,n.ensureDefined)(this._textRenderers[e.index]),this._updateRendererLabel({...W,...w?this._inplaceTextHighlight():{},horzAlign:E,vertAlign:V,color:w?this._textColor():W.color,decorator:F},Y,w?this._textData():e.text||L),Y.setCursorType(H));const j=F===c.instance(),Q=this._updateLabelForLevel({...W,price:e.price,horzAlign:B,vertAlign:D,boxPaddingRight:j?0:void 0});let U=!1;if(null!==Y&&null!==Q){const e=D===V;U=R({labelRenderer:Q,textRenderer:Y,labelAndTextHaveSameAlign:N,labelAndTextHaveSameVertAlign:e,horzTextAlign:E,horzLabelsAlign:B,textMaxWidth:X?P({leftAnchorX:T,rightAnchorX:m,extendLeft:_,extendRight:g,screenWidth:b,horzLabelsAlign:B,labelRenderer:Q,labelAndTextHaveSameVertAlign:e}):null,extendLeft:_,extendRight:g}).hideText}if(x){S(Y),S(Q);if(!(!_&&!g&&(Y&&"center"===E&&"middle"===V&&m-4<Y.rect().x+Y.rect().width||Q&&"center"===B&&"middle"===D&&T+4>Q.rect().x))){const r=[...v(Q,D,b,y),...v(U?null:Y,V,b,y)],s={points:[t,i],color:e.color,linewidth:e.linewidth,linestyle:e.linestyle,extendleft:_,extendright:g,leftend:f.LineEnd.Normal,rightend:f.LineEnd.Normal,excludeBoundaries:r,hitTestTolerance:4},o=(0,n.ensureDefined)(this._levelLineRenderers.has(e.index)?this._levelLineRenderers.get(e.index):this._levelLineRenderers.set(e.index,new l.TrendLineRenderer).get(e.index));o.setData(s),o.setHitTest(new p.HitTestResult(p.HitTarget.MovePoint,{snappingPrice:e.price,activeItem:e.index},e.index)),M.push(o)}}null===Q||Q.isOutOfScreen(b,y)||I.push(Q),U||null===Y||Y.isOutOfScreen(b,y)||I.push(Y)}for(const e of M)this._renderer.append(e);w&&this._renderer.append(w);for(const e of I)this._renderer.append(e);if(this._isTextEditMode()){const e=(0,n.ensureDefined)(this._textRenderers[this._inplaceEditLevelIndex]);e.isOutOfScreen(b,y)?this.closeTextEditor():this._updateInplaceText(e.getTextInfo())}}}},72609:(e,t,i)=>{"use strict";i.d(t,{LineToolPaneViewFibWithLabels:()=>c,labelEdgeOffset:()=>h});var n=i(50151),r=i(17330),s=i(56468),o=i(74079),a=i(15938),l=i(32211),d=i(62689);const h=4
|
|
;class c extends l.InplaceTextLineSourcePaneView{constructor(e,t,i,a,h){super(e,t,i,a,h),this._labelsRenderers={},this._numericFormatter=(0,o.getNumericFormatter)(),this._percentageFormatter=(0,o.getPercentageFormatter)(),this._textRenderers={},this._inplaceEditLevelIndex=1;for(let t=1;t<=e.levelsCount();t++)this._labelsRenderers[t]=new r.TextRenderer(void 0,new s.HitTestResult(s.HitTarget.MovePoint,{activeItem:t}));if(i&&a&&h){for(let t=1;t<=e.levelsCount();t++){const e=new s.HitTestResult(s.HitTarget.MovePoint,{...(0,l.inplaceEditHandlers)(this._tryActivateEditMode.bind(this,t)),activeItem:t});this._textRenderers[t]=new d.LineToolTextRenderer(void 0,e)}this._source.setAdditionalCursorData((()=>{const e=(0,n.ensureDefined)(this._textRenderers[this._inplaceEditLevelIndex]);return{color:this._source.editableTextStyle().cursorColor,...e.getTextInfo()}}),(e=>(0,n.ensureDefined)(this._textRenderers[this._inplaceEditLevelIndex]).positionToCoordinate(e)))}}_tryActivateEditMode(e,t){this._inplaceEditLevelIndex=e,super._tryActivateEditMode(e,t)}_activateEditMode(e){const t=(0,n.ensureDefined)(this._textRenderers[this._inplaceEditLevelIndex]);this._updateInplaceText(t.getTextInfo()),super._activateEditMode(e)}_updateLabelForLevel(e){const t=this._labelsRenderers[e.levelIndex];if(void 0===t)return null;const i=this._source.priceScale();if(!i)return null;const n=this._source.ownerSource()?.firstValue();if(null==n)return null;const r=this._source.properties(),s=Boolean(r.showCoeffs?.value()),o=Boolean(r.showPrices?.value());if(!s&&!o)return null;const a=r["level"+e.levelIndex].coeff.value();let l="";if(s){l+=r.coeffsAsPercents?.value()??!1?this._percentageFormatter.format(100*a,{signPositive:!1,tailSize:2}):this._numericFormatter.format(a)}return o&&(l+=" ("+i.formatPrice(e.price,n)+")"),this._updateRendererLabel(e,t,l),t}_updateRendererLabel(e,t,i){if(!i&&void 0===e.decorator)return null;const{leftPoint:n,rightPoint:s,horzAlign:o,extendLeft:l,extendRight:d,...c}=e,u=this._source.properties(),[p,_]=(0,r.getTextAlignInBox)({horzAlign:o,extendLeft:l,extendRight:d,width:this._model.timeScale().width(),leftPoint:n,rightPoint:s});return t.setData({points:[p],text:i,horzAlign:_,offsetX:h,offsetY:0,font:a.CHART_FONT_FAMILY,fontSize:u.labelFontSize?.value()??12,...c}),t}}},93143:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FibChannelPaneView:()=>u});var n=i(50151),r=i(19063),s=i(49857),o=i(95201),a=i(93610),l=i(91046),d=i(72609),h=i(17330);class c extends a.ParallelChannelRenderer{constructor(){super(...arguments),this._data=null}_drawLine(e,t,i){const{context:n,bitmapSize:r}=e,s=this._data?.excludeBoundaries;if(void 0!==s){n.save(),n.beginPath(),n.rect(0,0,r.width,r.height);for(let t=0;t<s.length;t++){const{x:i,y:r}=s[t];0!==t?n.lineTo(i*e.horizontalPixelRatio,r*e.verticalPixelRatio):n.moveTo(i*e.horizontalPixelRatio,r*e.verticalPixelRatio)}n.closePath(),n.clip("evenodd")}super._drawLine(e,t,i),void 0!==s&&n.restore()}}class u extends d.LineToolPaneViewFibWithLabels{constructor(){super(...arguments),
|
|
this._baseLineRenderer=new l.TrendLineRenderer,this._lastLevelTrendRenderer=new l.TrendLineRenderer,this._renderer=null,this._norm=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e);const t=this._source.priceScale();if(null===t)return;this._renderer=null;const i=this._source.ownerSource()?.firstValue();if(null==i)return;3===this._points.length&&3===this._source.points().length&&(this._norm=this._points[2].subtract(this._points[0]));const a=new o.CompositeRenderer;if(this._points.length<2)return this.addAnchors(a),void(this._renderer=a);const l=this._source.properties().childs(),d=this._points[0],u=this._points[1];if(this._points.length<3){const e={points:[d,u],color:l.level1.childs().color.value(),linewidth:l.levelsStyle.childs().linewidth.value(),linestyle:l.levelsStyle.childs().linestyle.value(),extendleft:l.extendLeft.value(),extendright:l.extendRight.value(),leftend:s.LineEnd.Normal,rightend:s.LineEnd.Normal};return this._baseLineRenderer.setData(e),a.append(this._baseLineRenderer),this.addAnchors(a),void(this._renderer=a)}const p=this._source.levelsCount(),_=(0,n.ensureNotNull)(this._norm),{mediaSize:{width:f,height:g}}=e;for(let e=1;e<p;e++){const s=(0,n.ensureDefined)(this._source.properties().child("level"+e)).childs();if(!s.visible.value())continue;let o=null;for(let t=e+1;t<=p;t++){const e=(0,n.ensureDefined)(this._source.properties().child("level"+t)).childs();if(e.visible.value()){o=e;break}}if(!o)break;const x=_.scaled(s.coeff.value()),v=d.add(x),w=u.add(x),R=_.scaled(o.coeff.value()),T=d.add(R),m=u.add(R),b=s.color.value(),y=l.extendLeft.value(),P=l.extendRight.value(),L=l.levelsStyle.childs().linestyle.value(),S=l.levelsStyle.childs().linewidth.value(),C=t.coordinateToPrice(v.y,i),A=this._updateLabelForLevel({levelIndex:e,leftPoint:v,rightPoint:w,price:C,color:b,horzAlign:l.horzLabelsAlign.value(),vertAlign:l.vertLabelsAlign.value()});let M;null!==A&&(a.append(A),M=(0,h.getTextBoundaries)(A,f,g)??void 0);const I={line1:{color:b,lineStyle:L,lineWidth:S,points:[v,w]},line2:{color:b,lineStyle:L,lineWidth:S,points:[T,m]},extendLeft:y,extendRight:P,backColor:(0,r.generateColor)(b,l.transparency.value(),!0),skipTopLine:!0,fillBackground:l.fillBackground.value(),hittestOnBackground:!0,excludeBoundaries:M},k=new c;k.setData(I),a.append(k)}let x=null;for(let e=p;e>=1;e--){if((0,n.ensureDefined)(this._source.properties().child("level"+e)).childs().visible.value()){x=e;break}}if(null!==x){const e=(0,n.ensureDefined)(this._source.properties().child("level"+x)).childs();if(e.visible.value()){const n=_.scaled(e.coeff.value()),r=d.add(n),o=u.add(n),c=t.coordinateToPrice(r.y,i),p=this._updateLabelForLevel({levelIndex:x,leftPoint:r,rightPoint:o,price:c,color:e.color.value(),horzAlign:l.horzLabelsAlign.value(),vertAlign:l.vertLabelsAlign.value()});let v;null!==p&&(a.append(p),v=(0,h.getTextBoundaries)(p,f,g)??void 0);const w={points:[r,o],color:e.color.value(),linewidth:l.levelsStyle.childs().linewidth.value(),
|
|
linestyle:l.levelsStyle.childs().linestyle.value(),extendleft:l.extendLeft.value(),extendright:l.extendRight.value(),leftend:s.LineEnd.Normal,rightend:s.LineEnd.Normal,excludeBoundaries:v?[v]:void 0};this._lastLevelTrendRenderer.setData(w),a.append(this._lastLevelTrendRenderer)}}this.addAnchors(a),this._renderer=a}}},83201:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FibCirclesPaneView:()=>u});var n=i(50151),r=i(86441),s=i(30699),o=i(72609),a=i(91046),l=i(56468),d=i(95201),h=i(36155),c=i(49857);class u extends o.LineToolPaneViewFibWithLabels{constructor(){super(...arguments),this._trendLineRenderer=new a.TrendLineRenderer,this._renderer=new d.CompositeRenderer}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer.clear(),this._source.points().length<2||this._points.length<2)return;const t=this._source.priceScale();if(!t||t.isEmpty()||this._model.timeScale().isEmpty())return;const[i,o]=this._points,a=i.add(o).scaled(.5),d=Math.abs(o.x-i.x),u=Math.abs(o.y-i.y),p=[],_=this._source.properties(),f=this._source.levelsCount();for(let e=1;e<=f;e++){const t=(0,n.ensureDefined)(_.child(`level${e}`)).childs();if(!t.visible.value())continue;const i=t.coeff.value(),s=t.color.value(),o=[];o.push(new r.Point(a.x-.5*d*i,a.y-.5*u*i)),o.push(new r.Point(a.x+.5*d*i,a.y+.5*u*i));const l=new r.Point(a.x,a.y+.5*u*i);p.push({color:s,points:o,labelPoint:l,linewidth:t.linewidth.value(),linestyle:t.linestyle.value(),index:e})}const g=_.childs().fillBackground.value(),x=_.childs().transparency.value();for(let e=0;e<p.length;e++){const t=p[e];this._renderer.append(new h.EllipseRendererSimple({points:t.points,color:t.color,linewidth:t.linewidth,backcolor:t.color,wholePoints:e>0?p[e-1].points:void 0,fillBackground:g,transparency:x},new l.HitTestResult(l.HitTarget.MovePoint,void 0,t.index)));const i=this._updateLabelForLevel({levelIndex:t.index,color:t.color,price:0,vertAlign:s.VerticalAlign.Middle,horzAlign:s.HorizontalAlign.Left,leftPoint:t.labelPoint,rightPoint:t.labelPoint});null!==i&&this._renderer.append(i)}const v=_.childs().trendline.childs();v.visible.value()&&(this._trendLineRenderer.setData({points:[this._points[0],this._points[1]],color:v.color.value(),linewidth:v.linewidth.value(),linestyle:v.linestyle.value(),extendleft:!1,extendright:!1,leftend:c.LineEnd.Normal,rightend:c.LineEnd.Normal}),this._renderer.append(this._trendLineRenderer)),this.addAnchors(this._renderer)}}},70011:(e,t,i)=>{"use strict";i.d(t,{fibLevelCoordinate:()=>r,fibLevelPrice:()=>s});var n=i(50151);function r(e,t,i,r,s,o){if(o)return Math.round((0,n.ensureDefined)(e.coordinate)+(0,n.ensureDefined)(t.coordinate)*i);const a=e.price+t.price*i;return r.priceToCoordinate(a,s)}function s(e,t,i,r,s,o){if(!o)return e.price+t.price*i;const a=(0,n.ensureDefined)(e.coordinate)+(0,n.ensureDefined)(t.coordinate)*i;return r.coordinateToPrice(a,s)}},65343:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FibRetracementPaneView:()=>d});var n=i(86441),r=i(62189),s=i(91046),o=i(49857),a=i(70011),l=i(23033)
|
|
;class d extends l.FibHorizontalLevelsPaneViewBase{constructor(){super(...arguments),this._trendLineRenderer=new s.TrendLineRenderer,this._levels=[]}_tryActivateEditMode(e,t){super._tryActivateEditMode(e,t),this._source.setInplaceEditLevelIndex(e)}_updateImpl(e){if(super._updateImpl(e),this._renderer.clear(),this._source.points().length<2)return;const t=this._source.priceScale();if(!t||t.isEmpty()||this._model.timeScale().isEmpty())return;const i=this._source.ownerSource()?.firstValue();if(null==i)return;const[s,l]=this._source.points(),d=this._source.properties().childs(),h=d.reverse.value();if(this._points.length<2)return;const c=this._points[0],u=this._points[1],p=Math.min(c.x,u.x),_=Math.max(c.x,u.x),f=d.fillBackground.value(),g=d.transparency.value(),x=d.extendLinesLeft.value(),v=d.extendLines.value(),w=t.isLog()&&d.fibLevelsBasedOnLogScale.value(),{mediaSize:{width:R}}=e,T=!(p>R&&!x||_<0&&!v);this._levels=[];const m=h?s.price:l.price,b=h?l.price:s.price,y=b-m,P=t.priceToCoordinate(m,i),L={price:m,coordinate:P},S={price:y,coordinate:t.priceToCoordinate(b,i)-P},C=this._source.levelsCount();for(let e=1;e<=C;e++){const n=d["level"+e].childs();if(!n||!n.visible.value())continue;const r=n.coeff.value(),s=(0,a.fibLevelCoordinate)(L,S,r,t,i,w),o=(0,a.fibLevelPrice)(L,S,r,t,i,w);this._levels.push({color:n.color.value(),text:n.text.value(),y:s,price:o,linewidth:d.levelsStyle.childs().linewidth.value(),linestyle:d.levelsStyle.childs().linestyle.value(),index:e})}if(f&&T)for(let e=0;e<this._levels.length;e++)if(e>0&&f){const t=this._levels[e-1],i={points:[new n.Point(p,this._levels[e].y),new n.Point(_,t.y)],color:this._levels[e].color,linewidth:0,backcolor:this._levels[e].color,fillBackground:!0,transparency:g,extendLeft:x,extendRight:v},s=new r.RectangleRenderer(!0);s.setData(i),this._renderer.append(s)}let A=p,M=_;A===M&&(x&&(A-=1),v&&(M+=1));const I=d.trendline.childs();let k=null;I.visible.value()&&T&&(k=this._trendLineRenderer,k.setData({points:[this._points[0],this._points[1]],color:I.color.value(),linewidth:I.linewidth.value(),linestyle:I.linestyle.value(),extendleft:!1,extendright:!1,leftend:o.LineEnd.Normal,rightend:o.LineEnd.Normal})),this._addLevels({mediaSize:e.mediaSize,levels:this._levels,left:A,right:M,showLabel:d.showCoeffs.value()||d.showPrices.value(),showText:d.showText.value(),labelAlign:[d.horzLabelsAlign.value(),d.vertLabelsAlign.value()],textAlign:[d.horzTextAlign.value(),d.vertTextAlign.value()],extendLeft:x,extendRight:v,fontSize:d.labelFontSize.value(),isOnScreen:T,trendLineRenderer:k}),this.addAnchors(this._renderer),this._model.selection().isSelected(this._source)||this.closeTextEditor()}}},66152:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FibSpeedResistanceArcsPaneView:()=>g});var n=i(50151),r=i(86441),s=i(30699),o=i(9859),a=i(56468),l=i(95201),d=i(49857),h=i(91046),c=i(72609),u=i(19063),p=i(61993),_=i(75919);class f extends _.MediaCoordinatesPaneRenderer{constructor(e,t,i){super(),this._data=e,this._hittest=t||new a.HitTestResult(a.HitTarget.MovePoint),
|
|
this._backHittest=i||new a.HitTestResult(a.HitTarget.MovePointBackground)}hitTest(e){const t=this._data;if(null===t)return null;if((0,o.sign)(e.y-t.center.y)!==t.dir&&!t.fullCircles)return null;const i=e.subtract(t.center).length(),n=(0,p.interactionTolerance)().curve;return Math.abs(i-t.radius)<n?this._hittest:t.hittestOnBackground&&Math.abs(i)<=t.radius+n?this._backHittest:null}_drawImpl(e){const t=this._data;if(null===t)return;const i=e.context;i.lineCap="round",i.strokeStyle=t.color,i.lineWidth=t.linewidth,i.translate(t.center.x,t.center.y),i.beginPath(),t.fullCircles?i.arc(0,0,t.radius,2*Math.PI,0,!1):t.dir>0?i.arc(0,0,t.radius,0,Math.PI,!1):i.arc(0,0,t.radius,Math.PI,0,!1),i.stroke(),t.fillBackground&&(t.radius2&&(t.fullCircles?i.arc(0,0,t.radius2,2*Math.PI,0,!0):t.dir>0?i.arc(0,0,t.radius2,Math.PI,0,!0):i.arc(0,0,t.radius2,0,Math.PI,!0)),i.fillStyle=(0,u.generateColor)(t.color,t.transparency,!0),i.fill())}}class g extends c.LineToolPaneViewFibWithLabels{constructor(){super(...arguments),this._trendLineRenderer=new h.TrendLineRenderer,this._renderer=null,this._levels=[]}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer=null,this._points.length<2)return;const t=this._source.priceScale();if(!t||t.isEmpty()||this._model.timeScale().isEmpty())return;const i=this._source.ownerSource()?.firstValue();if(null==i)return;const h=this._points[0],c=this._points[1],u=h.subtract(c).length();this._levels=[];const p=this._source.properties().childs(),_=this._source.levelsCount();for(let e=1;e<=_;e++){const t="level"+e,i=(0,n.ensureDefined)(this._source.properties().child(t)).childs();if(!i.visible.value())continue;const s=i.coeff.value(),a=i.color.value(),l=Math.abs(c.subtract(h).length()*s),d=(0,o.sign)(c.y-h.y),p=new r.Point(h.x,h.y+d*u*Math.abs(s));this._levels.push({color:a,radius:l,dir:d,labelPoint:p,linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),index:e})}if(this._points.length<2)return;const g=new l.CompositeRenderer,x=p.fillBackground.value(),v=p.transparency.value();for(let e=0;e<this._levels.length;e++){const t=this._levels[e],i={center:h,color:t.color,linewidth:t.linewidth,radius:t.radius,dir:t.dir,transparency:v,fillBackground:x,hittestOnBackground:!0,fullCircles:p.fullCircles.value(),radius2:e>0?this._levels[e-1].radius:void 0},n=new a.HitTestResult(a.HitTarget.MovePoint,void 0,t.index);g.append(new f(i,n));const r=this._updateLabelForLevel({levelIndex:this._levels[e].index,leftPoint:this._levels[e].labelPoint,rightPoint:this._levels[e].labelPoint,price:0,color:this._levels[e].color,horzAlign:s.HorizontalAlign.Left,vertAlign:s.VerticalAlign.Middle});null!==r&&g.append(r)}const w=p.trendline.childs();if(w.visible.value()){const e={points:[this._points[0],this._points[1]],color:w.color.value(),linewidth:w.linewidth.value(),linestyle:w.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal};this._trendLineRenderer.setData(e),g.append(this._trendLineRenderer)}this.addAnchors(g),
|
|
this._renderer=g}}},66832:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FibSpeedResistanceFanPaneView:()=>f});var n=i(50151),r=i(86441),s=i(30699),o=i(15938),a=i(74079),l=i(56468),d=i(65395),h=i(95201),c=i(49857),u=i(17330),p=i(91046),_=i(27916);class f extends _.LineSourcePaneView{constructor(e,t){super(e,t),this._leftTextRenderers=[],this._rightTextRenderers=[],this._topTextRenderers=[],this._bottomTextRenderers=[],this._renderer=null;for(let e=0;e<this._source.hLevelsCount();e++)this._leftTextRenderers.push(new u.TextRenderer),this._rightTextRenderers.push(new u.TextRenderer);for(let e=0;e<this._source.vLevelsCount();e++)this._topTextRenderers.push(new u.TextRenderer),this._bottomTextRenderers.push(new u.TextRenderer)}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer=null,this._source.points().length<2)return;const t=this._source.priceScale(),i=(0,n.ensureNotNull)(this._source.ownerSource()).firstValue();if(null===i||!t||t.isEmpty()||this._model.timeScale().isEmpty())return;if(this._points.length<2)return;const u=this._source.points()[0],_=this._source.points()[1],f=this._source.properties().childs(),g=f.reverse.value(),x=[],v=g?_.price-u.price:u.price-_.price,w=g?u.price:_.price;for(let e=1;e<=this._source.hLevelsCount();e++){const r="hlevel"+e,s=(0,n.ensureDefined)(this._source.properties().child(r)).childs();if(!s.visible.value())continue;const o=s.coeff.value(),a=s.color.value(),l=w+o*v,d=t.priceToCoordinate(l,i);x.push({coeff:o,color:a,y:d,index:e})}const R=[],T=g?_.index-u.index:u.index-_.index,m=g?u.index:_.index;for(let e=1;e<=this._source.vLevelsCount();e++){const t="vlevel"+e,i=(0,n.ensureDefined)(this._source.properties().child(t)).childs();if(!i.visible.value())continue;const r=i.coeff.value(),s=i.color.value(),o=Math.round(m+r*T),a=this._model.timeScale().indexToCoordinate(o);R.push({coeff:r,color:s,x:a,index:e})}const b=new h.CompositeRenderer,y=this._points[0],P=this._points[1],L=Math.min(y.x,P.x),S=Math.min(y.y,P.y),C=Math.max(y.x,P.x),A=Math.max(y.y,P.y),M=f.grid.childs().color.value(),I=f.grid.childs().linewidth.value(),k=f.grid.childs().linestyle.value(),H=(0,a.getNumericFormatter)();for(let e=0;e<x.length;e++){const t=new r.Point(L,x[e].y),i=new r.Point(C,x[e].y);if(f.grid.childs().visible.value()){const e={points:[t,i],color:M,linewidth:I,linestyle:k,extendleft:!1,extendright:!1,leftend:c.LineEnd.Normal,rightend:c.LineEnd.Normal},n=new p.TrendLineRenderer;n.setData(e),b.append(n)}if(f.showLeftLabels.value()){const i={points:[t],text:H.format(x[e].coeff),color:x[e].color,vertAlign:s.VerticalAlign.Middle,horzAlign:s.HorizontalAlign.Right,font:o.CHART_FONT_FAMILY,offsetX:5,offsetY:0,fontsize:12,forceTextAlign:!0};this._leftTextRenderers[e].setData(i),b.append(this._leftTextRenderers[e])}if(f.showRightLabels.value()){const t={points:[i],text:H.format(x[e].coeff),color:x[e].color,vertAlign:s.VerticalAlign.Middle,horzAlign:s.HorizontalAlign.Left,font:o.CHART_FONT_FAMILY,offsetX:5,offsetY:0,fontsize:12,forceTextAlign:!0}
|
|
;this._rightTextRenderers[e].setData(t),b.append(this._rightTextRenderers[e])}}for(let e=0;e<R.length;e++){const t=new r.Point(R[e].x,S),i=new r.Point(R[e].x,A);if(f.grid.childs().visible.value()){const e={points:[t,i],color:M,linewidth:I,linestyle:k,extendleft:!1,extendright:!1,leftend:c.LineEnd.Normal,rightend:c.LineEnd.Normal},n=new p.TrendLineRenderer;n.setData(e),b.append(n)}if(f.showTopLabels.value()){const i={points:[t],text:H.format(R[e].coeff),color:R[e].color,vertAlign:s.VerticalAlign.Bottom,horzAlign:s.HorizontalAlign.Center,font:o.CHART_FONT_FAMILY,offsetX:0,offsetY:5,fontsize:12};this._topTextRenderers[e].setData(i),b.append(this._topTextRenderers[e])}if(f.showBottomLabels.value()){const t={points:[i],text:H.format(R[e].coeff),color:R[e].color,vertAlign:s.VerticalAlign.Top,horzAlign:s.HorizontalAlign.Center,font:o.CHART_FONT_FAMILY,offsetX:0,offsetY:5,fontsize:12};this._bottomTextRenderers[e].setData(t),b.append(this._bottomTextRenderers[e])}}const B=f.fillBackground.value(),D=f.transparency.value();for(let e=0;e<x.length;e++){const t=new r.Point(P.x,x[e].y);if(e>0&&B){const i={p1:y,p2:t,p3:y,p4:new r.Point(P.x,x[e-1].y),color:x[e].color,transparency:D,hittestOnBackground:!0,extendLeft:!1},n=new d.ChannelRenderer;n.setData(i),b.append(n)}{const i={points:[y,t],color:x[e].color,linewidth:f.linewidth.value(),linestyle:f.linestyle.value(),extendleft:!1,extendright:!0,leftend:c.LineEnd.Normal,rightend:c.LineEnd.Normal},n=new p.TrendLineRenderer;n.setData(i),n.setHitTest(new l.HitTestResult(l.HitTarget.MovePoint,void 0,{type:"h",index:x[e].index})),b.append(n)}}for(let e=0;e<R.length;e++){const t=new r.Point(R[e].x,P.y);if(e>0&&B){const i={p1:y,p2:t,p3:y,p4:new r.Point(R[e-1].x,P.y),color:R[e].color,transparency:D,hittestOnBackground:!0,extendLeft:!1},n=new d.ChannelRenderer;n.setData(i),b.append(n)}{const i={points:[y,t],color:R[e].color,linewidth:f.linewidth.value(),linestyle:f.linestyle.value(),extendleft:!1,extendright:!0,leftend:c.LineEnd.Normal,rightend:c.LineEnd.Normal},n=new p.TrendLineRenderer;n.setData(i);const r={type:"v",index:R[e].index};n.setHitTest(new l.HitTestResult(l.HitTarget.MovePoint,void 0,r)),b.append(n)}}this.addAnchors(b),this._renderer=b}}},18449:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FibTimeZonePaneView:()=>f});var n=i(86441),r=i(95173),s=i(17330),o=i(62189),a=i(91046),l=i(56468),d=i(95201),h=i(49857),c=i(30699),u=i(15938),p=i(36036),_=i(27916);class f extends _.LineSourcePaneView{constructor(e,t){super(e,t),this._levels=[],this._trendRenderer=new a.TrendLineRenderer,this._textRenderers=[],this._renderer=new d.CompositeRenderer;for(let t=0;t<e.levelsCount();t++)this._textRenderers.push(new s.TextRenderer)}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer.clear(),this._source.points().length<1)return;const t=this._model.timeScale();if(t.isEmpty())return;const[i,a]=this._source.points(),d=this._source.properties().childs(),_=i.index;if(null===t.visibleBarsStrictRange())return;this._levels=[]
|
|
;const f=a?a.index-i.index:1;for(let e=1;e<=this._source.levelsCount();e++){const i=d["level"+e].childs();if(!i.visible.value())continue;const n=Math.round(_+i.coeff.value()*f),r={index:e,x:t.indexToCoordinate(n),color:i.color.value(),width:i.linewidth.value(),style:i.linestyle.value(),text:String(i.coeff.value())};this._levels.push(r)}const{mediaSize:{width:g,height:x}}=e;if(d.fillBackground.value()){const e=d.transparency.value();for(let t=1;t<this._levels.length;t++){const i=this._levels[t-1],r={points:[new n.Point(this._levels[t].x,0),new n.Point(i.x,x)],color:this._levels[t].color,linewidth:0,backcolor:this._levels[t].color,fillBackground:!0,transparency:e,extendLeft:!1,extendRight:!1},s=new o.RectangleRenderer(!0);s.setData(r),this._renderer.append(s)}}let v=d.horzLabelsAlign.value();v=v===c.HorizontalAlign.Left?c.HorizontalAlign.Right:v===c.HorizontalAlign.Right?c.HorizontalAlign.Left:c.HorizontalAlign.Center;const w=d.vertLabelsAlign.value();for(let e=0;e<this._levels.length;e++){let t;const i=this._levels[e].color;if(d.showLabels.value()){let r;switch(w){case"top":r=new n.Point(this._levels[e].x,0);break;case"middle":r=new n.Point(this._levels[e].x,.5*x);break;default:r=new n.Point(this._levels[e].x,x)}const o={points:[r],text:this._levels[e].text,color:i,vertAlign:w,horzAlign:v,font:u.CHART_FONT_FAMILY,offsetX:2,offsetY:0,fontsize:12},a=this._textRenderers[e];a.setData(o),this._needLabelExclusionPath(a)&&(t=(0,s.getTextBoundaries)(a,g,x)??void 0),this._renderer.append(a)}const o={x:this._levels[e].x,color:i,linewidth:this._levels[e].width,linestyle:this._levels[e].style,excludeBoundaries:t},a=new l.HitTestResult(l.HitTarget.MovePoint,void 0,this._levels[e].index),h=new r.VerticalLineRenderer;h.setData(o),h.setHitTest(a),this._renderer.append(h)}if(2===this._points.length){const e=d.trendline.childs(),t={points:[this._points[0],this._points[1]],color:e.color.value(),linewidth:e.linewidth.value(),linestyle:e.linestyle.value(),extendleft:!1,extendright:!1,leftend:h.LineEnd.Normal,rightend:h.LineEnd.Normal};this._trendRenderer.setData(t),this._renderer.append(this._trendRenderer)}2===this._source.points().length?this._renderer.append(this.createLineAnchor({points:this._points.map((e=>({point:e,pointIndex:e.pointIndex})))},0)):this._points.length>0&&this._renderer.append(this.createLineAnchor({points:[(0,p.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(this._points[0].x,x/2),void 0,void 0,void 0,l.HitTarget.MovePoint)]},0))}_needLabelExclusionPath(e){return"center"===this._source.properties().childs().horzLabelsAlign.value()}}},84417:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FibWedgePaneView:()=>p});var n=i(50151),r=i(86441),s=i(30699),o=i(72609),a=i(91046),l=i(56468),d=i(95201),h=i(55053),c=i(49857),u=i(36036);class p extends o.LineToolPaneViewFibWithLabels{constructor(){super(...arguments),this._renderer=null,this._levels=[],this._baseTrendRenderer=new a.TrendLineRenderer,this._edgeTrendRenderer=new a.TrendLineRenderer}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){
|
|
if(super._updateImpl(e),this._renderer=null,this._levels=[],this._points.length<3)return void this._updateRenderer();const[t,i,s]=this._points,o=i.subtract(t).normalized(),a=s.subtract(t).normalized(),l=new r.Point(1,0),d=new r.Point(0,1);let h=Math.acos(o.dotProduct(l));o.dotProduct(d)<0&&(h=2*Math.PI-h);let c=Math.acos(a.dotProduct(l));if(a.dotProduct(d)<0&&(c=2*Math.PI-c),c<h&&([h,c]=[c,h]),Math.abs(h-c)>Math.PI){const e=Math.min(h,c);h=Math.max(h,c),c=e+2*Math.PI}const u=this._source.properties();for(let e=1;e<=this._source.levelsCount();e++){const r="level"+e,s=(0,n.ensureDefined)(u.child(r));if(!s.childs().visible.value())continue;const l=s.childs().coeff.value(),d=s.childs().color.value(),h=Math.abs(i.subtract(t).length()*l),c=o.add(a).scaled(.5).normalized().scaled(h),p=t.add(c);this._levels.push({coeff:l,color:d,radius:h,labelPoint:p,p1:t.add(o.scaled(h)),p2:t.add(a.scaled(h)),linewidth:s.childs().linewidth.value(),linestyle:s.childs().linestyle.value(),index:e})}this._points.length<2||this._updateRenderer(h,c)}_updateRenderer(e=NaN,t=NaN){if(this._points.length<2)return;const i=new d.CompositeRenderer,n=this._source.properties().childs(),[r,o]=this._points,a=n.trendline.childs().visible.value()?n.trendline.childs().linewidth.value():0,p=n.trendline.childs().linestyle.value();if(this._baseTrendRenderer.setData({points:[r,o],color:n.trendline.childs().color.value(),linewidth:a,linestyle:p,extendleft:!1,extendright:!1,leftend:c.LineEnd.Normal,rightend:c.LineEnd.Normal}),i.append(this._baseTrendRenderer),this._points.length<3)return this.addAnchors(i),void(this._renderer=i);let _=this._points[2];const f=_.pointIndex,g=o.subtract(r).length(),x=_.subtract(r).normalized();_=r.add(x.scaled(g)),_.pointIndex=f,this._edgeTrendRenderer.setData({points:[r,_],color:n.trendline.childs().color.value(),linewidth:a,linestyle:p,extendleft:!1,extendright:!1,leftend:c.LineEnd.Normal,rightend:c.LineEnd.Normal}),i.append(this._edgeTrendRenderer);for(let r=this._levels.length-1;r>=0;r--){const o=this._levels[r],a=new h.ArcWedgeRenderer;a.setData({center:this._points[0],radius:o.radius,prevRadius:r>0?this._levels[r-1].radius:0,color:o.color,linewidth:o.linewidth,angle1:e,angle2:t,p1:o.p1,p2:o.p2,fillBackground:n.fillBackground.value(),transparency:n.transparency.value(),color1:"",color2:""}),a.setHitTest(new l.HitTestResult(l.HitTarget.MovePoint,void 0,o.index)),i.append(a);const d=this._updateLabelForLevel({levelIndex:o.index,color:o.color,leftPoint:o.labelPoint,rightPoint:o.labelPoint,price:0,horzAlign:s.HorizontalAlign.Left,vertAlign:s.VerticalAlign.Middle});null!==d&&i.append(d)}const v=[r,o];this._model.lineBeingCreated()!==this._source&&v.push(_),i.append(this.createLineAnchor({points:v.map(u.mapLineSourcePaneViewPointToLineAnchorPoint)},0)),this._renderer=i}}},36134:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlagMarkPaneView:()=>p});var n,r=i(27916),s=i(95201),o=i(36036),a=i(11064),l=i(56468),d=i(34026),h=i(37743),c=i(75919);!function(e){e[e.Width=20]="Width",e[e.Height=22]="Height"}(n||(n={}))
|
|
;class u extends c.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e){if(null===this._data)return null;const{x:t,y:i}=this._data.point;return e.x<t||e.x>t+20||e.y<i-22||e.y>i?null:new l.HitTestResult(l.HitTarget.MovePoint)}doesIntersectWithBox(e){return null!==this._data&&(0,d.pointInBox)(this._data.point,e)}_drawImpl(e){if(null===this._data)return;const t=e.context;t.translate(Math.round(this._data.point.x)-.5,Math.round(this._data.point.y-22)-.5),t.fillStyle="#4A4A4A",(0,h.drawRoundRect)(t,0,0,2,22,1),t.fill(),t.fillStyle=this._data.color,t.beginPath(),t.moveTo(6.87,0),t.bezierCurveTo(5.62,0,4.46,.23,3.32,.69),t.bezierCurveTo(3.26,.71,3.2,.75,3.15,.8),t.bezierCurveTo(3.06,.89,3,1.02,3,1.16),t.lineTo(3,1.19),t.lineTo(3,12.5),t.bezierCurveTo(3,12.8,3.3,13.02,3.59,12.93),t.bezierCurveTo(4.61,12.64,5.94,12.44,6.87,12.44),t.bezierCurveTo(8.5,12.44,10.09,12.83,11.63,13.21),t.bezierCurveTo(13.19,13.6,14.79,14,16.45,14),t.bezierCurveTo(17.59,14,18.65,13.81,19.69,13.43),t.bezierCurveTo(19.88,13.36,20,13.18,20,12.98),t.lineTo(20,1.19),t.bezierCurveTo(20,1.06,19.83,.93,19.66,.99),t.bezierCurveTo(18.63,1.38,17.58,1.56,16.45,1.56),t.bezierCurveTo(14.82,1.56,13.23,1.17,11.69,.79),t.bezierCurveTo(10.14,.4,8.53,0,6.87,0),t.closePath(),t.fill()}}class p extends r.LineSourcePaneView{constructor(){super(...arguments),this._flagMarkRenderer=new u,this._renderer=null,this._anchorsOffset=null}setAnchors(e){this._anchorsOffset=e}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer=null,1!==this._points.length)return;this._flagMarkRenderer.setData({point:this._points[0],color:this._getSource().properties().childs().flagColor.value()});const t=this._getModel();this._renderer=new s.CompositeRenderer,this._renderer.append(this._flagMarkRenderer);const i=[this._anchorsOffset?this._points[0].add(this._anchorsOffset):this._points[0].clone()];this._renderer.append(new a.SelectionRenderer({points:i.map(o.mapLineSourcePaneViewPointToLineAnchorPoint),bgColors:this._lineAnchorColors(i),visible:this.areAnchorsVisible(),barSpacing:t.timeScale().barSpacing(),hittestResult:l.HitTarget.MovePoint}))}}},73050:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlatBottomPaneView:()=>_});var n=i(50151),r=i(86441),s=i(49483),o=i(30699),a=i(62317),l=i(91046),d=i(17330),h=i(95201),c=i(15938),u=i(27916),p=i(36036);class _ extends u.LineSourcePaneView{constructor(){super(...arguments),this._trendLineRendererPoints12=new l.TrendLineRenderer,this._trendLineRendererPoints43=new l.TrendLineRenderer,this._disjointChannelRenderer=new a.DisjointChannelRenderer,this._p1LabelRenderer=new d.TextRenderer,this._p2LabelRenderer=new d.TextRenderer,this._p3LabelRenderer=new d.TextRenderer,this._p4LabelRenderer=new d.TextRenderer,this._labelTextRenderer=new d.TextRenderer,this._renderer=new h.CompositeRenderer}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer.clear(),
|
|
this._source.points().length<2)return;const t=this._source.priceScale(),i=this._source.ownerSource()?.firstValue();if(!t||null==i)return;const[a,l]=this._source.points(),d=t.formatPrice(a.price,i),h=t.formatPrice(l.price,i);let u;if(3===this._source.points().length){const e=this._source.points()[2];u=t.formatPrice(e.price,i)}if(this._points.length<2)return;const[_,f]=this._points;let g,x;const v=this._source.properties().childs();if(3===this._points.length){if(g=(0,r.point)(f.x,this._points[2].y),x=(0,r.point)(_.x,g.y),v.fillBackground.value()){const e=v.extendLeft.value(),t=v.extendRight.value();this._disjointChannelRenderer.setData({extendleft:e,extendright:t,points:[_,f,g,x],backcolor:v.backgroundColor.value(),transparency:v.transparency.value(),hittestOnBackground:s.CheckMobile.any()}),this._renderer.append(this._disjointChannelRenderer)}v.labelVisible.value()&&v.labelText.value()&&this._renderer.append(this._getLabelTextRenderer(_,f,x,g))}const w=(e,t)=>({points:[e,t],color:v.linecolor.value(),linewidth:v.linewidth.value(),linestyle:v.linestyle.value(),extendleft:v.extendLeft.value(),extendright:v.extendRight.value(),leftend:v.leftEnd.value(),rightend:v.rightEnd.value()});if(this._trendLineRendererPoints12.setData(w(_,f)),this._renderer.append(this._trendLineRendererPoints12),2===this._points.length)return void this.addAnchors(this._renderer);const R=(e,t,i,n,r,s)=>{v.showPrices.value()&&(e.setData({points:[i],text:r,color:v.textcolor.value(),horzAlign:i.x>n.x?o.HorizontalAlign.Left:o.HorizontalAlign.Right,vertAlign:o.VerticalAlign.Middle,font:c.CHART_FONT_FAMILY,offsetX:6,offsetY:0,boxPadding:0,bold:v.bold.value(),italic:v.italic.value(),fontsize:v.fontsize.value(),forceTextAlign:!0}),this._renderer.append(e),t.setData({points:[n],text:s,color:v.textcolor.value(),horzAlign:i.x<n.x?o.HorizontalAlign.Left:o.HorizontalAlign.Right,vertAlign:o.VerticalAlign.Middle,font:c.CHART_FONT_FAMILY,offsetX:6,offsetY:0,boxPadding:0,bold:v.bold.value(),italic:v.italic.value(),fontsize:v.fontsize.value(),forceTextAlign:!0}),this._renderer.append(t))};if(R(this._p1LabelRenderer,this._p2LabelRenderer,_,f,d,h),!g||!x)return void this.addAnchors(this._renderer);this._trendLineRendererPoints43.setData(w(x,g)),this._renderer.append(this._trendLineRendererPoints43),R(this._p3LabelRenderer,this._p4LabelRenderer,g,x,(0,n.ensureDefined)(u),(0,n.ensureDefined)(u));const T=[(0,p.lineSourcePaneViewPointToLineAnchorPoint)(_),(0,p.lineSourcePaneViewPointToLineAnchorPoint)(f),(0,p.lineSourcePaneViewPointToLineAnchorPoint)(g,2),(0,p.lineSourcePaneViewPointToLineAnchorPoint)(x,3)];this._model.lineBeingCreated()===this._source&&T.pop(),this._renderer.append(this.createLineAnchor({points:T},0)),_&&f&&this._addAlertRenderer(this._renderer,[_,f])}_getLabelTextRenderer(e,t,i,n){const r=this._source.properties().childs();let s,a;const l=r.labelFontSize.value()/3;let d=0;switch(r.labelVertAlign.value()){case o.VerticalAlign.Bottom:e.y<i.y?(s=e,a=t):(s=i,a=n);break;case o.VerticalAlign.Top:e.y>i.y?(s=e,a=t):(s=i,a=n);break;case o.VerticalAlign.Middle:
|
|
s=e.add(i).scaled(.5),a=t.add(n).scaled(.5),d=l}const h=s.x<a.x?s:a,u=h===s?a:s;let p;switch(r.labelHorzAlign.value()){case o.HorizontalAlign.Left:p=h;break;case o.HorizontalAlign.Right:p=u;break;default:p=h.add(u).scaled(.5)}return this._labelTextRenderer.setData({points:[p],color:r.labelTextColor.value(),fontSize:r.labelFontSize.value(),text:r.labelText.value(),font:c.CHART_FONT_FAMILY,bold:r.labelBold.value(),italic:r.labelItalic.value(),vertAlign:r.labelVertAlign.value(),horzAlign:r.labelHorzAlign.value(),offsetX:0,offsetY:0,boxPaddingVert:l,boxPaddingHorz:d,forceTextAlign:!0,angle:Math.atan((h.y-u.y)/(h.x-u.x))}),this._labelTextRenderer}}},17307:(e,t,i)=>{"use strict";i.d(t,{GannArcRenderer:()=>a});var n=i(86441),r=i(19063),s=i(56468),o=i(75919);class a extends o.MediaCoordinatesPaneRenderer{constructor(){super(),this._data=null}setData(e){this._data=e}hitTest(e){if(null===this._data)return null;e=e.subtract(this._data.center);const t=this._data.edge.subtract(this._data.center),i=t.y/t.x;e=new n.Point(e.x,e.y/i);let r=this._data.point.subtract(this._data.center);r=new n.Point(r.x,r.y/i);const o=r.length(),a=e.length();let l=this._data.prevPoint.subtract(this._data.center);l=new n.Point(l.x,l.y/i);const d=l.length();return Math.abs(a-o)<5&&t.x*e.x>=0&&t.y*e.y>=0?new s.HitTestResult(s.HitTarget.MovePoint):this._data.fillBack&&a>=d&&a<=o&&t.x*e.x>=0&&t.y*e.y>=0?new s.HitTestResult(s.HitTarget.MovePointBackground):null}_drawImpl(e){if(null===this._data)return;const t=e.context;t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.translate(this._data.center.x,this._data.center.y);const i=this._data.edge.subtract(this._data.center),s=i.y/i.x;let o=this._data.point.subtract(this._data.center);o=new n.Point(o.x,o.y/s);let a=o.length(),l=this._data.prevPoint.subtract(this._data.center);l=new n.Point(l.x,l.y/s);let d=l.length();t.scale(1,s);const h=Math.abs(this._data.edge.x-this._data.center.x);if(Math.abs(a)>h){const e=Math.sign(this._data.edge.x-this._data.center.x)*h;t.rect(0,0,e,e),t.clip()}this._data.fillBack&&(this._data.point.x<this._data.center.x&&(a=-a,d=-d),t.beginPath(),t.moveTo(d,0),t.lineTo(a,0),t.arcTo(a,a,0,a,Math.abs(a)),t.lineTo(0,d),t.arcTo(d,d,d,0,Math.abs(d)),t.fillStyle=(0,r.generateColor)(this._data.color,this._data.transparency,!0),t.fill()),t.beginPath(),this._data.point.x>this._data.center.x?t.arc(0,0,Math.abs(a),0,Math.PI/2,!1):t.arc(0,0,Math.abs(a),-Math.PI/2,-Math.PI,!0),t.scale(1,1/s),t.stroke()}}},73017:(e,t,i)=>{"use strict";i.r(t),i.d(t,{GannComplexPaneView:()=>f});var n,r=i(86441),s=i(30699),o=i(27916),a=i(91046),l=i(17330),d=i(95201),h=i(36036),c=i(49857),u=i(51056),p=i(17307),_=i(63273);!function(e){e[e.LabelsOffset=10]="LabelsOffset",e[e.LabelsOffsetTop=8]="LabelsOffsetTop",e[e.LabelsOffsetBottom=10]="LabelsOffsetBottom",e[e.ArcMaxLevel=5]="ArcMaxLevel"}(n||(n={}));class f extends o.LineSourcePaneView{constructor(e,t){super(e,t),this._verticalLevelsRenderers=[],this._horizontalLevelsRenderers=[],this._fanRenderers=[],this._arcRenderers=[],
|
|
this._priceDiffTextRenderer=new l.TextRenderer,this._indexDiffTextRenderer=new l.TextRenderer,this._ratioTextRenderer=new l.TextRenderer,this._renderer=null,this._initRenderers()}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer=null;const t=new d.CompositeRenderer,i=this._getPoints();if(i.length<2)return this.addAnchors(t),void(this._renderer=t);let[n,r]=i;const s=this._getSource(),o=s.isReversed();o&&([r,n]=i);const a=r.x-n.x,l=r.y-n.y,c=n,u=r,p=this._getModel(),_={barsCoordsRange:a,priceCoordsRange:l,startPoint:c,endPoint:u,p1:n,p2:r,isLabelsVisible:s.isLabelsVisible(),reversed:o};this._prepareLevels(t,_),this._prepareFanLines(t,_),this._prepareArcs(t,_),this._prepareLabels(t,_);const f=[n,r];p.lineBeingCreated()===s&&f.pop(),t.append(this.createLineAnchor({points:f.map(h.mapLineSourcePaneViewPointToLineAnchorPoint)},0)),this._renderer=t}_initRenderers(){const e=this._getSource(),t=e.levelsCount();for(let e=0;e<t;e++)this._verticalLevelsRenderers.push(new a.TrendLineRenderer),this._horizontalLevelsRenderers.push(new a.TrendLineRenderer);const i=e.fanLinesCount();for(let e=0;e<i;e++)this._fanRenderers.push(new a.TrendLineRenderer);const n=e.arcsCount();for(let e=0;e<n;e++)this._arcRenderers.push(new p.GannArcRenderer)}_prepareLevels(e,t){const{startPoint:i,endPoint:n,barsCoordsRange:s,priceCoordsRange:o}=t,a=this._getSource().levels();for(const t of a){if(!t.visible)continue;const a=t.index/5,l=i.x+a*s,d={points:[new r.Point(l,i.y),new r.Point(l,n.y)],color:t.color,linewidth:t.width,linestyle:u.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:c.LineEnd.Normal,rightend:c.LineEnd.Normal},h=this._verticalLevelsRenderers[t.index];h.setData(d),e.append(h);const p=i.y+a*o,_={points:[new r.Point(i.x,p),new r.Point(n.x,p)],color:t.color,linewidth:t.width,linestyle:u.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:c.LineEnd.Normal,rightend:c.LineEnd.Normal},f=this._horizontalLevelsRenderers[t.index];f.setData(_),e.append(f)}}_prepareFanLines(e,t){const{p1:i,startPoint:n,endPoint:s,barsCoordsRange:o,priceCoordsRange:a}=t,l=this._getSource().fanLines();for(const t of l){if(!t.visible)continue;const l=t.x,d=t.y;let h,p;if(l>d){h=s.x;const e=d/l;p=n.y+e*a}else{p=s.y;const e=l/d;h=n.x+e*o}const _={points:[i,new r.Point(h,p)],color:t.color,linewidth:t.width,linestyle:u.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:c.LineEnd.Normal,rightend:c.LineEnd.Normal},f=this._fanRenderers[t.index];f.setData(_),e.append(f)}}_prepareArcs(e,t){const{p1:i,startPoint:n,endPoint:s,barsCoordsRange:o,priceCoordsRange:a}=t;let l=i;const d=this._getSource(),h=d.isArcsBackgroundFilled(),c=d.arcsBackgroundTransparency(),u=d.arcs();for(const t of u){if(!t.visible)continue;const i=t.x/5,d=t.y/5,u=n.x+i*o,p=n.y+d*a,_={center:n,point:new r.Point(u,p),edge:s,color:t.color,linewidth:t.width,fillBack:h,transparency:c,prevPoint:l},f=this._arcRenderers[t.index];f.setData(_),e.append(f),l=_.point}}_prepareLabels(e,t){const{p1:i,p2:n,isLabelsVisible:o,reversed:a}=t
|
|
;if(!o)return;const l=this._getSource(),d=l.ownerSource();let h=l.getPriceDiff(),c=l.getIndexDiff();if(null===h||null===c||null===d)return;a&&(h=-h,c=-c);const u=new r.Point(i.x,n.y),p=(0,_.forceLTRStr)(d.formatter().format(h)),f=this._getLabelData(u,p);f.horzAlign=c>0?s.HorizontalAlign.Right:s.HorizontalAlign.Left,f.vertAlign=h>0?s.VerticalAlign.Bottom:s.VerticalAlign.Top,f.offsetX=10,f.offsetY=h>0?8:10,f.forceTextAlign=!0,this._priceDiffTextRenderer.setData(f),e.append(this._priceDiffTextRenderer);const g=new r.Point(n.x,i.y),x=(0,_.forceLTRStr)(c.toString()),v=this._getLabelData(g,x);v.horzAlign=c>0?s.HorizontalAlign.Left:s.HorizontalAlign.Right,v.vertAlign=h>0?s.VerticalAlign.Top:s.VerticalAlign.Bottom,v.offsetX=10,v.offsetY=h>0?10:8,v.forceTextAlign=!0,this._indexDiffTextRenderer.setData(v),e.append(this._indexDiffTextRenderer);const w=l.getScaleRatio();if(null===w)return;const R=l.getScaleRatioFormatter(),T=(0,_.forceLTRStr)(R.format(w)),m=this._getLabelData(n,T);m.horzAlign=c>0?s.HorizontalAlign.Left:s.HorizontalAlign.Right,m.vertAlign=h>0?s.VerticalAlign.Bottom:s.VerticalAlign.Top,m.offsetX=10,m.offsetY=h>0?8:10,m.forceTextAlign=!0,this._ratioTextRenderer.setData(m),e.append(this._ratioTextRenderer)}_getLabelData(e,t){const i=this._getSource(),{textColor:n,font:r,fontSize:o,bold:a,italic:l}=i.getLabelsStyle();return{points:[e],backgroundColor:"transparent",text:t,font:r,bold:a,italic:l,fontsize:o,color:n,vertAlign:s.VerticalAlign.Top,horzAlign:s.HorizontalAlign.Center,offsetX:0,offsetY:0,backgroundRoundRect:4}}}},79890:(e,t,i)=>{"use strict";i.r(t),i.d(t,{GannFanPaneView:()=>_});var n=i(50151),r=i(86441),s=i(30699),o=i(15938),a=i(56468),l=i(65395),d=i(95201),h=i(49857),c=i(17330),u=i(91046),p=i(27916);class _ extends p.LineSourcePaneView{constructor(e,t){super(e,t),this._textRenderers=[],this._renderer=null;for(let t=0;t<e.levelsCount();t++)this._textRenderers.push(new c.TextRenderer)}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer=null,this._source.points().length<2)return;const t=this._source.priceScale();if(!t||t.isEmpty()||this._model.timeScale().isEmpty())return;if(this._points.length<2)return;const i=this._points[0],c=this._points[1],p=[],_=c.x-i.x,f=c.y-i.y,g=this._source.properties().childs();for(let e=1;e<=this._source.levelsCount();e++){const t="level"+e,r=(0,n.ensureDefined)(this._source.properties().child(t)).childs();if(!r.visible.value())continue;const s=r.coeff1.value(),o=r.coeff2.value(),a=s/o,l=r.color.value(),d=s+"/"+o;let h,u;s>o?(h=c.x,u=i.y+f/a):(h=i.x+_*a,u=c.y),p.push({label:d,color:l,x:h,y:u,linewidth:r.linewidth.value(),linestyle:r.linestyle.value(),index:e})}const x=new d.CompositeRenderer,v=g.fillBackground.value(),w=g.transparency.value();for(let e=0;e<p.length;e++){const t=new r.Point(p[e].x,p[e].y);if(v)if(p[e].index<4){const n={p1:i,p2:t,p3:i,p4:new r.Point(p[e+1].x,p[e+1].y),color:p[e].color,transparency:w,hittestOnBackground:!0,extendLeft:!1},s=new l.ChannelRenderer;s.setData(n),x.append(s)
|
|
}else if(p[e].index>4&&e>0){const n={p1:i,p2:t,p3:i,p4:new r.Point(p[e-1].x,p[e-1].y),color:p[e].color,transparency:w,hittestOnBackground:!0,extendLeft:!1},s=new l.ChannelRenderer;s.setData(n),x.append(s)}{const n={points:[i,t],color:p[e].color,linewidth:p[e].linewidth,linestyle:p[e].linestyle,extendleft:!1,extendright:!0,leftend:h.LineEnd.Normal,rightend:h.LineEnd.Normal},r=new u.TrendLineRenderer;r.setData(n),r.setHitTest(new a.HitTestResult(a.HitTarget.MovePoint,void 0,p[e].index)),x.append(r)}if(g.showLabels.value()){const i={points:[t],text:p[e].label,color:p[e].color,vertAlign:s.VerticalAlign.Middle,horzAlign:s.HorizontalAlign.Left,font:o.CHART_FONT_FAMILY,offsetX:0,offsetY:5,fontsize:12},n=this._textRenderers[e];n.setData(i),x.append(n)}}this.addAnchors(x),this._renderer=x}}},57736:(e,t,i)=>{"use strict";i.r(t),i.d(t,{GannFixedPaneView:()=>u});var n,r=i(86441),s=i(27916),o=i(91046),a=i(36036),l=i(95201),d=i(49857),h=i(51056),c=i(17307);!function(e){e[e.ArcMaxLevel=5]="ArcMaxLevel"}(n||(n={}));class u extends s.LineSourcePaneView{constructor(e,t){super(e,t),this._verticalLevelsRenderers=[],this._horizontalLevelsRenderers=[],this._fanRenderers=[],this._arcRenderers=[],this._renderer=null,this._initRenderers()}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer=null;const t=this._getSource(),i=this._getPoints(),n=t.getScreenPoints();if(i.length<2||n.length<2)return;const[r,o]=n;i[1]=(0,s.createLineSourcePaneViewPoint)(r,1),i[2]=(0,s.createLineSourcePaneViewPoint)(o,2);const d=this._getPoints(),h=new l.CompositeRenderer;if(d.length<2)return this.addAnchors(h),void(this._renderer=h);const c=d[0],u=3===d.length?d[2]:d[1],p=u.x-c.x,_=u.y-c.y,f=c,g=u,x=this._getModel(),v={barsCoordsRange:p,priceCoordsRange:_,startPoint:f,endPoint:g,p1:c,p2:u};this._prepareLevels(h,v),this._prepareFanLines(h,v),this._prepareArcs(h,v);const w=[c,d[1]];x.lineBeingCreated()===t&&w.pop(),h.append(this.createLineAnchor({points:w.map(a.mapLineSourcePaneViewPointToLineAnchorPoint)},0)),this._renderer=h}_initRenderers(){const e=this._getSource(),t=e.levelsCount();for(let e=0;e<t;e++)this._verticalLevelsRenderers.push(new o.TrendLineRenderer),this._horizontalLevelsRenderers.push(new o.TrendLineRenderer);const i=e.fanLinesCount();for(let e=0;e<i;e++)this._fanRenderers.push(new o.TrendLineRenderer);const n=e.arcsCount();for(let e=0;e<n;e++)this._arcRenderers.push(new c.GannArcRenderer)}_prepareLevels(e,t){const{startPoint:i,endPoint:n,barsCoordsRange:s,priceCoordsRange:o}=t,a=this._getSource().levels();for(const t of a){if(!t.visible)continue;const a=t.index/5,l=i.x+a*s,c={points:[new r.Point(l,i.y),new r.Point(l,n.y)],color:t.color,linewidth:t.width,linestyle:h.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal},u=this._verticalLevelsRenderers[t.index];u.setData(c),e.append(u);const p=i.y+a*o,_={points:[new r.Point(i.x,p),new r.Point(n.x,p)],color:t.color,linewidth:t.width,linestyle:h.LINESTYLE_SOLID,extendleft:!1,extendright:!1,
|
|
leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal},f=this._horizontalLevelsRenderers[t.index];f.setData(_),e.append(f)}}_prepareFanLines(e,t){const{p1:i,startPoint:n,endPoint:s,barsCoordsRange:o,priceCoordsRange:a}=t,l=this._getSource().fanLines();for(const t of l){if(!t.visible)continue;const l=t.x,c=t.y;let u,p;if(l>c){u=s.x;const e=c/l;p=n.y+e*a}else{p=s.y;const e=l/c;u=n.x+e*o}const _={points:[i,new r.Point(u,p)],color:t.color,linewidth:t.width,linestyle:h.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal},f=this._fanRenderers[t.index];f.setData(_),e.append(f)}}_prepareArcs(e,t){const{p1:i,startPoint:n,endPoint:s,barsCoordsRange:o,priceCoordsRange:a}=t;let l=i;const d=this._getSource(),h=d.isArcsBackgroundFilled(),c=d.arcsBackgroundTransparency(),u=d.arcs();for(const t of u){if(!t.visible)continue;const i=t.x/5,d=t.y/5,u=n.x+i*o,p=n.y+d*a,_={center:n,point:new r.Point(u,p),edge:s,color:t.color,linewidth:t.width,fillBack:h,transparency:c,prevPoint:l},f=this._arcRenderers[t.index];f.setData(_),e.append(f),l=_.point}}}},10349:(e,t,i)=>{"use strict";i.r(t),i.d(t,{GannSquarePaneView:()=>f});var n=i(50151),r=i(86441),s=i(30699),o=i(15938),a=i(74079),l=i(95201),d=i(36036),h=i(49857),c=i(62189),u=i(17330),p=i(91046),_=i(27916);class f extends _.LineSourcePaneView{constructor(e,t){super(e,t),this._hlevels=[],this._vlevels=[],this._hfans=[],this._vfans=[],this._renderer=new l.CompositeRenderer,this._leftLabelRenderers=[],this._rightLabelRenderers=[],this._topLabelRenderers=[],this._bottomLabelRenderers=[];for(let t=0;t<e.hLevelsCount();t++)this._leftLabelRenderers.push(new u.TextRenderer),this._rightLabelRenderers.push(new u.TextRenderer);for(let t=0;t<e.vLevelsCount();t++)this._topLabelRenderers.push(new u.TextRenderer),this._bottomLabelRenderers.push(new u.TextRenderer)}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer.clear();const t=this._source.points(),i=this._source.ownerSource()?.firstValue()??null;if(t.length<2||null===i)return;const l=this._source.priceScale(),u=this._model.timeScale();if(!l||l.isEmpty()||u.isEmpty())return;const f=t[0],g=t[1],x=this._source.properties().childs(),v=x.reverse.value();this._hlevels=[];const w=v?f.price-g.price:g.price-f.price,R=v?g.price:f.price;for(let e=1;e<=this._source.hLevelsCount();e++){const t="hlevel"+e,r=(0,n.ensureDefined)(this._source.properties().child(t)).childs();if(!r.visible.value())continue;const s=r.coeff.value(),o=r.color.value(),a=R+s*w,d=l.priceToCoordinate(a,i);this._hlevels.push({coeff:s,color:o,y:d})}this._vlevels=[];const T=v?f.index-g.index:g.index-f.index,m=v?g.index:f.index;for(let e=1;e<=this._source.vLevelsCount();e++){const t="vlevel"+e,i=(0,n.ensureDefined)(this._source.properties().child(t)).childs();if(!i.visible.value())continue;const r=i.coeff.value(),s=i.color.value(),o=Math.round(m+r*T),a=this._model.timeScale().indexToCoordinate(o);this._vlevels.push({coeff:r,color:s,x:a})}if(this._hfans=[],this._vfans=[],
|
|
x.fans.childs().visible.value())for(let e=1;e<=this._source.hLevelsCount();e++){const t=(0,n.ensureDefined)(this._source.properties().child("hlevel"+e)).childs(),r=(0,n.ensureDefined)(this._source.properties().child("vlevel"+e)).childs(),s=Math.round(m+t.coeff.value()*T),o=R+r.coeff.value()*w;this._hfans.push(u.indexToCoordinate(s)),this._vfans.push(l.priceToCoordinate(o,i))}if(this._points.length<2)return void this.addAnchors(this._renderer);const b=this._points[0],y=this._points[1],P=Math.min(b.x,y.x),L=Math.min(b.y,y.y),S=Math.max(b.x,y.x),C=Math.max(b.y,y.y),A=x.fillHorzBackground.value(),M=x.horzTransparency.value(),I=x.fillVertBackground.value(),k=x.vertTransparency.value(),H=(0,a.getNumericFormatter)();for(let e=0;e<this._hlevels.length;e++){if(e>0&&A){const t=new c.RectangleRenderer(!0);t.setData({points:[new r.Point(P,this._hlevels[e].y),new r.Point(S,this._hlevels[e-1].y)],color:this._hlevels[e].color,linewidth:0,backcolor:this._hlevels[e].color,fillBackground:!0,transparency:M,extendLeft:!1,extendRight:!1}),this._renderer.append(t)}const t=new r.Point(P,this._hlevels[e].y),i=new r.Point(S,this._hlevels[e].y),n=new p.TrendLineRenderer;if(n.setData({points:[t,i],color:this._hlevels[e].color,linewidth:x.linewidth.value(),linestyle:x.linestyle.value(),extendleft:!1,extendright:!1,leftend:h.LineEnd.Normal,rightend:h.LineEnd.Normal}),this._renderer.append(n),x.showLeftLabels.value()){const i=this._leftLabelRenderers[e];i.setData({points:[t],text:H.format(this._hlevels[e].coeff),color:this._hlevels[e].color,vertAlign:s.VerticalAlign.Middle,horzAlign:s.HorizontalAlign.Right,font:o.CHART_FONT_FAMILY,offsetX:5,offsetY:0,fontsize:12,forceTextAlign:!0}),this._renderer.append(i)}if(x.showRightLabels.value()){const t=this._rightLabelRenderers[e];t.setData({points:[i],text:H.format(this._hlevels[e].coeff),color:this._hlevels[e].color,vertAlign:s.VerticalAlign.Middle,horzAlign:s.HorizontalAlign.Left,font:o.CHART_FONT_FAMILY,offsetX:5,offsetY:0,fontsize:12}),this._renderer.append(t)}}for(let e=0;e<this._vlevels.length;e++){const t=new r.Point(this._vlevels[e].x,L),i=new r.Point(this._vlevels[e].x,C);if(e>0&&I){const t=new c.RectangleRenderer(!0);t.setData({points:[new r.Point(this._vlevels[e-1].x,L),i],color:this._vlevels[e].color,linewidth:0,backcolor:this._vlevels[e].color,fillBackground:!0,transparency:k,extendLeft:!1,extendRight:!1}),this._renderer.append(t)}const n=new p.TrendLineRenderer;if(n.setData({points:[t,i],color:this._vlevels[e].color,linewidth:x.linewidth.value(),linestyle:x.linestyle.value(),extendleft:!1,extendright:!1,leftend:h.LineEnd.Normal,rightend:h.LineEnd.Normal}),this._renderer.append(n),x.showTopLabels.value()){const i=this._topLabelRenderers[e];i.setData({points:[t],text:H.format(this._vlevels[e].coeff),color:this._vlevels[e].color,vertAlign:s.VerticalAlign.Bottom,horzAlign:s.HorizontalAlign.Center,font:o.CHART_FONT_FAMILY,offsetX:0,offsetY:3,fontsize:12}),this._renderer.append(i)}if(x.showBottomLabels.value()){const t=this._bottomLabelRenderers[e];t.setData({points:[i],
|
|
text:H.format(this._vlevels[e].coeff),color:this._vlevels[e].color,vertAlign:s.VerticalAlign.Top,horzAlign:s.HorizontalAlign.Center,font:o.CHART_FONT_FAMILY,offsetX:0,offsetY:5,fontsize:12}),this._renderer.append(t)}}const B=(e,t)=>{const i=new r.Point(P,L),n=new r.Point(S,L),s=new r.Point(P,C),o=new r.Point(S,C),a=e=>{const t=new p.TrendLineRenderer;t.setData({points:e,color:x.fans.childs().color.value(),linewidth:x.linewidth.value(),linestyle:x.linestyle.value(),extendleft:!1,extendright:!1,leftend:h.LineEnd.Normal,rightend:h.LineEnd.Normal}),this._renderer.append(t)};for(let l=0;l<e.length;++l){const d=t?C:e[l],h=t?L:e[l],c=t?e[l]:P,u=t?e[l]:S,p=new r.Point(u,d),_=new r.Point(c,d),f=new r.Point(u,h),g=new r.Point(c,h);a([s,f]),a([o,g]),a([i,p]),a([n,_])}};B(this._hfans,!0),B(this._vfans,!1);const D=(0,_.createLineSourcePaneViewPoint)(new r.Point(this._points[0].x,this._points[1].y),2),z=(0,_.createLineSourcePaneViewPoint)(new r.Point(this._points[1].x,this._points[0].y),3);this._renderer.append(this.createLineAnchor({points:[...this._points,D,z].map(d.mapLineSourcePaneViewPointToLineAnchorPoint)},0))}}},14049:(e,t,i)=>{"use strict";i.r(t),i.d(t,{GhostFeedPaneView:()=>_});var n=i(19625),r=i(51056),s=i(37265),o=i(56468),a=i(95201),l=i(61993),d=i(49857),h=i(91046),c=i(25201),u=i(27916);const p=n.colorsPalette["color-cold-gray-500"];class _ extends u.LineSourcePaneView{constructor(){super(...arguments),this._renderer=null,this._segments=[]}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer=null,this._segments=[];const t=this._source.priceScale(),i=this._source.ownerSource()?.firstValue()??null;if(this._points.length<2||null===t||t.isEmpty()||null===i)return;const n=this._source.points(),u=this._source.properties().childs(),_=u.candleStyle.childs(),f=_.upColor.value(),g=_.downColor.value(),x=_.borderUpColor.value(),v=_.borderDownColor.value();this._segments=this._source.segments().map(((e,r)=>{if(r>=this._points.length-1)return null;let s=this._points[r],o=this._points[r+1],a=n[r].price,l=n[r+1].price,d=1;s.x>o.x&&(s=this._points[r+1],o=this._points[r],a=n[r+1].price,l=n[r].price,d=-1);const h=s.x,c=this._model.timeScale().coordinateToIndex(h),u=t.priceToCoordinate(a,i),p=t.priceToCoordinate(l,i),_=e.bars(),w=(p-u)/(_.length-1),R=[];let T=d>0?0:_.length-1;const m=d>0?_.length:-1;for(let e=0;T!==m;T+=d,e++){const n=u+e*w,r=t.coordinateToPrice(n,i),s=_[T],o=s.c>=s.o;R.push({open:t.priceToCoordinate(r+s.o,i),high:t.priceToCoordinate(r+s.h,i),low:t.priceToCoordinate(r+s.l,i),close:t.priceToCoordinate(r+s.c,i),color:o?f:g,borderColor:o?x:v,hollow:!1,center:NaN,left:NaN,right:NaN,timePointIndex:c+e})}return this._model.timeScale().fillBarBorders(R),{bars:R}})).filter(s.notNull);const w=new a.CompositeRenderer;for(let e=1;e<this._points.length;e++){const t={points:[this._points[e-1],this._points[e]],color:p,linewidth:1,linestyle:r.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal},i=new h.TrendLineRenderer
|
|
;i.setData(t),i.setHitTest(new o.HitTestResult(o.HitTarget.MovePoint)),w.append(i)}const R=_.drawWick.value(),T=_.drawBorder.value(),m=_.borderColor.value(),b=_.wickColor.value(),y=new a.CompositeRenderer;y.setGlobalAlpha(1-u.transparency.value()/100);const P=this._model.timeScale().barSpacing();for(let e=0;e<this._segments.length;e++){const i={bars:this._segments[e].bars,barSpacing:P,wickVisible:R,bodyVisible:!0,borderVisible:T,borderColor:m,wickColor:b,barWidth:(0,l.optimalBarWidth)(P),hittest:new o.HitTestResult(o.HitTarget.MovePoint),isPriceScaleInverted:t.isInverted()};y.append(new c.PaneRendererCandles(i))}w.append(y),this.addAnchors(w),this._renderer=w}}},29634:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LineToolHeadAndShouldersPaneView:()=>g});var n=i(5531),r=i(11542),s=i(51056),o=i(30699),a=i(91046),l=i(1161),d=i(17330),h=i(95201),c=i(49857),u=i(74011),p=i(27916),_=i(15938);const f={leftShoulder:r.t(null,void 0,i(27443)),rightShoulder:r.t(null,void 0,i(14719)),head:r.t(null,void 0,i(1472))};class g extends p.LineSourcePaneView{constructor(){super(...arguments),this._trendLineRenderer=new a.TrendLineRenderer,this._triangleRendererPoints234=new l.TriangleRenderer,this._intersect1Renderer=new l.TriangleRenderer,this._intersect2Renderer=new l.TriangleRenderer,this._polyLineRenderer=new u.PolygonRenderer,this._leftShoulderLabelRenderer=new d.TextRenderer,this._headLabelRenderer=new d.TextRenderer,this._rightShoulderLabelRenderer=new d.TextRenderer,this._renderer=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){let t,i;super._updateImpl(e),this._renderer=null;const[r,a,l,d,u,p,g]=this._points;if(this._points.length>=5){const e=(0,n.intersectLineSegments)(l,u,r,a);if(null!==e){const i=u.subtract(l);t=l.add(i.scaled(e))}if(7===this._points.length){const e=(0,n.intersectLineSegments)(l,u,p,g);if(null!==e){const t=u.subtract(l);i=l.add(t.scaled(e))}}}if(this._points.length<2)return;const x=this._source.properties().childs(),v=new h.CompositeRenderer,w=(e,t)=>({points:[e],text:t,color:x.textcolor.value(),horzAlign:o.HorizontalAlign.Center,vertAlign:o.VerticalAlign.Middle,font:_.CHART_FONT_FAMILY,offsetX:0,offsetY:0,bold:x.bold&&x.bold.value(),italic:x.italic&&x.italic.value(),fontsize:x.fontsize.value(),backgroundColor:x.color.value(),backgroundRoundRect:4}),R=(e,t,i)=>({points:[e,t,i],color:"rgba(0, 0, 0, 0)",linewidth:0,backcolor:x.backgroundColor.value(),fillBackground:x.fillBackground.value(),transparency:x.transparency.value()}),T={points:this._points,color:x.color.value(),linewidth:x.linewidth.value(),linestyle:s.LINESTYLE_SOLID,backcolor:"rgba(0, 0, 0, 0)",fillBackground:!1,filled:!1};if(this._polyLineRenderer.setData(T),v.append(this._polyLineRenderer),this._points.length>=5){let e,n,r=!1,o=!1;t?e=t:(e=l,r=!0),i?n=i:(n=u,o=!0);const a={points:[e,n],color:x.color.value(),linewidth:x.linewidth.value(),linestyle:s.LINESTYLE_DOTTED,extendleft:!1,extendright:!1,leftend:c.LineEnd.Normal,rightend:c.LineEnd.Normal};a.extendleft=r,a.extendright=o,this._trendLineRenderer.setData(a),
|
|
v.append(this._trendLineRenderer);const h=R(l,d,u);this._triangleRendererPoints234.setData(h),v.append(this._triangleRendererPoints234)}if(t){const e=R(t,a,l);this._intersect1Renderer.setData(e),v.append(this._intersect1Renderer)}if(i){const e=R(u,p,i);this._intersect2Renderer.setData(e),v.append(this._intersect2Renderer)}if(this._points.length>=2){const e=w(a,f.leftShoulder);a.y<r.y?(e.vertAlign=o.VerticalAlign.Bottom,e.offsetY=5):(e.vertAlign=o.VerticalAlign.Top,e.offsetY=5),this._leftShoulderLabelRenderer.setData(e),v.append(this._leftShoulderLabelRenderer)}if(this._points.length>=4){const e=w(d,f.head);d.y<l.y?(e.vertAlign=o.VerticalAlign.Bottom,e.offsetY=5):(e.vertAlign=o.VerticalAlign.Top,e.offsetY=5),this._headLabelRenderer.setData(e),v.append(this._headLabelRenderer)}if(this._points.length>=6){const e=w(p,f.rightShoulder);p.y<u.y?(e.vertAlign=o.VerticalAlign.Bottom,e.offsetY=5):(e.vertAlign=o.VerticalAlign.Top,e.offsetY=5),this._rightShoulderLabelRenderer.setData(e),v.append(this._rightShoulderLabelRenderer)}this.addAnchors(v),this._renderer=v}}},64332:(e,t,i)=>{"use strict";i.r(t),i.d(t,{HighlighterPaneView:()=>s});var n=i(51056),r=i(70849);class s extends r.BrushBasePaneView{_createPolygonRendererData(){const e=this._source.properties().childs();return{points:this._points,color:e.linecolor.value(),linewidth:e.width.value(),backcolor:"rgba(0, 0, 0, 0)",fillBackground:!1,linestyle:n.LINESTYLE_SOLID,filled:!1,transparency:e.transparency.value()}}}},38117:(e,t,i)=>{"use strict";i.r(t),i.d(t,{HorzLinePaneView:()=>_});var n=i(86441),r=i(56468),s=i(72791),o=i(17330),a=i(62689),l=i(50600),d=i(95201),h=i(13075),c=i(15938),u=i(36036),p=i(32211);class _ extends p.InplaceTextLineSourcePaneView{constructor(e,t,i,n,s){super(e,t,i,n,s),this._renderer=null,this._lineRenderer=new l.HorizontalLineRenderer,this._lineRenderer.setHitTest(new r.HitTestResult(r.HitTarget.MovePoint)),this._labelRenderer=new a.LineToolTextRenderer(void 0,new r.HitTestResult(r.HitTarget.MovePoint,(0,p.inplaceEditHandlers)(this._tryActivateEditMode.bind(this,null)))),this._source.setAdditionalCursorData((()=>({color:this._source.editableTextStyle().cursorColor,...this._labelRenderer.getTextInfo()})),this._labelRenderer.positionToCoordinate.bind(this._labelRenderer))}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer=null,0===this._points.length)return;const t=this._source.properties().childs(),i=new d.CompositeRenderer;let a=!0;const{mediaSize:{width:l,height:p}}=e,_=t.text.value(),f=this._isTextEditMode(),g=this._placeHolderMode();let x;if(t.showLabel?.value()&&_||g||f){const e=t.vertLabelsAlign.value(),r=t.horzLabelsAlign.value();let s=0,d=0;"left"===r?d=3:"right"===r?(d=l,s=3):d=l/2;const u=new n.Point(d,this._points[0].y);this._labelRenderer.setData({points:[u],text:this._textData(),color:this._textColor(),vertAlign:e,horzAlign:r,font:c.CHART_FONT_FAMILY,offsetX:s,offsetY:0,bold:t.bold.value(),italic:t.italic.value(),fontsize:t.fontsize.value(),forceTextAlign:!0,
|
|
decorator:g?h.PlusTextRendererDecorator.instance():void 0,...this._inplaceTextHighlight()}),this._labelRenderer.setCursorType(this._textCursorType()),i.append(this._labelRenderer),this._needLabelExclusionPath(this._labelRenderer)&&(x=(0,o.getTextBoundaries)(this._labelRenderer,l,p)??void 0),a=this._labelRenderer.isOutOfScreen(l,p),a?this.closeTextEditor():this._updateInplaceText(this._labelRenderer.getTextInfo())}const v={y:this._points[0].y,color:t.linecolor.value(),linewidth:t.linewidth.value(),linestyle:t.linestyle.value(),excludeBoundaries:x};this._lineRenderer.setData(v),this._lineRenderer.setHitTest(new r.HitTestResult(r.HitTarget.MovePoint,{snappingPrice:this._source.points()[0].price}));const w=v.linewidth/2+1;if(a=a&&(v.y<-w||v.y>p+w),i.insert(this._lineRenderer,0),!a){if(1===this._points.length&&!this._isTextEditMode()){const e=(0,u.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(.9*l,this._points[0].y),0,s.PaneCursorType.VerticalResize,!0);i.append(this.createLineAnchor({points:[e]},0))}if(1===this._points.length){const e=new n.Point(this._model.timeScale().width()/2,this._points[0].y);this._addAlertRenderer(i,[e])}this._renderer=i}}}},66451:(e,t,i)=>{"use strict";i.r(t),i.d(t,{HorzRayPaneView:()=>g});var n,r=i(86441),s=i(95201),o=i(17330),a=i(15938),l=i(56468),d=i(27916),h=i(37743),c=i(61993),u=i(7114),p=i(30125),_=i(51056);class f extends p.BitmapCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e){if(null===this._data||0===this._data.points.length)return null;if(e.x<this._data.points[0].x)return null;const t=(0,c.interactionTolerance)().line;return Math.abs(e.y-this._data.points[0].y)<=t?new l.HitTestResult(this._data.hitTestResult,{snappingPrice:this._data.snappingPrice}):null}_drawImpl(e){if(null===this._data||0===this._data.points.length)return;const{context:t,horizontalPixelRatio:i,verticalPixelRatio:n,bitmapSize:r}=e,s=r.width,o=this._data.points[0].y,a=Math.max(0,this._data.points[0].x),l=Math.max(s,this._data.points[0].x);t.lineCap=void 0===this._data.linestyle||this._data.linestyle===_.LINESTYLE_SOLID?"round":"butt",t.strokeStyle=this._data.color,t.lineWidth=Math.max(1,Math.floor(this._data.linewidth*i)),void 0!==this._data.linestyle&&(0,h.setLineStyle)(t,this._data.linestyle);const d=this._data.excludeBoundaries;void 0!==d&&(0,u.addExclusionAreaByScope)(e,d),(0,h.drawHorizontalLine)(t,Math.round(o*n),Math.round(a*i),Math.round(l*i))}}!function(e){e[e.RightOffset=3]="RightOffset"}(n||(n={}));class g extends d.LineSourcePaneView{constructor(e,t){super(e,t),this._horzRayRenderer=new f,this._labelRenderer=new o.TextRenderer,this._renderer=null,this._horzRayRenderer=new f,this._labelRenderer=new o.TextRenderer,this._renderer=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer=null,0===this._points.length)return;const t=this._source.properties().childs(),i=new s.CompositeRenderer;let n,d=this._points[0].clone();if(t.showLabel.value()&&1===this._points.length){
|
|
const s=t.vertLabelsAlign.value(),l=t.horzLabelsAlign.value(),h=0;let c=0;const u=t.text.value(),p=t.bold.value(),_=t.italic.value(),f=a.CHART_FONT_FAMILY,g=t.fontsize.value();if("right"===l){const e=this._labelRenderer.measure().width,t=this._model.timeScale().width();d.x+e+3>=t?d=d.add((0,r.point)(e+3,0)):(d=(0,r.point)(t,d.y),c=3)}else"center"===l&&(d=(0,r.point)((d.x+this._model.timeScale().width())/2,d.y));const x={points:[d],text:u,color:t.textcolor.value(),vertAlign:s,horzAlign:l,font:f,offsetX:c,offsetY:h,bold:p,italic:_,fontsize:g,forceTextAlign:!0};if(this._labelRenderer.setData(x),i.append(this._labelRenderer),this._needLabelExclusionPath(this._labelRenderer)){const{mediaSize:{width:t,height:i}}=e;n=(0,o.getTextBoundaries)(this._labelRenderer,t,i)??void 0}}const h={points:this._points,color:t.linecolor.value(),linewidth:t.linewidth.value(),linestyle:t.linestyle.value(),hitTestResult:l.HitTarget.MovePoint,snappingPrice:this._source.points()[0].price,excludeBoundaries:n};this._horzRayRenderer.setData(h),i.append(this._horzRayRenderer),this.addAnchors(i),1===this._points.length&&this._addAlertRenderer(i,[h.points[0]]),this._renderer=i}}},11735:(e,t,i)=>{"use strict";i.r(t),i.d(t,{IconPaneView:()=>r});var n=i(68498);class r extends n.SvgIconPaneView{_iconColor(){return this._source.properties().childs().color.value()}}},26087:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ImagePaneView:()=>p});var n=i(86441),r=i(72791),s=i(95201),o=i(34026),a=i(56468),l=i(75919);class d extends l.MediaCoordinatesPaneRenderer{constructor(e){super(),this._data=e??null}hitTest(e){if(!this._data)return null;const{point:t,cssWidth:i,cssHeight:r}=this._data,s=new n.Point(t.x,t.y),l=new n.Point(t.x+i,t.y+r);return(0,o.pointInBox)(e,(0,n.box)(s,l))?new a.HitTestResult(a.HitTarget.MovePoint):null}setData(e){this._data=e}_drawImpl(e){if(!this._data)return;const{angle:t,img:i,point:n,cssWidth:r,cssHeight:s,transparency:o}=this._data,a=e.context;a.globalAlpha=(100-o)/100,Math.abs(t)<1e-4?a.drawImage(i,n.x,n.y,r,s):(a.translate(n.x,n.y),a.rotate(t),a.drawImage(i,0,0,r,s))}}var h=i(27916),c=i(36036),u=i(3503);class p extends h.LineSourcePaneView{constructor(e,t){super(e,t),this._imageRenderer=new d}renderer(e){const t=this._source.image();if(null===t||(0,u.imageIsOversized)(t))return null;if(this._invalidated&&this._updateImpl(e),!this._points.length)return null;const i=new s.CompositeRenderer;return i.append(this._imageRenderer),this._addAnchors(i),i}_updateImpl(e){super._updateImpl(e);const t=this._source.properties(),i=this._source.image(),n=this._calculateBox();null===i||void 0===n?this._imageRenderer.setData(null):this._imageRenderer.setData({point:n[0],img:i,cssWidth:this._source.cssWidth(),cssHeight:this._source.cssHeight(),angle:0,transparency:t.childs().transparency.value()})}_addAnchors(e){const t=this._calculateBox();if(void 0===t)return;const[i,s]=t,o=[(0,c.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(i.x+1,i.y+1),0,r.PaneCursorType.DiagonalNwSeResize),(0,
|
|
c.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(s.x-1,i.y+1),1,r.PaneCursorType.DiagonalNeSwResize),(0,c.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(i.x+1,s.y-1),2,r.PaneCursorType.DiagonalNeSwResize),(0,c.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(s.x-1,s.y-1),3,r.PaneCursorType.DiagonalNwSeResize)];e.append(this.createLineAnchor({points:o},0))}_calculateBox(){const e=this._source.cssWidth(),t=this._source.cssHeight(),i=this._source.originPoint(),r=this._source.dOffsetX();let s,o,[a]=this._points;if(a){switch(4!==i&&(a=new n.Point(a.x+r,a.y)),i){case 4:{const i=e/2,r=t/2;s=new n.Point(a.x-i,a.y-r),o=new n.Point(a.x+i,a.y+r);break}case 0:s=new n.Point(a.x,a.y),o=new n.Point(a.x+e,a.y+t);break;case 1:s=new n.Point(a.x-e,a.y),o=new n.Point(a.x,a.y+t);break;case 2:s=new n.Point(a.x,a.y-t),o=new n.Point(a.x+e,a.y);break;case 3:s=new n.Point(a.x-e,a.y-t),o=new n.Point(a.x,a.y)}return[s,o]}}}},15852:(e,t,i)=>{"use strict";i.r(t),i.d(t,{InplaceTextCursorPaneView:()=>d});var n=i(50151);class r{constructor(e){this._data=null,this._positionToCoordinate=e}setData(e){this._data=e}draw(e,t){const{position:i,rotationPoint:r,lineHeight:s,color:o,alpha:a}=(0,n.ensureNotNull)(this._data);if(void 0===i)return;e.save();const{horizontalPixelRatio:l,verticalPixelRatio:d}=t;if(r&&0!==r.angle){const t=r.x*l,i=r.y*d;e.translate(t,i),e.rotate(r.angle),e.translate(-t,-i)}const h=this._positionToCoordinate(i),c=Math.round(h.x*l),u=Math.round(h.y*d),p=Math.max(Math.floor(l),1),_=Math.round(s*d);e.globalAlpha=a??1,e.fillStyle=o,e.fillRect(c,u,p,_),e.restore()}hitTest(e){return null}}var s=i(78871);const o=1e3;function a(e){return{isActive:t=>t-e<o,data:t=>{const i=Math.min(t-e,o);return{alpha:s.easingFunc.linear(i/o)<.5?0:1}}}}var l=i(62288);class d{constructor(e,t){this._renderer=null,this._animation=null,this._animationTimeout=null,this._invalidated=!0,this._model=t,this._cursorRenderer=new r((e=>this._positionToCoordinate(e)))}update(){this._invalidated=!0}renderer(){return this._continueAnimationIfNeeded(),this._invalidated&&this._updateImpl(),this._renderer}setCursorPosition(e){this._cursorPosition!==e&&(this._cursorPosition=e,null!==this._animation&&this._stopAnimation(),this._startAnimation()),this._invalidated=!0}setAdditionalCursorData(e,t){this._textAdditionalData=e,this._positionToCoordinate=t}_updateImpl(){if(this._renderer=null,this._invalidated=!1,void 0===this._cursorPosition)return void this._stopAnimation();const e={...this._textAdditionalData(),position:this._cursorPosition},t=this._animationStepData();null!==t&&(e.alpha=t.alpha),this._cursorRenderer.setData(e),this._renderer=this._cursorRenderer}_startAnimation(){this._animationTimeout=setTimeout((()=>{this._animation=a(performance.now()),this._continueAnimationIfNeeded()}),300)}_stopAnimation(){null!==this._animationTimeout&&(clearTimeout(this._animationTimeout),this._animationTimeout=null),this._animation=null}_animationStepData(){if(null===this._animation)return null;const e=performance.now()
|
|
;return this._animation.isActive(e)||(this._animation=a(e)),this._animation.data(e)}_continueAnimationIfNeeded(){null!==this._animation&&this._model.invalidate(l.InvalidationMask.cursor())}}},8938:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LineToolBeingCreatedPaneView:()=>c});var n=i(19625),r=i(27916),s=i(51056),o=i(49857),a=i(95201),l=i(95173),d=i(91046);const h=n.colorsPalette["color-cold-gray-500"];class c extends r.LineSourcePaneView{constructor(){super(...arguments),this._lineRenderer1=new l.VerticalLineRenderer,this._lineRenderer2=new l.VerticalLineRenderer,this._medianRenderer=new d.TrendLineRenderer,this._renderer=null}renderer(e){return this._invalidated&&(this._updateImpl(e),this._invalidated=!1),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer=null;const t=this._getPoints();if(t.length<1)return;this._renderer=new a.CompositeRenderer;const[i,n]=t;this._lineRenderer1.setData({x:i.x,color:h,linewidth:1,linestyle:s.LINESTYLE_SOLID}),this._renderer.append(this._lineRenderer1),t.length>1&&(this._lineRenderer2.setData({x:n.x,color:h,linewidth:1,linestyle:s.LINESTYLE_SOLID}),this._medianRenderer.setData({points:[i,n],color:h,linewidth:1,linestyle:s.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:o.LineEnd.Normal,rightend:o.LineEnd.Normal}),this._renderer.append(this._lineRenderer2),this._renderer.append(this._medianRenderer))}}},15511:(e,t,i)=>{"use strict";i.d(t,{LineToolWithRelativePriceCoordinate:()=>g,getNoDataPosition:()=>_,getSeriesPosition:()=>f,positionToCoordinate:()=>c});var n,r,s=i(50151),o=i(8025),a=i(10568);function l(e,t,i){const n=e.barFunction();switch(e.style()){case 3:case 10:case 2:case 14:case 15:return n(t.value);default:return t.value[-1===i?3:2]}}function d(e){return e>=0?1:-1}function h(e,t){return-1===d(e)!==t?-1:1}function c(e,t,i,n){const r=Math.min(t,Math.max(0,1===n?i:t-i));return i-n*Math.abs(r*e/100)}function u(e,t,i){const n=e.index();return null===n?null:{index:n,price:t.coordinateToPrice(t.height()/2,i)}}function p(e,t){const i=e.data().bars(),n=i.first(),r=i.last();if(null===n||null===r)return null;let s;const a=t.index();if(null===a){if(void 0===t.time)return null;const e=t.time(),a=n.value[0],l=r.value[0];if(e<a-86400||e>l)return null;s=i.searchByTime(e,o.PlotRowSearchMode.NearestRight,4)}else s=i.search(a);return null===s?null:{index:s.index,price:l(e,s,d(t.position()))}}function _(e,t,i,n){const r=u(e,t,n);if(null===r)return null;const s=h(e.position(),t.isInverted());return{index:r.index,price:r.price,poleStartY:t.height(),visualDirection:1,positionPointDirection:s,startsOnSeriesData:!1,priceCoordinate:t.priceToCoordinate(r.price,n),indexCoordinate:i.indexToCoordinate(r.index)}}function f(e,t,i=!0){const n=p(e,t),r=e.priceScale(),o=e.model().timeScale(),a=(0,s.ensureNotNull)(e.firstValue());if(null===n)return _(t,r,o,a);let l=0;const d=e.properties().childs(),c=r.priceToCoordinate(n.price,a),u=h(t.position(),r.isInverted());if(i)switch(e.style()){case 16:l=1===u?d.hlcAreaStyle.childs().highLineWidth.value()/2:d.hlcAreaStyle.childs().lowLineWidth.value()/2
|
|
;break;case 3:l=d.areaStyle.childs().linewidth.value()/2;break;case 2:l=d.lineStyle.childs().linewidth.value()/2;break;case 14:l=d.lineWithMarkersStyle.childs().linewidth.value()/2;break;case 15:l=d.steplineStyle.childs().linewidth.value()/2;break;case 10:const e=Math.abs(100-d.baselineStyle.childs().baseLevelPercentage.value());l=r.height()*e/100>c?d.baselineStyle.childs().topLineWidth.value()/2:d.baselineStyle.childs().bottomLineWidth.value()/2;break;case 1:case 9:case 8:case 12:case 4:case 7:l=3;break;case 0:l=d.barStyle.childs().thinBars.value()?3:Math.max(3,.25*o.barSpacing());break;case 11:l=d.rangeStyle.childs().thinBars.value()?3:Math.max(3,.25*o.barSpacing());break;case 5:l=Math.max(4,.25*o.barSpacing());break;case 6:l=Math.max(5,.25*o.barSpacing())}const f=c-u*l;return{index:n.index,price:n.price,poleStartY:f,visualDirection:u,positionPointDirection:u,startsOnSeriesData:!0,priceCoordinate:c,indexCoordinate:o.indexToCoordinate(n.index)}}!function(e){e[e.Label=0]="Label",e[e.Body=1]="Body"}(n||(n={})),function(e){e[e.OneDaySeconds=86400]="OneDaySeconds"}(r||(r={}));class g extends a.InplaceTextLineDataSource{constructor(){super(...arguments),this._startMovingAnchorY=NaN}priceSource(){return this.ownerSource()}editableTextProperties(){(0,s.assert)(!1,"unexpected method call")}addPoint(e,t,i){return super.addPoint(this._updatePositionAndCorrectPoint(e),t,i)}setPoint(e,t,i,n){n?super.setPoint(e,t,i,n):(super.setPoint(e,this._updatePositionAndCorrectPoint(t,!this.isPhantom()&&!this._allowChangeAnchorHorizontally()),i),this._syncPosition())}setPointAndChangeIndex(e,t,i){super.setPoint(e,this._updatePositionAndCorrectPoint(t),i),this._syncPosition()}startMoving(e,t,i,n){n||(this._startMovingAnchorY=(0,s.ensureNotNull)(this._anchorYCoordinate())),super.startMoving(e,t,i)}move(e,t,i,n){const r=(0,s.ensureDefined)((0,s.ensureNotNull)(this.startMovingPoint()).logical),o=(0,s.ensureDefined)(e.logical);if(!n&&0===t){const e=this._points[0],t=o.index-r.index,i=(0,s.ensureNotNull)(this.priceScale()),n=(0,s.ensure)(this.ownerSource()?.firstValue()),a=i.priceToCoordinate(o.price,n)-i.priceToCoordinate(r.price,n),l=this._startMovingAnchorY+a,d=i.coordinateToPrice(l,n);this._updatePositionAndCorrectPoint({index:e.index+t,price:d})}super.move(e,t,i),n||this._syncPosition()}_allowChangeAnchorHorizontally(){return!1}_updatePositionAndCorrectPoint(e,t=!1){t&&(e.index=this._points[0].index);const i=this.priceSource();if(null===i)return e;const n=i.priceScale(),r=i.firstValue();if(null===n||n.isEmpty()||null===r)return e;const s=n.height();let o=s/2,a=e.price>=n.coordinateToPrice(o,r)?1:-1;const d=this._model.mainSeries();if(i===d){const t=d.data().search(this._baseSeriesIndexForPoint(e));if(null!==t){const i=l(d,t,-1),s=l(d,t,1);a=e.price>=i?1:-1,o=n.priceToCoordinate(1===a?s:i,r),e.price=1===a?Math.max(s,e.price):e.price}}const h=1===(-1===a!==n.isInverted()?-1:1)?o:s-o,c=n.priceToCoordinate(e.price,r),u=Math.min(s,Math.abs(c-o)),p=Math.max(0,Math.min(100,100*u/h))*a;return this.properties().childs().position.setValue(p),e}
|
|
_baseSeriesIndexForPoint(e){return e.index}_syncPosition(){const e=this.linkKey().value();null!==e&&this._syncLineStyleChanges(e,{position:this.properties().childs().position.value()})}_anchorYCoordinate(){const e=this.priceSource();if(null===e)return null;const t=e.priceScale(),i=e.firstValue();if(null===t||t.isEmpty()||null===i)return null;const n=this._model.mainSeries(),r=this.customEvent();if(null===r)return null;let s=null;if(e===n&&(s=p(n,r)),null===s&&(s=u(r,t,i)),null===s)return null;const o=r.position(),a=t.priceToCoordinate(s.price,i);return c(o,t.height(),a,h(o,t.isInverted()))}}},31352:(e,t,i)=>{"use strict";function n(e,t,i){const n=t-i;if("percentage"===e.getLineLengthUnit()){const r=Math.max(e.getLineLength()/100*t,1),s=Math.round(t-Math.min(n,r));return{right:s,left:s-i}}const r=e.getLineLength();if(r<0){const e=Math.round(Math.min(n,-1*r));return{left:e,right:e+i}}{const e=Math.round(t-Math.min(n,r));return{right:e,left:e-i}}}i.d(t,{orderLineLocation:()=>n})},92281:(e,t,i)=>{"use strict";i.r(t),i.d(t,{OrderPaneView:()=>v});var n=i(86441),r=i(27916),s=i(36036),o=i(95201),a=i(11542),l=i(37743),d=i(75919),h=i(56468),c=i(34585),u=i(91920),p=i(31352);const _=a.t(null,void 0,i(67710)),f=a.t(null,void 0,i(95931));class g extends d.MediaCoordinatesPaneRenderer{constructor(e){super(),this._data=null,this._cache={},this._data=null,this._adapter=e}setData(e){this._data=e}hitTest(e){if(null===this._data||0===this._data.points.length)return null;const t=this._cache;if(e.y<t.top||e.y>t.bottom)return null;if(this._adapter.getBlocked()&&e.x>=t.left&&e.x<t.right)return new h.HitTestResult(h.HitTarget.Custom,{});if(this._adapter.getEditable()&&e.x>=t.left&&e.x<t.bodyRight){const e=this._adapter.hasMoveCallback()?h.HitTarget.MovePoint:h.HitTarget.Regular;return 0===this._adapter.getTooltip().length?new h.HitTestResult(e):new h.HitTestResult(e,{tooltip:{text:this._adapter.getTooltip(),forceHideOnMove:this._adapter.hasMoveCallback(),rect:{x:t.left,y:t.top,w:t.bodyRight-t.left,h:t.bottom-t.top}}})}return this._adapter.getEditable()&&e.x>=t.bodyRight&&e.x<t.quantityRight?this._adapter.hasModifyCallback()?new h.HitTestResult(h.HitTarget.Custom,{clickHandler:this._adapter.callOnModify.bind(this._adapter),tapHandler:this._adapter.callOnModify.bind(this._adapter),tooltip:{text:this._adapter.getModifyTooltip()||(0,c.appendEllipsis)(_),rect:{x:t.bodyRight,y:t.top,w:t.quantityRight-t.bodyRight,h:t.bottom-t.top}}}):new h.HitTestResult(h.HitTarget.Regular):this._adapter.getCancellable()&&e.x>=t.quantityRight&&e.x<t.right?new h.HitTestResult(h.HitTarget.Custom,{clickHandler:this._adapter.callOnCancel.bind(this._adapter),tapHandler:this._adapter.callOnCancel.bind(this._adapter),tooltip:{text:this._adapter.getCancelTooltip()||f,rect:{x:t.quantityRight,y:t.top,w:t.right-t.quantityRight,h:t.bottom-t.top}}}):null}_drawImpl(e){if(null===this._data||!this._data.points||this._data.points.length<1)return;const t=e.context,i=e.mediaSize.width,n=this._bodyWidth(t),r=this._quantityWidth(t),s=n+r+this._cancelButtonWidth(),{left:o,right:a}=(0,
|
|
p.orderLineLocation)(this._adapter,i,s),l=Math.round(this._data.points[0].y),d=Math.round(l-(this._height()+1)/2);this._cache.bodyRight=o+n,this._cache.quantityRight=o+n+r,this._cache.top=d,this._cache.bottom=d+this._height(),this._cache.left=o,this._cache.right=a,this._drawLines(t,o,a,l,i);let h=!1;0!==n&&(this._drawBody(t,o,d),this._adapter.hasMoveCallback()&&this._drawMovePoints(t,o,d),this._drawBodyText(t,o,d),h=!0),0!==r&&(this._drawQuantity(t,o+n,d,h),this._drawQuantityText(t,o+n,d),h=!0),0!==this._cancelButtonWidth()&&this._drawCancelButton(t,o+n+r,d,h)}_height(){return Math.max(20,1+Math.max(u.fontHeight(this._adapter.getBodyFont()),u.fontHeight(this._adapter.getQuantityFont())))}_bodyWidth(e){if(0===this._adapter.getText().length)return 0;e.save(),e.font=this._adapter.getBodyFont();const t=e.measureText(this._adapter.getText()).width;return e.restore(),Math.round(20+t)}_getQuantity(){return this._adapter.getQuantity()}_quantityWidth(e){if(0===this._getQuantity().length)return 0;e.save(),e.font=this._adapter.getQuantityFont();const t=e.measureText(this._getQuantity()).width;return e.restore(),Math.round(Math.max(this._height(),10+t))}_cancelButtonWidth(){return this._adapter.isOnCancelCallbackPresent()?this._height():0}_drawLines(e,t,i,n,r){e.save(),e.strokeStyle=this._adapter.getLineColor(),(0,l.setLineStyle)(e,this._adapter.getLineStyle()),e.lineWidth=this._adapter.getLineWidth(),(0,l.drawLine)(e,i,n,r,n),this._adapter.getExtendLeft()&&(0,l.drawLine)(e,0,n,t,n),e.restore()}_drawMovePoints(e,t,i){e.save(),e.strokeStyle=this._adapter.getBodyBorderColor(),e.fillStyle=this._adapter.getBodyBorderColor();const n=t+4,r=n+2,s=Math.floor((this._height()-10)/2)+1;for(let t=0;t<s;++t){const s=i+5+2*t;(0,l.drawLine)(e,n,s,r,s)}e.restore()}_drawBody(e,t,i){e.strokeStyle=this._adapter.getBodyBorderColor(),e.fillStyle=this._adapter.getBodyBackgroundColor();const n=this._bodyWidth(e),r=this._height();e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r)}_drawBodyText(e,t,i){e.textAlign="center",e.textBaseline="middle",e.font=this._adapter.getBodyFont(),e.fillStyle=this._adapter.getBodyTextColor();const n=t+this._bodyWidth(e)/2,r=i+this._height()/2;e.fillText(this._adapter.getText(),5+n-2,r)}_drawQuantity(e,t,i,n){e.save(),e.strokeStyle=this._adapter.getQuantityBorderColor(),e.fillStyle=this._adapter.getQuantityBackgroundColor();const r=this._quantityWidth(e),s=this._height();e.fillRect(t+.5,i+.5,r-1,s-1),n&&e.clip&&(e.beginPath(),e.rect(t+.5,i-.5,r+1,s+1),e.clip()),e.strokeRect(t,i,r,s),e.restore()}_drawQuantityText(e,t,i){e.save(),e.textAlign="center",e.textBaseline="middle",e.font=this._adapter.getQuantityFont(),e.fillStyle=this._adapter.getQuantityTextColor();const n=t+this._quantityWidth(e)/2,r=i+this._height()/2;e.fillText(this._getQuantity(),n,r),e.restore()}_drawCancelButton(e,t,i,r){e.strokeStyle=this._adapter.getCancelButtonBorderColor(),e.fillStyle=this._adapter.getCancelButtonBackgroundColor();const s=this._cancelButtonWidth(),o=this._height();e.fillRect(t+.5,i+.5,s-1,o-1),
|
|
this._adapter.getBlocked()&&(e.fillStyle="rgba(140, 140, 140, 0.75)",e.fillRect(t+.5,i+.5,s-1,o-1)),e.save(),r&&e.clip&&(e.beginPath(),e.rect(t+.5,i-.5,s+1,o+1),e.clip()),e.strokeRect(t,i,s,o),e.restore();const a=t+s,d=i+o;e.strokeStyle=this._adapter.getCancelButtonIconColor();const h=(this._cancelButtonWidth()-8)/2,c=(this._height()-8)/2;(0,l.drawPoly)(e,[new n.Point(t+h,i+c),new n.Point(a-h,d-c)],!0),(0,l.drawPoly)(e,[new n.Point(a-h,i+c),new n.Point(t+h,d-c)],!0)}}var x=i(11064);class v extends r.LineSourcePaneView{constructor(e,t){super(e,t),this._renderer=new o.CompositeRenderer,this._selectionRenderer=new x.SelectionRenderer,this._selectionData=null,this._adapter=e.adapter(),this._orderRenderer=new g(e.adapter()),this._renderer.append(this._orderRenderer),this._renderer.append(this._selectionRenderer)}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._selectionData=null,this.isSelectedSource()&&this._points.length>0){const t=this._points[0].y,i=e.mediaSize.width-4-1,r=this._adapter.hasMoveCallback()?h.HitTarget.MovePoint:h.HitTarget.Regular,o=[new n.Point(i,t)];this._selectionData={barSpacing:this._model.timeScale().barSpacing(),points:o.map(s.mapLineSourcePaneViewPointToLineAnchorPoint),bgColors:this._lineAnchorColors(o),hittestResult:r,visible:!0}}this._orderRenderer.setData({points:this._points}),this._selectionRenderer.setData(this._selectionData)}}},86595:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ParallelChannelPaneView:()=>f});var n=i(86441),r=i(50151),s=i(19063),o=i(15938),a=i(30699),l=i(72791),d=i(95201),h=i(36036),c=i(93610),u=i(27916),p=i(17330),_=i(14267);class f extends u.LineSourcePaneView{constructor(e,t){super(e,t),this._channelRenderers=[],this._labelTextRenderer=new p.TextRenderer,this._renderer=null,this._channelRenderers=Array.from({length:_.coeffs.length-1}).map((()=>new c.ParallelChannelRenderer))}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer=null;const t=this._source.priceScale();if(!t||t.isEmpty())return;if(0===this._source.points().length)return;if(this._points.length<=1)return;const i=this._source.properties(),o=i.childs(),u=this._points[0],_=this._points[1];let f=0,g=null,x=null;3===this._points.length&&(f=this._points[2].y-this._points[0].y,g=u.add((0,n.point)(0,f)),x=_.add((0,n.point)(0,f)));const v=new d.CompositeRenderer,w=Array.from({length:this._source.levelsCount()}).map(((e,t)=>(0,r.ensureDefined)(i.child(`level${t+1}`)))).filter((e=>e.childs().visible.value()));1===w.length&&w.push(w[0]),this._channelRenderers.length!==w.length-1&&(this._channelRenderers=Array.from({length:w.length-1}).map((()=>new c.ParallelChannelRenderer)));const R=[],T=(0,s.generateColor)(o.backgroundColor.value(),o.transparency.value());for(let e=0;e<w.length-1;e++){const t=w[e],i=w[e+1];let r=u,s=_,a=u,l=_;if(3===this._points.length){const e=f*t.childs().coeff.value(),o=f*i.childs().coeff.value();r=u.add((0,n.point)(0,e)),s=_.add((0,n.point)(0,e)),a=u.add((0,
|
|
n.point)(0,o)),l=_.add((0,n.point)(0,o))}const d={line1:{color:t.childs().color.value(),lineStyle:t.childs().lineStyle.value(),lineWidth:t.childs().lineWidth.value(),points:[r,s]},line2:null===a||null===l?void 0:{color:i.childs().color.value(),lineStyle:i.childs().lineStyle.value(),lineWidth:i.childs().lineWidth.value(),points:[a,l]},skipTopLine:e!==w.length-2,extendLeft:o.extendLeft.value(),extendRight:o.extendRight.value(),fillBackground:o.fillBackground.value(),backColor:T,hittestOnBackground:!0};R.push(d)}let m=null;{let t=u,r=_,s=u,l=_;if(3===this._points.length&&w.length>0){const e=o.labelVertAlign.value()===a.VerticalAlign.Middle,i=f*(e?0:w[0].childs().coeff.value()),d=f*(e?1:w[w.length-1].childs().coeff.value());t=u.add((0,n.point)(0,i)),r=_.add((0,n.point)(0,i)),s=u.add((0,n.point)(0,d)),l=_.add((0,n.point)(0,d))}if(m=this._getLabelTextRenderer(t,r,s,l),m&&i.childs().labelVertAlign.value()===a.VerticalAlign.Middle){const{mediaSize:t}=e,i=(0,p.getTextBoundaries)(m,t.width,t.height)??void 0;R.forEach((e=>{e.excludeBoundaries=i}))}}R.forEach(((e,t)=>{this._channelRenderers[t].setData(e),v.append(this._channelRenderers[t])})),m&&v.append(m);const b=[];u&&b.push((0,h.lineSourcePaneViewPointToLineAnchorPoint)(u)),_&&b.push((0,h.lineSourcePaneViewPointToLineAnchorPoint)(_)),g&&x&&(b.push((0,h.lineSourcePaneViewPointToLineAnchorPoint)(g,2)),b.push((0,h.lineSourcePaneViewPointToLineAnchorPoint)(x,3)),b.push((0,h.lineSourcePaneViewPointToLineAnchorPoint)(g.add(x).scaled(.5),4,l.PaneCursorType.VerticalResize,!0)),b.push((0,h.lineSourcePaneViewPointToLineAnchorPoint)(b[0].point.add(b[1].point).scaled(.5),5,l.PaneCursorType.VerticalResize,!0)));const y=3===this._points.length&&!g;if(this._model.lineBeingCreated()!==this._source||y||(b.pop(),b.pop()),v.append(this.createLineAnchor({points:b},0)),this._points.length>=2){const e=this._points;this._addAlertRenderer(v,[e[0],e[1]],o.level1.childs().color.value())}this._renderer=v}_getLabelTextRenderer(e,t,i,n){const r=this._source.properties().childs();if(!r.labelVisible.value()||!r.labelText.value())return null;let s,l;const d=r.labelFontSize.value()/3;let h=0;switch(r.labelVertAlign.value()){case a.VerticalAlign.Bottom:!i||!n||e.y<i.y?(s=e,l=t):(s=i,l=n);break;case a.VerticalAlign.Top:!i||!n||e.y>i.y?(s=e,l=t):(s=i,l=n);break;case a.VerticalAlign.Middle:i&&n?(s=e.add(i).scaled(.5),l=t.add(n).scaled(.5)):(s=e,l=t),h=d}const c=s.x<l.x?s:l,u=c===s?l:s;let p,_;switch(r.labelHorzAlign.value()){case a.HorizontalAlign.Left:_=c;break;case a.HorizontalAlign.Right:_=u;break;default:_=c.add(u).scaled(.5)}switch(r.labelVertAlign.value()){case a.VerticalAlign.Top:p=a.VerticalAlign.Top;break;case a.VerticalAlign.Bottom:p=a.VerticalAlign.Bottom;break;case a.VerticalAlign.Middle:p=a.VerticalAlign.Middle}return this._labelTextRenderer.setData({points:[_],color:r.labelTextColor.value(),fontSize:r.labelFontSize.value(),text:r.labelText.value(),font:o.CHART_FONT_FAMILY,bold:r.labelBold.value(),italic:r.labelItalic.value(),vertAlign:p,horzAlign:r.labelHorzAlign.value(),offsetX:0,offsetY:0,
|
|
boxPaddingVert:d,boxPaddingHorz:h,forceTextAlign:!0,angle:Math.atan((c.y-u.y)/(c.x-u.x))}),this._labelTextRenderer}}},99035:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PathPaneView:()=>o});var n=i(74011),r=i(95201),s=i(27916);class o extends s.LineSourcePaneView{constructor(e,t){super(e,t),this._polygonRenderer=new n.PolygonRenderer,this._renderer=new r.CompositeRenderer}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer.clear();const t=this._source.properties().childs(),i={points:this._points,color:t.lineColor.value(),linewidth:t.lineWidth.value(),linestyle:t.lineStyle.value(),leftend:t.leftEnd.value(),rightend:t.rightEnd.value(),filled:!1,backcolor:"",fillBackground:!1,transparency:0};this._polygonRenderer.setData(i),this._renderer.append(this._polygonRenderer),this.addAnchors(this._renderer)}}},4086:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PitchfanLinePaneView:()=>h});var n=i(56468),r=i(65395),s=i(95201),o=i(36036),a=i(49857),l=i(91046),d=i(27916);class h extends d.LineSourcePaneView{constructor(){super(...arguments),this._medianRenderer=new l.TrendLineRenderer,this._sideRenderer=new l.TrendLineRenderer,this._renderer=null,this._medianPoint=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer=null;const t=this._points.length;if(0===t)return;const[i]=this._points;if(this._medianPoint=(0,o.lineSourcePaneViewPointToLineAnchorPoint)(3===t?this._points[1].add(this._points[2]).scaled(.5):2===t?this._points[1]:i,3),t<2)return;if(!this._medianPoint)return;const d=new s.CompositeRenderer,h=this._source.properties().childs(),c=h.median.childs(),u={points:[i,this._medianPoint.point],color:c.color.value(),linewidth:c.linewidth.value(),linestyle:c.linestyle.value(),extendleft:!1,extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};if(this._medianRenderer.setData(u),d.append(this._medianRenderer),t<3)return this.addAnchors(d),void(this._renderer=d);const p={points:[this._points[1],this._points[2]],color:c.color.value(),linewidth:c.linewidth.value(),linestyle:c.linestyle.value(),extendleft:!1,extendright:!1,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal};this._sideRenderer.setData(p),d.append(this._sideRenderer);let _=0;const f=this._points[2].subtract(this._points[1]).scaled(.5),g=h.fillBackground.value(),x=h.transparency.value();for(let e=0;e<=8;e++){const t="level"+e,s=this._source.properties().child(t);if(s?.childs().visible.value()){const t=this._medianPoint.point.addScaled(f,s.childs().coeff.value()),o=this._medianPoint.point.addScaled(f,-s.childs().coeff.value());if(g){{const e={p1:i,p2:t,p3:i,p4:this._medianPoint.point.addScaled(f,_),color:s.childs().color.value(),transparency:x,hittestOnBackground:!0,extendLeft:!1},n=new r.ChannelRenderer;n.setData(e),d.append(n)}{const e={p1:i,p2:o,p3:i,p4:this._medianPoint.point.addScaled(f,-_),color:s.childs().color.value(),transparency:x,hittestOnBackground:!0,extendLeft:!1},t=new r.ChannelRenderer;t.setData(e),d.append(t)}}
|
|
_=s.childs().coeff.value();{const r={points:[i,t],color:s.childs().color.value(),linewidth:s.childs().linewidth.value(),linestyle:s.childs().linestyle.value(),extendleft:!1,extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal},o=new l.TrendLineRenderer;o.setData(r),o.setHitTest(new n.HitTestResult(n.HitTarget.MovePoint,void 0,e)),d.append(o)}{const t={points:[i,o],color:s.childs().color.value(),linewidth:s.childs().linewidth.value(),linestyle:s.childs().linestyle.value(),extendleft:!1,extendright:!0,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal},r=new l.TrendLineRenderer;r.setData(t),r.setHitTest(new n.HitTestResult(n.HitTarget.MovePoint,void 0,e)),d.append(r)}}}this.addAnchors(d),this._renderer=d}}},68470:(e,t,i)=>{"use strict";i.r(t),i.d(t,{InsidePitchforkLinePaneView:()=>f,PitchforkLinePaneView:()=>u,SchiffPitchfork2LinePaneView:()=>_,SchiffPitchforkLinePaneView:()=>p});var n=i(50151),r=i(86441),s=i(56468),o=i(65395),a=i(95201),l=i(36036),d=i(49857),h=i(91046),c=i(27916);class u extends c.LineSourcePaneView{constructor(){super(...arguments),this._medianRenderer=new h.TrendLineRenderer,this._sideRenderer=new h.TrendLineRenderer,this._renderer=null,this._medianPoint=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer=null;const t=this._points.length;if(0===t)return;const[i,n,r]=this._points;this._medianPoint=(0,l.lineSourcePaneViewPointToLineAnchorPoint)(3===t?n.add(r).scaled(.5):2===t?n:i,3),this._updateRenderer()}_updateRenderer(){if(this._points.length<2)return;if(!this._medianPoint)return;const e=this._source.properties(),t=e.childs().median.childs(),i=new a.CompositeRenderer,n={points:[this._points[0],this._medianPoint.point],color:t.color.value(),linewidth:t.linewidth.value(),linestyle:t.linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal};if(this._medianRenderer.setData(n),i.append(this._medianRenderer),this._points.length<3)return this.addAnchors(i),void(this._renderer=i);const r={points:[this._points[1],this._points[2]],color:t.color.value(),linewidth:t.linewidth.value(),linestyle:t.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal};this._sideRenderer.setData(r),i.append(this._sideRenderer);const l=this._points[2].subtract(this._points[1]).scaled(.5),c=this._medianPoint.point.subtract(this._points[0]);let u=0;const p=e.childs().fillBackground.value(),_=e.childs().transparency.value();for(let t=0;t<=8;t++){const n="level"+t,r=e.childs()[n];if(r.childs().visible.value()){const n=this._medianPoint.point.addScaled(l,r.childs().coeff.value()),a=n.add(c),f=this._medianPoint.point.addScaled(l,-r.childs().coeff.value()),g=f.add(c);if(p){{const t=this._medianPoint.point.addScaled(l,u),s={p1:n,p2:a,p3:t,p4:t.add(c),color:r.childs().color.value(),transparency:_,hittestOnBackground:!0,extendLeft:e.childs().extendLines.value()},d=new o.ChannelRenderer;d.setData(s),i.append(d)}{
|
|
const t=this._medianPoint.point.addScaled(l,-u),n={p1:f,p2:g,p3:t,p4:t.add(c),color:r.childs().color.value(),transparency:_,hittestOnBackground:!0,extendLeft:e.childs().extendLines.value()},s=new o.ChannelRenderer;s.setData(n),i.append(s)}}u=r.childs().coeff.value();const x={points:[n,a],color:r.childs().color.value(),linewidth:r.childs().linewidth.value(),linestyle:r.childs().linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal},v=new h.TrendLineRenderer;v.setData(x),v.setHitTest(new s.HitTestResult(s.HitTarget.MovePoint,void 0,t)),i.append(v);const w={points:[f,g],color:r.childs().color.value(),linewidth:r.childs().linewidth.value(),linestyle:r.childs().linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal},R=new h.TrendLineRenderer;R.setData(w),R.setHitTest(new s.HitTestResult(s.HitTarget.MovePoint,void 0,t)),i.append(R)}}this.addAnchors(i),this._renderer=i}}class p extends u{constructor(){super(...arguments),this._modifiedBase=null,this._backSideRenderer=new h.TrendLineRenderer}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateRenderer(){if(this._points.length<2)return;this._calcMofifiedBase();const e=this._source.properties(),t=new a.CompositeRenderer,i=e.childs().median.childs();{const e={points:[this._points[0],this._points[1]],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal};if(this._backSideRenderer.setData(e),t.append(this._backSideRenderer),!this._medianPoint||!this._modifiedBase)return this.addAnchors(t),void(this._renderer=t)}{const n={points:[this._modifiedBase,this._medianPoint.point],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal};if(this._medianRenderer.setData(n),t.append(this._medianRenderer),this._points.length<3)return this.addAnchors(t),void(this._renderer=t)}{const e={points:[this._points[1],this._points[2]],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal};this._sideRenderer.setData(e),t.append(this._sideRenderer)}{const i=this._points[2].subtract(this._points[1]).scaled(.5),r=this._medianPoint.point.subtract(this._modifiedBase);let a=0;const l=e.childs().fillBackground.value(),c=e.childs().transparency.value();for(let u=0;u<=8;u++){const p="level"+u,_=(0,n.ensureDefined)(e.child(p));if(_.childs().visible.value()){const n=this._medianPoint.point.addScaled(i,_.childs().coeff.value()),p=n.add(r),f=this._medianPoint.point.addScaled(i,-_.childs().coeff.value()),g=f.add(r);if(l){const s=this._medianPoint.point.addScaled(i,a);{const i={p1:n,p2:p,p3:s,p4:s.add(r),color:_.childs().color.value(),transparency:c,hittestOnBackground:!0,
|
|
extendLeft:e.childs().extendLines.value()},a=new o.ChannelRenderer;a.setData(i),t.append(a)}{const n=this._medianPoint.point.addScaled(i,-a),s={p1:f,p2:g,p3:n,p4:n.add(r),color:_.childs().color.value(),transparency:c,hittestOnBackground:!0,extendLeft:e.childs().extendLines.value()},l=new o.ChannelRenderer;l.setData(s),t.append(l)}}a=_.childs().coeff.value();const x={points:[n,p],color:_.childs().color.value(),linewidth:_.childs().linewidth.value(),linestyle:_.childs().linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal},v=new h.TrendLineRenderer;v.setData(x),v.setHitTest(new s.HitTestResult(s.HitTarget.MovePoint,void 0,u)),t.append(v);const w={points:[f,g],color:_.childs().color.value(),linewidth:_.childs().linewidth.value(),linestyle:_.childs().linestyle.value(),extendleft:e.childs().extendLines.value(),extendright:!0,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal},R=new h.TrendLineRenderer;R.setData(w),R.setHitTest(new s.HitTestResult(s.HitTarget.MovePoint,void 0,u)),t.append(R)}}}this.addAnchors(t),this._renderer=t}_calcMofifiedBase(){this._points.length>1&&(this._modifiedBase=this._points[0].add(this._points[1]).scaled(.5))}}class _ extends p{_calcMofifiedBase(){if(this._points.length>2){const e=this._points[0].x,t=.5*(this._points[0].y+this._points[1].y),i=new r.Point(e,t);this._modifiedBase=i}}}class f extends u{constructor(){super(...arguments),this._backSideRenderer=new h.TrendLineRenderer,this._centerRenderer=new h.TrendLineRenderer,this._modifiedBase=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateRenderer(){if(this._points.length>1&&(this._modifiedBase=this._points[0].add(this._points[1]).scaled(.5)),this._points.length<2)return;const e=new a.CompositeRenderer;if(!this._medianPoint||!this._modifiedBase)return void this.addAnchors(e);const t=this._source.properties(),i=t.childs().median.childs();if(3===this._points.length){const t={points:[this._modifiedBase,this._points[2]],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal};this._medianRenderer.setData(t),e.append(this._medianRenderer)}{const t={points:[this._points[0],this._points[1]],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal};if(this._backSideRenderer.setData(t),e.append(this._backSideRenderer),this._points.length<3)return this.addAnchors(e),void(this._renderer=e)}{const t={points:[this._points[1],this._points[2]],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:!1,extendright:!1,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal};this._sideRenderer.setData(t),e.append(this._sideRenderer)}{const r=this._points[2].subtract(this._points[1]).scaled(.5),a=this._points[2].subtract(this._modifiedBase);let l=0
|
|
;const c=t.childs().fillBackground.value(),u=t.childs().transparency.value(),p={points:[this._medianPoint.point,this._medianPoint.point.add(a)],color:i.color.value(),linewidth:i.linewidth.value(),linestyle:i.linestyle.value(),extendleft:t.childs().extendLines.value(),extendright:!0,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal};this._centerRenderer.setData(p),e.append(this._centerRenderer);for(let i=0;i<=8;i++){const p="level"+i,_=(0,n.ensureDefined)(t.child(p)).childs();if(_.visible.value()){const n=this._medianPoint.point.addScaled(r,_.coeff.value()),p=n.add(a),f=this._medianPoint.point.addScaled(r,-_.coeff.value()),g=f.add(a);if(c){{const i=this._medianPoint.point.addScaled(r,l),s={p1:n,p2:p,p3:i,p4:i.add(a),color:_.color.value(),transparency:u,hittestOnBackground:!0,extendLeft:t.childs().extendLines.value()},d=new o.ChannelRenderer;d.setData(s),e.append(d)}{const i=this._medianPoint.point.addScaled(r,-l),n={p1:f,p2:g,p3:i,p4:i.add(a),color:_.color.value(),transparency:u,hittestOnBackground:!0,extendLeft:t.childs().extendLines.value()},s=new o.ChannelRenderer;s.setData(n),e.append(s)}}l=_.coeff.value();const x={points:[n,p],color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:t.childs().extendLines.value(),extendright:!0,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal},v=new h.TrendLineRenderer;v.setData(x),v.setHitTest(new s.HitTestResult(s.HitTarget.MovePoint,void 0,i)),e.append(v);const w={points:[f,g],color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:t.childs().extendLines.value(),extendright:!0,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal},R=new h.TrendLineRenderer;R.setData(w),R.setHitTest(new s.HitTestResult(s.HitTarget.MovePoint,void 0,i)),e.append(R)}}}this.addAnchors(e),this._renderer=e}}},65765:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PolylinePaneView:()=>o});var n=i(74011),r=i(95201),s=i(27916);class o extends s.LineSourcePaneView{constructor(e,t){super(e,t),this._polygonRenderer=new n.PolygonRenderer,this._renderer=new r.CompositeRenderer}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer.clear();const t=this._source.properties().childs(),i={points:this._points,color:t.linecolor.value(),linewidth:t.linewidth.value(),linestyle:t.linestyle.value(),filled:t.filled.value(),backcolor:t.backgroundColor.value(),fillBackground:t.fillBackground.value(),transparency:t.transparency.value()};this._polygonRenderer.setData(i),this._renderer.append(this._polygonRenderer),this.addAnchors(this._renderer)}}},38420:(e,t,i)=>{"use strict";var n=i(27916).LineSourcePaneView,r=i(91920),s=i(56468).HitTestResult,o=i(56468).HitTarget,a=i(63273),l=i(34585).appendEllipsis,d=i(75919).MediaCoordinatesPaneRenderer,h=i(31352).orderLineLocation;const{setLineStyle:c,drawLine:u,drawPoly:p}=i(37743),{LINESTYLE_SOLID:_}=i(51056);class f extends d{constructor(e,t){super(),this._data=null,this._cache=e,this._adapter=t}setData(e){this._data=e}_height(){
|
|
return Math.max(20,1+Math.max(r.fontHeight(this._adapter.getBodyFont()),r.fontHeight(this._adapter.getQuantityFont())))}_bodyWidth(e){if(0===this._adapter.getText().length)return 0;e.save(),e.font=this._adapter.getBodyFont();var t=e.measureText(this._adapter.getText()).width;return e.restore(),Math.round(10+t)}_getQuantity(){return this._adapter.getQuantity()}_quantityWidth(e){if(0===this._getQuantity().length)return 0;e.save(),e.font=this._adapter.getQuantityFont();var t=e.measureText(this._getQuantity()).width;return e.restore(),Math.round(Math.max(this._height(),10+t))}_reverseButtonWidth(){return this._adapter.isOnReverseCallbackPresent()?this._height():0}_closeButtonWidth(){return this._adapter.isOnCloseCallbackPresent()?this._height():0}_drawLines(e,t,i,n,r){e.save(),e.strokeStyle=this._adapter.getLineColor(),c(e,this._adapter.getLineStyle()),e.lineWidth=this._adapter.getLineWidth(),u(e,i,n,r,n),this._adapter.getExtendLeft()&&u(e,0,n,t,n),e.restore()}_drawBody(e,t,i){e.strokeStyle=this._adapter.getBodyBorderColor(),e.fillStyle=this._adapter.getBodyBackgroundColor();var n=this._bodyWidth(e),r=this._height();e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r)}_drawBodyText(e,t,i){e.save(),e.textAlign="center",e.textBaseline="middle",e.font=this._adapter.getBodyFont(),e.fillStyle=this._adapter.getBodyTextColor();var n=t+this._bodyWidth(e)/2,r=i+this._height()/2;e.fillText(this._adapter.getText(),n,r),e.restore()}_drawQuantity(e,t,i){e.strokeStyle=this._adapter.getQuantityBorderColor(),e.fillStyle=this._adapter.getQuantityBackgroundColor();var n=this._quantityWidth(e),r=this._height();e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r)}_drawQuantityText(e,t,i){e.save(),e.textAlign="center",e.textBaseline="middle",e.font=this._adapter.getQuantityFont(),e.fillStyle=this._adapter.getQuantityTextColor();var n=t+this._quantityWidth(e)/2,r=i+this._height()/2;e.fillText(a.startWithLTR(this._getQuantity()+""),n,r),e.restore()}_drawReverseButton(e,t,i){e.save(),e.strokeStyle=this._adapter.getReverseButtonBorderColor(),e.fillStyle=this._adapter.getReverseButtonBackgroundColor();var 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();var s=function(e,t){c(e,_),u(e,0,0,0,t),u(e,-1,1,1,1),u(e,-2,2,2,2)},o=t+Math.round((this._reverseButtonWidth()-6)/2),a=i+5;e.save(),e.translate(o,a),s(e,10),e.translate(6,10),e.rotate(Math.PI),s(e,10),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()}_drawCloseButton(e,t,i){e.save(),e.strokeStyle=this._adapter.getCloseButtonBorderColor(),e.fillStyle=this._adapter.getCloseButtonBackgroundColor();var n=this._closeButtonWidth(),r=this._height();e.fillRect(t+.5,i+.5,n-1,r-1),e.strokeRect(t,i,n,r);var s=t+n,o=i+r;e.strokeStyle=this._adapter.getCloseButtonIconColor();var a=(this._closeButtonWidth()-8)/2,l=(this._height()-8)/2;p(e,[{x:t+a,y:i+l},{x:s-a,y:o-l}],!0),p(e,[{x:s-a,y:i+l},{x:t+a,y:o-l}],!0),
|
|
this._adapter._blocked&&(e.fillStyle="rgba(140, 140, 140, 0.75)",e.fillRect(t+.5,i+.5,n-1,r-1)),e.restore()}_drawImpl(e){if(null===this._data||!this._data.points||this._data.points.length<1)return;var t=e.context,i=this._data.width,n=this._bodyWidth(t),r=this._quantityWidth(t),s=this._reverseButtonWidth(t),o=n+r+s+this._closeButtonWidth();const{left:a,right:l}=h(this._adapter,i,o);var d=Math.round(this._data.points[0].y),c=Math.round(d-(this._height()+1)/2);this._cache.bodyRight=a+n,this._cache.quantityRight=this._cache.bodyRight+r,this._cache.reverseButtonRight=this._cache.quantityRight+s,this._cache.top=c,this._cache.bottom=c+this._height(),this._cache.left=a,this._cache.right=l,this._drawLines(t,a,l,d,i),0!==n&&(this._drawBody(t,a,c),this._drawBodyText(t,a,c)),0!==r&&(this._drawQuantity(t,this._cache.bodyRight,c),this._drawQuantityText(t,this._cache.bodyRight,c)),0!==s&&this._drawReverseButton(t,this._cache.quantityRight,c),0!==this._closeButtonWidth()&&this._drawCloseButton(t,this._cache.reverseButtonRight,c)}hitTest(e){return null===this._data||0===this._data.points.length||e.y<this._cache.top||e.y>this._cache.bottom||e.x<this._cache.left||this._cache.right<e.x?null:this._adapter._blocked?new s(o.Custom,{}):e.x>=this._cache.bodyRight&&e.x<this._cache.quantityRight&&this._adapter._onModifyCallback?new s(o.Custom,{clickHandler:this._adapter.callOnModify.bind(this._adapter),tapHandler:this._adapter.callOnModify.bind(this._adapter),tooltip:{text:this._adapter.getProtectTooltip()||l(i.i18next(null,void 0,i(24927))),rect:{x:this._cache.bodyRight,y:this._cache.top,w:this._cache.quantityRight-this._cache.bodyRight,h:this._cache.bottom-this._cache.top}}}):e.x>=this._cache.quantityRight&&e.x<this._cache.reverseButtonRight?new s(o.Custom,{clickHandler:this._adapter.callOnReverse.bind(this._adapter),tapHandler:this._adapter.callOnReverse.bind(this._adapter),tooltip:{text:this._adapter.getReverseTooltip()||i.i18next(null,void 0,i(98818)),rect:{x:this._cache.quantityRight,y:this._cache.top,w:this._cache.reverseButtonRight-this._cache.quantityRight,h:this._cache.bottom-this._cache.top}}}):e.x>=this._cache.reverseButtonRight&&e.x<this._cache.right?new s(o.Custom,{clickHandler:this._adapter.callOnClose.bind(this._adapter),tapHandler:this._adapter.callOnClose.bind(this._adapter),tooltip:{text:this._adapter.getCloseTooltip()||i.i18next(null,void 0,i(59783)),rect:{x:this._cache.reverseButtonRight,y:this._cache.top,w:this._cache.right-this._cache.reverseButtonRight,h:this._cache.bottom-this._cache.top}}}):new s(o.Custom,{clickHandler:function(){},tapHandler:function(){},tooltip:{text:this._adapter.getTooltip(),rect:{x:this._cache.left,y:this._cache.top,w:this._cache.bodyRight-this._cache.left,h:this._cache.bottom-this._cache.top}}})}}t.PositionPaneView=class extends n{constructor(e,t){super(e,t),this._rendererCache={},this._renderer=new f(this._rendererCache,e._adapter)}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer.setData({points:this._points,width:this._model.timeScale().width()}),this._renderer}}},
|
|
27442:(e,t,i)=>{"use strict";var n,r;i.d(t,{AlertStatus:()=>n,Direction:()=>r}),function(e){e[e.Waiting=0]="Waiting",e[e.Success=1]="Success",e[e.Failure=2]="Failure"}(n||(n={})),function(e){e[e.Up=1]="Up",e[e.Down=2]="Down"}(r||(r={}))},75872:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PredictionPaneView:()=>H});var n,r=i(83873),s=i(50151),o=i(11542),a=i(19938),l=i(19063),d=i(63273),h=i(82826),c=i(74079),u=i(15344),p=i(92953),_=i(85049),f=i(95201),g=i(27916),x=i(86441),v=i(9859),w=i(7114),R=i(15938),T=i(68979),m=i(56468),b=i(37743),y=i(75919),P=i(2844),L=i(27442);!function(e){e[e.TargetFontSize1=14]="TargetFontSize1",e[e.TargetFontSize2=11]="TargetFontSize2",e[e.SourceFontSize1=12]="SourceFontSize1",e[e.SourceFontSize2=10]="SourceFontSize2",e[e.ArrowOffset=6]="ArrowOffset",e[e.ArrowHeight=5]="ArrowHeight",e[e.ArrowWidth=5]="ArrowWidth",e[e.Radius=3]="Radius",e[e.LabelsLeftOffset=4]="LabelsLeftOffset",e[e.LabelsTopOffset=3]="LabelsTopOffset",e[e.LabelsBoxLineWidth=2]="LabelsBoxLineWidth",e[e.LabelsBoxWidthDelta=15]="LabelsBoxWidthDelta",e[e.LabelsMinLeftOffset=20]="LabelsMinLeftOffset",e[e.LabelsCircleRadius=3]="LabelsCircleRadius",e[e.StartLabelTopOffset=2]="StartLabelTopOffset"}(n||(n={}));const S=(0,T.makeFont)(14,R.CHART_FONT_FAMILY,"normal"),C=(0,T.makeFont)(14,R.CHART_FONT_FAMILY,"bold"),A=(0,T.makeFont)(11,R.CHART_FONT_FAMILY,"normal"),M=(0,T.makeFont)(12,R.CHART_FONT_FAMILY,"normal"),I=(0,T.makeFont)(10,R.CHART_FONT_FAMILY,"normal");class k extends y.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null,this._sourceWidth=void 0,this._sourceHeight=void 0,this._sourceRectLeftOffset=void 0,this._targetWidth=void 0,this._targetHeight=void 0,this._targetRectLeftOffset=void 0,this._target1TextWidthCache=new P.TextWidthCache,this._target1BoldTextWidthCache=new P.TextWidthCache,this._target2TextWidthCache=new P.TextWidthCache,this._source1TextWidthCache=new P.TextWidthCache,this._source2TextWidthCache=new P.TextWidthCache}setData(e){this._data=e}hitTest(e){if(null===this._data||this._data.points.length<2)return null;const t=this._data.points[0],i=this._data.points[1].subtract(t),n=e.subtract(t),r=Math.abs(i.x),s=Math.abs(i.y),o=(0,v.sign)(i.y)*(s-s*Math.sqrt(1-n.x*n.x/(r*r)));if(Math.abs(o-n.y)<3)return new m.HitTestResult(m.HitTarget.MovePoint);const a=this._targetLabelHitTest(e);return a||this._sourceLabelHitTest(e)}_drawImpl(e){if(null===this._data||this._data.points.length<2)return;const t=e.context;t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth;const i=this._data.points[0],n=this._data.points[1],r=n.subtract(i),s=Math.abs(r.x),o=Math.abs(r.y);let a,l,d;r.y<0?(a=Math.PI/2,l=r.x>0?0:Math.PI,d=1):(a=-Math.PI/2,l=r.x>0?0:-Math.PI,d=-1),t.beginPath(),t.ellipse(i.x,n.y,s,o,0,a,l,a>l),t.stroke(),this._drawTargetLabel(t,e.mediaSize),this._drawStartLabel(t,e.mediaSize);const h=Math.max(8,4*this._data.linewidth);let c;if(Math.abs(r.x)<1||Math.abs(r.y)<1)c=Math.atan(r.x/r.y);else{let e=0,t=Math.PI/2,i=(e+t)/2,n=0,a=0;if(r.length()>h){let r=0;for(;10!==r;){n=s*Math.sin(i),
|
|
a=o*(1-Math.cos(i));const l=Math.sqrt((n-s)*(n-s)+(a-o)*(a-o));if(Math.abs(l-h)<1)break;l>h?e=i:t=i,i=(e+t)/2,r++}}c=Math.atan((s-n)/(o-a)),r.x*r.y<0&&(c=-c)}t.fillStyle=this._data.color,t.save(),t.beginPath(),t.translate(n.x,n.y),t.rotate(-c),t.moveTo(0,0),t.lineTo(-h/2,d*h),t.lineTo(h/2,d*h),t.lineTo(0,0),t.restore(),t.fill()}_drawBalloon(e,t,i,n,r,s=20){e.beginPath();if(r===L.Direction.Down){const r=new x.Point(t.x-s,t.y-6-5-n);return e.moveTo(r.x+3,r.y),e.lineTo(r.x+i-3,r.y),e.arcTo(r.x+i,r.y,r.x+i,r.y+3,3),e.lineTo(r.x+i,r.y+n-3),e.arcTo(r.x+i,r.y+n,r.x+i-3,r.y+n,3),e.lineTo(r.x+s+5,r.y+n),e.lineTo(r.x+s,r.y+n+5),e.lineTo(r.x+s-5,r.y+n),e.lineTo(r.x+3,r.y+n),e.arcTo(r.x,r.y+n,r.x,r.y+n-3,3),e.lineTo(r.x,r.y+3),e.arcTo(r.x,r.y,r.x+3,r.y,3),r}{const r=new x.Point(t.x-s,t.y+6+5+n);return e.moveTo(r.x+3,r.y),e.lineTo(r.x+i-3,r.y),e.arcTo(r.x+i,r.y,r.x+i,r.y-3,3),e.lineTo(r.x+i,r.y-n+3),e.arcTo(r.x+i,r.y-n,r.x+i-3,r.y-n,3),e.lineTo(r.x+s+5,r.y-n),e.lineTo(r.x+s,r.y-n-5),e.lineTo(r.x+s-5,r.y-n),e.lineTo(r.x+3,r.y-n),e.arcTo(r.x,r.y-n,r.x,r.y-n+3,3),e.lineTo(r.x,r.y-3),e.arcTo(r.x,r.y,r.x+3,r.y,3),new x.Point(r.x,r.y-n)}}_drawTargetLabel(e,t){if(null===this._data)return;e.save();const n=this._data.targetLine1,r=this._data.targetLine2,s=this._data.targetLine3,a=this._data.targetLine4;e.font=S;const l=this._target1TextWidthCache.measureText(e,n),h=this._target1TextWidthCache.measureText(e,r),c=this._target1TextWidthCache.measureText(e," ");e.font=A;const u=this._target2TextWidthCache.measureText(e,s),p=this._target2TextWidthCache.measureText(e,a),_=this._target2TextWidthCache.measureText(e," "),f=this._data.clockWhite&&this._data.clockWhite.width||0;this._targetWidth=Math.max(l+h+c,u+p+f+2*_)+8+4,this._targetHeight=38;const g=this._data.points[1],x=g.x+this._targetWidth-t.width+5;this._targetRectLeftOffset=Math.max(20,Math.min(this._targetWidth-15,x));const v=this._data.direction===L.Direction.Up?L.Direction.Down:L.Direction.Up,R=this._drawBalloon(e,g,this._targetWidth,this._targetHeight,v,this._targetRectLeftOffset);e.fillStyle=this._data.targetBackColor,e.fill(),e.lineWidth=2,e.strokeStyle=this._data.targetStrokeColor,e.stroke(),e.beginPath(),e.arc(g.x,g.y,3,0,2*Math.PI,!1),e.fillStyle=this._data.centersColor,e.fill(),e.textBaseline="top",e.fillStyle=this._data.targetTextColor;const T=2+R.x+4,m=2+R.y+3,y=this._targetWidth-8-4;e.font=S,e.textAlign=(0,d.isRtl)()?"right":"left";const P=(0,w.calcTextHorizontalShift)(e,y-h-c);e.fillText(n,T+P,m);const M=(0,w.calcTextHorizontalShift)(e,y-l);e.fillText(r,T+l+c+M,m),e.font=A;const I=m+14+3,k=(0,w.calcTextHorizontalShift)(e,y-p-f-_);e.fillText(s,T+k,I);const H=(0,w.calcTextHorizontalShift)(e,y-u-_-f-p);this._data.clockWhite&&e.drawImage(this._data.clockWhite,T+u+_+H,I+1);const B=(0,w.calcTextHorizontalShift)(e,y-u-f);if(e.fillText(a,T+u+f+2*_+B,I),!this._data.status)return void e.restore();let D,z,E,V;if(e.font=C,this._data.status===L.AlertStatus.Success)D=o.t(null,void 0,i(26409)),z=this._data.successBackground,E=this._data.successTextColor,
|
|
V=this._data.successIcon;else D=o.t(null,void 0,i(47545)),z=this._data.failureBackground,E=this._data.failureTextColor,V=this._data.failureIcon;const N=18,W=this._target1BoldTextWidthCache.measureText(e,D),O=Math.round((this._targetWidth-W)/2),F=(0,w.calcTextHorizontalShift)(e,W);e.fillStyle=z,this._data.direction===L.Direction.Up?((0,b.drawRoundRect)(e,R.x-1,R.y-N-2,this._targetWidth+2,N,5),e.fill(),e.fillStyle=E,e.fillText(D,R.x+O+F,R.y-N+1),V&&e.drawImage(V,R.x+O-V.width-4,R.y-N-2+Math.abs(N-V.height)/2)):((0,b.drawRoundRect)(e,R.x-1,R.y+this._targetHeight+2,this._targetWidth+2,N,5),e.fill(),e.fillStyle=E,e.fillText(D,R.x+O+F,R.y+this._targetHeight+5),V&&e.drawImage(V,R.x+O-V.width-4,R.y+this._targetHeight+10-Math.abs(N-V.height)/2)),e.restore()}_drawStartLabel(e,t){if(null===this._data)return;e.save();e.font=M;const i=this._source1TextWidthCache.measureText(e,this._data.sourceLine1);e.font=I;const n=this._source2TextWidthCache.measureText(e,this._data.sourceLine2);this._sourceWidth=Math.max(i,n)+6+4,this._sourceHeight=32;const r=this._data.points[0],s=r.x+this._sourceWidth-t.width+5;this._sourceRectLeftOffset=Math.max(20,Math.min(this._sourceWidth-15,s));const o=this._drawBalloon(e,r,this._sourceWidth,this._sourceHeight,this._data.direction,this._sourceRectLeftOffset);e.fillStyle=this._data.sourceBackColor,e.fill(),e.lineWidth=2,e.strokeStyle=this._data.sourceStrokeColor,e.stroke(),e.textAlign=(0,d.isRtl)()?"right":"left",e.textBaseline="top",e.fillStyle=this._data.sourceTextColor;const a=(0,w.calcTextHorizontalShift)(e,this._sourceWidth-6-4),l=2+o.x+3+a,h=2+o.y+2;e.font=M,e.fillText(this._data.sourceLine1,l,h),e.font=I,e.fillText(this._data.sourceLine2,l,h+12+2),e.beginPath(),e.arc(r.x,r.y,3,0,2*Math.PI,!1),e.fillStyle=this._data.centersColor,e.fill(),e.restore()}_targetLabelHitTest(e){if(null===this._data||void 0===this._targetWidth||void 0===this._targetHeight||void 0===this._targetRectLeftOffset)return null;let t=this._targetHeight+5;this._data.status&&(t+=24);const i=this._data.direction===L.Direction.Up?-1:1,n=this._data.points[1],r=n.x-this._targetRectLeftOffset,s=n.y+3*i,o=n.y+i*(t+3),a=Math.min(s,o),l=Math.max(s,o);return e.x>=r&&e.x<=r+this._targetWidth&&e.y>=a&&e.y<=l?new m.HitTestResult(m.HitTarget.MovePoint):null}_sourceLabelHitTest(e){if(null===this._data||void 0===this._sourceHeight||void 0===this._sourceWidth||void 0===this._sourceRectLeftOffset)return null;const t=this._data.direction===L.Direction.Up?1:-1,i=this._data.points[0],n=i.x-this._sourceRectLeftOffset,r=i.y+3*t,s=i.y+(3+this._sourceHeight+5)*t,o=Math.min(r,s),a=Math.max(r,s);return e.x>=n&&e.x<=n+this._sourceWidth&&e.y>=o&&e.y<=a?new m.HitTestResult(m.HitTarget.MovePoint):null}}class H extends g.LineSourcePaneView{constructor(e,t){super(e,t),this._clockWhite=null,this._successIcon=null,this._failureIcon=null,this._pendingIcons=3,this._predictionRenderer=new k,this._renderer=new f.CompositeRenderer;const n=()=>{this._pendingIcons-=1,0===this._pendingIcons&&this._source.model().updateSource(this._source)};(0,
|
|
a.getImage)("prediction-clock-white",i(99620)).then((e=>{this._clockWhite=e,n()})),(0,a.getImage)("prediction-success-white",i(14012)).then((e=>{this._successIcon=e,n()})),(0,a.getImage)("prediction-failure-white",i(88249)).then((e=>{this._failureIcon=e,n()}))}iconsReady(){return 0===this._pendingIcons}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer.clear();const t=this._source.points();if(t.length<2)return;if(!this._source.priceScale())return;const n=(0,s.ensureNotNull)(this._source.ownerSource()).formatter(),a=t[1],f=t[0],g=(0,d.forceLTRStr)(n.format(a.price)),x=a.price-f.price,v=x/Math.abs(f.price)*100,w=(0,d.forceLTRStr)(`${n.format(x)} (${(0,c.getPercentageFormatter)().format(v)})`),R=this._model.timeScale();let T=R.indexToUserTime(f.index),m=R.indexToUserTime(a.index);f.time&&a.time&&(T=(0,r.default)(f.time)?new Date(Date.parse(f.time)):new Date(1e3*f.time),m=(0,r.default)(a.time)?new Date(Date.parse(a.time)):new Date(1e3*a.time));const b=this._model.mainSeries().isDWM(),y=_.Interval.parse(this._model.mainSeries().interval()),P=y.isSeconds()||y.isTicks();let L="",S="";if(m&&T){const e=b?"":` ${new u.TimeFormatter(P?u.hourMinuteSecondFormat:u.hourMinuteFormat).format(m)}`;S=`${(new h.DateFormatter).format(m)}${e}`;const t=(m.valueOf()-T.valueOf())/1e3;L=`${o.t(null,{context:"dates"},i(71682))} ${(0,d.startWithLTR)((new p.TimeSpanFormatter).format(t))}`}const C=n.format(f.price);let A="";const M=R.indexToUserTime(f.index);if(M){const e=b?"":` ${new u.TimeFormatter(P?u.hourMinuteSecondFormat:u.hourMinuteFormat).format(M)}`;A=`${(new h.DateFormatter).format(M)}${e}`}const I=this._model.lineBeingCreated()!==this._source&&this._model.lineBeingEdited()!==this._source&&!this._model.sourcesBeingMoved().includes(this._source),k=this._source.properties().childs(),H=k.transparency.value(),B={points:this._points,color:k.linecolor.value(),linewidth:k.linewidth.value(),targetLine1:w,targetLine2:L,targetLine3:g,targetLine4:S,status:k.status.value(),targetBackColor:(0,l.generateColor)(k.targetBackColor.value(),H),targetStrokeColor:(0,l.generateColor)(k.targetStrokeColor.value(),H),targetTextColor:k.targetTextColor.value(),sourceBackColor:(0,l.generateColor)(k.sourceBackColor.value(),H),sourceStrokeColor:(0,l.generateColor)(k.sourceStrokeColor.value(),H),sourceTextColor:k.sourceTextColor.value(),successBackground:(0,l.generateColor)(k.successBackground.value(),H),successTextColor:k.successTextColor.value(),failureBackground:(0,l.generateColor)(k.failureBackground.value(),H),failureTextColor:k.failureTextColor.value(),intermediateBackColor:k.intermediateBackColor.value(),intermediateTextColor:k.intermediateTextColor.value(),sourceLine1:C,sourceLine2:A,direction:this._source.direction(),clockWhite:this._clockWhite,successIcon:this._successIcon,failureIcon:this._failureIcon,finished:I,centersColor:this._model.backgroundCounterColor().value()};this._predictionRenderer.setData(B),this._renderer.append(this._predictionRenderer),this.addAnchors(this._renderer)
|
|
}}},4465:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PriceLabelPaneView:()=>x});var n=i(68979),r=i(15938),s=i(36036),o=i(56468),a=i(95201),l=i(11064),d=i(27916),h=i(34026),c=i(86441),u=i(7114),p=i(19063),_=i(63273),f=i(75919);class g extends f.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._measureCache=null,this._data=null,this._points=null}setData(e){this._data=e,this._points=e.points}hitTest(e){if(null===this._data||null===this._points||0===this._points.length||!this._measureCache)return null;const t=this._points[0].x-this._measureCache.tailLeft,i=this._points[0].y-(this._measureCache.innerHeight+this._measureCache.tailHeight),n=(0,c.box)(new c.Point(t,i),new c.Point(t+this._measureCache.innerWidth,i+this._measureCache.innerHeight));return(0,h.pointInBox)(e,n)?new o.HitTestResult(o.HitTarget.MovePoint):null}_drawImpl(e){if(null===this._data||null===this._points||0===this._points.length)return;const t=e.context;t.font=this._data.font;const i=t.measureText(this._data.label),n=this._data.fontSize,r=10,s=5,o=i.width+2*r,a=n+2*s,l=this._points[0].x- -9,d=this._points[0].y-(a+15),h=(0,u.calcTextHorizontalShift)(t,i.width);this._measureCache={innerWidth:o,innerHeight:a,tailLeft:-9,tailHeight:15},t.textAlign=(0,_.isRtl)()?"right":"left",t.translate(l,d),t.beginPath(),t.moveTo(12,a),t.lineTo(-9,a+15),t.lineTo(5,a),t.lineTo(3,a),t.arcTo(0,a,0,0,3),t.lineTo(0,3),t.arcTo(0,0,o,0,3),t.lineTo(o-3,0),t.arcTo(o,0,o,a,3),t.lineTo(o,a-3),t.arcTo(o,a,0,a,3),t.lineTo(12,a),t.fillStyle=(0,p.generateColor)(this._data.backgroundColor,this._data.transparency),t.fill(),t.strokeStyle=this._data.borderColor,t.lineWidth=2,t.stroke(),t.closePath(),t.textBaseline="alphabetic",t.fillStyle=this._data.color,t.fillText(this._data.label,r+h,a/2+Math.floor(.35*this._data.fontSize)),t.beginPath(),t.arc(-9,a+15,2.5,0,2*Math.PI,!1),t.fillStyle=(0,p.generateColor)(this._data.borderColor,this._data.transparency),t.fill(),t.strokeStyle=this._data.chartBgColor,t.lineWidth=1,t.stroke(),t.closePath()}}class x extends d.LineSourcePaneView{constructor(){super(...arguments),this._renderer=new a.CompositeRenderer,this._priceLabelRenderer=new g}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer.clear();const t=this._source.points(),i=this._source.priceScale(),a=this._source.ownerSource();if(0===t.length||!i||i.isEmpty()||!a)return;const d=t[0].price,h=a.firstValue(),c=i.formatPrice(d,h??0),u=this._source.properties().childs(),p=u.fontsize.value(),_={points:this._points,borderColor:u.borderColor.value(),backgroundColor:u.backgroundColor.value(),color:u.color.value(),font:(0,n.makeFont)(p,r.CHART_FONT_FAMILY,"",u.fontWeight.value()),fontSize:p,transparency:u.transparency.value(),chartBgColor:this._model.backgroundColor().value(),label:c};this._priceLabelRenderer.setData(_),this._renderer.append(this._priceLabelRenderer),this._renderer.append(new l.SelectionRenderer({points:_.points.map(s.mapLineSourcePaneViewPointToLineAnchorPoint),bgColors:this._lineAnchorColors(_.points),
|
|
visible:this.areAnchorsVisible(),barSpacing:this._model.timeScale().barSpacing(),hittestResult:o.HitTarget.MovePoint}))}}},64661:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PriceRangePaneView:()=>x});var n=i(50151),r=i(86441),s=i(63273),o=i(30699),a=i(17330),l=i(62189),d=i(91046),h=i(95201),c=i(74079),u=i(51056),p=i(49857),_=i(15938),f=i(27436);const g=(0,c.getPercentageFormatter)();class x extends f.DateAndPriceRangeBasePaneView{constructor(){super(...arguments),this._topBorderRenderer=new d.TrendLineRenderer,this._bottomBorderRenderer=new d.TrendLineRenderer,this._distanceRenderer=new d.TrendLineRenderer,this._backgroundRenderer=new l.RectangleRenderer,this._labelRenderer=new a.TextRenderer,this._renderer=new h.CompositeRenderer}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer.clear(),this._points.length<2||this._source.points().length<2)return;const t=this._source.properties().childs(),i=t.extendLeft.value(),l=t.extendRight.value(),[d,h]=this._points,f=Math.min(d.x,h.x),x=Math.max(d.x,h.x);t.fillBackground.value()&&(this._backgroundRenderer.setData({points:[new r.Point(f,d.y),new r.Point(x,h.y)],color:"white",linewidth:0,backcolor:t.backgroundColor.value(),fillBackground:!0,transparency:t.backgroundTransparency.value(),extendLeft:i,extendRight:l}),this._renderer.append(this._backgroundRenderer));const v=(e,n,r)=>{e.setData({points:[n,r],color:t.linecolor.value(),linewidth:t.linewidth.value(),linestyle:u.LINESTYLE_SOLID,extendleft:i,extendright:l,leftend:p.LineEnd.Normal,rightend:p.LineEnd.Normal}),this._renderer.append(e)};let w=f,R=x;w===R&&(i&&(w-=1),l&&(R+=1)),v(this._topBorderRenderer,new r.Point(w,d.y),new r.Point(R,d.y)),v(this._bottomBorderRenderer,new r.Point(w,h.y),new r.Point(R,h.y));const T=Math.round((d.x+h.x)/2),m=new r.Point(T,d.y),b=new r.Point(T,h.y),{mediaSize:{width:y,height:P}}=e,L=this._updateCustomTextRenderer(P,y);this._distanceRenderer.setData({points:[m,b],color:t.linecolor.value(),linewidth:t.linewidth.value(),linestyle:u.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:p.LineEnd.Normal,rightend:Math.abs(m.y-b.y)>=15*t.linewidth.value()?p.LineEnd.Arrow:p.LineEnd.Normal,excludeBoundaries:L?[L]:void 0}),this._renderer.append(this._distanceRenderer);const S=this._source.points()[0].price,C=this._source.points()[1].price,A=C-S,M=100*A/Math.abs(S),I=this._model.mainSeries().symbolInfo(),k=I&&(0,c.getPipFormatter)(I),H=(0,n.ensureNotNull)(this._source.ownerSource()).formatter(),B=H.formatChange?.(C,S)??H.format(A),D=(0,s.forceLTRStr)(B+" ("+g.format(M)+") "+(k?k.format(A):""));let z;z=C>S?new r.Point(.5*(d.x+h.x),h.y-2*t.fontsize.value()):new r.Point(.5*(d.x+h.x),h.y+.7*t.fontsize.value());const E={x:0,y:10},V=t.fontsize.value(),N={points:[z],text:D,color:t.textcolor.value(),font:_.CHART_FONT_FAMILY,offsetX:E.x,offsetY:E.y,lineSpacing:8,vertAlign:o.VerticalAlign.Middle,horzAlign:o.HorizontalAlign.Center,fontsize:V,backgroundRoundRect:4,boxPaddingHorz:.4*V+V/3,boxPaddingVert:.2*V+V/3},W=t.fillLabelBackground?.value()
|
|
;W&&(N.boxShadow={shadowColor:t.shadow.value(),shadowBlur:4,shadowOffsetY:1},N.backgroundColor=t.labelBackgroundColor.value()),this._labelRenderer.setData(N);const O=this._labelRenderer.measure(),F=(0,a.calculateLabelPosition)(O,d,h,E,P);this._labelRenderer.setPoints([F]),this._renderer.append(this._labelRenderer),this._renderer.append(this._customTextrenderer),this.addAnchors(this._renderer)}_needLabelExclusionPath(e){return e.getLinesInfo().lines.length>0}}},31869:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ProjectionLinePaneView:()=>d});var n=i(55053),r=i(84417),s=i(91046),o=i(95201),a=i(49857),l=i(27916);class d extends r.FibWedgePaneView{constructor(e,t){super(e,t),this._arcWedgeRenderer=new n.ArcWedgeRenderer,this._baseTrendRenderer=new s.TrendLineRenderer,this._edgeTrendRenderer=new s.TrendLineRenderer,this._arcWedgeRenderer=new n.ArcWedgeRenderer}_getPoints(){if(this._points.length<3)return this._points;const e=this._points,[t,i]=e;let n=e[2];const r=n.pointIndex,s=i.subtract(t).length(),o=n.subtract(t).normalized().scaled(s);return n=(0,l.createLineSourcePaneViewPoint)(t.add(o),r),[t,i,n]}_updateRenderer(e=NaN,t=NaN){if(this._points.length<2)return;const i=new o.CompositeRenderer,n=this._source.properties().childs(),[r,s,l]=this._getPoints(),d=n.trendline.childs().color.value(),h=n.linewidth.value(),c=n.trendline.childs().linestyle.value();if(this._baseTrendRenderer.setData({points:[r,s],color:d,linewidth:h,linestyle:c,extendleft:!1,extendright:!1,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal}),i.append(this._baseTrendRenderer),this._points.length<3)return this.addAnchors(i),void(this._renderer=i);this._edgeTrendRenderer.setData({points:[r,l],color:d,linewidth:h,linestyle:c,extendleft:!1,extendright:!1,leftend:a.LineEnd.Normal,rightend:a.LineEnd.Normal}),i.append(this._edgeTrendRenderer);const u=this._levels[0];this._arcWedgeRenderer.setData({center:this._points[0],radius:u.radius,prevRadius:0,color:d,color1:n.color1.value(),color2:n.color2.value(),linewidth:h,angle1:e,angle2:t,p1:u.p1,p2:u.p2,fillBackground:n.fillBackground.value(),transparency:n.transparency.value(),gradient:!0}),i.append(this._arcWedgeRenderer),this.addAnchors(i),this._renderer=i}}},41883:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RectanglePaneView:()=>x});var n=i(86441),r=i(50151),s=i(19063),o=i(30699),a=i(15938),l=i(62189),d=i(95201),h=i(72791),c=i(56468),u=i(17330),p=i(13075),_=i(32211),f=i(62689),g=i(36036);class x extends _.InplaceTextLineSourcePaneView{constructor(e,t,i,n,r){super(e,t,i,n,r),this._rectangleRenderer=new l.RectangleRenderer,this._renderer=null,this._textRenderer=new f.LineToolTextRenderer(void 0,new c.HitTestResult(c.HitTarget.MovePoint,(0,_.inplaceEditHandlers)(this._tryActivateEditMode.bind(this,null)))),this._source.setAdditionalCursorData((()=>({color:this._source.editableTextStyle().cursorColor,rotationPoint:this._textRenderer.rotation()??void 0,...this._textRenderer.getTextInfo()})),this._textRenderer.positionToCoordinate.bind(this._textRenderer))}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}
|
|
_updateImpl(e){if(super._updateImpl(e),this._renderer=null,this._textRenderer.setData(null),this._points.length<2)return;const t=this._getSource().properties().childs(),i=t.extendLeft.value(),l=t.extendRight.value(),h={points:this._points,color:t.color.value(),linewidth:t.linewidth.value(),linestyle:t.linestyle.value(),backcolor:t.fillBackground.value()?(0,s.generateColor)(t.backgroundColor.value(),t.transparency.value()):"transparent",fillBackground:!0,extendLeft:i,extendRight:l,backgroundHitTarget:this._model.selection().isSelected(this._source)?c.HitTarget.MovePoint:void 0},_=new d.CompositeRenderer;_.append(this._rectangleRenderer);const[f,g]=this._points,{mediaSize:{width:x,height:v}}=e,w=this._placeHolderMode();let R=!1;const T=this._rectangleRenderer.visibleRectSegment(e.mediaSize);if(null!==T&&(t.showLabel?.value()&&t.text.value()||w||this._isTextEditMode())){const e=Math.min(f.x,g.x),s=Math.max(f.x,g.x),d=Math.min(f.y,g.y),h=Math.max(f.y,g.y),c=t.horzLabelsAlign.value();let m,b;const y=t.fontSize.value()/3;let P=0;const[L]=(0,u.getTextAlignInBox)({horzAlign:c,extendLeft:i,extendRight:l,width:x,leftPoint:(0,n.point)(e,d),rightPoint:(0,n.point)(s,h)});switch(t.vertLabelsAlign.value()){case o.VerticalAlign.Middle:b=(d+h)/2,m=o.VerticalAlign.Middle,P=y;break;case o.VerticalAlign.Top:b=h,m=o.VerticalAlign.Top;break;case o.VerticalAlign.Bottom:b=d,m=o.VerticalAlign.Bottom}const S=c===o.HorizontalAlign.Left&&i||c===o.HorizontalAlign.Right&&l;let C,A;m===o.VerticalAlign.Middle&&(C=(l?x:s)-(i?0:e)-2*P,A=h-d),this._textRenderer.setData({points:[new n.Point(L.x,b)],text:this._textData(),color:this._textColor(),fontSize:t.fontSize.value(),font:a.CHART_FONT_FAMILY,bold:t.bold.value(),italic:t.italic.value(),horzAlign:c,vertAlign:m,wordWrapWidth:w?void 0:C,maxHeight:w?void 0:A,offsetX:0,offsetY:0,boxPaddingVert:y,boxPaddingHorz:P,forceTextAlign:!0,forceCalculateMaxLineWidth:!0,decorator:w?p.PlusTextRendererDecorator.instance():void 0,...this._inplaceTextHighlight()});const M=this._textRenderer.measure().width;if(S){const[e,t]=T,i=t.x-e.x-M;i<0&&this._textRenderer.setData({...(0,r.ensureNotNull)(this._textRenderer.data()),offsetX:i})}let I=!1;void 0!==C&&w&&M>C&&(this._textRenderer.updateData({text:""}),I=M>C),I||(this._textRenderer.setCursorType(this._textCursorType()),this._textRenderer.isOutOfScreen(x,v)?this.closeTextEditor():this._updateInplaceText(this._textRenderer.getTextInfo()),_.append(this._textRenderer),R=!0)}if(t.middleLine.childs().showLine.value()){let e;R&&"middle"===t.vertLabelsAlign.value()&&(0,u.needTextExclusionPath)(this._textRenderer)&&(e=(0,u.getTextBoundaries)(this._textRenderer,x,v)??void 0);const{lineColor:i,lineWidth:n,lineStyle:r}=t.middleLine.state();h.middleLine={lineColor:i,lineWidth:n,lineStyle:r,excludeBoundaries:e}}this._rectangleRenderer.setData(h),this._addAnchors(f,g,_),this._renderer=_}_addAnchors(e,t,i){
|
|
const r=e.x-t.x,s=e.y-t.y,o=Math.sign(r*s),a=o<0?h.PaneCursorType.DiagonalNeSwResize:h.PaneCursorType.DiagonalNwSeResize,l=o<0?h.PaneCursorType.DiagonalNwSeResize:h.PaneCursorType.DiagonalNeSwResize,d=[(0,g.lineSourcePaneViewPointToLineAnchorPoint)(e,void 0,a),(0,g.lineSourcePaneViewPointToLineAnchorPoint)(t,void 0,a),(0,g.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(e.x,t.y),2,l),(0,g.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(t.x,e.y),3,l),(0,g.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(e.x,.5*(e.y+t.y)),4,h.PaneCursorType.HorizontalResize,!0),(0,g.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(t.x,.5*(e.y+t.y)),5,h.PaneCursorType.HorizontalResize,!0),(0,g.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(.5*(e.x+t.x),e.y),6,h.PaneCursorType.VerticalResize,!0),(0,g.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(.5*(e.x+t.x),t.y),7,h.PaneCursorType.VerticalResize,!0)];i.append(this.createLineAnchor({points:d},0))}}},90185:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RegressionTrendPaneView:()=>x});var n=i(50151),r=i(36036),s=i(19063),o=i(56468),a=i(95201),l=i(93610),d=i(17330),h=i(91046),c=i(11064),u=i(86441),p=i(30699),_=i(49857),f=i(15938);var g=i(27916);class x extends g.LineSourcePaneView{constructor(e,t){super(e,t),this._data=null,this._pearsonsLabelRenderer=new d.TextRenderer,this._renderer=null,this._renderer=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._data=function(e,t){const i={lines:[],pearsons:null};if(!t.properties().visible.value())return i;const r=e.timeScale(),s=t.priceScale(),o=e.mainSeries().firstBar();if(!s||s.isEmpty()||r.isEmpty()||!o)return i;const a=t.startIndex(),l=t.endIndex();if(null===a||null===l)return i;const d=[t.baseLine(),t.downLine(),t.upLine()],h=Math.round(r.indexToCoordinate(a)),c=Math.round(r.indexToCoordinate(l)),g=t.properties(),x=[g.styles.baseLine,g.styles.downLine,g.styles.upLine],v=o[4];for(let e=0;e<d.length;e++){if(1&~x[e].display.value())continue;const t=(0,n.ensureNotNull)(d[e]).startPrice,r=(0,n.ensureNotNull)(d[e]).endPrice;if(void 0===t||void 0===r)continue;const o=s.priceToCoordinate(t,v),a=s.priceToCoordinate(r,v),l={points:[new u.Point(h,o),new u.Point(c,a)],color:x[e].color.value(),linewidth:x[e].linewidth.value(),linestyle:x[e].linestyle.value(),extendleft:!1,extendright:g.styles.extendLines.value(),leftend:_.LineEnd.Normal,rightend:_.LineEnd.Normal};i.lines.push(l)}const w=(0,n.ensureNotNull)(t.downLine());if(g.styles.showPearsons.value()&&void 0!==w.startPrice){const e=s.priceToCoordinate(w.startPrice,v),n=new u.Point(h,e);i.pearsons={points:[n],text:""+t.pearsons(),color:g.styles.downLine.color.value(),vertAlign:p.VerticalAlign.Top,horzAlign:p.HorizontalAlign.Center,font:f.CHART_FONT_FAMILY,offsetX:0,offsetY:4,fontsize:12}}return i}(this._model,this._source),this._renderer=null;const t=new a.CompositeRenderer;let i=[]
|
|
;const d=[this._data.lines[1],this._data.lines[0],this._data.lines[2]].filter((e=>!!e)),g=this._source.properties().childs().styles.childs().transparency.value();for(let e=1;e<d.length;e++){const i=d[e].color,n=d[e].linewidth,r=d[e].linestyle,a=d[e].extendright,h={line1:{color:i,lineStyle:r,lineWidth:n,points:[d[e].points[0],d[e].points[1]]},line2:{color:i,lineStyle:r,lineWidth:n,points:[d[e-1].points[0],d[e-1].points[1]]},extendLeft:!1,extendRight:a,backColor:(0,s.generateColor)(d[e].color,g),skipLines:!0,fillBackground:!0},c=new l.ParallelChannelRenderer(new o.HitTestResult(o.HitTarget.Regular));c.setData(h),t.append(c)}const x=this._getTransparencyResetLines();for(let e=0;e<d.length;e++){const n=new h.TrendLineRenderer;n.setData(x[e]),n.setHitTest(new o.HitTestResult(o.HitTarget.Regular)),t.append(n),0!==e&&(i=i.concat(d[e].points))}this._data.pearsons&&(this._data.pearsons.color=(0,s.resetTransparency)(this._data.pearsons.color),this._pearsonsLabelRenderer.setData(this._data.pearsons),t.append(this._pearsonsLabelRenderer)),this._data.lines.length>=1&&t.append(new c.SelectionRenderer({points:i.map(r.mapLineSourcePaneViewPointToLineAnchorPoint),bgColors:this._lineAnchorColors(i),visible:this.areAnchorsVisible(),hittestResult:o.HitTarget.Regular,barSpacing:this._model.timeScale().barSpacing()})),this._renderer=t}_getTransparencyResetLines(){return(0,n.ensureNotNull)(this._data).lines.map((e=>({...e,color:(0,s.resetTransparency)(e.color)})))}}},1971:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RiskRewardPaneView:()=>M});var n=i(86441),r=i(50151),s=i(11542),o=i(27916),a=i(30699),l=i(91046),d=i(17330),h=i(62189),c=i(56468),u=i(95201),p=i(74079),_=i(19063),f=i(49857),g=i(76050),x=i(63273),v=i(72791),w=i(88145),R=i(15938),T=i(51056),m=i(36036);const b=s.t(null,void 0,i(76250)),y=s.t(null,{context:"line_tool_position"},i(18741)),P=s.t(null,{context:"line_tool_position"},i(72630)),L=s.t(null,void 0,i(36825)),S=s.t(null,void 0,i(79463)),C=s.t(null,void 0,i(72274)),A=s.t(null,void 0,i(10780));class M extends o.LineSourcePaneView{constructor(){super(...arguments),this._entryLineRenderer=new l.TrendLineRenderer,this._stopLineRenderer=new l.TrendLineRenderer,this._targetLineRenderer=new l.TrendLineRenderer,this._positionLineRenderer=new l.TrendLineRenderer,this._fullStopBgRenderer=new h.RectangleRenderer,this._stopBgRenderer=new h.RectangleRenderer,this._fullTargetBgRenderer=new h.RectangleRenderer,this._targetBgRenderer=new h.RectangleRenderer,this._stopLabelRenderer=new d.TextRenderer,this._middleLabelRenderer=new d.TextRenderer,this._profitLabelRenderer=new d.TextRenderer,this._renderer=new u.CompositeRenderer}isLabelVisible(){return this.isHoveredSource()||this.isSelectedSource()||this._source.properties().childs().alwaysShowStats.value()}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer.clear();const t=this._model.timeScale(),i=this._source.priceScale();if(!i||i.isEmpty()||t.isEmpty())return;const s=this._source.points()
|
|
;if(s.length<2||this._points.length<2)return;const o=(0,r.ensureNotNull)(this._source.ownerSource()),a=o?.barsProvider().bars();if(!a||a.isEmpty())return;if(null===a.last())return;const l=4===s.length,d=this._source.lastBarData();if(!d)return;const h=d.closePrice,c=this._source.stopPrice(),u=this._source.profitPrice(),_=this._source.calculatePL(h),f=o.symbolSource().symbolInfo();if(!f)return;const x=o.firstValue();if(null===x)return;const w=this._points[g.RiskRewardPointIndex.Entry].y,R=i.priceToCoordinate(c,x),T=i.priceToCoordinate(u,x),b=i.priceToCoordinate(d.closePrice,x),y=t.indexToCoordinate(d.index),P=this._points[g.RiskRewardPointIndex.Entry].x,L=this._points[g.RiskRewardPointIndex.ActualEntry]?this._points[g.RiskRewardPointIndex.ActualEntry].x:this._points[g.RiskRewardPointIndex.Close].x,S=this._points[g.RiskRewardPointIndex.ActualClose]?this._points[g.RiskRewardPointIndex.ActualClose].x:this._points[g.RiskRewardPointIndex.Close].x,C=this._points[g.RiskRewardPointIndex.Close].x,A=this._source.entryPrice(),M=this._source.stopPrice(),I=this._source.profitPrice(),k={pl:_,isClosed:l,entryLevel:w,stopLevel:R,profitLevel:T,closeLevel:b,closeBar:y,left:P,entryX:L,right:S,edge:C,entryPrice:A,stopPrice:M,profitPrice:I,currentPrice:h},{mediaSize:{width:H,height:B}}=e;let D=C<-5||P>H+5;if(this._createBackgroundRenderers(k,this._renderer),this._createLinesRenderers(k,this._renderer),this._createLabelsRenderers(k,this._renderer,f,(0,p.getPipFormatter)(f)),D=[this._profitLabelRenderer,this._stopLabelRenderer,this._middleLabelRenderer].reduce(((e,t)=>e&&t.isOutOfScreen(H,B)),D),D)return;const[z]=this._points,E=[(0,m.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(P,z.y),0,void 0,void 0,void 0,A),(0,m.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(C,z.y),1,v.PaneCursorType.HorizontalResize,!0,void 0,void 0,d.index),(0,m.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(P,R),2,v.PaneCursorType.VerticalResize,!0,void 0,M),(0,m.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(P,T),3,v.PaneCursorType.VerticalResize,!0,void 0,I)];this._renderer.append(this.createLineAnchor({points:E},0))}_createBackgroundRenderers(e,t){const i=this._source.properties().childs();{const t={points:[new n.Point(e.left,e.entryLevel),new n.Point(e.edge,e.stopLevel)],color:"white",linewidth:0,backcolor:i.stopBackground.value(),fillBackground:!0,transparency:i.stopBackgroundTransparency.value(),extendLeft:!1,extendRight:!1,backgroundHitTarget:c.HitTarget.MovePoint};this._fullStopBgRenderer.setData(t),this._renderer.append(this._fullStopBgRenderer)}if(e.pl<0&&e.entryX!==e.right){const t=new n.Point(e.entryX,e.entryLevel),r=new n.Point(e.right,e.closeLevel),s=.01*i.stopBackgroundTransparency.value(),o=100-100*(1-s*s*s),a={points:[t,r],color:"white",linewidth:0,backcolor:i.stopBackground.value(),fillBackground:!0,transparency:o,extendLeft:!1,extendRight:!1,backgroundHitTarget:c.HitTarget.MovePoint};this._stopBgRenderer.setData(a),this._renderer.append(this._stopBgRenderer)}{const t={
|
|
points:[new n.Point(e.left,e.entryLevel),new n.Point(e.edge,e.profitLevel)],color:"white",linewidth:0,backcolor:i.profitBackground.value(),fillBackground:!0,transparency:i.profitBackgroundTransparency.value(),extendLeft:!1,extendRight:!1,backgroundHitTarget:c.HitTarget.MovePoint};this._fullTargetBgRenderer.setData(t),this._renderer.append(this._fullTargetBgRenderer)}if(e.pl>0&&e.entryX!==e.right){const t=new n.Point(e.entryX,e.entryLevel),r=new n.Point(e.right,e.closeLevel),s=.01*i.profitBackgroundTransparency.value(),o=100-100*(1-s*s*s),a={points:[t,r],color:"white",linewidth:0,backcolor:i.profitBackground.value(),fillBackground:!0,transparency:o,extendLeft:!1,extendRight:!1,backgroundHitTarget:c.HitTarget.MovePoint};this._targetBgRenderer.setData(a),this._renderer.append(this._targetBgRenderer)}}_createLinesRenderers(e,t){const i=this._source.properties().childs(),r=(e,t,n,r)=>{const s={points:[t,n],color:r??i.linecolor.value(),linewidth:i.linewidth.value(),linestyle:T.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:f.LineEnd.Normal,rightend:f.LineEnd.Normal};e.setData(s),this._renderer.append(e)};if(this._points[g.RiskRewardPointIndex.ActualEntry]){const t={points:[this._points[g.RiskRewardPointIndex.ActualEntry],e.isClosed?this._points[g.RiskRewardPointIndex.ActualClose]:new n.Point(e.closeBar,e.closeLevel)],color:this._source.properties().childs().linecolor.value(),linewidth:1,linestyle:T.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:f.LineEnd.Normal,rightend:f.LineEnd.Arrow};this._positionLineRenderer.setData(t),this._renderer.append(this._positionLineRenderer)}{const t=new n.Point(e.left,this._points[g.RiskRewardPointIndex.Entry].y),i=new n.Point(e.edge,this._points[g.RiskRewardPointIndex.Entry].y);r(this._entryLineRenderer,t,i)}{const t=new n.Point(e.left,e.stopLevel),s=new n.Point(e.edge,e.stopLevel);r(this._stopLineRenderer,t,s,i.stopBackground.value())}{const t=new n.Point(e.left,e.profitLevel),s=new n.Point(e.edge,e.profitLevel);r(this._targetLineRenderer,t,s,i.profitBackground.value())}}_addCenterLabel(e,t,i){const n=this._source.properties().childs(),r={font:R.CHART_FONT_FAMILY,offsetX:3,horzAlign:"center",backgroundRoundRect:4,boxPaddingHorz:4,points:[i.p],text:i.txt,color:n.textcolor.value(),offsetY:i.offsetY,vertAlign:i.vertAlign,backgroundColor:(0,_.resetTransparency)(i.color),fontsize:n.fontsize.value(),borderColor:i.border};return t.setData(r),e.append(t),r}_creareMiddleLabel(e,t,i){const{entryPrice:s,profitPrice:o,stopPrice:l,currentPrice:d,pl:h,left:c,edge:u,isClosed:_}=e,f=Math.abs(s-o)/Math.abs(s-l),g=this._source.properties().childs(),x=(0,r.ensureNotNull)(this._source.ownerSource()),v=new n.Point((c+u)/2,Math.round(this._points[0].y));let R="",T="";const m=(0,p.getNumericFormatter)().format(Math.round(100*f)/100);if(this._points[1]){const e=x.formatter();if(e.formatChange){const t=Math.max(d,s),i=Math.min(d,s);T=h>=0?e.formatChange(t,i):e.formatChange(i,t)}else T=e.format(h)}const S=g.qty.value()/g.lotSize.value(),C="futures"===i.type||(0,
|
|
w.hasCryptoTypespec)(i.typespecs||[])?Math.round(1e3*S)/1e3:Math.floor(S);if(g.compact.value())R+=T?T+" ~ ":"",R+=C+"\n",R+=m;else{const e=_?P:y;R+=T?b.format({status:e,pnl:T})+", ":"",R+=A.format({qty:""+C})+"\n",R+=L.format({ratio:m})+" "}let M=g.linecolor.value();return h<0?M=g.stopBackground.value():h>0&&(M=g.profitBackground.value()),this._addCenterLabel(t,this._middleLabelRenderer,{p:v,txt:R,color:M,vertAlign:a.VerticalAlign.Middle,offsetY:0,border:"white"})}_createStopLabel(e,t,i){const{stopPrice:s,entryPrice:o,left:l,edge:d,stopLevel:h}=e,c=this._source.properties().childs(),u=(0,r.ensureNotNull)(this._source.ownerSource()),_=Math.abs(s-o),f=Math.round(1e4*_/o)/100,g=new n.Point((l+d)/2,h);let v="";const w=u.formatter(),R=w.formatChange?.(Math.max(s,o),Math.min(s,o))??w.format(_),T=(0,p.getPercentageFormatter)(),m=T.format(f);return v=c.compact.value()?R+" ("+m+") "+c.amountStop.value():S.format({stopChange:(0,x.forceLTRStr)(R),stopChangePercent:(0,x.forceLTRStr)(T.format(f)),stopChangePip:i?(0,x.forceLTRStr)(i.format(_)):"",amount:(0,x.forceLTRStr)(""+c.amountStop.value())}),this._addCenterLabel(t,this._stopLabelRenderer,{p:g,txt:v,color:c.stopBackground.value(),vertAlign:o<s?a.VerticalAlign.Bottom:a.VerticalAlign.Top,offsetY:0})}_createTargetLabel(e,t,i){const{profitPrice:s,entryPrice:o,stopPrice:l,left:d,edge:h,profitLevel:c}=e,u=this._source.properties().childs(),_=(0,r.ensureNotNull)(this._source.ownerSource()),f=Math.abs(s-o),g=Math.round(1e4*f/o)/100,v=new n.Point((d+h)/2,c);let w="";const R=_.formatter(),T=R.formatChange?.(Math.max(s,o),Math.min(s,o))??R.format(f),m=(0,p.getPercentageFormatter)(),b=m.format(g);return w=u.compact.value()?T+" ("+b+") "+u.amountTarget.value():C.format({profitChange:T,profitChangePercent:(0,x.forceLTRStr)(m.format(g)),profitChangePip:i?(0,x.forceLTRStr)(i.format(f)):"",amount:(0,x.forceLTRStr)(""+u.amountTarget.value())}),this._addCenterLabel(t,this._profitLabelRenderer,{p:v,txt:w,color:u.profitBackground.value(),vertAlign:o<l?a.VerticalAlign.Top:a.VerticalAlign.Bottom,offsetY:0})}_createLabelsRenderers(e,t,i,s){if(!this.isLabelVisible())return;const o=this._creareMiddleLabel(e,t,i),a=this._createStopLabel(e,t,s),l=this._createTargetLabel(e,t,s),d=[this._profitLabelRenderer,this._stopLabelRenderer,this._middleLabelRenderer].reduce(((e,t)=>Math.max(e,t.measure().width)),0),h=e.edge-e.left,c=this._anchorRadius();if(h-d-c<=8&&(l&&(l.offsetY+=c+8,this._profitLabelRenderer.setData(l)),a&&(a.offsetY+=c+8,this._stopLabelRenderer.setData(a)),o)){let t;if(this._source.priceScale()?.isLog()){const i=Math.abs(this._points[0].y-e.stopLevel);t=Math.abs(this._points[0].y-e.profitLevel)>i?-1:1}else{const i=Math.abs(e.stopPrice-e.entryPrice);t=Math.abs(e.profitPrice-e.entryPrice)>i?-1:1}const i=e.profitLevel<e.stopLevel?1:-1,s=(0,r.ensureDefined)(o.points)[0].add(new n.Point(0,i*t*(.5*this._middleLabelRenderer.measure().height+c+8)));o.points=[s],this._middleLabelRenderer.setData(o)}}}},76050:(e,t,i)=>{"use strict";var n;i.d(t,{RiskRewardPointIndex:()=>n}),function(e){
|
|
e[e.Entry=0]="Entry",e[e.Close=1]="Close",e[e.ActualEntry=2]="ActualEntry",e[e.ActualClose=3]="ActualClose"}(n||(n={}))},78270:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RotatedRectanglePaneView:()=>u});var n=i(86441),r=i(4652),s=i(51056),o=i(27916),a=i(91046),l=i(74011),d=i(95201),h=i(49857),c=i(36036);class u extends o.LineSourcePaneView{constructor(){super(...arguments),this._poligonRenderer=new l.PolygonRenderer,this._renderer=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer=null;let t=0;if(3===this._points.length&&(t=(0,r.distanceToLine)(this._points[0],this._points[1],this._points[2]).distance),0===this._points.length)return;const i=new d.CompositeRenderer,l=this._source.properties(),[u,p]=this._points,_=[];if(_.push((0,c.lineSourcePaneViewPointToLineAnchorPoint)(u)),p&&_.push((0,c.lineSourcePaneViewPointToLineAnchorPoint)(p)),2===this._points.length){const e={points:this._points,color:l.childs().color.value(),linewidth:1,linestyle:s.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:h.LineEnd.Normal,rightend:h.LineEnd.Normal},t=new a.TrendLineRenderer;t.setData(e),i.append(t)}else if(3===this._points.length){const e=p.subtract(u),r=new n.Point(e.y,-e.x).normalized().scaled(t),a=r.scaled(-1),d=u.add(r),h=p.add(r),f=u.add(a),g={points:[d,h,p.add(a),f],color:l.childs().color.value(),linewidth:l.childs().linewidth.value(),linestyle:s.LINESTYLE_SOLID,filled:!0,backcolor:l.childs().backgroundColor.value(),fillBackground:l.childs().fillBackground.value(),transparency:l.childs().transparency.value()};this._poligonRenderer.setData(g),i.append(this._poligonRenderer);const x=(0,o.thirdPointCursorType)(u,p);_.push(...g.points.map((e=>(0,c.lineSourcePaneViewPointToLineAnchorPoint)(e,2,x))))}i.append(this.createLineAnchor({points:_},0)),this._renderer=i}}},93751:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Constants:()=>u,SignpostItemIndex:()=>H,SignpostPaneView:()=>B});var n=i(86441),r=i(19625),s=i(30699),o=i(50151),a=i(84906),l=i(19365);class d{constructor(){this._cache=new Map}getEmoji(e){return this._cache.has(e)||this._cache.set(e,this._fetchEmoji(e)),(0,o.ensureDefined)(this._cache.get(e))}static instance(){return this._instance||=new d}static clear(){this._instance=null}async _fetchEmoji(e){try{return(await(0,a.fetch)((0,l.getTwemojiUrl)(e,"svg"))).text()}catch(t){throw this._cache.has(e)&&this._cache.delete(e),t}}}d._instance=null;var h,c,u,p=i(56468),_=i(72791),f=i(95201),g=i(12027),x=i(15511),v=i(32211),w=i(62689),R=i(36036),T=i(15938),m=i(4652),b=i(34026),y=i(61993),P=i(69186);function L(e){return void 0===e?0:80}function S(e){return e.poleStartY}function C(e){const{inverseAnchorPosition:t,anchorCoordinates:i}=e;if(t)return i.y;const{labelHeight:n,plate:r,direction:s}=e;return i.y+(n+L(r))*s}function A(e){const{inverseAnchorPosition:t,anchorCoordinates:i,direction:n}=e;return t?i.y+L(e.plate)*n:i.y+e.labelHeight*n}!function(e){e[e.HitTestTolerance=3]="HitTestTolerance",e[e.HitTestToleranceTouch=20]="HitTestToleranceTouch",
|
|
e[e.ShadowYOffset=1]="ShadowYOffset",e[e.ShadowBlur=4]="ShadowBlur"}(h||(h={})),function(e){e[e.CircleRadius=35]="CircleRadius",e[e.CircleBorderWidth=1]="CircleBorderWidth",e[e.LabelOffset=10]="LabelOffset",e[e.LabelVertPadding=6]="LabelVertPadding"}(c||(c={}));class M{constructor(e){this._data=null,this._phantomMode=Boolean(e)}setData(e){this._data=e}hitTest(e){if(null===this._data)return null;const[t,i]=function(e,t){const i=(0,P.lastMouseOrTouchEventInfo)().isTouch?20:3,{anchorCoordinates:r,plate:s}=e,o=(0,m.distanceToSegment)(new n.Point(r.x,S(e)),new n.Point(r.x,C(e)),t).distance<i;let a=!1;if(!o&&void 0!==s){const s=e.inverseAnchorPosition?e.anchorCoordinates.y+35*e.direction:e.anchorCoordinates.y+(e.labelHeight+10+35)*e.direction;a=(0,b.pointInCircle)(t,new n.Point(r.x,s),35+i)}return[o,a]}(this._data,e);if(t||i){const e={hideCrosshairLinesOnHover:!0,activeItem:this._data.itemIndex};return i&&(e.areaName=p.AreaName.Style),new p.HitTestResult(p.HitTarget.MovePoint,e)}return null}draw(e,t){if(null===this._data)return;e.save(),this._phantomMode&&(e.globalAlpha=.5);const{poleColor:i,emojiRadius:n,plate:r}=this._data,{horizontalPixelRatio:s,verticalPixelRatio:o}=t,a=Math.max(1,Math.floor(s)),l=a%2?.5:0;e.beginPath(),e.strokeStyle=i,e.lineWidth=a;const d=Math.round(this._data.anchorCoordinates.x*s)+l;e.moveTo(d,Math.round(S(this._data)*o)),e.lineTo(d,Math.round(C(this._data)*o)),void 0!==r&&(e.moveTo(d,Math.round(A(this._data)*o)),e.lineTo(d,Math.round(function(e){const t=e.plate?10:0;return e.inverseAnchorPosition?A(e)-t*e.direction:A(e)+t*e.direction}(this._data)*o))),e.stroke(),void 0!==r&&function(e,t,i,n,r){const{horizontalPixelRatio:s,verticalPixelRatio:o}=r,{circleBorderColor:a,circleBackgroundColor:l}=i;e.strokeStyle=a,e.fillStyle=l;const d=(0,y.fillScaledRadius)(35,s),h=Math.round(t.anchorCoordinates.x*s),c=t.inverseAnchorPosition?Math.round(t.anchorCoordinates.y*o)+Math.round(35*o)*t.direction:Math.round(t.anchorCoordinates.y*o)+Math.round((t.labelHeight+10+35)*o)*t.direction,u=h+Math.max(1,Math.floor(s))%2/2,p=c+Math.max(1,Math.floor(o))%2/2;if(e.shadowOffsetY=1,e.shadowColor=i.shadowColor,e.shadowBlur=4,e.beginPath(),e.arc(u,p,d,0,2*Math.PI,!0),e.closePath(),e.fill(),e.shadowColor="transparent",t.svgRenderer){const i=2*(0,y.fillScaledRadius)(n,s);t.svgRenderer.render(e,{targetViewBox:{x:u-i/2,y:p-i/2,width:i,height:i}})}const _=Math.round(1*s),f=(0,y.strokeScaledRadius)(35,s,_);if(e.lineWidth=_,e.beginPath(),e.arc(u,p,f,0,2*Math.PI,!0),e.closePath(),e.stroke(),i.outsideBorderWidth){e.save();const t=Math.round(i.outsideBorderWidth*s),n=f+_/2+t/2;e.lineWidth=t,e.strokeStyle=i.outsideBorderColor,e.beginPath(),e.arc(u,p,n,0,2*Math.PI,!0),e.closePath(),e.stroke(),e.restore()}}(e,this._data,r,n,t),e.restore()}}!function(e){e[e.EmojiRadius=16]="EmojiRadius",e[e.LabelFontSize=12]="LabelFontSize",e[e.LabelBorderRadius=4]="LabelBorderRadius",e[e.LabelLineSpacing=3]="LabelLineSpacing",e[e.LabelHorzPadding=8]="LabelHorzPadding",e[e.LabelWordWrapWidth=134]="LabelWordWrapWidth",
|
|
e[e.AdditionalTopBottomSpace=2]="AdditionalTopBottomSpace",e[e.CalculationEpsilon=1e-10]="CalculationEpsilon",e[e.SourceLabelBorderWidth=1]="SourceLabelBorderWidth"}(u||(u={}));const I={circleBorderColor:(0,r.getHexColorByName)("color-cold-gray-900"),labelBackgroundColor:(0,r.getHexColorByName)("color-cold-gray-900"),labelBorderColor:(0,r.getHexColorByName)("color-cold-gray-800"),labelTextColor:(0,r.getHexColorByName)("color-cold-gray-200"),poleColor:(0,r.getHexColorByName)("color-cold-gray-500"),shadowColor:"rgba(0,0,0,0.4)",selectionColor:(0,r.getHexColorByName)("color-tv-blue-500")},k={circleBorderColor:(0,r.getHexColorByName)("color-white"),labelBackgroundColor:(0,r.getHexColorByName)("color-white"),labelBorderColor:(0,r.getHexColorByName)("color-cold-gray-150"),labelTextColor:(0,r.getHexColorByName)("color-cold-gray-900"),poleColor:(0,r.getHexColorByName)("color-cold-gray-500"),shadowColor:"rgba(0,0,0,0.2)",selectionColor:(0,r.getHexColorByName)("color-tv-blue-500")};var H;!function(e){e[e.Label=0]="Label",e[e.Body=1]="Body"}(H||(H={}));class B extends v.InplaceTextLineSourcePaneView{constructor(e,t,i,n,r){super(e,t,i,n,r),this._renderer=new f.CompositeRenderer,this._emojiCache=null,this._destroyed=!1,this._signpostRenderer=new M(e.isPhantom()),this._labelRenderer=new w.LineToolTextRenderer(void 0,new p.HitTestResult(p.HitTarget.MovePoint,(0,v.inplaceEditHandlers)(this._tryActivateEditMode.bind(this,null)))),this._source.setAdditionalCursorData((()=>({color:this._source.editableTextStyle().cursorColor,...this._labelRenderer.getTextInfo()})),this._labelRenderer.positionToCoordinate.bind(this._labelRenderer)),e.properties().childs().emoji.subscribe(this,this._updateEmoji),this._updateEmoji()}destroy(){this._source.properties().childs().emoji.unsubscribeAll(this),this._destroyed=!0,super.destroy()}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer.clear();const t=this._getBasePosition();if(!t)return;const i=this._updateLabelTextRenderer(e,t);if(this._updateTimelineRenderer(t,i),this._renderer.append(this._signpostRenderer),this._renderer.append(this._labelRenderer),!this._source.isPhantom()){const[e]=this._points,t=(0,R.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(e.x,i.y),e.pointIndex,_.PaneCursorType.VerticalResize,!0);this._renderer.append(this.createLineAnchor({points:[t]},0))}}_updateTimelineRenderer(e,t){const{poleStartY:i,inverse:n,direction:r}=e,s=this._source.properties().childs(),o=this._getCurrentColorTheme(),a={emojiRadius:16,poleColor:o.poleColor,svgRenderer:this._emojiCache?.emojiSvgRenderer,poleStartY:i,itemIndex:1,anchorCoordinates:t,direction:r,inverseAnchorPosition:n,labelHeight:this._labelRenderer.measure().height};s.showImage.value()&&(a.plate={circleBackgroundColor:s.backgroundsColors.value(),outsideBorderWidth:0,circleBorderColor:o.circleBorderColor,shadowColor:o.shadowColor,outsideBorderColor:o.selectionColor}),this._signpostRenderer.setData(a)}async _updateEmoji(){
|
|
const e=this._source.properties().childs().emoji.value();if(this._emojiCache?.emoji===e)return;const t=this._emojiCache={emoji:e},i=await d.instance().getEmoji(e);this._destroyed||this._emojiCache.emoji!==e||(t.emojiSvgRenderer=(0,g.svgRenderer)(i),this.update(),this._model.updateSource(this._source))}_updateLabelTextRenderer(e,t){const i=this._source.properties().childs(),r=this._getCurrentColorTheme(),{positionPointDirection:o,indexCoordinate:a,priceCoordinate:l,inverse:d,direction:h}=t,{height:c,width:u}=e.mediaSize;let p=(0,x.positionToCoordinate)(i.position.value(),c,l,o);p>=-1e-10&&p<=c+1e-10&&(p=Math.min(c-2,Math.max(2,p)));const _={...this._inplaceTextHighlight(),text:this._textData(),fontSize:i.fontSize.value(),bold:i.bold.value(),italic:i.italic.value(),offsetX:0,offsetY:0,points:[new n.Point(a,p)],forceCalculateMaxLineWidth:!0,vertAlign:-1===o?s.VerticalAlign.Bottom:s.VerticalAlign.Top,horzAlign:s.HorizontalAlign.Center,horzTextAlign:s.HorizontalAlign.Center,font:T.CHART_FONT_FAMILY,backgroundRoundRect:4,lineSpacing:3,boxPaddingVert:6,boxPaddingHorz:8,wordWrapWidth:134,color:this._textColor(),borderColor:r.labelBorderColor,borderWidth:1,backgroundColor:r.labelBackgroundColor};this._labelRenderer.setData(_);const f=this._labelRenderer.measure().height;let g={x:a,y:p};if(d){if(i.showImage.value()){const e=80;this._labelRenderer.setData({..._,points:[new n.Point(a,p+e*h)]})}}else{const{poleStartY:e}=t,i=1===h?Math.min(e-f,p):Math.max(e+f,p);p!==i&&(this._labelRenderer.setData({..._,points:[new n.Point(a,i)]}),g={x:a,y:i})}return this._labelRenderer.setCursorType(this._textCursorType()),this._labelRenderer.isOutOfScreen(u,c)?this.closeTextEditor():this._updateInplaceText(this._labelRenderer.getTextInfo()),g}_getCurrentColorTheme(){return this._model.dark().value()?I:k}_getBasePosition(){const e=this._source.ownerSource();if(!e)return null;const t=e.priceScale(),i=this._model.timeScale(),n=e.firstValue();if(i.isEmpty()||!t||t.isEmpty()||!n)return null;const r=this._model.mainSeries(),s=this._source.customEvent(),o=e===r?(0,x.getSeriesPosition)(r,s):(0,x.getNoDataPosition)(s,t,i,n);if(!o)return null;const{visualDirection:a,positionPointDirection:l}=o,d=a!==l;return{...o,inverse:d,direction:a*(d?-1:1)}}}},14661:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SineLinePaneView:()=>c});var n,r=i(86441),s=i(27916),o=i(95201),a=i(75919),l=i(56468),d=i(37743);!function(e){e[e.Tolerance=3]="Tolerance",e[e.SegmentsPerHalfPeriod=30]="SegmentsPerHalfPeriod"}(n||(n={}));class h extends a.MediaCoordinatesPaneRenderer{constructor(e){super(),this._data=e}hitTest(e){const t=(e.x-this._data.point.x)*Math.PI/this._data.width;let i=Math.sin(t-Math.PI/2)*this._data.height/2;return i=this._data.point.y+i+this._data.height/2,Math.abs(i-e.y)<=3?new l.HitTestResult(l.HitTarget.MovePoint):null}_drawImpl(e){const t=e.context;t.strokeStyle=this._data.color,t.lineWidth=this._data.lineWidth,(0,d.setLineStyle)(t,this._data.lineStyle),t.beginPath(),t.moveTo(this._data.point.x,this._data.point.y)
|
|
;const i=Math.max(1,this._data.width/30),n=e.mediaSize.width-this._data.point.x+i;for(let e=1;e<=n;e+=i){const i=e*Math.PI/this._data.width,n=Math.sin(i-Math.PI/2)*this._data.height/2;t.lineTo(this._data.point.x+e,this._data.point.y+n+this._data.height/2)}t.stroke()}}class c extends s.LineSourcePaneView{constructor(e,t){super(e,t),this._renderer=new o.CompositeRenderer}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){const{mediaSize:{height:t}}=e;if(super._updateImpl(e),this._renderer.clear(),this._points.length<2)return;const[i,n]=this._source.points();if(0===2*Math.abs(i.index-n.index))return void this.addAnchors(this._renderer);const[s,o]=this._points,a=Math.abs(s.x-o.x),l=o.y-s.y,d=this._source.properties().childs(),c=d.linewidth.value();if(s.y<-c&&o.y<-c||s.y>t+c&&o.y>t+c)return;const u=2*a,p=s.x>0?s.x-Math.ceil(s.x/u)*u:s.x+Math.floor(-s.x/u)*u,_={point:new r.Point(p,s.y),width:a,height:l,color:d.linecolor.value(),lineWidth:d.linewidth.value(),lineStyle:d.linestyle.value()};this._renderer.append(new h(_)),this.addAnchors(this._renderer)}}},44386:(e,t,i)=>{"use strict";i.r(t),i.d(t,{StickerPaneView:()=>r});var n=i(68498);class r extends n.SvgIconPaneView{_iconColor(){return null}}},19583:(e,t,i)=>{"use strict";i.r(t),i.d(t,{StudyLineDataSourceAnchorsPaneView:()=>s});var n=i(27916),r=i(36036);class s extends n.LineSourcePaneView{renderer(e){return this._invalidated&&(this._updateImpl(e),this._invalidated=!1),this.createLineAnchor({points:this._getPoints().map(r.mapLineSourcePaneViewPointToLineAnchorPoint)},0)}}},68498:(e,t,i)=>{"use strict";i.d(t,{SvgIconPaneView:()=>f});var n=i(86441),r=i(25422),s=i(50151),o=i(19063),a=i(36036),l=i(95201),d=i(27916),h=i(19625),c=i(75919),u=i(56468);const p=(0,h.getHexColorByName)("color-tv-blue-600");class _ extends c.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e){if(null===this._data)return null;const{size:t,angle:i,point:n}=this._data,s=(0,r.rotationMatrix)(-i),o=(0,r.transformPoint)(s,e.subtract(n));return Math.abs(o.y)<=t/2&&Math.abs(o.x)<=t/2?new u.HitTestResult(u.HitTarget.MovePoint):null}isOutOfScreen(e,t){if(null===this._data)return!0;const{size:i,point:n,angle:r}=this._data;let s;return s=r%(Math.PI/2)==0?i/2:Math.sqrt(i**2*2)/2,n.x+s<0||n.x-s>t||n.y+s<0||n.y-s>e}_drawImpl(e){if(null===this._data)return;const{size:t,svg:i,point:n,angle:r,color:s,background:o,selected:a}=this._data,l=e.context;l.translate(n.x,n.y);const d=r-Math.PI/2;l.rotate(d);const h=t/2;a&&(l.fillStyle=o,l.strokeStyle=p,l.beginPath(),l.rect(-h,-h,t,t),l.closePath(),l.fill(),l.stroke()),i&&(l.translate(-h,-h),null!==s&&(l.fillStyle=s),i.render(l,{targetViewBox:{x:0,y:0,width:t,height:t},doNotApplyColors:null!==s}))}}class f extends d.LineSourcePaneView{constructor(e,t,i){super(e,t),this._iconRenderer=new _,this._renderer=new l.CompositeRenderer,this._svg=i}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer.clear(),
|
|
this._points.length<1)return;const t=this._source.properties().childs(),i=t.size.value(),s={point:this._points[0],color:this._iconColor(),size:i,svg:this._svg,angle:t.angle.value(),selected:this.areAnchorsVisible(),background:this._calculateBackgroundColor()};this._iconRenderer.setData(s);const{mediaSize:{width:o,height:l}}=e;this._iconRenderer.isOutOfScreen(l,o)||this._renderer.append(this._iconRenderer);const[h]=this._points,c=this._source.getAnchorLimit();let u=new n.Point(Math.max(c,i)/2,0),p=new n.Point(0,Math.max(c,i)/2);const _=(0,r.rotationMatrix)(t.angle.value());u=(0,r.transformPoint)(_,u),p=(0,r.transformPoint)(_,p);const f=h.add(u),g=h.subtract(u),x=(0,d.thirdPointCursorType)(f,g),v=[(0,a.lineSourcePaneViewPointToLineAnchorPoint)(f,0,void 0,void 0,void 0,void 0,void 0,!0),(0,a.lineSourcePaneViewPointToLineAnchorPoint)(g,1,void 0,void 0,void 0,void 0,void 0,!0),(0,a.lineSourcePaneViewPointToLineAnchorPoint)(h.add(p),2,x,!0,void 0,void 0,void 0,!0),(0,a.lineSourcePaneViewPointToLineAnchorPoint)(h.subtract(p),3,x,!0,void 0,void 0,void 0,!0)];this._renderer.append(this.createLineAnchor({points:v},0))}_calculateBackgroundColor(){return(0,o.generateColor)(this._model.backgroundColorAtYPercentFromTop(this._points[0].y/(0,s.ensureNotNull)(this._model.paneForSource(this._source)).height()),60,!0)}}},13589:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TextPaneView:()=>_});var n=i(50151),r=i(86441),s=i(30699),o=i(15938),a=i(72791),l=i(95201),d=i(11064),h=i(56468),c=i(36036),u=i(32211),p=i(62689);class _ extends u.InplaceTextLineSourcePaneView{constructor(e,t,i,n,r,s,o,a,l,d,c){super(e,t,l,d,c),this._noSelection=!1,this._renderer=null,this._offsetX=i,this._offsetY=n,this._vertAlign=r,this._horzAlign=s,this._forceTextAlign=Boolean(o),this._noSelection=!1,this._renderer=null,this._recalculateSourcePointsOnFirstUpdate=a,this._textRenderer=new p.LineToolTextRenderer(void 0,new h.HitTestResult(h.HitTarget.MovePoint,(0,u.inplaceEditHandlers)(this._tryActivateEditMode.bind(this,null)))),this._source.setAdditionalCursorData((()=>({color:this._source.editableTextStyle().cursorColor,...this._textRenderer.getTextInfo()})),this._textRenderer.positionToCoordinate.bind(this._textRenderer))}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}disableSelection(){this._noSelection=!0}isEditMode(){return!this._getModel().readOnly()}_updateImpl(e){super._updateImpl(e),this._renderer=null;const t=this._getSource(),i=t.priceScale();if(!i||i.isEmpty())return;const u=t.properties().childs(),p=this._getModel(),_={text:this._textData(),color:this._textColor(),fontSize:u.fontsize.value(),boxPadding:u.fontsize.value()/6,font:o.CHART_FONT_FAMILY,vertAlign:this._vertAlign||s.VerticalAlign.Top,horzAlign:this._horzAlign||s.HorizontalAlign.Left,offsetX:this._offsetX||0,offsetY:this._offsetY||0,forceTextAlign:this._forceTextAlign,...this._inplaceTextHighlight()};_.points=t.isFixed()?[(0,n.ensureDefined)(t.fixedPoint())]:this._points,u.fillBackground&&u.fillBackground.value()&&(_.backgroundColor=u.backgroundColor.value()),
|
|
u.drawBorder&&u.drawBorder.value()&&(_.borderColor=u.borderColor.value()),u.wordWrap&&u.wordWrap.value()&&(_.wordWrapWidth=u.wordWrapWidth.value()),_.bold=u.bold&&u.bold.value(),_.italic=u.italic&&u.italic.value();p.selection().isSelected(t)&&(_.highlightBorder=!0,_.highlightBorderColor=u.color.value()),!t.isFixed()&&this._model.isSnapshot()&&(_.scale=p.timeScale().barSpacingScaleRatio()),this._textRenderer.setData(_),this._textRenderer.setCursorType(this._textCursorType());const{mediaSize:{width:f,height:g}}=e;if(this._textRenderer.isOutOfScreen(f,g))return void this.closeTextEditor();const x=1===_.points.length;if(this._updateInplaceText(this._textRenderer.getTextInfo()),x&&void 0!==this._recalculateSourcePointsOnFirstUpdate){this._renderer=null;const e=this._textRenderer.measure();return this._recalculateSourcePointsOnFirstUpdate(e.width,e.height),void(this._recalculateSourcePointsOnFirstUpdate=void 0)}if(!x||this._noSelection)this._renderer=this._textRenderer;else{const e=new l.CompositeRenderer;e.append(this._textRenderer);const t=_.points[0].clone(),i=this._textRenderer.measure(),n=i.width,s=i.height;if(_.wordWrapWidth){const i=[(0,c.lineSourcePaneViewPointToLineAnchorPoint)(new r.Point(t.x+n,t.y+s/2),1,a.PaneCursorType.HorizontalResize,!0)];e.append(this.createLineAnchor({points:i},1))}if(!this._isTextEditMode()){const i=new r.Point(t.x+n/2,t.y+s);i.pointIndex=0,e.append(new d.SelectionRenderer({points:[(0,c.lineSourcePaneViewPointToLineAnchorPoint)(i)],bgColors:this._lineAnchorColors([i]),visible:this.areAnchorsVisible(),hittestResult:h.HitTarget.MovePoint,barSpacing:p.timeScale().barSpacing()}))}this._renderer=e}}}},62689:(e,t,i)=>{"use strict";i.d(t,{LineToolTextRenderer:()=>r});var n=i(17330);class r extends n.TextRenderer{getTextInfo(){const e=this._getInternalData(),t=this.fontStyle(),i=this._getFontInfo();return{...e,lineHeight:this.lineHeight(),lineSpacing:this.lineSpacing(),font:t,fontSize:i.fontSize,centerRotation:this.centerTextRotation()??void 0}}setCursorType(e){this._hitTest.data()?.cursorType!==e&&this._hitTest.mergeData({cursorType:e})}}},6822:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LineToolThreeDrivesPaneView:()=>p});var n=i(30699),r=i(51056),s=i(95201),o=i(17330),a=i(74079),l=i(91046),d=i(49857),h=i(74011),c=i(27916),u=i(15938);class p extends c.LineSourcePaneView{constructor(){super(...arguments),this._retrace1LabelRenderer=new o.TextRenderer,this._retrace12LabelRenderer=new o.TextRenderer,this._polyLineRenderer=new h.PolygonRenderer,this._renderer=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer=null;let t=NaN,i=NaN;if(this._source.points().length>=4){const[,e,i,n]=this._source.points();t=Math.round(100*Math.abs((n.price-i.price)/(i.price-e.price)))/100}if(this._source.points().length>=6){const[,,,e,t,n]=this._source.points();i=Math.round(100*Math.abs((n.price-t.price)/(t.price-e.price)))/100}if(this._points.length<2)return;const o=this._source.properties().childs(),h=new s.CompositeRenderer,c=(e,t)=>({points:[e],
|
|
text:t,color:o.textcolor.value(),vertAlign:n.VerticalAlign.Middle,horzAlign:n.HorizontalAlign.Center,font:u.CHART_FONT_FAMILY,offsetX:0,offsetY:0,bold:o.bold&&o.bold.value(),italic:o.italic&&o.italic.value(),fontsize:o.fontsize.value(),backgroundColor:o.color.value(),backgroundRoundRect:4}),p=(e,t)=>({points:[e,t],color:o.color.value(),linewidth:o.linewidth.value(),linestyle:r.LINESTYLE_DOTTED,extendleft:!1,extendright:!1,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal}),_={points:this._points,color:o.color.value(),linewidth:o.linewidth.value(),linestyle:r.LINESTYLE_SOLID,leftend:d.LineEnd.Normal,rightend:d.LineEnd.Normal,backcolor:"rgba(0, 0, 0, 0)",fillBackground:!1,filled:!1};this._polyLineRenderer.setData(_),h.append(this._polyLineRenderer);const f=(0,a.getNumericFormatter)();if(!isNaN(t)){const e=new l.TrendLineRenderer;e.setData(p(this._points[1],this._points[3])),h.append(e);const i=c(this._points[1].add(this._points[3]).scaled(.5),f.format(t));this._retrace1LabelRenderer.setData(i),h.append(this._retrace1LabelRenderer)}if(!isNaN(i)){const e=new l.TrendLineRenderer;e.setData(p(this._points[3],this._points[5])),h.append(e);const t=c(this._points[5].add(this._points[3]).scaled(.5),f.format(i));this._retrace12LabelRenderer.setData(t),h.append(this._retrace12LabelRenderer)}this.addAnchors(h),this._renderer=h}}},80485:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TimeCyclesPaneView:()=>c});var n=i(86441),r=i(95201),s=i(27916),o=i(19063),a=i(56468),l=i(37743),d=i(75919);class h extends d.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e){if(null===this._data||e.y>this._data.point.y)return null;if(e.x<this._data.point.x||e.x>this._data.point.x+this._data.width)return null;const t=new n.Point(this._data.point.x+this._data.width/2,this._data.point.y);let i=e.subtract(t);const r=this._data.height/this._data.width;i=new n.Point(i.x,i.y/r);const s=i.length();return Math.abs(s-this._data.width/2)<3?new a.HitTestResult(a.HitTarget.MovePoint):null}_drawImpl(e){if(null===this._data)return;const t=e.context;t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,(0,l.setLineStyle)(t,this._data.linestyle),t.save(),t.translate(this._data.point.x+1,this._data.point.y),t.scale(this._data.width,this._data.height),t.beginPath(),t.arc(.5,0,.5,Math.PI,0,!1),t.restore(),t.stroke(),this._data.fillBackground&&(t.fillStyle=(0,o.generateColor)(this._data.backcolor,this._data.transparency),t.fill())}}class c extends s.LineSourcePaneView{constructor(){super(...arguments),this._renderer=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){if(super._updateImpl(e),this._renderer=null,this._points.length<2)return;const t=this._source.points(),i=t[0],s=t[1],o=Math.min(i.index,s.index),a=Math.max(i.index,s.index),l=a-o,d=this._points[0],c=this._points[1],u=Math.abs(d.x-c.x),p=new r.CompositeRenderer,_=this._source.properties().childs(),f=this._model.timeScale();if(0===l)return;let g=Math.min(d.x,c.x);const x=[]
|
|
;for(let e=o;g>-u;e-=l)g=f.indexToCoordinate(e),x.push(g);g=Math.max(d.x,c.x);for(let e=a;g<f.width();e+=l)g=f.indexToCoordinate(e),x.push(g);for(let e=0;e<x.length;e++){const t={point:new n.Point(x[e],d.y),width:u,height:u,color:_.linecolor.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),fillBackground:_.fillBackground.value(),backcolor:_.backgroundColor.value(),transparency:_.transparency.value()},i=new h;i.setData(t),p.append(i)}this.addAnchors(p),this._renderer=p}}},82595:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TrendAnglePaneView:()=>T});var n=i(50151),r=i(86441),s=i(5531),o=i(34026),a=i(63273),l=i(30699),d=i(56468),h=i(49857),c=i(39429),u=i(17330),p=i(91046),_=i(11064),f=i(15938),g=i(36036),x=i(75919);class v extends x.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e){return null}_drawImpl(e){if(null===this._data)return;const t=e.context;t.translate(this._data.point.x,this._data.point.y),t.strokeStyle=this._data.color,t.setLineDash([1,2]);const i=this._data.size;t.beginPath(),t.moveTo(0,0),t.lineTo(i,0),t.arc(0,0,i,0,-this._data.angle,this._data.angle>0),t.stroke()}}var w,R=i(57347);!function(e){e[e.DistanceBetweenAngleAndPoint=50]="DistanceBetweenAngleAndPoint",e[e.AngleTextOffsetY=0]="AngleTextOffsetY",e[e.AngleTextOffsetX=5]="AngleTextOffsetX"}(w||(w={}));class T extends R.TrendToolWithStatsPaneView{constructor(e,t){super(e,t),this._secondPoint=null,this._trendRenderer=new p.TrendLineRenderer,this._angleRenderer=new v,this._angleLabelRenderer=new u.TextRenderer}_getPointsForStats(){return[this._points[0],(0,n.ensureNotNull)(this._middlePoint),(0,n.ensureNotNull)(this._secondPoint)]}_updateImpl(e){this._renderer.clear(),super._updateImpl(e);const t=this._source,i=t.angle();if(this._points.length>0&&null!==i){const e=Math.cos(i),n=-Math.sin(i),s=new r.Point(e,n);this._secondPoint=this._points[0].addScaled(s,t.distance()),this._middlePoint=this._source.calcMiddlePoint(this._points[0],this._secondPoint)}this._invalidated=!1;const n=this._source.priceScale(),u=this._model.timeScale();if(!n||n.isEmpty()||u.isEmpty())return;if(null===this._model.timeScale().visibleBarsStrictRange())return;if(this._source.points().length<2)return;if(this._points.length<2||null===this._secondPoint)return;const p=this._points[0],x=this._points[1],v=this._source.properties().childs();v.showBarsRange.value()||v.showPriceRange.value()||v.showPercentPriceRange.value()||v.showPipsPriceRange.value()||(this._label=null,this._labelData&&(this._labelData.text=""));const w=v.linecolor.value(),R={points:[p,this._secondPoint],color:w,linewidth:v.linewidth.value(),linestyle:v.linestyle.value(),extendleft:v.extendLeft.value(),extendright:v.extendRight.value(),leftend:h.LineEnd.Normal,rightend:h.LineEnd.Normal};this._trendRenderer.setData(R),this._renderer.append(this._trendRenderer);const T=(0,r.box)(new r.Point(0,0),new r.Point(e.mediaSize.width,e.mediaSize.height));let m=!1;v.statsPosition.value()===c.StatsPosition.Auto&&(m=(0,r.equalPoints)(p,x)?!(0,
|
|
o.pointInBox)(p,T):null===(0,s.intersectLineSegmentAndBox)((0,r.lineSegment)(p,x),T));(this.isHoveredSource()||this.isSelectedSource()||v.alwaysShowStats.value())&&!m&&2===this._points.length&&this._renderer.append(this._updateAndReturnStatsRenderer(e));const b=(this.isHoveredSource()||this.isSelectedSource())&&v.showMiddlePoint.value();this._middlePoint&&this._renderer.append(new _.SelectionRenderer({points:[(0,g.lineSourcePaneViewPointToLineAnchorPoint)(this._middlePoint,0)],bgColors:this._lineAnchorColors([this._middlePoint]),color:w,visible:b&&this.areAnchorsVisible(),hittestResult:d.HitTarget.Regular,barSpacing:0}));const y={point:p,angle:t.angle()??0,color:w,size:50};this._angleRenderer.setData(y),this._renderer.append(this._angleRenderer);const P=180*y.angle/Math.PI,L=Math.round(100*P)/100+"º",S={points:[new r.Point(p.x+50,p.y)],text:(0,a.forceLTRStr)(L),color:w,horzAlign:l.HorizontalAlign.Left,font:f.CHART_FONT_FAMILY,offsetX:5,offsetY:0,bold:v.bold.value(),italic:v.italic.value(),fontsize:v.fontsize.value(),vertAlign:l.VerticalAlign.Middle};this._angleLabelRenderer.setData(S),this._renderer.append(this._angleLabelRenderer),R.points.length>=2&&this._addAlertRenderer(this._renderer,R.points),this._renderer.append(this.createLineAnchor({points:[(0,g.lineSourcePaneViewPointToLineAnchorPoint)(p),(0,g.lineSourcePaneViewPointToLineAnchorPoint)(this._secondPoint,1)]},0))}}},90413:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TrendBasedFibExtensionPaneView:()=>d});var n=i(86441),r=i(62189),s=i(91046),o=i(49857),a=i(70011),l=i(23033);class d extends l.FibHorizontalLevelsPaneViewBase{constructor(){super(...arguments),this._trendLineRendererPoints12=new s.TrendLineRenderer,this._trendLineRendererPoints23=new s.TrendLineRenderer,this._rectangleRenderers={},this._levels=[]}_tryActivateEditMode(e,t){this._source.setInplaceEditLevelIndex(e),super._tryActivateEditMode(e,t)}_updateImpl(e){if(super._updateImpl(e),this._renderer.clear(),this._points.length<2)return;const[t,i]=this._points,s=this._source.properties().childs();if(3===this._source.points().length){const e=this._source.priceScale();if(!e||e.isEmpty()||this._model.timeScale().isEmpty())return;const t=this._source.ownerSource()?.firstValue();if(null==t)return;const[i,n,r]=this._source.points();let o=!1;s.reverse&&s.reverse.value()&&(o=s.reverse.value()),this._levels=[];const l=o?i.price:n.price,d=o?n.price:i.price,h=l-d;let c,u,p;const _=e.isLog()&&s.fibLevelsBasedOnLogScale.value();if(_){c=e.priceToCoordinate(l,t);u=c-e.priceToCoordinate(d,t),p=e.priceToCoordinate(r.price,t)}const f={price:r.price,coordinate:p},g={price:h,coordinate:u},x=this._source.levelsCount();for(let i=1;i<=x;i++){const n=s["level"+i].childs();if(!n.visible.value())continue;const r=n.coeff.value(),o=n.color.value(),l=n.text.value(),d=(0,a.fibLevelCoordinate)(f,g,r,e,t,_),h=(0,a.fibLevelPrice)(f,g,r,e,t,_);this._levels.push({color:o,price:h,y:d,linewidth:s.levelsStyle.childs().linewidth.value(),linestyle:s.levelsStyle.childs().linestyle.value(),index:i,text:l})}}const l=s.trendline.childs()
|
|
;if(l.visible.value()){const e={points:[t,i],color:l.color.value(),linewidth:l.linewidth.value(),linestyle:l.linestyle.value(),extendleft:!1,extendright:!1,leftend:o.LineEnd.Normal,rightend:o.LineEnd.Normal};this._trendLineRendererPoints12.setData(e),this._renderer.append(this._trendLineRendererPoints12)}if(this._points.length<3)return void this.addAnchors(this._renderer);let d=null;const h=this._points[2];l.visible.value()&&(d=this._trendLineRendererPoints23,d.setData({points:[i,h],color:l.color.value(),linewidth:l.linewidth.value(),linestyle:l.linestyle.value(),extendleft:!1,extendright:!1,leftend:o.LineEnd.Normal,rightend:o.LineEnd.Normal}));const c=Math.min(h.x,i.x),u=Math.max(h.x,i.x),p=s.fillBackground.value(),_=s.transparency.value(),f=s.extendLinesLeft.value(),g=s.extendLines.value();if(p)for(let e=0;e<this._levels.length;e++)if(e>0&&p){const t=this._levels[e-1],i={points:[new n.Point(c,this._levels[e].y),new n.Point(u,t.y)],color:this._levels[e].color,linewidth:0,backcolor:this._levels[e].color,fillBackground:!0,transparency:_,extendLeft:f,extendRight:g};this._rectangleRenderers.hasOwnProperty(e)||(this._rectangleRenderers[e]=new r.RectangleRenderer(!0));const s=this._rectangleRenderers[e];s.setData(i),this._renderer.append(s)}this._addLevels({mediaSize:e.mediaSize,levels:this._levels,left:c,right:u,showLabel:s.showCoeffs.value()||s.showPrices.value(),showText:s.showText.value(),labelAlign:[s.horzLabelsAlign.value(),s.vertLabelsAlign.value()],textAlign:[s.horzTextAlign.value(),s.vertTextAlign.value()],extendLeft:f,extendRight:g,fontSize:s.labelFontSize.value(),isOnScreen:!0,trendLineRenderer:d}),this.addAnchors(this._renderer),this._model.selection().isSelected(this._source)||this.closeTextEditor()}}},57175:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TrendBasedFibTimePaneView:()=>_});var n=i(86441),r=i(30699),s=i(95173),o=i(17330),a=i(62189),l=i(91046),d=i(56468),h=i(95201),c=i(49857),u=i(15938),p=i(27916);class _ extends p.LineSourcePaneView{constructor(e,t){super(e,t),this._trendLineRendererPoints12=new l.TrendLineRenderer,this._trendLineRendererPoints23=new l.TrendLineRenderer,this._textRenderers=[],this._renderer=new h.CompositeRenderer,this._levels=[];for(let t=0;t<e.levelsCount();t++)this._textRenderers.push(new o.TextRenderer)}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer.clear();const t=this._source.properties().childs();if(3===this._source.points().length){const e=this._model.timeScale();if(e.isEmpty())return;const[i,n,r]=this._source.points();if(this._levels=[],n.index===i.index)return;const s=n.index-i.index,o=r.index;if(null===e.visibleBarsStrictRange())return;for(let i=1;i<=this._source.levelsCount();i++){const n=t["level"+i].childs();if(!n.visible.value())continue;const r=n.coeff.value(),a=n.color.value(),l=Math.round(o+r*s),d={x:e.indexToCoordinate(l),coeff:r,color:a,linewidth:n.linewidth.value(),linestyle:n.linestyle.value(),index:i,text:String(r)};this._levels.push(d)}}if(this._points.length<2)return
|
|
;const i=new h.CompositeRenderer,[l,p]=this._points,_=t.trendline.childs();if(_.visible.value()){const e={points:[l,p],color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!1,leftend:c.LineEnd.Normal,rightend:c.LineEnd.Normal};this._trendLineRendererPoints12.setData(e),i.append(this._trendLineRendererPoints12)}if(this._points.length<3)return this.addAnchors(i),void(this._renderer=i);const f=this._points[2];if(_.visible.value()){const e={points:[p,f],color:_.color.value(),linewidth:_.linewidth.value(),linestyle:_.linestyle.value(),extendleft:!1,extendright:!1,leftend:c.LineEnd.Normal,rightend:c.LineEnd.Normal};this._trendLineRendererPoints23.setData(e),i.append(this._trendLineRendererPoints23)}const{mediaSize:{width:g,height:x}}=e;if(t.fillBackground.value()){const e=t.transparency.value();for(let t=1;t<this._levels.length;t++){const r=this._levels[t-1],s={points:[new n.Point(r.x,0),new n.Point(this._levels[t].x,x)],color:this._levels[t].color,linewidth:0,backcolor:this._levels[t].color,fillBackground:!0,transparency:e,extendLeft:!1,extendRight:!1},o=new a.RectangleRenderer(!0);o.setData(s),i.append(o)}}let v=t.horzLabelsAlign.value();v=v===r.HorizontalAlign.Left?r.HorizontalAlign.Right:v===r.HorizontalAlign.Right?r.HorizontalAlign.Left:r.HorizontalAlign.Center;const w=t.vertLabelsAlign.value(),R=t.showCoeffs.value();for(let e=0;e<this._levels.length;e++){let t;if(R){let r;switch(w){case"top":r=new n.Point(this._levels[e].x,0);break;case"middle":r=new n.Point(this._levels[e].x,.5*x);break;default:r=new n.Point(this._levels[e].x,x)}const s={points:[r],text:this._levels[e].text,color:this._levels[e].color,vertAlign:w,horzAlign:v,font:u.CHART_FONT_FAMILY,offsetX:2,offsetY:0,fontsize:12},a=this._textRenderers[e];a.setData(s),this._needLabelExclusionPath(a)&&(t=(0,o.getTextBoundaries)(a,g,x)??void 0),i.append(a)}const r={x:this._levels[e].x,color:this._levels[e].color,linewidth:this._levels[e].linewidth,linestyle:this._levels[e].linestyle,excludeBoundaries:t},a=new d.HitTestResult(d.HitTarget.MovePoint,void 0,this._levels[e].index),l=new s.VerticalLineRenderer;l.setData(r),l.setHitTest(a),i.append(l)}this.addAnchors(i),this._renderer=i}_needLabelExclusionPath(e){return"center"===this._source.properties().childs().horzLabelsAlign.value()}}},29710:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TrendLinePaneView:()=>x});var n=i(50151),r=i(86441),s=i(34026),o=i(5531),a=i(17330),l=i(62689),d=i(13075),h=i(39429),c=i(11064),u=i(91046),p=i(15938),_=i(56468),f=i(57347),g=i(32211);class x extends f.TrendToolWithStatsPaneView{constructor(e,t,i,n,r){super(e,t,i,n,r),this._trendRenderer=new u.TrendLineRenderer,this._labelRenderer=new l.LineToolTextRenderer(void 0,new _.HitTestResult(_.HitTarget.MovePoint,(0,g.inplaceEditHandlers)(this._tryActivateEditMode.bind(this,null)))),this._source.setAdditionalCursorData((()=>({color:this._source.editableTextStyle().cursorColor,rotationPoint:this._labelRenderer.rotation()??void 0,...this._labelRenderer.getTextInfo()
|
|
})),this._labelRenderer.positionToCoordinate.bind(this._labelRenderer))}_getPointsForStats(){return[this._points[0],(0,n.ensureNotNull)(this._middlePoint),this._points[1]]}_updateImpl(e){this._renderer.clear(),this._invalidated=!1;const t=this._source.priceScale(),i=this._model.timeScale();if(!t||t.isEmpty()||i.isEmpty())return;const n=this._model.timeScale().visibleBarsStrictRange();if(null===n)return;const l=this._source.points();if(l.length<2)return;const u=l[0],f=l[1],g=this._source.properties().childs();if(u.index<n.firstBar()&&f.index<n.firstBar()&&!g.extendLeft.value()&&!g.extendRight.value())return;if(super._updateImpl(e),this._points.length<2)return;g.showPriceRange.value()||g.showPercentPriceRange.value()||g.showPipsPriceRange.value()||g.showBarsRange.value()||g.showDateTimeRange.value()||g.showDistance.value()||g.showAngle.value()||(this._label=null,this._labelData&&(this._labelData.text=""));const x=this._points[0],v=this._points[1],{mediaSize:{width:w,height:R}}=e;let T;const m=g.text.value(),b=this._isTextEditMode(),y=this._placeHolderMode(!0);if(g.showLabel?.value()&&m||y||b){const e=x.x<v.x?x:v,t=e===x?v:x,i=g.vertLabelsAlign.value(),n=g.horzLabelsAlign.value();let s;s="left"===n?e.clone():"right"===n?t.clone():new r.Point((x.x+v.x)/2,(x.y+v.y)/2);const o=Math.atan((t.y-e.y)/(t.x-e.x));this._labelRenderer.setData({points:[s],text:this._textData(),color:this._textColor(),vertAlign:i,horzAlign:n,font:p.CHART_FONT_FAMILY,offsetX:0,offsetY:0,bold:g.bold.value(),italic:g.italic.value(),fontsize:g.fontsize.value(),forceTextAlign:!0,angle:o,decorator:y?d.PlusTextRendererDecorator.instance():void 0,...this._inplaceTextHighlight()}),this._labelRenderer.setCursorType(this._textCursorType()),this._renderer.append(this._labelRenderer),this._needLabelExclusionPath(this._labelRenderer)&&(T=(0,a.getTextBoundaries)(this._labelRenderer,w,R)??void 0),this._labelRenderer.isOutOfScreen(w,R)?this.closeTextEditor():this._updateInplaceText(this._labelRenderer.getTextInfo())}const P=g.linecolor.value(),L={points:this._points,color:P,linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),extendleft:g.extendLeft.value(),extendright:g.extendRight.value(),leftend:g.leftEnd.value(),rightend:g.rightEnd.value(),excludeBoundaries:T?[T]:void 0};this._trendRenderer.setData(L),this._renderer.insert(this._trendRenderer,0);const S=(0,r.box)(new r.Point(0,0),new r.Point(w,R));let C=!1;g.statsPosition.value()===h.StatsPosition.Auto&&(C=(0,r.equalPoints)(x,v)?!(0,s.pointInBox)(x,S):null===(0,o.intersectLineSegmentAndBox)((0,r.lineSegment)(x,v),S));if(((this.isHoveredSource()||this.isSelectedSource())&&this.isEditMode()||g.alwaysShowStats.value())&&!C&&2===this._points.length&&this._renderer.append(this._updateAndReturnStatsRenderer(e)),this._middlePoint&&!b){const e=(this.isHoveredSource()||this.isSelectedSource())&&g.showMiddlePoint.value();this._renderer.append(new c.SelectionRenderer({points:[{point:this._middlePoint}],bgColors:this._lineAnchorColors([this._middlePoint]),color:P,visible:e&&this.areAnchorsVisible(),
|
|
hittestResult:_.HitTarget.Regular,barSpacing:0}))}this.addAnchors(this._renderer),L.points.length>=2&&this._addAlertRenderer(this._renderer,L.points)}}},57347:(e,t,i)=>{"use strict";i.d(t,{TrendToolWithStatsPaneView:()=>E});var n=i(50151),r=i(5531),s=i(86441),o=i(11542),a=i(63273),l=i(30699),d=i(95201),h=i(74079),c=i(92953),u=i(27714),p=i(34026),_=i(19625),f=i(68979),g=i(17330),x=i(56468),v=i(37743),w=i(7114),R=i(2844),T=i(12027),m=i(63929),b=i(42057),y=i(1195);let P=null;const L=(0,_.getHexColorByName)("color-cold-gray-50"),S=(0,_.getHexColorByName)("color-cold-gray-800"),C={angle:(0,T.svgRenderer)(m),priceRange:(0,T.svgRenderer)(b),barsRange:(0,T.svgRenderer)(y)},A=18;class M{constructor(e){this._data=null,this._preRenderedData=null,this._textWidthCache=new R.TextWidthCache,this._hittest=e||new x.HitTestResult(x.HitTarget.MovePoint)}setData(e){this._data=e,this._preRenderedData=null}draw(e,t){if(!this._data||null===this._data.text)return;const i=this._preRender();if(!i)return;const{horizontalPixelRatio:n,verticalPixelRatio:r}=t,{point:s,horzAlign:o,doNotAlignText:a,backgroundRoundRect:d,backgroundColor:h,color:c,lineSpacing:u,icons:p,isDark:_}=this._data,{font:f,lineHeight:g,lines:x,padding:R}=i,T=Math.round(s.x*n),m=Math.round(s.y*r),b=Math.round(i.rectSize.width*n),y=Math.round(i.rectSize.height*r);if(o!==l.HorizontalAlign.Right&&o!==l.HorizontalAlign.Center||!0!==a&&(e.textAlign=o===l.HorizontalAlign.Right?"end":"center"),d?((0,v.drawRoundRect)(e,T,m,b,y,d*n),e.fillStyle=h,e.fill(),e.globalAlpha=1):(e.fillStyle=h,e.fillRect(T,m,b,y),e.globalAlpha=1),p){const i=Math.max(0,(g-A)/2),o=Math.round((s.x+R.left)*n);let a=s.y+R.top+i;for(const i of p){const n=Math.round(a*r);this._drawIcon(e,o,n,C[i],Boolean(_),t),a+=g+u}}const P=i.textPointOffset,L=s.x+P.x;let S=s.y+P.y;e.fillStyle=c,e.textBaseline="middle",e.font=f;const M=Math.round(g/2);(0,w.drawScaled)(e,n,r,(()=>{for(const t of x)e.fillText(t,L,S+M),S+=g+u}))}hitTest(e){const t=this._data,i=this._preRender();if(!t||!i)return null;const n=(0,s.point)(t.point.x+i.rectSize.width,t.point.y+i.rectSize.height);return(0,p.pointInBox)(e,(0,s.box)(t.point,n))?this._hittest:null}rectSize(){const e=this._preRender();return e?(0,u.size)({width:e.rectSize.width,height:e.rectSize.height}):null}updatePoint(e){this._data&&(this._data.point=e)}_preRender(){if(!this._data)return null;if(this._preRenderedData)return this._preRenderedData;const{fontSize:e=12,text:t,wordWrapWidth:i,paddingBottom:n,paddingTop:r,paddingLeft:s,paddingRight:o,icons:a,bold:l,italic:d,lineSpacing:h}=this._data,c=(0,f.makeFont)(e,this._data.font,d?"italic":void 0,l?"bold":void 0),p=function(){if(null!==P)return P;const e=(0,w.createDisconnectedCanvas)(document,(0,u.size)({width:0,height:0}));return P=(0,w.getPrescaledContext2D)(e),P}(),_={x:0,y:0};p.textBaseline="middle",p.font=c;const x=null===t?[]:(0,g.wordWrap)(t,c,this._textWidthCache,!0,i).map((e=>e.text));let v=0;if(i)v=i;else for(const e of x)v=Math.max(v,p.measureText(e).width);const R={top:r,right:o,bottom:n,left:s
|
|
},T=Math.max(e,a?.length?A:0),m=T*x.length+h*(x.length-1),b={width:v+R.left+R.right,height:m+R.top+R.bottom};if(_.x+=R.left,_.y+=R.top,a){const t=void 0!==this._data.textPadding?this._data.textPadding:e/2;_.x+=A+t,b.width+=A+t}return b.width%2!=0&&b.width++,this._preRenderedData={rectSize:b,padding:R,textPointOffset:_,lines:x,lineHeight:T,font:c},this._preRenderedData}_drawIcon(e,t,i,n,r,s){e.fillStyle=r?L:S,n.render(e,{targetViewBox:{x:t,y:i,width:Math.round(A*s.horizontalPixelRatio),height:Math.round(A*s.verticalPixelRatio)},doNotApplyColors:!0})}}var I,k,H,B=i(15938),D=i(39429),z=i(32211);!function(e){e[e.Offset=8]="Offset",e[e.FontSize=12]="FontSize",e[e.LineSpacing=8]="LineSpacing",e[e.RectRadius=4]="RectRadius",e[e.TextPadding=12]="TextPadding",e[e.PaddingTopBottom=12]="PaddingTopBottom",e[e.PaddingLeftRight=12]="PaddingLeftRight"}(I||(I={})),function(e){e.Background="#f2f2f2e6",e.Text="#1a1a1a"}(k||(k={})),function(e){e.Background="#464646e6",e.Text="#FFFFFF"}(H||(H={}));class E extends z.InplaceTextLineSourcePaneView{constructor(){super(...arguments),this._renderer=new d.CompositeRenderer,this._labelData=null,this._label=null,this._statsRenderer=new M}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateAndReturnStatsRenderer(e){this._statsRenderer.setData(this._statLabelData());const t=this._statsRenderer.rectSize();if(null!==t){const i=this._targetRect(e,t);this._statsRenderer.updatePoint((0,s.point)(i.left,i.top))}return this._statsRenderer}_targetRect(e,t){const i=this._source.properties().childs().statsPosition.value(),n=this._getPointsForStats(),o=i===D.StatsPosition.Auto?D.StatsPosition.Center:i;let a=n[o].x+12,l=n[o].y;const d=this._points[1].y<this._points[0].y&&this._points[1].x<this._points[0].x||this._points[1].y>this._points[0].y&&this._points[1].x>this._points[0].x;d?l-=12+t.height:l+=12;const{mediaSize:h}=e;return i!==D.StatsPosition.Auto||(0,s.equalPoints)(n[D.StatsPosition.Left],n[D.StatsPosition.Right])||(a<0?a=0:a+t.width>h.width&&(a=h.width-t.width),l<0?l=0:l+t.height>h.height&&(l=h.height-t.height),(0,r.intersectLineSegmentAndBox)((0,s.lineSegment)(n[D.StatsPosition.Left],n[D.StatsPosition.Right]),(0,s.box)((0,s.point)(a,l),(0,s.point)(a+t.width,l+t.height)))&&(l=d?n[o].y+12:n[o].y-12-t.height,a=Math.min(n[D.StatsPosition.Center].x,h.width)-t.width)),{left:Math.floor(a),top:Math.floor(l),width:t.width,height:t.height}}_priceRange(){const[e,t]=this._source.points(),i=this._source.properties().childs(),r=i.showPriceRange.value(),s=i.showPercentPriceRange.value(),o=i.showPipsPriceRange.value(),a=(0,n.ensureNotNull)(this._source.ownerSource());let l;if(this._source.priceScale()&&(r||s||o)){const i=[],n=t.price-e.price;if(r||s){const o=n/Math.abs(e.price),l=[];if(r){const i=a.formatter(),r=i.formatChange?.(t.price,e.price)??i.format(n);l.push(r)}if(s){const e=(0,h.getPercentageFormatter)().format(100*o);l.push(r?`(${e})`:e)}i.push(l.join(" "))}const d=this._model.mainSeries().symbolInfo(),c=d&&(0,h.getPipFormatter)(d);o&&c&&i.push(c.format(n)),l=i.join(", ")}return l
|
|
}_statLabelData(){const[e,t]=this._source.points(),r=this._source.properties().childs(),s=[];let d,u,p,_,f;const g=this._priceRange();void 0!==g&&s.push("priceRange");const x=r.showBarsRange.value(),v=r.showDateTimeRange&&r.showDateTimeRange.value(),w=r.showDistance&&r.showDistance.value(),R=r.showAngle&&r.showAngle.value();if(R||w){const i=(0,n.ensureNotNull)(this._source.pointToScreenPoint(e));_=(0,n.ensureNotNull)(this._source.pointToScreenPoint(t)).subtract(i),f=Math.round(1e5*_.length())/1e5}if(x||v||w){if(d="",x&&(p=t.index-e.index,d+=o.t(null,void 0,i(41643)).format({count:(0,a.forceLTRStr)(String(p))})),v){const i=this._model.timeScale().indexToUserTime(e.index),n=this._model.timeScale().indexToUserTime(t.index);if(i&&n){const e=(n.valueOf()-i.valueOf())/1e3,t=(0,a.startWithLTR)((new c.TimeSpanFormatter).format(e));t&&(d+=x?" ("+t+")":t)}}w&&(d&&(d+=", "),d+=o.t(null,void 0,i(44994)).format({number:(0,a.forceLTRStr)((0,h.getNumericFormatter)().format(Math.round(Number(f))))})),d&&s.push("barsRange")}if(R){let e;if(void 0!==f&&f>0&&void 0!==_&&(_=_.normalized(),e=Math.acos(_.x),_.y>0&&(e=-e)),"number"==typeof e&&!isNaN(e)){const t=180*e/Math.PI;u=Math.round(100*t)/100+"º",s.push("angle")}}this._label=[(0,a.forceLTRStr)(g),d,u].filter((e=>null!=e)).join("\n")||null;const T=this._model.dark().value(),m=T?"#464646e6":"#f2f2f2e6",b=T?"#FFFFFF":"#1a1a1a",y={point:this._points[1],text:this._label,color:b,isDark:T,font:B.CHART_FONT_FAMILY,fontSize:12,lineSpacing:8,backgroundColor:m,backgroundRoundRect:4,paddingLeft:12,paddingRight:12,paddingTop:12,paddingBottom:12,textPadding:12,doNotAlignText:!0,icons:s,bold:!1,italic:!1,lines:[],wordWrapWidth:0};return this._points[1].y<this._points[0].y&&(y.vertAlign=l.VerticalAlign.Bottom),this._points[1].x<this._points[0].x&&(y.horzAlign=l.HorizontalAlign.Right),this._labelData=y,y}}},41123:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LineToolTrianglePatternPaneView:()=>_});var n=i(50151),r=i(86441),s=i(51056),o=i(30699),a=i(95201),l=i(91046),d=i(1161),h=i(17330),c=i(49857),u=i(27916),p=i(15938);class _ extends u.LineSourcePaneView{constructor(){super(...arguments),this._trendLineRendererPoints01=new l.TrendLineRenderer,this._trendLineRendererPoints12=new l.TrendLineRenderer,this._trendLineRendererPoints23=new l.TrendLineRenderer,this._intersectionRenderer=new d.TriangleRenderer,this._aLabelRenderer=new h.TextRenderer,this._bLabelRenderer=new h.TextRenderer,this._cLabelRenderer=new h.TextRenderer,this._dLabelRenderer=new h.TextRenderer,this._renderer=null}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer=null;const[t,i,l,d]=this._points;let h,u,_;if(4===this._points.length){if(Math.abs(l.x-t.x)<1||Math.abs(d.x-i.x)<1)return;let e=Math.min(t.x,i.x);e=Math.min(e,l.x),e=Math.min(e,d.x);const n=(l.y-t.y)/(l.x-t.x),s=t.y+(e-t.x)*n,o=(d.y-i.y)/(d.x-i.x),a=i.y+(e-i.x)*o;if(Math.abs(n-o)<1e-6)return;u=new r.Point(e,s),_=new r.Point(e,a);const c=(i.y-t.y+(t.x*n-i.x*o))/(n-o);if(c<e){let e=Math.max(t.x,i.x)
|
|
;e=Math.max(e,l.x),e=Math.max(e,d.x),u=new r.Point(e,t.y+(e-t.x)*n),_=new r.Point(e,i.y+(e-i.x)*o)}const p=t.y+(c-t.x)*n;h=new r.Point(c,p)}if(this._points.length<2)return;const f=this._source.properties().childs(),g=new a.CompositeRenderer,x=(e,t)=>({points:[e],text:t,color:f.textcolor.value(),vertAlign:o.VerticalAlign.Middle,horzAlign:o.HorizontalAlign.Center,font:p.CHART_FONT_FAMILY,offsetX:0,offsetY:0,bold:f.bold&&f.bold.value(),italic:f.italic&&f.italic.value(),fontsize:f.fontsize.value(),backgroundColor:f.color.value(),backgroundRoundRect:4}),v=(e,t)=>({points:[e,t],color:f.color.value(),linewidth:f.linewidth.value(),linestyle:s.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:c.LineEnd.Normal,rightend:c.LineEnd.Normal});if(this._trendLineRendererPoints01.setData(v(t,i)),g.append(this._trendLineRendererPoints01),this._points.length>=3&&(this._trendLineRendererPoints12.setData(v(i,l)),g.append(this._trendLineRendererPoints12)),4===this._points.length&&(this._trendLineRendererPoints23.setData(v(l,d)),g.append(this._trendLineRendererPoints23),h)){const e={points:[(0,n.ensureDefined)(u),(0,n.ensureDefined)(_),h],color:f.color.value(),linewidth:f.linewidth.value(),backcolor:f.backgroundColor.value(),fillBackground:f.fillBackground.value(),transparency:f.transparency.value(),linestyle:s.LINESTYLE_DOTTED};this._intersectionRenderer.setData(e),g.append(this._intersectionRenderer)}const w=x(t,"A");i.y>t.y?(w.vertAlign=o.VerticalAlign.Bottom,w.offsetY=5):(w.vertAlign=o.VerticalAlign.Top,w.offsetY=5),this._aLabelRenderer.setData(w),g.append(this._aLabelRenderer);const R=x(i,"B");if(i.y<t.y?(R.vertAlign=o.VerticalAlign.Bottom,R.offsetY=5):(R.vertAlign=o.VerticalAlign.Top,R.offsetY=5),this._bLabelRenderer.setData(R),g.append(this._bLabelRenderer),this._points.length>2){const e=x(l,"C");l.y<i.y?(e.vertAlign=o.VerticalAlign.Bottom,e.offsetY=5):(e.vertAlign=o.VerticalAlign.Top,e.offsetY=5),this._cLabelRenderer.setData(e),g.append(this._cLabelRenderer)}if(this._points.length>3){const e=x(d,"D");d.y<l.y?(e.vertAlign=o.VerticalAlign.Bottom,e.offsetY=5):(e.vertAlign=o.VerticalAlign.Top,e.offsetY=5),this._dLabelRenderer.setData(e),g.append(this._dLabelRenderer)}this.addAnchors(g),this._renderer=g}}},86448:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TrianglePaneView:()=>o});var n=i(95201),r=i(1161),s=i(27916);class o extends s.LineSourcePaneView{constructor(){super(...arguments),this._renderer=new n.CompositeRenderer,this._triangleRenderer=new r.TriangleRenderer}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_updateImpl(e){super._updateImpl(e),this._renderer.clear();const t=this._source.properties().childs(),i={points:this._points,color:t.color.value(),linewidth:t.linewidth.value(),backcolor:t.backgroundColor.value(),fillBackground:t.fillBackground.value(),transparency:t.transparency.value()};this._triangleRenderer.setData(i),this._renderer.append(this._triangleRenderer),this.addAnchors(this._renderer)}}},63307:(e,t,i)=>{"use strict";i.r(t),i.d(t,{VertLinePaneView:()=>f})
|
|
;var n=i(86441),r=i(30699),s=i(95201),o=i(17330),a=i(72791),l=i(95173),d=i(13075),h=i(36036),c=i(15938),u=i(56468),p=i(32211),_=i(62689);class f extends p.InplaceTextLineSourcePaneView{constructor(e,t,i,n,r,s){super(e,t,n,r,s),this._lineRenderer=new l.VerticalLineRenderer,this._renderer=null,this._pane=i,this._labelRenderer=new _.LineToolTextRenderer(void 0,new u.HitTestResult(u.HitTarget.MovePoint,(0,p.inplaceEditHandlers)(this._tryActivateEditMode.bind(this,null))))}additionalCursorData(){const e=this._labelRenderer.getTextInfo();return{color:this._source.editableTextStyle().cursorColor,lineSpacing:e.lineSpacing,lineHeight:e.lineHeight,rotationPoint:this._labelRenderer.rotation()??void 0}}positionToCoordinate(e){return this._labelRenderer.positionToCoordinate(e)}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_validatePriceScale(){return!0}_updateImpl(e){if(super._updateImpl(e),this._renderer=null,0===this._points.length)return;const{mediaSize:{width:t,height:i}}=e,l=this._source.properties().childs(),p=new s.CompositeRenderer,_=l.text.value(),f=this._isTextEditMode(),g=this._placeHolderMode();let x,v=!0;if(1===this._points.length){const e=new n.Point(this._points[0].x,i/2);this._addAlertRenderer(p,[e])}if(this._source.model().paneForSource(this._source)===this._pane&&(l.showLabel?.value()&&_||g||f)){let e=0,s=5,a=r.HorizontalAlign.Center,h=r.VerticalAlign.Middle;const u=this._points[0].x;let _=0;switch(l.vertLabelsAlign.value()){case"top":_=i;break;case"middle":_=i/2;break;case"bottom":_=0}if("horizontal"===l.textOrientation.value()){switch(l.horzLabelsAlign.value()){case"left":a=r.HorizontalAlign.Right;break;case"right":a=r.HorizontalAlign.Left;break;case"center":a=r.HorizontalAlign.Center}switch(l.vertLabelsAlign.value()){case"top":h=r.VerticalAlign.Bottom;break;case"middle":h=r.VerticalAlign.Middle;break;case"bottom":h=r.VerticalAlign.Top}}else{switch(e=-Math.PI/2,s=0,l.horzLabelsAlign.value()){case"left":h=r.VerticalAlign.Bottom;break;case"right":h=r.VerticalAlign.Top;break;case"center":h=r.VerticalAlign.Middle}switch(l.vertLabelsAlign.value()){case"top":a=r.HorizontalAlign.Left;break;case"middle":a=r.HorizontalAlign.Center;break;case"bottom":a=r.HorizontalAlign.Right}}this._labelRenderer.setData({points:[new n.Point(u,_)],text:this._textData(),color:this._textColor(),vertAlign:h,horzAlign:a,font:c.CHART_FONT_FAMILY,offsetX:s,offsetY:0,bold:l.bold.value(),italic:l.italic.value(),fontsize:l.fontsize.value(),forceTextAlign:!0,angle:e,decorator:g?d.PlusTextRendererDecorator.instance():void 0,...this._inplaceTextHighlight()}),this._labelRenderer.setCursorType(this._textCursorType()),p.append(this._labelRenderer),this._needLabelExclusionPath(this._labelRenderer)&&(x=(0,o.getTextBoundaries)(this._labelRenderer,t,i)??void 0),v=this._labelRenderer.isOutOfScreen(t,i),v?this.closeTextEditor():this._updateInplaceText(this._labelRenderer.getTextInfo())}const w={x:this._points[0].x,color:l.linecolor.value(),linewidth:l.linewidth.value(),linestyle:l.linestyle.value(),excludeBoundaries:x
|
|
},R=w.linewidth/2+1;if(v=v&&(w.x<-R||w.x>t+R),this._lineRenderer.setData(w),this._lineRenderer.setHitTest(new u.HitTestResult(u.HitTarget.MovePoint,{snappingIndex:this._source.points()[0].index})),p.insert(this._lineRenderer,0),!v){if(1===this._points.length&&!this._isTextEditMode()){const e=[(0,h.lineSourcePaneViewPointToLineAnchorPoint)(new n.Point(this._points[0].x,.9*i),0,a.PaneCursorType.HorizontalResize,!0,void 0,void 0,this._source.points()[0].index)];p.append(this.createLineAnchor({points:e},0))}this._renderer=p}}_needLabelExclusionPath(e){const t=this._source.properties().childs(),i="horizontal"===t.textOrientation.value(),n=t.text.value();if(i)return""!==n.trim();if("center"!==t.horzLabelsAlign.value())return!1;const r=e.getLinesInfo().lines;if(r.length%2==0)return!1;if(""===r[Math.floor(r.length/2)].text.trim())return!1;return!0}}},55053:(e,t,i)=>{"use strict";i.d(t,{ArcWedgeRenderer:()=>a});var n,r=i(56468),s=i(19063),o=i(75919);!function(e){e[e.HitTestTolerance=4]="HitTestTolerance"}(n||(n={}));class a extends o.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null,this._hitTest=new r.HitTestResult(r.HitTarget.MovePoint),this._backHitTest=new r.HitTestResult(r.HitTarget.MovePointBackground)}setData(e){this._data=e}setHitTest(e){this._hitTest=e}hitTest(e){if(null===this._data)return null;const t=e.subtract(this._data.center),i=t.length();if(Math.abs(i-this._data.radius)<=4){const t=e.subtract(this._data.p1).length(),i=e.subtract(this._data.p2).length();if(Math.max(t,i)<=this._data.p1.subtract(this._data.p2).length())return this._hitTest}if(this._data.fillBackground&&i<=this._data.radius){const e=this._data.p1.subtract(this._data.center).normalized(),i=this._data.p2.subtract(this._data.center).normalized(),n=t.normalized(),r=e.dotProduct(i),s=n.dotProduct(e),o=n.dotProduct(i);if(s>=r&&o>=r)return this._backHitTest}return null}_drawImpl(e){if(null===this._data)return;const t=e.context;if(t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.beginPath(),t.arc(this._data.center.x,this._data.center.y,this._data.radius,this._data.angle1,this._data.angle2),t.stroke(),this._data.fillBackground){if(t.arc(this._data.center.x,this._data.center.y,this._data.prevRadius,this._data.angle2,this._data.angle1,!0),this._data.gradient){const e=t.createRadialGradient(this._data.center.x,this._data.center.y,this._data.prevRadius,this._data.center.x,this._data.center.y,this._data.radius);e.addColorStop(0,(0,s.generateColor)(this._data.color1,this._data.transparency)),e.addColorStop(1,(0,s.generateColor)(this._data.color2,this._data.transparency)),t.fillStyle=e}else t.fillStyle=(0,s.generateColor)(this._data.color,this._data.transparency,!0);t.fill()}}}},66825:(e,t,i)=>{"use strict";i.d(t,{cubicBezierHitTest:()=>l,extendQuadroBezier:()=>d,quadroBezierHitTest:()=>o});var n,r=i(4652),s=i(9859);function o(e,t,i,n,s){const o=i.subtract(e).length()+i.subtract(t).length(),a=Math.max(3/o,.02);let l;for(let o=0;;o+=a){o>1&&(o=1)
|
|
;const a=e.scaled((1-o)*(1-o)),d=i.scaled(2*o*(1-o)),h=t.scaled(o*o),c=a.add(d).add(h);if(void 0!==l){if((0,r.distanceToSegment)(c,l,n).distance<s)return!0}else if(c.subtract(n).length()<s)return!0;if(l=c,1===o)break}return!1}function a(e,t,i,n,r){r=(0,s.clamp)(r,0,1);const o=e.scaled((1-r)*(1-r)*(1-r)),a=t.scaled(3*(1-r)*(1-r)*r),l=i.scaled(3*(1-r)*r*r),d=n.scaled(r*r*r);return o.add(a).add(l).add(d)}function l(e,t,i,n,s,o){const l=t.subtract(e).length()+i.subtract(t).length()+n.subtract(i).length(),d=Math.max(3/l,.02);let h;for(let l=0;;l+=d){const d=a(e,t,i,n,l);if(void 0!==h){if((0,r.distanceToSegment)(d,h,s).distance<o)return!0}else if(d.subtract(s).length()<o)return!0;if(h=d,l>=1)break}return!1}function d(e,t,i,n,r){const s=i.subtract(e).length()+i.subtract(t).length();if(!s)return[];const o=function(e,t,i,n,r){const s=[],o=h(e.y,t.y,i.y,0).concat(h(e.y,t.y,i.y,r));for(let r=0;r<o.length;r++){const a=c(e.x,t.x,i.x,o[r]);a>=0&&a<=n&&s.push(o[r])}const a=h(e.x,t.x,i.x,0).concat(h(e.x,t.x,i.x,n));for(let n=0;n<a.length;n++){const o=c(e.y,t.y,i.y,a[n]);o>=0&&o<=r&&s.push(a[n])}return s}(e,t,i,n,r).filter((e=>e>1)).sort(((e,t)=>e-t));t.x>=0&&t.x<=n&&t.y>=0&&t.y<=r&&o.unshift(1);const a=3/s,l=[];for(let n=0;n<o.length-1;n+=2){let r=a,s=o[n],d=o[n+1]+r;const h=[];for(;s<=d;){const n=e.scaled((1-s)*(1-s)),o=i.scaled(2*s*(1-s)),a=t.scaled(s*s),l=n.add(o).add(a);if(h.length>0){h[h.length-1].subtract(l).length()<2&&(d+=r,r*=2)}h.push(l),s+=r}h.length>0&&l.push(h)}return l}function h(e,t,i,n){const r=[],s=e-2*i+t,o=2*i-2*e,a=e-n;if(Math.abs(s)>1e-8){const e=o*o-4*s*a;e>=0&&(r.push((-o+Math.sqrt(e))/(2*s)),r.push((-o-Math.sqrt(e))/(2*s)))}else r.push(-a/o);return r}function c(e,t,i,n){return(1-n)*(1-n)*e+2*(1-n)*n*i+n*n*t}!function(e){e[e.MaxHitTestSegments=50]="MaxHitTestSegments"}(n||(n={}))},65395:(e,t,i)=>{"use strict";i.d(t,{ChannelRenderer:()=>c});var n=i(50151),r=i(86441),s=i(34026),o=i(4652),a=i(56468),l=i(37743),d=i(19063),h=i(75919);class c extends h.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e,t){if(null===this._data||!this._data.hittestOnBackground)return null;const i=this._visiblePolygon(t.mediaSize);return null!==i&&(0,s.pointInPolygon)(e,i)?new a.HitTestResult(a.HitTarget.MovePointBackground):null}_drawImpl(e){if(null===this._data)return;const t=e.context,i=this._visiblePolygon(e.mediaSize);if(null!==i){t.beginPath(),t.moveTo(i[0].x,i[0].y);for(let e=1;e<i.length;e++)t.lineTo(i[e].x,i[e].y);t.fillStyle=(0,d.generateColor)(this._data.color,this._data.transparency,!0),t.fill()}}_visiblePolygon(e){const t=(0,n.ensureNotNull)(this._data),i=t.p1,s=t.p2,a=t.p3,d=t.p4;if((0,r.equalPoints)(i,s)||(0,r.equalPoints)(a,d)||(0,o.distanceToLine)(i,s,a).distance<1e-6&&(0,o.distanceToLine)(i,s,d).distance<1e-6)return null;if(e.width<=0||e.height<=0)return null;let h=[new r.Point(0,0),new r.Point(e.width,0),new r.Point(e.width,e.height),new r.Point(0,e.height)];return h=(0,l.clipPolygonByEdge)(h,i,s,[d,a]),h=(0,l.clipPolygonByEdge)(h,d,a,[i,s]),(0,
|
|
r.equalPoints)(a,i)||t.extendLeft||(h=(0,l.clipPolygonByEdge)(h,a,i,[s,d])),h}}},62317:(e,t,i)=>{"use strict";i.d(t,{DisjointChannelRenderer:()=>_});var n=i(50151),r=i(86441),s=i(34026),o=i(4652),a=i(5531),l=i(51056),d=i(56468),h=i(93610),c=i(37743),u=i(19063),p=i(75919);class _{constructor(){this._parallelChannelRenderer=new h.ParallelChannelRenderer,this._disjointChannelIntersectionRenderer=new f,this._selectedRenderer=this._disjointChannelIntersectionRenderer}setData(e){if(e.points.length<4)return;const[t,i,n,s]=e.points;if((0,r.equalPoints)(t,i)||(0,r.equalPoints)(n,s)||(0,o.distanceToLine)(t,i,n).distance<1e-6&&(0,o.distanceToLine)(t,i,s).distance<1e-6)this._selectedRenderer=null;else{null!==(0,a.intersectLines)((0,r.lineThroughPoints)(t,i),(0,r.lineThroughPoints)(n,s))?(this._disjointChannelIntersectionRenderer.setData(e),this._selectedRenderer=this._disjointChannelIntersectionRenderer):(this._parallelChannelRenderer.setData({line1:{color:"rgba(0,0,0,0)",lineStyle:l.LINESTYLE_SOLID,lineWidth:0,points:[t,i]},line2:{color:"rgba(0,0,0,0)",lineStyle:l.LINESTYLE_SOLID,lineWidth:0,points:[s,n]},extendLeft:e.extendleft,extendRight:e.extendright,skipLines:!0,fillBackground:!0,backColor:(0,u.generateColor)(e.backcolor,e.transparency),hittestOnBackground:e.hittestOnBackground}),this._selectedRenderer=this._parallelChannelRenderer)}}hitTest(e,t){return null!==this._selectedRenderer?this._selectedRenderer.hitTest(e,t):null}draw(e,t){null!==this._selectedRenderer&&this._selectedRenderer.draw(e,t)}}class f extends p.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e,t){if(null===this._data||!this._data.hittestOnBackground)return null;for(const i of this._visiblePolygons(t.mediaSize))if((0,s.pointInPolygon)(e,i))return new d.HitTestResult(d.HitTarget.MovePointBackground);return null}_drawImpl(e){if(null===this._data||this._data.points.length<4)return;const t=e.context;t.fillStyle=(0,u.generateColor)(this._data.backcolor,this._data.transparency);for(const i of this._visiblePolygons(e.mediaSize)){t.beginPath(),t.moveTo(i[0].x,i[0].y);for(let e=1;e<i.length;e++)t.lineTo(i[e].x,i[e].y);t.fill()}}_visiblePolygons(e){const t=(0,n.ensureNotNull)(this._data),[i,s,o,l]=t.points;if(e.width<=0||e.height<=0)return[];const d=(0,a.intersectLines)((0,r.lineThroughPoints)(i,s),(0,r.lineThroughPoints)(o,l));if(null===d)return[];const h=[new r.Point(0,0),new r.Point(e.width,0),new r.Point(e.width,e.height),new r.Point(0,e.height)],u=[];{let e=h;const n=i.subtract(s).add(d),r=l.subtract(o).add(d);e=(0,c.clipPolygonByEdge)(e,d,n,[r,r]),e=x(e,t),e=(0,c.clipPolygonByEdge)(e,r,d,[n,n]),null!==e&&u.push(e)}{let e=h;const n=s.subtract(i).add(d),r=o.subtract(l).add(d);e=(0,c.clipPolygonByEdge)(e,d,n,[r,r]),e=x(e,t),e=(0,c.clipPolygonByEdge)(e,r,d,[n,n]),null!==e&&u.push(e)}return u}}function g(e,t,i){return null!==e?(0,a.intersectPolygonAndHalfplane)(e,(0,r.halfplaneThroughPoint)((n=t,(0,r.line)(1,0,-n)),new r.Point(i,0))):null;var n}function x(e,t){const[i,n]=t.points
|
|
;return t.extendleft||(e=g(e,i.x,n.x)),t.extendright||(e=g(e,n.x,i.x)),e}},36155:(e,t,i)=>{"use strict";i.d(t,{EllipseRendererSimple:()=>h});var n,r=i(56468),s=i(9859),o=i(86441),a=i(19063),l=i(75919),d=i(37743);!function(e){e[e.HitTestTolerance=3]="HitTestTolerance"}(n||(n={}));class h extends l.MediaCoordinatesPaneRenderer{constructor(e,t,i){super(),this._data=e,this._hitTest=t||new r.HitTestResult(r.HitTarget.MovePoint),this._backgroundHitTest=i||new r.HitTestResult(r.HitTarget.MovePointBackground)}hitTest(e){if(this._data.points.length<2)return null;const t=this._data.points[0],i=this._data.points[1],n=.5*Math.abs(t.x-i.x),r=Math.abs(t.x-i.x),a=Math.abs(t.y-i.y),l=t.add(i).scaled(.5);let d=e.subtract(l);if(r<1||a<1)return null;const h=(i.y-t.y)/(i.x-t.x);d=new o.Point(d.x,d.y/h);let c=d.x*d.x+d.y*d.y-n*n;return c=(0,s.sign)(c)*Math.sqrt(Math.abs(c/n)),Math.abs(c)<3?this._hitTest:this._data.fillBackground&&!this._data.noHitTestOnBackground&&c<3?this._backgroundHitTest:null}_drawImpl(e){const t=e.context;t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,void 0!==this._data.linestyle&&(0,d.setLineStyle)(t,this._data.linestyle);const i=this._data.points[0],n=this._data.points[1],r=Math.abs(i.x-n.x),s=Math.abs(i.y-n.y),o=i.add(n).scaled(.5);if(r<1||s<1)return;let l=0;if(this._data.wholePoints){const e=this._data.wholePoints[0],t=this._data.wholePoints[1];l=Math.abs(e.x-t.x)}t.save(),t.translate(o.x,o.y),t.scale(1,s/r),t.beginPath(),t.arc(0,0,r/2,0,2*Math.PI,!1),t.restore(),t.stroke(),this._data.fillBackground&&(this._data.wholePoints&&(t.translate(o.x,o.y),t.scale(1,s/r),t.arc(0,0,l/2,0,2*Math.PI,!0)),t.fillStyle=(0,a.generateColor)(this._data.backcolor,this._data.transparency,!0),t.fill())}}},48633:(e,t,i)=>{"use strict";i.d(t,{intersectLineWithViewport:()=>o});var n=i(86441);function r(e,t,i){return e>=t&&e<=i?e:null}function s(e,t,i,n){return Math.sign(e.x-t.x)===Math.sign(i.x-n.x)&&Math.sign(e.y-t.y)===Math.sign(i.y-n.y)}function o(e,t,i,o,a,l,d){const h=e.x>=0&&e.x<=a&&e.y>=0&&e.y<=l,c=t.x>=0&&t.x<=a&&t.y>=0&&t.y<=l;if(h&&c&&!i&&!o)return[e,t];if(e.x<0&&t.x<0&&(e.x<t.x?!o:!i)||e.x>a&&t.x>a&&(e.x<t.x?!i:!o)||e.y<0&&t.y<0&&(e.y<t.y?!o:!i)||e.y>l&&t.y>l&&(e.y<t.y?!i:!o))return null;const u=[];if(e.x===t.x){if(e.x<0||e.x>a)return null;e.y<t.y?u.push(new n.Point(e.x,0===d?0:e.y<0?e.y%d:-(d-e.y%d)),new n.Point(t.x,l)):u.push(new n.Point(e.x,0===d?l:e.y>l?l+(e.y-l)%d:l+(d-(l-e.y)%d)),new n.Point(t.x,0))}else if(e.y===t.y){if(e.y<0||e.y>l)return null;e.x<t.x?u.push(new n.Point(0===d?0:e.x<0?e.x%d:-(d-e.x%d),e.y),new n.Point(a,t.y)):u.push(new n.Point(0===d?a:e.x>a?a+(e.x-a)%d:a+(d-(a-e.x)%d),e.y),new n.Point(0,t.y))}else{const s=(t.y-e.y)/(t.x-e.x),o=e.y-s*e.x;let h=0,c=0;const p=r(o,0,l);if(null!==p)if(d>0&&(e.x<=0||i&&e.x<t.x)){const t=e.x<=0?Math.sqrt(Math.pow(0-e.x,2)+Math.pow(p-e.y,2))%d:d-Math.sqrt(Math.pow(0-e.x,2)+Math.pow(p-e.y,2))%d;h=Math.cos(Math.atan(s))*t,c=s*h,u.push(new n.Point(-h,p-c))}else u.push(new n.Point(0,p));const _=r(s*a+o,0,l)
|
|
;if(null!==_)if(d>0&&(e.x>=a||i&&e.x>t.x)){const t=e.x>=a?Math.sqrt(Math.pow(e.x-a,2)+Math.pow(e.y-_,2))%d:d-Math.sqrt(Math.pow(e.x-a,2)+Math.pow(e.y-_,2))%d;h=Math.cos(Math.atan(s))*t,c=s*h,u.push(new n.Point(a+h,_+c))}else u.push(new n.Point(a,_));const f=r(-o/s,0,a);if(null!==f&&(0!==f||0!==p))if(d>0&&(e.y<=0||i&&e.y<t.y)){const t=e.y<=0?Math.sqrt(Math.pow(e.x-f,2)+Math.pow(e.y-0,2))%d:d-Math.sqrt(Math.pow(e.x-f,2)+Math.pow(e.y-0,2))%d;h=Math.cos(Math.atan(s))*t,c=s*h,u.push(new n.Point(f-Math.sign(s)*h,-Math.sign(s)*c))}else u.push(new n.Point(f,0));const g=r((l-o)/s,0,a);if(null!==g&&(0!==g||_!==l))if(d>0&&(e.y>=l||i&&e.y>t.y)){const t=e.y>=l?Math.sqrt(Math.pow(e.x-g,2)+Math.pow(e.y-l,2))%d:d-Math.sqrt(Math.pow(e.x-g,2)+Math.pow(e.y-l,2))%d;h=Math.cos(Math.atan(s))*t,c=s*h,u.push(new n.Point(g+Math.sign(s)*h,l+Math.sign(s)*c))}else u.push(new n.Point(g,l))}if(u.length<1)return null;if(u.length<2&&u.push(u[0]),!i&&h){return[e,s(u[0],u[1],e,t)?u[1]:u[0]]}if(!o&&c){return[s(u[0],u[1],e,t)?u[0]:u[1],t]}return s(u[0],u[1],e,t)?[u[0],u[1]]:[u[1],u[0]]}},93610:(e,t,i)=>{"use strict";i.d(t,{ParallelChannelRenderer:()=>x});const n=function(e,t){for(var i,n=-1,r=e.length;++n<r;){var s=t(e[n]);void 0!==s&&(i=void 0===i?s:i+s)}return i};var r=i(76402);const s=function(e){return e&&e.length?n(e,r.default):0};var o=i(34026),a=i(86441),l=i(4652),d=i(5531),h=i(51056),c=i(56468),u=i(61993),p=i(37743),_=i(48633),f=i(7114),g=i(30125);class x extends g.BitmapCoordinatesPaneRenderer{constructor(e,t){super(),this._data=null,this._backgroundPolygon=null,this._clippedLines=new Map,this._hittestResult=e||new c.HitTestResult(c.HitTarget.MovePoint),this._backHittestResult=t||new c.HitTestResult(c.HitTarget.MovePointBackground)}setData(e){this._data=e,this._backgroundPolygon=null,this._clippedLines.clear()}hitTest(e,t){if(null===this._data)return null;const{line1:i,line2:n,middleLine:r}=this._data,s=t.mediaSize,a=(0,u.interactionTolerance)().line;for(const t of[i,n,r]){if(!t)continue;const i=this._getClippedLine(t,this._data,s);if(i){if((0,l.distanceToSegment)(i.points[0],i.points[1],e).distance<=a)return this._hittestResult}}if(this._data.hittestOnBackground&&this._data.fillBackground){const t=this._getBackgroundPolygon(this._data,s);if(t.length>0&&(0,o.pointInPolygon)(e,t))return this._backHittestResult}return null}_drawImpl(e){if(null===this._data)return;const{line1:t,line2:i,middleLine:n,skipLines:r,skipTopLine:s,fillBackground:o,backColor:a}=this._data,l=e.context;l.lineCap="round";const d=this._data;if(o&&i){const t=this._getBackgroundPolygon(this._data,e.mediaSize);if(t.length>0){l.beginPath();{const i=t[0].x*e.horizontalPixelRatio,n=t[0].y*e.verticalPixelRatio;l.moveTo(i,n)}for(let i=1;i<t.length;i++){const n=t[i].x*e.horizontalPixelRatio,r=t[i].y*e.verticalPixelRatio;l.lineTo(n,r)}l.fillStyle=a,l.fill()}}void 0!==d.excludeBoundaries&&(l.save(),(0,f.addExclusionArea)(l,e,d.excludeBoundaries)),r||this._drawLine(e,t,this._data),r||s||!i||this._drawLine(e,i,this._data),n&&!this._data.skipLines&&this._drawLine(e,n,this._data),
|
|
void 0!==d.excludeBoundaries&&l.restore()}_drawLine(e,t,i){const n=this._getClippedLine(t,i,e.mediaSize);if(!n)return;const r=e.context;r.strokeStyle=n.color,r.lineWidth=r.lineWidth=Math.max(1,Math.floor(n.lineWidth*e.horizontalPixelRatio)),r.lineCap=n.lineStyle===h.LINESTYLE_SOLID?"round":"butt",(0,p.setLineStyle)(r,n.lineStyle),r.strokeStyle=n.color;const[s,o]=n.points,a=s.x*e.horizontalPixelRatio,l=s.y*e.verticalPixelRatio,d=o.x*e.horizontalPixelRatio,c=o.y*e.verticalPixelRatio;(0,p.drawPixelPerfectLine)(r,a,l,d,c)}_getClippedLine(e,t,i){let n=this._clippedLines.get(e);if(void 0===n){const{lineWidth:r,lineStyle:o,points:[a,l]}=e;let d=!1,h=!1;a.x!==l.x&&({extendLeft:d,extendRight:h}=t);const c=(0,_.intersectLineWithViewport)(a,l,d,h,i.width,i.height,s((0,p.computeDashPattern)(r,o)));n=null==c?null:{...e,points:c},this._clippedLines.set(e,n)}return n}_getBackgroundPolygon(e,t){return this._backgroundPolygon||(this._backgroundPolygon=this._getBackgroundPolygonImpl(e,t)??[]),this._backgroundPolygon}_getBackgroundPolygonImpl(e,t){if(void 0===e.line2)return null;const[i,n]=e.line1.points,[r,s]=e.line2.points;if((0,a.equalPoints)(i,n)||(0,a.equalPoints)(r,s)||(0,l.distanceToLine)(i,n,r).distance<1e-6||(0,l.distanceToLine)(i,n,s).distance<1e-6)return null;if(t.width<=0||t.height<=0)return null;let o=[new a.Point(0,0),new a.Point(t.width,0),new a.Point(t.width,t.height),new a.Point(0,t.height)];return o=v(o,i,n,s),e.extendRight||(o=v(o,n,s,r)),o=v(o,s,r,i),e.extendLeft||(o=v(o,r,i,n)),o}}function v(e,t,i,n){return null!==e?(0,d.intersectPolygonAndHalfplane)(e,(0,a.halfplaneThroughPoint)((0,a.lineThroughPoints)(t,i),n)):null}},74011:(e,t,i)=>{"use strict";i.d(t,{PolygonRenderer:()=>_});var n=i(34026),r=i(4652),s=i(91046),o=i(49857),a=i(56468),l=i(19063),d=i(75919),h=i(61993),c=i(37743),u=i(51056),p=i(64034);class _ extends d.MediaCoordinatesPaneRenderer{constructor(e){super(),this._data=null,this._backHittest=new a.HitTestResult(a.HitTarget.MovePointBackground),this._points=[],this._hittest=e??new a.HitTestResult(a.HitTarget.MovePoint)}setData(e){this._data=e,this._points=e.points}hitTest(e){if(null===this._data||this._data.disableInteractions)return null;const t=Math.max((0,h.interactionTolerance)().line,Math.ceil(this._data.linewidth/2)),i=this._points.length;if(1===i){return(0,n.pointInCircle)(e,this._points[0],t)?this._hittest:null}for(let n=1;n<i;n++){const i=this._points[n-1],s=this._points[n];if((0,r.distanceToSegment)(i,s,e).distance<=t)return this._hittest}if(this._data.filled&&this._data.fillBackground&&i>0){const n=this._points[0],s=this._points[i-1];if((0,r.distanceToSegment)(n,s,e).distance<=t)return this._hittest}return this._data.filled&&this._data.fillBackground&&(0,n.pointInPolygon)(e,this._data.points)?this._backHittest:null}_drawImpl(e){const t=e.context,i=this._points.length;if(null===this._data||0===i)return;const n=t.globalAlpha;try{if(void 0!==this._data.globalAlpha&&(t.globalAlpha=this._data.globalAlpha),1===i)return void this._drawPoint(t,this._points[0],this._data.linewidth/2,this._data.color)
|
|
;t.beginPath();const e=this._data.linestyle===u.LINESTYLE_SOLID?"round":"butt",n=this._data.linecap??e;t.lineCap=n,t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineJoin=this._data.linejoin??"round",(0,c.setLineStyle)(t,this._data.linestyle);const r=this._points[0];t.moveTo(r.x,r.y);for(const e of this._points)t.lineTo(e.x,e.y);if(this._data.filled&&this._data.fillBackground&&(t.fillStyle=(0,l.generateColor)(this._data.backcolor,this._data.transparency),t.fill()),this._data.filled&&!this._data.skipClosePath&&t.closePath(),i>1){if(this._data.leftend===o.LineEnd.Arrow){const e=this._correctArrowPoints(this._points[1],this._points[0],t.lineWidth,n);(0,s.drawArrow)(e[0],e[1],t,t.lineWidth,p.dpr1PixelRatioInfo)}if(this._data.rightend===o.LineEnd.Arrow){const e=this._correctArrowPoints(this._points[i-2],this._points[i-1],t.lineWidth,n);(0,s.drawArrow)(e[0],e[1],t,t.lineWidth,p.dpr1PixelRatioInfo)}}this._data.linewidth>0&&t.stroke()}finally{t.globalAlpha=n}}_drawPoint(e,t,i,n){0!==i&&(e.beginPath(),e.fillStyle=n,e.arc(t.x,t.y,i,0,2*Math.PI,!0),e.fill(),e.closePath())}_correctArrowPoints(e,t,i,n){const r=t.subtract(e),s=r.length();if("butt"===n||s<1)return[e,t];const o=s+i/2;return[e,r.scaled(o/s).add(e)]}}},13075:(e,t,i)=>{"use strict";i.d(t,{PlusTextRendererDecorator:()=>r});var n=i(17330);class r{geometry(e){const t=(0,n.fontSize)(e);return{decoratorAndTextMargin:t/3,width:Math.round(.8*t),ignoreRtl:!1}}draw(e,t,i,n){const{horizontalPixelRatio:r,verticalPixelRatio:s}=t,o=Math.max(1,Math.round(r*n.decoratorWidth/8)),a=o%2/2,l=Math.round((n.textTop+n.textBottom)/2*s)+a,d=Math.round((n.decoratorLeft+n.decoratorWidth/2)*r)+a,h=Math.round(n.decoratorWidth*r);e.strokeStyle=i.color,e.lineWidth=o;let c=h/2;d%2/2!=c%2/2&&(c+=.5),e.beginPath(),e.moveTo(d-c,l),e.lineTo(d+c,l),e.moveTo(d,l-c),e.lineTo(d,l+c),e.stroke()}static instance(){return this._instance=this._instance??new r,this._instance}}r._instance=null},1161:(e,t,i)=>{"use strict";i.d(t,{TriangleRenderer:()=>p});var n=i(86441),r=i(4652),s=i(34026),o=i(75919),a=i(56468),l=i(19063),d=i(61993),h=i(37743),c=i(51056),u=i(48633);class p extends o.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e){if(null===this._data||this._data.points.length<2)return null;const[t,i]=this._data.points;let n=(0,r.distanceToSegment)(t,i,e);const o=(0,d.interactionTolerance)().line;if(n.distance<=o)return new a.HitTestResult(a.HitTarget.MovePoint);if(3!==this._data.points.length)return null;const l=this._data.points[2];return n=(0,r.distanceToSegment)(i,l,e),n.distance<=o?new a.HitTestResult(a.HitTarget.MovePoint):(n=(0,r.distanceToSegment)(l,t,e),n.distance<=o?new a.HitTestResult(a.HitTarget.MovePoint):this._data.fillBackground&&(0,s.pointInTriangle)(e,t,i,l)?new a.HitTestResult(a.HitTarget.MovePointBackground):null)}_drawImpl(e){if(null===this._data||this._data.points.length<2)return;const t=e.context,i=(this._data.linestyle??c.LINESTYLE_SOLID)===c.LINESTYLE_SOLID?"round":"butt";t.lineCap=i,t.lineJoin="round",
|
|
t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,void 0!==this._data.linestyle&&(0,h.setLineStyle)(t,this._data.linestyle);const[r,s,o=s]=this._data.points,{mediaSize:a}=e;if(this._data.fillBackground&&Math.abs((r.x-o.x)*(s.y-o.y)-(s.x-o.x)*(r.y-o.y))>1e-10){let e=[new n.Point(0,0),new n.Point(a.width,0),new n.Point(a.width,a.height),new n.Point(0,a.height)];if(e=(0,h.clipPolygonByEdge)(e,r,s,[s,o]),e=(0,h.clipPolygonByEdge)(e,s,o,[o,r]),e=(0,h.clipPolygonByEdge)(e,o,r,[r,s]),e&&e.length>1){t.save(),t.beginPath(),t.moveTo(e[0].x,e[0].y);for(let i=1;i<e.length;i++)t.lineTo(e[i].x,e[i].y);t.fillStyle=(0,l.generateColor)(this._data.backcolor,this._data.transparency),t.fill(),t.restore()}}const d=[],p=t.getLineDash().reduce(((e,t)=>e+t),0);[[r,s],[s,o],[o,r]].forEach((([e,t])=>{const i=(0,u.intersectLineWithViewport)(e,t,!1,!1,a.width,a.height,p);i&&d.push(i)})),d.length&&(t.beginPath(),d.forEach((([e,i])=>{t.moveTo(e.x,e.y),t.lineTo(i.x,i.y)})),t.stroke())}}},19365:(e,t,i)=>{"use strict";i.d(t,{getTwemojiUrl:()=>r});var n=i(18438);function r(e,t){let i="";return n.default.parse(e,(e=>(i=n.default.base+("svg"===t?`svg/${e}.svg`:`72x72/${e}.png`),!1))),i}n.default.base="https://cdnjs.cloudflare.com/ajax/libs/twemoji/13.0.1/"},63929:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" fill-rule="evenodd" d="M8.55 2.78 2.7 15H15v-1h-4.01a6.2 6.2 0 0 0-1.36-3.95 7.94 7.94 0 0 0-2.57-1.83l2.4-5-.91-.44ZM6.63 9.12 4.29 14H10a5.18 5.18 0 0 0-1.12-3.3 6.93 6.93 0 0 0-2.24-1.58Z"/></svg>'},1195:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" fill-rule="evenodd" d="M2 3v2H1v9h1v2h1v-2h1V5H3V3H2Zm6.2 4.5-.35.35L6.71 9h4.58l-1.14-1.15-.36-.35.71-.7.35.35 2 2 .36.35-.36.35-2 2-.35.36-.7-.71.35-.35L11.29 10H6.71l1.14 1.15.36.35-.71.7-.35-.35-2-2-.36-.35.36-.35 2-2 .35-.36.7.71ZM3 6H2v7h1V6Zm12-2.5V3h1v2h1v9h-1v2h-1v-2h-1V5h1V3.5ZM15 6h1v7h-1V6Z"/></svg>'},42057:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18"><path fill="currentColor" d="M3 2h11v1H3V2Zm5.5 1.8.35.35 2 2 .36.35-.71.7-.35-.35L9 5.71v6.58l1.15-1.14.35-.36.7.71-.35.35-2 2-.35.36-.35-.36-2-2-.36-.35.71-.7.35.35L8 12.29V5.71L6.85 6.85l-.35.36-.7-.71.35-.35 2-2 .35-.36ZM3.5 16H3v-1h11v1H3.5Z"/></svg>'},18438:(e,t,i)=>{"use strict";i.d(t,{default:()=>n});const n=function(){var e={base:"https://twemoji.maxcdn.com/v/13.0.1/",ext:".png",size:"72x72",className:"emoji",convert:{fromCodePoint:function(e){var t="string"==typeof e?parseInt(e,16):e;if(t<65536)return a(t);return a(55296+((t-=65536)>>10),56320+(1023&t))},toCodePoint:x},onerror:function(){this.parentNode&&this.parentNode.replaceChild(l(this.alt,!1),this)},parse:function(t,i){i&&"function"!=typeof i||(i={callback:i});return("string"==typeof t?p:u)(t,{callback:i.callback||d,attributes:"function"==typeof i.attributes?i.attributes:f,base:"string"==typeof i.base?i.base:e.base,ext:i.ext||e.ext,
|
|
size:i.folder||(n=i.size||e.size,"number"==typeof n?n+"x"+n:n),className:i.className||e.className,onerror:i.onerror||e.onerror});var n},replace:g,test:function(e){i.lastIndex=0;var t=i.test(e);return i.lastIndex=0,t}},t={"&":"&","<":"<",">":">","'":"'",'"':"""
|
|
},i=/(?:\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d])|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf7c\udf84\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc70\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc3b\u200d\u2744\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f|\ud83d\udc08\u200d\u2b1b)|[#*0-9]\ufe0f?\u20e3|(?:[©®\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26a7\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5-\uded7\udeeb\udeec\udef4-\udefc\udfe0-\udfeb]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd1d\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78\udd7a-\uddb4\uddb7\uddba\uddbc-\uddcb\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7a\ude80-\ude86\ude90-\udea8\udeb0-\udeb6\udec0-\udec2\uded0-\uded6]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g,n=/\uFE0F/g,r=String.fromCharCode(8205),s=/[&<>'"]/g,o=/^(?:iframe|noframes|noscript|script|select|style|textarea)$/,a=String.fromCharCode
|
|
;return e;function l(e,t){return document.createTextNode(t?e.replace(n,""):e)}function d(e,t){return"".concat(t.base,t.size,"/",e,t.ext)}function h(e,t){for(var i,n,r=e.childNodes,s=r.length;s--;)3===(n=(i=r[s]).nodeType)?t.push(i):1!==n||"ownerSVGElement"in i||o.test(i.nodeName.toLowerCase())||h(i,t);return t}function c(e){return x(e.indexOf(r)<0?e.replace(n,""):e)}function u(e,t){for(var n,r,s,o,a,d,u,p,_,f,g,x,v,w=h(e,[]),R=w.length;R--;){for(s=!1,o=document.createDocumentFragment(),d=(a=w[R]).nodeValue,p=0;u=i.exec(d);){if((_=u.index)!==p&&o.appendChild(l(d.slice(p,_),!0)),x=c(g=u[0]),p=_+g.length,v=t.callback(x,t),x&&v){for(r in(f=new Image).onerror=t.onerror,f.setAttribute("draggable","false"),n=t.attributes(g,x))n.hasOwnProperty(r)&&0!==r.indexOf("on")&&!f.hasAttribute(r)&&f.setAttribute(r,n[r]);f.className=t.className,f.alt=g,f.src=v,s=!0,o.appendChild(f)}f||o.appendChild(l(g,!1)),f=null}s&&(p<d.length&&o.appendChild(l(d.slice(p),!0)),a.parentNode.replaceChild(o,a))}return e}function p(e,t){return g(e,(function(e){var i,n,r=e,o=c(e),a=t.callback(o,t);if(o&&a){for(n in r="<img ".concat('class="',t.className,'" ','draggable="false" ','alt="',e,'"',' src="',a,'"'),i=t.attributes(e,o))i.hasOwnProperty(n)&&0!==n.indexOf("on")&&-1===r.indexOf(" "+n+"=")&&(r=r.concat(" ",n,'="',i[n].replace(s,_),'"'));r=r.concat("/>")}return r}))}function _(e){return t[e]}function f(){return null}function g(e,t){return String(e).replace(i,t)}function x(e,t){for(var i=[],n=0,r=0,s=0;s<e.length;)n=e.charCodeAt(s++),r?(i.push((65536+(r-55296<<10)+(n-56320)).toString(16)),r=0):55296<=n&&n<=56319?r=n:i.push(n.toString(16));return i.join(t||"-")}}()},99620:(e,t,i)=>{"use strict";e.exports=i.p+"prediction-clock-white.c4675d37769f1df4c9ec.png"},88249:(e,t,i)=>{"use strict";e.exports=i.p+"prediction-failure-white.a838a6689f951970e715.png"},14012:(e,t,i)=>{"use strict";e.exports=i.p+"prediction-success-white.2fb9966b4c0f3529a2ea.png"}}]); |