"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[6025],{50516:(t,e,i)=>{function n(t,e){if(null===t)return e;const i=t.firstIndex,n=e.firstIndex,s=t.clearData||e.clearData;return{firstIndex:s||void 0===i||void 0===n?void 0:Math.min(i,n),clearData:s}}i.d(e,{mergeDataInvalidation:()=>n})},26705:(t,e,i)=>{var n;function s(t){t.lineWidth=void 0,t.lineStyle=void 0;for(let e=0;e<t.colors.length;e++)t.colors[e]=void 0;return t}function o(){return{colors:[void 0,void 0,void 0,void 0,void 0,void 0,void 0],lineWidth:void 0,lineStyle:void 0}}i.d(e,{clearStyle:()=>s,createEmptyStyle:()=>o}),function(t){t[t.Main=0]="Main",t[t.Background=1]="Background",t[t.Text=2]="Text",t[t.Border=3]="Border",t[t.Wick=4]="Wick",t[t.Up=5]="Up",t[t.Down=6]="Down"}(n||(n={}))},96025:(t,e,i)=>{i.d(e,{StudyPlotPaneView:()=>E});var n=i(50151),s=i(24377),o=i(37103),l=i(77914),r=i(87465),a=i(52859),d=i(58043);function c(t,e){const i=new Map;return function(...n){const s=""+(e?e.apply(null,n):n[0]);if(!i.has(s)){const e=t.apply(this,n);return i.set(s,e),e}return i.get(s)}}var h,u=i(93463),_=i(94602),p=i(79268),m=i(60876),y=i(45801),f=i(26705),S=i(10555),I=i(4539),g=i(2383),v=i(10307),P=i(49483);!function(t){t[t.MinCircleRadius=1.5]="MinCircleRadius",t[t.SimplifiedPaintingModeMaxBarSpacing=2]="SimplifiedPaintingModeMaxBarSpacing"}(h||(h={}));class x extends v.BitmapCoordinatesPaneRenderer{constructor(t){super(),this._data=t}hitTest(t){const e=this._data,i=e.lineWidth,n=e.vertOffset||0,s=(0,I.interactionTolerance)().series+i,o=e.visibleItemsRange?.startItemIndex??0,l=e.visibleItemsRange?.endItemIndex??e.items.length;for(let r=o;r<l;r++){const o=e.items[r];if(new S.Point(o.center,o.y+n).subtract(t).length()+i<=s)return new g.HitTestResult(g.HitTarget.Regular)}return null}_drawImpl(t){const e=this._data,{horizontalPixelRatio:i,verticalPixelRatio:n,context:s}=t,o=Math.max(1,Math.floor(i)),l=o%2?.5:0,{vertOffset:a=0,lineColor:d,lineWidth:c,barSpacing:h}=e;let u="",_=!1;const p=e.visibleItemsRange?.startItemIndex??0,m=e.visibleItemsRange?.endItemIndex??e.items.length;for(let t=p;t<m;t++){const p=e.items[t],m=p.center,y=p.y+a;if((0,r.isNaN)(m)||(0,r.isNaN)(y))continue;let f,S;null!=p.style?(f=p.style.color,S=p.style.width):(f=d,S=c),(f!==u||P.isSafari)&&(u=f,_&&s.fill(),s.beginPath(),s.fillStyle=f);const I=Math.round(m*i)+l,g=Math.round(y*n)+l;let v=Math.round(2*Math.max(1.5,S)*i);o%2!=v%2&&(v+=1),h>2||S>1.5?(s.moveTo(I+v/2,g),s.arc(I,g,v/2,0,2*Math.PI,!1)):s.rect(I-v/2,g-v/2,v,v),_=!0}_&&s.fill()}}var C=i(93387),w=i(2624);class b extends v.BitmapCoordinatesPaneRenderer{constructor(t){super(),this._data=t}hitTest(t){const e=(0,I.interactionTolerance)().series+this._data.lineWidth/2;let i,n,s,o;for(let l=1;l<this._data.items.length;++l){i=this._data.items[l-1],n=this._data.items[l],s=i.center,o=n.center;if((0,w.distanceToSegment)(new S.Point(s,i.y),new S.Point(o,n.y),new S.Point(t.x,t.y)).distance<=e)return new g.HitTestResult(g.HitTarget.Regular)}return null}_drawImpl(t){
const{context:e,horizontalPixelRatio:i,verticalPixelRatio:n}=t;let s="",o=!1;const l=this._data.visibleItemsRange?.startItemIndex??0,a=(this._data.visibleItemsRange?.endItemIndex??this._data.items.length)-1;for(let t=l;t<=a;t++){const l=this._data.items[t];if((0,r.isNaN)(l.center)||(0,r.isNaN)(l.y))continue;const a=l.style?.color??this._data.lineColor,d=l.style?.width??this._data.lineWidth,c=Math.max(1,Math.floor(d*i)),h=Math.max(1,Math.floor(d*n));(a!==s||P.isSafari)&&(s=a,o&&e.fill(),e.beginPath(),e.fillStyle=a);let u=3*c;u%2!=c%2&&(u+=1);let _=3*h;_%2!=h%2&&(_+=1);const p=Math.round(Math.round(l.center*i)-u/2),m=Math.round(Math.round(l.y*n)-_/2),y=p+Math.floor(u/2-c/2),f=m+Math.floor(_/2-h/2);e.rect(p,f,u,h),e.rect(y,m,c,_),o=!0}o&&e.fill()}}class N extends v.BitmapCoordinatesPaneRenderer{constructor(t){super(),this._data=t}hitTest(t){const e=(0,I.interactionTolerance)().series+this._data.lineWidth/2,i=new Map;for(const s of this._data.items){const o=s.center,l=s.y;let r=e;s.style&&(i.has(s.style.width)?r=(0,n.ensureDefined)(i.get(s.style.width)):i.set(this._data.lineWidth,r));if((0,w.distanceToSegment)(new S.Point(o,l),new S.Point(o,this._data.histogramBase),new S.Point(t.x,t.y)).distance<=r)return new g.HitTestResult(g.HitTarget.Regular)}return null}_drawImpl(t){if(0===this._data.items.length)return;const{context:e,horizontalPixelRatio:i,verticalPixelRatio:n}=t;e.fillStyle=this._data.lineColor;const s=Math.max(1,Math.floor(this._data.lineWidth*i)),o=s/2,l=Math.max(1,Math.floor(i)),r=Math.round(this._data.histogramBase*n)-Math.floor(l/2),a=r+l,d=this._data.visibleItemsRange?.startItemIndex??0,c=(this._data.visibleItemsRange?.endItemIndex??this._data.items.length)-1;for(let t=d;t<=c;t++){const d=this._data.items[t];let c=s,h=o;d.style?(e.fillStyle=d.style.color,c=Math.max(1,Math.floor(d.style.width*i)),h=c/2):e.fillStyle=this._data.lineColor;const u=c%2?.5:0,_=Math.round(d.center*i)+u,p=Math.round(d.y*n);let m,y;p<=r?(m=p,y=a):(m=r,y=p-Math.floor(l/2)+l),e.fillRect(Math.floor(_-h),m,c,y-m)}}}var M=i(4359),L=i(41425),R=i(12217),D=i(41028),B=i(93201);const T=t=>{const e=(0,s.rgbToHsl)((0,s.parseRgb)(t)),i=e[0]+.05;return e[0]=i-Math.floor(i),(0,s.rgbToHexString)((0,s.hslToRgb)(e))},W=c(T),k=new Set([M.LineStudyPlotStyle.Line,M.LineStudyPlotStyle.Area,M.LineStudyPlotStyle.Circles,M.LineStudyPlotStyle.Cross,M.LineStudyPlotStyle.StepLine,M.LineStudyPlotStyle.StepLineWithDiamonds]);class E extends D.StudyPaneViewInplaceUpdatable{constructor(t,e,i,n,s=!1){super(e,i,n),this._histogramBase=null,this._lineColor="",this._lineWidth=1,this._color1="",this._color2="",this._renderer=new _.CompositeRenderer,this._isMarkersEnabled=o.enabled("source_selection_markers"),this._study=t,this._plotIndex=t.metaInfo().plots.findIndex((t=>t.id===n)),this._colorProvider=(0,L.createStudyPlotColorProvider)(t.metaInfo(),t.properties(),n),this._extendStepLineToBarsEndings=s,this._isFundamental=!1;const l=this._study.properties().styles[this._plotName].plottype.value()
;this._isStepLinePlot=l===M.LineStudyPlotStyle.StepLine||l===M.LineStudyPlotStyle.StepLineWithBreaks||l===M.LineStudyPlotStyle.StepLineWithDiamonds}items(){return this._items}renderer(){return this._makeSureRendererIsValid(),this._renderer}_getTranspValue(){const t=this._study.properties(),e=t.styles[this._plotName];let i=0;const n=this._study.metaInfo();return"Volume@tv-basicstudies"===n.id&&n.version<=46&&"transparency"in t?(i=t.transparency.value(),i=(0,r.isNumber)(i)?i:0,i):(e.transparency&&(i=e.transparency.value(),i=(0,r.isNumber)(i)?i:0),i)}_updateImplFull(t){if(this._renderer.clear(),this._dataInvalidated?.clearData&&(this._items=[]),!this._study.isPlotVisibleAt(this._plotName,1))return!1;const e=this._priceScale();if(!e||e.isEmpty())return!1;if(null===this._study.firstValue(void 0,this.isForceOverlay()))return!1;this._histogramBase=null;const i=this._study.properties().styles[this._plotName],s=i.plottype.value(),o=this._isFundamental&&this._isStepLinePlot,r=this._study.plots().plottableRange(o);if(0===r.size())return!1;const d=this._study.offset(this._plotName),c=k.has(s),h=this._preallocateItems(r,((t,e)=>({y:NaN,left:NaN,center:NaN,right:NaN,origPrices:{price:e??NaN,timePointIndex:t+d},timePointIndex:t+d})));let u=NaN,_=NaN;const p=new Map,m=(t,e)=>{let i=p.get(t);void 0===i&&(i=new Map,p.set(t,i));let n=i.get(e);if(void 0===n){const s=!this._plotName||"vol"!==this._plotName;n=(0,a.generateColor)(t,e,s),i.set(e,n)}return n},y=(0,f.createEmptyStyle)(),S=(0,l.clamp)(this._getTranspValue(),0,100),I=this._model.timeScale().visibleBarsStrictRange();if(null===I)return!1;const{startBar:g,endBar:v}=this._calculateStartEnd(I);if(null===g||null===v||0===this._items.length)return!1;const P=h??(0,n.ensureNotNull)(r.firstIndex()),x=(0,n.ensureNotNull)(r.lastIndex())+1,C=r.rangeIterator(P,x);let w,b=(0,R.lowerbound)(this._items,P+d,((t,e)=>t.timePointIndex<e));for(const t of C){let e=t.index;const n=t.value;e+=d,e=Math.floor(e);let s=n[this._plotIndex+1];const o=null==s;if(s=o?NaN:s,c&&o){_=s,u=e,b++;continue}const l=this._items[b];l.valIsNotSameAsPrev=s!==_||e-1!==u;if(this._colorProvider.isColorDefined()&&(l.style={color:m(i.color.value(),100),width:i.linewidth.value(),style:i.linestyle.value()},null!=s)){const t=this._colorProvider.getPlotPointStyle(n,y),e=t.colors[0];void 0!==e&&(l.style.color=(0,a.isHexColor)(e)?m(e,S):e),l.style.width=t.lineWidth??l.style.width,l.style.style=t.lineStyle??l.style.style}!c&&!isNaN(u)&&u!==e-1&&b>0&&(this._items[b].breakBefore=!0),_=s,u=e,b++,w=l}return this._updateImplLight(),!0}_correctVisibleItemIndexes(t,e){return super._correctVisibleItemIndexes(t,e)}_updateRenderer(t,e){this._renderer.clear();const i=this._study.properties().styles.childs()[this._plotName].childs(),s=this._study.metaInfo().styles?.[this._plotName],o=(0,l.clamp)(this._getTranspValue(),0,100);this._lineColor=(0,a.generateColor)(i.color.value(),o),this._lineWidth=i.linewidth.value();let c=i.color.value();const h=this._colorProvider.getDefaultPlotPointStyle();h&&(c=h.colors[0]||c,
this._lineWidth=h.lineWidth??this._lineWidth,this._lineColor=c?(0,a.generateColor)(c,o):this._lineColor),this._color2=(0,a.generateColor)(c,o);const _=this._study.metaInfo().isRGB?T(c):W(c);this._color1=(0,a.generateColor)(_,o);const f=this._histogramBase?this._histogramBase:(0,n.ensureNotNull)(this._priceScale()).height(),S=i.plottype.value(),I={barSpacing:this._model.timeScale().barSpacing(),items:this._items,histogramBase:f,lineIndex:0,lineStyle:i.linestyle.value(),lineColor:this._lineColor,lineWidth:(0,r.isNumber)(this._lineWidth)?this._lineWidth:1,color1:this._color1,color2:this._color2,bottom:f,visibleItemsRange:{startItemIndex:t,endItemIndex:e},simpleMode:this._colorProvider.singleColor(),skipHoles:[M.LineStudyPlotStyle.Line,M.LineStudyPlotStyle.Area,M.LineStudyPlotStyle.Cross,M.LineStudyPlotStyle.Circles,M.LineStudyPlotStyle.StepLine,M.LineStudyPlotStyle.StepLineWithDiamonds].includes(S)},g=this._renderer,v=Boolean(s?.joinPoints);switch(S){case M.LineStudyPlotStyle.Line:case M.LineStudyPlotStyle.LineWithBreaks:g.append(new p.PaneRendererLine({...I,lineColor:{type:B.ColorType.Solid,color:this._lineColor}}));break;case M.LineStudyPlotStyle.Area:case M.LineStudyPlotStyle.AreaWithBreaks:g.append(new u.PaneRendererArea({...I,lineColor:{type:B.ColorType.Solid,color:this._lineColor}}));break;case M.LineStudyPlotStyle.Histogram:g.append(new N(I));break;case M.LineStudyPlotStyle.Columns:g.append(new C.PaneRendererColumns(I));break;case M.LineStudyPlotStyle.Cross:g.append(new b(I)),v&&g.append(new p.PaneRendererLine({...(0,d.deepCopy)(I),lineWidth:1,lineColor:{type:B.ColorType.Solid,color:this._lineColor},forceLineWidth:!0}));break;case M.LineStudyPlotStyle.Circles:g.append(new x(I)),v&&g.append(new p.PaneRendererLine({...(0,d.deepCopy)(I),lineWidth:1,lineColor:{type:B.ColorType.Solid,color:this._lineColor},ignorePaletteLineWidth:!0}));break;case M.LineStudyPlotStyle.StepLine:case M.LineStudyPlotStyle.StepLineWithBreaks:case M.LineStudyPlotStyle.StepLineWithDiamonds:{const t=new m.PaneRendererStepLine;t.setData({...I,lineColor:{type:B.ColorType.Solid,color:this._lineColor},decoration:i.plottype.value()===M.LineStudyPlotStyle.StepLineWithDiamonds?m.StepLineDecoration.Diamonds:m.StepLineDecoration.None,extendToBarsEndings:this._extendStepLineToBarsEndings}),g.append(t);break}default:g.append(new p.PaneRendererLine({...I,lineColor:{type:B.ColorType.Solid,color:this._lineColor}}))}this._model.selection().isSelected(this._study)&&this._isMarkersEnabled&&this._selectionData&&g.append(new y.SelectionRenderer(this._selectionData))}_updateAdditionalPrices(t,e){const i=this._study.metaInfo().styles?.[this._plotName];void 0!==i?.histogramBase&&(this._histogramBase=t.priceToCoordinate(i.histogramBase,e))}}},17631:(t,e,i)=>{i.d(e,{StudyForceOverlayPlotView:()=>n});class n{constructor(t,e,i){this._series=t,this._model=e,this._plotName=i}isForceOverlay(){return!!this._study.metaInfo().isPlotForceOverlay(this._plotName)}_priceScale(){return this.isForceOverlay()?this._model.mainSeries().priceScale():this._study.priceScale()}}},
41028:(t,e,i)=>{i.d(e,{StudyPaneViewInplaceUpdatable:()=>u});var n=i(50151),s=i(10555),o=i(87465),l=i(50516),r=i(5471),a=i(12217),d=i(13173),c=i(2383),h=i(17631);class u extends h.StudyForceOverlayPlotView{constructor(t,e,i){super(t,e,i),this._selectionData=null,this._dataInvalidated=null,this._viewportInvalidated=!1,this._items=[],this._selectionIndexer=new d.SelectionIndexes(e.timeScale())}update(t){if("hover-change"!==t.type){if("global-change"===t.type)return this._dataInvalidated=(0,l.mergeDataInvalidation)(this._dataInvalidated,{}),void(this._viewportInvalidated=!0);if("data-source-change"!==t.type)this._viewportInvalidated=!0;else{if((t.sourceId===this._study.id()||this._dependsOnSeriesData()&&t.sourceId===this._model.mainSeries().id())&&!t.nonSeriesOnly){const e=(0,l.mergeDataInvalidation)(this._dataInvalidated,{firstIndex:t.firstUpdatedTimePointIndex,clearData:t.clearData});this._dataInvalidated=e}}}}_dependsOnSeriesData(){return!1}_makeSureRendererIsValid(){this._dataInvalidated?this._updateImplFull(this._viewportInvalidated)&&(this._dataInvalidated=null):this._viewportInvalidated&&this._updateImplLight(),this._viewportInvalidated=!1}_preallocateItems(t,e){const i=t.size();let s=this._dataInvalidated?.firstIndex;if(0===i)return s;const o=this._study.offset(this._plotName);if(i!==this._items.length){const i=void 0!==s?s+o:void 0;if(void 0===i||0===this._items.length||i<(0,n.ensureDefined)(this._items[0].timePointIndex))return this._items=[],t.each(((t,i)=>{const n=i[this._plotIndex+1];return this._items.push(e(t,n)),!1})),this._items.length?(0,n.ensureDefined)(this._items[0].timePointIndex)-o:void 0;{const i=(0,n.ensureDefined)(s),l=o>=0?0:o,r=o>=0?o:0;let d=(0,a.lowerbound)(this._items,i+l,((t,e)=>t.timePointIndex<e));const c=(0,n.ensureNotNull)(t.lastIndex()),h=t.rangeIterator(i-r,c);for(const t of h)if(void 0!==d&&this._items[d]?.timePointIndex===t.index+o)d=this._updateItem(t,d);else{const i=t.value[this._plotIndex+1];this._items.push(e(t.index,i))}}}else if(s=s??t.firstIndex()??void 0,void 0!==s){const e=o>=0?0:o,i=o>=0?o:0;let l=(0,a.lowerbound)(this._items,s+e,((t,e)=>t.timePointIndex<e));const r=(0,n.ensureNotNull)(t.lastIndex())+1,d=t.rangeIterator(s-i,r);for(const t of d)l=this._updateItem(t,l)}return s}_updateItem(t,e){const i=this._getValueForUpdating(t);return this._items[e].origPrices.price=i??NaN,e+1}_getValueForUpdating(t){return t.value[this._plotIndex+1]}_calculateStartEnd(t){const e=this._study.offset(this._plotName);let i=t.firstBar()-Math.abs(e)-1,s=t.lastBar()+Math.abs(e)+1;const o=this._study.getMinFirstBarIndexForPlot(this._plotName)+e;if(o>s+1)return{startBar:null,endBar:null};let l=this._study.plots();l=l.range(o,(0,n.ensureNotNull)(l.lastIndex())),i=Math.max(i,o),s=Math.max(s,o);const a=l.search(i,r.PlotRowSearchMode.NearestLeft,this._plotIndex+1),d=l.search(s,r.PlotRowSearchMode.NearestRight,this._plotIndex+1);return null!==a&&(i=a.index),null!==d&&(s=d.index),i=Math.max(o,i),{startBar:i,endBar:s}}_updateImplLight(){const t=this._study.firstValue(void 0,this.isForceOverlay())
;if(null===t)return this._selectionData=null,void this._updateRenderer(0,-1);const e=this._priceScale();if(null===e||e.isEmpty())return this._selectionData=null,void this._updateRenderer(0,-1);const i=this._model.timeScale().visibleBarsStrictRange();if(null===i)return this._selectionData=null,void this._updateRenderer(0,-1);const{startBar:n,endBar:s}=this._calculateStartEnd(i);if(null===n||null===s||0===this._items.length)return this._selectionData=null,void this._updateRenderer(0,-1);const{startItemIndex:o,endItemIndex:l}=this._correctVisibleItemIndexes(Math.max(0,(0,a.lowerbound)(this._items,n,((t,e)=>t.timePointIndex<e))),Math.min(this._items.length,(0,a.upperbound)(this._items,s,((t,e)=>t<e.timePointIndex))));if(o>=l)return this._selectionData=null,void this._updateRenderer(0,-1);this._convertItemsToCoordinates(e,t,o,l),this._createSelection(t),this._updateRenderer(o,l)}_correctVisibleItemIndexes(t,e){return{startItemIndex:t,endItemIndex:e}}_convertItemsToCoordinates(t,e,i,n){this._convertItemsToCoordinatesImpl(t,e,i,n)}_convertItemsToCoordinatesImpl(t,e,i,n){for(let t=i;t<n;t++){const e=this._items[t];e.y=e.origPrices.price}t.pointsArrayToCoordinates(this._items,e,{startItemIndex:i,endItemIndex:n}),this._model.timeScale().fillBarBorders(this._items,{startItemIndex:i,endItemIndex:n},!0),this._updateAdditionalPrices(t,e)}_updateAdditionalPrices(t,e){}_createSelection(t){const e=this._priceScale();if(null!==e)if(this._model.selection().isSelected(this._study)){const i=(0,n.ensureNotNull)(this._model.paneForSource(this._study)).height();this._selectionData={points:[],bgColors:[],visible:!0,hittestResult:c.HitTarget.Regular,barSpacing:this._model.timeScale().barSpacing()};const s=this._study.offset(this._plotName);for(const n of this._selectionIndexer.indexes()){const l=this._study.plots().valueAt(n);if((0,o.isAbsent)(l))continue;const r=l[this._plotIndex+1];if((0,o.isAbsent)(r))continue;const a=this._createSelectionDataPoint(e,Math.floor(n+s),r,t);this._selectionData.points.push(a),this._selectionData.bgColors.push(this._model.backgroundColorAtYPercentFromTop(a.point.y/i))}}else this._selectionIndexer.clear()}_createSelectionDataPoint(t,e,i,n){const o=this._model.timeScale().indexToCoordinate(e),l=t.priceToCoordinate(i,n);return{point:(0,s.point)(o,l)}}}},41425:(t,e,i)=>{i.d(e,{createStudyPlotColorProvider:()=>_});var n=i(4359),s=i(50151),o=i(26705);const l=new Map([[0,"color"],[2,"textColor"],[3,"borderColor"],[4,"wickColor"],[5,"colorup"],[6,"colordown"]]);class r{constructor(t){this._plotStyle=t}getPlotPointStyle(t,e){const i=e?(0,o.clearStyle)(e):(0,o.createEmptyStyle)();return l.forEach(((t,e)=>{this._plotStyle[t]&&(i.colors[e]=this._plotStyle[t].value())})),i.lineWidth=this._plotStyle.linewidth?this._plotStyle.linewidth.value():void 0,i.lineStyle=this._plotStyle.linestyle?this._plotStyle.linestyle.value():void 0,i}isColorDefined(){return!0}singleColor(){return!0}getDefaultPlotPointStyle(){return null}}const a=[0,1,2,3,4,5,6];class d{constructor(t,e,i,n){this._palettesColors=new Map,
this._defaultPlotColors=new Map,this._indexes=n;const o=e.styles[i];if(o)for(const[t,e]of l)this._defaultPlotColors.set(t,o[e]);const r=(0,s.ensureDefined)(t.palettes),a=t.plots;n.forEach(((t,i)=>{const n=a[t];if(n&&"palette"in n){const t=r[n.palette],s=e.palettes[n.palette];if(t&&s){const{valToIndex:e}=t,{colors:n}=s,o={...n};e&&Object.keys(e).forEach((t=>{const i=e[t];void 0!==i&&(o[t]=n[i])})),this._palettesColors.set(i,o)}}}))}getPlotPointStyle(t,e){const i=e?(0,o.clearStyle)(e):(0,o.createEmptyStyle)();return a.forEach((e=>{if(this._palettesColors.has(e)){const n=t[(0,s.ensureDefined)(this._indexes.get(e))+1];if("number"==typeof n){const t=this._palettesColors.get(e)?.[n];0===e&&t&&(i.lineWidth=t.width.value(),i.lineStyle=t.style.value()),i.colors[e]=t?.color.value()}else i.colors[e]="transparent"}else i.colors[e]=this._defaultPlotColors.get(e)?.value()})),i}getDefaultPlotPointStyle(){const t=this._palettesColors.get(0)?.[0];if(void 0!==t){return{colors:[t.color.value(),void 0,void 0,void 0,void 0,void 0,void 0],lineStyle:void 0,lineWidth:t.width.value()}}return null}isColorDefined(){return!!this._palettesColors.size}singleColor(){return!1}}var c=i(13560);class h{constructor(t){this._rgbaFromInteger=(0,c.rgbaFromIntegerCached)(),this._indexes=t}getPlotPointStyle(t,e){const i=e?(0,o.clearStyle)(e):(0,o.createEmptyStyle)();return this._indexes.forEach(((e,n)=>{const s=t[e+1];if(null!=s){const t=this._rgbaFromInteger(s);i.colors[n]=t}else i.colors[n]="transparent"})),i}isColorDefined(){return!0}singleColor(){return!1}getDefaultPlotPointStyle(){return null}}const u=new Map([[0,function(t,e){const i=(0,n.isColorerPlot)(e)||(0,n.isOhlcColorerPlot)(e);return"target"in e&&e.target===t&&i}],[2,function(t,e){const i=(0,n.isTextColorerPlot)(e);return"target"in e&&e.target===t&&i}],[1,function(t,e){return(0,n.isBgColorerPlot)(e)&&e.id===t}],[3,function(t,e){const i=(0,n.isCandleBorderColorerPlot)(e);return"target"in e&&e.target===t&&i}],[4,function(t,e){const i=(0,n.isCandleWickColorerPlot)(e);return"target"in e&&e.target===t&&i}],[5,function(t,e){const i=(0,n.isUpColorerPlot)(e);return"target"in e&&e.target===t&&i}],[6,function(t,e){const i=(0,n.isDownColorerPlot)(e);return"target"in e&&e.target===t&&i}]]);function _(t,e,i){const{colorers:n}=function(t,e){const i=t.plots,n=i.findIndex((t=>t.id===e)),s=new Map;return i.forEach(((t,i)=>{u.forEach(((n,o)=>{n(e,t)&&s.set(o,i)}))})),{plotIndex:-1===n?null:n,colorers:s}}(t,i);if(n.size)return t.isRGB?new h(n):new d(t,e,i,n);{const t=e.ohlcPlots;if(t&&t[i])return new r(t[i]);const n=e.styles[i];return new r(n)}}},13560:(t,e,i)=>{i.d(e,{rgbaFromIntegerCached:()=>l});var n=i(59332),s=i(52859),o=i(16659);function l(t=1e3){const e=n.default.Cache;n.default.Cache=o.CircularCacheBuffer.bind(o.CircularCacheBuffer,t);const i=(0,n.default)(s.rgbaFromInteger);return n.default.Cache=e,i}}}]);