',actions:[{name:"ok",type:"primary",text:window.t("Ok"),method:"close",key:[13,32]}]});function o(e){return new Promise((function(t){Promise.all([i.e("dialogs-core"),i.e(57),i.e(0),i.e(18),i.e("create-dialog")]).then(function(o){var s=i("YDhE").createDialog;t(s(Object(n.a)(Object(n.a)({},r),e)))}.bind(null,i)).catch(void 0)}))}function s(e){o(e).then((function(e){return e.open()}))}},"bv/X":function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;function o(e,t){var r=t||o.createProperties()
;n.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("piZW").SineLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.name=function(){return"Sine Line"},o.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("LX4V").CyclicAndSineLinesPatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},o.createProperties=function(e){var t=new r("linetoolsineline",e);return o._configureProperties(t),t},o._configureProperties=function(e){n._configureProperties(e)},t.LineToolSineLine=o},c2JX:function(e,t,i){"use strict";i.r(t),i.d(t,"renderSpinnerTemplate",(function(){return o})),i.d(t,"Spinner",(function(){return a}));i("SzKR");var n=i("gWrr"),r=i("Owlf");function o(e){return void 0===e&&(e=""),'\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\x3c!--\n\t\t\t\t--\x3e
\n\t\t\t
\n\t\t
\n\t'}var s=Object(n.b)(o()),a=function(){function e(e){this._shown=!1,this._el=s.cloneNode(!0),this.setSize(e||r.a)}return e.prototype.spin=function(e){return this._el.classList.add("tv-spinner--shown"),void 0===this._container&&(this._container=e,void 0!==e&&e.appendChild(this._el)),this._shown=!0,this},e.prototype.stop=function(e){return e&&void 0!==this._container&&this._container.removeChild(this._el),this._el.classList.remove("tv-spinner--shown"),this._shown=!1,this},e.prototype.setStyle=function(e){var t=this;return Object.keys(e).forEach((function(i){var n=e[i];void 0!==n&&t._el.style.setProperty(i,n)})),this},e.prototype.setSize=function(e){var t=void 0!==e?"tv-spinner--size_"+e:"";return this._el.className="tv-spinner "+t+" "+(this._shown?"tv-spinner--shown":""),this},e.prototype.getEl=function(){return this._el},e.prototype.destroy=function(){this.stop(),delete this._el,delete this._container},e}()},c44N:function(e,t,i){"use strict";function n(e,t){return e.pixelRatio===t.pixelRatio}i.r(t),i.d(t,"areEqualPaneRenderParams",(function(){return n}))},cBZt:function(e,t,i){"use strict";function n(e,t){return e+"@"+t}function r(e){return e.replace(/(@[^-]+-[^-]+).*$/,"$1")}i.r(t),i.d(t,"studyIdString",(function(){return n})),i.d(t,"extractStudyId",(function(){return r}))},cKqi:function(e,t,i){"use strict"
;var n=i("aO4+").Point,r=i("qJq3").Series,o=i("GVHu").Study,s=i("k9/m").PlotRowSearchMode,a=i("FBsw").OverlayPriceAxisView,l=i("KtbP").PanePriceAxisView,c=i("x0JF"),u=c.SeriesAreaPaneView,h=c.SeriesLinePaneView,d=c.SeriesHollowCandlesPaneView,p=c.SeriesCandlesPaneView,f=c.SeriesBarsPaneView,_=c.SeriesBaselinePaneView,m=i("biIa").SeriesWaterlinePaneView,v=i("2kV1").StudyStatusView,y=i("JjUe").OverlayDataWindowView,g=i("z8/4").OverlayLegendView,b=i("qXYw").OverlayLegendValuesProvider,S=i("ZsYR").OverlayStatusProvider,w=i("38az").SeriesBarColorer,P=i("l4sv").HorizontalLineRenderer,C=i("Kxc7"),T=i("6sst").OverlayStudyPriceLineAxisView,x=i("Qb4w").PriceRange,I=i("XPit").barFunction,L=i("XPit").seriesPlotFunctionMap,O=i("k9/m").PlotList,M=i("n5al").createSeriesFormatter,A=i("y/Xm").StudyOverlayBase,k=i("qFKp").CheckMobile.any()&&!1,E=!C.enabled("hide_study_overlay_legend_item"),V=i("txPx").getLogger("Chart.StudyOverlay");function D(e,t){this._source=e,this._model=t,this._points=[new n(0,0)],this._lineRenderer=new P}function B(e,t){return null==e[t]}function R(e,t,i,n){this._waterlineView=null,A.call(this,e,t,i,n),this.m_data=new O(L(),B),this._formatter=null,this._paneView=null;var r=this;this.properties().minTick.listeners().subscribe(null,(function(){r._recreatePriceFormattingDependencies(),r.updateAllViews(),r._model.fullUpdate()})),this.properties().style.listeners().subscribe(this,this._updateBarFunction),this.properties().lineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().areaStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().baselineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this._updateBarFunction()}D.prototype.update=function(){if(this._visible=!1,this._source.properties().showPriceLine.value()){var e=this._source.lastValueData(void 0,!0);e.noData||(this._visible=!0,this._points=[new n(0,e.coordinate)],this._color=e.color)}},D.prototype.renderer=function(){var e={};return e.width=this._model.timeScale().width(),e.height=this._source.priceScale().height(),e.y=this._points[0].y,e.color=this._color,e.linewidth=1,e.linestyle=CanvasEx.LINESTYLE_DOTTED,e.visible=this._visible,this._lineRenderer.setData(e),this._lineRenderer},inherit(R,A),R.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},R.prototype.lastValueData=function(e,t,i){var n={noData:!0};if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return n;var o=this._model.timeScale().visibleBarsStrictRange();if(null===o)return n;if(!this.properties().visible.value())return n;var a=this.nearestIndex(o.lastBar(),s.NearestLeft,TradingView.OPEN_PLOT);if(null==a)return n;var l=this._lastNonEmptyPlotRow(TradingView.CLOSE_PLOT),c=null!==l&&o.contains(l.index),u=null!==l?l.value:null,h=t||c?u:this.data().valueAt(a);if(null===h)return n;var d=this._barFunction(h);if(!isNumber(d))return n;var p={noData:!1};i&&(p.price=d)
;var f=this.firstValue();if(!isNumber(f))return n;p.text=this.priceScale().formatPrice(d,f),p.text=this.priceScale().formatPrice(d,f),p.formattedPriceAbsolute=this.priceScale().formatPriceAbsolute(d),p.formattedPricePercentage=this.priceScale().formatPricePercentage(d,f),p.floatCoordinate=this.priceScale().priceToCoordinate(d,f),p.coordinate=p.floatCoordinate,p.item=h;var _=this.properties();switch(_.style.value()){case r.STYLE_BARS:p.color=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?_.barStyle.upColor.value():_.barStyle.downColor.value();break;case r.STYLE_CANDLES:case r.STYLE_HOLLOW_CANDLES:p.color=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?_.candleStyle.upColor.value():_.candleStyle.downColor.value();break;case r.STYLE_LINE:p.color=_.lineStyle.color.value();break;case r.STYLE_AREA:p.color=_.areaStyle.color1.value();break;case r.STYLE_BASELINE:var m=_.baselineStyle,v=this.priceScale(),y=Math.round(v.height()*(Math.abs(100-m.baseLevelPercentage.value())/100));p.color=p.coordinate
0),o?{left:0,right:1,totallySlots:i}:{left:1,right:0,totallySlots:i}}return{left:e,right:t,totallySlots:e+t}},X.prototype.startScalePrice=function(e,t,i){e.startScalePrice(t,i)},X.prototype.scalePriceTo=function(e,t,i){e.scalePriceTo(t,i),this.mainSeries().priceScale().isLockScale()?this.lightUpdate():this.invalidate(this._paneInvalidationMask(e,S.Light)),this._setScalesResetAvailable(!0)},X.prototype.endScalePrice=function(e,t){e.endScalePrice(t),this.invalidate(this._paneInvalidationMask(e,S.Light))},X.prototype.startScrollPrice=function(e,t,i){e.startScrollPrice(t,i)},X.prototype.scrollPriceTo=function(e,t,i){e.scrollPriceTo(t,i),this.invalidate(this._paneInvalidationMask(e,S.Light))},X.prototype.endScrollPrice=function(e,t){e.endScrollPrice(t),this.invalidate(this._paneInvalidationMask(e,S.Light))},X.prototype.setPriceAutoScale=function(e,t,i){e.setPriceAutoScale(t,i),this.invalidate(this._paneInvalidationMask(e,S.Light))},X.prototype.restorePriceScaleState=function(e,t,i){e.restorePriceScaleState(t,i),this.invalidate(this._paneInvalidationMask(e,S.Light))},X.prototype.resetPriceScale=function(e,t){this._setScalesResetAvailable(!1),e.resetPriceScale(t),this.invalidate(this._paneInvalidationMask(e,S.Light))},X.prototype.updateScales=function(e,t){this._undoModel._chartWidget._updateScalesActions()},X.prototype.startScaleTime=function(e){this._timeScale.startScale(e)},X.prototype.mainSeriesScaleRatioProperty=function(){return this._mainSeriesScaleRatioProperty},X.prototype.mainSeriesScaleRatioPropertyOnChanged=function(){this._mainSeriesScaleRatioProperty.listeners().fire(this._mainSeriesScaleRatioProperty)},X.prototype.mainSeriesScaleRatio=function(){return N(this._timeScale,this.m_mainSeries.priceScale())},X.prototype.setMainSeriesScaleRatio=function(e){this.paneForSource(this.m_mainSeries).applyPriceScaleRatio(this.m_mainSeries.priceScale(),e)},X.prototype.scaleTimeTo=function(e){this._timeScale.scaleTo(e),this.recalculateAllPanes(),this.lightUpdate(),this._setScalesResetAvailable(!0)},X.prototype.endScaleTime=function(){this._timeScale.endScale(),this.lightUpdate(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudies()},X.prototype.startScrollTime=function(e){this._timeScale.startScroll(e),this._isTimeScrolling=!0},X.prototype.scrollTimeTo=function(e){this._timeScale.scrollTo(e),this.recalculateAllPanes(),this.updateCrossHair(),this.lightUpdate(),this._setScalesResetAvailable(!0)},X.prototype.endScrollTime=function(){this._timeScale.endScroll(),this.lightUpdate(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudies(),this._isTimeScrolling=!1},
X.prototype.recalcStudyBasedLineTools=function(){this.dataSources().forEach((function(e){p(e)&&e.recalcStudyIfNeeded&&e.recalcStudyIfNeeded()}))},X.prototype.onResetScales=function(){return this._resetScales},X.prototype.resetTimeScale=function(){this._timeScale.restoreDefault(),this.recalculateAllPanes(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudies(),this.updateCrossHair(),this.lightUpdate(),this._resetScales.fire(),this._setScalesResetAvailable(!1)},X.prototype.restoreTimeScaleState=function(e){this._timeScale.restoreState(e),this.recalculateAllPanes(),this.updateCrossHair(),this.lightUpdate(),this._setScalesResetAvailable(!0)},X.prototype.restoreFactoryDefaults=function(e){e.restoreFactoryDefaults(),this.recalcVisibleRangeStudies(!0)},X.prototype.selectionMacro=function(e){var t=this.selection().allSources();e({removeSourceFromSelection:ee.bind(this),addSourceToSelection:te.bind(this),clearSelection:Q.bind(this),selection:this.selection.bind(this)});var i=F(t,this.selection().allSources()),n=F(this.selection().allSources(),t);n.concat(t).forEach((function(e){e.updateAllViews()})),i.forEach((function(e){var t=e.hasAlert&&e.hasAlert.value()&&e.getAlertSync();t&&t.set("selected",!1)})),n.forEach((function(e){var t=e.hasAlert&&e.hasAlert.value()&&e.getAlertSync();t&&t.set("selected",!0)})),this.lightUpdate(),this.setHoveredSource(null),(i.length>0||n.length>0)&&this._selectedSourceChanged.fire()},X.prototype.checkLineToolSelection=function(){this._selection.checkLineToolSelection()},X.prototype.onSelectedSourceChanged=function(){return this._selectedSourceChanged},X.prototype.selection=function(){return this._selection},X.prototype.invalidate=function(e){this._invalidateHandler&&this._invalidateHandler(e)},X.prototype.orderedDataSources=function(e){var t=[];t.push(this.m_crossHairSource);for(var i=0;i0)for(s=this.dataSources(),a=0;a0){var c=r-n,u=l?null:i.rightOffset()-c;if(!this._options.shiftVisibleRangeOnNewBar&&l){var h=i.width()/(a.length()+c);h>=i.minBarSpacing()?(i.setBarSpacing(h),u=i.rightOffset()+c):s.lastBar()!==n&&(u=i.rightOffset()-c)}null!==u&&i.setRightOffset(u)}}i.setBaseIndex(r)}},X.prototype.recalculatePane=function(e){e&&e.recalculate()},X.prototype.recalculateAllPanes=function(){
for(var e=0;e1},X.prototype.lineBeingEdited=function(){return this._lineBeingEdited},X.prototype.linePointBeingEdited=function(){return this._linePointBeingEdited},X.prototype.changeLinePoint=function(e,t,i){var n=this.paneForSource(this._lineBeingEdited),r=e.price,o=e.index;if(void 0!==e.x&&void 0!==e.y){var s=this._lineBeingEdited.priceScale(),a=n.mainDataSource().firstValue();r=s.coordinateToPrice(e.y,a),o=Math.round(this.timeScale().coordinateToIndex(e.x)),r=this._magnet.align(r,o,n),this._lineBeingEdited.setPoint(this._linePointBeingEdited,{price:r,index:o},t)}else this._lineBeingEdited.setPoint(this._linePointBeingEdited,e,t);var l={indexesChanged:o!==this._linePointBeingChanged.index,pricesChanged:r!==this._linePointBeingChanged.price};if(this._lineBeingEdited.updateAllViews(),this.lightUpdate(),!i&&this._lineBeingEdited.linkKey&&this._lineBeingEdited.isSynchronizable()){var c=this._lineBeingEdited.getChangePointForSync(this._linePointBeingEdited);if(null!==c){var u=this.externalTimeStamp(o);r=c.price,k.changeLineTool({linkKey:this._lineBeingEdited.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:r,timeStamp:u},envState:t,changes:l})}}},X.prototype.calculateDefaultTags=function(){for(var e=[],t=this.dataSources(),i=0;i-1&&this._modelIntervals.splice(t,1)},X.prototype.clearIntervals=function(){for(var e=0;eu&&(h-=Math.abs(u-(d+l)),d=Math.floor(h-c)+.5);var p=d+l,f=0+t.borderSize+t.paddingTop+t.fontSize+t.paddingBottom;e.fillStyle=n.background;var _=Math.round(d*i),m=Math.round(0*i),v=Math.round(p*i),y=Math.round(f*i);e.fillRect(_,m,v-_,y-m);var g=Math.round(n.coordinate*i),b=m,S=Math.round((b+t.borderSize+t.tickLength)*i);e.fillStyle=n.color;var w=Math.max(1,Math.floor(i)),P=Math.floor(.5*i);e.fillRect(g-P,b,w,S-b);var C=f-t.baselineOffset-t.paddingBottom;e.textAlign="left",e.fillStyle=n.color,Object(r.drawScaled)(e,i,(function(){return e.fillText(n.text,d+a,C)})),e.restore()}}},e}();i.d(t,"a",(function(){return a}));var a=function(){function e(e){this._renderer=new s,this._rendererData={background:"",color:"",coordinate:0,text:"",visible:!1,width:0},this._invalidated=!0,this._model=e,this._renderer.setData(this._rendererData)}return e.prototype.update=function(){this._invalidated=!0},e.prototype.renderer=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer},
e.prototype.coordinate=function(){return this._rendererData.coordinate},e.prototype._updateImpl=function(){var e=this._rendererData;if(e.visible=!1,!this._model.timeScale().isEmpty()){var t=this._getIndex();if(null!==t){e.visible=!0,e.width=this._model.timeScale().width(),e.background=this._getBgColor(),e.color=Object(n.colorFromBackground)(e.background),e.coordinate=this._model.timeScale().indexToCoordinate(t);var i=this._model.timeScale().indexToUserTime(t);e.text=null!==i?this._model.dateTimeFormatter().format(i):"",this._invalidated=!1}}},e}()},d1Pk:function(e,t,i){"use strict";i.r(t),i.d(t,"fibLevelCoordinate",(function(){return r})),i.d(t,"fibLevelPrice",(function(){return o}));var n=i("Eyy1");function r(e,t,i,r,o,s){if(s)return Math.round(Object(n.ensureDefined)(e.coordinate)+Object(n.ensureDefined)(t.coordinate)*i);var a=e.price+t.price*i;return r.priceToCoordinate(a,o)}function o(e,t,i,r,o,s){if(!s)return e.price+t.price*i;var a=Object(n.ensureDefined)(e.coordinate)+Object(n.ensureDefined)(t.coordinate)*i;return r.coordinateToPrice(a,o)}},d700:function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return o}));var n=i("/3z9");function r(e){if("INPUT"===e.tagName){var t=e.type;return"text"===t||"email"===t||"number"===t||"password"===t||"search"===t||"tel"===t||"url"===t}return"TEXTAREA"===e.tagName||e.isContentEditable}function o(e,t){if(!t)return!1;var i=255&e;if(27===i||i>>>4==7)return!1;switch(e^i){case n.Modifiers.Alt:return(38===i||40===i)&&"SELECT"===t.tagName||r(t);case n.Modifiers.Alt+n.Modifiers.Shift:return r(t);case n.Modifiers.Mod:if(67===i||!n.isMacKeyboard&&45===i){var o=t.ownerDocument&&t.ownerDocument.getSelection();if(o&&!o.isCollapsed)return!0}return r(t);case n.Modifiers.Mod+n.Modifiers.Shift:return i>=33&&i<=40&&r(t);case n.Modifiers.Shift:case 0:return!!(9!==i||t.ownerDocument&&t!==t.ownerDocument.body&&t!==t.ownerDocument.documentElement)&&((13===i||32===i||!function(e){if("BUTTON"===e.tagName)return!0;if("INPUT"===e.tagName){var t=e.type;if("submit"===t||"button"===t||"reset"===t||"checkbox"===t||"radio"===t)return!0}return!1}(t))&&("form"in t||t.isContentEditable))}return!1}},dBsn:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererCross",(function(){return l}));var n=i("aO4+"),r=i("GEp6"),o=i("ogJP"),s=i("Zp/P"),a=i("VdBB"),l=function(){function e(e){this._data=e}return e.prototype.draw=function(e,t){for(var i,n,r,s,a=t.pixelRatio,l="",c=!1,u=0,h=this._data.items;u0?"Forward":"Backward")),this._model=e,this._sourcesIds=t.map((function(e){return e.id()})),this._shift=i}function A(e,t,i,n,r,o){p.call(this,"Zoom"),this._model=e,this._startBar=t,this._endBar=i,this._startPrice=n,this._endPrice=r,this._pane=o}function k(e,t,i){p.call(this,"Zoom"),this._baseCmd=e,this._zoomStack=t,this._inOut=i}function E(e,t,i){p.call(this,"Apply Chart Theme"),this._model=e,this._newChartProps=TradingView.factoryDefaults("chartproperties"),this._newSeriesProps=TradingView.factoryDefaults("chartproperties.mainSeriesProperties"),this._newSessionProps=t.sessions||TradingView.factoryDefaults("sessions"),["candleStyle","hollowCandleStyle","haStyle"].forEach((function(e){t.mainSourceProperties[e].wickUpColor=t.mainSourceProperties[e].wickUpColor||t.mainSourceProperties[e].wickColor,t.mainSourceProperties[e].wickDownColor=t.mainSourceProperties[e].wickDownColor||t.mainSourceProperties[e].wickColor})),
t.chartProperties.paneProperties.vertGridProperties=t.chartProperties.paneProperties.vertGridProperties||t.chartProperties.paneProperties.gridProperties,t.chartProperties.paneProperties.horzGridProperties=t.chartProperties.paneProperties.horzGridProperties||t.chartProperties.paneProperties.gridProperties,t.chartProperties.paneProperties.legendProperties=this._model.properties().state().paneProperties.legendProperties,this._newChartProps=o({},this._newChartProps,t.chartProperties),delete this._newChartProps.scalesProperties.showLeftScale,delete this._newChartProps.scalesProperties.showRightScale,delete this._newChartProps.scalesProperties.scaleSeriesOnly,delete this._newChartProps.scalesProperties.showSeriesLastValue,delete this._newChartProps.scalesProperties.showStudyLastValue,delete this._newChartProps.scalesProperties.showSymbolLabels,delete this._newChartProps.scalesProperties.showBidAskLabels,delete this._newChartProps.scalesProperties.showPrePostMarketPriceLabel,delete this._newChartProps.scalesProperties.showStudyPlotLabels,delete this._newChartProps.scalesProperties.showFundamentalNameLabel,delete this._newChartProps.scalesProperties.showFundamentalLastValue,delete this._newChartProps.scalesProperties.seriesLastValueMode,e.timeScale().preserveBarSpacing()&&delete this._newChartProps.scalesProperties.barSpacing,this._newSeriesProps=o({},this._newSeriesProps,t.mainSourceProperties),this._oldChartProps=e.properties().state(),delete this._oldChartProps.paneProperties.topMargin,delete this._oldChartProps.paneProperties.bottomMargin,this._oldSeriesProps=e.mainSeries().properties().state(),this._oldSessionsProps=this._model.sessions().properties().state(),i||(delete this._oldSeriesProps.style,delete this._oldSeriesProps.symbol,delete this._oldSeriesProps.interval,delete this._oldSeriesProps.extendedHours,delete this._newSeriesProps.style,delete this._newSeriesProps.symbol,delete this._newSeriesProps.interval,delete this._newSeriesProps.extendedHours,delete this._newSeriesProps.bidAsk.visible,delete this._newSeriesProps.prePostMarket.visible,delete this._newSeriesProps.highLowAvgPrice)}function V(e,t){p.call(this,"Stop Sincing Drawing"),this._model=e,this._sourceId=t.id(),this._linkKey=t.linkKey}inherit(I,a),I.prototype.version=function(){return this.m_model._version},I.prototype.onData=function(e){switch(e.method){case"timescale_update":var t=e.params;this.m_model.updateTimeScale(t.index,t.zoffset,t.changes,t.index_diff,t.marks,t.clear)}},I.prototype.paneForSource=function(e){return this.m_model.paneForSource(e)},I.prototype.createPane=function(e){return this.m_model.createPane(e)},I.prototype.readOnly=function(){return this.m_model.readOnly()},I.prototype.restart=function(){this.m_model.restart()},I.prototype.disconnect=function(){this.m_model.disconnect()},I.prototype.studiesMetaData=function(){return this.m_model.studiesMetaData()},I.prototype.studyVersioning=function(){return this.m_model.studyVersioning()},I.prototype.chartModel=function(){return this._model()},I.prototype._model=function(){return this.m_model
},I.prototype.pushUndoCommand=function(e){this._pushUndoCommand(e)},I.prototype._pushUndoCommand=function(e){this._undoHistory.pushUndoCommand(e)},I.prototype.startScalePrice=function(e,t,i){this.pushUndoCommand(new L(this.m_model,e,t,t.state())),this.chartModel().startScalePrice(e,t,i)},I.prototype.scalePriceTo=function(e,t,i){this.chartModel().scalePriceTo(e,t,i)},I.prototype.endScalePrice=function(e,t){this.chartModel().endScalePrice(e,t)},I.prototype.startScrollPrice=function(e,t,i){t.isAutoScale()||(this._initialPriceScrollState=t.state(),this._initialPriceScrollPos=i,this.chartModel().startScrollPrice(e,t,i))},I.prototype.scrollPriceTo=function(e,t,i){t.isAutoScale()||(this._initialPriceScrollPos&&Math.abs(this._initialPriceScrollPos-i)>20&&(this.pushUndoCommand(new L(this.m_model,e,t,this._initialPriceScrollState)),delete this._initialPriceScrollState,delete this._initialPriceScrollPos),this.chartModel().scrollPriceTo(e,t,i))},I.prototype.endScrollPrice=function(e,t){t.isAutoScale()||(delete this._initialPriceScrollState,delete this._initialPriceScrollPos,this.chartModel().endScrollPrice(e,t))},I.prototype.setPriceAutoScale=function(e,t,i){this.pushUndoCommand(new L(this.m_model,e,t,t.state())),this.chartModel().setPriceAutoScale(e,t,i)},I.prototype.resetPriceScale=function(e,t){this.pushUndoCommand(new L(this.m_model,e,t,t.state())),this.chartModel().resetPriceScale(e,t)},I.prototype.setWidth=function(e){this.m_model.setWidth(e)},I.prototype.setPaneHeight=function(e,t){this.m_model.setPaneHeight(e,t)},I.prototype.gridSource=function(){return this.m_model.gridSource()},I.prototype.watermarkSource=function(){return this.m_model.watermarkSource()},I.prototype.addAlertsSource=function(e){return this.m_model.addAlertsSource(e)},I.prototype.alertsSources=function(){return this.m_model.alertsSources()},I.prototype.publishedChartsTimelineSource=function(){return this.m_model.publishedChartsTimelineSource()},I.prototype.barsMarksSources=function(){return this.m_model.barsMarksSources()},I.prototype.crossHairSource=function(){return this.m_model.crossHairSource()},I.prototype.model=function(){return this.m_model},I.prototype.chartWidget=function(){return this._chartWidget},I.prototype.mainSeries=function(){return this.m_model.m_mainSeries},I.prototype.mainSeriesScaleRatioProperty=function(){return this.m_model.mainSeriesScaleRatioProperty()},I.prototype.panes=function(){return this.m_model.panes()},I.prototype.timeScale=function(){return this.m_model.timeScale()},I.prototype.selectionMacro=function(e){return this.m_model.selectionMacro(e)},I.prototype.setHoveredSource=function(e,t){this.m_model.setHoveredSource(e,t)},I.prototype.selection=function(){return this.m_model.selection()},I.prototype.onSelectedSourceChanged=function(){return this.m_model.onSelectedSourceChanged()},I.prototype.hoveredSource=function(){return this.m_model.hoveredSource()},I.prototype.activeStrategySource=function(){return this.m_model.activeStrategySource()},I.prototype.invalidate=function(e){this.m_model.invalidate(e)},
I.prototype.setCurrentPosition=function(e,t,i,n){this.m_model.setCurrentPosition(e,t,i,n)},I.prototype.setAndSaveCurrentPosition=function(e,t,i,n){this.m_model.setAndSaveCurrentPosition(e,t,i,n)},I.prototype.modifySeries=function(e,t,i){var n=new O(this.m_model,e,t,i);this.pushUndoCommand(n)},I.prototype.canCreateStudy=function(e){return this.model().chartApi().chartApi().isCanCreateStudy(e)},I.prototype.checkIfFeatureAvailable=function(e,t){var i=this.canCreateStudy(),n=t&&t instanceof c;return!this.readOnly()&&n&&(i=this.canCreateStudy(!0)),!!i||(n||h(),!1)},I.prototype.insertStudyWithoutCheck=function(e){return this._insertStudy(e)},I.prototype.createStudyInserter=function(e,t,i){var n=this,r=null,o={createStudy:function(e,t,i,o,s,a,l,c,u,h){return n.checkIfFeatureAvailable(e,a)?(S("studies","Study_"+e.id),"Compare@tv-basicstudies"===e.id&&S("compare","symbol:"+t.symbol),n._insertStudy(e,t,o,s,a,l,c,u,r,h)):(w.logNormal("Cannot insert study "+e.id),null)}};void 0!==i&&(o.createStub=function(){var e=n.m_model.insertStudyStub(i);return r={targetPaneId:n.m_model.paneForSource(e).id(),targetZOrder:e.zorder()},e.id()},o.removeStub=function(e){return n.m_model.removeStudyStub(e)});var s=new b(e,this.m_model._studiesMetaInfoRepository,o);return s.setParentSource(t),s},I.prototype.setProperty=function(e,t,i,n){if(e&&e.value()!==t){var r=new C(e,t,i,this.m_model,n);this.pushUndoCommand(r),this.emitEvent("setProperty")}},I.prototype.setProperties=function(e,t,i){var n=this;this.beginUndoMacro(i),this.m_model.selectionMacro((function(){for(var r=0;r0&&t.reverse(),t.forEach((function(t){e._model.changeZOrder(t,e._shift)}))},I.prototype.removePane=function(e){var t=this.m_model.panes()[e].dataSources().slice();this.removeSources(t,!1,"Remove pane")},inherit(A,p),A.prototype.redo=function(){this._timeScaleState=this._model.timeScale().state(),this._priceScaleState=this._pane.defaultPriceScale().state(),this._model.zoomToViewport(this._startBar,this._endBar,this._startPrice,this._endPrice,this._pane)},A.prototype.undo=function(){this._model.timeScale().restoreState(this._timeScaleState),this._pane.defaultPriceScale().restoreState(this._priceScaleState),this._model.recalculateAllPanes(),this._model.lightUpdate()},inherit(k,p),k.prototype.undo=function(){if(this._inOut){if(this._baseCmd!==this._zoomStack.head())return void w.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}else this._baseCmd.redo(),this._zoomStack.push(this._baseCmd)},k.prototype.redo=function(){if(this._inOut)this._baseCmd.redo(),this._zoomStack.push(this._baseCmd);else{if(this._baseCmd!==this._zoomStack.head())return void w.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}},inherit(E,p),E.prototype._merge=function(e,t,i){var n=this._model;l(!0),e&&(n.properties().paneProperties.mergeAndFire(e.paneProperties),n.properties().scalesProperties.mergeAndFire(e.scalesProperties)),n.mainSeries().priceScale().setMode({autoScale:t.priceAxisProperties.autoScale,percentage:t.priceAxisProperties.percentage,log:t.priceAxisProperties.log,lockScale:t.priceAxisProperties.lockScale}),n.mainSeries().properties().mergeAndFire(t),n.mainSeries().properties().saveDefaults(),n.mainSeries().createPaneView(),n.mainSeries().invalidateBarStylesCache(),n._version=t.version,n.recalculateAllPanes(),
n.fullUpdate(),n.properties().saveDefaults(),n.sessions().restoreState({properties:i}),l(!1)},E.prototype.undo=function(){this._merge(this._oldChartProps,this._oldSeriesProps,this._oldSessionsProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},E.prototype.redo=function(){this._merge(this._newChartProps,this._newSeriesProps,this._newSessionProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},inherit(V,p),V.prototype.redo=function(){delete this._model.dataSourceForId(this._sourceId).linkKey},V.prototype.undo=function(){this._model.dataSourceForId(this._sourceId).linkKey=this._linkKey},t.ChartUndoModel=I,t.PriceScaleChangeUndoCommand=L}).call(this,i("aIyQ"))},dOnf:function(e,t,i){"use strict";function n(e){var t;if("object"!=typeof e||null==e||"number"==typeof e.nodeType)t=e;else if(Array.isArray(e)){t=[];for(var i=0,r=e.length;ii?i:Math.round(t)}function o(e,t,i){return n.isNaN(t)||ti?i:Math.round(1e4*t)/1e4}function s(e){return r(0,e,255)}function a(e){return r(0,e,255)}function l(e){return r(0,e,255)}function c(e){return o(0,e,1)}function u(e){return o(0,e,1)}function h(e){return o(0,e,1)}function d(e){return o(0,e,1)}function p(e){return o(0,e,1)}function f(e){return o(0,e,1)}function _(e){var t=e[0]/255,i=e[1]/255,n=e[2]/255,r=Math.min(t,i,n),o=Math.max(t,i,n),s=0,a=0,l=(r+o)/2;if(r===o)s=0,a=0;else{var c=o-r;switch(a=l>.5?c/(2-o-r):c/(o+r),o){case t:s=((i-n)/c+(i1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}function v(e){var t,i,n,r=e[0],o=e[1],c=e[2];if(0===o)t=i=n=c;else{
var u=c<.5?c*(1+o):c+o-c*o,h=2*c-u;t=m(h,u,r+1/3),i=m(h,u,r),n=m(h,u,r-1/3)}return[s(255*t),a(255*i),l(255*n)]}t.normalizeRedComponent=s,t.normalizeGreenComponent=a,t.normalizeBlueComponent=l,t.normalizeAlphaComponent=c,t.rgb=function(e,t,i){return[s(e),a(t),l(i)]},t.areEqualRgb=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},t.rgba=function(e,t,i,n){if(Array.isArray(e)){var r=e;return n=t,[r[0],r[1],r[2],c(n)]}var o=t;return i=i||0,n=n||0,[s(e),a(o),l(i),c(n)]},t.areEqualRgba=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},t.normalizeHue=u,t.normalizeHslSaturation=h,t.normalizeHsvSaturation=d,t.normalizeLightness=p,t.normalizeValue=f,t.hsl=function(e,t,i){return[u(e),h(t),p(i)]},t.areEqualHsl=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},t.hsv=function(e,t,i){return[u(e),d(t),f(i)]},t.areEqualHsv=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},t.rgbToHsl=_,t.hslToRgb=v,t.rgbToHsv=function(e){var t=e[0],i=e[1],n=e[2],r=t/255,o=i/255,s=n/255,a=Math.min(r,o,s),l=Math.max(r,o,s),c=l-a,u=0,h=0===l?0:c/l,d=l;if(l===a)u=0;else switch(l){case t:u=((o-s)/c+(o255)throw new Error("invalid threshold value, valid values are [0, 255]");return g(e)>=t?"white":"black"},t.tryParseRgb=E,t.parseRgb=function(e){var t=E(e);if(null!==t)return t;throw new Error("Passed color string does not match any of the known color representations")},t.tryParseRgba=V,t.parseRgba=D},ePL1:function(e,t,i){"use strict";i.r(t),i.d(t,"types",(function(){return n}));var n={ECONOMIC:"economic",QUANDL:"quandl"}},eqEH:function(e,t,i){"use strict";i.r(t),i.d(t,"registerService",(function(){return s})),i.d(t,"unregisterService",(function(){return a})),i.d(t,"hasService",(function(){return l})),i.d(t,"service",(function(){return c})),i.d(t,"waitServiceRegistered",(function(){return u}));var n=i("jofe"),r={},o=new Map;function s(e,t){if(l(e))throw new Error("Service already registered");r[e.id]=t;var i=o.get(e.id);void 0!==i&&(o.delete(e.id),i.resolve(t))}function a(e){if(!l(e))throw new Error("Service not found");r[e.id]=void 0}function l(e){return void 0!==r[e.id]}function c(e){var t=r[e.id];if(void 0===t)throw new Error("ServiceLocator: Service "+e.id+" not found");return t}function u(e){if(l(e))return Promise.resolve(c(e));var t=o.get(e.id);return void 0===t&&(t=Object(n.createDeferredPromise)(),o.set(e.id,t)),t.promise}},"f+Sq":function(e,t,i){"use strict";function n(e){if(void 0===e)throw new Error("Value is undefined");return e}function r(e){if(null===e)throw new Error("Value is null");return e}Object.defineProperty(t,"__esModule",{value:!0}),t.ensureNever=t.ensure=t.ensureNotNull=t.ensureDefined=t.assert=void 0,t.assert=function(e,t){if(!e)throw new Error("Assertion failed"+(t?": "+t:""))},t.ensureDefined=n,t.ensureNotNull=r,t.ensure=function(e){return r(n(e))},t.ensureNever=function(e){}},
f3xO:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererUnicodeChar",(function(){return p}));var n=i("mrSG"),r=i("/SnT"),o=i.n(r),s=i("Eyy1"),a=i("aO4+"),l=i("2WC2"),c=i("VdBB"),u=i("Zp/P"),h=i("zDbI"),d=i("gBDZ"),p=function(e){function t(t,i){var n=e.call(this,t,i)||this;n._heightEnsured=Object(s.ensureDefined)(n._height);var r=t.char.slice(0,40);return n._ch=o()(r)[0]||" ",n._fontFamily=t.fontFamily||h.CHART_FONT_FAMILY,n._charCache=new d.b(n._ch,!1,!1,n._fontFamily,n._heightEnsured),n}return Object(n.c)(t,e),t.prototype.hitTest=function(e){for(var t=Object(u.selectionTolerance)(this._heightEnsured),i=0,n=this._items;i0?1:-1,s=i.y+i.vertOffset-o*Math.round(this._heightEnsured/2);n=i.style&&void 0!==i.style.color?i.style.color:this._color,this._charCache.paintTo(e,t,n,r,s,d.a.Center,i.vertOffset>0?d.c.Top:d.c.Bottom)},t.prototype._startPath=function(e,t,i,n){},t.prototype._endPath=function(e){},t}(l.b)},f6yo:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("hBTJ");t.pointInHalfplane=function(e,t){var i=t.edge;return i.A*e.x+i.B*e.y+i.C>0===t.isPositive},t.pointInTriangle=function(e,t,i,r){var o=t.add(i).scaled(.5).add(r).scaled(.5),s=n.intersectLineSegments(t,i,o,e);return null===s&&(null===(s=n.intersectLineSegments(i,r,o,e))&&null===(s=n.intersectLineSegments(r,t,o,e)))},t.pointInBox=function(e,t){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},t.pointInPolygon=function(e,t){for(var i=t.length-1,n=!1,r=e.x,o=e.y,s=0;s=o||l.y=o)&&a.x+(o-a.y)/(l.y-a.y)*(l.x-a.x)=t.length||e.endIndex>=t.length)return null;var i=t[e.startIndex],n=t[e.endIndex];return i===o.a||n===o.a?null:(Object(r.assert)(i<=n,"startIndex should not exceed endIndex"),{startIndex:i,endIndex:n,level:e.level,extendLeft:e.extendLeft,extendRight:e.extendRight})}function l(e,t,i){var r=Object(s.ensureTimePointIndexIndex)(i.indexOf(e.startIndex)),o=Object(s.ensureTimePointIndexIndex)(i.indexOf(e.endIndex));return Object(n.a)(Object(n.a)({id:t},e),{startIndex:r,endIndex:o})}},fJhV:function(e,t,i){"use strict";i.r(t),i.d(t,"LineDataSourceTimeAxisView",(function(){return r}));var n=i("mrSG"),r=function(e){function t(t,i){var n=e.call(this,t.model())||this;return n._active=!1,n._source=t,n._pointIndex=i,n}return Object(n.c)(t,e),t.prototype.setActive=function(e){this._active=e},t.prototype._getBgColor=function(){return this._active?"#1565C0":this._model.isDark()?"#1E88E5":"#2196F3"},t.prototype._getIndex=function(){
if(!this._model.selection().isSelected(this._source))return null;var e=this._source.axisPoints();return e.length<=this._pointIndex?null:e[this._pointIndex].index},t}(i("cgFQ").a)},fPdn:function(e,t,i){"use strict";window.TradingView=window.TradingView||{},window.requireAll=function(e){return e.keys().map(e)},i("6jKD"),i("bZMm"),i("P5fv"),i("YFKU"),i("VUhU"),i("si6p"),i("EsMY"),i("jjqu"),i("OV6q"),i("SpsL"),i("eqD+"),i("iA8Q"),i("32f0"),i("MApU"),i("w9cH").install(),i("QYoC"),i("oA7e"),i("qFKp"),i("1oAu"),i("ogJP"),i("jFln"),i("HbRj"),i("VVxS"),i("CLNU"),i("mZrn"),i("Vdly"),i("+GxX")},fTGZ:function(e,t,i){"use strict";(function(e,n,r){var o=i("Ss5c").LineDataSource,s=i("ogJP").isNumber,a=i("BOPY").BarsMarksContainerPaneView,l=i("BOPY").BarsMarksContainerRenderer,c=i("Bt3k").TooltipRenderer,u=i("LxhU").Interval,h=i("n5al").isPriceSourceStyle,d=i("txPx").getLogger("Chart.BarsMarksContainer");function p(t,i){this.toolname="Child class must override this member";var s=t._undoModel._chartWidget,a=s.onWidget(),l=!1;l=a?s._options&&!s._options.hideIdeas:!!e.enabled("bars_marks")&&TVSettings.getBool("BarsMarksContainer.visibile",!1),i?i.merge({visible:l,frozen:!1}):i=new n({visible:l,frozen:!1});var u=this;i.visible.listeners().subscribe(null,(function(t){a||s._containsData||!e.enabled("bars_marks")||TVSettings.setValue("BarsMarksContainer.visibile",!!t.value()),u._tooltip&&u._tooltip.removeAll()})),o._configureProperties(i),o.call(this,t,i),this.onNeedRepaint=new r,this._requests=[],this._marks={},this._loadedRange=null,this._getDataTimeout=null,this._collectedRange=null,this._model.mainSeries().onSymbolIntervalChanged().subscribe(this,this.clearMarks),this._model.mainSeries().dataEvents().symbolResolved().subscribe(this,this.clearMarks),this._model.mainSeries().dataEvents().tickMarksRangeChanged().subscribe(this,this.getData),this._initialize(),this.pinnedTooltips={},this._tooltip=new c(this._createTooltip.bind(this),this)}inherit(p,o),p.prototype._initialize=function(e){throw new Error("Child class must override this member")},p.prototype.onClicked=function(){throw new Error("Child class must override this member")},p.prototype._getData=function(e){throw new Error("Child class must override this member")},p.prototype._createTooltip=function(){throw new Error("Child class must override this member")},p.prototype.updateDotData=function(e,t){return t},p.prototype.updatePlateData=function(e,t){},p.prototype.isAvailableInFloatingWidget=function(){return!1},p.prototype._plateViewData=function(e){return{}},p.prototype.pinTooltip=function(e,t){this.pinnedTooltips[e]=t},p.prototype.timeScale=function(){return this._model.timeScale()},p.prototype.getIntervalInTicks=function(){var e=this._model.mainSeries().properties().interval.value(),t=u.parse(e);if(!t.isValid())throw new TypeError("Unexpected interval");return t.isRange()?60:t.inMilliseconds()/1e3},p.prototype._maxDate=Math.round(new Date(2037,0,1).getTime()/1e3),p.prototype.getVisibleTickMarksRange=function(){if(this.timeScale().isEmpty())return{start:0,end:0}
;var e,t=this.timeScale().visibleBarsStrictRange();return t.lastBar()>this.timeScale().points().firstIndex()&&t.firstBar()=t.start&&o<=t.end+i&&e.push(r)}),this),e},p.prototype.getPublishedPlates=function(){var e={},t=this;return is_authenticated?(this.getVisibleRangePlates().forEach((function(i){i.is_public&&(t.pinnedTooltips[i.id]||i.user__id===user.id)&&(e[i.id]=i)})),e):e},p.prototype._maxPlatesPerBar=10,p.prototype.filterDisplayedPlates=function(e){return e=e.reduce(function(e,t){var i=this._getIndex(t.tickmark);return e[i]=e[i]||[],e[i].push(t),e}.bind(this),{}),e=Object.keys(e).reduce(function(t,i){var n=e[i];return n=(n=n.sort((function(e,t){return t.views_count-e.views_count}))).slice(0,this._maxPlatesPerBar),t.concat(n)}.bind(this),[])},p.prototype._layout=function(e){switch(e){default:case 0:return"up";case 1:return"down";case 2:return"up";case 3:case 4:case 5:case 6:return"up"}},p.prototype._theme=function(e){switch(e){default:case 0:return"neutral";case 1:return"green";case 2:return"red";case 3:return"yellow";case 4:return"blue";case 5:return"green";case 6:return"red"}},p.prototype._offset=function(e,t,i){var n;switch(e){default:case"up":n=null===i?t[TradingView.HIGH_PLOT]:i(t);break;case"down":n=null===i?t[TradingView.LOW_PLOT]:i(t)}return this.priceScale().priceToCoordinate(n,this.ownerSource().firstValue())},p.prototype._getIndex=function(e){return this.timeScale().timePointToIndex(e)},p.prototype.getViewData=function(){return{barWidth:this.barWidth(),plates:this.getPlatesViewData(),tooltip:this._tooltip}},p.prototype.barWidth=function(){return this.timeScale().barSpacing()},p.prototype.getPlatesViewData=function(){var e=this._model.mainSeries();if(e.data().isEmpty())return[];for(var t=h(e.style())?e.barFunction():null,i=this.filterDisplayedPlates(this.getVisibleRangePlates()),n=this,r={},o=this._model.lastHittestData(),s=(i=(i=i.map(function(e){var i=this._getIndex(e.tickmark),s=this._getBar(i);if(null===s)return!1;var a,l=this._layout(e.direction),c=this._theme(e.direction),u=o&&o.id===e.id,h=this.timeScale().indexToCoordinate(i),d=this._offset(l,s,t),p=this.priceScale().isInverted();return i in r||(r[i]={up:0,down:0}),a=r[i][l]++,TradingView.merge({id:e.id,x:h,y:d,yInverted:p,order:a,direction:l,theme:c,hovered:u,pinned:!0===n.pinnedTooltips[e.id],user__id:e.user__id,label:e.label,labelFontColor:e.labelFontColor||"#444",minSize:e.minSize||5},this._plateViewData(e))}.bind(this))).filter((function(e){return!!e}))).filter((function(e){return!0===e.hovered
})),a=0;athis._loadedRange.end&&(e.start=this._loadedRange.end)),e},p.prototype._rangeUnion=function(e,t){return e=Object.assign({},e),t&&(e.start=Math.min(t.start,e.start),e.end=Math.max(t.end,e.end)),e},p.prototype._pushGetDataStack=function(e){s(e.start)&&s(e.end)?(this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._collectedRange=this._rangeUnion(e,this._collectedRange),this._getDataTimeout=setTimeout(function(){this._getData(this._collectedRange),this._getDataTimeout=this._collectedRange=null}.bind(this),300)):d.logError("Wrong tickmark range")},p.prototype.roundRange=function(e){return{start:Math.round(e.start),end:Math.round(e.end)}},p.prototype.refreshData=function(){this.getData(this._lastRange)},p.prototype.getData=function(e){s(e.start)&&s(e.end)?(this._lastRange=e,(e=Object.assign({},e)).end=this._maxDate,this._pushGetDataStack(e)):d.logError("Wrong range")},p.prototype._abortAllRequests=function(){this._requests.forEach((function(e){e.abort()})),this._requests=[],this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._getDataTimeout=this._collectedRange=null},p.prototype.clearMarks=function(){this._abortAllRequests(),this._marks={},this._loadedRange=null},t.BarsMarksContainer=p}).call(this,i("Kxc7"),i("tc+8"),i("aIyQ"))},fZEr:function(e,t,i){"use strict";i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return o}));var n=i("mrSG");function r(e,t){return Object(n.b)(this,void 0,void 0,(function(){var r;return Object(n.d)(this,(function(n){switch(n.label){case 0:return[4,Promise.all([i.e("react"),i.e(1),i.e(2),i.e(5),i.e(7),i.e(9),i.e(15),i.e(16),i.e(86),i.e(0),i.e(4),i.e(8),i.e("simple-dialog")]).then(i.bind(null,"EcUf"))];case 1:return[2,(r=n.sent()).showSimpleDialog(e,r.renameModule,t)]}}))}))}function o(e,t){return Object(n.b)(this,void 0,void 0,(function(){var r;return Object(n.d)(this,(function(n){switch(n.label){case 0:return[4,Promise.all([i.e("react"),i.e(1),i.e(2),i.e(5),i.e(7),i.e(9),i.e(15),i.e(16),i.e(86),i.e(0),i.e(4),i.e(8),i.e("simple-dialog")]).then(i.bind(null,"EcUf"))];case 1:return[2,(r=n.sent()).showSimpleDialog(e,r.confirmModule,t)]}}))}))}},fgLi:function(e,t,i){"use strict";i.r(t),i.d(t,"DataSource",(function(){return l}))
;var n=i("hY0g"),r=i.n(n),o=i("e3/o"),s=i("aIyQ"),a=i.n(s),l=function(){function e(){this.hasAlert=new r.a(!1),this._zorder=0,this.m_priceScale=null,this._id=Object(o.randomHashN)(6),this._ownerSource=null,this._userEditEnabled=!0,this._onPriceScaleChanged=new a.a,this._isSelectionEnabled=!0,this._ownerSourceChanged=new a.a}return e.prototype.id=function(){return this._id},e.prototype.preferNoScale=function(){return!1},e.prototype.idForAlert=function(){return this._id},e.prototype.setId=function(e){this._id=e},e.prototype.zorder=function(){return this._zorder},e.prototype.setZorder=function(e){"number"==typeof e&&this._zorder!==e&&(this._zorder=e)},e.prototype.title=function(){throw new Error("Implement this fun in a subclass")},e.prototype.priceScale=function(){return this.m_priceScale},e.prototype.setPriceScale=function(e){this.m_priceScale=e,this._onPriceScaleChanged.fire()},e.prototype.ownerSource=function(){return this._ownerSource},e.prototype.setOwnerSource=function(e){this._ownerSource=e,this._ownerSourceChanged.fire()},e.prototype.ownerSourceChanged=function(){return this._ownerSourceChanged},e.prototype.isSavedInChart=function(e){return!0},e.prototype.isSavedInStudyTemplates=function(){return!0},e.prototype.isRemovedByStudyTemplates=function(){return!0},e.prototype.hasContextMenu=function(){return!0},e.prototype.showInObjectTree=function(){return!0},e.prototype.setUserEditEnabled=function(e){this._userEditEnabled=e},e.prototype.userEditEnabled=function(){return this._userEditEnabled},e.prototype.canBeHidden=function(){return this.userEditEnabled()},e.prototype.isUserDeletable=function(){return this.userEditEnabled()},e.prototype.canHasAlert=function(){return!1},e.prototype.properties=function(){throw new Error("Implement this fun in a subclass")},e.prototype.isVisible=function(){return this.properties().visible.value()},e.prototype.statusView=function(){return null},e.prototype.dataWindowView=function(){return null},e.prototype.legendView=function(){return null},e.prototype.marketStatusModel=function(){return null},e.prototype.dataUpdatedModeModel=function(){return null},e.prototype.dataProblemModel=function(){return null},e.prototype.priceAxisViews=function(e,t){return null},e.prototype.updateAllViews=function(){},e.prototype.paneViews=function(){return null},e.prototype.labelPaneViews=function(){return null},e.prototype.isFailed=function(){return!1},e.prototype.isLoading=function(){return!1},e.prototype.isPhantom=function(){return!1},e.prototype.isChildStudy=function(){return!1},e.prototype.hasChildren=function(){return!1},e.prototype.canHaveChildren=function(){return!1},e.prototype.onClickOutside=function(){},e.prototype.getInputsPropertyPage=function(){return null},e.prototype.getStylesPropertyPage=function(){return null},e.prototype.getDisplayPropertyPage=function(){return null},e.prototype.getVisibilitiesPropertyPage=function(){return null},e.prototype.getSourceIcon=function(){return null},e.prototype.state=function(e){throw new Error("Implement this fun in a subclass")},
e.prototype.onPriceScaleChanged=function(){return this._onPriceScaleChanged},e.prototype.doesMovingAffectsUndo=function(){return!0},e.prototype.isMultiPaneAvailable=function(){return!1},e.prototype.isMultiPaneEnabled=function(){return!1},e.prototype.copiable=function(){return!1},e.prototype.cloneable=function(){return!1},e.prototype.movable=function(){return!1},e.prototype.isIncludedInAutoScale=function(){return!1},e.prototype.isHoveredEnabled=function(){return this.isSelectionEnabled()},e.prototype.isSelectionEnabled=function(){return this._isSelectionEnabled},e.prototype.setSelectionEnabled=function(e){this._isSelectionEnabled=e},e.prototype.priceRange=function(e,t){return null},e.prototype.autoScaleInfo=function(e,t){return{range:this.priceRange(e,t)}},e}()},fs3R:function(e,t){e.exports=''},fxzW:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererDiamond",(function(){return s}));var n=i("mrSG"),r=i("2WC2"),o=i("aO4+"),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype._drawItemShapeUsingCSSPixels=function(e,t){var i=Math.round(t.height/2),n=t.x,r=t.vertOffset,o=t.y+r;e.moveTo(n,o-i),e.lineTo(n+i,o),e.lineTo(n,o+i),e.lineTo(n-i,o),e.lineTo(n,o-i)},t.prototype._calcBoundingBox=function(t){var i=Math.round(t.height/2),n=t.x,r=t.vertOffset,s=t.y+r,a=n-i,l=n+i,c=s-i,u=s+i,h=new o.Point(a,c),d=new o.Point(l,u),p=Object(o.box)(h,d),f=e.prototype._calcBoundingBox.call(this,t);return f&&(p=this._unionBox(p,f)),p},t}(r.a)},g5Qf:function(e,t,i){"use strict";i.r(t),i.d(t,"getFavoriteDrawingToolbarPromise",(function(){return s})),i.d(t,"createFavoriteDrawingToolbar",(function(){return a}));i("YFKU");var n=i("yMne"),r=null,o=null;function s(){return o}function a(){null===o&&(o=new Promise((function(e){Promise.all([i.e(34),i.e(43),i.e(67),i.e(81),i.e(18),i.e(32),i.e("line-tools-icons"),i.e(39),i.e(51),i.e(60),i.e("floating-toolbars")]).then(function(t){if(null===r){var o=i("gmn6").FavoriteDrawingToolbar;r=new o({left:window.innerWidth/2,top:n.HEADER_TOOLBAR_HEIGHT_EXPANDED+61}),e(r)}}.bind(null,i)).catch(void 0)})))}},gASG:function(e,t,i){"use strict";i.r(t);var n=i("mrSG"),r=i("Eyy1"),o=i("Ocx9"),s=i("jvrd"),a=i("Ss5c"),l=i("tc+8"),c=i.n(l),u=i("mMWL"),h=i("aIyQ"),d=i.n(h),p=function(){function e(e){this._image=null,this._currentImageURL=null,this._imageReady=!1,this._ready=new d.a,this._source=e,this.updateImage()}return e.prototype.updateImage=function(){var e=this,t=this.imageURL();this._currentImageURL!==t&&(this._currentImageURL=t,this._image=null,null!==this._currentImageURL&&(this._image=new Image,this._image.onload=function(){e._imageReady=!0,e._ready.fire()},this._image.src=this._currentImageURL))},e.prototype.itemIndex=function(){return 1},
e.prototype.labelIndex=function(){return 0},e.prototype.image=function(){return this._imageReady&&this.showPlate()?this._image:null},e.prototype.showPlate=function(){return this._props().childs().showImage.value()},e.prototype.backgroundPlateColor=function(e){return this._props().childs().plateColor.value()},e.prototype.ready=function(){return this._ready},e.prototype.type=function(){return this._props().childs().itemType.value()},e.prototype.category=function(){return 1},e.prototype.time=function(){return 0},e.prototype.index=function(){var e=this._source.points();return 0===e.length?null:e[0].index},e.prototype.imageURL=function(){return this._props().childs().imageURL.value()},e.prototype.sourceImage=function(){return null},e.prototype.additionalImageURL=function(){return null},e.prototype.additionalImageSource=function(){return null},e.prototype.name=function(){return""},e.prototype.headline=function(){return this._props().childs().text.value()},e.prototype.text=function(){return""},e.prototype.fullTextAst=function(){return null},e.prototype.position=function(){return this._props().childs().position.value()},e.prototype.fontSize=function(){return this._props().childs().fontSize.value()},e.prototype.fontBold=function(){return this._props().childs().bold.value()},e.prototype.fontItalic=function(){return this._props().childs().italic.value()},e.prototype._props=function(){return this._source.properties()},e}(),f=function(e){function t(t){var i=e.call(this)||this;return i._source=t,t.pointAdded().subscribe(i,(function(){return i.listeners().fire(i)})),t.pointChanged().subscribe(i,(function(){return i.listeners().fire(i)})),i}return Object(n.c)(t,e),t.prototype.value=function(){var e=this._source.properties().childs().position.value();return parseFloat(e.toFixed(2))},t.prototype.setValue=function(e){this._source.properties().childs().position.setValue(e),this._source.model().updateSource(this._source),this.listeners().fire(this),this._source.syncMultichartState({pricesChanged:!1,indexesChanged:!1}),this._source.updateLastUpdateTime()},t}(c.a),_=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._source=t,n}return Object(n.c)(t,e),t.prototype._setPointImpl=function(e){this._source.setPointAndChangeIndex(this._pointIndex,e)},t}(i("j8de").a),m=i("j3hX");i.d(t,"LineToolSignpost",(function(){return v}));var v=function(e){function t(n,r){var o=this,s=r||t.createProperties();return(o=e.call(this,n,s)||this)._item=new p(o),o._startMovingAnchorY=NaN,o.properties().childs().imageURL.subscribe(o,(function(){return o._item.updateImage()})),i.e("lt-pane-views").then(i.bind(null,"KFbh")).then((function(e){o._setPaneViews([new e.SignpostPaneView(o,n)])})),o}return Object(n.c)(t,e),t.prototype.isItemHovered=function(e){return!1},t.prototype.isItemSelected=function(e){return!1},t.prototype.isHidden=function(e){return!1},t.prototype.items=function(){return[this.customEvent()]},t.prototype.priceSource=function(){return this.ownerSource()},t.prototype.pointsCount=function(){return 1},t.prototype.addPoint=function(t,i,n){
return e.prototype.addPoint.call(this,this._updatePositionAndCorrectPoint(t),i,n)},t.prototype.setPoint=function(t,i,n){e.prototype.setPoint.call(this,t,this._updatePositionAndCorrectPoint(i,!this.isPhantom()),n),this._syncPosition()},t.prototype.setPointAndChangeIndex=function(t,i,n){e.prototype.setPoint.call(this,t,this._updatePositionAndCorrectPoint(i,!1),n),this._syncPosition()},t.prototype.startMoving=function(t,i,n){this._startMovingAnchorY=Object(r.ensureNotNull)(this._anchorYCoordinate()),e.prototype.startMoving.call(this,t,i,n)},t.prototype.move=function(t,i,n){var o;if(0===i){var s=this._points[0],a=Object(r.ensureDefined)(Object(r.ensureNotNull)(this.startMovingPoint()).logical),l=Object(r.ensureDefined)(t.logical),c=l.index-a.index,u=Object(r.ensureNotNull)(this.priceScale()),h=Object(r.ensure)(null===(o=this.ownerSource())||void 0===o?void 0:o.firstValue()),d=u.priceToCoordinate(l.price,h)-u.priceToCoordinate(a.price,h),p=this._startMovingAnchorY+d,f=u.coordinateToPrice(p,h);this._updatePositionAndCorrectPoint({index:s.index+c,price:f})}e.prototype.move.call(this,t,i,n),this._syncPosition()},t.prototype.properties=function(){return e.prototype.properties.call(this)},t.prototype.name=function(){return"Signpost"},t.prototype.customEvent=function(){return this._item},t.prototype.showInObjectTree=function(){return!this.isPhantom()&&e.prototype.showInObjectTree.call(this)},t.prototype.isPhantom=function(){return this._model.isPhantomLine(this)},t.prototype.clonePositionOffset=function(){return{barOffset:1,xCoordOffset:0,yCoordOffset:0}},t.prototype.template=function(){var t=e.prototype.template.call(this),i=this.properties().childs();return t.text=i.text.value(),t.position=i.position.value(),t},t.createProperties=function(e){var i=new o.DefaultProperty("linetoolsignpost",e);return t._configureProperties(i),i.hasChild("text")||i.addChild("text",new c.a(window.t("Text"))),i.hasChild("position")||i.addChild("position",new c.a(50)),i.addExclusion("text"),i.addExclusion("position"),i.addChild("backgroundsColors",new m.LineToolColorsProperty([i.childs().plateColor])),i},t.prototype._createPointProperty=function(t){e.prototype._createPointProperty.call(this,t);var i=this._pointsProperty.childs().points[t];i.removeProperty("price"),i.removeProperty("bar"),i.addChild("price",new f(this)),i.addChild("bar",new _(this,0))},t.prototype._applyTemplateImpl=function(t){e.prototype._applyTemplateImpl.call(this,t),this.properties().childs().text.setValue(t.text),this.properties().childs().position.setValue(t.position)},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"zb1A")).then((function(e){return e.SignpostDefinitionsViewModel}))},t._configureProperties=function(e){a.LineDataSource._configureProperties(e)},t.prototype._updatePositionAndCorrectPoint=function(e,t){t&&(e.index=this._points[0].index);var i=this.priceSource();if(null===i)return e;var n=i.priceScale(),r=i.firstValue();if(null===n||n.isEmpty()||null===r)return e
;var o=n.height(),a=o/2,l=e.price>=n.coordinateToPrice(a,r)?1:-1,c=this._model.mainSeries();if(i===c){var u=c.data().search(e.index);if(null!==u){var h=Object(s.e)(c,u,-1),d=Object(s.e)(c,u,1);l=e.price>=h?1:-1,a=n.priceToCoordinate(1===l?d:h,r),e.price=1===l?Math.max(d,e.price):e.price}}var p=1===(-1===l!==n.isInverted()?-1:1)?a:o-a,f=n.priceToCoordinate(e.price,r),_=Math.min(o,Math.abs(f-a)),m=Math.max(0,Math.min(100,100*_/p))*l;return this.properties().childs().position.setValue(m),e},t.prototype._syncPosition=function(){if(this.linkKey){var e={position:this.properties().childs().position.value()};Object(u.changeLineStyle)({linkKey:this.linkKey,state:e,model:this._model})}},t.prototype._anchorYCoordinate=function(){var e=this.priceSource();if(null===e)return null;var t=e.priceScale(),i=e.firstValue();if(null===t||t.isEmpty()||null===i)return null;var n=this._model.mainSeries(),r=this.customEvent(),o=null;if(e===n&&(o=Object(s.d)(n,r)),null===o&&(o=Object(s.a)(r,t,i)),null===o)return null;var a=r.position(),l=t.priceToCoordinate(o.price,i);return Object(s.b)(a,t.height(),l,Object(s.c)(a,t.isInverted()))},t.supportPhantomMode=!0,t}(a.LineDataSource)},gAom:function(e,t,i){"use strict";function n(e,t,i,n,r,o,s){e.save(),e.globalCompositeOperation="copy";var a=e.createLinearGradient(0,0,0,r);a.addColorStop(0,o),a.addColorStop(1,s),e.fillStyle=a,e.fillRect(t,i,n,r),e.restore()}function r(e,t,i,n,r,o){e.fillRect(t+o,i,n-2*o,o),e.fillRect(t+o,i+r-o,n-2*o,o),e.fillRect(t,i,o,r),e.fillRect(t+n-o,i,o,r)}function o(e,t,i,n){e.beginPath();var r=e.lineWidth%2?.5:0;e.moveTo(i,t+r),e.lineTo(n,t+r),e.stroke()}function s(e,t,i,n){e.beginPath();var r=e.lineWidth%2?.5:0;e.moveTo(t+r,i),e.lineTo(t+r,n),e.stroke()}i.r(t),i.d(t,"clearRectWithGradient",(function(){return n})),i.d(t,"fillRectInnerBorder",(function(){return r})),i.d(t,"drawHorizontalLine",(function(){return o})),i.d(t,"drawVerticalLine",(function(){return s}))},gBDZ:function(e,t,i){"use strict";i.d(t,"a",(function(){return n})),i.d(t,"c",(function(){return r})),i.d(t,"b",(function(){return c}));var n,r,o=i("Eyy1"),s=i("XlJ7"),a=i("c44N"),l=i("ikwP");!function(e){e.Left="left",e.Right="right",e.Center="center"}(n||(n={})),function(e){e.Top="top",e.Bottom="bottom",e.Middle="middle"}(r||(r={}));var c=function(){function e(e,t,i,n,r,a){void 0===a&&(a="center"),this._cacheRenderParams=null,this._canvasesMap={},this._lines=e.split(/[^\S\r\n]*(?:\r\n|\r|\n)/),this._font=function(e,t,i,n){return Object(s.makeFont)(n,i,(e?"bold ":"")+(t?"italic ":""))}(t,i,n,r),this._fontSize=r,this._verticalPadding=~~(r/6),this._textAlign=a;var c=Object(l.createDisconnectedCanvas)(document,new l.Size(0,0),1),u=Object(o.ensureNotNull)(c.getContext("2d"));u.font=this._font;for(var h=0,d=0,p=this._lines;dt.code?1:0}var R=function(){function e(e){this._convertibleItems=e,this._idsToItems=new Map;for(var t=0,i=e;t0){var i=this._strategySources[this._strategySources.length-1];this.setActiveStrategySource(i)}this._strategySourcesChange.fire()}},e.prototype.setActiveStrategySource=function(e){-1!==this._strategySources.indexOf(e)&&this._activeStrategySource.setValue(e)},e.prototype.unsetActiveStrategySource=function(){this._activeStrategySource.setValue(null)},e.prototype.activeStrategySource=function(){return this._activeStrategySource},e.prototype.strategySources=function(){return this._strategySources},e.prototype.strategySourcesChange=function(){return this._strategySourcesChange},e.prototype.setScrollEnabled=function(e){this._scrollEnabled=e},e.prototype.scrollEnabled=function(){return this._scrollEnabled},e.prototype.setZoomEnabled=function(e){this._zoomEnabled=e},e.prototype.zoomEnabled=function(){return this._zoomEnabled},e.prototype.onTagsChanged=function(){return this._tagsChanged},e.prototype.canZoomIn=function(){return this._timeScale.canZoomIn()&&this._zoomEnabled},e.prototype.canZoomOut=function(){return this._timeScale.canZoomOut()&&this._zoomEnabled},e.prototype.onPaneTagsChanged=function(){this._tagsChanged.fire()},e.prototype.panesCollectionChanged=function(){return this._panesCollectionChanged},e.prototype.dataSourceCollectionChanged=function(){return this._dataSourceCollectionChanged},e.prototype.sourceProperitesChanged=function(){return this._sourceProperitesChanged},
e.prototype.updateCrosshair=function(){var e=this.crossHairSource(),t=e.pane;if(null!==t){var i=e.originCoordX(),n=e.originCoordY();this.setAndSaveCurrentPosition(i,n,t)}},e.prototype.zoomTime=function(e,t,i){if(this._zoomEnabled){var n=this.timeScale();if(!n.isEmpty()&&0!==t){var r=n.width();e=Math.max(1,Math.min(e,r-2)),n.zoom(e,t,i),this.updateCrosshair(),this.recalculateAllPanes(),this.lightUpdate(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudies(),this._setScalesResetAvailable(!0)}}},e.prototype.linePointBeingEdited=function(){return this._linePointBeingEdited},e.prototype.linePointBeingChanged=function(){return this._linePointBeingChanged},e.prototype.dataSources=function(){for(var e=[this.crossHairSource()],t=0,i=this._panes;t=0;t--)if(this._panes[t].hasDataSource(e))return this._panes[t];return e instanceof V.BarsMarksContainer?this.paneForSource(this.mainSeries()):null},e.prototype.findNonOverlayStudyWithGroupingKey=function(e,t){for(var i=function(t){var i=t.dataSources().find((function(i){return Object(_.isStudy)(i)&&i.metaInfo().groupingKey===e&&!t.isOverlay(i)}));if(void 0!==i)return{value:{pane:t,study:i}}},n=0,r=void 0!==t?[t]:this._panes;n=0&&e1)return void t.setValue(!1)}t.setValue(!0)}},e.prototype._pointToPercentPosition=function(e,t){return{x:e.x/this._timeScale.width(),y:e.y/Object(r.ensureNotNull)(Object(r.ensureNotNull)(t.mainDataSource()).priceScale()).height()}},e.prototype._percentPositionToPoint=function(e,t){var i=e.x*this._timeScale.width(),n=e.y*Object(r.ensureNotNull)(Object(r.ensureNotNull)(t.mainDataSource()).priceScale()).height();return new o.Point(i,n)},e.prototype._recalcVisibleRangeStudiesImpl=function(e){if(e.timerId=null,!this.timeScale().isEmpty()){var t=this.timeScale().visibleBarsStrictRange();if(null!==t){var i=this.mainSeries().nearestData(t.firstBar(),F.PlotRowSearchMode.NearestRight),n=this.mainSeries().nearestData(t.lastBar(),F.PlotRowSearchMode.NearestLeft),r=this.mainSeries().bars().lastIndex(),o=i?i.index:void 0,s=n?n.index:void 0,a=o===e.oldStartVisibleIndex,l=s===e.oldEndVisibleIndex;if(!a||!l||e.force){e.force=!1,e.oldStartVisibleIndex=void 0!==o?o:NaN,e.oldEndVisibleIndex=void 0!==s?s:NaN;var c={first_visible_bar_time:1e3*Math.floor(i&&i.value?i.value[0]:0),last_visible_bar_time:1e3*Math.floor(n&&n.value?n.value[0]:0),subscribeRealtime:n&&n.index===r},u=e.studies||this.priceDataSources();e.studies=void 0;for(var h=0,d=u;h0&&g.listeners().fire(g)}}}}}},e.prototype._getAvailableCurrencies=function(){var e=this;return this._options.currencyConversionEnabled?Object(k.isArray)(this._availableCurrenciesList)?this._availableCurrenciesList:(null!==this._availableCurrenciesList||(this._availableCurrenciesList=this.chartApi().availableCurrencies(),this._availableCurrenciesList.then((function(t){e._destroyed||(e._availableCurrenciesList=t,e.lightUpdate())})).catch((function(e){W.logWarn("An error occurred while getting available currencies: "+e)}))),[]):[]},e.prototype._getBackgroundColor=function(e){var t=this._properties.childs().paneProperties.childs();if(t.backgroundType.value()===D.ColorType.Gradient){var i=t.backgroundGradientStartColor.value(),n=t.backgroundGradientEndColor.value();return e?i:n}return t.background.value()},e.prototype._updateBackgroundColor=function(){this._backgroundColor.setValue(this._getBackgroundColor()),this._backgroundTopColor.setValue(this._getBackgroundColor(!0))},e}()},gQ5K:function(e,t,i){"use strict";i.r(t),i.d(t,"DateFormatter",(function(){return o}));var n=i("kcTO"),r=i("e1ZQ"),o=function(){
function e(e){void 0===e&&(e="yyyy-MM-dd"),this._dateFormatFunc=r.b[e]}return e.prototype.format=function(e){return n.customFormatters&&n.customFormatters.dateFormatter?n.customFormatters.dateFormatter.format(e):this._dateFormatFunc(e,!1)},e.prototype.formatLocal=function(e){return n.customFormatters.dateFormatter?n.customFormatters.dateFormatter.formatLocal?n.customFormatters.dateFormatter.formatLocal(e):n.customFormatters.dateFormatter.format(e):this._dateFormatFunc(e,!0)},e}()},gTEF:function(e,t,i){"use strict";i.r(t),i.d(t,"SelectionRendererArrowsUpDown",(function(){return a}));var n=i("mrSG"),r=i("Eyy1"),o=i("vq8G"),s=i("6Fc/"),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype._drawMarker=function(e,t,i,n,o){var a=Object(r.ensureNotNull)(this._data),l=t.isUp?1:-1,c=i+l*Object(s.calculateVerticalOffset)(a.barSpacing)+l*Object(s.calculateMinHeight)(a.barSpacing),u=Math.round(3.5*o*2);u%2!=n%2&&(u+=1);var h=n%2/2,d=Math.round(t.x*o)+h,p=Math.round((t.y+c)*o)+h;e.beginPath(),e.arc(d,p,u/2,0,2*Math.PI,!0),e.closePath(),e.fill(),e.stroke()},t}(o.SelectionRenderer)},gVWb:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererBackground",(function(){return n}));var n=function(){function e(e){this._data=e}return e.prototype.draw=function(e,t){},e.prototype.drawBackground=function(e,t){e.save();for(var i=this._data,n=t.pixelRatio,r=null,o=Math.round(this._data.w*n),s=0;s0)i.items[s-1].index===a.index-1&&null!==r&&(c=r+1);var u=l+o,h=u-c+1;e.fillRect(c,Math.round(i.y*n),h,Math.round(i.h*n)),r=u}else r=null}e.restore()},e.prototype.hitTest=function(e){return null},e}()},gWck:function(e,t,i){"use strict";i.r(t),i.d(t,"SeriesLegendView",(function(){return a}));var n=i("mrSG"),r=i("cXAR"),o=i("C2K+"),s=window.t("At close"),a=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._showBarChange=i.properties().paneProperties.legendProperties.showBarChange,n._showSeriesOHLC=i.properties().paneProperties.legendProperties.showSeriesOHLC,n._showBarChange.subscribe(n,n.update),n._showSeriesOHLC.subscribe(n,n.update),n}return Object(n.c)(t,e),t.prototype.isValuesVisible=function(){return this._showSeriesOHLC.value()||this._showBarChange.value()},t.prototype.additional=function(){return null},t.prototype.marketTitle=function(){var e=this._series.marketStatusModel().status().value();return this._showLastPriceAndChangeOnly()&&("pre_market"===e||"post_market"===e)?s+":":""},t.prototype.destroy=function(){this._showBarChange.unsubscribeAll(this),this._showSeriesOHLC.unsubscribeAll(this)},t.prototype._createValuesProvider=function(e,t){return new o.a(e,t)},t}(r.SeriesDataWindowView)},gWrr:function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return o}));var n=new WeakMap;function r(e,t){var i,r;return i=null==t?document.documentElement:9===t.nodeType?t.documentElement:t,n&&(r=n.get(i)),
r||((r=i.ownerDocument.createRange()).selectNodeContents(i),n&&n.set(i,r)),r.createContextualFragment(e)}function o(e,t){var i,n=r(e,t);if("firstElementChild"in n)i=n.firstElementChild;else{i=null;for(var o=0;o2;){var d=Math.round((h+u)/2);this.items[d].x<=e.x?u=d:h=d}u=Math.max(1,u-1),h=Math.min(this.items.length-1,h+1);for(var p=u;p<=h;++p)if(t=this.items[p-1],i=this.items[p],a=t.x,l=i.x,r(new n(a,t.y),new n(l,i.y),new n(e.x,e.y)).distance<=c)return this.hittest?this.hittest:new s(s.REGULAR);return null},t.PaneRendererLine=TradingView.PaneRendererLine=l},gzUS:function(e,t,i){"use strict";i.r(t),i.d(t,"PointsetsManager",(function(){return s}));var n=i("LxhU"),r=i("txPx"),o=Object(r.getLogger)("ChartApi.PointsetsManager"),s=function(){function e(){this._pointsetsDataBySymbol=new Map}return e.prototype.destroy=function(){this._pointsetsDataBySymbol.clear()},e.prototype.createPointset=function(e,t,i,n,r){var s=this._pointsetsDataBySymbol.get(t);void 0===s&&(s=new Map,this._pointsetsDataBySymbol.set(t,s));for(var a=[],l=0,c=n;l "+t),null;c.push({index:r,value:[h,u.extrapolation.timeMs/1e3]})}return c},e}()},h24c:function(e,t,i){"use strict";i.r(t),i.d(t,"parseIntervalValue",(function(){return c})),i.d(t,"intervalIsSupported",(function(){return u})),i.d(t,"canShowSpreadActions",(function(){return h})),i.d(t,"globalKeypressMatches",(function(){return d})),i.d(t,"skipAccept",(function(){return p})),i.d(t,"syncSymbolSearch",(function(){return f})),i.d(t,"setLinkingResolution",(function(){return _}))
;var n=i("Kxc7"),r=i("pPtI"),o=i("PT1i"),s=i("LxhU"),a=i("ePL1"),l=new RegExp("^"+a.types.QUANDL,"i");function c(e){var t=/^[,\s]*(\d*)\s*([hdwmst]?)\s*$/i.exec(e)||[],i=~~t[1],n=t[2]&&t[2].toUpperCase()||null,r={qty:!i&&n?1:i,unit:n};return r.error=!i&&!n,r.intraday=!(r.error||r.unit&&"H"!==r.unit&&"S"!==r.unit&&"T"!==r.unit),r}function u(e){if(n.enabled("allow_supported_resolutions_set_only")){var t=s.Interval.normalize(e);return null!==t&&Object(r.isAvailable)(t)}var i=c(e);if(i.error)return!1;if(i.intraday)return o.linking.intraday.value();var a=o.linking.supportedResolutions.value();return!a||null!==i.unit&&!!~a.indexOf(i.unit)}function h(){return!1}function d(e){return!e.ctrlKey&&(!e.metaKey&&(!!e.charCode&&(!(!e.which||e.which<=32)&&(null===e.target||!/^(input|textarea)$/i.test(e.target.tagName)))))}function p(e,t){return!t&&(e===o.linking.symbol.value()||e===o.linking.seriesShortSymbol.value())}function f(e,t){var i=o.linking.symbol.value()||"";i=function(e,t){if(!t)return e;if(l.test(e)){var i=e.split(/\//);i.length&&(e=i[i.length-1])}else e=o.linking.seriesShortSymbol.value()||e;return e}(i,t),e.val(i)}function _(e){Object(r.setLastUsedResolution)(e),o.linking.interval.setValue(e)}},hBTJ:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("Eyy1"),r=i("aO4+"),o=i("GEp6"),s=i("f6yo");function a(e,t){var i=e.A,n=t.A,o=e.B,s=t.B,a=e.C,l=t.C,c=i*s-n*o;if(Math.abs(c)<1e-6)return null;var u=(o*l-s*a)/c,h=(n*a-i*l)/c;return new r.Point(u,h)}function l(e,t,i,n){var r=function(e,t,i,n){var r=t.subtract(e),o=n.subtract(i),s=r.x*o.y-r.y*o.x;if(Math.abs(s)<1e-6)return null;var a=e.subtract(i);return(a.y*o.x-a.x*o.y)/s}(e,t,i,n);if(null===r)return null;var s=t.subtract(e).scaled(r).add(e),a=o.distanceToSegment(i,n,s);return Math.abs(a.distance)<1e-6?r:null}function c(e,t){for(var i=0,n=e;i0&&r.equalPoints(e[e.length-1],t))&&(e.push(t),!0)}function h(e,t){for(var i=[],n=0;n=3?i:null}t.intersectLineSegmentAndBox=function(e,t){var i=e[0].x,n=e[0].y,o=e[1].x,s=e[1].y,a=t.min.x,l=t.min.y,c=t.max.x,u=t.max.y;function h(e,t,i,n,r,o){var s=0;return er&&(s|=2),to&&(s|=8),s}for(var d=h(i,n,a,l,c,u),p=h(o,s,a,l,c,u),f=!1,_=0;;){if(_>1e3)throw new Error("Cohen - Sutherland algorithm: infinity loop");if(_++,!(d|p)){f=!0;break}if(d&p)break;var m=d||p,v=void 0,y=void 0;8&m?(v=i+(o-i)*(u-n)/(s-n),y=u):4&m?(v=i+(o-i)*(l-n)/(s-n),y=l):2&m?(y=n+(s-n)*(c-i)/(o-i),v=c):(y=n+(s-n)*(a-i)/(o-i),v=a),m===d?d=h(i=v,n=y,a,l,c,u):p=h(o=v,s=y,a,l,c,u)}return f?r.equalPoints(r.point(i,n),r.point(o,s))?r.point(i,n):r.lineSegment(r.point(i,n),r.point(o,s)):null},t.intersectLines=a,t.intersectLineSegments=l,t.intersectLineAndBox=function(e,t){
var i=t.min.x,o=t.min.y,s=t.max.x,a=t.max.y;if(0===e.A){var l=-e.C/e.B;return o<=l&&l<=a?r.lineSegment(r.point(i,l),r.point(s,l)):null}if(0===e.B){var u=-e.C/e.A;return i<=u&&u<=s?r.lineSegment(r.point(u,o),r.point(u,a)):null}var h=[],d=function(t){var i=function(e,t){return-(e.C+e.A*t)/e.B}(e,t);o<=i&&i<=a&&c(h,new r.Point(t,i))},p=function(t){var n=function(e,t){return-(e.C+e.B*t)/e.A}(e,t);i<=n&&n<=s&&c(h,new r.Point(n,t))};switch(d(i),p(o),d(s),p(a),h.length){case 0:return null;case 1:return h[0];case 2:return r.equalPoints(h[0],h[1])?h[0]:r.lineSegment(h[0],h[1])}return n.assert(!1,"We should have at most two intersection points"),null},t.intersectRayAndBox=function(e,t,i){var n=l(e,t,i.min,new r.Point(i.max.x,i.min.y)),o=l(e,t,new r.Point(i.max.x,i.min.y),i.max),a=l(e,t,i.max,new r.Point(i.min.x,i.max.y)),c=l(e,t,new r.Point(i.min.x,i.max.y),i.min),u=[];if(null!==n&&n>=0&&u.push(n),null!==o&&o>=0&&u.push(o),null!==a&&a>=0&&u.push(a),null!==c&&c>=0&&u.push(c),0===u.length)return null;u.sort((function(e,t){return e-t}));var h=s.pointInBox(e,i)?u[0]:u[u.length-1];return e.addScaled(t.subtract(e),h)},t.intersectPolygonAndHalfplane=h,t.intersectPolygons=function(e,t){for(var i=e,n=0;n0){var d=this._points[this._points.length-1],p=this._model.timeScale().indexToCoordinate(d.index),f=d.price,_=a.priceToCoordinate(f,u);if(new o.Point(l,h).subtract(new o.Point(p,_)).length()<5)return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0
;var m=this._points[0],v=this._model.timeScale().indexToCoordinate(m.index),y=m.price,g=a.priceToCoordinate(y,u);if(new o.Point(l,h).subtract(new o.Point(v,g)).length()<5)return this.properties().childs().filled.setValue(!0),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}return e.prototype.addPoint.call(this,t,i,n)},t.prototype.setPoint=function(t,i,n){var s;e.prototype.setPoint.call(this,t,i,n);var a=this.priceScale();if(!(this._model.timeScale().isEmpty()||null===a||a.isEmpty()||t!==this._points.length-1&&0!==t)){var l=Object(r.ensure)(null===(s=this.ownerSource())||void 0===s?void 0:s.firstValue()),c=this._model.timeScale().indexToCoordinate(i.index),u=a.priceToCoordinate(i.price,l),h=t===this._points.length-1?this._points[0]:this._points[this._points.length-1],d=this._model.timeScale().indexToCoordinate(h.index),p=a.priceToCoordinate(h.price,l);new o.Point(c,u).subtract(new o.Point(d,p)).length()<5&&this.properties().childs().filled.setValue(!0)}},t.createProperties=function(e){var i=new s.DefaultProperty("linetoolpolyline",e);return t._configureProperties(i),i},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"91EF")).then((function(e){return e.PolylinesDefinitionsViewModel}))},t._configureProperties=function(e){a.LineDataSource._configureProperties(e),e.addExclusion("filled")},t}(a.LineDataSource)},hY0g:function(e,t,i){"use strict";(function(e){var t=i("txPx").getLogger("Common.WatchedValue");function n(){}function r(e){if(!(this instanceof r))return new r(e);arguments.length>0&&(this._value=e),this._listeners=[]}r.prototype.value=function(){return this._owner?this._owner._value:this._value},r.prototype.setValue=function(e,i){var n=this._owner?this._owner:this;if("function"==typeof n.hook&&(e=n.hook(e)),n.writeLock)return n._value;if(!i&&n._value===e&&n.hasOwnProperty("_value"))return e;n._value=e;for(var r=n._listeners.slice(),o=0,s=0;s=1&&t.multiplier()<=15?"1D":"1W";case r.ResolutionKind.Seconds:case r.ResolutionKind.Ticks:return"1D"}throw new Error("Unexpected resolution type: "+e.symbol.resolution)}(e);case"Daily":return"1D";case"Weekly":return"1W";case"Monthly":return"1M";case"Yearly":return"12M";default:throw new Error("No such pivTimeFrame: "+t)}}var u={name:"Pivot Points Standard",metainfo:{_metainfoVersion:44,defaults:{inputs:{kind:"Traditional",lookBack:15,pivTimeFrame:"Auto",showHistoricalPivots:!0},precision:"4"},description:"Pivot Points Standard",id:"PivotPointsStandard@tv-basicstudies-80",inputs:[{defval:"Traditional",id:"kind",name:"Type",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"],type:"text"},{defval:!0,id:"showHistoricalPivots",name:"Show historical pivots",type:"bool"},{defval:"Auto",id:"pivTimeFrame",name:"Pivots Timeframe",
options:["Auto","Daily","Weekly","Monthly","Yearly"],type:"text"},{defval:15,id:"lookBack",max:5e3,min:2,name:"Number of Pivots Back",type:"integer"}],is_price_study:!0,linkedToSeries:!0,shortDescription:"Pivots"},constructor:function(){function e(){this._secondaryRes="1D",this._firstMainSeriesBarTime=NaN}return e.prototype.init=function(e,t){var i=t(0),r=t(1),o=t(2),a=t(3);this._data=new s,this._firstMainSeriesBarTime=NaN,this._kindPP=function(e){switch(e){case"Traditional":return 0;case"Fibonacci":return 1;case"Woodie":return 2;case"Classic":return 3;case"DeMark":return 4;case"Camarilla":return 5;default:throw new Error("Unknown kind "+e)}}(i),this._showHistoricalPivots=r,this._historicalPivotsToKeep=a,this._pivTimeFrame=o,this._isValidResolution=function(e,t){return(!n.Std.isdaily(e)||"Daily"!==t)&&((!n.Std.isweekly(e)||"Daily"!==t&&"Weekly"!==t)&&(!n.Std.ismonthly(e)||"Daily"!==t&&"Weekly"!==t&&"Monthly"!==t))}(e,this._pivTimeFrame),this._isValidResolution||n.Std.error("You cannot see this pivot timeframe on this resolution"),this._isValidResolution&&(this._secondaryRes=c(e,this._pivTimeFrame)),e.new_sym(e.symbol.tickerid,this._secondaryRes)},e.prototype.main=function(e){if(!this._isValidResolution)return null;if(e.symbol.time)return isNaN(this._firstMainSeriesBarTime)&&(this._firstMainSeriesBarTime=e.symbol.time,this._removeUnusedPivots()),e.symbol.isLastBar&&e.symbol.isNewBar?this._createResponse():null;e.select_sym(1);var t=e.new_var(n.Std.open(e)),i=e.new_var(n.Std.high(e)),r=e.new_var(n.Std.low(e)),s=e.new_var(n.Std.close(e)),a=e.new_var(n.Std.time(e)),c=this._data,u=t.get(0),h=a.get(0),d=t.get(1),p=i.get(1),f=r.get(1),_=s.get(1),m=e.symbol.isLastBar;if(0!==c.pivots.length&&e.symbol.isNewBar){var v=c.pivots[c.pivots.length-1];v.endIndex__t!==h&&(v.endIndex__t=h)}if(0===e.symbol.index||!e.symbol.isNewBar)return e.select_sym(0),null;var y=function(e,t,i,r,s,a,l,c){var u=new o,h=NaN,d=i-r;switch(c){case 0:h=(i+r+s)/3,u.p=h,u.r1=2*h-r,u.s1=2*h-i,u.r2=h+(i-r),u.s2=h-(i-r),u.r3=2*h+(i-2*r),u.s3=2*h-(2*i-r),u.r4=3*h+(i-3*r),u.s4=3*h-(3*i-r),u.r5=4*h+(i-4*r),u.s5=4*h-(4*i-r);break;case 1:h=(i+r+s)/3,u.p=h,u.r1=h+.382*d,u.s1=h-.382*d,u.r2=h+.618*d,u.s2=h-.618*d,u.r3=h+d,u.s3=h-d;break;case 2:h=(i+r+2*e)/4,u.p=h,u.r1=2*h-r,u.s1=2*h-i,u.r2=h+d,u.s2=h-d,u.r3=i+2*(h-r),u.s3=r-2*(i-h),u.r4=u.r3+d,u.s4=u.s3-d;break;case 3:h=(i+r+s)/3,u.p=h,u.r1=2*h-r,u.s1=2*h-i,u.r2=h+d,u.s2=h-d,u.r3=h+2*d,u.s3=h-2*d,u.r4=h+3*d,u.s4=h-3*d;break;case 4:var p=NaN;h=(p=n.Std.equal(t,s)?i+r+2*s:n.Std.greater(s,t)?2*i+r+s:2*r+i+s)/4,u.p=h,u.r1=p/2-r,u.s1=p/2-i;break;case 5:h=(i+r+s)/3,u.p=h,u.r1=s+1.1*d/12,u.s1=s-1.1*d/12,u.r2=s+1.1*d/6,u.s2=s-1.1*d/6,u.r3=s+1.1*d/4,u.s3=s-1.1*d/4,u.r4=s+1.1*d/2,u.s4=s-1.1*d/2;break;default:throw new Error("Unknown kind")}return u.startIndex__t=a,u.endIndex__t=l,u}(u,d,p,f,_,h,l(e,h),this._kindPP);return e.select_sym(0),this._showHistoricalPivots||(c.pivots=[]),c.pivots.push(y),c.pivots.length>this._historicalPivotsToKeep&&c.pivots.shift(),m?this._createResponse():null},e.prototype._createResponse=function(){
return 0===this._data.pivots.length?null:{nonseries:!0,type:"non_series_data",data:{data:this._data}}},e.prototype._removeUnusedPivots=function(){var e=this,t=Math.max(this._data.pivots.findIndex((function(t){return t.startIndex__t>e._firstMainSeriesBarTime}))-1,0);t>0&&this._data.pivots.splice(0,t)},e}()}},"i/Bj":function(e,t,i){"use strict";function n(e){if(void 0===e)return null;var t=e.match(/(delayed_streaming)_([\d]{1,4})/);return null===t?null:{mode:t[1],interval:parseInt(t[2])}}i.r(t),i.d(t,"parseUpdateMode",(function(){return n}))},i126:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyColorRotatorFactory",(function(){return u}));var n=i("eJTA"),r=i("Tmoa"),o=i("HGP3"),s=i("3ClC"),a=["color-sky-blue-400","color-banana-yellow-700","color-deep-blue-500","color-grapes-purple-a700","color-iguana-green-500","color-minty-green-a700","color-ripe-red-a200","color-berry-pink-200","color-tv-blue-a100","color-tan-orange-a200","color-sky-blue-a400","color-deep-blue-a100","color-grapes-purple-400","color-iguana-green-a700","color-minty-green-200","color-ripe-red-200","color-berry-pink-a200","color-ripe-red-500","color-grapes-purple-500","color-deep-blue-400","color-tv-blue-a200","color-sky-blue-500","color-iguana-green-400","color-minty-green-400","color-banana-yellow-600","color-tan-orange-500","color-berry-pink-400","color-ripe-red-300","color-grapes-purple-300","color-deep-blue-300","color-tv-blue-300","color-sky-blue-300","color-iguana-green-300","color-minty-green-300","color-banana-yellow-400","color-tan-orange-300","color-berry-pink-300","color-tan-orange-a700"],l=function(){function e(e){this._offset=0,this._offset=e}return e.prototype.getColor=function(e){if(0===this._offset)return e;var t=a[(this._offset-1)%a.length],i=o.a[t],s=Object(r.isHexColor)(e)?1:Object(n.parseRgba)(e)[3];return Object(r.generateColor)(i,Object(r.alphaToTransparency)(s))},e}(),c=function(){function e(e,t){this._offset=e,this._modelStartOffset=t}return e.prototype.getColor=function(e){if(Object(r.isHexColor)(e)){var t=Object(n.parseRgb)(e);return Object(n.rgbToHexString)(Object(n.shiftRgb)(t,this._offset,this._modelStartOffset))}var i=Object(n.parseRgba)(e);return Object(n.rgbaToString)(Object(n.shiftRgba)(i,this._offset,this._modelStartOffset))},e}();var u=function(){function e(e){this._chartModel=e}return e.prototype.getColorRotator=function(e){var t=Object(s.studyColorRotationMode)(e);if(null===t)return null;var i=this._calcDefaultColorsOffset(e);switch(t){case"loop":return new l(i);case"shift":var n=this._chartModel.getStudyShiftColorStartOffset();return new c(i,n)}},e.prototype._calcDefaultColorsOffset=function(e){var t=0;return this._chartModel.dataSources().filter(s.isStudy).forEach((function(i){var n,r,o=i.metaInfo().id===e.id,s=(n=i.metaInfo(),r=e,(n.pine?n.pine.version:void 0)===(r.pine?r.pine.version:void 0));o&&s&&t++})),t},e}()},i80N:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;function o(e,t){var r=t||o.createProperties();n.call(this,e,r),i.e("lt-pane-views").then(function(e){
var t=i("8MBc").FibSpiralPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.name=function(){return"Fib Spiral"},o.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("nBUU").FibSpiralDefinitionsViewModel}.bind(null,i)).catch(i.oe)},o.createProperties=function(e){var t=new r("linetoolfibspiral",e);return o._configureProperties(t),t},o._configureProperties=function(e){n._configureProperties(e)},t.LineToolFibSpiral=o},iDOr:function(e,t,i){"use strict";(function(e){var n=i("Y7w9").moveToHead,r=i("704P").ExecutionsPositionController,o=i("Ss5c").LineDataSource,s=i("7ktv").PriceDataSource,a=i("CW80").isLineTool,l=i("s1Gx").isSpeciallyZOrderedSource,c=i("1Wlv").PriceScale,u=i("MWAT").createPriceScaleSelectionStrategy,h=i("yfAl").PaneBase,d=i("s1Gx").sortSources;function p(t,i,n,r){h.call(this,t,i,n,r),this.m_timeScale=t,this.m_height=0,this.m_width=0,this.m_mainDataSource=null,this._properties=i,this._model=n,this._destroyed=new e,n.properties().priceScaleSelectionStrategyName.listeners().subscribe(null,function(e){this._priceScaleSelectionStrategy=u(e.value()),this._priceScaleSelectionStrategy.apply(this)}.bind(this)),this.m_timeScale.barSpacingChanged().subscribe(this,function(){this.m_mainDataSource===this._model.mainSeries()&&this._recalculatePriceScaleByScaleRatio(this.m_mainDataSource.priceScale())}.bind(this)),i.topMargin.listeners().subscribe(this,p.prototype._updateMargins),i.bottomMargin.listeners().subscribe(this,p.prototype._updateMargins),this._updateMargins(),this._maximized=!1,this._isMainPane=!1}inherit(p,h),p.DEFAULT_STRETCH_FACTOR=1e3,p.PANE_ANIMATION_DURATION=500,p.prototype.destroy=function(){this._properties.topMargin.listeners().unsubscribe(this,p.prototype._updateMargins),this._properties.bottomMargin.listeners().unsubscribe(this,p.prototype._updateMargins),this._model.properties().priceScaleSelectionStrategyName.listeners().unsubscribeAll(this),this.m_timeScale.barSpacingChanged().unsubscribeAll(this),this._leftPriceScales.concat(this._rightPriceScales).forEach((function(e){e.modeChanged().unsubscribeAll(this),e.priceRangeChanged().unsubscribeAll(this),e.internalHeightChanged().unsubscribeAll(this)}),this);for(var e=0;ee.left){var t=n(this._leftPriceScales,this.mainDataSource().priceScale());return t.splice(e.left),t}return this._leftPriceScales},p.prototype.visibleRightPriceScales=function(){var e=this._model.priceScaleSlotsCount();if(this._rightPriceScales.length>e.right){var t=n(this._rightPriceScales,this.mainDataSource().priceScale());return t.splice(e.right),t}return this._rightPriceScales},p.prototype.timeScale=function(){return this.m_timeScale},p.prototype._processMainSourceChange=function(){var e;if(null===this.m_mainDataSource)for(var t=0;te)&&(e=n)}}return null===e&&(e=this.getZOrderMinMax().minZOrder-1),this.m_dataSources.forEach((function(t){t.zorder()>e&&t.setZorder(t.zorder()+1)})),e+1},p.prototype.beginInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!0,this._lastLineDataSourceZOrder=null},p.prototype.endInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null},p.prototype.startScalePrice=function(e,t){e.startScale(t)},p.prototype.scalePriceTo=function(e,t){e.scaleTo(t),this.updateAllViews()},p.prototype.endScalePrice=function(e){e.endScale()},p.prototype.startScrollPrice=function(e,t){e.startScroll(t)},p.prototype.scrollPriceTo=function(e,t){e.scrollTo(t),this.updateAllViews()},p.prototype.endScrollPrice=function(e){e.endScroll()},p.prototype.setPriceAutoScale=function(e,t){e.setMode({autoScale:t}),this.timeScale().isEmpty()?e.setPriceRange(null):this.recalculatePriceScale(e)},p.prototype.restorePriceScaleState=function(e,t){e.restoreState(t),this.updateAllViews()},p.prototype.defaultPriceScale=function(){var e=this.m_mainDataSource?this.m_mainDataSource.priceScale():null
;return null===e&&(e=new c(this._model.properties().scalesProperties)),e},p.prototype._priceScaleIsPrice=function(e){var t=e.mainSource();return!!t&&(!!TradingView.isInherited(t.constructor,TradingView.Series)||!!TradingView.isInherited(t.constructor,TradingView.Study)&&t.metaInfo().is_price_study)},p.prototype.findSuitableScale=function(e,t,i){return this._priceScaleSelectionStrategy.findSuitableScale(this,e,t,i)},p.prototype.createNewPriceScaleIfPossible=function(){return this._priceScaleSelectionStrategy.createNewPriceScaleIfPossible(this)},p.prototype.canCreateNewPriceScale=function(){return this._priceScaleSelectionStrategy.canCreateNewPriceScale(this)},p.prototype.mainDataSource=function(){return this.m_mainDataSource},p.prototype.resetPriceScale=function(e){var t=this.timeScale().visibleBarsStrictRange();e.isLockScale()||e.setMode({autoScale:!0}),e.recalculatePriceRange(t),this.updateAllViews()},p.prototype.recalculate=function(){this.recalculatePriceScale(this.m_rightPriceScale),this.recalculatePriceScale(this.m_leftPriceScale);for(var e=0;e0&&t<0){var s=i[n-1].zorder(),a=e.zorder();i[n-1].setZorder(a),e.setZorder(s)}else if(n0){var l=i[n+1].zorder();a=e.zorder();i[n+1].setZorder(a),e.setZorder(l)}this._invalidateSourcesCache(),this._dataSourcesCollectionChanged.fire()},p.prototype.onDestroyed=function(){return this._destroyed},p.prototype.clearSeries=function(e){for(var t=this.m_dataSources.length-1;t>=0;t--)TradingView.isInherited(this.m_dataSources[t].constructor,TradingView.Series)&&this._removeSourceFromCollections(t,e)},p.prototype.nonOverlayPricesSourcesCount=function(){return this.m_dataSources.filter((function(e){return(!e.properties().linkedToSeries||!e.properties().linkedToSeries.value())&&(TradingView.isInherited(e.constructor,s)&&e.showInObjectTree()&&!this.isOverlay(e))}),this).length},p.prototype.canHaveMoreNoScaleSources=function(){return this.nonOverlayPricesSourcesCount()>1},p.prototype.actionNoScaleIsEnabled=function(e){return!(!this.isOverlay(e)&&TradingView.isInherited(e.constructor,s))||this.canHaveMoreNoScaleSources()},
p.prototype.executionsPositionController=function(){return this._executionsPositionController||(this._executionsPositionController=new r(this,this._model.timeScale())),this._executionsPositionController},p.prototype.isLast=function(){var e=this._model.panes();return e[e.length-1]===this},p.prototype.setMaximized=function(e){this._maximized=e},p.prototype.isMaximized=function(){return this._maximized},p.prototype.isMainPane=function(){var e=this._model.mainSeries(),t=!1;return this.m_dataSources.forEach((function(i){t||(t=i===e)})),this._isMainPane=t,t},p.prototype.properties=function(){return this._properties},p.prototype.priceScaleRatio=function(){return this._currentPriceScaleRatio},p.prototype.getPriceScaleById=function(e){var t=this.m_dataSources.find((function(t){return null!==t.priceScale()&&t.priceScale().id()===e}));return void 0===t?null:t.priceScale()},p.prototype.setPriceScaleSelectionStrategy=function(e){this._priceScaleSelectionStrategy=e,e.apply(this)},p.prototype.priceScaleIndex=function(e,t){switch(t){case"left":return this.leftPriceScales().indexOf(e);case"right":return this.rightPriceScales().indexOf(e)}},p.prototype.realignLineTools=function(){for(var e=0;e0&&(c=2*Math.PI-c),0===e&&(c+=Math.PI),s.angle.setValue(c)}else{var u=2*o.subtract(r).length();u*=this._sizeScale,s.size.setValue(u),s.scale.setValue(1)}},t.prototype.endChanging=function(t,i){var n=e.prototype.endChanging.call(this,t,i);return this._sizeScale=NaN,n},t.prototype.properties=function(){return e.prototype.properties.call(this)},
t.prototype.getSourceIcon=function(){return{type:"text",text:String.fromCharCode(this.properties().childs().icon.value())}},t.createProperties=function(e){var i=new r.DefaultProperty("linetoolicon",e);return t._configureProperties(i),i},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"XCOO")).then((function(e){return e.IconsDefinitionsViewModel}))},t._configureProperties=function(e){o.LineDataSource._configureProperties(e),e.addChild("backgroundsColors",new s.LineToolColorsProperty([e.childs().color])),e.addExclusion("angle"),e.addExclusion("scale")},t}(o.LineDataSource)},ijBy:function(e,t,i){"use strict";i.r(t),i.d(t,"SetChartLayoutCommand",(function(){return s}));var n=i("mrSG"),r=i("RDU5"),o=i("VNzU"),s=function(e){function t(t,i){var n=this,r="Change Chart Layout to "+o.layouts[i].title;return(n=e.call(this,r)||this)._chartWidgetCollection=t,n._newLayoutType=i,n._oldLayoutType=t.layout.value(),n}return Object(n.c)(t,e),t.prototype.redo=function(){this._chartWidgetCollection.layout.setValue(this._newLayoutType)},t.prototype.undo=function(){this._chartWidgetCollection.layout.setValue(this._oldLayoutType)},t}(r.UndoCommand)},ikwP:function(e,t,i){"use strict";i.r(t),i.d(t,"Size",(function(){return s})),i.d(t,"getCanvasDevicePixelRatio",(function(){return a})),i.d(t,"getContext2D",(function(){return l})),i.d(t,"getPrescaledContext2D",(function(){return c})),i.d(t,"getPretransformedContext2D",(function(){return u})),i.d(t,"hardResizeCanvas",(function(){return h})),i.d(t,"resizeCanvasPreservingContent",(function(){return d})),i.d(t,"fillRect",(function(){return p})),i.d(t,"clearRect",(function(){return f})),i.d(t,"drawScaled",(function(){return _})),i.d(t,"createDisconnectedCanvas",(function(){return m})),i.d(t,"createDisconnectedBoundCanvas",(function(){return v})),i.d(t,"createBoundCanvas",(function(){return g})),i.d(t,"calcTextHorizontalShift",(function(){return b})),i.d(t,"disableSelection",(function(){return S}));var n=i("f2KN"),r=i("Eyy1"),o=i("Ialn"),s=function(){function e(e,t){this.w=e,this.h=t}return e.prototype.equals=function(e){return this.w===e.w&&this.h===e.h},e}();function a(e){var t,i;return Math.max(1,(null===(i=null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0===i?void 0:i.devicePixelRatio)||1)}function l(e){var t=Object(r.ensureNotNull)(e.getContext("2d"));return t.setTransform(1,0,0,1,0,0),t}function c(e){var t=Object(r.ensureNotNull)(e.getContext("2d")),i=a(e);return t.setTransform(i,0,0,i,0,0),t}function u(e){var t=Object(r.ensureNotNull)(e.canvas.getContext("2d"));return t.setTransform(e.pixelRatio,0,0,e.pixelRatio,0,0),t.translate(.5,.5),t}function h(e,t){e.resizeCanvas({width:0,height:0}),e.resizeCanvas({width:t.w,height:t.h})}function d(e,t){var i=v(document,t),n=c(i.canvas);return n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(e.canvas,0,0,e.canvasSize.width*e.pixelRatio,e.canvasSize.height*e.pixelRatio),n.restore(),i}function p(e,t,i,n,r,o){e.save(),e.translate(-.5,-.5),
e.fillStyle=o,e.fillRect(t,i,n,r),e.restore()}function f(e,t,i,n,r,o){e.save(),e.translate(-.5,-.5),e.globalCompositeOperation="copy",e.fillStyle=o,e.fillRect(t,i,n,r),e.restore()}function _(e,t,i){e.save(),e.scale(t,t),i(),e.restore()}function m(e,t,i){var n=y(e);return void 0===i&&(i=a(n)),n.width=t.w*i,n.height=t.h*i,n}function v(e,t){var i=y(e),r=Object(n.a)(i,{allowDownsampling:!1});return r.resizeCanvas({width:t.w,height:t.h}),r}function y(e){var t=e.createElement("canvas");return S(t),t}function g(e,t){var i=y(Object(r.ensureNotNull)(e.ownerDocument));e.appendChild(i);var o=Object(n.a)(i,{allowDownsampling:!1});return o.resizeCanvas({width:t.w,height:t.h}),o}function b(e,t){return"center"===e.textAlign?0:Object(o.isRtl)()?"start"===e.textAlign||"right"===e.textAlign?t:0:"start"===e.textAlign||"left"===e.textAlign?0:t}function S(e){e.style.userSelect="none",e.style.webkitUserSelect="none",e.style.msUserSelect="none",e.style.MozUserSelect="none",e.style.webkitTapHighlightColor="transparent"}},isVH:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,o=i("j3hX").LineToolColorsProperty;function s(e,t){var r=t||s.createProperties();n.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("D4q4").TrianglePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(s,n),s.prototype.pointsCount=function(){return 3},s.prototype.name=function(){return"Triangle"},s.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("Zd1D").GeneralFiguresDefinitionsViewModel}.bind(null,i)).catch(i.oe)},s.createProperties=function(e){var t=new r("linetooltriangle",e);return s._configureProperties(t),t},s._configureProperties=function(e){n._configureProperties(e),e.addChild("linesColors",new o([e.childs().color]))},t.LineToolTriangle=s},it7y:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyDataWindowView",(function(){return a}));var n=i("mrSG"),r=i("ivNn"),o=i("4miz"),s=i("EYFt"),a=function(e){function t(t,i){var n=e.call(this)||this;return n._invalidated=!0,n._study=t,n._model=i,n._valueProvider=n._createValuesProvider(t,i),n._items=n._valueProvider.getItems().map((function(e){return new o.a(e.title,"")})),n.update(),n}return Object(n.c)(t,e),t.prototype.update=function(){this._invalidated=!0},t.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},t.prototype._updateImpl=function(){this._header=this._study.title(!0),this._title=this._study.title();var e=this._currentIndex();if(null!==e&&Object(r.isNumber)(e))for(var t=this._valueProvider.getValues(e),i=0;i0)},t.fixComputationError=n,t.alignTo=function(e,t){var i=e/t,r=Math.floor(i),o=i-r;return o>2e-10?n(o>.5?(r+1)*t:r*t):e}},j3hX:function(e,t,i){"use strict";i.r(t),i.d(t,"LineToolMultiplePropertyBaseImpl",(function(){return c})),i.d(t,"LineToolCollectedProperty",(function(){return u})),i.d(t,"LineToolWidthsProperty",(function(){return h})),i.d(t,"LineToolColorsProperty",(function(){return d})),i.d(t,"MultipleLineWidthsProperty",(function(){return f})),i.d(t,"MultipleLineColorsProperty",(function(){return _}));var n=i("mrSG"),r=i("txPx"),o=i("aIyQ"),s=i.n(o),a=Object(r.getLogger)("Chart.LineToolCollectedProperty"),l=function(){function e(){}return e.prototype.applyValue=function(e,t){e.setValue(t)},e}(),c=function(){function e(e,t){var i=this;this._onChange=new s.a,this._properties=e,e.forEach((function(e){return e.subscribe(i,(function(){i._onChange.fire(i)}))})),this._showIfProperty=t}return e.prototype.visible=function(){var e;return!this._showIfProperty||(null===(e=this._showIfProperty)||void 0===e?void 0:e.value())},e.prototype.value=function(){if(0===this._properties.length)return a.logError("Incorrect call, should not request value of 0 properties"),"mixed";var e=this._properties[0].value();return 1===this._properties.length||this._properties.every((function(t){return t.value()===e}))?e:"mixed"},e.prototype.state=function(){},e.prototype.merge=function(){},e.prototype.destroy=function(){var e=this;this._properties.forEach((function(t){return t.unsubscribeAll(e)}))},e.prototype.subscribe=function(e,t){this._onChange.subscribe(e,t)},e.prototype.unsubscribe=function(e,t){this._onChange.unsubscribe(e,t)},e.prototype.unsubscribeAll=function(e){this._onChange.unsubscribeAll(e)},e}(),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype.setValue=function(e,t,i){if("mixed"!==e){var n=null!=i?i:new l;this._properties.forEach((function(t){return n.applyValue(t,e)}))}},t}(c),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t}(u),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype.firstColor=function(){return this._properties[0].value()},t}(u),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t.prototype.setValue=function(e,t,i){if("mixed"!==e){var n=null!=i?i:new l;this._properties.forEach((function(t){return t.setValue(e,void 0,n)}))}},t}(c),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t}(p),_=function(e){function t(){
return null!==e&&e.apply(this,arguments)||this}return Object(n.c)(t,e),t}(p)},j8de:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var n=i("mrSG"),r=i("tc+8"),o=function(e){function t(t,i){var n=e.call(this)||this;return n._lineSource=t,n._pointIndex=i,n}return Object(n.c)(t,e),t.prototype.value=function(){return this._lineSource.points()[this._pointIndex].index},t.prototype.setValue=function(e){var t=this._lineSource.points()[this._pointIndex];t.index=e,this._lineSource.startChanging(this._pointIndex,t),this._setPointImpl(t),this._lineSource.model().updateSource(this._lineSource),this._listeners.fire(this);var i=this._lineSource.endChanging(!0,!1);this._lineSource.syncMultichartState(i),this._lineSource.properties().lastUpdateTime.setValue((new Date).valueOf())},t.prototype._setPointImpl=function(e){this._lineSource.setPoint(this._pointIndex,e)},t}(i.n(r).a)},jA0t:function(e,t,i){"use strict";var n=function(){var e={};function t(e){return e.is_price_study}function i(e,t){var i=t.slice(0).toLowerCase();if(e){for(var n=0;nt){if((r=o-1)0&&e-t[n-1]<=r)return r;return 0},r.prototype.is_valid=function(){return!this._invalid},r._offset=function(e,t,i){var n=o(e,i);return-1===n?0:t[n]};var s=function(e){return 0|e},a=function(e){return 60*e*1e3};function l(e){return e%4==0&&(e%100!=0||e%400==0)}var c={0:0,1:31,2:59,3:90,4:120,5:151,6:181,7:212,8:243,9:273,10:304,11:334},u={SUNDAY:1,MONDAY:2,TUESDAY:3,WEDNESDAY:4,THURSDAY:5,FRIDAY:6,SATURDAY:7,JANUARY:0,FEBRUARY:1,MARCH:2,APRIL:3,MAY:4,JUNE:5,JULY:6,AUGUST:7,SEPTEMBER:8,OCTOBER:9,NOVEMBER:10,DECEMBER:11,YEAR:1,MONTH:2,WEEK_OF_YEAR:3,DAY_OF_MONTH:5,DAY_OF_YEAR:6,DAY_OF_WEEK:7,HOUR_OF_DAY:11,MINUTE:12,SECOND:13,minutesPerDay:1440,secondsPerDay:a(1440),get_minutes_from_hhmm:function(e){return-1!==e.indexOf(":")&&(e=e.split(":").join("")),e%100+60*s(e/100)},get_year:function(e){return e.getUTCFullYear()},get_month:function(e){return e.getUTCMonth()},get_hours:function(e){return e.getUTCHours()},get_minutes:function(e){return e.getUTCMinutes()},get_seconds:function(e){return e.getUTCSeconds()},get_day_of_month:function(e){return e.getUTCDate()},get_day_of_week:function(e){return e.getUTCDay()+1},get_day_of_year:function(e){var t=e.getUTCMonth(),i=c[t];return t>u.JANUARY+1&&l(e.getUTCFullYear())&&(i+=1),i+e.getUTCDate()},get_week_of_year:function(e){var t=new Date(Date.UTC(e.getUTCFullYear(),0,1)).getUTCDay(),i=0===t?1:8-t,n=u.get_day_of_year(e)-i;return Math.ceil(n/7)+1},get_minutes_from_midnight:function(e){return 60*u.get_hours(e)+u.get_minutes(e)},set_hms:function(e,t,i,n,r,o){e.setUTCHours(t),e.setUTCMinutes(i),e.setUTCSeconds(n),e.setUTCMilliseconds(r),u.correct_time(e,o)},correct_time:function(e,t){var i=e.getTime(),n=t.correction_loc(i);e.setTime(i+n)},add_days_considering_dst:function(e,t,i){var n=e.offset_utc(t),r=this.clone(t);this.add_date(r,i);var o=e.offset_utc(r);return r.setTime(r.getTime()+n-o),r},add_date:function(e,t){e.setTime(e.getTime()+t*u.secondsPerDay)},add_minutes:function(e,t){e.setTime(e.getTime()+a(t))},clone:function(e){return new Date(e.getTime())},get_days_per_year:function(e){var t=e.getUTCFullYear();return this.days_per_year(t)},days_per_year:function(e){return l(e)?366:365},get_part:function(e,t){switch(t){case u.YEAR:return u.get_year(e);case u.MONTH:return u.get_month(e);case u.DAY_OF_MONTH:return u.get_day_of_month(e);case u.WEEK_OF_YEAR:return u.get_week_of_year(e);case u.DAY_OF_WEEK:return u.get_day_of_week(e);case u.HOUR_OF_DAY:return u.get_hours(e);case u.MINUTE:return u.get_minutes(e);case u.DAY_OF_YEAR:return u.get_day_of_year(e);case u.SECOND:return u.get_seconds(e);default:return e.getTime()}},time_minutes:a,time_seconds:function(e){return 1e3*e},time_minutes_diff:function(e,t){return s((s(e/1e3)-s(t/1e3))/60)},time_seconds_diff:function(e,t){return s(s(e/1e3)-s(t/1e3))},utc_to_cal:function(e,t){var i=e.offset_utc(t);return new Date(t+i)},get_cal:function(e,t,i,n,r,o,s){var a=new Date(Date.UTC(t,i,n,r||0,o||0,s||0)),l=e.offset_utc(+a);return new Date(a.valueOf()-l)},
get_cal_from_unix_timestamp_ms:function(e,t){return new Date(t+e.offset_utc(t))},get_cal_utc:function(e,t,i){return new Date(Date.UTC(e,t,i))},cal_to_utc:function(e,t){var i=t.getTime();return i-e.offset_loc(i)},get_timezone:function(e){return new r(e)},shift_day:function(e,t){var i=e-1;return(i+=t)>6?i%=7:i<0&&(i=(7+i%7)%7),i+1}};e.exports=u},jFln:function(e,t,i){"use strict";var n=i("Hr11"),r=n.greaterThan,o=n.lessThan,s=window.CanvasEx=i("8Uy/");s.computeDashPattern=function(e){return[[e.lineWidth,2*e.lineWidth],[5*e.lineWidth,6*e.lineWidth],[6*e.lineWidth,6*e.lineWidth],[e.lineWidth,4*e.lineWidth],[2*e.lineWidth,e.lineWidth]][e.lineStyle-1]},s.drawLine=function(e,t,i,n,r){isFinite(t)&&isFinite(n)&&isFinite(i)&&isFinite(r)&&(e.lineStyle!==s.LINESTYLE_SOLID?s.drawDashedLine(e,t,i,n,r):s.drawSolidLine(e,t,i,n,r))},s.drawArrow=function(e,t,i,n,r,o){if(o=void 0===o?2:o,isFinite(t)&&isFinite(n)&&isFinite(i)&&isFinite(r)){var s=Math.round(o/2);e.beginPath(),e.moveTo(n,r),e.lineTo(t,i),e.moveTo(t+o,i+o),e.lineTo(t-o,i+o),e.moveTo(t-s,i+s),e.lineTo(t+s,i+s),e.stroke()}},s.drawSolidLine=function(e,t,i,n,r){e.beginPath(),e.moveTo(t,i),e.lineTo(n,r),e.stroke()},s.setLineStyle=function(e,t){e.lineStyle=t;var i=[];t!==s.LINESTYLE_SOLID&&(i=s.computeDashPattern(e)),s.setLineDash(e,i)},s.setLineDash=function(e,t){"function"==typeof e.setLineDash?e.setLineDash(t):void 0!==e.mozDash?e.mozDash=t:void 0!==e.webkitLineDash&&(e.webkitLineDash=t)},s.drawPoly=function(e,t,i){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(var n=0;n0&&(c.thereYet=o,c.cap=Math.max),t-n>0&&(l.thereYet=o,l.cap=Math.max),e.moveTo(t,i);for(var u=t,h=i,d=0,p=!0;!l.thereYet(u,n)||!c.thereYet(h,s);){var f=Math.atan2(s-i,n-t),_=a[d];u=l.cap(n,u+Math.cos(f)*_),h=c.cap(s,h+Math.sin(f)*_),p?e.lineTo(u,h):e.moveTo(u,h),d=(d+1)%a.length,p=!p}},
s.setFont=function(e,t){if(e.font!==t)try{e.font=t}catch(i){}},"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.setFont=function(e){s.setFont(this,e)},CanvasRenderingContext2D.prototype.lineStyle=s.LINESTYLE_SOLID),e.exports=s},jJ9X:function(e,t,i){},jRfx:function(e,t,i){"use strict";i.d(t,"c",(function(){return s})),i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return l}));var n=i("mrSG"),r=i("Eyy1"),o=function(e){function t(t,i,n){var r=e.call(this,t,i,n)||this;return r._restorePane=!1,r}return Object(n.c)(t,e),t.prototype.redo=function(){var e=this,t=this._chartModel.panes().length,i=this._chartModel.panes()[this._targetPaneIndex()],n=Object(r.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),o=Object(r.ensureNotNull)(this._chartModel.paneForSource(n)),s=this._chartModel.children(n,!0);o.bulkActionMacro((function(){s.forEach((function(t){return e._chartModel.detachSource(t)})),e._restorePane=e._chartModel.detachSource(n)}));var a="overlay"===this._initialPriceScalePosition?this._initialPriceScalePosition:void 0,l=i.findSuitableScale(n,void 0,a),c=0===l.dataSources().length;if(i.bulkActionMacro((function(){i.addDataSource(n,l,!1),s.forEach((function(e){return i.addDataSource(e,l,!1)}))})),n===this._chartModel.mainSeries()){var u=i.priceScalePosition(l);i.movePriceScale(l,u,0)}c&&Object(r.ensureNotNull)(n.priceScale()).restoreState(this._newPriceScaleState(i.isOverlay(n)));this._chartModel.fullUpdate(),t!==this._chartModel.panes().length&&this._chartModel.setShouldBeSavedEvenIfHidden(!0)},t.prototype.undo=function(){var e,t=this;e=this._restorePane?this._chartModel.createPane(this._initialPaneIndex):this._chartModel.panes()[this._initialPaneIndex];var i=Object(r.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),n=Object(r.ensureNotNull)(this._chartModel.paneForSource(i)),o=this._chartModel.children(i,!0);n.bulkActionMacro((function(){o.forEach((function(e){return t._chartModel.detachSource(e)})),t._chartModel.detachSource(i)}));var s=e.getPriceScaleById(this._initialPriceScaleId);null===s&&(s=e.createPriceScaleAtPosition(this._initialPriceScalePosition,this._initialPriceScaleIndex)),e.bulkActionMacro((function(){e.addDataSource(i,s,!0),o.forEach((function(t){return e.addDataSource(t,s,!1)}))})),Object(r.ensureNotNull)(i.priceScale()).restoreState(this._originalPriceScaleState()),this._chartModel.fullUpdate()},t}(i("3u3j").a),s=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}return Object(n.c)(t,e),t.prototype._targetPaneIndex=function(){return this._initialPaneIndex-1},t}(o),a=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}return Object(n.c)(t,e),t.prototype._targetPaneIndex=function(){return this._initialPaneIndex+1},t}(o),l=function(e){function t(t,i,n,r){var o=e.call(this,t,i,r)||this;return o._targetPane=n,o}return Object(n.c)(t,e),t.prototype._targetPaneIndex=function(){return this._targetPane},t}(o)},jTis:function(e,t,i){"use strict";var n;i.r(t),i.d(t,"CalloutConsts",(function(){return n})),function(e){
e[e.RoundRadius=8]="RoundRadius",e[e.TextMargins=2]="TextMargins",e[e.MinWidth=100]="MinWidth"}(n||(n={}))},jeZR:function(e,t,i){"use strict";i.r(t),i.d(t,"AppliedTimeFrame",(function(){return r}));var n=i("QfUd"),r=function(){function e(e){this._appliedTimeFrame=new n.a(null),this._appliedTimeFrameInfo=null,this._model=e,e.mainSeries().dataEvents().messageReceived().subscribe(this,this._onSeriesMessageReceived)}return e.prototype.destroy=function(){this._model.timeScale().logicalRangeChanged().unsubscribeAll(this),this._model.mainSeries().dataEvents().messageReceived().unsubscribeAll(this)},e.prototype.appliedTimeFrame=function(){return this._appliedTimeFrame},e.prototype._onSeriesMessageReceived=function(e){if("series_timeframe"===e.method){var t=this._model.timeScale();t.logicalRangeChanged().unsubscribe(this,this._invalidateAppliedTimeFrame),(null==e.params[5]||e.params[5])&&(this._appliedTimeFrameInfo={logicalRange:t.logicalRange(),baseIndex:t.baseIndex()},t.logicalRangeChanged().subscribe(this,this._invalidateAppliedTimeFrame))}},e.prototype._invalidateAppliedTimeFrame=function(){if(null!==this._appliedTimeFrameInfo){var e=this._model.timeScale(),t=e.logicalRange(),i=e.baseIndex(),n=this._appliedTimeFrameInfo.logicalRange,r=this._appliedTimeFrameInfo.baseIndex;null!==t&&null!==n&&i-t.left()==r-n.left()&&i-t.right()==r-n.right()||(this._appliedTimeFrame.setValue(null),e.logicalRangeChanged().unsubscribe(this,this._invalidateAppliedTimeFrame))}},e}()},jenN:function(e,t,i){"use strict";i.r(t);var n=i("txPx"),r=i("7Fue"),o=i("xWfy"),s=i("qySK"),a=i("mrSG"),l=function(e){function t(t,i){var n=e.call(this)||this;return n._source=t,n._data=i,n}return Object(a.c)(t,e),t.prototype._updateRendererData=function(e,t,i){e.visible=!1;var n=this._source.priceScale(),r=this._source.properties().visible.value();if(n&&!n.isEmpty()&&r){var o=this._source.properties().graphics[this._data.lineType][this._data.styleId];if(o.visible&&o.visible.value()&&o.showPrice&&o.showPrice.value()){var s=this._source.firstValue();if(null!==s){var a=this._data.line.level,l=o.color.value();i.background=l,i.color=this.generateTextColor(l),i.coordinate=n.priceToCoordinate(a,s),e.text=n.formatPrice(a,s),e.visible=!0}}}},t}(i("KcY8").a);i.d(t,"createGraphicsPaneViews",(function(){return u})),i.d(t,"createGraphicsPriceAxisViews",(function(){return d})),i.d(t,"isStudyGraphicsEmpty",(function(){return r.a})),i.d(t,"StaticStudyGraphics",(function(){return o.a})),i.d(t,"emptyStudyGraphics",(function(){return o.b})),i.d(t,"loadStudyGraphics",(function(){return o.c})),i.d(t,"saveStudyGraphics",(function(){return o.d})),i.d(t,"LiveStudyGraphics",(function(){return s.a}));var c=Object(n.getLogger)("Chart.StudyGraphics");function u(e,t,n){return new Promise((function(r){i.e("study-pane-views").then(function(o){var s=Object.keys(e.graphicsInfo());s.sort((function(e,t){return h(e)-h(t)})),r(s.map((function(r){var o={backgrounds:null,hhists:i("Gj0v").HHistPaneView,horizlines:i("1sos").HorizLinePaneView,hlines:null,lines:null,polygons:null,shapemarks:null,
textmarks:null,trendchannels:null,vertlines:i("psYU").VertLinePaneView,dwglabels:null,dwglines:null,dwgtables:null,dwgcells:null}[r];return null===o?(c.logWarn(r+" is not supported by this build of graphics subsystem, skipping"),null):new o(e,t,n)})).filter((function(e){return null!==e})))}.bind(null,i)).catch(void 0)}))}function h(e){switch(e){case"polygons":return-100;case"trendchannels":return-90;default:return 0}}function d(e){for(var t=Object.keys(e.graphicsInfo()),i=[],n=function(t){switch(t){case"hlines":e.graphics().hlines().forEach((function(n,r){n.forEach((function(n){void 0!==n.level&&i.push(new l(e,{line:{level:n.level},styleId:r,lineType:t}))}))}));break;case"horizlines":e.graphics().horizlines().forEach((function(n,r){n.forEach((function(n){void 0!==n.level&&i.push(new l(e,{line:{level:n.level},styleId:r,lineType:t}))}))}))}},r=0,o=t;r0&&t.setValue(a.family),i.setValue(a.size),n.setValue(a.bold),s.setValue(a.italic)):o.logError("Invalid font: "+e)},fontHeight:function(e){if(!this._fontHeightCache[e]){var t=document.createElement("span");t.appendChild(document.createTextNode("height")),document.body.appendChild(t),t.style.cssText="font: "+e+"; white-space: nowrap; display: inline;";var i=t.offsetHeight;document.body.removeChild(t),this._fontHeightCache[e]=Math.ceil(i)}return this._fontHeightCache[e]},drawPolyHoverOrPress:function(e,t,i,n){n?(e.save(),e.fillStyle="rgba(0, 0, 0, 0.15)",CanvasEx.drawPoly(e,t,!0),e.restore()):i&&(e.save(),e.fillStyle="rgba(0, 0, 0, 0.1)",CanvasEx.drawPoly(e,t,!0),e.restore())},repaint:function(e){e.lightUpdate()},roundToMinTick:function(e,t){var i=1/e.mainSource().base();return i*Math.round(t/i)}};e.exports=s},jofe:function(e,t,i){"use strict";function n(){var e,t;return{promise:new Promise((function(i,n){e=i,t=n})),reject:t,resolve:e}}i.r(t),i.d(t,"createDeferredPromise",(function(){return n}))},jpZi:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var n=i("mrSG"),r=i("Eyy1"),o=(i("YFKU"),
i("HbRj"),i("RDU5")),s=window.t("Exclude line tools from group {group}"),a=function(e){function t(t,i,n){var r=e.call(this,s.format({group:i.name()}))||this;return r._model=t,r._groupId=i.id,r._groupName=i.name(),r._lineToolsIds=n.map((function(e){return e.id()})),r}return Object(n.c)(t,e),t.prototype.redo=function(){var e=this,t=Object(r.ensureNotNull)(this._model.lineToolsGroupModel().groupForId(this._groupId)),i=this._lineToolsIds.map((function(t){return e._model.dataSourceForId(t)}));t.excludeLineTools(i),0===t.lineTools().length&&this._model.lineToolsGroupModel().removeGroup(t)},t.prototype.undo=function(){var e=this,t=this._lineToolsIds.map((function(t){return e._model.dataSourceForId(t)})),i=this._model.lineToolsGroupModel().groupForId(this._groupId);null!==i?i.addLineTools(t):this._model.lineToolsGroupModel().createGroup(t,this._groupName,this._groupId)},t}(o.UndoCommand)},jvrd:function(e,t,i){"use strict";i.d(t,"e",(function(){return r})),i.d(t,"c",(function(){return s})),i.d(t,"b",(function(){return a})),i.d(t,"a",(function(){return l})),i.d(t,"d",(function(){return c}));var n=i("k9/m");function r(e,t,i){var n=e.barFunction();switch(e.style()){case 3:case 10:case 2:return n(t.value);default:return t.value[-1===i?3:2]}}function o(e){return e>=0?1:-1}function s(e,t){return-1===o(e)!==t?-1:1}function a(e,t,i,n){var r=Math.min(t,Math.max(0,1===n?i:t-i));return i-n*Math.abs(r*e/100)}function l(e,t,i){if(void 0===e.index)return null;var n=e.index();return null===n?null:{index:n,price:t.coordinateToPrice(t.height()/2,i)}}function c(e,t){var i,s=e.data().bars(),a=s.first(),l=s.last();if(null===a||null===l)return null;if(void 0===t.index){var c=t.time(),u=a.value[0],h=l.value[0];if(ch)return null;i=s.searchByTime(c,n.PlotRowSearchMode.NearestRight,4)}else{var d=t.index();if(null===d)return null;i=s.search(d)}return null===i?null:{index:i.index,price:r(e,i,o(t.position()))}}},jy4L:function(e,t,i){"use strict";i.r(t),i.d(t,"makeNextSymbolId",(function(){return r})),i.d(t,"makeNextStudyId",(function(){return s}));var n=0;function r(){return"ss_"+ ++n}var o=0;function s(){return"st"+ ++o}},k4w6:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var n=i("mrSG"),r=function(e){function t(t){var i=e.call(this)||this;return i._series=t,i._model=t.model(),i}return Object(n.c)(t,e),t}(i("2ijp").a)},"k9/m":function(e,t,i){"use strict";i.r(t),i.d(t,"PlotRowSearchMode",(function(){return n})),i.d(t,"PlotList",(function(){return h})),i.d(t,"mergeMinMax",(function(){return d})),i.d(t,"mergePlotRows",(function(){return p}));var n,r=i("Eyy1"),o=i("Y7w9"),s=i("tqok"),a=i("txPx"),l=Object(a.getLogger)("Chart.PlotList");!function(e){e[e.NearestLeft=-1]="NearestLeft",e[e.Exact=0]="Exact",e[e.NearestRight=1]="NearestRight"}(n||(n={}));function c(e){return e.index}function u(e){return e.value[0]}var h=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache=new Map,this._rowSearchCacheByIndex=new Map,
this._rowSearchCacheByIndexWithoutEmptyValues=new Map,this._rowSearchCacheByTime=new Map,this._rowSearchCacheByTimeWithoutEmptyValues=new Map,this._plotFunctions=e||new Map,this._emptyValuePredicate=t}return e.prototype.clear=function(){this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache.clear(),this._invalidateSearchCaches()},e.prototype.first=function(){return this.size()>0?this._items[this._start]:null},e.prototype.last=function(){return this.size()>0?this._items[this._end-1]:null},e.prototype.firstIndex=function(){return this.size()>0?this._indexAt(this._start):null},e.prototype.lastIndex=function(){return this.size()>0?this._indexAt(this._end-1):null},e.prototype.size=function(){return this._end-this._start},e.prototype.isEmpty=function(){return 0===this.size()},e.prototype.contains=function(e){return null!==this.search(e,n.Exact)},e.prototype.valueAt=function(e){var t=this.search(e);return null!==t?t.value:null},e.prototype.add=function(e,t){if(this._shareRead)return l.logDebug("add: readonly collection modification attempt"),!1;var i={index:e,value:t},r=this._nonCachedSearch(e,n.Exact,c);return this._invalidateSearchCaches(),null===r?(this._items.splice(this._lowerbound(e,c),0,i),this._start=0,this._end=this._items.length,!0):(this._items[r]=i,!1)},e.prototype.search=function(e,t,i){return void 0===t&&(t=n.Exact),this._searchImpl(e,t,this._rowSearchCacheByIndex,this._rowSearchCacheByIndexWithoutEmptyValues,c,i)},e.prototype.searchByTime=function(e,t,i){return void 0===t&&(t=n.Exact),this._searchImpl(e,t,this._rowSearchCacheByTime,this._rowSearchCacheByTimeWithoutEmptyValues,u,i)},e.prototype.fold=function(e,t){for(var i=t,n=this._start;n=i;--n){var r=this._indexAt(n),o=this._valueAt(n);if(e(r,o))return{index:r,value:o}}return null},e.prototype.each=function(e){for(var t=this._start;t