Files
ai/charting_library/bundles/line-tool-fib-speed-resistance-arcs.24b790bcadcb8798006c.js

2 lines
3.3 KiB
JavaScript

"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[3710],{15399:(e,t,s)=>{s.d(t,{LevelsProperty:()=>v});var r=s(90054),i=s(16738),n=s(37265),l=s(32679),a=s(35039);const o={prefixes:[""],range:[0,0],names:["coeff","color","visible","linestyle","linewidth"],typecheck:{pack:()=>Object(),unpack:()=>[]}};function c(e,t,s,r){return r.push(s[t]),r}function p(e,t,s,r){return r[t]=s[e],r}function u(){return[]}function h(){return{}}function d(e,t,s){return s.prefixes.forEach((r=>{const i=r+"level";for(let r=s.range[0];r<=s.range[1];r++)if(e[i+r]&&(0,n.isSameType)(e[i+r],t.typecheck())){let n=t.tpl();s.names.forEach(((s,l)=>{n=t.fill(""+l,s,e[i+r],n)})),e[i+r]=n}})),e}function f(e,t,s){return s(e,{tpl:h,fill:p,typecheck:t.typecheck.unpack},t)}class v extends l.DefaultProperty{constructor(e){const{levelsIterator:t=d,map:s={},...r}=e,i={...o,...s};r.state&&(r.state=f(r.state,i,t)),super(r),this._map=i,this._levelsIterator=t}state(e,t,s){const r=super.state(e,t);return s?r:(i=r,n=this._map,(0,this._levelsIterator)(i,{tpl:u,fill:c,typecheck:n.typecheck.pack},n));var i,n}preferences(){return(0,l.extractState)(this.state(this._excludedDefaultsKeys,void 0,!0),this._allDefaultsKeys)}applyTemplate(e,t){this.mergeAndFire((0,l.extractState)((0,i.default)((0,r.default)(t),f(e,this._map,this._levelsIterator)),this._allStateKeys,this._excludedTemplateKeys))}saveDefaults(){this._useUserPreferences&&(0,a.saveDefaults)(this._defaultName,this.preferences())}clone(){return new v(this._options())}merge(e,t){return super.merge(this._map?f(e,this._map,this._levelsIterator):e,t)}_options(){return{...super._options(),map:{...this._map},levelsIterator:this._levelsIterator}}}},88588:(e,t,s)=>{s.r(t),s.d(t,{LineToolFibSpeedResistanceArcs:()=>h});var r=s(50151),i=s(11542),n=s(45126),l=s(15399),a=s(73305),o=s(85719),c=s(10568);const p=new n.TranslatedString("erase level line",i.t(null,void 0,s(77114)));var u;!function(e){e[e.LevelsCount=11]="LevelsCount"}(u||(u={}));class h extends c.InplaceTextLineDataSource{constructor(e,t,r,i){super(e,t??h.createProperties(e.backgroundTheme().spawnOwnership()),r,i),Promise.all([s.e(2870),s.e(2211),s.e(1583)]).then(s.bind(s,66152)).then((e=>{this._setPaneViews([new e.FibSpeedResistanceArcsPaneView(this,this._model)])}))}levelsCount(){return 11}pointsCount(){return 2}name(){return"Fib Speed Resistance Arcs"}processErase(e,t){const s=(0,r.ensureDefined)(this.properties().child(`level${t}`)).childs().visible;e.setProperty(s,!1,p,o.lineToolsDoNotAffectChartInvalidation)}editableTextProperties(){(0,r.assert)(!1,"unexpected method call")}static createProperties(e,t){const s=new l.LevelsProperty({defaultName:"linetoolfibspeedresistancearcs",state:t,map:{range:[1,11]},theme:e});return this._configureProperties(s),s}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([s.e(3401),s.e(3889),s.e(8009),s.e(6204),s.e(1963),s.e(8537)]).then(s.bind(s,20875))).FibSpeedResistanceArcsDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e)
;const t=e.childs().trendline.childs(),s=[t.linewidth],i=[t.color];for(let t=1;t<=11;t++){const n=(0,r.ensureDefined)(e.child(`level${t}`)).childs();s.push(n.linewidth),i.push(n.color)}e.addChild("linesColors",new a.LineToolColorsProperty(i)),e.addChild("linesWidths",new a.LineToolWidthsProperty(s))}}}}]);