"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[6800],{43825:(e,t,i)=>{i.r(t),i.d(t,{LineToolInfoLine:()=>h,LineToolInfoLineConst:()=>a});var r=i(47004),s=i(90450),n=i(45124);const o={...s.nonThemedFactoryDefaults,statsPosition:n.StatsPosition.Center,alwaysShowStats:!0,showPriceRange:!0,showPercentPriceRange:!0,showPipsPriceRange:!0,showBarsRange:!0,showDateTimeRange:!0,showDistance:!0,showAngle:!0};class l extends s.LineToolTrendLinePropertiesImpl{static create(e,t,i){return s.LineToolTrendLinePropertiesImpl._createWithDefaults("linetoolinfoline",e,o,s.themedFactoryDefaults,t,i)}}var a;!function(e){e.ConstructorName="LineToolInfoLine",e.Name="Info Line"}(a||(a={}));class h extends r.LineToolTrendLine{constructor(e,t,i,r){super(e,t??h.createProperties(e.backgroundTheme().spawnOwnership()),i,r)}pointsCount(){return 2}name(){return"Info Line"}static createProperties(e,t){const i=l.create(e,t);return this._configureProperties(i),i}}},90450:(e,t,i)=>{i.d(t,{LineToolTrendLinePropertiesImpl:()=>S,nonThemedFactoryDefaults:()=>T,themedFactoryDefaults:()=>x});var r=i(11284),s=i(85842),n=i(25432),o=i(47097),l=i(95385),a=i(68459),h=i(45124),d=i(62565),c=i(88483),u=i(5829),p=i(93445),_=i(86371),g=i(17567);const P=(0,r.getHexColorByName)("color-tv-blue-500"),T={intervalsVisibilities:{...c.intervalsVisibilitiesDefaults},linewidth:u.DEFAULT_LINE_TOOL_LINE_WIDTH,linestyle:d.LineStyle.Solid,extendLeft:!1,extendRight:!1,leftEnd:a.LineEnd.Normal,rightEnd:a.LineEnd.Normal,horzLabelsAlign:l.HorizontalAlign.Center,vertLabelsAlign:l.VerticalAlign.Bottom,fontsize:14,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceLabels:!1,showPriceRange:!1,showPercentPriceRange:!1,showPipsPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:h.StatsPosition.Right},w={linecolor:P,textcolor:P},x=new Map([[o.StdTheme.Light,w],[o.StdTheme.Dark,w]]),f=(0,p.extractThemedColors)((0,s.ensureDefined)(x.get(o.StdTheme.Light)),(0,s.ensureDefined)(x.get(o.StdTheme.Dark))),m=(0,p.extractAllPropertiesKeys)((0,s.ensureDefined)(x.get(o.StdTheme.Light))),v=(0,p.extractAllPropertiesKeys)(T),L=[...m,...v,"text"],b=[...new Set([...L,...n.commonLineToolPropertiesStateKeys])];class S extends _.LineDataSourceProperty{constructor(e){super(e),this.hasChild("text")||this.addProperty("text","")}static create(e,t,i){return S._createWithDefaults("linetooltrendline",e,T,x,t,i)}static _createWithDefaults(e,t,i,r,s,n){return new this({defaultName:e,factoryDefaultsSupplier:()=>(0,g.factoryDefaultsForCurrentTheme)(i,r),nonThemedDefaultsKeys:v,themedDefaultsKeys:m,allStateKeys:b,themedColors:f,templateKeys:L,replaceThemedColorsOnThemeChange:!0,state:s,theme:t,useUserPreferences:n})}}},47004:(e,t,i)=>{i.r(t),i.d(t,{Consts:()=>m,LineToolTrendLine:()=>L});var r=i(85842),s=i(33993),n=i(63212),o=i(91569),l=i(57415),a=i(91069),h=i(78792),d=i(61208),c=i(16965),u=i(79083),p=i(45124),_=i(71367),g=i(6353),P=i(14491),T=i(83077),w=i(35428),x=i(7955);class f extends w.TrendToolWithStatsPaneView{ constructor(e,t,i,r,s,n){super(e,t,r,s,n),this._trendRenderer=new g.TrendLineRenderer,this._pane=i,this._labelRenderer=new c.LineToolTextRenderer(void 0,new T.HitTestResult(T.HitTarget.MovePoint,(0,x.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,r.ensureNotNull)(this._middlePoint),this._points[1]]}_updateImpl(e){this._renderer.clear(),this._invalidated=!1;const t=this._getOwnerSource();if(!t||this._pane&&!this._pane.sourcesByGroup().hasLineSource(this._source))return;const i=t.priceScale(),r=this._model.timeScale();if(!i||i.isEmpty()||r.isEmpty())return;const s=this._model.timeScale().visibleBarsStrictRange();if(null===s)return;const n=this._source.points();if(n.length<2)return;const o=n[0],c=n[1],g=this._source.properties().childs();if(o.index=2&&this._addAlertRenderer(this._renderer,y.points)}}var m,v=i(90450);!function(e){e[e.PointsCount=2]="PointsCount",e.Name="Trend Line"}(m||(m={}));class L extends n.InplaceTextLineDataSource{constructor(e,t,i,r){super(e,t??L.createProperties(e.backgroundTheme().spawnOwnership()),i,r)}destroy(){super.destroy()}pointsCount(){return 2}name(){return"Trend Line"}canHasAlert(){return!0}showPriceLabels(){return this._properties.childs().showPriceLabels.value()}createPriceAxisView(e){return new o.LineToolPriceAxisView(this,{pointIndex:e,backgroundPropertyGetter:()=>this.showPriceLabels()?this._properties.childs().linecolor.value():null})}isForcedDrawPriceAxisLabel(){return this.showPriceLabels()}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}editableTextProperties(){const e=this.properties().childs();return{text:e.text,textColor:e.textcolor}}supportsTargetSignature(){return!1}isMultiPaneAvailable(){return this.supportsTargetSignature()}isMultiPaneEnabled(){return null!==this.targetSignature().value()}snapTo45DegreesAvailable(){return!0}static createProperties(e,t,i){return L._createPropertiesImpl(e,t,i)}_getPaneViews(e){return null!==this.targetSignature().value()||this._paneViews.has(e)||e&&!e.hasDataSource(this)||this._paneViews.set(e,[new f(this,this._model,e??null,this._openTextEditor.bind(this),this._closeTextEditor.bind(this))]),super._getPaneViews(e)}_getAlertPlots(){const e=this._linePointsToAlertPlot(this._points,null,this._properties.childs().extendLeft.value(),this._properties.childs().extendRight.value());return null===e?[]:[e]}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(1982),i.e(7686),i.e(2428),i.e(3920),i.e(9328)]).then(i.bind(i,44252))).TrendLineDefinitionsViewModel}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text||"")}_createSignatureSourcePaneViews(e){return[new f(this,this._model,null,this._openTextEditor.bind(this),this._closeTextEditor.bind(this),e)]}static _createPropertiesImpl(e,t,i){const r=v.LineToolTrendLinePropertiesImpl.create(e,t,i);return this._configureProperties(r),r}static _configureProperties(e){super._configureProperties(e),e.addChild("textsColors",new s.LineToolColorsProperty([(0,r.ensureDefined)(e.child("textcolor"))]))}}}}]);