"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[5450],{73174:(e,t,i)=>{i.r(t),i.d(t,{getCoordinateXMetaInfo:()=>f,getCoordinateYMetaInfo:()=>P,getCoordinatesPropertiesDefinitions:()=>g,getSelectionCoordinatesPropertyDefinition:()=>b});var n=i(50151),r=i(11542),o=i(45126),s=i(60265);class l extends s.UndoCommand{constructor({lineToolId:e,chartModel:t,newPositionPoints:i}){super(null),this._pointState=null,this._lineToolId=e,this._model=t,this._newPositionPoints=i}redo(){const e=(0,n.ensureNotNull)(this._model.dataSourceForId(this._lineToolId));this._pointState=[e.normalizedPoints(),e.points()],e.startChanging(),e.moveLineTool(this._newPositionPoints),this._model.updateSource(e),e.syncMultichartState(e.endChanging(!0,!1))}undo(){if(this._pointState){const e=(0,n.ensureNotNull)(this._model.dataSourceForId(this._lineToolId));e.startChanging(),e.restorePoints(...this._pointState),this._model.updateSource(e),e.syncMultichartState(e.endChanging(!0,!1))}}}var a=i(4116),c=i(64147),d=i(12988),p=i(49406);const u=new o.TranslatedString("change price Y coordinate",r.t(null,void 0,i(11737))),h=new o.TranslatedString("change bar X coordinate",r.t(null,void 0,i(2066))),y=new o.TranslatedString("move drawings",r.t(null,void 0,i(76261)));function P(e,t,i){return{property:(0,a.convertToDefinitionProperty)(e,t.price,u),info:{typeY:1,stepY:i}}}function f(e,t){return{property:(0,a.convertToDefinitionProperty)(e,t.bar,h),info:{typeX:0,minX:new c.WatchedValue(-5e4),maxX:new c.WatchedValue(15e3),stepX:new c.WatchedValue(1)}}}function g(e,t,i,n,r,o){const s=f(e,t),l=P(e,t,n);return(0,a.createCoordinatesPropertyDefinition)({x:s.property,y:l.property},{id:(0,p.removeSpaces)(`${o}Coordinates${r}`),title:r,...s.info,...l.info})}const w=/^([+*\-\/]?)((?:\d*)|(?:\d+\.\d*))$/;function m(e,t,i){const r=new d.Property(""),o=(0,a.makeProxyDefinitionProperty)(r.weakReference());return o.setValue=o=>{try{const s=o.match(w);if(!s)return;const[,a,c]=s;if(!c.length)return;const d=i(parseFloat(c));if("/"===a&&(0===d.price||0===d.index))return;t.withMacro(y,(()=>{e.forEach((e=>{const i=e.points();let r;switch(a){case"":{const e=(0,n.ensureDefined)(i[0]);let{index:t=e.index,price:o=e.price}=d;o-=e.price,t-=e.index,r=i.map((e=>({...e,index:e.index+t,price:e.price+o})));break}case"-":case"+":{let{index:e=0,price:t=0}=d;"-"===a&&(e*=-1,t*=-1),r=i.map((i=>({...i,index:i.index+e,price:i.price+t})));break}case"*":{const{index:e=1,price:t=1}=d;r=i.map((i=>({...i,index:i.index*e,price:i.price*t})));break}case"/":{const{index:e=1,price:t=1}=d;r=i.map((i=>({...i,index:i.index/e,price:i.price/t})));break}}t.undoHistory().pushUndoCommand(new l({lineToolId:e.id(),chartModel:t.model(),newPositionPoints:r}))}))}))}finally{r.setValue("",!0)}},o}function b(e,t){const n=m(e,t,(e=>({index:e}))),o=m(e,t,(e=>({price:e})));return(0,a.createSelectionCoordinatesPropertyDefinition)({x:n,y:o},{id:"SourcesCoordinates",title:r.t(null,void 0,i(44272)),mathOperationsX:"+",mathOperationsY:"+/*",modeX:"integer",modeY:"float"})}},26434:(e,t,i)=>{i.r(t),
i.d(t,{getIntervalsVisibilitiesPropertiesDefinitions:()=>ae,getSelectionIntervalsVisibilitiesPropertiesDefinition:()=>ce});var n=i(11542),r=i(45126),o=i(56570),s=i(4116),l=i(64147),a=i(10074),c=i(73305),d=i(46112);const p=new r.TranslatedString("change {title} visibility on ticks",n.t(null,void 0,i(98596))),u=new r.TranslatedString("change {title} visibility on seconds",n.t(null,void 0,i(41315))),h=new r.TranslatedString("change {title} seconds from",n.t(null,void 0,i(86780))),y=new r.TranslatedString("change {title} seconds to",n.t(null,void 0,i(6573))),P=new r.TranslatedString("change {title} visibility on minutes",n.t(null,void 0,i(78219))),f=new r.TranslatedString("change {title} minutes from",n.t(null,void 0,i(59820))),g=new r.TranslatedString("change {title} minutes to",n.t(null,void 0,i(38011))),w=new r.TranslatedString("change {title} visibility on hours",n.t(null,void 0,i(68715))),m=new r.TranslatedString("change {title} hours from",n.t(null,void 0,i(8306))),b=new r.TranslatedString("change {title} hours to",n.t(null,void 0,i(67233))),_=new r.TranslatedString("change {title} visibility on days",n.t(null,void 0,i(56402))),v=new r.TranslatedString("change {title} days from",n.t(null,void 0,i(91201))),S=new r.TranslatedString("change {title} days to",n.t(null,void 0,i(96135))),T=new r.TranslatedString("change {title} visibility on weeks",n.t(null,void 0,i(71084))),C=new r.TranslatedString("change {title} weeks from",n.t(null,void 0,i(32481))),D=new r.TranslatedString("change {title} weeks to",n.t(null,void 0,i(18678))),V=new r.TranslatedString("change {title} visibility on months",n.t(null,void 0,i(67583))),W=new r.TranslatedString("change {title} months from",n.t(null,void 0,i(99122))),k=new r.TranslatedString("change {title} months to",n.t(null,void 0,i(10518))),x=(new r.TranslatedString("change {title} visibility on ranges",n.t(null,{replace:{ranges:"ranges"}},i(55616))),
n.t(null,void 0,i(24821))),I=n.t(null,void 0,i(65188)),M=n.t(null,void 0,i(42562)),U=n.t(null,void 0,i(56796)),A=n.t(null,void 0,i(72942)),L=n.t(null,void 0,i(835)),R=n.t(null,void 0,i(43154)),F=new r.TranslatedString("ticks",n.t(null,void 0,i(3539))),N=new r.TranslatedString("seconds",n.t(null,void 0,i(751))),Y=new r.TranslatedString("seconds from",n.t(null,void 0,i(35801))),E=new r.TranslatedString("seconds to",n.t(null,void 0,i(73419))),X=new r.TranslatedString("minutes",n.t(null,void 0,i(18726))),H=new r.TranslatedString("minutes from",n.t(null,void 0,i(22476))),$=new r.TranslatedString("minutes to",n.t(null,void 0,i(67649))),j=new r.TranslatedString("hours",n.t(null,void 0,i(2359))),O=new r.TranslatedString("hours from",n.t(null,void 0,i(82267))),z=new r.TranslatedString("hours to",n.t(null,void 0,i(15600))),B=new r.TranslatedString("days",n.t(null,void 0,i(35813))),q=new r.TranslatedString("days from",n.t(null,void 0,i(59215))),G=new r.TranslatedString("days to",n.t(null,void 0,i(89919))),J=new r.TranslatedString("weeks",n.t(null,void 0,i(45537))),K=new r.TranslatedString("weeks from",n.t(null,void 0,i(92859))),Q=new r.TranslatedString("weeks to",n.t(null,void 0,i(44127))),Z=new r.TranslatedString("months",n.t(null,void 0,i(95300))),ee=new r.TranslatedString("months from",n.t(null,void 0,i(17250))),te=new r.TranslatedString("months to",n.t(null,void 0,i(2828))),ie=(new r.TranslatedString("ranges","ranges"),[1,59]),ne=[1,59],re=[1,24],oe=[1,366],se=[1,52],le=[1,12];function ae(e,t,i){const n=[];if(o.enabled("tick_resolution")){const r=(0,s.createCheckablePropertyDefinition)({checked:(0,s.convertToDefinitionProperty)(e,t.ticks,p.format({title:i}))},{id:"IntervalsVisibilitiesTicks",title:x});n.push(r)}if((0,a.isSecondsEnabled)()){const r=(0,s.createRangePropertyDefinition)({checked:(0,s.convertToDefinitionProperty)(e,t.seconds,u.format({title:i})),from:(0,s.convertToDefinitionProperty)(e,t.secondsFrom,h.format({title:i})),to:(0,s.convertToDefinitionProperty)(e,t.secondsTo,y.format({title:i}))},{id:"IntervalsVisibilitiesSecond",title:I,min:new l.WatchedValue(ie[0]),max:new l.WatchedValue(ie[1])});n.push(r)}const r=(0,s.createRangePropertyDefinition)({checked:(0,s.convertToDefinitionProperty)(e,t.minutes,P.format({title:i})),from:(0,s.convertToDefinitionProperty)(e,t.minutesFrom,f.format({title:i})),to:(0,s.convertToDefinitionProperty)(e,t.minutesTo,g.format({title:i}))},{id:"IntervalsVisibilitiesMinutes",title:M,min:new l.WatchedValue(ne[0]),max:new l.WatchedValue(ne[1])}),c=(0,s.createRangePropertyDefinition)({checked:(0,s.convertToDefinitionProperty)(e,t.hours,w.format({title:i})),from:(0,s.convertToDefinitionProperty)(e,t.hoursFrom,m.format({title:i})),to:(0,s.convertToDefinitionProperty)(e,t.hoursTo,b.format({title:i}))},{id:"IntervalsVisibilitiesHours",title:U,min:new l.WatchedValue(re[0]),max:new l.WatchedValue(re[1])}),d=(0,s.createRangePropertyDefinition)({checked:(0,s.convertToDefinitionProperty)(e,t.days,_.format({title:i})),from:(0,s.convertToDefinitionProperty)(e,t.daysFrom,v.format({title:i})),to:(0,
s.convertToDefinitionProperty)(e,t.daysTo,S.format({title:i}))},{id:"IntervalsVisibilitiesDays",title:A,min:new l.WatchedValue(oe[0]),max:new l.WatchedValue(oe[1])});n.push(r,c,d);const F=(0,s.createRangePropertyDefinition)({checked:(0,s.convertToDefinitionProperty)(e,t.weeks,T.format({title:i})),from:(0,s.convertToDefinitionProperty)(e,t.weeksFrom,C.format({title:i})),to:(0,s.convertToDefinitionProperty)(e,t.weeksTo,D.format({title:i}))},{id:"IntervalsVisibilitiesWeeks",title:L,min:new l.WatchedValue(se[0]),max:new l.WatchedValue(se[1])}),N=(0,s.createRangePropertyDefinition)({checked:(0,s.convertToDefinitionProperty)(e,t.months,V.format({title:i})),from:(0,s.convertToDefinitionProperty)(e,t.monthsFrom,W.format({title:i})),to:(0,s.convertToDefinitionProperty)(e,t.monthsTo,k.format({title:i}))},{id:"IntervalsVisibilitiesMonths",title:R,min:new l.WatchedValue(le[0]),max:new l.WatchedValue(le[1])});return n.push(F,N),{definitions:n}}function ce(e,t){const i=[];if(o.enabled("tick_resolution")){const n=(0,s.createCheckablePropertyDefinition)({checked:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.ticks),F,t)},{id:"IntervalsVisibilitiesTicks",title:x});i.push(n)}if((0,a.isSecondsEnabled)()){const n=(0,s.createRangePropertyDefinition)({checked:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.seconds),N,t),from:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.secondsFrom),Y,t),to:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.secondsTo),E,t)},{id:"IntervalsVisibilitiesSecond",title:I,min:new l.WatchedValue(ie[0]),max:new l.WatchedValue(ie[1])});i.push(n)}const n=(0,s.createRangePropertyDefinition)({checked:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.minutes),X,t),from:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.minutesFrom),H,t),to:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.minutesTo),$,t)},{id:"IntervalsVisibilitiesMinutes",title:M,min:new l.WatchedValue(ne[0]),max:new l.WatchedValue(ne[1])}),r=(0,s.createRangePropertyDefinition)({checked:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.hours),j,t),from:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.hoursFrom),O,t),to:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.hoursTo),z,t)},{id:"IntervalsVisibilitiesHours",title:U,min:new l.WatchedValue(re[0]),max:new l.WatchedValue(re[1])}),p=(0,s.createRangePropertyDefinition)({checked:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.days),B,t),from:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.daysFrom),q,t),to:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.daysTo),G,t)},{id:"IntervalsVisibilitiesDays",title:A,min:new l.WatchedValue(oe[0]),max:new l.WatchedValue(oe[1])});i.push(n,r,p);const u=(0,s.createRangePropertyDefinition)({checked:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.weeks),J,t),
from:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.weeksFrom),K,t),to:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.weeksTo),Q,t)},{id:"IntervalsVisibilitiesWeeks",title:L,min:new l.WatchedValue(se[0]),max:new l.WatchedValue(se[1])}),h=(0,s.createRangePropertyDefinition)({checked:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.months),Z,t),from:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.monthsFrom),ee,t),to:new d.CollectiblePropertyUndoWrapper(new c.LineToolCollectedProperty(e.monthsTo),te,t)},{id:"IntervalsVisibilitiesMonths",title:R,min:new l.WatchedValue(le[0]),max:new l.WatchedValue(le[1])});return i.push(u,h),{definitions:i}}},18009:(e,t,i)=>{i.r(t),i.d(t,{LineDataSourceDefinitionsViewModel:()=>b,LineDataSourceTabTypes:()=>n});var n,r=i(50151),o=i(11542),s=i(45126),l=(i(21251),i(4116)),a=i(57717),c=i(64147),d=i(26434),p=i(73174),u=i(35923),h=i(19466);!function(e){e.Visibility="visibility",e.Coordinates="coordinates",e.Style="style",e.Text="text",e.Inputs="inputs"}(n||(n={}));const y=o.t(null,void 0,i(40091)),P=o.t(null,void 0,i(78930)),f=o.t(null,void 0,i(92516)),g=o.t(null,void 0,i(70320)),w=o.t(null,void 0,i(21429)),m=o.t(null,{context:"linetool point"},i(80166));class b{constructor(e,t){this._yCoordinateStepWV=null,this._propertyPages=[],this._source=t,this._undoModel=e,this._ownerSource=(0,r.ensureNotNull)(this._source.ownerSource()),this._propertyApplier=new u.PropertyApplierWithoutSavingChart((()=>e)),this._createPropertyRages()}destroy(){null!==this._yCoordinateStepWV&&(this._source.ownerSourceChanged().unsubscribeAll(this),this._ownerSource.priceStepChanged().unsubscribeAll(this)),this._source.pointAdded().unsubscribeAll(this),this._propertyPages.forEach((e=>{(0,l.destroyDefinitions)(e.definitions.value())}))}propertyPages(){return Promise.resolve(this._propertyPages)}_createPropertyRages(){this._propertyPages=[];const e=this._createInputsPropertyPage();null!==e&&this._propertyPages.push(e);const t=this._createStylePropertyPage();null!==t&&this._propertyPages.push(t);const i=this._createTextPropertyPage();if(null!==i&&this._propertyPages.push(i),this._source.hasEditableCoordinates()){const e=this._createCoordinatesPropertyPage();null!==e&&this._propertyPages.push(e)}const n=this._createVisibilitiesPropertyPage();this._propertyPages.push(n)}_createVisibilitiesPropertyPage(){const e=this._source.properties().childs().intervalsVisibilities.childs();return(0,a.createPropertyPage)((0,d.getIntervalsVisibilitiesPropertiesDefinitions)(this._propertyApplier,e,new s.TranslatedString(this._source.name(),this._source.title(h.TitleDisplayTarget.StatusLine,!0))),"visibility",y)}_createCoordinatesPropertyPage(){const e=this._coordinatesPropertyDefinitions();return null!==e?(e.definitions.length<this._source.pointsCount()&&this._source.pointAdded().subscribe(this,this._updateCoordinatesPropertyDefinitons),(0,a.createPropertyPage)(e,"coordinates",P)):null}_getYCoordinateStepWV(){
return null===this._yCoordinateStepWV&&(this._yCoordinateStepWV=new c.WatchedValue(function(e){if(null!==e){const t=e.priceStep();if(null!==t)return t}return 1}(this._source.ownerSource())),this._ownerSource.priceStepChanged().subscribe(this,(()=>this._updateYCoordinateStep())),this._source.ownerSourceChanged().subscribe(this,(()=>{this._ownerSource.priceStepChanged().unsubscribeAll(this),this._ownerSource=(0,r.ensureNotNull)(this._source.ownerSource()),this._ownerSource.priceStepChanged().subscribe(this,(()=>this._updateYCoordinateStep()))}))),this._yCoordinateStepWV}_coordinatesPropertyDefinitions(){const e=this._source.points(),t=this._source.pointsProperty().childs().points,i=[],n=this._getYCoordinateStepWV();return e.forEach(((e,r)=>{const o=t[r].childs();o&&i.push((0,p.getCoordinatesPropertiesDefinitions)(this._propertyApplier,o,e,n,m.format({count:(r+1).toString()}),this._source.name()))})),{definitions:i}}_createStylePropertyPage(){const e=this._stylePropertyDefinitions();return null!==e?(0,a.createPropertyPage)(e,"style",f):null}_stylePropertyDefinitions(){return null}_createTextPropertyPage(){const e=this._textPropertyDefinitions();return null!==e?(0,a.createPropertyPage)(e,"text",g):null}_textPropertyDefinitions(){return null}_createInputsPropertyPage(){const e=this._inputsPropertyDefinitions();return null!==e?(0,a.createPropertyPage)(e,"inputs",w):null}_inputsPropertyDefinitions(){return null}_updateYCoordinateStep(){const e=this._ownerSource.priceStep();this._getYCoordinateStepWV().setValue(e||1)}_updateCoordinatesPropertyDefinitons(){const e=this._coordinatesPropertyDefinitions();if(null!==e){(0,r.ensureDefined)(this._propertyPages.find((e=>"coordinates"===e.id))).definitions.setValue(e.definitions),this._source.points().length===this._source.pointsCount()&&this._source.pointAdded().unsubscribeAll(this)}}}},31507:(e,t,i)=>{i.r(t),i.d(t,{StudyLineDataSourceDefinitionsViewModel:()=>d});var n=i(11542),r=(i(21251),i(52033)),o=i(4116),s=i(18009),l=i(28388),a=i(73174),c=i(49406);class d extends s.LineDataSourceDefinitionsViewModel{constructor(e,t){super(e,t)}_inputsPropertyDefinitions(){return{definitions:[(0,o.createStudyInputsPropertyDefinition)({},{id:"StudyInputs",inputs:new l.MetaInfoHelper(this._source.metaInfo()).getUserEditableInputs(),inputsTabProperty:this._source.properties(),model:this._undoModel,studyMetaInfo:this._source.metaInfo(),source:{isInputsStudy:!0,symbolsResolved:()=>new r.Delegate,resolvedSymbolInfoBySymbol:e=>null}})]}}_coordinatesPropertyDefinitions(){const e=this._source.points(),t=this._source.pointsProperty().childs().points,r=[];return e.forEach(((e,s)=>{const l=t[s].childs();if(!l)return;const d=(0,a.getCoordinateXMetaInfo)(this._propertyApplier,l);r.push((0,o.createCoordinatesPropertyDefinition)({x:d.property},{id:(0,c.removeSpaces)(`${this._source.name()}Point${s}`),title:n.t(null,{context:"linetool point"},i(13616)).format({count:(s+1).toString()}),...d.info}))})),{definitions:r}}}},46112:(e,t,i)=>{i.d(t,{CollectiblePropertyUndoWrapper:()=>a})
;var n=i(50151),r=i(11542),o=i(45126),s=i(12988);const l=new o.TranslatedString("change {propertyName} property",r.t(null,void 0,i(25167)));class a extends s.Property{constructor(e,t,i){super(),this._isProcess=!1,this._listenersMappers=[],this._valueApplier={applyValue:(e,t)=>{this._propertyApplier.setProperty(e,t,l)}},this._baseProperty=e,this._propertyApplier=i,this._propertyName=t}destroy(){this._baseProperty.destroy(),super.destroy()}value(){return this._baseProperty.value()}setValue(e,t){this._propertyApplier.beginUndoMacro(l.format({propertyName:this._propertyName})),this._isProcess=!0,this._baseProperty.setValue(e,void 0,this._valueApplier),this._isProcess=!1,this._propertyApplier.endUndoMacro(),this._listenersMappers.forEach((e=>{e.method.call(e.obj,this,"")}))}subscribe(e,t){const i=()=>{this._isProcess||t.call(e,this,"")};this._listenersMappers.push({obj:e,method:t,callback:i}),this._baseProperty.subscribe(e,i)}unsubscribe(e,t){var i;const r=(0,n.ensureDefined)(null===(i=this._listenersMappers.find((i=>i.obj===e&&i.method===t)))||void 0===i?void 0:i.callback);this._baseProperty.unsubscribe(e,r)}unsubscribeAll(e){this._baseProperty.unsubscribeAll(e)}}},35923:(e,t,i)=>{i.d(t,{PropertyApplierWithoutSavingChart:()=>r});var n=i(85719);class r{constructor(e){this._undoModelSupplier=e}setProperty(e,t,i){this._undoModelSupplier().setProperty(e,t,i,n.lineToolsDoNotAffectChartInvalidation)}beginUndoMacro(e){return this._undoModelSupplier().beginUndoMacro(e)}endUndoMacro(){this._undoModelSupplier().endUndoMacro()}setWatchedValue(e,t,i){this._undoModelSupplier().undoHistory().setWatchedValue(e,t,i,n.lineToolsDoNotAffectChartInvalidation)}}},1183:(e,t,i)=>{i.d(t,{StudyPlotVisibleProperty:()=>o});var n=i(34776),r=i(52033);class o{constructor(e){this._subscribers=new r.Delegate,this._displayProperty=e,this._displayProperty.subscribe(this,this._displayPropertyValueChanged)}destroy(){this._displayProperty.unsubscribe(this,this._displayPropertyValueChanged),this._subscribers.destroy()}value(){return 0!==this._displayProperty.value()}setValue(e,t){this._displayProperty.setValue(e?15:0)}subscribe(e,t){this._subscribers.subscribe(e,t,!1)}unsubscribe(e,t){this._subscribers.unsubscribe(e,t)}unsubscribeAll(e){this._subscribers.unsubscribeAll(e)}storeStateIfUndefined(){return!1}weakReference(){return(0,n.weakReference)(this)}ownership(){return(0,n.ownership)(this)}_displayPropertyValueChanged(){this._subscribers.fire(this)}}}}]);