Release v16.002 (from 2be9706e)

This commit is contained in:
jenkins@nwork.local
2020-09-15 07:59:35 +00:00
parent 4a28c600f7
commit c43d9a9b79
32 changed files with 35 additions and 35 deletions

View File

@@ -587,10 +587,10 @@ return this._requestOptions.startDate?!this._requestOptions.startDate||this._req
U.logDebug("Invalidate style cache starting from "+e),this._clearStylePlot(this.m_data.m_bars,e),this._clearStylePlot(this.m_data.m_nsBars)},s.prototype.invalidateBarColorerCache=function(){delete this._barColorerCache,this.invalidateBarStylesCache()},s.prototype.barColorer=function(){var e,t,i,n;if(this._barColorerCache)return this._barColorerCache;for(e=null,t=this.m_model.dataSources().length-1;t>=0;t--)(i=this.m_model.dataSources()[t]).metaInfo&&TradingView.isInherited(i.constructor,TradingView.Study)&&i.hasBarColorer()&&i.properties().visible.value()&&(n=i.barColorer(),null===e?e=n:e.pushBackBarColorer(n));return null===e?e=new I(this):e.pushBackBarColorer(new I(this)),this._barColorerCache=e,this._barColorerCache},s.prototype.properties=function(){return this._properties},s.prototype._barsState=function(e){var t=e.state();return t.data.forEach(function(e){e.value.splice(7,1)}),t},s.prototype.state=function(e){var t=this===this.m_model.mainSeries()?"MainSeries":TradingView.className(this.constructor),i={type:t,id:this.id(),state:this.properties().state(),zorder:this.zorder(),haStyle:this._haStyle,renkoStyle:this._renkoStyle,pbStyle:this._pbStyle,kagiStyle:this._kagiStyle,pnfStyle:this._pnfStyle,rangeStyle:this._rangeStyle};return this._symbolInfo&&this._symbolInfo.ticker&&(i.state.symbol=this._symbolInfo.ticker),e&&(i.bars=this._barsState(this.m_data.m_bars),i.nsBars=this._barsState(this.m_data.m_nsBars),i.symbolInfo=this._symbolInfo,i.rtPrice=this.data().lastProjectionPrice),i.boxSize=this.data().boxSize,i.reversalAmount=this.data().reversalAmount,i},s.prototype.restoreState=function(e,t){t&&this._setStatus(s.STATUS_SNAPSHOT),this._properties.mergeAndFire(e.state),this._prevChartStyle=this.properties().style.value(),this.createPaneView(),t&&this.restoreData(e.bars,e.nsBars,e.symbolInfo,e.rtPrice,e.boxSize,e.reversalAmount)},s.prototype.hasStateForAlert=function(){return!1},s.prototype.stateForAlert=function(){throw new Error("Not implemented")},s.prototype.idForAlert=function(){return l.prototype.idForAlert.call(this)},s.prototype.restoreData=function(e,t,i,n,o,r){this._status=s.STATUS_SNAPSHOT,this.m_data.m_bars.restoreState(e),this.m_data.m_nsBars.restoreState(t),this.updateSymbolInfo(i),this.m_data.lastProjectionPrice=n,this.m_data.boxSize=o,o||(this.properties().style.value()===s.STYLE_PNF?this.m_data.boxSize=this.properties().pnfStyle.inputs.boxSize.value():this.properties().style.value()===s.STYLE_RENKO&&(this.m_data.boxSize=this.properties().renkoStyle.inputs.boxSize.value())),this.m_data.reversalAmount=r,r||this.properties().style.value()===s.STYLE_KAGI&&(this.m_data.reversalAmount=this.properties().kagiStyle.inputs.reversalAmount.value())},s.prototype.setProperties=function(e){e.timeframe||e.merge({timeframe:""}),e.shortName||e.merge({shortName:""}),this._properties=e,this._properties.symbol.listeners().subscribe(this,s.prototype.changeSymbol),this._properties.interval.listeners().subscribe(this,s.prototype.changeInterval),
this._properties.timeframe.listeners().subscribe(this,s.prototype.changeTimeFrame),this._properties.listeners().subscribe(this,s.prototype.changeProperties)},s.prototype.changeSymbol=function(){this.setSymbolIntervalDelayed(),this.m_model.checkLineToolSelection()},s.prototype.changeInterval=function(){this.setSymbolIntervalDelayed()},s.prototype.changeTimeFrame=function(){F("GUI","Change timeframe")},s.prototype.title=function(){return this.properties().symbol.value()+", "+W(this.properties().interval.value())},s.prototype.changeProperties=function(e){e!==this._properties.symbol&&e!==this._properties.interval&&e!==this._properties.timeframe&&(this._tagsChanged.fire(),this.createPaneView(),this.updateAllViews(),this.m_model.updateSource(this),re.emit("series_properties_changed",this._id))},s.prototype._makeNextSymbolId=function(){return"symbol_"+this._nextSymbolId++},s.prototype._makeNextSeriesId=function(){return"s"+this._nextSeriesId++},s.prototype.onData=function(e){var t,i,n,o,r,l,c,u,h,d,p,_,f,m,y,g,v,S,b,w=this;switch(e.method){case"symbol_resolved":if(e.params[0]!==this._symbolId){U.logNormal("command for old symbol. Expected:"+this._symbolId+", actual"+e.params[0]);break}this.updateSymbolInfo(e.params[1]),this.m_model.updateSource(this),this._dataEvents.fireSymbolResolved(this._symbolInfo),this.m_model.realignLineTools(),TradingView.onWidget()||(F("Symbol",e.params[1].listed_exchange,e.params[1].name),F("Symbol Type",e.params[1].type,e.params[1].listed_exchange)),t=this.symbolInfo().minmov/this.symbolInfo().pricescale,(i=this.properties()).style.value()===s.STYLE_RENKO&&i.renkoStyle.inputs.boxSize.value()<t?i.renkoStyle.inputs.merge({boxSize:t}):i.style.value()===s.STYLE_PNF&&i.pnfStyle.inputs.boxSize.value()<t?i.pnfStyle.inputs.merge({boxSize:t}):i.style.value()===s.STYLE_KAGI&&i.kagiStyle.inputs.reversalAmount.value()<t&&i.kagiStyle.inputs.merge({reversalAmount:t});break;case"symbol_error":if(e.params[0]!==this._symbolId){U.logNormal("command for old symbol. Expected:"+this._symbolId+", actual"+e.params[0]);break}if(this._setStatus(s.STATUS_INVALID_SYMBOL),this._properties.shortName.setValue(this._properties.symbol.value()),this.m_model.clearAllStudies(),this.updateAllViews(),this.m_model.updateSource(this),(n=e.params[1])===s.PERMISSION_DENIED)switch(e.params[2]){case s.PD_REASON_EXTENDED_HOURS:this._dataEvents.fireExtendedHoursNotPermitted();break;case s.PD_REASON_SYMBOL:this._dataEvents.fireSymbolNotPermitted(e.params[3]);break;case s.PD_REASON_GROUP_PERMISSION:this._dataEvents.fireSymbolGroupNotPermitted(e.params[3]);break;default:this._dataEvents.fireSymbolNotPermitted(e.params[2])}else this.m_model.resetTimeScale(),this._dataEvents.fireSymbolError(e);this.m_model.realignLineTools();break;case"series_timeframe":if(e.params[1]!==this._turnaround)break;o=e.params[2],r=e.params[3],l=e.params[4],c=this.m_model.timeScale(),u=r,void 0===l?u+=c.defaultRightOffsetProperty().value():l.applyDefaultRightMargin?u+=c.defaultRightOffsetProperty().value():l.percentRightMargin&&(h=r-o+1,
u+=(d=Math.max(0,Math.min(.99,l.percentRightMargin/100)))*h/(1-d)),this.m_model.setTimeViewport(o,u);break;case"series_error":n=e.params[2],delete this._loadingStartTime,C.enabled("charting_library_debug_mode")&&U.logNormal("Error reason: "+n),this._setStatus(C.enabled("no_bars_status")&&this._symbolInfo?s.STATUS_NO_BARS:s.STATUS_INVALID_SYMBOL),"string"==typeof n&&(n.startsWith("study_not_auth:")?(p=n.split(":",2)[1].split("@",2)[0])in{BarSetRenko:!0,BarSetPriceBreak:!0,BarSetKagi:!0,BarSetPnF:!0}?this._dataEvents.fireChartTypeNotPermitted(p):"BarSetSpread"===p?this._dataEvents.fireIntradaySpreadNotPermitted():"BarSetRange"===p&&this._dataEvents.fireCustomIntervalNotPermitted():"resolution_not_entitled"===n?this._dataEvents.fireIntradayExchangeNotPermitted():"custom_resolution"===n?this._dataEvents.fireCustomIntervalNotPermitted():"seconds_not_entitled"===n&&isFeatureEnabled("seconds_bars")&&this._dataEvents.fireSecondsIntervalNotPermitted()),this._seriesLoaded=!0,this._dataEvents.fireSeriesError(e);break;case"series_loading":if(e.params[1]!==this._turnaround)break;if(e.params[0]!==this._seriesId){U.logNormal("command for old series. Expected:"+this._seriesId+", actual"+e.params.customId);break}this._setStatus(s.STATUS_LOADING),w._loadingStartTime=(new Date).getTime();break;case"series_completed":if(e.params[2]!==this._turnaround)break;if(e.params[0]!==this._seriesId){U.logNormal("command for old series. Expected:"+this._seriesId+", actual"+e.params.customId);break}if(this._setSymbolIntervalDelay){if(this._willSymbolIntervalChanged())return void U.logNormal("command comes during symbol/interval changing");U.logNormal("series_completed comes when symbol interval delay present but symbol/interval should not be changed")}switch(_="chartSession:"+w._chartApi._sessionid,f=(new Date).getTime()-this._loadingStartTime,U.logDebug(_+", Series loading took "+f+" ms, eod:"+this._endOfData),delete this._loadingStartTime,"pulsed"===(m=e.params[1])&&(m="delayed"),m){case"streaming":this._setStatus(s.STATUS_READY);break;case"endofday":this._setStatus(s.STATUS_EOD);break;case"delayed":this._setStatus(s.STATUS_DELAYED);break;case"pulsed":this._setStatus(s.STATUS_PULSE);break;case"replay":this._setStatus(s.STATUS_REPLAY)}m.match(/delayed_streaming/)&&this._setStatus(s.STATUS_DELAYED_STREAMING),(y=this.m_model.paneForSource(this)).recalculatePriceScale(this.priceScale()),this.m_model.fullUpdate(),this.m_data.size()&&this._dataEvents.fireTickMarksRangeChanged({start:a(this.data().first()).value[TradingView.TIME_PLOT],end:a(this.data().last()).value[TradingView.TIME_PLOT]}),this.model().recalcVisibleRangeStudy(this.model().dataSources(),!0),this.model().recalcStudyBasedLineTools(),!this.m_priceScale.isLockScale()||this.model().timeScale().isEmpty()||this._seriesLoaded||(this.model().timeScale()._correctOffset(),this.model().timeScale().correctBarSpacing(),this.model().resetPriceScale(y,this.priceScale())),this._seriesLoaded=!0,this._dataEvents.fireCompleted(),this.requestMoreData();break;case"series_deleted":break;case"data_update":
if(e.params.customId!==this._seriesId){U.logNormal("command for old series. Expected:"+this._seriesId+", actual"+e.params.customId);break}if(e.params.turnaround!==this._turnaround){U.logNormal("command for old series turnaround. Expected:"+this._turnaround+", actual"+e.params.turnaround);break}if(this._setSymbolIntervalDelay){if(this._willSymbolIntervalChanged())return void U.logNormal("command comes during symbol/interval changing");U.logNormal("data_update comes when symbol interval delay present but symbol/interval should not be changed")}if(this.status()===s.STATUS_INVALID_SYMBOL)break;e.params.plots.length?(g=this.m_data.bars().size(),v=this.m_data.bars().firstIndex(),S=this.m_data.bars().merge(e.params.plots),(null===v||S.index<v)&&(this._endOfData=!1),b="Merge bars. earliestRow:"+S.index+"} ",b+="bars state:{firstBar:"+a(this.m_data.bars().firstIndex())+",lastBar:"+a(this.m_data.bars().lastIndex())+",size:"+this.m_data.bars().size()+"}",z.logDebug(b),g!==this.bars().size()&&(this._dataEvents.fireBarReceived(S),this.model().recalcVisibleRangeStudy(this.model().dataSources(),!0))):this.m_data.clear(),new Promise(function(t){var i=w.properties().style.value();e.params.nonseries&&"nochange"!==e.params.nonseries.indexes&&Y.isRangeBasedStyle(i)?w.parseJapProjBars(e.params.nonseries).then(function(e){w.m_data.m_nsBars=e.nsBars,w.m_data.lastProjectionPrice=e.lastPrice;var i=w.m_data.boxSize!==e.boxSize;w.m_data.boxSize=e.boxSize,w.m_data.reversalAmount=e.reversalAmount,i&&w._boxSizeChanged.fire(w.m_data.boxSize),t()}):(e.params.nonseries||(w.m_data.m_nsBars.clear(),w.m_data.lastProjectionPrice=void 0),t(),t())}).then(function(){w._statusView.invalidate();var e=w.m_model.paneForSource(w);w.m_model.updateAllVolumeStudies(),w.m_model.recalculatePane(e),w.m_model.updateSource(w),w.m_model.updateLineTools(),w.m_model.updateCrossHair()})}this._dataEvents.fireMessageReceived(e)},s.prototype.parseJapProjBars=function(e){var t,i,n,o=new D(k()),r=this.model().timeScale(),a=this.properties().style.value();return new Promise(function(l){e.d&&""!==e.d?R(e.d).then(function(c){var u,h,d,p,_=c.data;for(t=_.price,i=_.boxSize,n=_.reversalAmount,u=_.bars,h=0;u&&h<u.length;h++)d=[],p=e.indexes[u[h].time],d.push(r.points().valueAt(p)),d.push(u[h].open),d.push(u[h].high),d.push(u[h].low),d.push(u[h].close),d.push(u[h].volume),a===s.STYLE_KAGI?d.push(u[h].additionalPrice):a===s.STYLE_PNF&&d.push(u[h].factor),o.add(p,d);l({nsBars:o,lastPrice:t,boxSize:i,reversalAmount:n})}):l({nsBars:o,lastPrice:t,boxSize:i,reversalAmount:n})})},s.prototype.disconnect=function(){this._seriesId&&this._chartApi.removeSeries(this._seriesId),this._symbolId=null,this._seriesId=null,this._predictBars=0,this._status=s.STATUS_OFFLINE},s.prototype.isStarted=function(){return!!this._symbolId},s.prototype.restart=function(){var e,t;this._status!==s.STATUS_SNAPSHOT&&(e=i("OK+B"),this._onRestarted.fire(),this._setStatus(s.STATUS_RESOLVING),this.m_data=new M,this.updateSymbolInfo(null),this._prevSymbolId=this._symbolId,this._symbolId=this._makeNextSymbolId(),
t=this._properties.interval.value(),this._pendingTimeRange&&(t=this._generateTimeframe(t,this._pendingTimeRange),delete this._pendingTimeRange),this._onBeforeModifySeries(this.getSymbolString(),t),t=q(t),this._chartApi.resolveSymbol(this._symbolId,this._getResolvingSymbolString(),this._handler),this._seriesId?(this._turnaround="s"+ ++this._turnaroundCounter,this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,t,this._handler,this._prevSymbolId)):(this._seriesId=this._makeNextSeriesId(),!1===this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,t,this._prepareChartApiParams(),this._handler)&&(this._seriesId=void 0)),this._properties.showInDataWindow.listeners().subscribe(this.m_model,e.prototype.fullUpdate),this.m_symbol=this._properties.symbol.value(),this.m_interval=this._properties.interval.value())},s.prototype._generateTimeframe=function(e,t){var i=t.slice(-1),n=e;return"ytd"===t?n+=",YTD":"d"===i?(n+=","+t.slice(0,-1),C.enabled("daily_timeframe_suffix")&&(n+="D")):"m"===i?n+=","+t.slice(0,-1)+"M":"all"===t&&(n+=",ALL"),n},s.prototype.hasDelayedSymbolIntervalChange=function(){return!!this._setSymbolIntervalDelay},s.prototype.setSymbolIntervalDelayed=function(){this._isDWMCached=null,this._willSymbolIntervalChanged()&&(this._setSymbolIntervalDelay&&(U.logNormal("Clear timeout to change symbol/interval #"+this._setSymbolIntervalDelay),clearTimeout(this._setSymbolIntervalDelay)),this._setSymbolIntervalDelay=setTimeout(function(){U.logNormal("Timeout #"+this._setSymbolIntervalDelay+' fired, new symbol will be "'+this._properties.symbol.value()+'"'),delete this._setSymbolIntervalDelay,this._setSymbolInterval(this._properties.symbol.value(),this._properties.interval.value())}.bind(this),30),U.logNormal("Started timeout #"+this._setSymbolIntervalDelay+' to change symbol/interval from "'+this.m_symbol+'" to "'+this._properties.symbol.value()+'"'))},s.prototype._willSymbolIntervalChanged=function(){var e=this._checkIntervalWillChanged(this._parseInterval(this._properties.interval.value()).interval),t=this._checkSymbolWillChanged(this._properties.symbol.value());return t||e},s.prototype._checkSymbolWillChanged=function(e){return!this.symbolSameAsCurrent(e)||C.enabled("same_data_requery")},s.prototype._checkIntervalWillChanged=function(e){return this.m_interval!==e||C.enabled("same_data_requery")},s.prototype._parseInterval=function(e){var t=(e+"").split(",");return{interval:2===t.length?t[0]:e,timeframe:2===t.length?t[1]:0}},s.prototype.rerequestData=function(){this._setSymbolInterval(this.m_symbol,this.m_interval,!0)},s.prototype._setSymbolInterval=function(e,t,i){var n,o,r,a,l,c,u;this.clearGotoDateResult(),(n=Z.isRange(t))&&this._properties.rangeStyle.inputs.range.setValue(Z.parse(t).multiplier()),r=(o=this._parseInterval(t)).interval,a=o.timeframe,l=this._checkSymbolWillChanged(e),c=this._checkIntervalWillChanged(r),(l||c||i)&&((n||Z.isRange(this.m_interval))&&(this._symbolId=null),this._syncModel=null,this.m_symbol=e,this.m_interval=r,this.m_timeframe=a,
this._symbolId&&!l||this.updateSymbolInfo(null),this.m_model.realignLineTools(),this._status!==s.STATUS_SNAPSHOT&&(this._setStatus(s.STATUS_RESOLVING),this._symbolIntervalChanged.fire(),c&&(u={timeframe:this._pendingTimeRange},this._intervalChanged.fire(this.m_interval,u),this._pendingTimeRange=u.timeframe&&u.timeframe.toLowerCase()),this._onRestarted.fire(),this._seriesLoaded=!1,this._chartApi&&this._chartApi.connected()&&(this._symbolId&&!l||(this._prevSymbolId=this._symbolId,this._symbolId=this._makeNextSymbolId(),this._chartApi.resolveSymbol(this._symbolId,this._getResolvingSymbolString(),this._handler)),this._seriesId?(this._onBeforeModifySeries(this.getSymbolString(),t),this._pendingTimeRange&&(t=this._generateTimeframe(t,this._pendingTimeRange),delete this._pendingTimeRange),this._turnaround="s"+ ++this._turnaroundCounter,this._predictBars=0,t=q(t),this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,t,this._handler,this._prevSymbolId)):(this._onBeforeModifySeries(this.getSymbolString(),t),this._seriesId=this._makeNextSeriesId(),t=q(t),this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,t,this._prepareChartApiParams(),this._handler)))))},s.prototype.setDefaultTimeframe=function(e){this._pendingTimeRange=e},s.prototype.actualSymbol=function(){return this.symbolInfo()?this.symbolInfo().full_name:this.symbol()},s.prototype.proSymbol=function(){return this.symbolInfo()?this.symbolInfo().pro_name:this.symbol()},s.prototype.symbol=function(){return this.properties().symbol.value()},s.prototype.interval=function(){return this.properties().interval.value()},s.prototype.bars=function(){return this.m_data.m_bars},s.prototype.nsBars=function(){return this.m_data.m_nsBars},s.prototype.open=function(e){return this.m_data.valueAt(e)[TradingView.OPEN_PLOT]},s.prototype.high=function(e){return this.m_data.valueAt(e)[TradingView.HIGH_PLOT]},s.prototype.low=function(e){return this.m_data.valueAt(e)[TradingView.LOW_PLOT]},s.prototype.close=function(e){return this.m_data.valueAt(e)[TradingView.CLOSE_PLOT]},s.prototype.hl2=function(e){return(this.high(e)+this.low(e))/2},s.prototype.hlc3=function(e){return(this.high(e)+this.low(e)+this.close(e))/3},s.prototype.ohlc4=function(e){return(this.open(e)+this.high(e)+this.low(e)+this.close(e))/4},s.prototype.priceRange=function(e,t){var i,n,o,s,a,l,c,u;return TradingView.isInteger(e)?TradingView.isInteger(t)?this.data().isEmpty()?null:this.m_priceScale.isLockScale()&&null!==(i=this._model.mainSeriesScaleRatio())?(n=this.priceScale().internalHeight()/(this.model().timeScale().barSpacing()/i),s=((o=this.data().search(t,V.NearestLeft)).value[TradingView.HIGH_PLOT]+o.value[TradingView.LOW_PLOT])/2,new r(s-.5*n,s+.5*n)):(null!==(a=this.priceSource())?(l=this.data().bars().minMaxOnRangeCached(e,t,[{name:a,offset:0}]),c=this.data().nsBars().minMaxOnRangeCached(e,t,[{name:a,offset:0}])):(l=this.data().bars().minMaxOnRangeCached(e,t,[{name:"low",offset:0},{name:"high",offset:0}]),c=this.data().nsBars().minMaxOnRange(e,t,[{name:"low",offset:0},{
name:"high",offset:0}])),u=null!==(l=B(l,c))?l.min===l.max?new r(l.min-.5,l.max+.5):new r(l.min,l.max):new r(-.5,.5),this.priceScale().isLog()?new r(this.priceScale().priceToLogical(u.minValue()),this.priceScale().priceToLogical(u.maxValue())):u):(U.logDebug("Series.priceRange: incorrect endBar"),null):(U.logDebug("Series.priceRange: incorrect startBar"),null)},s.prototype.nearestData=function(e,t){if(TradingView.isInteger(e)){var i=this.data().search(e,t);return null!==i?i:void 0}U.logDebug("Series.nearestData: incorrect logicalPoint")},s.prototype.nearestIndex=function(e,t){var i=this.nearestData(e,t);return i?i.index:void 0},s.prototype.paneViews=function(){if(!this.properties().visible.value())return null;var e=[this._baseHorizontalLineView,this._paneView];return this._futureBarsPaneView&&e.push(this._futureBarsPaneView),this._projectionBarsPaneView&&e.push(this._projectionBarsPaneView),null!==this._waterlineView&&e.push(this._waterlineView),null!==this._priceLineView&&e.push(this._priceLineView),null!==this._gotoDateView&&e.push(this._gotoDateView),e.push(this._panePriceAxisView),e.push(this._projectionPriceAxisView),e},s.prototype.dataWindowView=function(){return this._dataWindowView},s.prototype.legendView=function(){return this._legendView},s.prototype.statusView=function(){return ae?this._statusView:null},s.prototype.priceAxisViews=function(e,t){return e.findTargetPriceAxisViews(this,t,this._priceAxisViews,[this._priceLinePriceAxisView])},s.prototype.purgeSymbolInfo=function(){this._symbolInfo=null,this._isDWMCached=null},s.prototype.symbolInfo=function(){return this._symbolInfo},s.prototype.updateSymbolInfo=function(e){var t,i,n=Y.extractSymbolNameFromSymbolInfo(e,this.m_symbol);this._symbolInfo=e,e&&(this._properties.shortName.setValue(e.name),t=this._properties.symbol.value(),i=n,C.enabled("uppercase_instrument_names")&&(t=t.toUpperCase(),i=i.toUpperCase()),n&&t!==i&&this._properties.symbol.setValue(n)),this._base=e?e.pricescale/e.minmov:100,this._recreatePriceFormattingDependencies(),this._statusView.update(),this.priceScale().updateFormatter(),this._quotesProvider.setQuotesSessionSymbol(n),this.checkInterval()},s.prototype._onQuotesUpdate=function(e,t){this.marketStatus.setValue(t.values.current_session),se&&void 0!==t.values.prev_close_price&&(this._legendView.update(),this.m_model.updateSource(this))},s.prototype.dataPoweredBy=function(){return null},s.prototype.symbolSameAsCurrent=function(e){if(X(this.m_symbol,e))return!0;var t=this._symbolInfo;if(t){if(X(t.full_name,e)||X(t.pro_name,e))return!0;if(X(t.ticker,e))return!0;if(t.aliases&&Q(t.aliases,e))return!0;if(t.alternatives&&Q(t.alternatives,e))return!0;if(0===e.indexOf("FRA:")&&X(t.pro_name,e.replace("FRA:","FWB:")))return!0}return!1},s.prototype.updateAllViews=function(){var e,t;for(this._paneView.update(),this._dataWindowView.update(),this._legendView.update(),this._statusView.update(),e=this._priceAxisViews.length,t=0;t<e;t++)this._priceAxisViews[t].update();this._priceLinePriceAxisView.update(),
if(e.params.customId!==this._seriesId){U.logNormal("command for old series. Expected:"+this._seriesId+", actual"+e.params.customId);break}if(e.params.turnaround!==this._turnaround){U.logNormal("command for old series turnaround. Expected:"+this._turnaround+", actual"+e.params.turnaround);break}if(this._setSymbolIntervalDelay){if(this._willSymbolIntervalChanged())return void U.logNormal("command comes during symbol/interval changing");U.logNormal("data_update comes when symbol interval delay present but symbol/interval should not be changed")}if(this.status()===s.STATUS_INVALID_SYMBOL)break;e.params.plots.length?(g=this.m_data.bars().size(),v=this.m_data.bars().firstIndex(),S=this.m_data.bars().merge(e.params.plots),(null===v||S.index<v)&&(this._endOfData=!1),b="Merge bars. earliestRow:"+S.index+"} ",b+="bars state:{firstBar:"+a(this.m_data.bars().firstIndex())+",lastBar:"+a(this.m_data.bars().lastIndex())+",size:"+this.m_data.bars().size()+"}",z.logDebug(b),g!==this.bars().size()&&(this._dataEvents.fireBarReceived(S),this.model().recalcVisibleRangeStudy(this.model().dataSources(),!0))):this.m_data.clear(),new Promise(function(t){var i=w.properties().style.value();e.params.nonseries&&"nochange"!==e.params.nonseries.indexes&&Y.isRangeBasedStyle(i)?w.parseJapProjBars(e.params.nonseries).then(function(e){w.m_data.m_nsBars=e.nsBars,w.m_data.lastProjectionPrice=e.lastPrice;var i=w.m_data.boxSize!==e.boxSize;w.m_data.boxSize=e.boxSize,w.m_data.reversalAmount=e.reversalAmount,i&&w._boxSizeChanged.fire(w.m_data.boxSize),t()}):(e.params.nonseries||(w.m_data.m_nsBars.clear(),w.m_data.lastProjectionPrice=void 0),t(),t())}).then(function(){w._statusView.invalidate();var e=w.m_model.paneForSource(w);w.m_model.updateAllVolumeStudies(),w.m_model.recalculatePane(e),w.m_model.updateSource(w),w.m_model.updateLineTools(),w.m_model.updateCrossHair()})}this._dataEvents.fireMessageReceived(e)},s.prototype.parseJapProjBars=function(e){var t,i,n,o=new D(k()),r=this.model().timeScale(),a=this.properties().style.value();return new Promise(function(l){e.d&&""!==e.d?R(e.d).then(function(c){var u,h,d,p,_=c.data;for(t=_.price,i=_.boxSize,n=_.reversalAmount,u=_.bars,h=0;u&&h<u.length;h++)d=[],p=e.indexes[u[h].time],d.push(r.points().valueAt(p)),d.push(u[h].open),d.push(u[h].high),d.push(u[h].low),d.push(u[h].close),d.push(u[h].volume),a===s.STYLE_KAGI?d.push(u[h].additionalPrice):a===s.STYLE_PNF&&d.push(u[h].factor),o.add(p,d);l({nsBars:o,lastPrice:t,boxSize:i,reversalAmount:n})}):l({nsBars:o,lastPrice:t,boxSize:i,reversalAmount:n})})},s.prototype.disconnect=function(){this._seriesId&&this._chartApi.removeSeries(this._seriesId),this._symbolId=null,this._seriesId=null,this.m_symbol=void 0,this._predictBars=0,this._status=s.STATUS_OFFLINE},s.prototype.isStarted=function(){return!!this._symbolId},s.prototype.restart=function(){var e,t;this._status!==s.STATUS_SNAPSHOT&&(e=i("OK+B"),this._onRestarted.fire(),this._setStatus(s.STATUS_RESOLVING),this.m_data=new M,this.updateSymbolInfo(null),this._prevSymbolId=this._symbolId,
this._symbolId=this._makeNextSymbolId(),t=this._properties.interval.value(),this._pendingTimeRange&&(t=this._generateTimeframe(t,this._pendingTimeRange),delete this._pendingTimeRange),this._onBeforeModifySeries(this.getSymbolString(),t),t=q(t),this._chartApi.resolveSymbol(this._symbolId,this._getResolvingSymbolString(),this._handler),this._seriesId?(this._turnaround="s"+ ++this._turnaroundCounter,this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,t,this._handler,this._prevSymbolId)):(this._seriesId=this._makeNextSeriesId(),!1===this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,t,this._prepareChartApiParams(),this._handler)&&(this._seriesId=void 0)),this._properties.showInDataWindow.listeners().subscribe(this.m_model,e.prototype.fullUpdate),this.m_symbol=this._properties.symbol.value(),this.m_interval=this._properties.interval.value())},s.prototype._generateTimeframe=function(e,t){var i=t.slice(-1),n=e;return"ytd"===t?n+=",YTD":"d"===i?(n+=","+t.slice(0,-1),C.enabled("daily_timeframe_suffix")&&(n+="D")):"m"===i?n+=","+t.slice(0,-1)+"M":"all"===t&&(n+=",ALL"),n},s.prototype.hasDelayedSymbolIntervalChange=function(){return!!this._setSymbolIntervalDelay},s.prototype.setSymbolIntervalDelayed=function(){this._isDWMCached=null,this._willSymbolIntervalChanged()&&(this._setSymbolIntervalDelay&&(U.logNormal("Clear timeout to change symbol/interval #"+this._setSymbolIntervalDelay),clearTimeout(this._setSymbolIntervalDelay)),this._setSymbolIntervalDelay=setTimeout(function(){U.logNormal("Timeout #"+this._setSymbolIntervalDelay+' fired, new symbol will be "'+this._properties.symbol.value()+'"'),delete this._setSymbolIntervalDelay,this._setSymbolInterval(this._properties.symbol.value(),this._properties.interval.value())}.bind(this),30),U.logNormal("Started timeout #"+this._setSymbolIntervalDelay+' to change symbol/interval from "'+this.m_symbol+'" to "'+this._properties.symbol.value()+'"'))},s.prototype._willSymbolIntervalChanged=function(){var e=this._checkIntervalWillChanged(this._parseInterval(this._properties.interval.value()).interval),t=this._checkSymbolWillChanged(this._properties.symbol.value());return t||e},s.prototype._checkSymbolWillChanged=function(e){return!this.symbolSameAsCurrent(e)||C.enabled("same_data_requery")},s.prototype._checkIntervalWillChanged=function(e){return this.m_interval!==e||C.enabled("same_data_requery")},s.prototype._parseInterval=function(e){var t=(e+"").split(",");return{interval:2===t.length?t[0]:e,timeframe:2===t.length?t[1]:0}},s.prototype.rerequestData=function(){this._setSymbolInterval(this.m_symbol,this.m_interval,!0)},s.prototype._setSymbolInterval=function(e,t,i){var n,o,r,a,l,c,u;this.clearGotoDateResult(),(n=Z.isRange(t))&&this._properties.rangeStyle.inputs.range.setValue(Z.parse(t).multiplier()),r=(o=this._parseInterval(t)).interval,a=o.timeframe,l=this._checkSymbolWillChanged(e),c=this._checkIntervalWillChanged(r),(l||c||i)&&((n||Z.isRange(this.m_interval))&&(this._symbolId=null),this._syncModel=null,this.m_symbol=e,this.m_interval=r,
this.m_timeframe=a,this._symbolId&&!l||this.updateSymbolInfo(null),this.m_model.realignLineTools(),this._status!==s.STATUS_SNAPSHOT&&(this._setStatus(s.STATUS_RESOLVING),this._symbolIntervalChanged.fire(),c&&(u={timeframe:this._pendingTimeRange},this._intervalChanged.fire(this.m_interval,u),this._pendingTimeRange=u.timeframe&&u.timeframe.toLowerCase()),this._onRestarted.fire(),this._seriesLoaded=!1,this._chartApi&&this._chartApi.connected()&&(this._symbolId&&!l||(this._prevSymbolId=this._symbolId,this._symbolId=this._makeNextSymbolId(),this._chartApi.resolveSymbol(this._symbolId,this._getResolvingSymbolString(),this._handler)),this._seriesId?(this._onBeforeModifySeries(this.getSymbolString(),t),this._pendingTimeRange&&(t=this._generateTimeframe(t,this._pendingTimeRange),delete this._pendingTimeRange),this._turnaround="s"+ ++this._turnaroundCounter,this._predictBars=0,t=q(t),this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,t,this._handler,this._prevSymbolId)):(this._onBeforeModifySeries(this.getSymbolString(),t),this._seriesId=this._makeNextSeriesId(),t=q(t),this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,t,this._prepareChartApiParams(),this._handler)))))},s.prototype.setDefaultTimeframe=function(e){this._pendingTimeRange=e},s.prototype.actualSymbol=function(){return this.symbolInfo()?this.symbolInfo().full_name:this.symbol()},s.prototype.proSymbol=function(){return this.symbolInfo()?this.symbolInfo().pro_name:this.symbol()},s.prototype.symbol=function(){return this.properties().symbol.value()},s.prototype.interval=function(){return this.properties().interval.value()},s.prototype.bars=function(){return this.m_data.m_bars},s.prototype.nsBars=function(){return this.m_data.m_nsBars},s.prototype.open=function(e){return this.m_data.valueAt(e)[TradingView.OPEN_PLOT]},s.prototype.high=function(e){return this.m_data.valueAt(e)[TradingView.HIGH_PLOT]},s.prototype.low=function(e){return this.m_data.valueAt(e)[TradingView.LOW_PLOT]},s.prototype.close=function(e){return this.m_data.valueAt(e)[TradingView.CLOSE_PLOT]},s.prototype.hl2=function(e){return(this.high(e)+this.low(e))/2},s.prototype.hlc3=function(e){return(this.high(e)+this.low(e)+this.close(e))/3},s.prototype.ohlc4=function(e){return(this.open(e)+this.high(e)+this.low(e)+this.close(e))/4},s.prototype.priceRange=function(e,t){var i,n,o,s,a,l,c,u;return TradingView.isInteger(e)?TradingView.isInteger(t)?this.data().isEmpty()?null:this.m_priceScale.isLockScale()&&null!==(i=this._model.mainSeriesScaleRatio())?(n=this.priceScale().internalHeight()/(this.model().timeScale().barSpacing()/i),s=((o=this.data().search(t,V.NearestLeft)).value[TradingView.HIGH_PLOT]+o.value[TradingView.LOW_PLOT])/2,new r(s-.5*n,s+.5*n)):(null!==(a=this.priceSource())?(l=this.data().bars().minMaxOnRangeCached(e,t,[{name:a,offset:0}]),c=this.data().nsBars().minMaxOnRangeCached(e,t,[{name:a,offset:0}])):(l=this.data().bars().minMaxOnRangeCached(e,t,[{name:"low",offset:0},{name:"high",offset:0}]),c=this.data().nsBars().minMaxOnRange(e,t,[{name:"low",
offset:0},{name:"high",offset:0}])),u=null!==(l=B(l,c))?l.min===l.max?new r(l.min-.5,l.max+.5):new r(l.min,l.max):new r(-.5,.5),this.priceScale().isLog()?new r(this.priceScale().priceToLogical(u.minValue()),this.priceScale().priceToLogical(u.maxValue())):u):(U.logDebug("Series.priceRange: incorrect endBar"),null):(U.logDebug("Series.priceRange: incorrect startBar"),null)},s.prototype.nearestData=function(e,t){if(TradingView.isInteger(e)){var i=this.data().search(e,t);return null!==i?i:void 0}U.logDebug("Series.nearestData: incorrect logicalPoint")},s.prototype.nearestIndex=function(e,t){var i=this.nearestData(e,t);return i?i.index:void 0},s.prototype.paneViews=function(){if(!this.properties().visible.value())return null;var e=[this._baseHorizontalLineView,this._paneView];return this._futureBarsPaneView&&e.push(this._futureBarsPaneView),this._projectionBarsPaneView&&e.push(this._projectionBarsPaneView),null!==this._waterlineView&&e.push(this._waterlineView),null!==this._priceLineView&&e.push(this._priceLineView),null!==this._gotoDateView&&e.push(this._gotoDateView),e.push(this._panePriceAxisView),e.push(this._projectionPriceAxisView),e},s.prototype.dataWindowView=function(){return this._dataWindowView},s.prototype.legendView=function(){return this._legendView},s.prototype.statusView=function(){return ae?this._statusView:null},s.prototype.priceAxisViews=function(e,t){return e.findTargetPriceAxisViews(this,t,this._priceAxisViews,[this._priceLinePriceAxisView])},s.prototype.purgeSymbolInfo=function(){this._symbolInfo=null,this._isDWMCached=null},s.prototype.symbolInfo=function(){return this._symbolInfo},s.prototype.updateSymbolInfo=function(e){var t,i,n=Y.extractSymbolNameFromSymbolInfo(e,this.m_symbol);this._symbolInfo=e,e&&(this._properties.shortName.setValue(e.name),t=this._properties.symbol.value(),i=n,C.enabled("uppercase_instrument_names")&&(t=t.toUpperCase(),i=i.toUpperCase()),n&&t!==i&&this._properties.symbol.setValue(n)),this._base=e?e.pricescale/e.minmov:100,this._recreatePriceFormattingDependencies(),this._statusView.update(),this.priceScale().updateFormatter(),this._quotesProvider.setQuotesSessionSymbol(n),this.checkInterval()},s.prototype._onQuotesUpdate=function(e,t){this.marketStatus.setValue(t.values.current_session),se&&void 0!==t.values.prev_close_price&&(this._legendView.update(),this.m_model.updateSource(this))},s.prototype.dataPoweredBy=function(){return null},s.prototype.symbolSameAsCurrent=function(e){if(X(this.m_symbol,e))return!0;var t=this._symbolInfo;if(t){if(X(t.full_name,e)||X(t.pro_name,e))return!0;if(X(t.ticker,e))return!0;if(t.aliases&&Q(t.aliases,e))return!0;if(t.alternatives&&Q(t.alternatives,e))return!0;if(0===e.indexOf("FRA:")&&X(t.pro_name,e.replace("FRA:","FWB:")))return!0}return!1},s.prototype.updateAllViews=function(){var e,t;for(this._paneView.update(),this._dataWindowView.update(),this._legendView.update(),this._statusView.update(),e=this._priceAxisViews.length,t=0;t<e;t++)this._priceAxisViews[t].update();this._priceLinePriceAxisView.update(),
this._futureBarsPaneView&&this._futureBarsPaneView.update(),this._projectionBarsPaneView&&this._projectionBarsPaneView.update(),null!==this._waterlineView&&this._waterlineView.update(),null!==this._priceLineView&&this._priceLineView.update(),null!==this._gotoDateView&&this._gotoDateView.update(),this._baseHorizontalLineView.update()},s.prototype._setStatus=function(e){this._status=e,this._statusView.update(),this.m_model.updateSource(this),this._onStatusChanged.fire()},s.prototype.requestMoreData=function(e){var t,i,n,o;this._status!==s.STATUS_READY&&this._status!==s.STATUS_PULSE&&this._status!==s.STATUS_DELAYED&&this._status!==s.STATUS_DELAYED_STREAMING&&this._status!==s.STATUS_EOD&&this._status!==s.STATUS_REPLAY||this.m_model.timeScale().isEmpty()||null!==(t=this.m_model.timeScale().visibleBarsStrictRange())&&0!==this.bars().size()&&(i=t.lastBar()-a(this.data().last()).index,this._predictBars<i&&(this._predictBars=i,this._chartApi&&this._chartApi.connected()&&this._chartApi.requestMoreTickmarks(this._seriesId,i,this._handler)),this._endOfData||(n=a(this.bars().firstIndex()),(o=e||n-t.firstBar())<=0||(Number.isFinite(o)?(this._endOfData=!0,this._chartApi&&this._chartApi.connected()&&(this._chartApi.requestMoreData(this._seriesId,o,this._handler),C.enabled("charting_library_base")&&(this._predictBars=0)),this._setStatus(s.STATUS_LOADING)):U.logWarn("requestMoreData: invalid bar count: "+o+", visible bars: ["+t.firstBar()+", "+t.lastBar()+"], last index: "+a(this.data().last()).index+", predicted bars: "+this._predictBars+", required bars:"+e))))},s.prototype.bindStyleChange=function(){var e=this;Object.keys(s.STYLE_SHORT_NAMES).map(function(e){return s.STYLE_SHORT_NAMES[e]+"Style"}).forEach(function(t){e._properties[t].listeners().subscribe(e,s.prototype.invalidateBarStylesCache)})},s.prototype.bindJapChartsInputs=function(){this._properties.style.listeners().subscribe(this,this.onChartStyleChanged),this._properties.renkoStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.wicks.listeners().subscribe(this,this.onInputChanged),this._properties.pbStyle.inputs.lb.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.sources.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),
this._properties.pnfStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.oneStepBackBuilding.listeners().subscribe(this,this.onInputChanged),this._properties.rangeStyle.inputs.phantomBars.listeners().subscribe(this,this.onInputChanged)},s.prototype.createExtendedHoursProperty=function(){function e(){var e="undefined"!=typeof ProductFeatures&&isProductFeatureEnabled(ProductFeatures.EXTENDED_SESSION),i=t.model().readOnly(),n=t._properties.extendedHours.value(),o=C.enabled("widget");!n||o||i||e||(t._dataEvents.fireExtendedHoursNotPermitted(),n=!1),n&&t.isDWM()&&(n=!1),t.extendedHours.setValue(n)}var t=this;t.extendedHours=new o,t._properties.extendedHours.listeners().subscribe(null,e),t._properties.interval.listeners().subscribe(null,e),t.chartWidgetInitialized.subscribe(null,e),e()},s.prototype.dividendsAdjustmentProperty=function(){return null},s.prototype.setChartStyleWithIntervalIfNeeded=function(e,t){var i=t;void 0===t&&(i=K(e,this._properties.interval.value(),this._model.defaultResolutions())),Z.isEqual(i,this._properties.interval.value())||this._properties.interval.setValue(i),this._properties.style.setValue(e)},s.prototype.isNeedRestart=function(e){return this._status!==s.STATUS_SNAPSHOT&&(void 0===e&&(e=this.properties().style.value()),!Y.isRangeStyle(this._prevChartStyle)&&!Y.isRangeStyle(e)&&!(this._prevChartStyle===e||!Y.isRequiringRestartSeriesStyles(this._prevChartStyle)&&!Y.isRequiringRestartSeriesStyles(e)))},s.prototype.onChartStyleChanged=function(){this._updateBarFunction(),this.isNeedRestart()&&(this.data().clear(),this.model().timeScale().scrollToRealtime(!1),this.restart()),this._prevChartStyle=this.properties().style.value(),this._onStyleChanged.fire(this.properties().style.value()),this.invalidateBarStylesCache()},s.prototype.applyPreferences=function(e){var t=ie({},e);this.m_priceScale.setMode({autoScale:t.priceAxisProperties.autoScale,percentage:t.priceAxisProperties.percentage,log:t.priceAxisProperties.log,lockScale:t.priceAxisProperties.lockScale}),this.setChartStyleWithIntervalIfNeeded(t.style),delete t.style,delete t.interval,this._properties.mergePreferences(t),this._properties.saveDefaults(),this.createPaneView(),this.invalidateBarStylesCache()},s.prototype.barFunction=function(){return this._barFunction},s.prototype.priceSource=function(){var e=null;switch(this._properties.style.value()){case s.STYLE_LINE:e=this._properties.lineStyle.priceSource.value();break;case s.STYLE_AREA:e=this._properties.areaStyle.priceSource.value();break;case s.STYLE_BASELINE:e=this._properties.baselineStyle.priceSource.value()}return e},s.prototype._updateBarFunction=function(){if(this._properties.style.value()===s.STYLE_HILO)this._barFunction=A("low");else{var e=this.priceSource()||"close";this._barFunction=A(e)}},s.prototype.style=function(){return this.properties().style.value()},s.prototype.isRangeBasedStyle=function(){return Y.isRangeBasedStyle(this.style())},s.prototype.onInputChanged=function(){this.restart()},
s.prototype.onExtendedHoursChanged=function(){return this._extendedHoursChanged},s.prototype._getSymbolObject=function(){var e;return e={symbol:e=C.enabled("pay_attention_to_ticker_not_symbol")&&this._symbolInfo?this._symbolInfo.ticker:this.actualSymbol()},this.extendedHours.value()&&(e.session="extended"),s.SYMBOL_STRING_DATA.hasOwnProperty(this._properties.style.value())&&(e={symbol:e,type:this.styleStudyInfo(this.getStyleShortName()+"Style").studyId+"!",inputs:this.getInputsProperties().state()}),e},s.prototype.getSymbolString=function(){return oe(this._getSymbolObject())},s.prototype._getResolvingSymbolString=function(){var e=this._getSymbolObject();return oe(e)},s.prototype.getStyleShortName=function(){var e=this._properties.style.value();if(s.STYLE_SHORT_NAMES.hasOwnProperty(e))return s.STYLE_SHORT_NAMES[e];throw new Error("Missed short name for style "+e)},s.prototype.getStyleProperties=function(){return this._properties[this.getStyleShortName()+"Style"]},s.prototype.getInputsProperties=function(){return this.getStyleProperties().inputs||new o},s.prototype.getInputsInfoProperties=function(){return this.getStyleProperties().inputInfo||new o},s.prototype.getRealVisibleRange=function(){var e,t,i=this.model().timeScale().visibleBarsStrictRange();return null===i?null:(e=this.data().search(i.firstBar(),V.NearestRight),t=this.data().search(i.lastBar(),V.NearestLeft),null===e||null===t?null:new x(e.index,t.index))},s.prototype.firstValue=function(){var e=this.firstBar();return null===e?null:this._barFunction(e)},s.prototype.firstBar=function(){var e,t,i=this.model().timeScale().visibleBarsStrictRange();return null===i?null:(e=i.firstBar(),null!==(t=this.data().search(e,V.NearestRight))?t.value:null)},s.prototype.isSpread=function(){return null!==this._symbolInfo&&"spread"===this._symbolInfo.type},s.prototype.firstSymbol=function(){return this._symbolInfo?this._symbolInfo.legs[0]:""},s.prototype.firstShortName=function(){return E.ticker(this.firstSymbol())},s.prototype.loadDataTo=function(e){this._turnaround="s"+ ++this._turnaroundCounter;var t=this._properties.interval.value();t=this._generateTimeframe(t,e),this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,t,this._handler)},s.prototype.checkInterval=function(){if(this._symbolInfo&&(Z.isIntraday(this.interval())&&!this._symbolInfo.has_intraday&&this.requestingIntradayWhenNotSupported.fire(),this._symbolInfo.hasOwnProperty("supported_resolutions"))){var e=Z.normalize(this._properties.interval.value());-1===this._symbolInfo.supported_resolutions.indexOf(e)&&this.requestingResolutionWhenNotSupported.fire(this._symbolInfo.supported_resolutions[0])}},s.prototype.priceScale=function(){return this.m_priceScale},s.prototype.setPriceScale=function(e){this.m_priceScale!==e&&(this.m_priceScale=e,this._priceScaleChanged.fire(e),this._properties.removeProperty("priceAxisProperties"),this._properties.addChild("priceAxisProperties",e.properties()),this._properties.priceAxisProperties.childChanged(),re.emit("series_event","price_scale_changed"))},