"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[3866],{51691:(e,i,t)=>{t.r(i),t.d(i,{LineToolPolyline:()=>h});var n=t(50151),s=t(86441),o=t(32679),r=t(61993),l=t(29875),a=t(64147);class h extends l.LineDataSource{constructor(e,i,n,s){super(e,i??h.createProperties(e.backgroundTheme().spawnOwnership()),n,s),this._hasEditableCoordinates=new a.WatchedValue(!1),this._finished=!1,Promise.all([t.e(6290),t.e(9116),t.e(1200),t.e(1583)]).then(t.bind(t,65765)).then((i=>{this._setPaneViews([new i.PolylinePaneView(this,e)])}))}pointsCount(){return-1}name(){return"Polyline"}finish(){this._finished=!0,this._lastPoint=null,this._normalizePoints(),this.createServerPoints()}addPoint(e,i,t,o){if(this._finished)return!0;const l=(0,n.ensureNotNull)(this.priceScale()),a=this._model.timeScale().indexToCoordinate(e.index),h=e.price,c=(0,n.ensure)(this.ownerSource()?.firstValue()),d=l.priceToCoordinate(h,c),p=(0,r.interactionTolerance)().minDistanceBetweenPoints;if(this._points.length>0){const e=this._points[this._points.length-1],t=this._model.timeScale().indexToCoordinate(e.index),n=e.price,r=l.priceToCoordinate(n,c),h=new s.Point(a,d).subtract(new s.Point(t,r)).length();if(!i?.isApiEvent()&&h
e.PolylinesDefinitionsViewModel))}static _configureProperties(e){super._configureProperties(e),e.addExcludedKey("filled",1)}}}}]);