y[r].value[0])?y.push({index:(l=_,p=a(),l0?g:void 0,a,i)}}),!b._studiesCache[e]||!b._studiesCache[e][o])throw Error("This should never happen");b._studiesCache[e][o].engine=c}catch(e){if(!e.studyError)throw e;h(e.message)}else h("Unsupported resolution. Did you forget to set has_intraday to true?")},P=function(e){h(e)},C=function(){return b._studiesCache[e]&&b._studiesCache[e][o]&&b._studiesCache[e][o].activeResolve===m};b._studiesCache[e][o].activeResolve=m,this.resolveSymbol(i,function(){C()&&w.apply(b,arguments)},function(){C()&&P.apply(b,arguments)})},u.prototype._createStudy=function(e,t,i,o,a,l,c){function u(i,r,s){i=n(i),
+TradingView.ChartapiMessagerInstances[o].onDataUpdate(a,l,p._convertBarsTimeToUnix(i),r,s,p._extendedRange(e,t)),TradingView.ChartapiMessagerInstances[o].onStudyCompleted(a,l)}var h,d,p=this;c=function(e){var t,i,n;if(Array.isArray(e))return e;for(t=[],i=p._studiesCache[o][a].metainfo.inputs,n=0;n0?1e3*d[0].value[0]:void 0,h.nextTime&&(!p||h.nextTime=0&&u&&e.lastBar){for(h=[],d=0;d<=c;d++)h.push(s+.001*d);(p=e.lastBar.slice(0))[0]=p[0]/1e3,TradingView.ChartapiMessagerInstances[n].onTimescaleUpdate(o,r,[{index:u-1,value:p}],t,u-1,h),a(t,u+c,_=1e3*Math.trunc(h[c])),l.rebuildExtrapolatedData(n,t.full_name,i,t,_)}l._updateProjectionData(n,o,r,e)})},u.prototype.onMoreTickmarksRequested=function(e,t,i,n,o){this._extrapolationManager.storage(e,i.full_name,n).onTickmarksNeeded(i,o)},u.prototype.removePointset=function(e){this._pointsetsManager.removePointset(e)},
+u.prototype.rebuildExtrapolatedData=function(e,t,i,n,o){this._extrapolationManager.storage(e,n.full_name,i).rebuild(o,n)},u.prototype.createPointset=function(e,t,i,n,o,r){var s=this._extrapolationManager.storage(e,n.full_name,o);this._pointsetsManager.createPointset(t,i,r,s,n,e)},u.prototype.studiesMetadata=function(){return 0===this._metainfoCache.length&&(this._metainfoCache=JSServer.studyLibrary.map(function(e){return e.metainfo}),this._metainfoCache.push({palettes:{},inputs:[],plots:[{id:"open",type:"line"},{id:"high",type:"line"},{id:"low",type:"line"},{id:"close",type:"line"},{id:"volume",type:"line"}],graphics:{},_metainfoVersion:48,description:"Unnamed Study",format:{type:"inherit"},is_hidden_study:!0,is_price_study:!1,shortDescription:"Unnamed Study",description_localized:"Unnamed Study",id:"BarSetHeikenAshi@tv-prostudies",shortId:"BarSetHeikenAshi",packageId:"tv-basicstudies",version:"13",fullId:"BarSetHeikenAshi@tv-basicstudies-13",productId:"tv-basicstudies",name:"BarSetHeikenAshi@tv-basicstudies"})),this._metainfoCache},u.prototype.searchSymbols=function(e,t,i,n){this._logMessage("Symbol search requested: search string `{0}`, exchange: `{1}`, type `{2}`".format(e,t,i));var o=this;this._externalDatafeed.searchSymbols(e,t,i,function(e){o._logMessage("Symbol search response: {0}".format(JSON.stringify(e))),n(e)})},u.prototype.resolveSymbol=function(e,t,i){p.isSymbolEncoded(e)||console.error("Expect to get symbol encoded string, but got the following instead: "+e);var n=p.parseSymbol(e).symbol;this._resolveSymbolByName(n,t,i)},u.prototype._resolveSymbolByName=function(e,t,i){var n;this._resolveRequests[e]?n=this._resolveRequests[e]:(n=this._resolveSymbolInternal(e),this._resolveRequests[e]=n),n.then(t).catch(i)},u.prototype._resolveSymbolInternal=function(e){var i=this;return new Promise(function(n,o){this._logMessage("Symbol resolve requested: `{0}` ".format(e));var r=!0;this._externalDatafeed.resolveSymbol(e,function(o){r&&console.warn("`resolveSymbol` should return result asynchronously. Use `setTimeout` with 0 interval to execute the callback function."),i._logMessage("Symbol resolved: `{0}`, SymbolInfo in server response {1}".format(e,JSON.stringify(o))),function(e){var t,i;if(e.base_name||(e.base_name=[e.name]),e.legs||(e.legs=[e.name]),e.exchange||(e.exchange=e["exchange-listed"]),e.full_name||(e.full_name=e.symbol||(e.exchange?e.exchange+":"+e.name:e.name)),e.pro_name||(e.pro_name=e.full_name),e.data_status||(e.data_status="streaming"),e.ticker||(e.ticker=e.symbol||e.name),!e.session&&e["session-regular"]&&(e.session=e["session-regular"]),!e.minmov&&e.minmovement&&(e.minmov=e.minmovement),e.supported_resolutions)for(t=0;tp||(a=0,(l=h.valueAt(p)[TradingView.TIME_PLOT])e&&r.logNormal("Study inputs migration is done, studyId: "+this._studyId+", inputs: "+JSON.stringify(n)),n},n.prototype._findMigration=function(e){var t,i,n=-1,o=this._maxFromVers;for(t=0;t=0||t.indexOf(e)>=0},n._applyInputChangedMinMaxRule=function(e,t){if("adjustValIfNeeded"!==t.action)throw new Error("Unknown action "+t.action+" for rule with type "+t.type);var i=e[t.inputId];return it.maxVal&&(e[t.inputId]=t.maxVal),r.logNormal("Input "+t.inputId+"="+i+" adjusted to value "+e[t.inputId]),e},n._applyInputChangedOptionsRule=function(e,t){if(!(["text"].indexOf(t.inputType)>=0&&"resetToDefValIfNeeded"===t.action))throw new Error("Unexpected rule.inputType="+t.inputType+" in rule.action="+t.action);var i=e[t.inputId];return t.options.indexOf(i)<0&&(e[t.inputId]=t.defVal,r.logNormal("Input "+t.inputId+"="+i+" reset to default value "+t.defVal)),e},e.exports=n},Eyy1:function(e,t,i){"use strict";function n(e){if(void 0===e)throw new Error("Value is undefined");return e}function o(e){if(null===e)throw new Error("Value is null");return e}Object.defineProperty(t,"__esModule",{value:!0}),t.assert=function(e,t){if(!e)throw new Error("Assertion failed"+(t?": "+t:""))},t.ensureDefined=n,t.ensureNotNull=o,t.ensure=function(e){return o(n(e))},t.ensureNever=function(e){}},F58L:function(e,t,i){"use strict";var n,o,r,s,a,l,c,u,h,d,p;i.r(t),i.d(t,"StudyTemplates",function(){return p}),n=i("zUrt"),o=i("PC8g"),r=i("aIyQ"),s=i.n(r),a=i("hY0g"),l=i.n(a),c=i("oNDq"),u=i("uOxu"),h=Object(u.getLogger)("Platform.StudyTemplates"),d={confirmDelete:window.t("Do you really want to delete Study Template '{0}' ?")},p=function(){function e(e){var t=this;this._chartWidgetCollection=e.chartWidgetCollection,this._favoriteStudyTemplatesService=e.favoriteStudyTemplatesService,window.loginStateChange.subscribe(null,n.backend.invalidateStudyTemplatesList),this._list=new l.a([]),this._onChange=new s.a,this._list.subscribe(function(){return t._onChange.fire()})}return e.prototype.findRecordByName=function(e){return this._list.value().find(function(t){return t.name===e})||null},e.prototype.showSaveAsDialog=function(){var e=this,t=this._chartWidgetCollection.activeChartWidget.value().model()
+;Promise.all([i.e("react"),i.e(2),i.e(5),i.e(7),i.e(11),i.e(31),i.e(39),i.e(68),i.e(0),i.e(4),i.e(9),i.e("study-template-dialog")]).then(i.bind(null,"IDfV")).then(function(i){new i.StudyTemplateSaver({controller:t,onSave:function(t){e._list.setValue(t)}}).show()})},e.prototype.applyTemplate=function(e){var t=this,i=this.findRecordByName(e);null!==i?window.runOrSignIn(function(){var e=t._chartWidgetCollection.activeChartWidget.value(),r=function(t){Object(o.trackEvent)("GUI","Load Study Template"),e.model().applyStudyTemplate(JSON.parse(t.content),i.name)};void 0!==i.id?i.is_default?n.backend.getStandardStudyTemplateContentById(i.id,r):n.backend.getStudyTemplateContentById(i.id,r):n.backend.getStudyTemplateContent(i.name,r)},{source:"Study templates apply"}):h.logNormal("Template "+name+" not found in cache")},e.prototype.deleteStudyTemplate=function(e){var t=this.findRecordByName(e);null!==t?this._removeTemplate(t):h.logNormal("Template "+e+" not found in cache")},e.prototype.list=function(){return this._list.value()},e.prototype.getOnChange=function(){return this._onChange},e.prototype.refreshStudyTemplateList=function(e){var t=this;n.backend.getStudyTemplatesList(function(i){t._list.setValue(i),void 0!==e&&e()})},e.prototype._removeTemplate=function(e){var t=this;window.runOrSignIn(function(){Object(c.createConfirmDialog)({type:"modal",content:document.createTextNode(d.confirmDelete.format(e.name))}).then(function(i){i.on("action:yes",function(i){var o=function(){t.refreshStudyTemplateList(function(){var n=t.list();t._list.setValue(n.filter(function(t){return t!==e})),t._favoriteStudyTemplatesService&&t._favoriteStudyTemplatesService.remove(e.name),i.actionLoader("yes","stop"),i.close()})};i.actionLoader("yes","start"),n.backend.invalidateStudyTemplatesList(),void 0!==e.id?n.backend.removeStudyTemplateById(e.id,o):n.backend.removeStudyTemplate(e.name,o)}),i.open()})},{source:"Study templates delete"})},e}()},FBsw:function(e,t,i){"use strict";var n,o,r,s;i.r(t),i.d(t,"OverlayPriceAxisView",function(){return s}),n=i("mrSG"),o=i("KcY8"),r=i("oXaB"),s=function(e){function t(t){var i=e.call(this)||this;return i._source=t,i}return Object(n.__extends)(t,e),t.prototype._updateRendererData=function(e,t,i){var n,o,s,a;e.visible=!1,t.visible=!1,(n=this._source.lastValueData("close",!1)).noData||(o=this._source.model(),null!==(s=this._source.priceScale())&&o.isPriceScaleVisible(s)&&(i.background=n.color,i.color=this.generateTextColor(n.color),i.coordinate=n.coordinate,i.floatCoordinate=n.floatCoordinate,(a=this._source.model().properties().scalesProperties).showSeriesLastValue.value()&&(e.text=this._text(n),e.visible=!0),t.text="",(a.showSymbolLabels.value()||a.seriesLastValueMode.value()===r.PriceAxisLastValueMode.LastPriceAndPercentageValue)&&(t.text=this._paneText(n),t.visible=t.text.length>0)))},t.prototype._paneText=function(e){var t,i="",n=this._source.model().properties().scalesProperties;return n.showSymbolLabels.value()&&(i+=this._source.symbol()+" "),
+null!==(t=this._source.priceScale())&&n.showSeriesLastValue.value()&&n.seriesLastValueMode.value()===r.PriceAxisLastValueMode.LastPriceAndPercentageValue&&(i+=t.isPercentage()?e.formattedPriceAbsolute:e.formattedPricePercentage),i.trim()},t.prototype._text=function(e){var t=this._source.model().properties().scalesProperties,i=this._source.priceScale();return t.seriesLastValueMode.value()!==r.PriceAxisLastValueMode.LastPriceAndPercentageValue||null===i?e.text:i.isPercentage()?e.formattedPricePercentage:e.formattedPriceAbsolute},t}(o.a)},FBuY:function(e,t,i){"use strict";var n,o,r;i.r(t),i.d(t,"TVXWindowEvents",function(){return r}),i("HbRj"),n=i("uOxu"),o=Object(n.getLogger)("XWindowEvents"),function(e){var t="tvxwevents.",i={};window.addEventListener("storage",function(e){if(null!==e.newValue){var n=e.key;n&&n.startsWith(t)&&(n=n.substr(t.length),i[n]&&i[n].forEach(function(t){t.call(e.newValue,e.newValue)}))}}),e.on=function(e,t){i[e]||(i[e]=[]),i[e].push(t)},e.off=function(e,t){if(i[e]){var n=i[e].indexOf(t);-1!==n&&(1===i[e].length?delete i[e]:i[e].splice(n,1))}},e.current=function(e){return TVLocalStorage.getItem(t+e)},e.emit=function(e,i){if(void 0===i&&(i=(new Date).valueOf()),i!==TVLocalStorage.getItem(t+e))try{TVLocalStorage.setItem(t+e,i)}catch(e){o.logError(e.message)}}}(r||(r={}))},FDyI:function(e,t,i){"use strict";var n,o,r,s,a;i.r(t),i.d(t,"ChartWidgetApiBase",function(){return a}),n=i("Eyy1"),o=i("LxhU"),r=i("IiTo"),s=i("/bs+"),a=function(){function e(e){this._chartWidget=e}return e.prototype.exportData=function(e){var t=this;return i.e("export-data").then(i.bind(null,"SIoL")).then(function(i){return i.exportData(t._chartWidget.model().model(),e)})},e.prototype.barTimeToEndOfPeriod=function(e){var t=this._prepareEndOfPeriodArgs();return Object(s.barTimeToEndOfPeriod)(t.barBuilder,t.session,e,t.intervalObj)},e.prototype.endOfPeriodToBarTime=function(e){var t=this._prepareEndOfPeriodArgs();return Object(s.endOfPeriodToBarTime)(t.barBuilder,t.session,e,t.intervalObj)},e.prototype._prepareEndOfPeriodArgs=function(){var e=this._chartWidget.model().model(),t=e.timezone(),i=Object(n.ensureNotNull)(e.mainSeries().symbolInfo()),s=e.mainSeries().interval(),a=new r.SessionInfo(t,i.session,i.holidays,i.corrections),l=Object(r.newBarBuilder)(s,a,a),c=o.Interval.parse(s);return{barBuilder:l,session:a.spec,intervalObj:c}},e}()},FIi8:function(e,t,i){"use strict";function n(e){var t,i=[];for(t=1;t=this._actualCapacity&&(this._actualCapacity++,t=this._canvas,this._canvas=o(this._currentWidth,this._rowHeight*this._actualCapacity),this._ctx=Object(r.ensureNotNull)(this._canvas.getContext("2d")),this._ctx.drawImageOriginal?this._ctx.drawImageOriginal(t,0,0,t.width,t.height):this._ctx.drawImage(t,0,0,t.width,t.height),this._ctx.translate(.5,.5),this._ctx.font=h+"px "+c.CHART_FONT_FAMILY,_.logDebug("TrendLineCache. Expanding cache to "+this._actualCapacity+" items")),i},e.prototype._effectiveState=function(e){var t=e.properties(),i={p1:Object.assign({},e.points()[0]),p2:Object.assign({},e.points()[1]),props:e.properties(),showBars:t.showBarsRange.value(),showTimeRange:t.showDateTimeRange.value(),showDistance:t.showDistance.value(),showPriceRange:t.showPriceRange.value(),showAngle:t.showAngle.value(),dark:e.model().isDark(),priceRange:void 0,barSpacing:void 0};return!0===i.showAngle&&(i.priceRange=Object(r.ensureNotNull)(Object(r.ensureNotNull)(e.priceScale()).priceRange()).state(),i.barSpacing=e.model().timeScale().barSpacing()),i},e.prototype._effectiveStatesEquals=function(e,t){var i,o;if(null!==e&&null===t)return!1;if(null===e&&null!==t)return!1;if(i=Object(r.ensureNotNull)(e),o=Object(r.ensureNotNull)(t),n(i.p1,o.p1))return!1;if(n(i.p2,o.p2))return!1;if(i.dark!==o.dark)return!1;if(i.showBars!==o.showBars)return!1;if(i.showTimeRange!==o.showTimeRange)return!1;if(i.showDistance!==o.showDistance)return!1;if(i.showPriceRange!==o.showPriceRange)return!1;if(i.showAngle!==o.showAngle)return!1;if(i.showAngle&&o.showAngle){if(i.priceRange.min!==o.priceRange.min)return!1;if(i.priceRange.max!==o.priceRange.max)return!1
+;if(i.barSpacing!==o.barSpacing)return!1}return!0},e.prototype._repaintSource=function(e,t,i){var n;this._ctx.save(),this._ctx.translate(0,this.topByRow(t)),i.points[0]=new s.Point(0,0),i.offsetX=0,i.offsetY=0,delete i.horzAlign,delete i.vertAlign,this._ctx.clearRect(0,0,this._currentWidth,this.rowHeight(t)),n=new l.TrendLineStatsRenderer(i,{widths:[]}).draw(this._ctx),Object(r.ensureDefined)(this._sourcesToRow.get(e)).width=n.width,this._ctx.restore()},e}()},FVma:function(e,t,i){"use strict";(function(e){function n(e,t,i,n){this._prices=[],this._canvas=document.createElement("canvas"),this._cache=this._canvas.getContext("2d"),this.reset({font:e,fontSize:t,backColors:i,colors:n}),this._priceAxisFontSize=11}function o(e,t){this._model=e,this._source=t,this._pivots=[],this._textCache={}}function r(e,t){this._source=e,this._model=e._model,this._prices=[],this._invidated=!0,this._cache=t}function s(e,t,i,n){var o,r,s;for(p.call(this,e,t,i,n),o=["P","S1/R1","S2/R2","S3/R3","S4/R4","S5/R5"],r=this.properties().levelsStyle.visibility,s=0;ss)))for(f in h={},(d=this._source.properties().levelsStyle.visibility).P.value()&&this.mergeLabel(h,e[l].p,"P"),d["S1/R1"].value()&&(this.mergeLabel(h,e[l].s1,"S1"),this.mergeLabel(h,e[l].r1,"R1")),d["S2/R2"].value()&&(this.mergeLabel(h,e[l].s2,"S2"),this.mergeLabel(h,e[l].r2,"R2")),d["S3/R3"].value()&&(this.mergeLabel(h,e[l].s3,"S3"),this.mergeLabel(h,e[l].r3,"R3")),d["S4/R4"].value()&&(this.mergeLabel(h,e[l].s4,"S4"),this.mergeLabel(h,e[l].r4,"R4")),d["S5/R5"].value()&&(this.mergeLabel(h,e[l].s5,"S5"),this.mergeLabel(h,e[l].r5,"R5")),p=i.indexToCoordinate(c),_=i.indexToCoordinate(u),h)m=parseFloat(f),y=n.priceToCoordinate(m,a),this._pivots.push({x1:p,x2:_,y:y,label:h[f].text,labelIds:h[f].ids})},o.prototype.renderer=function(){var e,t,i,n,o,r,s,l,c,u,h,d,p,_,f,S;for(this._invalidated&&(this._updateImpl(),this._invalidated=!1),e=new v,t=this._source.properties().levelsStyle.colors,i=this._source.properties().levelsStyle.widths,n=0;n0&&(p=this._cache._labelRectByIndex(d+11),_={left:r.x-p.width+u,top:Math.round(r.y-p.height/2),width:p.width,height:p.height},u+=p.width/2,
+f=this._cache._canvas,S=new y(f,p,_),e.append(S)),p=this._cache._labelRectByIndex(d),_={left:r.x-p.width+u,top:Math.round(r.y-p.height/2),width:p.width,height:p.height},u+=p.width,f=this._cache._canvas,S=new y(f,p,_),e.append(S);return e},r.prototype._updateImpl=function(){var e,t,i,n,o,r,s,a,l,c,u,h,d,p,_,f,m,y,g,v;if(!this._model.timeScale().isEmpty()&&!this._source.priceScale().isEmpty()&&null!==(e=this._model.timeScale().visibleBarsStrictRange())&&this._source.customData()&&this._source.customData().pivots&&(t=this._model.mainSeries(),i=this._source.priceScale(),null!==(n=t.bars().search(e.lastBar(),S.NearestLeft)))){for(o=n.index,r=this._source.customData().pivots,s=this._source._indexes,a=this._source.properties(),l=this._source.firstValue(),c=0;c=o&&u<=o||!d))for(p=["p","s1","r1","s2","r2","s3","r3","s4","r4","s5","r5"],this._prices=[],_=0;_i)))for(l=[],(c=this._properties.levelsStyle.visibility).P.value()&&l.push(n[s].p),c["S1/R1"].value()&&l.push(n[s].s1,n[s].r1),c["S2/R2"].value()&&l.push(n[s].s2,n[s].r2),c["S3/R3"].value()&&l.push(n[s].s3,n[s].r3),c["S4/R4"].value()&&l.push(n[s].s4,n[s].r4),c["S5/R5"].value()&&l.push(n[s].s5,n[s].r5),u=0;uT}var a,l,c,u,h,d,p,_,f,m,y,g,v,S,b,w,P,C,T,x,I,L,M,A,k,E,O,D,V,B,R,N,F,W,j,U,z,H,Y,G,q,K,Z,J,X,Q,$,ee,te;Object.defineProperty(t,"__esModule",{value:!0}),t.Branding=void 0,a=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i,n,o=[],r=!0,s=!1,a=void 0;try{for(i=e[Symbol.iterator]();!(r=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);r=!0);}catch(e){s=!0,a=e}finally{try{!r&&i.return&&i.return()}finally{if(s)throw a}}return o}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function e(e,t){var i,n;for(i=0;i-1,Y=H&&navigator.userAgent.toLowerCase().indexOf("windows")>-1,G=navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&-1===navigator.userAgent.toLowerCase().indexOf("edge"),ee=window.navigator.userAgent,te=ee.indexOf("MSIE "),q=te>0?parseInt(ee.substring(te+5,ee.indexOf(".",te)),10):ee.indexOf("Trident/")>0&&($=ee.indexOf("rv:"),parseInt(ee.substring($+3,ee.indexOf(".",$)),10)),K=window.urlParams||{},window.initData,Z=window.hidpiCanvasRatio||1,J=null,X=function(){function e(t){var i=t.layout,o=void 0===i?E:i,s=t.symbol,a=void 0===s?"":s,l=t.model,c=t.onReadyCallback;n(this,e),this._model=l,this._image=null,this._imageReady=!1,this._needDisplayImage=!1,this._imageWidth=22,this._imageHeight=13,this._layout=o,this._symbol=a,
+this.showAnimatedBranding=d.enabled("show_animated_logo")||this._layout===O,this.show=!0,this.width=100,this.height=14,this._bottomShift=0,this._brandCircleSize=32,this._animatedWidth=this._brandCircleSize,this._animatedOpacity=0,this.width=this.showAnimatedBranding?this._brandCircleSize:100,this.height=14,this._fillColor=_.color.brandNew,this._colorOldBlue=_.color.brandNew2,this._colorOldGray=_.color.black30,this._strokeColor=_.color.black255,this._brandCircleShadowColor=_.color.black0,this._strokeWidth=4,this._fontSize=this.showAnimatedBranding?11:14,this._font="px "+b,this._txt="TradingView",this._onReadyCallback=c,this._upscaleRatio=G?1:2,this._verticalTextShift=H?this.showAnimatedBranding?2:4:0,this._strokeCanv=null,this._fillCanv=null,q&&(this._init=r(this._init,this)),this._init()}return l(e,[{key:"_init",value:function(){this._checkLayout(),this.show&&(this._updateStrokeColor(),this.showAnimatedBranding?(this._loadImage(S,"tvLogo"),this._createFillText()):this._loadImage(S,"tvLogo"),this._model.properties().paneProperties.background.subscribe(this,this._updateStrokeColor),this._model.onChartThemeLoaded().subscribe(this,this._updateStrokeColor))}},{key:"_updateStrokeColor",value:function(){var e=(0,f.getLuminance)(this._model.properties().paneProperties.background.value());this._strokeCanv=null,this._fillCanv=null,e>z?(this._brandCircleColor=_.color.black255,this._animatedColorBg=_.color.black255,this._brandCircleShadowOpacity=.09,this._strokeOpacity=.8):(this._brandCircleColor=_.color.black27,this._animatedColorBg=_.color.black27,this._brandCircleShadowOpacity=.09,this._strokeOpacity=.1)}},{key:"_loadImage",value:function(e,t){var i,n=this;this._needDisplayImage&&(this._image=new Image,this.showAnimatedBranding&&(this._imageWhite=new Image),q?(this._image.src=J.fallbackImages[t+"Blue"],this.showAnimatedBranding&&(this._imageWhite.src=J.fallbackImages[t+"White"])):(i=e.replace(/fill="#[\da-f]{6}"/i,'fill="#FFFFFF"'),this._image.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(e),this.showAnimatedBranding&&(this._imageWhite.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(i))),this._image.addEventListener("load",function(){Y&&(n._image=o(n._image,n._imageWidth,n._imageHeight)),n._imageReady=!0,"function"==typeof n._onReadyCallback&&n._onReadyCallback()}))}},{key:"_checkLayout",value:function(){switch(this._layout){case O:case D:case V:case R:case N:case j:case W:this.show=!0;break;case E:case B:case F:case U:this.show=!1}switch(this._layout){case W:this._needDisplayImage=!0,this._txt=window.t(L);break;case j:this._txt=window.t(k)}}},{key:"_drawTextStroke",value:function(e){var t,i;this._strokeCanv||(this._strokeCanv=document.createElement("canvas"),t=this._strokeCanv.getContext("2d"),i=Math.round(this._strokeWidth*this._upscaleRatio),t.font=this._fontSize*this._upscaleRatio+this._font,this._textWidth=t.measureText(this._txt).width,this._strokeCanv.width=(this._textWidth+2*i)*Z,this._strokeCanv.height=(this._fontSize+2*i)*this._upscaleRatio*Z,
+this._strokeCanv.width%2==0&&(this._strokeCanv.width+=1,this._strokeCanv.height+=1),t.textBaseline="top",t.textAlign="start",t.font=this._fontSize*this._upscaleRatio+this._font,t.strokeStyle=this._strokeColor,t.lineWidth=this._strokeWidth*this._upscaleRatio*Z,t.lineJoin="round",t.strokeText(this._txt,i,this._verticalTextShift)),e.save(),e.globalAlpha=this._strokeOpacity,e.drawImage(this._strokeCanv,0,0,this._strokeCanv.width,this._strokeCanv.height,0,0,this._strokeCanv.width/this._upscaleRatio/Z,this._strokeCanv.height/this._upscaleRatio/Z),e.restore()}},{key:"_drawTextFill",value:function(e){this._createFillText(),e.save(),e.drawImage(this._fillCanv,0,0,this._fillCanv.width,this._fillCanv.height,0,0,this._fillCanv.width/this._upscaleRatio/Z,this._fillCanv.height/this._upscaleRatio/Z),e.restore()}},{key:"_createFillText",value:function(){var e,t;null===this._fillCanv&&(this._fillCanv=document.createElement("canvas"),e=this._fillCanv.getContext("2d"),t=Math.round(this._strokeWidth*this._upscaleRatio),e.font=this._fontSize*this._upscaleRatio+this._font,void 0===this._textWidth&&(this._textWidth=Math.round(e.measureText(this._txt).width)),this._setSizeFillTextCanvas(t),e.textBaseline="top",e.textAlign="start",e.font=this._fontSize*this._upscaleRatio+this._font,e.fillStyle=this._fillColor,e.fillText(this._txt,t,this._verticalTextShift))}},{key:"_updateFillTextWithColor",value:function(e){var t=Math.round(this._strokeWidth*this._upscaleRatio),i=this._fillCanv.getContext("2d");this._setSizeFillTextCanvas(t),i.clearRect(0,0,this._fillCanv.width,this._fillCanv.height),i.textBaseline="top",i.textAlign="start",i.font=this._fontSize*this._upscaleRatio+this._font,i.fillStyle=e,i.fillText(this._txt,t,this._verticalTextShift)}},{key:"_setSizeFillTextCanvas",value:function(e){this._fillCanv.width=(this._textWidth+2*e)*Z,this._fillCanv.height=(this._fontSize+2*e)*this._upscaleRatio*Z,this._fillCanv.width%2==0&&(this._fillCanv.width+=1,this._fillCanv.height+=1)}},{key:"_drawFillTextCropWidth",value:function(e,t,i){this._fillCanv?this._updateFillTextWithColor(i):this._createFillText(),e.save(),e.drawImage(this._fillCanv,0,0,t*this._upscaleRatio*Z,this._fillCanv.height,0,0,t,this._fillCanv.height/this._upscaleRatio/Z),e.restore()}},{key:"_drawBgCircle",value:function(e){e.save(),e.beginPath(),e.fillStyle=this._brandCircleShadowColor,e.globalAlpha=this._brandCircleShadowOpacity,e.arc(this._imageWidth/2,this._imageHeight/2,this._brandCircleSize/2+1,0,2*Math.PI),e.fill(),e.closePath(),e.restore(),e.save(),e.beginPath(),e.fillStyle=this._brandCircleColor,e.arc(this._imageWidth/2,this._imageHeight/2,this._brandCircleSize/2,0,2*Math.PI,!1),e.fill(),e.closePath(),e.restore()}},{key:"_drawFillRectWithRoundedCorner",value:function(e,t,i,n,o,r,s){e.save(),(0,y.drawRoundRect)(e,t-1,i-1,n+2,o+2,r),e.globalAlpha=this._brandCircleShadowOpacity,e.fillStyle=this._brandCircleShadowColor,e.fill(),e.closePath(),e.restore(),e.save(),(0,y.drawRoundRect)(e,t,i,n,o,r),e.fillStyle=s,e.fill(),e.closePath(),e.restore()}},{key:"_drawImageWithColor",
+value:function(e){e.save(),e.globalAlpha=this._animatedOpacity,e.drawImage(this._imageWhite,0,-.5,this._imageWidth,this._imageHeight),e.restore(),e.save(),e.globalAlpha=1-this._animatedOpacity,e.drawImage(this._image,0,-.5,this._imageWidth,this._imageHeight),e.restore()}},{key:"bottomShift",value:function(){return this._bottomShift}},{key:"hasAnimation",value:function(){return this.showAnimatedBranding}},{key:"minimizedAnimationWidth",value:function(){return this._brandCircleSize}},{key:"maximizedAnimationWidth",value:function(){return this._fillCanv.width/this._upscaleRatio/Z+this._brandCircleSize-3}},{key:"animatedDrawStep",value:function(e,t){var i,n,o,r,s,l,c,u,h,d,p,_,f,m,y,v;this._animatedWidth=t,i=this._animatedWidthr&&(e.translate(this._imageWidth/2+o,.5),this._drawFillTextCropWidth(e,this._animatedWidth-r,this._animatedColorText)),e.restore(),this.width=this._animatedWidth,this.height=this._brandCircleSize,this._bottomShift=this._brandCircleSize-this._imageHeight):this._layout===V||this._layout===N?(a="12px "+b,e.font=a,l=e.measureText(this._txt).width,this.width=l+e.measureText("TradingView").width,e.save(),e.globalAlpha=.7,e.fillStyle=this._colorOldGray,e.fillText(this._txt,0,12),e.fillStyle=this._colorOldBlue,e.fillText("TradingView",l,12),e.restore()):function(e){return!C||e>x}(t)&&(this._needDisplayImage&&this._imageReady?(e.save(),c=(this._brandCircleSize-this._imageWidth)/2,e.translate(c,0),this._drawBgCircle(e),e.drawImage(this._image,0,-.5,this._imageWidth,this._imageHeight),u=12+(G?-.5:0),e.translate(this._imageWidth+u,-.5),(h=s(t))&&(this._drawTextStroke(e),this._drawTextFill(e)),e.restore(),this.width=this._imageWidth+c,this.width+=h?u+this._strokeCanv.width/this._upscaleRatio/Z:c,this.height=this._brandCircleSize,this._bottomShift=this._brandCircleSize-this._imageHeight):(e.save(),e.translate(G?-.5:0,-.5),(d=s(t))&&(this._drawTextStroke(e),this._drawTextFill(e)),e.restore(),d&&(this.width=this._strokeCanv.width/this._upscaleRatio/Z)))}}]),e}(),
+Q=function(){function e(t){var i=t.layout,o=void 0===i?E:i,s=t.src,a=t.onReadyCallback;n(this,e),this._img=new Image,this._ready=!1,this.show=!1,this.width=0,this.height=0,this._layout=o,this._src=s,this._onReadyCallback=a,q&&(this._init=r(this._init,this)),this._init()}return l(e,[{key:"_init",value:function(){var e,t,i=this;this._checkLayout(),this.show&&(e=this._src.match(/(\w+)\.svg/),q&&e&&2===e.length?(t=e[1],this._img.src=J.fallbackImages[t],this._img.addEventListener("load",function(){var e=J.logoSizes;t in e?(i.width=e[t].width,i.height=e[t].height):(i.width=135,i.height=25),i._ready=!0,"function"==typeof i._onReadyCallback&&i._onReadyCallback()})):(this._img.src=this._src,this._img.addEventListener("load",function(){i.width=Math.round(i._img.width),i.height=Math.round(i._img.height),Y&&(i._img=o(i._img,i.width,i.height)),i._ready=!0,"function"==typeof i._onReadyCallback&&i._onReadyCallback()})))}},{key:"_checkLayout",value:function(){switch(this._layout){case V:case B:case N:case F:case j:case U:this.show=!0;break;case E:case O:case D:case R:case W:this.show=!1}}},{key:"draw",value:function(e){this._ready&&e.drawImage(this._img,0,0,this.width,this.height)}}]),e}(),t.Branding=function(){function e(t,i){var o,r=this;n(this,e),this._model=t,this._mainSeries=this._model.mainSeries(),this._canvasWidth=0,this._showAllowance=i,this._paneHeight=0,this._left=13,this._bottom=24,this._layout=E,this._needToShow=!0,this._customLogoSrc="",this._customLogoLink="",this._checkLayout(),this._layout!==V&&this._layout!==N||(this._left=8,this._bottom=5),o=function(){r._needToShow?r._layout===E?r._showBranding=window.innerWidth>=768:r._showBranding=!0:r._showBranding=!1},this._resizeHandlerDelayed=v(o,200),o(),window.addEventListener("resize",this._resizeHandlerDelayed),this._model.isSnapshot()?this._init():this._mainSeries.dataEvents().symbolResolved().subscribe(this,this._init),this._cubicBezier=new _.CubicBezier(.4,.01,.22,1)}return l(e,[{key:"destroy",value:function(){window.removeEventListener("resize",this._resizeHandlerDelayed)}},{key:"_init",value:function(){var e=this,t=this._mainSeries.symbolInfo()||{};this._powBy=new X({layout:this._layout,symbol:t.name,model:this._model,onReadyCallback:function(){return e._model.fullUpdate()}}),this._custom=new Q({layout:this._layout,src:this._customLogoSrc,onReadyCallback:function(){return e._model.fullUpdate()}}),this._openAnimation=null,this._closeAnimation=null}},{key:"_checkLayout",value:function(){if(d.enabled("widget"));else if(d.enabled("charting_library")||d.enabled("amp_terminal")||d.enabled("cqg_terminal")||d.enabled("trading_terminal")){var e=JSON.parse(K.logo)||{};e.image?(this._customLogoSrc=e.image,this._customLogoLink=e.link,this._needToShow=d.enabled("widget_logo"),d.enabled("link_to_tradingview")?this._layout=j:this._layout=U):(this._layout=W,this._needToShow=d.enabled("widget_logo"))}else this._layout=E}},{key:"_startOpenAnimation",value:function(){null===this._openAnimation&&(null!==this._closeAnimation&&(this._closeAnimation.stop(),this._closeAnimation=null),
+this._openAnimation=(0,m.doAnimate)({from:this._currentStateForAnimation(),to:this._openedStateForAnimation(),duration:200,easing:this._cubicBezier.easingFunc,onStep:this._animatedDrawStep.bind(this)}))}},{key:"_startCloseAnimation",value:function(){null===this._closeAnimation&&(null!==this._openAnimation&&(this._openAnimation.stop(),this._openAnimation=null),this._closeAnimation=(0,m.doAnimate)({from:this._currentStateForAnimation(),to:this._closedStateForAnimation(),duration:200,easing:this._cubicBezier.easingFunc,onStep:this._animatedDrawStep.bind(this)}))}},{key:"_currentStateForAnimation",value:function(){return this._powBy.width}},{key:"_closedStateForAnimation",value:function(){return this._powBy.minimizedAnimationWidth()}},{key:"_openedStateForAnimation",value:function(){return this._powBy.maximizedAnimationWidth()}},{key:"_animatedDrawStep",value:function(e,t){this._powBy.animatedDrawStep(e,t),this._model.lightUpdate()}},{key:"_hasAnimation",value:function(){return this._powBy.hasAnimation()}},{key:"updateAllViews",value:function(){}},{key:"priceAxisViews",value:function(){return[]}},{key:"onClickOutside",value:function(){}},{key:"hasContextMenu",value:function(){return!1}},{key:"hitTest",value:function(e){var t=this;return!this._showBranding||d.enabled("logo_without_link")?null:this._powBy&&this._layout!==E&&this._layout!==B&&this._layout!==F&&(0,u.pointInBox)(e,(0,c.box)(new c.Point(this._left,this._paneHeight-Math.max(this._powBy.height,void 0!==this._custom?this._custom.height:0)-this._bottom),new c.Point(this._left+Math.max(this._powBy.width,void 0!==this._custom?this._custom.width:0),this._paneHeight-this._bottom)))?new p.HitTestResult(p.HitTestResult.CUSTOM,{mouseClickHandler:function(){window.open(t.tvUrl(),"_blank").opener=null},mouseEnterHandler:function(){t._hasAnimation()&&t._startOpenAnimation()},mouseLeaveHandler:function(){t._hasAnimation()&&t._startCloseAnimation()}}):null}},{key:"tvUrl",value:function(){var e,t="https://www.tradingview.com/";if(this._customLogoLink)return this._customLogoLink;if(this._layout===W||this._layout===j){switch(e=void 0,!0){case d.enabled("charting_library"):e="library";break;case d.enabled("trading_terminal"):case d.enabled("amp_terminal"):case d.enabled("cqg_terminal"):e="trading-terminal"}return t+="/"===t[t.length-1]?"?":"&",t+="utm_source="+window.location.origin+"&utm_medium=library"+(e?"&utm_campaign="+e:"")}return t}},{key:"draw",value:function(e){if(this._showBranding){var t=0;K.utm=!0,this._powBy&&this._powBy.show&&(t=this._powBy.height-this._powBy.bottomShift(),e.save(),e.translate(this._left,this._paneHeight-this._bottom-t),this._powBy.draw(e,this._canvasWidth),e.restore()),this._custom&&this._custom.show&&(e.save(),e.translate(this._left,this._paneHeight-this._bottom-t-this._custom.height),this._custom.draw(e),e.restore())}}},{key:"renderer",value:function(e,t){return this._paneHeight=e,this._canvasWidth=t,{draw:this.draw.bind(this),hitTest:this.hitTest.bind(this)}}},{key:"paneViews",value:function(e){if(!this._showAllowance())return[]
+;var t=d.enabled("move_logo_to_main_pane");return t&&e.isMainPane()||!t&&e.isLast()||e.isMaximized()?[{renderer:this.renderer.bind(this)}]:[]}}]),e}()},GUQs:function(e,t,i){"use strict";function n(e){e.cancelable&&e.preventDefault()}function o(e){return function(t){n(t),e()}}i.d(t,"a",function(){return n}),i.d(t,"b",function(){return o})},GVHu:function(e,t,i){"use strict";(function(e,n,o){function r(e,t,i,n){this._study=e,this.m_series=t,this.m_model=i,this._plotName=n,this._visible=!1,this._points=[new Y(0,0)],this._invalidated=!0,this._lineRenderer=new f}function s(e,t,i){var n,o,r=new G(t,i,!0);for(r.addExclusion("visible"),r.addExclusion("precision"),r.addExclusion("minTick"),n=0;ny+1&&void 0!==(C=f[y+1])&&null!==C?(T=g.valToIndex?g.valToIndex[C]:C,m.color=v.colors[T].color.value()):m.color=P,m.floatCoordinate=this.priceScale().priceToCoordinate(b,w,!0),m.coordinate=Math.round(m.floatCoordinate),m.item=f,m):x},l.prototype.isFailed=function(){return this._failed},l.prototype.isLoading=function(){return this._loading},l.prototype.series=function(){return this._series},l.prototype.model=function(){return this._model},l.prototype.currency=function(){var e=this.metaInfo();return Boolean(e)&&e.is_price_study?this.parentSource().currency():null},l.prototype._invalidateLastNonEmptyPlotRowCache=function(){this._lastNonEmptyPlotRowCache={}},
+l.prototype.clearData=function(){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.clear(),this._graphics.clear&&this._graphics.clear(),this._plotOffsets={}},l.prototype.onTagsChanged=function(){return this._tagsChanged},l.prototype.properties=function(){return this._properties},l.prototype.state=function(e,t){var i,n,o,r,s=TradingView.className(this.constructor),a={type:s,id:this.id(),state:this.properties().state(),zorder:this.zorder()};for(this.metaInfo()instanceof ie?a.metaInfo=TradingView.clone(this.metaInfo().state()):(a.metaInfo=TradingView.clone(this.metaInfo()),a.metaInfo.id=ie.parseIdString(a.metaInfo.id+(a.metaInfo.version?"-"+a.metaInfo.version:"")).fullId),e&&(a.data=this.data().state(),a.data.symbols=this._resolvedSymbols,a.data.graphics=W(this.graphics()),a.data.plotOffsets=this._plotOffsets),this.ownerSource()&&(a.ownerSource=this.ownerSource().id()),i=0;i=0?r:0));return this._isChildStudy&&ie.patchChildStudyMetaInfoState(a),a},l.prototype._plotsForAlert=function(){var e=this,t=this._metaInfo,i=[oe.isLinePlot,oe.isShapesPlot,oe.isCharsPlot,oe.isArrowsPlot,oe.isOhlcPlot,oe.isAlertConditionPlot];return t.plots.map(function(e,t){return e.pinePlotIndex=t,e}).filter(function(e){return i.some(function(t){return t(e)})}).map(function(i){var n={id:i.id,type:i.type,pinePlotIndex:i.pinePlotIndex,offset:e.offset(i.id)};return t.styles&&void 0!==t.styles[i.id]&&(n.title=t.styles[i.id].title||"",n.text=t.styles[i.id].text||""),i.target&&t.ohlcPlots&&t.ohlcPlots[i.target]&&(n.ohlcTitle=t.ohlcPlots[i.target].title),n})},l.prototype._collectDepsForAlert=function(){throw new Error("Not implemented")},l.prototype.idForAlert=function(){return O.prototype.idForAlert.call(this)},l.prototype.dependenciesForAlerts=function(){throw new Error("Not implemented")},l.prototype._hasPlotData=function(){var e=this.data();return!e.isEmpty()&&null!==e.findLast(function(e,t){var i,n;for(i=t.length-1;i>0;i--)if(null!==(n=t[i])&&void 0!==n&&!isNaN(n))return!0;return!1})},l.prototype._hasAvailableAlertPlots=function(){return!1},l.prototype._hasAlertablePlots=function(){return(this.metaInfo().plots||[]).some(function(e){return"line"===e.type})},l.prototype._hasAlertConditions=function(){if(this.metaInfo().plots.some(oe.isAlertConditionPlot))return!0;var e=this.stateForAlert();return!(!e.alerts||!e.alerts.conditions)},l.prototype.hasStateForAlert=function(){return!1},l.prototype.stateForAlert=function(){throw new Error("Not implemented")},l.prototype.isSavedInStudyTemplates=function(){for(var e=0;e0)return!0;for(e in this._metaInfo.graphics)for(t in this._metaInfo.graphics[e])if(!(i=this.properties().graphics[e][t]).visible||i.visible.value())return!0;return!!this._metaInfo.isTVScriptStrategy},l.prototype.start=function(e,t){var i,n=this._model.mainSeries();n.isStarted()?(this._isChildStudy&&this._source.isHibernated()&&this._source.start(),i=!this._isChildStudy&&!this.hasChildren()&&!this.isVisible(),!this._chartApi||!this._chartApi.connected()||i&&!0!==t||this._allSymbolsAreResolved().then(function(){this._startAfterSymbolsResolved(e,t)}.bind(this)).catch(function(e){pe.logError("ERROR: "+this._debugId()+" start failed, "+e),delete this._restarting}.bind(this))):n.dataEvents().completed().subscribe(this,function(){this.start(e,t)},!0)},l.prototype._getStudyIdWithLatestVersion=function(){var e=ie.cutDollarHash(this._metaInfo.id),t=e;return e.indexOf("@tv-scripting")>=0?t+="-101!":t+="-"+this._metaInfo.version,t},l.prototype._startAfterSymbolsResolved=function(e,t){var i,n;if(!this.isStarted()||this._restarting){if(this._isChildStudy){if(!this._source.isStarted()||this._source.isRestarting())return void this._source.onStart.subscribe(this,this._startAfterSymbolsResolved,!0);ie.setChildStudyMetaInfoPropertiesSourceId(this._metaInfo,this._source.sourceId(),this._properties)}if(this._studyId=ce(),delete this._restarting,this._allInputsAreValid()&&(this._inputs=this.inputs({keepOptionalSymbolsEmpty:!0}),i=this._getStudyIdWithLatestVersion(),this._incrementTurnaround(),this._chartApi.createStudy(this._studyId,this._turnaround,this._isChildStudy?this._source.sourceId():this._series._seriesId,i,this._inputs,this._handler,this._isChildStudy),this._studyName=i,this._subscribeExtendedHours(),this.onStart.fire(),!0===e&&this._children))for(n=0;n=e&&(t=d(this._series.bars().lastIndex())-e,i=d(this._series.bars().valueAt(t))[TradingView.TIME_PLOT]),i},l.prototype.getSymbolString=function(e){return this._series&&this._series.extendedHours.value()?"="+JSON.stringify({symbol:e,session:"extended"}):e},
+l.prototype._titleInputs=function(e){return this.inputs({symbolsForDisplay:!0,skipHiddenInputs:!0,skipFakeInputs:!1,fakeInputsForDisplay:!0,asObject:!1,skippedGroups:[],noExchanges:e})},l.prototype.inputsForAlert=function(){var e=this.offset(),t=this.inputs();return e&&t.push(e),t},l.prototype.inputs=function(e){var t={symbolsForDisplay:!1,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!1,skipBooleanInputs:de.enabled("dont_show_boolean_study_arguments"),asObject:!0,skippedGroups:[],noExchanges:!1,keepOptionalSymbolsEmpty:!1};return TradingView.merge(t,e),this._buildInputs(t)},l.prototype._buildInputs=function(e){var t,i;h(!!e,"options not set"),t={};try{t=this._prepareInputs(e)}catch(e){pe.logWarn("Failed to prepare study inputs: "+e)}return e.asObject?(i={},Object.keys(t).forEach(function(e){null!=t[e]&&(i[e]=t[e])}),i):(i=[],Object.keys(t).forEach(function(e){null!=t[e]&&i.push(t[e])}),i)},l.prototype._prepareInputs=function(e){var t,i,n,o;for(h(!!e,"options not set"),t={},i=0;i=0?s:r),r):this._metaInfo.isTVScript||this._metaInfo.pine?"text"===a?this._metaInfo.defaults.inputs.text:"pineId"===a?this._metaInfo.scriptIdPart:"pineVersion"===a?this._metaInfo.pine?this._metaInfo.pine.version:"-1":this._properties.inputs[a].value():this._properties.inputs[a].value()},l.prototype._rebindToSource=function(e,t){var i,n,o,r,s,a,c=this.parentSource();if(this._isChildStudy){if(this._source.unsetChild(this),delete this._nonPriceParent,n=null,e===this._model.mainSeries())delete this._source,delete this._isChildStudy,delete this._ownerSource,i=this._series._seriesId,n=H.REBIND_STUDY_CHILD_TO_STANDALONE;else{if(!(e instanceof l))return pe.logError("Unable to rebind study to source of this type"),!1;this._ownerSource=e,this._source=e,i=this._source.sourceId(),this._source.setChild(this),this._source.isHibernated()&&this._source.start()}this._incrementTurnaround(),this._chartApi.rebindStudy(this._studyId,this._turnaround,i,this._studyName,t,this._handler,n)}else{
+if(!(e instanceof l))return pe.logError("Unable to rebind study to source of this type"),!1;if((o=e.isHibernated())&&e.start(),r=!1,this._canCreateStudyWithRebindType(H.REBIND_STUDY_STANDALONE_TO_CHILD)&&(this._incrementTurnaround(),r=this._chartApi.rebindStudy(this._studyId,this._turnaround,e.sourceId(),this._studyName,t,this._handler,H.REBIND_STUDY_STANDALONE_TO_CHILD)),!r)return o&&e.stop(),!1;this._isChildStudy=!0,this._ownerSource=e,this._source=e,this._source.setChild(this),this._childStudyByRebind.fire()}return this.m_priceScale!==(s=e.priceScale())&&this._model.paneForSource(this)===(a=this._model.paneForSource(e))&&a.move(this,s,!0),c.formatterChanged().unsubscribe(this,this._onSourceFormatterChanged),this.parentSource().formatterChanged().subscribe(this,this._onSourceFormatterChanged),c.priceStepChanged().unsubscribe(this,this._onSourcePriceStepChanged),this.parentSource().priceStepChanged().subscribe(this,this._onSourcePriceStepChanged),this._recreatePriceFormattingDependencies(),!0},l.prototype.childStudyByRebind=function(){return this._childStudyByRebind},l.prototype._changeInputsImpl=function(e,t){var i,n,o,r,s,a=this.source(),c=this._properties.inputs&&this._properties.inputs.state(),u=ie.getSourceIdByInputs(this._metaInfo.inputs,c),h=!0;if(u)if("high"===u||"open"===u||"low"===u||"close"===u||"hl2"===u||"ohl3"===u||"ohlc4"===u)a=this._model.mainSeries();else for(i=this._model.dataSources(),n=0;n0?" ("+t+")":"")},l.prototype._titleInParts=function(e,t,i,n){var o,r,s,a,l,c,u,h,d,p,_,f,m,y="";if(y=e?this._metaInfo.shortDescription||this._properties.shortDescription&&this._properties.shortDescription.value()||"Study":this._metaInfo.description||this._properties.description&&this._properties.description.value()||"Study",t=t||{},o=window.t(y),r=[],!i&&(r=this._titleInputs(n)||[]).length>0){if(s={},
+this._isChildStudy)for(a=0;a=0&&this._source&&(h=this._source.metaInfo(),d=this._source.title(e,null,!0,n),1===h.plots.length?s[u]=d:(p=u.split("$")[1],_=h.plots[p].id,f=h.styles&&h.styles[_]&&h.styles[_].title||_,s[u]=d+": "+f));break}m=this,r=r.map(function(e){var i=isNumber(e)?m._numericFormatter.format(e):s&&s[e]||e;return t[i]&&(i=t[i]),i})}return[o,r]},l.prototype.invalidateTitleCache=function(e){if(this._titleStrCache={},this._titleInPartsCache={},!0===e&&this._children)for(var t=0;t0?window.t(t):""},l.prototype._handleStudyError=function(e){delete this._loadingStartTime,this._failed=!0,this._loading=!1,this.clearData(),e.params[2],this._status=this._getStatusTextOnStudyError(e.params[2]),this._statusView.update(),this._model.updateSource(this)},l.prototype.onData=function(e){var t,i,n,o=this;switch(e.method){case"study_loading":this._status=window.t("loading..."),this._failed=!1,this._loading=!0,this._statusView.update(),this._model.updateSource(this),o._loadingStartTime=(new Date).getTime();break;case"study_error":this._handleStudyError(e);break;case"study_completed":if(!this._checkTurnaround(e.params[1]))return;t="chartSession:"+o._chartApi._sessionid,i=(new Date).getTime()-this._loadingStartTime,pe.logDebug(t+", Study "+this._metaInfo.description+" loading took "+i+" ms"),delete this._loadingStartTime,this._loading=!1,this._status="",this._statusView.update(),n=this._model.paneForSource(this),this._model.recalculatePane(n),this._updateSources(),this._model.fullUpdate();break;case"study_deleted":break;case"data_update":if(e.params.customId!==this.sourceId()||!this._checkTurnaround(e.params.turnaround))return;h(!!e.params.nonseries,"data.params.nonseries is missing"),this._onDataUpdate(e.params.plots,e.params.nonseries)}},l.prototype._onDataUpdate=function(e,t){this._studyModified&&(this.clearData(),this._studyModified=!1);var i=p(t.d);return this._ongoingDataUpdate=this._ongoingDataUpdate.then(function(){return i},function(){return i}).then(this._onDataUnpacked.bind(this,e,t.indexes)),this._ongoingDataUpdate},l.prototype._onDataUnpacked=function(e,t,i){this._isDestroyed||("nochange"!==t&&this._processPlotOffsets(i),this.transformData(e),this._mergeData(e),null!==i&&(i.indexes_replace?(h("nochange"!==t),this._graphics.replaceIndexesTo(t)):("nochange"!==t&&this._graphics.replaceIndexesTo(t),void 0!==i.graphicsCmds&&this._graphics.processCommands(i.graphicsCmds,this._metaInfo.graphics))),
+this._onDataUpdated(e,i,t))},l.prototype._onDataUpdated=function(e,t,i){this.hasBarColorer()&&e.length>0&&this._model.mainSeries().invalidateBarStylesCache(e[0].index),null!==t&&this._postProcessGraphics();var n=this._model.paneForSource(this);this._model.recalculatePane(n),this._updateSources()},l.prototype.transformData=function(e){},l.prototype.moveData=function(e){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.move(e)},l.prototype.replaceData=function(e,t,i){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.remove(e+1),this.m_data.addTail(i,t)},l.prototype._updateSources=function(){this._model.updateSource(this),this.hasBarColorer()&&this._model.updateSource(this._model.mainSeries())},l.processPlotOffsets=function(e,t){t&&t.indexes_replace||(e._plotOffsets=t&&t.offsets||{})},l.prototype._processPlotOffsets=function(e){l.processPlotOffsets(this,e)},l.prototype._mergeData=function(e){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.merge(e)},l.prototype._postProcessGraphics=function(){this._priceAxisViews=[].concat(this._priceAxisViewsBase,z(this))},l.prototype._getNonPriceParent=function(){var e,t;if(this._nonPriceParent)return this._nonPriceParent;for(e=this.source();e instanceof l;){if(!(t=e.metaInfo()).is_price_study||"Compare@tv-basicstudies"===t.id)return this._nonPriceParent=e,e;e=e.source()}},l.prototype.firstValue=function(e){var t,i,n,o,r,s,a;return!this._isChildStudy&&"Compare@tv-basicstudies"===this._metaInfo.id||!this._metaInfo.is_price_study?null===(t=this._model.timeScale().visibleBarsStrictRange())?null:(i=t.firstBar(),n=t.lastBar(),o=null,s=(r=this)._metaInfo.plots,null===o&&this.data().range(i,n).each(function(t,i){var n,a,l,c;for(n=0;n=0){if(y=n.properties().styles[h].histogramBase.value(),!isNumber(y))continue;c=ee(c,{min:y,max:y})}a.push(f)}if(g=n.m_data.minMaxOnRangeCached(e,t,a),g=ee(c,g),s&&(a=[{name:"low",offset:0},{name:"high",offset:0}],v=n.series().data().bars().minMaxOnRangeCached(e,t,a),g=ee(g,v)),null!==g&&(i=new o(g.min,g.max)),r.bands)for(u=0;u=0&&(e="_v"+this._metaInfo.pine.version),{symbol:this.series().actualSymbol(),resolution:this.series().interval(),study:this._metaInfo.shortId+e}},l.prototype._sendTelemetryReport=function(e,t,i){void 0===i&&(i=this._getTelemetryAdditionalData());var n=Object.assign(t,{additional:i});telemetry.sendChartReport(e,n)},l.prototype._sendTelemetryCounter=function(e,t){this._sendTelemetryReport(e,{count:1},t)},l.prototype._sendTelemetryTiming=function(e,t,i){this._sendTelemetryReport(e,{value:t},i)},l.prototype.destroy=function(){var e,t,i,n,o,r;for(this._isDestroyed=!0,this._legendView&&this._legendView.destroy(),this.parentSource().formatterChanged().unsubscribe(this,this._onSourceFormatterChanged),this.parentSource().priceStepChanged().unsubscribe(this,this._onSourcePriceStepChanged),this._properties.listeners().unsubscribe(this,this.changeStyles),this._properties.visible.listeners().unsubscribe(this,this.visibleChanged),this._properties.visible.listeners().unsubscribe(this,this.processHibernate),e=0;e= 1");return a(s=TradingView.clone(defaults("study")),t),l=ie.getStudyPropertyRootName(t),c=TradingView.clone(defaults(l,r)),t.isTVScript&&t.TVScriptSourceCode!==c.TVScriptSourceCode&&(c=TradingView.clone(TradingView.factoryDefaults(l,r))),TradingView.merge(s,c),n&&(h(!(n instanceof e),"propsState should not be an instance of Property"),TradingView.merge(s,n)),u=TradingView.clone(t),d={},f.mergeInputsObjPart(d,u.defaults.inputs),f.mergeInputsObjPart(d,s.inputs),s.inputs=d,delete u.inputs,delete u.defaults.inputs,p={},TradingView.merge(p,u.defaults),TradingView.merge(p,TradingView.factoryDefaults(l)),TradingView.merge(p,s),TradingView.merge(p,u),delete p.defaults,s=p,null!==o&&(_=o.model().studiesColorRotatorFactory().getColorRotator(t),"Overlay@tv-basicstudies"===t.id?s.lineStyle.color=_.getColor(s.lineStyle.color,t):TradingView.merge(s,function(e,t){var i,n;for(i in e.styles)(n=e.styles[i].color)&&(e.styles[i].color=t.getColor(n));return e}(s,_))),n&&TradingView.merge(s.styles,n.styles),s
+}(t,n,o,r),_=ie.getSourceInputIds(t);return _.length>0&&(d=_[0],u instanceof l?p.inputs[d]="{pid}$0":void 0!==p.inputs[d]&&-1!==p.inputs[d].indexOf("$")&&(p.inputs[d]="close")),s(t,c,p)}(t,n,o,r,ie.getStudyPropertyRootName(t),c)},t.prepareStudyPropertiesForLoadChart=function(e,t,n,o,r,l){return function(e,t,n,o,r,l,c){var u=function(e,t,n,o,r){var s,l,c,u,h=i("K4L1");return e.version&&n.version&&e.version!==n.version&&pe.logWarn("Serialized metaInfo version "+e.version+" is not equal to the saved state version "+n.version),s=TradingView.clone(defaults("study")),TradingView.merge(s,TradingView.factoryDefaults(ie.getStudyPropertyRootName(e))),a(s,e),TradingView.merge(s,n),s=r.updateStudyState(s,e,t),(l=TradingView.clone(t||e))&&ie.versionOf(l)>=1&&(c={},h.mergeInputsObjPart(c,l.defaults.inputs),h.mergeInputsObjPart(c,s.inputs),s.inputs=c,delete l.inputs,delete l.defaults.inputs,u={},TradingView.merge(u,l.defaults),TradingView.merge(u,TradingView.factoryDefaults(ie.getStudyPropertyRootName(l))),TradingView.merge(u,s),delete l.defaults,TradingView.merge(u,l),s=u),s}(e,t,n,0,r);return s(t||e,l,u)}(e,t,n,0,r,ie.getStudyPropertyRootName(e))}}).call(this,i("tc+8"),i("aIyQ"),i("Qb4w").PriceRange)},GVQo:function(e,t,i){"use strict";function n(){try{return JSON.parse(r.TVLocalStorage.getItem("application-clipboard"))}catch(e){return null}}function o(e){try{r.TVLocalStorage.setItem("application-clipboard",JSON.stringify(e))}catch(e){}}var r;i.r(t),i.d(t,"get",function(){return n}),i.d(t,"set",function(){return o}),r=i("VVxS")},GhVi:function(e,t,i){"use strict";(function(t){function i(){this._marksByIndex={},this._marksBySpan=[],this.changed=new t}i.prototype.reset=function(){this._marksByIndex={},this._marksBySpan=[],delete this.minIndex,delete this.maxIndex,delete this._cache,this.changed.fire()},i.prototype.minIndex=void 0,i.prototype.maxIndex=void 0,i.prototype.merge=function(e){var t,i,n,o,r,s=this._marksBySpan,a={};for(t=0;t=n||(this.maxIndex=n),s[o]||(s[o]=[]),s[o].push(i),a[o]=!0}for(o=s.length;o--;)s[o]&&(s[o].length||delete s[o],a[o]&&s[o].sort(this._sortByIndexAsc));delete this._cache,this.changed.fire()},i.prototype._removeTickmark=function(e){var t,i,n=e.index;this._marksByIndex[n]===e&&(delete this._marksByIndex[n],n<=this.minIndex&&this.minIndex++,n>=this.maxIndex&&this.maxIndex--,this.maxIndex2;){if(1e3*this._marksByIndex[i].time===e)return i;if(1e3*this._marksByIndex[n].time===e)return n;t=Math.round((i+n)/2),1e3*this._marksByIndex[t].time>e?n=t:i=t}return i},i.prototype.build=function(e,t){var i,n,o,r,s,a,l,c,u,h,d,p,_,f,m=Math.ceil(t/e);if(this._maxbar===m&&this._cache)return this._cache;for(this._maxbar=m,i=[],n=this._marksBySpan.length;n--;)if(this._marksBySpan[n]){for(o=i,i=[],r=o.length,s=0,l=(a=this._marksBySpan[n]).length,c=1/0,u=-1/0,h=0;h=m&&p-u>=m&&(i.push(d),u=p)}for(;s=t}function r(e,t,i){return Math.min(Math.max(e,t),i)}function s(e){return e<0?-1:e>0?1:0}function a(e){
+if(e<0)return f.logDebug("MathEx.isBaseDecimal: argument less zero"),!1;for(var t=e;t>1;t/=10)if(t%10!=0)return!1;return!0}function l(e,t,i){return t-e<=i}function c(e,t,i){return Math.abs(e-t)t?1:0}function d(e,t){var i,n;if(void 0===t&&(t=h),e.length<1)throw Error("array is empty");for(i=e[0],n=0;n0&&(i=e[n]);return i}var _,f;i.r(t),i.d(t,"lessThan",function(){return n}),i.d(t,"greaterThan",function(){return o}),i.d(t,"clamp",function(){return r}),i.d(t,"sign",function(){return s}),i.d(t,"isBaseDecimal",function(){return a}),i.d(t,"greaterOrEqual",function(){return l}),i.d(t,"equal",function(){return c}),i.d(t,"log10",function(){return u}),i.d(t,"defComparator",function(){return h}),i.d(t,"min",function(){return d}),i.d(t,"max",function(){return p}),_=i("uOxu"),f=Object(_.getLogger)("Common.MathEx")},HySD:function(e,t,i){"use strict";var n,o,r,s;i.r(t),i.d(t,"ResizerDetacherState",function(){return s}),n=i("Eyy1"),o=i("hY0g"),r=i.n(o),s=function(){function e(e){var t=this;this._alive=new r.a,this._container=new r.a,this._width=new r.a,this._height=new r.a,this._fullscreen=new r.a,this._detachable=new r.a,this._fullscreenable=new r.a,this._visible=new r.a,this._availWidth=new r.a,this._availHeight=new r.a,this._owner=new r.a,this._ownersStack=[],this.owner=this._owner.readonly(),this._bridge={alive:this._alive.readonly(),container:this._container.readonly(),width:this._width.readonly(),height:this._height.readonly(),fullscreen:this._fullscreen.readonly(),detachable:this._detachable.readonly(),fullscreenable:this._fullscreenable.readonly(),visible:this._visible.readonly(),availWidth:this._availWidth.readonly(),availHeight:this._availHeight.readonly(),remove:function(){var e=t._owner.value();e&&e.remove&&e.remove()},negotiateWidth:function(e){var i=t._owner.value();i&&i.negotiateWidth&&i.negotiateWidth(e)},negotiateHeight:function(e){var i=t._owner.value();i&&i.negotiateHeight&&i.negotiateHeight(e)},requestFullscreen:function(){var e=t._owner.value();e&&e.requestFullscreen&&e.requestFullscreen()},exitFullscreen:function(){var e=t._owner.value();e&&e.exitFullscreen&&e.exitFullscreen()},detach:function(e){var i=t._owner.value();i&&i.detach&&i.detach(e)},attach:function(){var e=t._owner.value();e&&e.attach&&e.attach()}},e&&this.pushOwner(e)}return e.prototype.bridge=function(){return this._bridge},e.prototype.pushOwner=function(e){var t,i,n,o;if(e.alive.value()){for(t=0,i=this._ownersStack;t=i;t--)this._unsubscribeOwner(this._ownersStack[t],!0);this._ownersStack.length=i,i>0?this._subscribeOwner(this._ownersStack[i-1]):(this._alive.setValue(!1),this._owner.deleteValue())},e}()},I4UZ:function(e,t,i){"use strict";var n,o,r,s,a;i.r(t),i.d(t,"HeaderToolbarBootloader",function(){return a}),n=i("mrSG"),o=i("yMne"),r=i("YuHv"),s=i("cZRT"),a=function(e){function t(t,i){var n=e.call(this)||this;return n._toolsBootloader=t,n._headerProps=i,n._headerProps.resizerBridge.negotiateHeight(o.HEADER_TOOLBAR_HEIGHT_EXPANDED),n._headerProps.resizerBridge.container.value().appendChild(Object(r.a)()),n}return Object(n.__extends)(t,e),t.prototype._startLoading=function(){var e=this;return Promise.all([this._toolsBootloader.load(),this._loadHeaderToolbar()]).then(function(t){var i=t[0];return new(0,t[1])(e._headerProps.resizerBridge.container.value(),Object(n.__assign)(Object(n.__assign)({},e._headerProps),{tools:i}))})},t.prototype._loadHeaderToolbar=function(){return Promise.all([i.e("react"),i.e(35),i.e(36),i.e(60),i.e(8),i.e(30),i.e("header-toolbar")]).then(i.bind(null,"KMbc")).then(function(e){return e.HeaderToolbarRenderer})},t}(s.a)},I5CP:function(e,t,i){"use strict";(function(t){function n(e,t,i,n){this.reset(e,t,i,n)}var o=i("XlJ7").makeFont,r=i("u+0B").TextWidthCache,s=t.enabled("charting_library_debug_mode");n.prototype.maxCount=200,n.prototype.reset=function(e,t,i,n){this._textWidthCache=new r(this.maxCount),this._fontSize=e,this._color=n,this._font=o(e,t,i),this._keys=[],this._hash={}},n.prototype.paintTo=function(e,t,i,n,o){var r=this.getLabelImage(e,t);"left"!==o&&(i-=r.textWidth),n-=Math.floor(r.height/2),e.drawImage(r.canvas,i,n)},n.prototype.getLabelHeight=function(e,t){return this.getLabelImage(e,t).height},n.prototype.getLabelImage=function(e,t){var i,n,o,r,a;return Object.prototype.hasOwnProperty.call(this._hash,t)?i=this._hash[t]:(this._keys.length>=this.maxCount&&(n=this._keys.shift(),delete this._hash[n]),i={text:t,textWidth:0,width:0,height:0,canvas:document.createElement("canvas")},o=Math.ceil(this._fontSize/4.5),r=Math.round(this._fontSize/10),a=Math.ceil(this._textWidthCache.measureText(e,t)),
+i.textWidth=Math.round(Math.max(1,a)),i.width=Math.round(a+2*o),i.height=this._fontSize+2*o,0!==a?(this._keys.push(i.text),this._hash[i.text]=i):s&&console.log('Canvas 2d context measureText return zero width for "'+t+'" text'),i.canvas.width=i.width,i.canvas.height=i.height,(e=i.canvas.getContext("2d")).font=this._font,e.fillStyle=this._color,e.fillText(t,0,i.height-o-r)),i},e.exports=n}).call(this,i("Kxc7"))},I9zs:function(e,t,i){"use strict";function n(e,t,i,n){var o,r;for(this.m_study=e,this.m_series=t,this.m_model=i,this._plotName=n,this.m_items=[],this._invalidated=!0,this._isMarkersEnabled=K.enabled("source_selection_markers"),o=this.m_study.metaInfo().plots,this._colorer=null,this._palette=null,this._paletterProps=null,this._plotIndex=0,r=0;r=0&&e0?(t-=o,i+=o):(t+=o,i-=o),(r=this.m_study.getMinFirstBarIndexForPlot(this._plotName))>i))){if(t=Math.max(r,t),a=(s=this.m_study.properties().styles[this._plotName]).plottype.value(),l=[U.Line,U.Area,U.Circles,U.Cross].indexOf(a)>=0,c=this.m_study.data(),
+u=this.m_study.firstValue(),l&&c._length()>0){for(h=c._bsearch(t);n.isIndexValid(h,c)&&void 0===c._valueAt(h)[this._plotIndex+1];)h-=1;for(t=n.isIndexValid(h,c)?c._indexAt(h):t,d=c._bsearch(i);n.isIndexValid(d,c)&&void 0===c._valueAt(d)[this._plotIndex+1];)d+=1;i=n.isIndexValid(d,c)?c._indexAt(d):i}if(_=c.range(t,i),f=this.m_study.priceScale(),m=F(this._getTranspValue(),0,100),y={},g=function(e,t){var i=e+"@"+t;return y[i]||(this._plotName&&"vol"===this._plotName?y[i]=G.generateColor(e,t):y[i]=G.generateColor(e,t,!0)),y[i]}.bind(this),_.each(function(e,t){var i,n,r,a,c,u,h,d,_;return e+=o,e=Math.floor(e),i=(n=void 0===(i=t[this._plotIndex+1])||null===i)?NaN:i,(!l||!n)&&(r=new p(e,i),a=void 0!==t[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&a&&(i=t[this._colorer+1],r.style={},null!=i?(c=this._palette.valToIndex?this._palette.valToIndex[i]:i,h=(u=this._paletterProps.colors[c]).color.value(),r.style.color=G.isHexColor(h)?g(h,m):h):(h=s.color.value(),r.style.color=g(h,100)),d=void 0!==c?u.width.value():s.linewidth.value(),_=void 0!==c?u.style.value():s.linestyle.value(),r.style.width=d,r.style.style=_),this.m_items.push(r),!1)}.bind(this)),f.pointsArrayToCoordinates(this.m_items,u),this.m_model.timeScale().indexesToCoordinates(this.m_items),s.histogramBase&&(this._histogramBase=this.m_study.priceScale().priceToCoordinate(s.histogramBase.value(),u)),this.m_model.selection().isSelected(this.m_study))for(v=N(t,i),this._selectionData={points:[],bgColor:this.m_model.backgroundColor()},this._selectionData.hittestResult=S.REGULAR,b=0;b0?(s-=l,a+=l):(s+=l,a-=l),(c=this._study.getMinFirstBarIndexForPlot(this._plotName))>a||(s=Math.max(c,s),this._study.data().range(s,a).each(function(e,t){var i,s,a,c;return e+=l,i=t[this._plotIndex+1],s=new p(Math.floor(e)-.5),a=isNumber(r)?r:50,a=Math.min(a,100),a=Math.max(a,0),null!=i?(c=o.valToIndex?o.valToIndex[i]:i,s.color=G.generateColor(n[c].color.value(),a)):s.color=null,this._items.push(s),!1}.bind(this)),this._model.timeScale().indexesToCoordinates(this._items)))},o.prototype.renderer=function(){var e,t;if(this._study.properties().styles[this._plotName].visible&&this._study.properties().styles[this._plotName].visible.value()&&this._scalesReady())return this._invalidated&&(this._updateImpl(),this._invalidated=!1),e={items:this._items,y:0,h:this._study.priceScale().height(),w:Math.ceil(this._model.timeScale().barSpacing())},(t=new R).append(new V(e)),t},r.prototype.items=function(){return this.m_items},r.prototype.update=function(){this.m_invalidated=!0},r.prototype._scalesReady=function(){var e=this.m_model.timeScale(),t=this.m_study.priceScale();return e&&t&&!e.isEmpty()&&!t.isEmpty()},r.prototype._updateImpl=function(){var e,t,i,n,o,r,s,a,l,c,u,h,d,p,_,f,m,y,g,v;this.m_items=[],
+this._scalesReady()&&(e=this.m_model.timeScale(),t=this.m_study.priceScale(),null!==(i=e.visibleBarsStrictRange())&&(n=this.m_series.nearestIndex(i.firstBar(),q.NearestRight),o=this.m_series.nearestIndex(i.lastBar(),q.NearestLeft),(r=this.m_study.offset(this.m_plotName))>0?(n-=r,o+=r):(n+=r,o-=r),(s=this.m_study.getMinFirstBarIndexForPlot(this.m_plotName))>o||(n=Math.max(s,n),a=this.m_study.data(),l=this.m_study.firstValue(),c=a.range(n,o),u=this._getTranspValue(),h=N(n,o),d=this.m_model.selection().isSelected(this.m_study),this.m_selectionData=d?{points:[],hittestResult:S.REGULAR,vertOffset:0,isDark:this.m_model.isDark(),bgColor:this.m_model.backgroundColor()}:null,(_=(p=this.m_series.properties().style.value())===TradingView.Series.STYLE_LINE?"lineStyle":p===TradingView.Series.STYLE_AREA?"areaStyle":null)?(f=this.m_series.properties()[_].priceSource.value(),m=f):(f="high",m="low"),y=this.m_study.priceScale().isInverted(),g=t.coordinateToPrice(t.height()*t.topMargin(),l),v=t.coordinateToPrice(t.height()*(1-t.bottomMargin()),l),this._topCoord=y?v:g,this._bottomCoord=y?g:v,c.each(function(e,t){var i,n,o,s,a,l,c,p=Math.floor(e+r),_=t[this.m_plotIndex+1];return null!==_&&void 0!==_&&(void 0!==(i=this._createItem(p,_,f,m))&&null!==i?(n=void 0!==t[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&n&&(_=t[this._colorer+1],i.style={},null!=_?(a=this._palette.valToIndex?this._palette.valToIndex[_]:_,o=this._paletterProps.colors[a].color.value(),s=u>9?u-10:0,i.style.color=G.generateColor(o,u)):(o=this.m_study.properties().styles[this.m_plotName].color.value(),s=100,i.style.color=G.generateColor(o,100)),i.style.borderColor=G.generateColor(o,s)),l=void 0!==t[this._textColorer+1]||this._textPalette&&this._textPalette.addDefaultColor,this._textColorer&&l&&(_=t[this._textColorer+1],i.style||(i.style={}),null!=_?(a=this._textPalette.valToIndex?this._textPalette.valToIndex[_]:_,c=this._textPaletterProps.colors[a].color.value(),i.style.textColor=G.generateColor(c,u)):(c=this.m_study.properties().styles[this.m_plotName].textColor.value(),i.style.textColor=G.generateColor(c,100))),d&&-1!==h.indexOf(e)&&this.m_selectionData.points.push(i),this.m_items.push(i),!1):void 0)}.bind(this)),this._convertItemsToCoordinates())))},r.prototype._updateRenderer=function(){var e,t,i,n,o,r,s,a,l,c;this._updateImpl(),e=this.m_model.timeScale(),t={},i=this._getTranspValue(),n=e.barSpacing(),o=this._calculateShapeHeight(n),r=this.m_study.properties().styles[this.m_plotName].location.value(),s=this._calculateVerticalOffset(r,o+o/2),t.barSpacing=n,t.items=this.m_items,t.color=G.generateColor(this.m_study.properties().styles[this.m_plotName].color.value(),i),t.height=o,t.vertOffset=s,a=this.m_study.properties().styles[this.m_plotName].plottype.value(),l=W.plotShapesData[a],c=new R,l&&c.append(new TradingView[l.paneRendererClass](t)),this.m_model.selection().isSelected(this.m_study)&&this._isMarkersEnabled&&null!==this.m_selectionData&&(this.m_selectionData.vertOffset=s,c.append(new w(this.m_selectionData))),this.m_renderer=c},
+r.prototype._getSeriesVal=function(e,t){var i;e=e||"close",i=null;try{i=this.m_series[e](t)}catch(e){}return i},r.prototype._getTranspValue=function(){var e,t=0;return this.m_study.properties().transparency&&(t=this.m_study.properties().transparency.value(),t=isNumber(t)?t:50),(e=this.m_study.properties().styles[this.m_plotName]).transparency&&(t=e.transparency.value(),t=isNumber(t)?t:50),F(t,0,100)},r.prototype._createItem=function(e,t,i,n){var o,r,s,a=this.m_study.properties().styles[this.m_plotName].location.value();if(!t&&a!==H.Absolute)return null;switch(a){case H.AboveBar:if(void 0===(o=this._getSeriesVal(i,e))||null==o)return null;r=o;break;case H.BelowBar:if(void 0===(s=this._getSeriesVal(n,e))||null==s)return null;r=s;break;case H.Top:r=this._topCoord;break;case H.Bottom:r=this._bottomCoord;break;case H.Absolute:r=t;break;default:throw new Error("Bad value: "+a)}return new p(e,r)},r.prototype._convertItemsToCoordinates=function(){var e=this.m_model.timeScale(),t=this.m_study.priceScale();e.indexesToCoordinates(this.m_items),t.pointsArrayToCoordinates(this.m_items,this.m_study.firstValue())},r.prototype._calculateVerticalOffset=function(e,t){var i=0;switch(e){case H.AboveBar:case H.Bottom:i=-t;break;case H.BelowBar:case H.Top:i=t}return this.m_study.priceScale().isInverted()&&(i*=-1),i},r.prototype._calculateShapeHeight=function(e,t){var i=e;switch(t){case z.Tiny:i=.3*e;break;case z.Small:i=.6*e;break;case z.Normal:i=e;break;case z.Large:i=1.5*e;break;case z.Huge:i=2*e}return i},r.prototype.renderer=function(){if(this.m_study.properties().styles[this.m_plotName].visible&&this.m_study.properties().styles[this.m_plotName].visible.value()&&this._scalesReady())return this.m_invalidated&&(this._updateRenderer(),this.m_invalidated=!1),this.m_renderer},inherit(s,r),s.prototype._updateRenderer=function(e){var t,i,n,o,r,s,a,l,c,u,h,d,p,_,f,m;this._updateImpl(),t=this.m_model.timeScale(),i={},n=this._getTranspValue(),o=t.barSpacing(),e.size?(s=e.size.value(),r=this._calculateShapeHeight(25,s)):r=Math.round(o/2),a=e.location.value(),l=G.generateColor(e.color.value(),n),c=n>19?n-10:0,u=this._calculateVerticalOffset(a,Math.round(1.5*r)),i.barSpacing=o,i.items=this.items(),i.color=l,i.borderColor=G.generateColor(e.color.value(),c),i.height=r,i.vertOffset=u,h=e.plottype.value(),d=W.plotShapesData[h],p=new R,void 0!==(_=e.text?e.text.value():void 0)&&""!==_.trim()&&(f=_.trim().replace(/\\n/gm,"\n"),f=TradingView.cleanButAmpersand(f,!0),i.text=f,i.fontSize=12,m=e.textColor?e.textColor.value():void 0,i.textColor=m?G.generateColor(m,n):l),null!=d&&p.append(new TradingView[d.paneRendererClass](i)),this.m_model.selection().isSelected(this.m_study)&&this._isMarkersEnabled&&null!==this.m_selectionData&&(this.m_selectionData.vertOffset=u,p.append(new w(this.m_selectionData))),this.m_renderer=p},s.prototype.renderer=function(){var e=this.m_study.properties().styles[this.m_plotName];if(e.visible&&e.visible.value()&&this._scalesReady())return this.m_invalidated&&(this._updateRenderer(e),this.m_invalidated=!1),this.m_renderer},
+inherit(a,s),a.prototype.renderer=function(){var e,t,i,n,o,r,s,a,l,c,u,h,d,p=this.m_study.properties().styles[this.m_plotName];if(p.visible&&p.visible.value()&&this._scalesReady())return e=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),t={},i=this._getTranspValue(),n=e.barSpacing(),p.size?(r=p.size.value(),o=this._calculateShapeHeight(50,r)):o=Math.round(n),s=p.location.value(),a=G.generateColor(p.color.value(),i),l=this._calculateVerticalOffset(s,o),t.items=this.items(),t.barSpacing=n,t.char=p.char.value(),t.height=o,t.vertOffset=l,t.color=a,c=new R,void 0!==(u=p.text?p.text.value():void 0)&&""!==u.trim()&&(h=u.trim().replace(/\\n/gm,"\n"),h=TradingView.cleanButAmpersand(h,!0),t.text=h,t.fontSize=12,d=p.textColor?p.textColor.value():void 0,t.textColor=d?G.generateColor(d,i):a),c.append(new D(t)),this.m_model.selection().isSelected(this.m_study)&&this._isMarkersEnabled&&null!==this.m_selectionData&&(this.m_selectionData.vertOffset=l,c.append(new w(this.m_selectionData))),c},inherit(l,r),l.prototype.renderer=function(){var e,t,i,n,o,r,s,a,l;if(this.m_study.properties().styles[this.m_plotName].visible&&this.m_study.properties().styles[this.m_plotName].visible.value()&&this._scalesReady())return this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),e={},t=F(this._getTranspValue(),0,100),i=this.m_model.timeScale().barSpacing(),e.items=this.m_items,e.barSpacing=i,e.colorup=G.generateColor(this.m_study.properties().styles[this.m_plotName].colorup.value(),t),e.colordown=G.generateColor(this.m_study.properties().styles[this.m_plotName].colordown.value(),t),o=(n=v(e.colorup))?100*(1-n[3]):0,s=(r=v(e.colordown))?100*(1-r[3]):0,e.colorBorderUp=G.generateColor("#000000",o),e.colorBorderDown=G.generateColor("#000000",s),e.minHeight=this.m_study.properties().styles[this.m_plotName].minHeight.value(),e.maxHeight=this.m_study.properties().styles[this.m_plotName].maxHeight.value(),(a=new R).append(new O(e)),this.m_model.selection().isSelected(this.m_study)&&null!==this.m_selectionData&&((l=this.m_selectionData).barSpacing=i,a.append(new P(l))),a},l.prototype._createItem=function(e,t,i,n){var o,r,s,a;if(0!==t){if(Math.abs(t)>this._maxAbsValue&&(this._maxAbsValue=Math.abs(t)),o=t>0){if(void 0===(s=this._getSeriesVal(n,e))||null==s)return null;r=s}else{if(void 0===(a=this._getSeriesVal(i,e))||null==a)return null;r=a}return new E(e,r,t,o)}},l.prototype._convertItemsToCoordinates=function(){var e,t,i,n,o,r,s,a,l=this.m_model.timeScale(),c=this.m_study.priceScale();for(l.indexesToCoordinates(this.m_items),c.pointsArrayToCoordinates(this.m_items,this.m_study.firstValue()),(e=Math.abs(this.m_study.properties().styles[this.m_plotName].minHeight.value()))>(t=Math.abs(this.m_study.properties().styles[this.m_plotName].maxHeight.value()))&&(i=e,e=t,t=i),n=(t-e)/this._maxAbsValue,o=this.m_items,r=0;ri)&&(t=Math.max(n,t),o=this.m_study.data(),r=this.m_study.firstValue(),s=o.range(t,i),a=0,l=this.m_study.properties().ohlcPlots[this.m_plotName],c={},u=function(e,t){var i=e+"@"+t;return c[i]||(c[i]=G.generateColor(e,t)),c[i]},s.each(function(e,t){var i,n,o,r,s,c,h,d,p,_;for(e=Math.floor(e),i=!0,n={},o=TradingView.OPEN_PLOT;o<=TradingView.CLOSE_PLOT;++o){if(void 0===(r=t[this._ohlcPlotIndexes[o]+1])||null===r){i=!1;break}n[o]=r}return!!i&&(s=n[TradingView.OPEN_PLOT],c=n[TradingView.CLOSE_PLOT],h=Math.max(s,n[TradingView.HIGH_PLOT],n[TradingView.LOW_PLOT],c),d=Math.min(s,n[TradingView.HIGH_PLOT],n[TradingView.LOW_PLOT],c),(p={}).time=Math.round(e),p.open=s,p.high=h,p.low=d,p.close=c,_=this._colorer?null!=t[this._colorer+1]?this._plotValueToPaletteColor(t[this._colorer+1]):"rgba(0, 0, 0, 0)":l.color.value(),p.color=u(_,a),p.hollow=null,this.m_bars.push(p),!1)}.bind(this)),this.m_study.priceScale().barPricesToCoordinates(this.m_bars,r),this.m_model.timeScale().barIndexesToCoordinates(this.m_bars),this.m_model.selection().isSelected(this.m_study))))for(h=N(t,i),this._selectionData={points:[],hittestResult:S.REGULAR,isDark:this.m_model.isDark(),bgColor:this.m_model.backgroundColor()},d=0;di?((a=n(e,i,t,o,r)).count=-a.count,a):s(e,t,1,function(e,t){return t>i||0!==o&&e>o},r)}function o(e,t,i,n){var o;return void 0===n&&(n=!1),s(e,t,o=i<0?-1:1,function(e,t){return e>=i*o},n)}function r(e,t,i){var n=i<0?-1:1,o=function(e,t){return e>=i*n},r=s(e,t,n,o,!0);return r.times}function s(e,t,i,n,o){var r,s,l,c,u,h,d,p,_=0,f=t;for(e.moveTo(f),r=0,s=Number.MAX_VALUE,l=!1,c=t,u=[];!n(_,f);){if(r>15)throw new Error("Internal error 0x10 while extrapolating.");if((h=e.indexOfBar(f))===a.SessionStage.PRE_SESSION&&1===i)f=e.startOfBar(0),e.moveTo(f);else if(h===a.SessionStage.PRE_SESSION&&-1===i)f=e.startOfBar(a.SessionStage.PRE_SESSION)-1,e.moveTo(f);else if(h===a.SessionStage.POST_SESSION&&1===i)f=e.startOfBar(a.SessionStage.POST_SESSION),e.moveTo(f);else{if(h===a.SessionStage.POST_SESSION&&-1===i)throw new Error("Internal error 0x12 while extrapolating.");if((d=e.startOfBar(h))>t&&i>0||t>d&&i<0){if(l&&s===d)throw new Error("Internal error 0x11 while extrapolating.");l=!0,s=d,r=0,_++,c=d,o&&u.push(c)}0===h&&-1===i?f=d-1:(f=e.startOfBar(h+i))>(p=e.startOfBar(a.SessionStage.POST_SESSION))&&(e.moveTo(p),f=e.startOfBar(0))}r++}return{time:c,times:u,count:_}}i.r(t),i.d(t,"extrapolateBarsFrontToTime",function(){return n}),i.d(t,"extrapolateBarsFrontByCount",function(){return o}),i.d(t,"extrapolateBarsFrontByCountAllPoints",function(){return r}),i.d(t,"extrapolateBars",function(){return s});var a=i("E6p6")},IVMC:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.reduce(function(e,t,i){return~e.indexOf(t)||e.push(t),e},[])},e.exports=t.default},IWXC:function(e,t,i){"use strict";function n(e){return void 0===e&&(e="full"),c[e]||o(e,new l.a(e)),c[e]}function o(e,t){void 0===e&&(e="full"),c[e]=t}function r(e){return void 0===e&&(e="full"),c[e]}function s(){var e,t;for(e in c)c.hasOwnProperty(e)&&(void 0!==(t=c[e])&&t.destroy(),delete c[e])}var a,l,c;i.r(t),i.d(t,"getQuoteSessionInstance",function(){return n}),i.d(t,"setQuoteSessionInstance",function(){return o}),i.d(t,"getQuoteSessionNoEnsure",function(){return r}),i.d(t,"destroyQuoteSessions",function(){return s}),a=i("hGf4"),l=i.n(a),c={}},Ialn:function(e,t,i){"use strict";function n(e){return""!==e&&d()&&void 0!==e&&null!==e?e.replace(y,""):e}function o(e){return""!==e&&d()&&void 0!==e&&null!==e?p+e:e}function r(e){return""!==e&&d()&&void 0!==e&&null!==e?_+e+m:e}function s(e){return _+e+m}function a(e){return""!==e&&d()&&void 0!==e&&null!==e?f+e+m:e}function l(e){return Object(h.getNormalizedScrollLeft)(e,"rtl")}function c(e,t){var i=Object(h.detectScrollType)();if("indeterminate"===i)return 0;switch(i){case"negative":
+t=e.clientWidth-e.scrollWidth+t;break;case"reverse":t=e.scrollWidth-e.clientWidth-t}return t}function u(e){var t=g.exec(e);return t?v.test(t[0])?"rtl":"ltr":""}var h,d,p,_,f,m,y,g,v;i.r(t),i.d(t,"isRtl",function(){return d}),i.d(t,"stripLTRMarks",function(){return n}),i.d(t,"startWithLTR",function(){return o}),i.d(t,"forceLTRStr",function(){return r}),i.d(t,"forceLTRStrSsr",function(){return s}),i.d(t,"forceRTLStr",function(){return a}),i.d(t,"getLTRScrollLeft",function(){return l}),i.d(t,"getLTRScrollLeftOffset",function(){return c}),i.d(t,"detectAutoDirection",function(){return u}),h=i("oYVD"),d=function(){return"rtl"===window.document.dir},p="",_="",f="",m="",y=new RegExp(p+"|"+_+"|"+f+"|"+m,"g"),g=/[^\u0000-\u0040\u005B-\u0060\u007B-\u00BF\u00D7\u00F7\u02B9-\u02FF\u2000-\u200E\u2010-\u2029\u202C\u202F-\u2BFF]/,v=/[\u0590-\u07FF\u200F\u202B\u202E\uFB1D-\uFDFD\uFE70-\uFEFC]/},IiTo:function(e,t,i){"use strict";function n(e,t){return t-function(e,t){var i=new Date(t);return function(e,t){var i=t.multiplier()||0;switch(t.kind()){case y.ResolutionKind.Months:!function(e,t){o(e,Math.floor(t/12));var i=e.getUTCMonth()-t%12;for(i<0&&(o(e,1),i+=12),e.setUTCMonth(i);e.getUTCMonth()!==i;)r(e,1)}(e,i);break;case y.ResolutionKind.Weeks:!function(e,t){r(e,7*t)}(e,i);break;case y.ResolutionKind.Days:r(e,i);break;default:throw new Error("Unsupported resolution type")}}(i,e),i.getTime()}(e,t)}function o(e,t){var i=e.getUTCMonth();e.setUTCFullYear(e.getUTCFullYear()-t),e.getUTCMonth()!==i&&r(e,1)}function r(e,t){e.setTime(e.getTime()-864e5*t)}function s(e){return 0|e}function a(e,t){var i,n=f.clone(t),o=e.businessDaysToCalendarDays(n,1);if(o>1&&f.add_date(n,o-1),null===(i=e.leftBorderOfDailyBar(n)))throw new Error("Cannot calculate left border of daily bar");return f.cal_to_utc(f.get_timezone(e.timezone()),i)}function l(e,t){var i=f.get_day_of_week(t)-e.firstDayOfWeek();return i<0?i+7:i}function c(e,t){var i=f.get_day_of_year(t)-1,n=l(e,t)-i%7;return 0===n?s(i/7):(n>=0&&(n-=7),s((n+i)/7))}function u(e,t,i,n){var o,r;return void 0===n&&(n=!1),r=(o=y.Interval.parse(e)).multiplier(),o.kind()===y.ResolutionKind.Hours?new P(60*r*60,t):o.kind()===y.ResolutionKind.Minutes?new P(60*r,t):o.kind()===y.ResolutionKind.Seconds?new P(r,t):o.kind()===y.ResolutionKind.Range?new P(60*r,t):new T(t,i,r,function(e,t){switch(e){case y.ResolutionKind.Days:return new L(t);case y.ResolutionKind.Weeks:return new M(t);case y.ResolutionKind.Months:return new A}throw new Error("Unknown dwm resolution: "+e)}(o.kind(),t),n)}function h(e,t,i,o,r,s,a){var l,c,u,h,d=new b("Etc/UTC",e,t,i),p=y.Interval.parse(r+o),_=p.isDWM();return _?(c=n(p,a),l=864e5):(c=p.inMilliseconds(),l=60*d.spec.findSession(0,0,0).getEntry().length()*1e3),u=l/c,0,s<(h=(_?7:7-d.spec.weekEndsCount())*u)?a-864e5*(s/u):a-6048e5*(s/h)}function d(e,t){return!m.enabled("disable_resolution_rebuild")&&y.Interval.isDWM(e)?u(e,t,k):null}function p(e,t){var i=f.clone(t);return e.alignToSessionStart(i),f.cal_to_utc(f.get_timezone(e.timezone()),i)}function _(e,t){
+var i=f.utc_to_cal(t.timezone,+e),n=f.get_day_of_week(i),o=f.get_minutes_from_midnight(i),r=t.spec.findSession(t.spec.getWeekIndex(i),n,o).getEntry();return r.isOvernight()&&o>r.startOffset()+r.length()&&n===r.dayOfWeek()-1&&(n++,o-=1440),n===r.dayOfWeek()&&o>=r.startOffset()&&o=this._sessionEndMs?v.SessionStage.POST_SESSION:s(f.time_seconds_diff(e,this._sessionStartMs)/this._periodSec)},t.prototype.startOfBar=function(e){var t,i;if(e===v.SessionStage.PRE_SESSION)return t=f.get_cal_from_unix_timestamp_ms(this._session.timezone,this._sessionStartMs-1),i=this._session.spec.alignToNearestSessionEnd(t,-1),f.cal_to_utc(this._session.timezone,i);if(e===v.SessionStage.POST_SESSION)return this._sessionEndMs;if(e<0)throw new Error("Negative offset is not supported");return this._sessionStartMs+f.time_seconds(this._periodSec*e)},t.prototype.endOfBar=function(e){if(e<0)throw new Error("Index cannot be negative");var t=this.startOfBar(e)+1e3*this._periodSec;return t>this._sessionEndMs?this._sessionEndMs:t},t.prototype.isLastBar=function(e,t){return t>=this._sessionStartMs+f.time_seconds(this._periodSec*(e+1)-1)},t.prototype.moveTo=function(e){var t=this._session.timezone,i=f.utc_to_cal(t,e),n=this._session.spec,o=n.alignToSessionStart(i);this._sessionStartMs=f.cal_to_utc(t,i),f.add_minutes(i,o),this._sessionEndMs=f.cal_to_utc(t,i)},t.prototype.moveNext=function(){this.moveTo(this._sessionEndMs)},t}(w),C=i("OBgQ"),T=function(e){function t(t,i,n,o,r){void 0===r&&(r=!1);var s=e.call(this)||this;return s._periodStart=-Number.MAX_VALUE,s._periodEnd=-Number.MAX_VALUE,s._periodLastBarStart=-Number.MAX_VALUE,s._periodStartDay=new C.a(0,0,0),s._periodEndDay=new C.a(0,0,0),s._period=n,s._sessionTgt=t,s._builder=o,s._useBusinessDays=r,s._sessionSrc=r?new b("Etc/UTC","24x7"):i||t,s}return Object(g.__extends)(t,e),t.prototype.builder=function(){return this._builder},t.prototype.alignTimeIfPossible=function(e){return this.tradingDayToSessionStart(e)},t.prototype.tradingDayToSessionStart=function(e){return this.moveTo(e),this.startOfBar(0)},t.prototype.indexOfBar=function(e){if(this._useBusinessDays){
+var t=C.a.fromCalendar(f.get_cal_from_unix_timestamp_ms(this._sessionSrc.timezone,e));return t.before(this._periodStartDay)?v.SessionStage.PRE_SESSION:this._periodEndDay.before(t)?v.SessionStage.POST_SESSION:0}return e=this._periodEnd?v.SessionStage.POST_SESSION:0},t.prototype.startOfBar=function(e){var t,i;return e===v.SessionStage.PRE_SESSION?(t=f.get_cal_from_unix_timestamp_ms(this._sessionTgt.timezone,this._periodStart-1),i=this._sessionTgt.spec.alignToNearestSessionEnd(t,-1),f.cal_to_utc(this._sessionTgt.timezone,i)-1):e===v.SessionStage.POST_SESSION||e>0?this._periodEnd:e===v.SessionStage.LASTBAR_SESSION?this._periodLastBarStart:this._periodStart},t.prototype.moveTo=function(e){var t,i,n,o,r,s,l,c,u,h,d=f.get_cal_from_unix_timestamp_ms(this._sessionSrc.timezone,e);for(this._sessionSrc.spec.correctTradingDay(d),t=f.get_year(d),n=(i=this._indexOfPeriodInYear(d))+this._period,o=this._sessionTgt.spec,r=this._sessionTgt.timezone,s=this._builder.startOfPeriod(r,i,t),this._periodStart=a(o,s),l=f.clone(s),(c=o.businessDaysToCalendarDays(l,1))>1&&f.add_date(l,c-1),this._periodStartDay=C.a.fromCalendar(l),u=this._builder.startOfPeriod(r,n,t),this._periodEnd=a(o,u),h=f.clone(u),f.add_date(h,-1);o.isCalWeekEnd(h);)f.add_date(h,-1);this._periodEndDay=C.a.fromCalendar(h),f.add_date(u,-1),function(e,t){for(;e.isCalWeekEnd(t);)f.add_date(t,-1)}(this._sessionTgt.spec,u),this._periodLastBarStart=a(o,u),(this._periodLastBarStart=this._periodLastBarStart},t.prototype.currentRange=function(){return{from:this._periodStartDay,to:this._periodEndDay}},t.prototype.indexOfBarInYear=function(e){var t=f.get_cal_from_unix_timestamp_ms(this._sessionSrc.timezone,e),i=f.get_year(t),n=this._builder.indexOfPeriod(t),o=this._sessionTgt.timezone,r=this._builder.startOfPeriod(o,n,i),s=a(this._sessionTgt.spec,r);return r=f.get_cal_from_unix_timestamp_ms(f.get_timezone("Etc/UTC"),s),i0&&(o=this._sessionsSpec.businessDaysToCalendarDays(c,i),f.add_date(c,o)),r=f.get_day_of_year(c)-1,ns?this.startOfPeriod(e,0,i+1):(f.add_date(n,r),n)},e}(),A=function(){function e(){}return e.prototype.indexOfPeriod=function(e){return f.get_month(e)},e.prototype.startOfPeriod=function(e,t,i){if(t<0){var n=s((11-t)/12);i-=n,t+=12*n}else t>f.DECEMBER&&(i++,t=f.JANUARY);return f.get_cal(f.get_timezone("Etc/UTC"),i,t,1)},e}(),i.d(t,"newBarBuilder",function(){return u}),i.d(t,"alignPeriodsBack",function(){return h}),i.d(t,"createDWMAligner",function(){return d}),i.d(t,"alignExchangeTimeToSessionStartAndReturnUTC",function(){return p}),i.d(t,"isTradingNow",function(){return _}),i.d(t,"SessionInfo",function(){return b}),k=new b("Etc/UTC","0000-0000:1234567")},IjC5:function(e,t,i){"use strict";var n,o,r,s,a,l,c,u;i.r(t),i.d(t,"RectangleRenderer",function(){return u}),n=i("Eyy1"),o=i("f6yo"),r=i("aO4+"),s=i("GEp6"),a=i("VdBB"),l=i("Tmoa"),c=i("jFln"),u=function(){function e(e,t,i){this._data=null,this._hitTestResult=e||new a.HitTestResult(a.HitTestResult.MOVEPOINT),this._backHitTestResult=t||new a.HitTestResult(a.HitTestResult.MOVEPOINT_BACKGROUND),this._forceOverrideTransparency=Boolean(i)}return e.prototype.setData=function(e){this._data=e},e.prototype.draw=function(e){var t,i,n;null===this._data||this._data.points.length<2||(e.lineCap="butt",e.strokeStyle=this._data.color,e.lineWidth=this._data.linewidth,void 0!==this._data.linestyle&&Object(c.setLineStyle)(e,this._data.linestyle),i=(t=this._data.points)[0],n=t[1].subtract(i),e.beginPath(),e.rect(i.x,i.y,n.x,n.y),
+this._data.linewidth>0&&e.stroke(),this._data.fillBackground&&(e.fillStyle=this.getColor(),e.fill()))},e.prototype.hitTest=function(e){var t,i,n,a,l,c,u,h,d;return null===this._data||this._data.points.length<2||this._data.nohittest?null:(i=(t=this._data.points)[0],n=t[1],a=new r.Point(n.x,i.y),l=new r.Point(i.x,n.y),Object(s.distanceToSegment)(i,a,e).distance<=3?this._hitTestResult:Object(s.distanceToSegment)(a,n,e).distance<=3?this._hitTestResult:Object(s.distanceToSegment)(n,l,e).distance<=3?this._hitTestResult:Object(s.distanceToSegment)(l,i,e).distance<=3?this._hitTestResult:this._data.fillBackground&&(c=Math.min(i.x,n.x),u=Math.max(i.x,n.x),h=Math.min(i.y,n.y),d=Math.max(i.y,n.y),i=new r.Point(c,h),n=new r.Point(u,d),Object(o.pointInBox)(e,Object(r.box)(i,n)))?this._backHitTestResult:null)},e.prototype.getColor=function(){var e=Object(n.ensure)(this._data);return void 0===e.transparency?e.backcolor:Object(l.generateColor)(e.backcolor,e.transparency,this._forceOverrideTransparency)},e}()},InMJ:function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolFlatBottom";var r=t||n.createProperties();o.call(this,e,r),this.version=n.version,i.e("lt-pane-views").then(function(e){var t=i("gr7S").FlatBottomPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,s=i("hayr").propertyPages,a=window.t("Flat Bottom");inherit(n,o),n.version=1,n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return a},n.prototype.name=function(){return"Flat Bottom"},n.prototype.hasEditableCoordinates=function(){return!1},n.prototype.addPoint=function(e,t){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),o.prototype.addPoint.call(this,e)},n.prototype.setLastPoint=function(e,t){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),o.prototype.setLastPoint.call(this,e)},n.prototype.setPoint=function(e,t,i){if(i&&i.shift()&&1===e){this._snapPoint45Degree(t,this.points()[0])}e<3?o.prototype.setPoint.call(this,e,t):this._points[0].index=t.index},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){var e,t,i,n,o,r,s,a,l,c=this._points[0],u=this._points[1],h=[];return c.index<=u.index?(h.push(c),h.push(u)):(h.push(u),h.push(c)),(e=this._points[2]).time=u.time,e.index=u.index,t={price:e.price,time:c.time,index:c.index},i=[],e.index<=t.index?(i.push(e),i.push(t)):(i.push(t),i.push(e)),h[0].price>i[0].price?(n=h,o=i):i[0].price>h[0].price?(n=i,o=h):i[1].price>h[1].price?(n=i,o=h):(n=h,o=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),c.index<=u.index?(r=a,s=l):(r=l,s=a),[this._linePointsToAlertPlot(n,"Upper",r,s),this._linePointsToAlertPlot(o,"Lower",a,s)]},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return s.LineToolFlatBottomStylesPropertyPage},
+n.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(13),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("vm8R").GeneralTrendFiguresDefinitionsViewModel}.bind(null,i)).catch(i.oe)},n.createProperties=function(e){var t=new r("linetoolflatbottom",e);return n._configureProperties(t),t},n._configureProperties=function(e){o._configureProperties(e)},t.LineToolFlatBottom=n},IzGk:function(e,t,i){"use strict";function n(e){var t=(""+e).match(/(.*)([DWM])/);return t?t[1]+window.t(t[2],{context:"interval_short"}):e}i.r(t),i.d(t,"translatedIntervalString",function(){return n});i("YFKU")},J2xC:function(e,t,i){e.exports={"css-value-header-toolbar-height":"38px"}},JOqt:function(e,t,i){"use strict";i.r(t),i.d(t,"debounce",function(){return n});var n=function(e,t){function i(){e.apply(o,n)}var n,o,r=0;return function(){o=this,n=arguments,clearTimeout(r),r=setTimeout(i,t)}}},JT5O:function(e,t,i){"use strict";var n,o,r;i.r(t),i.d(t,"StudyMarket",function(){return r}),n=i("aIyQ"),o=i.n(n),r=function(){function e(e,t){this.visibilityChanged=new o.a,this._dialogPromise=null,this._dialog=null,this._chartWidgetCollection=e,this._options=t}return e.prototype.isVisible=function(){return null!==this._dialog&&this._dialog.isVisible()},e.prototype.show=function(e){var t=this;return null===this._dialog?this._requestDialog().then(function(){return t.show(e)}):this._dialog.show(e)},e.prototype.hide=function(){null!==this._dialog&&this._dialog.hide()},e.prototype.onCustomScriptModified=function(){null!==this._dialog&&this._dialog.onCustomScriptModified()},e.prototype.resetAllPages=function(){null!==this._dialog&&this._dialog.resetAllPages()},e.prototype.updateFavorites=function(){null!==this._dialog&&this._dialog.updateFavorites()},e.prototype.getDialog=function(){return this._dialog},e.prototype._requestDialog=function(){var e=this,t=function(t,n){Promise.all([i.e("dialogs-core"),i.e(19),i.e(32),i.e(66),i.e("create-dialog"),i.e("study-market")]).then(function(n){var o=i("24k8").StudyMarketDialog;t(new o(e._chartWidgetCollection,e._options))}.bind(null,i)).catch(n)};return null===this._dialogPromise&&(this._dialogPromise=new Promise(t).then(function(t){e._dialogPromise=null,e._dialog=t,e._dialog.visibilityChanged.subscribe(null,function(t){e.visibilityChanged.fire(t)})})),this._dialogPromise},e}()},JcHK:function(e,t,i){"use strict";function n(e){return e.getAll().some(function(e){return e.isInitialized()})}function o(e,t){var i=e.getAll(),n=function(){t(),i.forEach(function(e){e.chartWidgetInitialized.unsubscribe(null,n)})};i.forEach(function(e){e.chartWidgetInitialized.subscribe(null,n,!0)})}i.r(t),i.d(t,"isAnyChartWidgetInitialized",function(){return n}),i.d(t,"waitAnyChartWidgetInitialized",function(){return o})},JjUe:function(e,t,i){"use strict";var n,o,r,s,a,l,c,u,h,d,p,_,f,m,y,g,v;i.r(t),i.d(t,"OverlayDataWindowView",function(){return v}),n=i("mrSG"),o=i("ivNn"),r=i("4miz"),s=i("GH0z"),a=i("k9/m"),l=i("7qT/"),c=i("Ialn"),u=i("qFKp"),h=i("38az"),d=i("e92V"),p=i("mMWL"),_=u.CheckMobile.any(),
+f=_&&!0,m=new s.PercentageFormatter,y=window.t("n/a"),g=y+" ("+y+"%)",v=function(e){function t(t,i){var n=e.call(this)||this;return n._invalidated=!0,n._study=t,n._model=i,n._items.push(new r.a(window.t("Open"),"")),n._items.push(new r.a(window.t("High"),"")),n._items.push(new r.a(window.t("Low"),"")),n._items.push(new r.a(window.t("Close"),"")),n._items.push(new r.a("","")),n._items.push(new r.a("","")),n._items.push(new r.a(window.t("Change"),"")),n.update(),n}return Object(n.__extends)(t,e),t.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},t.prototype.update=function(){this._invalidated=!0},t.prototype._updateImpl=function(){var e,t,i,n,r,s,l,u,h,d,p,_,f,v,S,b,w,P;if(this._header=this._study.title(),this._items[0].setValue(y),this._items[1].setValue(y),this._items[2].setValue(y),this._items[3].setValue(y),this._items[6].setValue(g),!this._model.timeScale().isEmpty()&&0!==this._study.data().size()){for(e=this._showLastPriceAndChangeOnly(),t=0,i=this._items;t=0?0:1,basedOnPrevClose:o.change>=0?0:1}}}else if(null!==(s=(r=this._study.data().search(i-1,a.PlotRowSearchMode.NearestLeft,1))&&r.value[4]||null))return{values:{change:e-s,percentChange:Object(l.a)(s,e)},priceDirection:{basedOnCurrentBar:e>=t?0:1,basedOnPrevClose:e>=s?0:1}};return{priceDirection:{basedOnCurrentBar:e>=t?0:1,basedOnPrevClose:e>=t?0:1}}},t.prototype._color=function(e,t,i){var n,o,r,s=h.SeriesBarColorer.upColor(this._study.properties()),a=h.SeriesBarColorer.downColor(this._study.properties())
+;return i&&!f?t.priceDirection?s:a:10===(n=this._study.properties().childs().style.value())?null!=(o=this._study.barColorer().barStyle(e,!1)).barBorderColor?o.barBorderColor:o.barColor:(r=!1,0===n?r=this._study.properties().childs().barStyle.childs().barColorsOnPrevClose.value():1===n?r=this._study.properties().childs().candleStyle.childs().barColorsOnPrevClose.value():9===n&&(r=!0),r?0===t.priceDirection.basedOnPrevClose?s:a:0===t.priceDirection.basedOnCurrentBar?s:a)},t}(r.b)},JmuD:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)},t.hasProperty=function(e,t){return t in e}},K4L1:function(e,t,i){"use strict";function n(e,t){var n,o,r,a,l,c,u,h,d;if(!e)throw new Error("No studies metainfo");if(n=i("EyEd"),this._studiesMetainfo=e,!t)throw new Error("No studies migrations");for(this._studiesMigrations=t,this._migrations={},o=0;o=22)return t;for(i={},n=0,o=0;void 0!==(r=t[o]);)s=t[r.id],r.isFake&&(r.id="in_"+n++),i[o]=r,i[r.id]=s,o++;return i}]}var o=i("Eyy1").assert,r=i("lCO3").Version,s=i("uOxu").getLogger("Chart.Study.Versioning"),a=i("Wt0y"),l=i("0YCj"),c=i("TcSq").extractPineId,u=i("Si3H").migrateMetaInfoAndPropState;n.prototype.updateMetaInfo=function(e){var t,i,n;if(!e)return e;for(o(!e.isTVScript,"This method should update only built-in java indicators metaInfo. For Pine indicators use updateMetaInfoAsync"),t=null,i=this._studiesMetainfo,n=0;n=12&&a<=26){for(c={},r=0;r=12&&u<=26)for(h=r.columns,r.columns=[],d=0;do&&s.logWarn("Bad integer input max value in metaInfo id="+e.id+" title="+e.description)},n._fixInputsMaxValue=function(e,t){var i,o,r,s,a,l;if(!TradingView.isAbsent(t)){if(i=n.INPUT_MAX_VALUE,t.inputs)for(o=0;oi&&(r.max=i);if(e&&e.inputs){for(l in a=(s=n.splitInputs(e.inputs)).arr)"integer"===(r=a[l]).type&&r.max&&r.max>i&&(r.max=i);e.inputs=TradingView.merge(s.obj,s.arr)}}},n.prototype.patchPropsStateAndMetaInfo=function(e,t,i){var o,r,s,a,h,d,p,_,f,m,y,g,v,S,b,w,P,C,T;if("Script$BOOKER"!==t.productId||t.alerts||delete e.alerts,n._fixInputsOrder(e,t),n._fixInputsMaxValue(e,t),o=n.splitInputs(e.inputs),e.inputs=o.obj,(r=l.versionOf(t))o&&(o=n);e[o+1]=t},n.splitInputs=function(e){var t,i={},n={};for(t in e)isNumber(parseInt(t,10))?i[t]=e[t]:n[t]=e[t];return{arr:i,obj:n}},n.findInputKeyById=function(e,t){var i,n=null;for(i in e)if(isNumber(parseInt(i,10))&&e[i].id===t){n=i;break}return n},n.getInputKeyById=function(e,t){var i=n.findInputKeyById(e,t);if(!i)throw new Error("Cannot find input with id: "+t);return i},e.exports=n},K8V9:function(e,t){e.exports=''},KEYX:function(e,t,i){"use strict";var n,o,r;i.r(t),i.d(t,"CrossHairPriceAxisView",function(){return r}),n=i("mrSG"),o=i("KcY8"),r=function(e){function t(t,i,n){var o=e.call(this)||this;return o._background="#4c525e",o._source=t,o._priceScale=i,o._valueProvider=n,o}return Object(n.__extends)(t,e),t.prototype._updateRendererData=function(e,t,i){var n,o,r;e.visible=!1,o=null!==(n=this._priceScale.mainSource())?n.firstValue():null,this._source.visible&&null!==this._source.pane&&!this._priceScale.isEmpty()&&null!==o&&(i.background=this._background,i.color=this.generateTextColor(this._background),r=this._valueProvider(this._priceScale),i.coordinate=r.coordinate,
+e.text=this._priceScale.formatPrice(r.price,o),e.visible=!0)},t}(o.a)},KUek:function(e,t,i){"use strict";var n,o,r,s,a,l,c,u,h,d,p,_,f,m,y,g,v,S,b,w,P;i.r(t),n=i("Eyy1"),o=i("aIyQ"),r=i.n(o),s=i("k9/m"),a=i("hsV8"),l=i("jy4L"),c=i("w4Ji"),u=i("jenN"),h=i("uOxu"),d=Object(h.getLogger)("Chart.StudyDataSource"),function(e){e[e.Undefined=0]="Undefined",e[e.Loading=1]="Loading",e[e.Completed=2]="Completed",e[e.Error=3]="Error"}(p||(p={})),function(e){e[e.Idle=0]="Idle",e[e.AwaitingConnection=1]="AwaitingConnection",e[e.AwaitingParent=2]="AwaitingParent",e[e.AwaitingFirstDataUpdate=3]="AwaitingFirstDataUpdate",e[e.Active=4]="Active"}(_||(_={})),f=function(){function e(e,t,i,n){this._inputs=null,this._status=_.Idle,this._studyId=null,this._turnaroundCounter=1,this._studyStatus={type:p.Undefined},this._studyStatusChanged=new r.a,this._graphics=new u.LiveStudyGraphics,this._dataCleared=new r.a,this._dataUpdated=new r.a,this._boundOnGatewayIsConnectedChanged=this._onGatewayIsConnectedChanged.bind(this),this._ongoingDataUpdate=Promise.resolve(),this._gateway=e,this._metaInfo=n,this._series=t,this._turnaroundPrefix=i,this._plots=new s.PlotList(Object(c.studyPlotFunctionMap)(n)),this._gateway.isConnected().subscribe(this._boundOnGatewayIsConnectedChanged)}return e.prototype.destroy=function(){this.stop(),this._gateway.isConnected().unsubscribe(this._boundOnGatewayIsConnectedChanged),this._dataUpdated.destroy(),this._dataCleared.destroy(),this._studyStatusChanged.destroy()},e.prototype.metaInfo=function(){return this._metaInfo},e.prototype.inputs=function(){return this._inputs},e.prototype.setInputs=function(e){this._inputs=e,null!==this._studyId&&(this._turnaroundCounter++,this._onStudyStatusChangedTo({type:p.Undefined}),this._gateway.modifyStudy(this._studyId,this._turnaround(),e,this._onMessage.bind(this)))},e.prototype.isStarted=function(){return this._status!==_.Idle},e.prototype.start=function(){this.isStarted()?d.logNormal("start: data source is already started, nothing to do"):(Object(n.assert)(null!==this._inputs,"Inputs should be defined when starting a study data source"),this._gateway.isConnected().value()?this._createStudy():this._changeStatusTo(_.AwaitingConnection))},e.prototype.stop=function(){this.isStarted()?(null!==this._studyId&&(this._gateway.removeStudy(this._studyId),this._studyId=null,this._onStudyStatusChangedTo({type:p.Undefined})),this._changeStatusTo(_.Idle)):d.logNormal("stop: data source is already stopped, nothing to do")},e.prototype.studyId=function(){return this._studyId},e.prototype.studyStatus=function(){return this._studyStatus},e.prototype.studyStatusChanged=function(){return this._studyStatusChanged},e.prototype.plots=function(){return this._plots},e.prototype.graphics=function(){return this._graphics},e.prototype.clearData=function(){this._plots.clear(),this._graphics.clear(),this._dataCleared.fire()},e.prototype.stealData=function(){var e,t;return Object(n.assert)(this._status===_.Idle,"Data source should be stopped when stealing data from it"),e=this._plots,t=this._graphics.extract(),
+this._plots=new s.PlotList(Object(c.studyPlotFunctionMap)(this._metaInfo)),{plots:e,graphics:t}},e.prototype.dataCleared=function(){return this._dataCleared},e.prototype.dataUpdated=function(){return this._dataUpdated},e.prototype._changeStatusTo=function(e){Object(n.assert)(this._status!==e,"Source and destination status should be distinct"),d.logNormal("Status changed from "+_[this._status]+" to "+_[e]),this._status=e},e.prototype._createStudy=function(){var e=this._series.seriesId();null!=e?this._createStudyUsingParentId(e):(this._changeStatusTo(_.AwaitingParent),this._series.dataEvents().completed().subscribe(this,this._onSeriesCompleted,!0))},e.prototype._createStudyUsingParentId=function(e){Object(n.assert)(this._status!==_.Active,'Status should not be "Active" when creating a study'),Object(n.assert)(this._studyStatus.type===p.Undefined,'Study status should be "Undefined" when creating a study'),Object(n.assert)(null===this._studyId,"Study id should be empty when creating a study"),this._studyId=Object(l.makeNextStudyId)(),this._gateway.createStudy(this._studyId,this._turnaround(),e,this._metaInfo.fullId+"!",Object(n.ensureNotNull)(this._inputs),this._onMessage.bind(this)),this._changeStatusTo(_.AwaitingFirstDataUpdate)},e.prototype._onGatewayIsConnectedChanged=function(e){e?this._onGatewayConnected():this._onGatewayDisconnected()},e.prototype._onGatewayConnected=function(){this._status===_.AwaitingConnection&&this._createStudy()},e.prototype._onGatewayDisconnected=function(){this._status!==_.Idle&&this._status!==_.AwaitingConnection&&(this._studyId=null,this._changeStatusTo(_.AwaitingConnection),this._studyStatus.type!==p.Undefined&&this._onStudyStatusChangedTo({type:p.Undefined})),this._turnaroundCounter=1},e.prototype._onSeriesCompleted=function(){this._status===_.AwaitingParent&&this._createStudyUsingParentId(Object(n.ensure)(this._series.seriesId()))},e.prototype._onStudyStatusChangedTo=function(e){var t=this._studyStatus;this._studyStatus=e,d.logNormal("Study status type changed from "+p[t.type]+" to "+p[e.type]),this._studyStatusChanged.fire(t,e)},e.prototype._onMessage=function(e){var t,i,n,o,r,s,a,l,c,u,h;"data_update"===e.method?(i=(t=e.params).customId,n=t.turnaround,o=t.plots,r=t.nonseries,i===this._studyId&&this._checkTurnaround(n)&&this._onDataUpdate(o,r)):"study_loading"===e.method?(i=(s=e.params)[0],n=s[1],a=s[2],i===this._studyId&&this._checkTurnaround(n)&&this._onStudyLoading(a)):"study_completed"===e.method?(i=(l=e.params)[0],n=l[1],a=l[2],i===this._studyId&&this._checkTurnaround(n)&&this._onStudyCompleted(a)):"study_error"===e.method&&(i=(c=e.params)[0],n=c[1],u=c[2],h=c[3],a=c[4],i===this._studyId&&this._checkTurnaround(n)&&this._onStudyError(u,h,a))},e.prototype._onDataUpdate=function(e,t){var i=Object(a.unpackNonSeriesData)(t.d);return this._ongoingDataUpdate=this._ongoingDataUpdate.then(function(){return i},function(){return i}).then(this._onDataUnpacked.bind(this,e,t.indexes)),this._ongoingDataUpdate},e.prototype._onDataUnpacked=function(e,t,i){
+this._status!==_.Idle&&(this._status===_.AwaitingFirstDataUpdate&&(this._changeStatusTo(_.Active),this.clearData()),this._mergePlots(e),null!==i&&(i.indexes_replace?(Object(n.assert)("nochange"!==t),this._graphics.replaceIndexesTo(t)):("nochange"!==t&&this._graphics.replaceIndexesTo(t),void 0!==i.graphicsCmds&&this._graphics.processCommands(i.graphicsCmds,this._metaInfo.graphics))),this._dataUpdated.fire(e,i,t))},e.prototype._onStudyLoading=function(e){this._onStudyStatusChangedTo({type:p.Loading,startTime:Date.now()})},e.prototype._onStudyError=function(e,t,i){this.clearData(),this._onStudyStatusChangedTo({type:p.Error,reason:e})},e.prototype._onStudyCompleted=function(e){this._onStudyStatusChangedTo({type:p.Completed})},e.prototype._mergePlots=function(e){this._plots.merge(e)},e.prototype._turnaround=function(){return""+this._turnaroundPrefix+this._turnaroundCounter},e.prototype._checkTurnaround=function(e){var t=this._turnaround();return e===t||e===this._series.turnaround()||e===this._series.turnaround()+"_"+t},e}(),m=i("kcTO"),y=i("Ocx9"),g=i("Kxc7"),i.d(t,"sessionsPreferencesDefault",function(){return w}),i.d(t,"Sessions",function(){return P}),v="Sessions@tv-basicstudies",S="sessions_",b=new m.PriceFormatter,w={graphics:{backgrounds:{outOfSession:{color:"#2196F3",transparency:80,visible:!1}},vertlines:{sessBreaks:{color:"#4985e7",style:2,visible:!1,width:1}}}},P=function(){function e(e,t){var i,n=this;this._studySource=null,this._paneViews=[],this._metaInfo=null,this._destroyed=!1,this._isStarted=!1,this._loadedGraphics=null,this._model=e,this._doubleClickHandler=t,i=e.mainSeries(),this._properties=new y.DefaultProperty("sessions"),this._properties.subscribe(this,this._onPropertiesChanged),e.studyMetaInfoRepository().findById({type:"java",studyId:v}).then(function(t){n._destroyed||null===n._loadedGraphics&&(n._setMetaInfo(t),null!==n._metaInfo&&(n._studySource=new f(e.chartApi(),i,S,n._metaInfo),n._createPaneViews(),n._studySource.dataCleared().subscribe(n,n.updateAllViews),n._studySource.dataUpdated().subscribe(n,n.updateAllViews),n._studySource.setInputs({}),n._processHibernate()))}),e.timeScale().onReset().subscribe(this,this._clearData),e.timeScale().logicalRangeChanged().subscribe(this,this.updateAllViews),e.mainSeries().properties().extendedHours.subscribe(this,this._updateVisibleOutOfSessionBackground),e.mainSeries().properties().interval.subscribe(this,this._processHibernate),this._updateVisibleOutOfSessionBackground(e.mainSeries().properties().extendedHours)}return e.prototype.start=function(){this._isStarted=!0,this._processHibernate()},e.prototype.restart=function(){this._clearData(),g.enabled("stop_study_on_restart")&&this.stop(),this.start()},e.prototype.isStarted=function(){return this._isStarted},e.prototype.stop=function(){this._isStarted=!1,null!==this._studySource&&this._studySource.stop()},e.prototype.paneViews=function(e){return e.containsMainSeries()?this._paneViews:[]},e.prototype.priceAxisViews=function(e,t){return[]},e.prototype.updateAllViews=function(){
+this._paneViews.forEach(function(e){return e.update()})},e.prototype.destroy=function(){this._destroyed=!0,null!==this._studySource&&(this._studySource.dataCleared().unsubscribe(this,this.updateAllViews),this._studySource.dataUpdated().unsubscribe(this,this.updateAllViews),this._studySource.destroy(),this._studySource=null),this._model.timeScale().logicalRangeChanged().unsubscribe(this,this.updateAllViews),this._model.timeScale().onReset().unsubscribe(this,this._clearData),this._model.mainSeries().properties().extendedHours.unsubscribe(this,this._updateVisibleOutOfSessionBackground),this._model.mainSeries().properties().interval.unsubscribe(this,this._processHibernate),this._properties.unsubscribe(this,this._onPropertiesChanged)},e.prototype.series=function(){return this._model.mainSeries()},e.prototype.priceScale=function(){return this.series().priceScale()},e.prototype.graphics=function(){return this._loadedGraphics||Object(n.ensureNotNull)(this._studySource).graphics()},e.prototype.properties=function(){return this._properties},e.prototype.graphicsInfo=function(){return Object(n.ensureNotNull)(this._metaInfo).graphics},e.prototype.firstValue=function(e){return this._model.mainSeries().firstValue()},e.prototype.formatter=function(){return b},e.prototype.state=function(e){var t={properties:this._properties.state()};return e&&null!==this._metaInfo&&(t.data={graphics:Object(u.saveStudyGraphics)(this.graphics()),metaInfo:this._metaInfo}),t},e.prototype.restoreState=function(e,t){this._properties.mergeAndFire(e.properties),this._updateVisibleOutOfSessionBackground(this._model.mainSeries().properties().extendedHours),void 0!==e.data&&t&&(this._loadStudyGraphics(e.data.graphics),this._setMetaInfo(e.data.metaInfo),this._createPaneViews())},e.prototype.restoreOldState=function(e,t){var i={graphics:e.state.graphics},n={properties:i};void 0!==e.data&&void 0!==e.metaInfo&&t&&(n.data={metaInfo:e.metaInfo,graphics:e.data.graphics}),this.restoreState(n,t)},e.prototype.applyPreferences=function(e){this._properties.mergePreferences(e)},e.prototype.metaInfo=function(){return Object(n.ensureNotNull)(this._metaInfo)},e.prototype._loadStudyGraphics=function(e){if(void 0!==e.backgrounds){var t=e.backgrounds.findIndex(function(e){return"inSession"===e.styleId});e.backgrounds.splice(t,1)}this._loadedGraphics=Object(u.loadStudyGraphics)(e)},e.prototype._setMetaInfo=function(e){void 0!==e.graphics.backgrounds&&void 0!==e.graphics.backgrounds.inSession&&delete e.graphics.backgrounds.inSession,this._metaInfo=e},e.prototype._updateVisibleOutOfSessionBackground=function(e){this._outOfSessionVisibilityProperty().setValue(e.value())},e.prototype._clearData=function(){null!==this._studySource&&this._studySource.clearData()},e.prototype._createPaneViews=function(){var e=this,t={mouseDoubleClickHandler:this._doubleClickHandler};Object(u.createGraphicsPaneViews)(this,this._model,t).then(function(t){e._paneViews=t,e._model.lightUpdate()})},e.prototype._onPropertiesChanged=function(){this._processHibernate(),this.updateAllViews()},
+e.prototype._processHibernate=function(){var e,t,i;null!==this._studySource&&(e=this._canBeHibernated(),t=this._isHibernated(),i=this._studySource.isStarted(),!t&&e&&i?this._studySource.stop():!t||e||i||this._studySource.start())},e.prototype._canBeHibernated=function(){return this._model.mainSeries().isDWM()||!this._outOfSessionVisibilityProperty().value()&&!this._vertLinesVisibleProperty().value()},e.prototype._isHibernated=function(){return this._isStarted&&(null===this._studySource||!this._studySource.isStarted())},e.prototype._outOfSessionVisibilityProperty=function(){return this._properties.childs().graphics.childs().backgrounds.childs().outOfSession.childs().visible},e.prototype._vertLinesVisibleProperty=function(){return this._properties.childs().graphics.childs().vertlines.childs().sessBreaks.childs().visible},e}()},KcY8:function(e,t,i){"use strict";var n,o=i("eJTA"),r=i("mrSG"),s=i("Tmoa"),a=i("Ialn"),l=i("8Uy/"),c=i("jFln"),u=function(){function e(e,t){this.setData(e,t)}return e.prototype.setData=function(e,t){this._data=Object(r.__assign)({},e),this._commonData=Object(r.__assign)({},t)},e.prototype.draw=function(e,t,i,n,o){var r,u,h,d,p,_,f,m,y,g,v,S,b,w,P,C,T,x,I,L,M;this._data.visible&&(r=t.fontSize,e.font=t.font,u=this._data.tickVisible?t.tickLength:0,h=this._data.borderVisible?t.borderSize:0,d=t.paddingTop,p=t.paddingBottom,_=t.paddingInner,f=t.paddingOuter,m=this._data.text,y=Math.ceil(i.measureText(e,m)),g=t.baselineOffset,v=t.fontSize+d+p,S=h+y+_+f+u,b=this._commonData.coordinate,this._commonData.fixedCoordinate&&(b=this._commonData.fixedCoordinate),P=(w=b-Math.floor(r/2)-d-.5)+v,x=T=(C="right"===o)?n-h-.5:.5,e.fillStyle=Object(s.resetTransparency)(this._commonData.background),e.lineWidth=1,Object(c.setLineStyle)(e,l.LINESTYLE_SOLID),e.lineCap="butt",m&&(C?(I=T-u,L=(x=T-S)+f):(x=T+S,I=T+u,L=T+h+u+_),e.beginPath(),e.moveTo(T,w),e.lineTo(x,w),e.lineTo(x,P),e.lineTo(T,P),e.fill(),this._data.tickVisible&&(e.beginPath(),e.strokeStyle=this._commonData.color,e.moveTo(T,b),e.lineTo(I,b),e.stroke()),e.textAlign="left",e.fillStyle=this._commonData.color,e.fillText(Object(a.startWithLTR)(m),L,P-p-g)),this._data.secondLine&&(M=Math.ceil(i.measureText(e,this._data.secondLine))+_+f,e.fillStyle=Object(s.resetTransparency)(this._commonData.background),this._data.text&&(w+=v+1,P+=v+1),C?(T=(x=Math.min(x,n-u))+M,L=x+f):(x=(T=Math.max(x-M,h))+M,L=T+_),e.beginPath(),e.moveTo(T,w),e.lineTo(x,w),e.lineTo(x,P),e.lineTo(T,P),e.fill(),e.textAlign="left",e.fillStyle=this._commonData.color,e.fillText(Object(a.startWithLTR)(this._data.secondLine),L,P-p-g)))},e.prototype.height=function(e,t){if(!this._data.visible)return 0;var i=e.fontSize+e.paddingTop+e.paddingBottom;return this._data.secondLine&&t?2*i+1:i},e}();i.d(t,"a",function(){return n}),n=function(){function e(e){this._commonRendererData={coordinate:0,color:"#FFF",background:"#000"},this._axisRendererData={text:"",visible:!1,tickVisible:!0,borderVisible:!0},this._paneRendererData={text:"",visible:!1,tickVisible:!1,borderVisible:!1},this._invalidated=!0,
+this._axisRenderer=new(e||u)(this._axisRendererData,this._commonRendererData),this._paneRenderer=new(e||u)(this._paneRendererData,this._commonRendererData)}return e.prototype.text=function(){return this._axisRendererData.text},e.prototype.background=function(){return this._commonRendererData.background},e.prototype.color=function(){return this.generateTextColor(this.background())},e.prototype.generateTextColor=function(e){return"black"===Object(o.rgbToBlackWhiteString)(Object(o.parseRgb)(e),160)?"white":"black"},e.prototype.coordinate=function(){return this._updateRendererDataIfNeeded(),this._commonRendererData.coordinate},e.prototype.floatCoordinate=function(){return this._updateRendererDataIfNeeded(),this._commonRendererData.floatCoordinate||this._commonRendererData.coordinate},e.prototype.update=function(){this._invalidated=!0},e.prototype.height=function(e,t){return void 0===t&&(t=!1),Math.max(this._axisRenderer.height(e,t),this._paneRenderer.height(e,t))},e.prototype.getFixedCoordinate=function(){return this._commonRendererData.fixedCoordinate||0},e.prototype.setFixedCoordinate=function(e){this._commonRendererData.fixedCoordinate=e},e.prototype.isVisible=function(){return this._updateRendererDataIfNeeded(),this._axisRendererData.visible||this._paneRendererData.visible},e.prototype.isAxisLabelVisible=function(){return this._updateRendererDataIfNeeded(),this._axisRendererData.visible},e.prototype.isPaneLabelVisible=function(){return this._updateRendererDataIfNeeded(),this._paneRendererData.visible},e.prototype.renderer=function(){return this._updateRendererDataIfNeeded(),this._axisRenderer.setData(this._axisRendererData,this._commonRendererData),this._paneRenderer.setData(this._paneRendererData,this._commonRendererData),this._axisRenderer},e.prototype.paneRenderer=function(){return this._updateRendererDataIfNeeded(),this._axisRenderer.setData(this._axisRendererData,this._commonRendererData),this._paneRenderer.setData(this._paneRendererData,this._commonRendererData),this._paneRenderer},e.prototype._updateRendererDataIfNeeded=function(){this._invalidated&&(this._updateRendererData(this._axisRendererData,this._paneRendererData,this._commonRendererData),this._invalidated=!1)},e}()},Ke3L:function(e,t,i){"use strict";var n,o,r,s,a,l;i.r(t),i.d(t,"ProjectionSeriesPriceAxisView",function(){return l}),n=i("mrSG"),o=i("Eyy1"),r=i("k9/m"),s=i("TQMj"),a=i("oXaB"),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.lastPrice=function(){return this._getSource().data().lastProjectionPrice},t.prototype._updateRendererData=function(e,t,i){var n,s,l,c,u,h,d,p,_,f,m,y,g,v,S,b,w,P,C,T,x,I;e.visible=!1,t.visible=!1,n=this._getData().model,l=(s=this._getSource()).priceScale(),c=n.timeScale(),u=this.lastPrice(),c.isEmpty()||l.isEmpty()||void 0===u||null!==(h=c.visibleBarsStrictRange())&&(d=h.firstBar(),p=h.lastBar(),
+null!==(f=(_=s.data()).search(p,r.PlotRowSearchMode.NearestLeft))&&void 0!==(m=s.nearestIndex(d,r.PlotRowSearchMode.NearestRight))&&(y=s.model().properties().scalesProperties,g=Object(o.ensureNotNull)(_.valueAt(m))[TradingView.CLOSE_PLOT],v=i.background,S=y.showSeriesLastValue.value(),b=!1,w=!1,P=!1,C=s.lastValueData(TradingView.CLOSE_PLOT,!1),8===(T=s.properties()).style.value()&&T.haStyle.showRealLastPrice.value()?((x=s.lastValueData(TradingView.CLOSE_PLOT,!0)).noData||x.color===i.background||(v=x.color),x.noData||C.noData||(b=(I=x.index===C.index)&&y.showSymbolLabels.value(),w=y.seriesLastValueMode.value()===a.PriceAxisLastValueMode.LastPriceAndPercentageValue,S=S&&I,P=I&&this._isCountdownEnabled()&&T.showCountdown.value())):v=s.barColorer().barStyle(f.index,!0).barColor,i.background=v,i.color=this.generateTextColor(v),i.coordinate=l.priceToCoordinate(u,g),e.visible=S||P,C.noData||(C.text=l.formatPrice(u,g),C.formattedPriceAbsolute=l.formatPriceAbsolute(u),C.formattedPricePercentage=l.formatPricePercentage(u,g),e.text=this._axisFirstLineText(C,S,w),e.secondLine=P?this._countdownText():"",t.text=this._paneText(C,S,b,w)),t.visible=b||S&&w))},t}(s.SeriesPriceAxisView)},Kmdw:function(e,t,i){"use strict";var n,o,r,s;i.r(t),i.d(t,"PaneRendererArrowUp",function(){return r}),i.d(t,"PaneRendererArrowDown",function(){return s}),n=i("mrSG"),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._sign=0,t._thinArrow=!1,t._thinArrowLineWidth=0,t._widthHalf=0,t._headHeight=0,t._arrowWidth=0,t}return Object(n.__extends)(t,e),t.prototype.setData=function(e,t){this._setBaseData(e,t)},t.prototype._drawItemShape=function(e,t){var i=this._sign,n=this._arrowWidth,o=this._widthHalf,r=this._headHeight,s=Math.abs(t.height),a=t.x,l=t.vertOffset,c=t.y+l+i*Math.round(s/2);e.translate(a,c),this._thinArrow?(e.moveTo(0,0),e.lineTo(-o,-o*i),e.moveTo(0,0),e.lineTo(o,-o*i),e.moveTo(0,0),e.lineTo(0,-s*i),e.moveTo(-o,-s*i),e.lineTo(o,-s*i)):(e.moveTo(0,0),s'},Ltzl:function(e,t,i){"use strict";var n,o,r,s
+;i.r(t),i.d(t,"SaveLineToolStateUndoCommand",function(){return s}),n=i("mrSG"),o=i("Eyy1"),r=i("RDU5"),s=function(e){function t(t,i,n,o){void 0===o&&(o=!0);var r=e.call(this,n,o)||this;return r._model=t,r._savedState=i.state(!0),r}return Object(n.__extends)(t,e),t.prototype.redo=function(){this._toggleState()},t.prototype.undo=function(){this._toggleState()},t.prototype._getSource=function(){return Object(o.ensureNotNull)(this._model.dataSourceForId(this._savedState.id))},t.prototype._toggleState=function(){var e=this._getSource(),t=this._savedState;this._savedState=e.state(!0),this._model.restoreLineToolState(e,t)},t}(r.UndoCommand)},LxhU:function(e,t,i){"use strict";function n(e){return 0===e.length?1:parseInt(e,10)}function o(e){return e>=60&&!(e%60)}var r,s,a,l,c,u;i.r(t),i.d(t,"ResolutionKind",function(){return a}),i.d(t,"Interval",function(){return u}),i.d(t,"isHour",function(){return o}),r=/^(\d*)([SHDWMR])$/,s=/^(\d+)$/,function(e){e.Seconds="seconds",e.Minutes="minutes",e.Hours="hours",e.Days="days",e.Weeks="weeks",e.Months="months",e.Range="range",e.Invalid="invalid"}(a||(a={})),(l={})[a.Seconds]=1e3,l[a.Minutes]=60*l[a.Seconds],l[a.Hours]=60*l[a.Minutes],l[a.Days]=24*l[a.Hours],l[a.Weeks]=7*l[a.Days],c={S:a.Seconds,H:a.Hours,D:a.Days,W:a.Weeks,M:a.Months,R:a.Range},u=function(){function e(e,t){this._kind=a.Invalid,this._multiplier=0,e!==a.Invalid&&t>0&&(this._kind=e,this._multiplier=t)}return e.prototype.kind=function(){return this._kind},e.prototype.multiplier=function(){return this._multiplier},e.prototype.isValid=function(){return this.kind()!==a.Invalid&&this.multiplier()>0},e.prototype.isDWM=function(){return this.isValid()&&!this.isRange()&&!this.isIntraday()},e.prototype.isIntraday=function(){var e=-1!==[a.Seconds,a.Minutes,a.Hours].indexOf(this.kind());return this.isValid()&&!this.isRange()&&e},e.prototype.isSeconds=function(){return this.kind()===a.Seconds},e.prototype.isMinutes=function(){return this.kind()===a.Minutes},e.prototype.isHours=function(){return this.kind()===a.Hours},e.prototype.isDays=function(){return this.kind()===a.Days},e.prototype.isWeeks=function(){return this.kind()===a.Weeks},e.prototype.isMonths=function(){return this.kind()===a.Months},e.prototype.isRange=function(){return this.kind()===a.Range},e.prototype.isTimeBased=function(){return!this.isRange()},e.prototype.letter=function(){return this.isValid()&&this.kind()!==a.Minutes?this.kind()[0].toUpperCase():""},e.prototype.value=function(){return this.isValid()?this.kind()===a.Minutes?this.multiplier()+"":this.multiplier()+this.letter():""},e.prototype.isEqualTo=function(t){if(!(t instanceof e))throw new Error("Argument is not an Interval");return!(!this.isValid()||!t.isValid())&&(this.kind()===t.kind()&&this.multiplier()===t.multiplier())},e.prototype.inMilliseconds=function(e){var t,i;return void 0===e&&(e=Date.now()),!this.isValid()||this.isRange()?NaN:this.isMonths()?((t=new Date(e)).setUTCMonth(t.getUTCMonth()+(this.multiplier()||1)),+t-e):(i=this.multiplier(),l[this.kind()]*i)},
+e.prototype.tryConvertToHighestKind=function(){var t=this.kind(),i=this.multiplier();return t===a.Minutes&&i&&o(i)?new e(a.Hours,i/60):new e(this.kind(),this.multiplier())},e.isEqual=function(t,i){return e.parse(t).isEqualTo(e.parse(i))},e.parse=function(t){t=(t+"").toUpperCase().split(",")[0];var i=r.exec(t);return null!==i?new e(c[i[2]],n(i[1])):null!==(i=s.exec(t))?new e(a.Minutes,n(i[1])):new e(a.Invalid,0)},e.kind=function(t){return e.parse(t).kind()},e.isValid=function(t){return e.parse(t).isValid()},e.isDWM=function(t){return e.parse(t).isDWM()},e.isIntraday=function(t){return e.parse(t).isIntraday()},e.isSeconds=function(t){return e.parse(t).isSeconds()},e.isMinutes=function(t){return e.parse(t).isMinutes()},e.isHours=function(t){return e.parse(t).isHours()},e.isDays=function(t){return e.parse(t).isDays()},e.isWeeks=function(t){return e.parse(t).isWeeks()},e.isMonths=function(t){return e.parse(t).isMonths()},e.isRange=function(t){return e.parse(t).isRange()},e.isTimeBased=function(t){return e.parse(t).isTimeBased()},e.normalize=function(t){var i=e.parse(t);return i.isValid()?i.value():null},e}()},"M7/j":function(e,t,i){"use strict";function n(e){var t,i;if(0===e.length)return!1;if(-1===(t=e.findIndex(function(e){return Object(l.coordinateIsValid)(e.y)})))return!1;for(i=e.length-1;i>t&&!Object(l.coordinateIsValid)(e[i].y);)i--;return!(t>=i)}function o(e,t){var i,n,o,a,c,u=[],h=[],d=null;for(i=0;i=t&&h.push(n),d=n;else{if(null===d)continue;n=d}Object(l.coordinateIsValid)(o.y)&&((n.y>t&&o.yt)&&(Math.abs(n.x-o.x)<1?(a=new r.Point(n.x,t),u.push(a),h.push(a)):null!==(c=Object(s.intersectLineSegments)(n,o,new r.Point(n.x,t),new r.Point(o.x,t)))&&(a=n.add(o.subtract(n).scaled(c)),u.push(a),h.push(a))))}return{topItems:u,bottomItems:h}}var r,s,a,l,c,u,h;i.r(t),i.d(t,"itemsRangeIsValid",function(){return n}),i.d(t,"splitItems",function(){return o}),i.d(t,"PaneRendererBaseline",function(){return h}),r=i("aO4+"),s=i("hBTJ"),a=i("GEp6"),l=i("Zp/P"),c=i("Y7w9"),u=i("VdBB"),h=function(){function e(){this._data=null}return e.prototype.setData=function(e){this._data=e},e.prototype.draw=function(e){var t,i,r,s,a,l,c,u,h,d,p,_,f,m,y;null!==this._data&&(i=(t=this._data).items,r=t.baseLevelCoordinate,s=t.bottom,a=t.bottomFillColor1,l=t.bottomFillColor2,c=t.topFillColor1,u=t.topFillColor2,h=t.topLineColor,d=t.bottomLineColor,p=t.topLineWidth,_=t.bottomLineWidth,n(i)&&(m=(f=o(i,r)).topItems,y=f.bottomItems,e.lineCap="round",e.lineJoin="round",e.translate(.5,.5),0!==m.length&&(e.beginPath(),e.moveTo(m[0].x,r),this._makeLine(e,m,!0,0),e.closePath(),e.fillStyle=this._makeLinearGradient(e,c,u,r-s,r),e.fill(),e.beginPath(),this._makeLine(e,m,!1,0),e.lineWidth=p,e.strokeStyle=h,e.stroke()),0!==y.length&&(e.beginPath(),e.moveTo(y[0].x,r),this._makeLine(e,y,!0,1),e.closePath(),e.fillStyle=this._makeLinearGradient(e,a,l,r,r+s),e.fill(),e.beginPath(),this._makeLine(e,y,!1,1),e.lineWidth=_,e.strokeStyle=d,e.stroke())))},
+e.prototype.hitTest=function(e){var t,i,n,o,s,h,d,p,_,f,m;if(null===this._data)return null;for(i=(t=this._data).items,n=t.topLineWidth,o=t.bottomLineWidth,s=Object(l.selectionTolerance)((n+o)/2),h=Object(c.lowerbound)(i,e,function(e,t){return e.x<=t.x}),d=Math.max(1,h-1),p=Math.min(i.length-1,h+1),_=d;_<=p;++_)if(f=i[_-1],m=i[_],Object(a.distanceToSegment)(new r.Point(f.x,f.y),new r.Point(m.x,m.y),new r.Point(e.x,e.y)).distance<=s)return new u.HitTestResult(u.HitTestResult.REGULAR);return null},e.prototype._makeLine=function(e,t,i,n){var o,r,s,a,c,u,h,d,p,_;if(null!==this._data&&-1!==(o=t.findIndex(function(e){return Object(l.coordinateIsValid)(e.y)})))for(s=(r=this._data).barSpacing,a=r.baseLevelCoordinate,c=.25*s,h=t.length,d=o;d=a&&p.y>=a){e.moveTo(p.x,p.y);continue}}else if(u&&u.y<=a&&p.y<=a){e.moveTo(p.x,p.y);continue}if(u&&Object(l.coordinateIsValid)(u.y))e.lineTo(p.x,p.y),i&&!Object(l.coordinateIsValid)(_.y)&&e.lineTo(p.x,a);else if(_&&Object(l.coordinateIsValid)(_.y))i?(d!==o&&e.lineTo(p.x,a),e.lineTo(p.x,p.y)):e.moveTo(p.x,p.y);else if(i){if(0===d)continue;d!==o&&e.lineTo(p.x-c,a),e.lineTo(p.x-c,p.y),e.lineTo(p.x+c,p.y),e.lineTo(p.x+c,a)}else e.moveTo(p.x-c,p.y),e.lineTo(p.x+c,p.y);u=p}},e.prototype._makeLinearGradient=function(e,t,i,n,o){var r=e.createLinearGradient(0,n,0,o);return r.addColorStop(0,t),r.addColorStop(1,i),r},e}()},MA5A:function(e,t,i){"use strict";var n,o,r,s,a,l,c,u;i.r(t),i.d(t,"LineToolCrossLine",function(){return u}),n=i("mrSG"),o=i("Ocx9"),r=i("p1SQ"),s=i("GmZZ"),a=i("Ss5c"),l=i("hayr"),c=window.t("Cross Line"),(u=function(e){function t(n,o){var a=e.call(this,n,o||t.createProperties())||this;return a._constructor="LineToolCrossLine",a._priceAxisView=new r.LineToolHorzLinePriceAxisView(a),a._timeAxisView=new s.LineToolVertLineTimeAxisView(a,n),i.e("lt-pane-views").then(function(e){var t=i("amUF").CrossLinePaneView;a._setPaneViews([new t(a,a._model)])}.bind(null,i)).catch(void 0),a}return Object(n.__extends)(t,e),t.prototype.pointsCount=function(){return 1},t.prototype.title=function(){return c},t.prototype.name=function(){return"Cross Line"},t.prototype.priceAxisViews=function(e,t){return this.isSourceHidden()?null:t===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===e?[this._priceAxisView]:null},t.prototype.timeAxisViews=function(){return this.isSourceHidden()?null:this.properties().showTime.value()?[this._timeAxisView]:null},t.prototype.updateAllViews=function(){e.prototype.updateAllViews.call(this),this._priceAxisView.update(),this._timeAxisView.update()},t.prototype.canHasAlert=function(){return!1},t.prototype.getInputsPropertyPage=function(){return l.propertyPages.LineToolCrossLineInputsPropertyPage},t.prototype.getStylesPropertyPage=function(){return l.propertyPages.LineToolCrossLineStylesPropertyPage},t.prototype.lineColor=function(){return this.properties().linecolor.value()},t.prototype.lineWidth=function(){return this.properties().linewidth.value()},
+t.prototype.lineStyle=function(){return this.properties().linestyle.value()},t.createProperties=function(e){var i=new o.DefaultProperty("linetoolcrossline",e);return t._configureProperties(i),i},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(13),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"xrdl")).then(function(e){return e.CrossLineDefinitionsViewModel})},t._configureProperties=function(e){a.LineDataSource._configureProperties(e)},t}(a.LineDataSource)).prototype.superclass=a.LineDataSource},MROS:function(e,t,i){"use strict";var n,o,r;i.r(t),i.d(t,"ModelSelection",function(){return r}),n=i("Y7w9"),o=i("CW80"),r=function(){function e(){this._items=[],this._set=new Set}return e.prototype.isEmpty=function(){return 0===this._items.length},e.prototype.add=function(e){this._items.length>0&&!Object(o.isLineTool)(this._items[0])&&this.clear(),Object(o.isLineTool)(e)||this.clear();var t=Object(n.lowerbound)(this._items,e,function(e,t){return e.zorder()e.rightPriceScales().length;)t=e.leftPriceScales()[e.leftPriceScales().length-1],e.movePriceScale(t,"right",this._targetPriceScaleIndex(t,i));for(;e.rightPriceScales().length-e.leftPriceScales().length>1;)t=e.rightPriceScales()[e.rightPriceScales().length-1],e.movePriceScale(t,"left",this._targetPriceScaleIndex(t,i))},
+t.prototype.createNewPriceScaleIfPossible=function(e){if(!this.canCreateNewPriceScale(e))return e.createPriceScaleAtPosition("overlay");var t=e.leftPriceScales().lengtht&&this._priceScaleIsPrice(e.rightPriceScales()[t],i))return e.rightPriceScales()[t];if(e.leftPriceScales().length>t&&this._priceScaleIsPrice(e.leftPriceScales()[t],i))return e.leftPriceScales()[t]}return null},e.prototype._targetPriceScaleIndex=function(e,t){if(e.mainSource()===t.mainSeries())return 0},e.prototype._tryToGetDesiredPriceScale=function(e,t,i,n){switch(i){case"left":return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("left"):e.createPriceScaleAtPosition("overlay");case"right":return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("right"):e.createPriceScaleAtPosition("overlay");case"as-series":return void 0!==n?Object(s.ensureNotNull)(n.priceScale()):e.isMainPane()?Object(s.ensureNotNull)(Object(s.ensureNotNull)(e.mainDataSource()).priceScale()):this.createNewPriceScaleIfPossible(e);case"overlay":return e.createPriceScaleAtPosition("overlay")}},e}()),u=function(e){function t(t){return e.call(this,t)||this}return Object(r.__extends)(t,e),t.prototype.apply=function(e){var t=this,i=e.model();e.leftPriceScales().slice(0).forEach(function(n){return e.movePriceScale(n,"right",t._targetPriceScaleIndex(n,i))})},
+t.prototype.createNewPriceScaleIfPossible=function(e){return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("right"):e.createPriceScaleAtPosition("overlay")},t}(l),h=function(e){function t(t){return e.call(this,t)||this}return Object(r.__extends)(t,e),t.prototype.apply=function(e){var t=this,i=e.model();e.rightPriceScales().slice(0).forEach(function(n){return e.movePriceScale(n,"left",t._targetPriceScaleIndex(n,i))})},t.prototype.createNewPriceScaleIfPossible=function(e){return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("left"):e.createPriceScaleAtPosition("overlay")},t}(l),d=[{name:"left",title:window.t("Stack On The Left"),ctor:h},{name:"right",title:window.t("Stack On The Right"),ctor:u},{name:"auto",title:window.t("Auto"),ctor:c}]},MXV9:function(e,t){e.exports=''},MY2c:function(e,t,i){"use strict";var n,o,r,s,a,l;i.r(t),i.d(t,"UndoStack",function(){return l}),n=i("RDU5"),o=i("aIyQ"),r=i.n(o),s=i("uOxu"),a=Object(s.getLogger)("Common.UndoStack"),l=function(){function e(){this._commands=[],this._onChange=new r.a}return e.prototype.onChange=function(){return this._onChange},e.prototype.isEmpty=function(){return 0===this._commands.length},e.prototype.clear=function(){this.isEmpty()||(this._commands.length=0,this._onChange.fire())},e.prototype.push=function(e){if(!(e instanceof n.UndoCommand))throw new TypeError("argument must be an instance of UndoCommand");this._commands.push(e),this._onChange.fire()},e.prototype.pop=function(){if(!this.isEmpty()){var e=this._commands.pop();return this._onChange.fire(),e}a.logDebug("pop: undo stack is empty")},e.prototype.head=function(){if(!this.isEmpty())return this._commands[this._commands.length-1]},e}()},MrEN:function(e,t,i){"use strict";(function(t){var n=i("IiTo"),o=i("LxhU").Interval,r=i("aIyQ"),s=i("Kxc7"),a=i("/bs+").barTimeToEndOfPeriod,l=function(e,t){this._server=e,this._session=t,this._timezone=null,this._timezoneId="",this._isDWM=!1,this._resolution=null,this.seriesCompleted=new r,this.seriesError=new r,this._lastBarTimes={}};l.prototype.lastBarTime=function(e){return this._lastBarTimes[e]},
+l.prototype._userTimezone=function(){return this._timezone},l.prototype.setTimezone=function(e){this._timezone="exchange"===e?"exchange":t.get_timezone(e),this._timezoneId=e},l.prototype.timezone=function(){return this._timezoneId},l.prototype.setResolution=function(e){this._isDWM=o.isDWM(e),this._resolution=e},l.prototype.onRequestMetadata=function(e,t){this._server.receiveLocalResponse({method:"studies_metadata",params:[this._session,e,{errors:[],hash:"",metainfo:t,migrations:[]}]})},l.prototype.onSymbolResolved=function(e,t){this._server.receiveLocalResponse({method:"symbol_resolved",params:[this._session,e,t]})},l.prototype.onSymbolError=function(e,t){this._server.receiveLocalResponse({method:"symbol_error",params:[this._session,e,t]})},l.prototype.onStudyError=function(e,t,i){this._server.receiveLocalResponse({method:"study_error",params:[this._session,e,t,i]})},l.prototype.onSeriesLoading=function(e,t){this._server.receiveLocalResponse({method:"series_loading",params:[this._session,e,t]})},l.prototype.onSeriesCompleted=function(e,t,i){this._server.receiveLocalResponse({method:"series_completed",params:[this._session,e,i,t]}),this.seriesCompleted.fire(e,t)},l.prototype.onSeriesError=function(e,t){this._server.receiveLocalResponse({method:"series_error",params:[this._session,e,t]}),this.seriesError.fire(e,t)},l.prototype.onSeriesClearData=function(e,t){var i={};i[e]={series:[],turnaround:t},this._server.receiveLocalResponse({method:"timescale_update",params:[this._session,i,{index:0,zoffset:0,changes:[],marks:[],index_diff:[]}]})},l.prototype.onStudyCompleted=function(e,t){this._server.receiveLocalResponse({method:"study_completed",params:[this._session,e,t]})},l.prototype.onStudyLoading=function(e,t){this._server.receiveLocalResponse({method:"study_loading",params:[this._session,e,t]})},l.prototype._calcMarksTime=function(e,i,r,l){var c,u,h,d=t.get_timezone(i.timezone),p=new n.SessionInfo(i.timezone,i.session,i.holidays,i.corrections),_=n.newBarBuilder(this._resolution,p,p),f=this._isDWM&&!s.enabled("disable_resolution_rebuild"),m=s.enabled("end_of_period_timescale_marks"),y=!this._isDWM,g=o.parse(this._resolution);for(c=0;c=0;--s)if(Math.floor(o/l[s].divisor)!==Math.floor(r/l[s].divisor))return l[s].span},TradingView.ChartapiMessagerInstances=[],e.exports=l}).call(this,i("jCNj"))},"N+BX":function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolBezierCubic";var r=t||n.createProperties();o.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("a6on").BezierCubicPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}
+var o=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,s=i("hayr").propertyPages,a=window.t("Double Curve");inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return a},n.prototype.name=function(){return"Double Curve"},n.prototype.controlPoints=function(){var e=this.pointToScreenPoint(this.points()[0])[0],t=this.pointToScreenPoint(this.points()[1])[0],i=t.subtract(e).scaled(.5),n=i.transposed().scaled(.3),o=e.add(t).scaled(.33),r=e.add(t).scaled(.67),s=o.add(n),a=r.subtract(n);return[this.screenPointToPoint(s),this.screenPointToPoint(a)]},n.prototype.setLastPoint=function(e,t){o.prototype.setLastPoint.call(this,e,t),this._controlPoints=this.controlPoints()},n.prototype.addPoint=function(e,t,i){var n,r=o.prototype.addPoint.call(this,e,t,!0);return r&&(n=this.controlPoints(),delete this._controlPoints,this._points.push(n[0]),this._points.push(n[1]),i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2),this._createPointProperty(3)),r},n.prototype.restorePoints=function(e,t,i){o.prototype.restorePoints.call(this,e,t,i),this._createPointProperty(2),this._createPointProperty(3)},n.prototype.getStylesPropertyPage=function(){return s.LineToolBezierStylesPropertyPage},n.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(13),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("b4fl").GeneralBezierDefinitionsViewModel}.bind(null,i)).catch(i.oe)},n.createProperties=function(e){var t=new r("linetoolbeziercubic",e);return n._configureProperties(t),t},n._configureProperties=function(e){o._configureProperties(e)},t.LineToolBezierCubic=n},N1UO:function(e,t,i){"use strict";var n,o,r,s,a,l,c;i.r(t),i.d(t,"StudyApi",function(){return c}),n=i("mrSG"),i("YFKU"),o=i("Eyy1"),r=i("9iCb"),s=i("HGup"),a=i("jRfx"),l=i("/ToI"),c=function(){function e(e,t){this._study=e,this._undoModel=t,this._model=t.model()}return e.prototype.isUserEditEnabled=function(){return this._study.userEditEnabled()},e.prototype.setUserEditEnabled=function(e){this._study.setUserEditEnabled(e)},e.prototype.getInputsInfo=function(){return this._study.metaInfo().inputs.map(function(e){return Object(n.__assign)(Object(n.__assign)({},e),{localizedName:void 0!==e.name?window.t(e.name,{context:"input"}):""})})},e.prototype.getInputValues=function(){var e=this._study.inputs();return Object.keys(e).map(function(t){return{id:t,value:e[t]}})},e.prototype.setInputValues=function(e){var t,i,n=this.getInputValues(),o=function(e){void 0!==n.find(function(t){return t.id===e.id})?r._study.properties().inputs[e.id].setValue(e.value):console.warn('There is no such input: "'+e.id+'"')},r=this;for(t=0,i=e;ti&&(e.moveTo(1.5,i),e.lineTo(1.5,n),e.moveTo(this._data.width-1.5,i),e.lineTo(this._data.width-1.5,n))},n.prototype.draw=function(e){var t,i,n,o;e.translate(this._data.x-this._data.width/2,this._data.y-this._data.height/2),t="rgba(153,153,153,.3)",i="rgba(153,153,153,.7)",n="#777",
+o="rgba(255,255,255,.7)",e.strokeStyle=t,e.lineWidth=2,e.beginPath(),this._drawShackle(e),e.stroke(),e.closePath(),e.strokeStyle=i,e.lineWidth=1,e.beginPath(),e.rect(0,this._data.height-this._data.bodyHeight+.5,this._data.width,this._data.bodyHeight),e.closePath(),e.stroke(),e.translate(0,-1),e.strokeStyle=n,e.beginPath(),this._drawShackle(e),e.stroke(),e.closePath(),e.fillStyle=o,e.beginPath(),e.rect(1,this._data.height-this._data.bodyHeight+1.5,this._data.width-2,this._data.bodyHeight-2),e.fill(),e.beginPath(),e.rect(.5,this._data.height-this._data.bodyHeight+1,this._data.width-1,this._data.bodyHeight-1),e.stroke(),e.closePath(),e.fillStyle=n,e.fillRect(this._data.width/2-.5,this._data.height-this._data.bodyHeight/2,1,2)},t.PaneRendererCrossHairLock=TradingView.PaneRendererCrossHairLock=n},NJRZ:function(e,t,i){"use strict";function n(e,t){this._constructor="LineTool5PointsPattern";var r=t||n.createProperties();o.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("6MfG").Pattern5PaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,s=i("hayr").propertyPages,a=window.t("XABCD Pattern");inherit(n,o),n.prototype.pointsCount=function(){return 5},n.prototype.title=function(){return a},n.prototype.name=function(){return"XABCD Pattern"},n.prototype.getStylesPropertyPage=function(){return s.LineToolLineTool5PointsPatternStylesPropertyPage},n.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(13),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("EFc4").Points5PatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},n.createProperties=function(e){var t=new r("linetool5pointspattern",e);return n._configureProperties(t),t},n._configureProperties=function(e){o._configureProperties(e)},t.LineTool5PointsPattern=n},NhkU:function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPitchfan";var r=t||n.createProperties();o.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("l5Au").PitchfanLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i("Ss5c").LineDataSource,r=i("5rJj"),s=i("hayr").propertyPages,a=window.t("Pitchfan");inherit(n,o),n.LevelsCount=8,n.prototype.levelsCount=function(){return n.LevelsCount},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return a},n.prototype.name=function(){return"Pitchfan"},n.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},n.prototype.getStylesPropertyPage=function(){return s.LineToolPitchfanStylesPropertyPage},n.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(13),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("D+Nk").PitchBaseDefinitionsViewModel}.bind(null,i)).catch(i.oe)},n.createProperties=function(e){var t=new r("linetoolpitchfan",e,!1,{range:[0,8]});return n._configureProperties(t),t},
+n._configureProperties=function(e){o._configureProperties(e)},t.LineToolPitchfan=n},NsVT:function(e,t,i){"use strict";function n(e,t){var i,n,o,r,s,a,l=0;for(i=0,n=t;i0&&s.push({min:o,max:r});return s.sort(function(e,t){return e.min-t.min||e.max-t.max}),s}function r(e,t){if(e.length!==t.length)return!1;for(var i=e.length;i--;){if(e[i].min!==t[i].min)return!1;if(e[i].max!==t[i].max)return!1}return!0}function s(e){var t=h.enabled("side_toolbar_in_fullscreen_mode"),i=h.enabled("header_in_fullscreen_mode");return"center"===e||"left"===e&&t||"top"===e&&i}var a,l,c,u,h,d,p;i.r(t),a=i("hY0g"),l=i.n(a),c=i("HySD"),u=i("+GxX"),h=i("Kxc7"),i.d(t,"ChartPage",function(){return p}),d=h.enabled("no_min_chart_width"),p=function(){function e(e){var t,i=this;if(this._processVisibility=function(e){var t=e.container.value();return i._affectsLayout(e.name)?(t&&t.classList.toggle("js-hidden",!1),!0):(t&&t.classList.toggle("js-hidden",!0),!1)},this._setWidth=function(e,t){var o,r=t;return i._fullscreenArea!==e.name&&(e.availWidth.setValue(t),e.canNegotiate.width&&(r=n(t,e.negotiations.width))),(o=e.container.value())&&(o.style.width=r+"px"),e.width.setValue(r),r},this._setHeight=function(e,t){var o,r=t;return i._fullscreenArea!==e.name&&(e.availHeight.setValue(t),e.canNegotiate.height&&(r=n(t,e.negotiations.height))),(o=e.container.value())&&(o.style.height=r+"px"),e.height.setValue(r),r},!(t=e.container.value()))throw new Error("bridge.container.value() must be an element");this._container=t,this._availableAreas=["left","tradingpanel","right","top","bottom","center","topleft"],this._areas={},this._bridge=e,this._width=e.width,this._height=e.height,this._width.subscribe(function(){return i.recalculate()}),this._height.subscribe(function(){return i.recalculate()}),this._bridge.visible.subscribe(function(){return i._updateVisibility()}),this._bridge.fullscreen.subscribe(function(){return i._onParentFullscreenChange()}),this.recalculate()}return e.prototype.allocate=function(e){var t,i,n=this,s=e&&e.areaName;if(-1===this._availableAreas.indexOf(s))throw new Error("unknown options.areaName");return this.free(s),t=this._createDOM(s),(i={name:s,canNegotiate:{width:"left"===s||"right"===s||"tradingpanel"===s||"topleft"===s,height:"top"===s||"bottom"===s||"topleft"===s},negotiations:{width:[],height:[]},remove:function(){for(var e in n._areas)n._areas[e]===i&&n.free(e)},negotiateWidth:function(e){if(i.canNegotiate.width){var t=o(e);r(i.negotiations.width,t)||(i.negotiations.width=t,n.recalculate())}},negotiateHeight:function(e){if(i.canNegotiate.height){var t=o(e);r(i.negotiations.height,t)||(i.negotiations.height=t,n.recalculate())}},requestFullscreen:function(){
+n._fullscreenArea||("right"!==s&&"center"!==s||(n._fullscreenArea=s),"center"===s&&n._bridge.requestFullscreen(),n._updateFullscreen())},exitFullscreen:function(){s===n._fullscreenArea&&(n._fullscreenArea=void 0,"center"===s&&n._bridge.exitFullscreen(),n._updateFullscreen())},width:new l.a,height:new l.a,availWidth:new l.a,availHeight:new l.a,alive:new l.a(!0),container:new l.a(t),visible:new l.a(!0),fullscreen:new l.a(!0),rdState:new c.ResizerDetacherState}).rdState.pushOwner(i),this._areas[s]=i,i.rdState.owner.subscribe(function(e){var t,o,r,a=i.container.value();if(e!==i)a&&(a.innerHTML="",a.parentElement&&a.parentElement.removeChild(a));else{for(t=null,o=n._availableAreas.indexOf(s);o--;)if(r=n._availableAreas[o],n._affectsLayout(r)){t=n._areas[r].container.value();break}a&&(t&&a.parentElement?a.insertAdjacentElement("afterend",t):n._container.appendChild(a))}n.recalculate()},{callWithLast:!0}),i.rdState.bridge()},e.prototype.free=function(e){var t,i=this._areas[e];i&&(this._areas[e]=void 0,(t=i.container.value())&&t.parentElement&&t.parentElement.removeChild(t),i.alive.setValue(!1))},e.prototype.recalculate=function(){var e,t,i,n,o,r,s,a,l,c,u,h,p,_,f,m,y,g,v,S,b,w,P,C,T={};this._recalcSingleRunToken=T,e=this._areas.topleft,t=this._areas.left,i=this._areas.tradingpanel,n=this._areas.right,o=this._areas.top,r=this._areas.bottom,s=this._areas.center,a=this._width.value(),l=this._height.value(),c=0,u=0,h=0,p=0,_=0,f=0,m=0,T===this._recalcSingleRunToken&&e&&this._processVisibility(e)&&(m=this._setHeight(e,l),(f=this._setWidth(e,a))&&(f+=4)),T===this._recalcSingleRunToken&&t&&this._processVisibility(t)&&((y=t.container.value())&&(y.style.top=m+"px"),this._setHeight(t,l-m),(h=this._setWidth(t,a))&&(h+=4)),T===this._recalcSingleRunToken&&i&&this._processVisibility(i)&&(this._setHeight(i,l),g=a-h,d||(g-=300),_=this._setWidth(i,g)),T===this._recalcSingleRunToken&&n&&this._processVisibility(n)&&(this._setHeight(n,l),g=a-h-_,d||(g-=300),p=this._setWidth(n,g)),S=(v=_+p)?4:0,T===this._recalcSingleRunToken&&o&&this._processVisibility(o)&&(b=Math.max(f,h),(y=o.container.value())&&(y.style.left=b+"px"),g=a-b-_-p-S,this._setWidth(o,g),c=this._setHeight(o,l)),w=0,P=a-h-_-p-S,T===this._recalcSingleRunToken&&r&&this._processVisibility(r)&&((y=r.container.value())&&(y.style.left=h+"px",y.classList.toggle("no-border-top-left-radius",!h),y.classList.toggle("no-border-top-right-radius",!v)),this._setWidth(r,P),C=l-c,w=Math.min(300,C-0),u=this._setHeight(r,C)+4),T===this._recalcSingleRunToken&&s&&this._processVisibility(s)&&((y=s.container.value())&&(y.style.left=h+"px",y.style.top=c+"px",y.classList.toggle("no-border-bottom-left-radius",!u||!h),y.classList.toggle("no-border-bottom-right-radius",!v||!u)),this._setWidth(s,P),C=l-c-u,this._setHeight(s,Math.max(C,w))),T===this._recalcSingleRunToken&&i&&this._affectsLayout("tradingpanel")&&(y=i.container.value())&&(y.style.right=p+"px"),T===this._recalcSingleRunToken&&this._updateVisibility()},e.prototype._affectsLayout=function(e){var t,i=this._areas[e]
+;return!!i&&(i.rdState.owner.value()===i&&(this._fullscreenArea&&this._fullscreenArea!==e?s(e):!((this._width.value()<=567||this._height.value()<=445)&&(t=["center","top","left","topleft"],Object(u.isFeatureEnabled)("mobile_show_bottom_panel")&&t.push("bottom"),!t.includes(e)))))},e.prototype._updateVisibility=function(){var e,t,i,n=this._bridge.visible.value();for(e=0;ee.year||this.year===e.year&&this.month>e.month||this.year===e.year&&this.month===e.month&&this.day>e.day?1:this.year===e.year&&this.month===e.month&&this.day===e.day?0:-1},e.prototype.before=function(e){return-1===this.compareTo(e)},e.prototype.toCalendar=function(e){return n.get_cal(n.get_timezone("Etc/UTC"),this.year,this.month-1,this.day)},e.prototype.addDays=function(t){var i=this.toCalendar(n.get_timezone(o));return n.add_date(i,t),e.fromCalendar(i)},e.fromCalendar=function(t){return new e(n.get_year(t),n.get_month(t)+1,n.get_day_of_month(t))},e}()},OH2X:function(e,t,i){"use strict";t.LineToolFibRetracement=i("t2ex").LineToolFibRetracement,t.LineToolFibChannel=i("xnA2").LineToolFibChannel,t.LineToolFibSpeedResistanceArcs=i("Yjuu").LineToolFibSpeedResistanceArcs,t.LineToolProjection=i("68at").LineToolProjection,t.LineToolTrendBasedFibExtension=i("ZtA1").LineToolTrendBasedFibExtension,t.LineToolElliott=i("xz+e").LineToolElliott,t.LineToolFibCircles=i("4bfY").LineToolFibCircles,t.LineToolVertLine=i("n40Z").LineToolVertLine,t.LineToolCrossLine=i("MA5A").LineToolCrossLine,t.LineToolBarsPattern=i("2bPF").LineToolBarsPattern,t.LineToolTrendBasedFibTime=i("yUly").LineToolTrendBasedFibTime,t.LineToolFibTimeZone=i("FsE7").LineToolFibTimeZone,t.LineToolCircleLines=i("tG6Q").LineToolCircleLines,t.LineToolDateRange=i("WkYF").LineToolDateRange,t.LineToolPriceRange=i("RDDl").LineToolPriceRange,t.LineToolDateAndPriceRange=i("UCMi").LineToolDateAndPriceRange,t.LineToolParallelChannel=i("qcGP").LineToolParallelChannel,t.LineToolTrendAngle=i("nW7S").LineToolTrendAngle,t.LineToolTrendLine=i("WPQD").LineToolTrendLine,t.LineToolInfoLine=i("yi8X").LineToolInfoLine,t.LineToolArrowMark=i("TohL").LineToolArrowMark,t.LineToolExecution=i("704P").LineToolExecution,t.LineToolPitchfan=i("NhkU").LineToolPitchfan,t.LineToolGannSquare=i("Z0Sh").LineToolGannSquare,t.LineToolFibSpeedResistanceFan=i("zZ5f").LineToolFibSpeedResistanceFan,t.LineToolGannComplex=i("nd9+").LineToolGannComplex,t.LineToolGannFixed=i("TBaH").LineToolGannFixed,t.LineToolGannFan=i("4u8j").LineToolGannFan,t.LineToolFibWedge=i("9QkW").LineToolFibWedge,t.LineToolPitchfork=i("aDyP").LineToolPitchfork,t.LineToolDisjointAngle=i("0xda").LineToolDisjointAngle,t.LineToolFlatBottom=i("InMJ").LineToolFlatBottom,t.LineToolIcon=i("icPo").LineToolIcon,t.LineToolRotatedRectangle=i("Az04").LineToolRotatedRectangle,t.LineToolFibSpiral=i("i80N").LineToolFibSpiral,t.LineToolHeadAndShoulders=i("aILO").LineToolHeadAndShoulders,t.LineToolTriangle=i("isVH").LineToolTriangle,t.LineToolTrianglePattern=i("lNN+").LineToolTrianglePattern,t.LineTool5PointsPattern=i("NJRZ").LineTool5PointsPattern,
+t.LineToolThreeDrivers=i("PYn8").LineToolThreeDrivers,t.LineToolABCD=i("pKDv").LineToolABCD,t.LineToolPolyline=i("hP9j").LineToolPolyline,t.LineToolPrediction=i("Wh6B").LineToolPrediction,t.LineToolPriceLabel=i("zqZp").LineToolPriceLabel,t.LineToolNote=i("gLxC").LineToolNote,t.LineToolNoteAbsolute=i("gLxC").LineToolNoteAbsolute,t.LineToolBrush=i("+hLl").LineToolBrush,t.LineToolArc=i("0Pxc").LineToolArc,t.LineToolCallout=i("odCa").LineToolCallout,t.LineToolBalloon=i("me8f").LineToolBalloon,t.LineToolText=i("V3Oj").LineToolText,t.LineToolHorzLine=i("/DxK").LineToolHorzLine,t.LineToolHorzRay=i("CJIV").LineToolHorzRay,t.LineToolRectangle=i("7qI1").LineToolRectangle,t.LineToolEllipse=i("V086").LineToolEllipse,t.LineToolTimeCycles=i("kIXa").LineToolTimeCycles,t.LineToolSineLine=i("bv/X").LineToolSineLine,t.LineToolGhostFeed=i("XUCF").LineToolGhostFeed,t.LineToolBezierQuadro=i("Xyly").LineToolBezierQuadro,t.LineToolBezierCubic=i("N+BX").LineToolBezierCubic,t.LineToolArrow=i("QQu0").LineToolArrow,t.LineToolRay=i("5ZUI").LineToolRay,t.LineToolExtended=i("CHw2").LineToolExtended,t.LineToolSchiffPitchfork=i("v5F8").LineToolSchiffPitchfork,t.LineToolSchiffPitchfork2=i("XFad").LineToolSchiffPitchfork2,t.LineToolInsidePitchfork=i("EqoR").LineToolInsidePitchfork,t.LineToolTextAbsolute=i("V3Oj").LineToolTextAbsolute,t.LineToolArrowMarkLeft=i("TohL").LineToolArrowMarkLeft,t.LineToolArrowMarkRight=i("TohL").LineToolArrowMarkRight,t.LineToolArrowMarkUp=i("TohL").LineToolArrowMarkUp,t.LineToolArrowMarkDown=i("TohL").LineToolArrowMarkDown,t.LineToolFlagMark=i("aIha").LineToolFlagMark,t.LineToolCypherPattern=i("bTqm").LineToolCypherPattern,t.LineToolElliottImpulse=i("xz+e").LineToolElliottImpulse,t.LineToolElliottTriangle=i("xz+e").LineToolElliottTriangle,t.LineToolElliottTripleCombo=i("xz+e").LineToolElliottTripleCombo,t.LineToolElliottCorrection=i("xz+e").LineToolElliottCorrection,t.LineToolElliottDoubleCombo=i("xz+e").LineToolElliottDoubleCombo,t.LineToolRiskRewardLong=i("tDUI").LineToolRiskRewardLong,t.LineToolRiskRewardShort=i("tDUI").LineToolRiskRewardShort,t.LineToolPosition=i("ziJ5").LineToolPosition,t.LineToolOrder=i("B4/o").LineToolOrder},"OK+B":function(e,t,i){"use strict";var n,o,r=i("Eyy1").assert,s=i("eJTA"),a=s.rgba,l=s.rgbaToString,c=s.parseRgb,u=i("+GxX").isFeatureEnabled,h=i("cWHH"),d=i("1Wlv").PriceScale,p=i("8sOK").StudyStub,_=i("CW80"),f=_.createLineTool,m=_.createLineToolProperties,y=_.createStudyLineToolProperties,g=_.isLineToolName,v=_.isStudyLineToolName,S=i("Ss5c").LineDataSource,b=i("OH2X").LineToolBarsPattern,w=i("OH2X").LineToolCallout,P=i("HLXm"),C=i("GVHu"),T=C.Study,x=C.prepareStudyPropertiesForLoadChart,I=i("3ClC").createStudy,L=i("qJq3").Series,M=i("dfhE"),A=i("n5al"),k=i("0YCj"),E=i("Kxc7"),O=i("uOxu").getLogger("Chart.Serialization"),D=i("OH2X").LineToolParallelChannel,V=i("OH2X").LineToolTrendAngle,B=i("OH2X").LineToolGhostFeed,R=i("OH2X").LineToolElliott,N=i("7ktv").PriceDataSource,F=i("iDOr").Pane,W=i("Tmoa"),j=i("jofe").createDeferredPromise,U=i("ApcL").preferencesByWhiteList
+;O=i("uOxu").getLogger("Chart.Serialization"),n=i("mPvX").LineToolsGroupModel,h.version=2,h.prototype.state=function(e,t,i){var n,o,r,s={panes:[]};for(n=0;nn&&o.push(l)),s=(s+1)%c.length;return o},h.prototype.restoreState=function(e,t,i){var r,s,a,l,c,u,h,d,p,_,f,m,y,g;if(new o(this).reset(),r={},e.panes)if(Array.isArray(e.panes)){if(!(e.panes.length<1)){if(e.chartProperties&&!e.chartProperties.timezone&&(e.chartProperties.timezone=e.timezone),e.chartProperties&&(s=TradingView.factoryDefaults("chartproperties").scalesProperties,TradingView.merge(s,e.chartProperties.scalesProperties),!("showLastValue"in s)||"showSeriesLastValue"in s||"showStudyLastValue"in s||(s.showSeriesLastValueProperty=s.showLastValue,s.showStudyLastValueProperty=s.showLastValue),"showSeriesLastValue"in s&&(r.showSeriesLastValueProperty=!0),"showStudyLastValue"in s&&(r.showStudyLastValueProperty=!0),e.chartProperties.paneProperties.vertGridProperties=e.chartProperties.paneProperties.vertGridProperties||TradingView.clone(e.chartProperties.paneProperties.gridProperties),e.chartProperties.paneProperties.horzGridProperties=e.chartProperties.paneProperties.horzGridProperties||TradingView.clone(e.chartProperties.paneProperties.gridProperties),this._properties.paneProperties.merge(e.chartProperties.paneProperties),this._properties.scalesProperties.merge(s),e.chartProperties.timezone&&this._properties.timezone.setValue(e.chartProperties.timezone),
+e.chartProperties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties.merge(e.chartProperties.chartEventsSourceProperties),this._timeScale.restoreState(e.timeScale,t),this._updateDateTimeFormatter()),e.timeScale&&this._timeScale.restoreState(e.timeScale,t),!this.readOnly()&&(a=this._getExceedingChildStudies(e.panes)).length)for(l=e.panes.length-1;l>=0;--l){for(u=(c=e.panes[l]).sources.length-1;u>=0;--u)h=c.sources[u],~a.indexOf(h)&&c.sources.splice(u,1);c.sources.length||e.panes.splice(l,1)}for(d=e.panes,this.panes()[0].restoreState(d[0],t,e.version,r,i),p=1,l=1;lg&&m%100==0?{lines_limit_exceeded:!0,line_tools_count:m}:(e.sessions&&this.sessions().restoreState(e.sessions,t),e.lineToolsGroups&&(this._lineToolsGroupModel=n.fromState(this,e.lineToolsGroups)),{})}O.logDebug("ChartModel.restoreState: invalid state")}else O.logDebug("ChartModel.restoreState: invalid state");else O.logDebug("ChartModel.restoreState: invalid state")},F.prototype.state=function(e,t,i,n,o){function r(e){var r,s;return h.has(e)?h.get(e):(r=null,s=i&&!e.isSavedInStudyTemplates()||!e.state||!(r=e.state(t,o))||!e.isSavedInChart(t)||n&&e.isActualSymbol&&!e.isActualSymbol()?null:r,h.set(e,s),s)}function s(e){return null!==h.get(e)}var a,l,c,u={},h=new Map;if(e)for(u.sources=[],a=0;a1e200?(m=u-1,O.logWarn("Datasource zorder has bad value: "+_.zorder+" Resetting it to "+m),_.zorder=m):this.isZOrderAvailable(_.zorder)||l&&"MainSeries"===f&&this._model.mainSeries().zorder()===_.zorder||(_.zorder=h+1),s[y=_.id]=_.ownerSource,f&&("MainSeries"===f?this._restoreMainSeries(_,t,l,n,o):f.toLowerCase().startsWith("study")?this._restoreStudy(_,t,n):TradingView.isInherited(TradingView[f],S)?this._restoreLineTool(_,t):TradingView[f]&&TradingView[f].createFromState&&this._restoreSpecialSource(_,t)),u=Math.min(u,_.zorder),h=Math.max(h,_.zorder))}for(g=new Set,v=this,
+b=e.leftAxisesState?e.leftAxisesState.map(r).filter(function(e){return null!==e}):null!==(w=r({state:e.leftAxisState,sources:e.leftAxisSources}))?[w]:[],this._leftPriceScales.slice().forEach(function(e){this.removePriceScale(e)}.bind(this)),this._leftPriceScales=[],b.forEach(function(e){v._placePriceScale(e,"left")}),P=e.rightAxisesState?e.rightAxisesState.map(r).filter(function(e){return null!==e}):null!==(C=r({state:e.rightAxisState,sources:e.rightAxisSources}))?[C]:[],this._rightPriceScales.forEach(function(e){this.removePriceScale(e)}.bind(this)),this._rightPriceScales=[],P.forEach(function(e){v._placePriceScale(e,"right")}),this._currentPriceScaleRatio=e.priceScaleRatio||e.leftPriceScaleRatio||e.rightPriceScaleRatio||null,p=0;p=t||!i._shouldExtrapolateMore()?null:o(i.newBarBuilder(e),n,t,!0).times})},a.prototype._ensureExtrapolatedToTime=function(e,t){var i=this;return this._extrapolateData(e,function(n){var o,s
+;return n>=t||!i._shouldExtrapolateMore()?null:(o=2e3,(s=r(i.newBarBuilder(e),n,t,o,!0)).times[s.length-1]e?this._extrapolatedBarsCache=[]:this._lastRealBarTime!==t&&this._extrapolatedBarsCache.shift(e-this._lastRealBarIndex)),this._lastRealBarIndex=e,this._lastRealBarTime=t;for(var i=0;i'},Owlf:function(e,t,i){"use strict";i.d(t,"a",function(){return n});var n="large"},"P+Pi":function(e,t,i){"use strict";var n,o,r,s;i.r(t),i.d(t,"PaneRendererFlagShape",function(){return s}),n=i("mrSG"),o=i("2WC2"),r=3,s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype._drawItemShape=function(e,t){var i=t.width,n=t.height,o=n/2,s=(i-r)/3,a=t.x-i/2,l=t.vertOffset,c=t.y-o+l;e.moveTo(a,c),e.lineTo(a+r,c),e.bezierCurveTo(a+s,c-s,a+2*s,c+s,a+i,c),e.lineTo(a+i,c+o),e.bezierCurveTo(a+i-s,c+o+s,a+i-2*s,c+o-s,a+r,c+o),e.lineTo(a+r,c+n),e.lineTo(a,c+n),e.lineTo(a,c)},t}(o.a)},PC8g:function(e,t,i){"use strict";var n,o,r,s,a,l,c;i.r(t),i.d(t,"trackEvent",function(){return c}),n=i("FQhm"),o=i("Kxc7"),r=i("uOxu"),s=Object(r.getLogger)("Common.TrackEvent"),a=[/Study_(Drawing)_(.*)/,/(Study)_(.*)@tv-basicstudies/,/(Study)_(.*)/,/(Chart Style) (.*)/],l=function(e,t,i){var o,r,s;for(t=t||e||i||"",o="",r=0;r=t.scrollWidth||t.setAttribute("title",t.textContent||""))},!0),document.addEventListener("mouseenter",function(e){var t,i,n,s,a,l,c=e.target;if(c instanceof HTMLElement&&c.matches(".apply-overflow-tooltip")){if(c.matches(".apply-overflow-tooltip--check-children")){for(t=!1,i=c.children,n=0;n'},PoSe:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,i){var n,o,r,s,a=null,l=0;return i=i||{},s=function(){l=!1===i.leading?0:Date.now(),a=null,r=e.apply(n,o),a||(n=o=null)},function(){var c,u=Date.now();return l||!1!==i.leading||(l=u),n=this,o=arguments,(c=t-(u-l))<=0||c>t?(a&&(clearTimeout(a),a=null),l=u,r=e.apply(n,o),a||(n=o=null)):a||!1===i.trailing||(a=setTimeout(s,c)),r}},e.exports=t.default},Q19o:function(e,t,i){"use strict";(function(t,n,o){function r(e,t){return t.map(function(t){return e.dataSourceForId(t)})}function s(e,t){var i=o.utc_to_cal(t.timezone,1e3*e),n=t.spec.correctTradingDay(i);return o.set_hms(n,0,0,0,0,b.get_timezone("Etc/UTC")),n.getTime()/1e3}
+var a=i("Eyy1").ensureNotNull,l=i("jA0t"),c=i("9iCb").applyOverridesToStudy,u=i("0YCj"),h=i("5JMW"),d=h.LineDataSourceApi,p=h.isLineToolRiskReward,_=i("N1UO").StudyApi,f=i("ltKl").SeriesApi,m=i("QrSB").SelectionApi,y=i("mf9N").PaneApi,g=i("3mf1").availableIcons,v=i("IiTo"),S=i("LxhU").Interval,b=i("jCNj"),w=i("2jXJ").supportedLineTools,P=i("7MZv").showTooManyStudiesNotice,C=i("ogJP").isNumber,T=i("ogJP").inherit,x=i("vu5c").onSeriesCompletedOrErrorReceived,I=i("CW80").createLineToolProperties,L=i("96Yh"),M=L.lineToolEntityInfo,A=L.studyEntityInfo,k=i("lReN").LineToolsGroupControllerApi,E=i("FDyI").ChartWidgetApiBase,O=i("mMWL"),D=function(e,i){E.call(this,e),this._panes=new WeakMap,this._studies=new WeakMap,this._lineDataSources=new WeakMap,this._activateChart=i,this._selectionApi=null,this._visibleBarsChanged=new t,this._chartWidget.onAboutToBeDestroyed().subscribe(this,this._destroy,!0),this._chartWidget.withModel(this,function(){this._chartWidget.model().timeScale().visibleBarsStrictRangeChanged().subscribe(this,this._onVisibleBarsChanged)})};T(D,E),D.prototype._getPaneApi=function(e){var t=this._panes.get(e);return void 0===t&&(t=new y(e,this._chartWidget),this._panes.set(e,t)),t},D.prototype._getStudyApi=function(e){var t=this._studies.get(e);return void 0===t&&(t=new _(e,this._chartWidget.model()),this._studies.set(e,t)),t},D.prototype._getLineDataSourceApi=function(e){var t=this._lineDataSources.get(e);return void 0===t&&(t=new d(e,this._chartWidget.model().model(),{apiPointsToDataSource:this._convertUserPointsToDataSource.bind(this),dataSourcePointsToPriced:function(e){var t=this._chartWidget.model().mainSeries().syncModel(),i=this._chartWidget.model().timeScale();return e.map(function(e){var n=i.normalizeBarIndex(e.index);return{price:e.price,time:t.projectTime(n.time_t,n.offset)}})}.bind(this)}),this._lineDataSources.set(e,t)),t},D.prototype._makeSubscriptionFromDelegate=function(e){return{subscribe:e.subscribe.bind(e),unsubscribe:e.unsubscribe.bind(e),unsubscribeAll:e.unsubscribeAll.bind(e)}},D.prototype.executeActionById=function(e){this._chartWidget.executeActionById(e)},D.prototype.getCheckableActionState=function(e){return this._chartWidget.getCheckableActionState(e)},D.prototype.setZoomEnabled=function(e){this._chartWidget.model().model().setZoomEnabled(e)},D.prototype.setScrollEnabled=function(e){this._chartWidget.model().model().setScrollEnabled(e)},D.prototype.refreshMarks=function(){this._chartWidget.refreshMarks()},D.prototype.clearMarks=function(){this._chartWidget.clearMarks()},D.prototype.symbol=function(){return this._chartWidget.getSymbol()},D.prototype.symbolExt=function(){var e=this._chartWidget.model().mainSeries().symbolInfo();return e?{symbol:e.name,full_name:e.full_name,exchange:e.exchange,description:e.description,type:e.type}:null},D.prototype.resolution=function(){return this._chartWidget.model().mainSeries().properties().interval.value()},D.prototype.setSymbol=function(e,t){if(e!==this.symbol()||n.enabled("same_data_requery")){
+var i=this._chartWidget.model().mainSeries().dataEvents();t&&x(i,function(e){e||t()}),this._activateChart(),this._chartWidget.setSymbol(e)}},D.prototype.resetData=function(){this._chartWidget.model().mainSeries().rerequestData()},D.prototype.setResolution=function(e,t){var i,n=S.normalize(e);null!==n&&n!==this.resolution()&&(i=this._chartWidget.model().mainSeries().dataEvents(),t&&x(i,function(e){e||t()}),this._activateChart(),this._chartWidget.setResolution(n))},D.prototype.setEntityVisibility=function(e,t){var i,n;console.warn("`setEntityVisibility` is deprecated. Use shape/study API instead"),(i=this._chartWidget.model().model().dataSourceForId(e))&&(n=i.properties())&&n.visible&&n.visible.setValue(t)},D.prototype.getAllStudies=function(){return this._chartWidget.model().model().allStudies().map(A)},D.prototype.availableZOrderOperations=function(e){var t=this._chartWidget.model().model(),i=r(t,e);return this._chartWidget.model().availableZOrderOperations(i)},D.prototype.sendToBack=function(e){var t=this._chartWidget.model().model(),i=r(t,e);this._chartWidget.model().sendToBack(i)},D.prototype.bringToFront=function(e){var t=this._chartWidget.model().model(),i=r(t,e);this._chartWidget.model().bringToFront(i)},D.prototype.insertAfter=function(e,t){var i=this._chartWidget.model().model(),n=r(i,e),o=i.dataSourceForId(t);this._chartWidget.model().insertAfter(n,o)},D.prototype.insertBefore=function(e,t){var i=this._chartWidget.model().model(),n=r(i,e),o=i.dataSourceForId(t);this._chartWidget.model().insertBefore(n,o)},D.prototype.bringForward=function(e){var t=r(this._chartWidget.model().model(),e);this._chartWidget.model().bringForward(t)},D.prototype.sendBackward=function(e){var t=r(this._chartWidget.model().model(),e);this._chartWidget.model().sendBackward(t)},D.prototype.showPropertiesDialog=function(e){var t=this._chartWidget.model().model().dataSourceForId(e);if(null===t)throw new Error("Study or shape "+e+" does not exist");this._chartWidget.showChartPropertiesForSource(t)},D.prototype.getAllShapes=function(){return this._chartWidget.model().model().allLineTools().map(M).filter(function(e){return null!==e.name})},D.prototype.removeAllShapes=function(){this._chartWidget.removeAllDrawingTools()},D.prototype.removeAllStudies=function(){this._chartWidget.removeAllStudies()},D.prototype.removeEntity=function(e){var t=this._chartWidget.model().chartModel().dataSourceForId(e);t?this._chartWidget.model().chartModel().removeSource(t,!0):console.warn("Can't find a source with id: "+e)},D.prototype.removeEntityWithUndo=function(e){var t=this._chartWidget.model().chartModel().dataSourceForId(e);this._chartWidget.model().removeSource(t,!1)},D.prototype.selection=function(){return null===this._selectionApi&&(this._selectionApi=new m(this._chartWidget.model().model())),this._selectionApi},D.prototype.createStudyTemplate=function(e){return this._chartWidget.model().model().studyTemplate(e.saveInterval)},D.prototype.drawOnAllCharts=function(e){O.drawOnAllCharts.setValue(e)},D.prototype.applyStudyTemplate=function(e){
+this._chartWidget.model().applyStudyTemplate(e,""+1e3*Math.random())},D.prototype.setVisibleRange=function(e,t){var i,o,r,s,a,l,c;if(void 0!==e&&e.from&&e.to&&!isNaN(e.from)&&!isNaN(e.to))return i=this._chartWidget.model().model().mainSeries(),o=[parseInt(e.from),parseInt(e.to)],r=S.isDWM(i.interval())&&!n.enabled("disable_resolution_rebuild")?this._alignPoints(o):o,s=r[0],a=r[1],l=void 0!==t&&"function"==typeof t,c=new Promise(function(e){this._chartWidget.setVisibleTimeRange(s,a,l?{}:t,e)}.bind(this)),l&&(console.warn("setVisibleRange now returns a Promise object and don't accept callback as the last argument"),c.then(t)),c;console.warn("Wrong time range: "+JSON.stringify(e)+'. Expected an object with "from" and "to" numeric values.')},D.prototype._getSession=function(){var e=this._chartWidget.model().mainSeries(),t=e.symbolInfo();return new v.SessionInfo(t.timezone,t.session,t.holidays,t.corrections)},D.prototype.getVisibleRange=function(){var e,t,i,n,o,r,l={from:0,to:0},c=this._chartWidget.model().timeScale(),u=c.visibleBarsStrictRange();return null===u?l:null===(t=(e=this._chartWidget.model().mainSeries()).syncModel())?l:(i=a(e.data().last()),o=(n=u.lastBar()-i.index)<=0?c.indexToTimePoint(u.lastBar()):t.projectTime(i.value[TradingView.TIME_PLOT],n),l.from=+c.indexToTimePoint(Math.max(0,u.firstBar()))||0,l.to=+o||0,S.isDWM(e.interval())&&(r=this._getSession(),l.from=s(l.from,r),l.to=s(l.to,r)),l)},D.prototype.getTimeScaleLogicalRange=function(){return this._chartWidget.model().timeScale().logicalRange()},D.prototype.getVisiblePriceRange=function(){return console.warn("`getVisiblePriceRange` is deprecated. Use Price Scale API instead"),this._chartWidget.model().mainSeries()?this._chartWidget.model().mainSeries().priceScale().priceRangeInPrice():null},D.prototype.scrollPosition=function(){return this._chartWidget.model().timeScale().rightOffset()},D.prototype.defaultScrollPosition=function(){return this._chartWidget.model().timeScale().defaultRightOffsetProperty().value()},D.prototype._createTradingPrimitive=function(e,t){var i,n,o,r,s=this,l=this._chartWidget.model().model(),c=l.paneForSource(l.mainSeries()),u=t?l:this._chartWidget.model(),h=u.createLineTool(c,(i=TradingView.CLOSE_PLOT,n=a(s._chartWidget.model().mainSeries().bars().last()),o=n.index,r=n.value[i],{index:o,price:r}),e);return h._adapter},D.prototype.createOrderLine=function(e){e=e||{};return this._createTradingPrimitive("LineToolOrder",e.disableUndo)},D.prototype.createPositionLine=function(e){e=e||{};return this._createTradingPrimitive("LineToolPosition",e.disableUndo)},D.prototype.createExecutionShape=function(e){e=e||{};return this._createTradingPrimitive("LineToolExecution",e.disableUndo)},D.prototype.createShape=function(e,t){return this.createMultipointShape([e],t)},D.prototype._alignPoints=function(e){var t,i,n=this._chartWidget.model().model(),o=n.mainSeries();return n.timeScale().isEmpty()?e:(t=this._getSession(),null===(i=v.createDWMAligner(o.interval(),t))?e:e.map(function(e){return e?(i.moveTo(1e3*e),i.startOfBar(0)/1e3):e}))},
+D.prototype._convertUserPointsToDataSource=function(e){var t,i,o,r,s,a,l,c,u,h,d,p,_,f=this._chartWidget.model().model(),m=f.mainSeries(),y=f.timeScale().points(),g=m.data();if(f.timeScale().isEmpty())return null;for(t=e.map(function(e){return e.time}),i=S.isDWM(m.interval())&&!n.enabled("disable_resolution_rebuild")?this._alignPoints(t):t,o=[],r=0;r_&&d===y.lastIndex()&&(u=m.syncModel().distance(_,a)).success&&(p.index=p.index+u.result),C(l)?p.price=l:((h=c?["open","high","low","close"].indexOf(c)+1:1)<=0&&(h=1),p.price=g.valueAt(d)[h]),p));return o},D.prototype.createMultipointShape=function(e,t,i){var n,o,r,s,a,l,c,u,h,d,_=t.disableUndo?this._chartWidget.model().model():this._chartWidget.model(),f=this._chartWidget.model().model(),m=f.mainSeries();if(!f.timeScale().isEmpty()){if(n=f.dataSourceForId(t.ownerStudyId)||m,o=f.paneForSource(n),r=this._convertUserPointsToDataSource(e),(s=w[t.shape]||w.flag).onlySelectable)throw new Error('Cannot create "'+t.shape+'" shape');if("LineToolPolyline"===s.name)r[0].price===r[r.length-1].price&&r[0].index===r[r.length-1].index||r.push(r[0]);else if("LineToolIcon"===s.name){if(t.icon=t.icon||t.overrides&&t.overrides.icon,!t.hasOwnProperty("icon"))throw new Error("icon must be specified in options");if(-1===g.indexOf(t.icon))throw new Error("icon value must be valid");t.overrides=t.overrides||{},t.overrides.icon=t.icon}if(a=I(s.name),t.overrides)for(l in t.overrides)a[l]?a[l].setValue(t.overrides[l]):p(s.name)&&-1!==["profitLevel","stopLevel"].indexOf(l)&&a.addProperty(l,t.overrides[l]);if(void 0!==a.text&&t.text&&a.text.setValue(t.text),c=_.createLineTool(o,r[0],s.name,a,void 0,n),p(s.name)){if(r.length>2)throw new Error("Wrong points count for "+t.shape+". Required 1 or 2");2===r.length&&(c.startChanging(1,r[1]),c.setPoint(1,r[1]),c.endChanging())}else{if((u=c.pointsCount())!==r.length&&-1!==u)throw new Error("Wrong points count for "+t.shape+". Required "+u);for(h=1;hthis._minValue&&e.maxValue()5)&&t||(c&&!this._moveExceededManhattanDistance&&t&&(h=s>=(u=.5*r)&&!this._options.treatVertTouchDragAsPageScroll,d=u>s&&!this._options.treatHorzTouchDragAsPageScroll,h||d||(this._preventDragProcess=!0)),c&&(this._moveExceededManhattanDistance=!0,this._cancelClick=!0,t&&this._clearLongTapTimeout()),this._preventDragProcess||(this._processEvent(i,this._handler.pressedMouseMoveEvent),t&&Object(l.a)(e)))))},e.prototype._mouseUpHandler=function(e){var t,i;"button"in e&&0!==e.button||(t=this._makeCompatEvent(e),this._clearLongTapTimeout(),this._mouseMoveStartPosition=null,this._mousePressed=!1,this._unsubscribeRoot&&(this._unsubscribeRoot(),this._unsubscribeRoot=null),(i=o(e))&&this._mouseLeaveHandler(e),this._processEvent(t,this._handler.mouseUpEvent),i?++this._tapCount:++this._clickCount,this._clickTimeoutId&&(this._clickCount>1||this._tapCount>1)?(Math.abs(this._clickPosition.x-t.localX)+Math.abs(this._clickPosition.y-t.localY)<(i?15:5)&&!this._cancelClick&&this._processEvent(t,this._handler.mouseDoubleClickEvent),
+this._resetClickTimeout()):this._cancelClick||this._processEvent(t,this._handler.mouseClickEvent),o(e)&&(0===this._tapCount&&Object(l.a)(e),this._mouseLeaveHandler(e),0===e.touches.length&&this._longTapActive&&(this._longTapActive=!1,Object(l.a)(e))),s.isFF&&this._target.ownerDocument.documentElement.removeEventListener("mouseleave",this._onFirefoxOutsideMouseUp))},e.prototype._clearLongTapTimeout=function(){null!==this._longTapTimeoutId&&(clearTimeout(this._longTapTimeoutId),this._longTapTimeoutId=null)},e.prototype._mouseDownHandler=function(e){var t,i,n,r;"button"in e&&0!==e.button||(t=this._target.ownerDocument.documentElement,s.isFF&&t.addEventListener("mouseleave",this._onFirefoxOutsideMouseUp),i=this._makeCompatEvent(e),this._cancelClick=!1,this._moveExceededManhattanDistance=!1,this._preventDragProcess=!1,o(e)&&this._mouseEnterHandler(e),this._mouseMoveStartPosition={x:i.pageX,y:i.pageY},this._unsubscribeRoot&&(this._unsubscribeRoot(),this._unsubscribeRoot=null),n=this._mouseMoveWithDownHandler.bind(this),r=this._mouseUpHandler.bind(this),this._unsubscribeRoot=function(){t.removeEventListener("touchmove",n),t.removeEventListener("touchend",r),t.removeEventListener("mousemove",n),t.removeEventListener("mouseup",r)},t.addEventListener("touchmove",n,{passive:!1}),t.addEventListener("touchend",r,{passive:!1}),this._clearLongTapTimeout(),o(e)&&1===e.touches.length?this._longTapTimeoutId=setTimeout(this._longTapHandler.bind(this,e),240):(t.addEventListener("mousemove",n),t.addEventListener("mouseup",r)),this._mousePressed=!0,this._processEvent(i,this._handler.mouseDownEvent),this._clickTimeoutId||(this._clickCount=0,this._tapCount=0,this._clickTimeoutId=setTimeout(this._resetClickTimeout.bind(this),500),this._clickPosition={x:i.localX,y:i.localY}))},e.prototype._init=function(){var e,t,i=this;this._target.addEventListener("mouseenter",this._mouseEnterHandler.bind(this)),this._target.addEventListener("touchcancel",this._clearLongTapTimeout.bind(this)),e=this._target.ownerDocument,t=function(e){i._handler.mouseDownOutsideEvent&&(e.target&&i._target.contains(e.target)||i._handler.mouseDownOutsideEvent())},this._unsubscribeOutsideEvents=function(){e.removeEventListener("mousedown",t),e.removeEventListener("touchstart",t)},e.addEventListener("mousedown",t),e.addEventListener("touchstart",t,{passive:!0}),this._target.addEventListener("mouseleave",this._mouseLeaveHandler.bind(this)),this._target.addEventListener("contextmenu",this._longTapHandler.bind(this)),this._target.addEventListener("touchstart",this._mouseDownHandler.bind(this),{passive:!0}),Modernizr.mobiletouch||this._target.addEventListener("mousedown",this._mouseDownHandler.bind(this)),this._initPinch(),this._target.addEventListener("touchmove",function(){},{passive:!1})},e.prototype._initPinch=function(){var e=this;void 0===this._handler.pinchStartEvent&&void 0===this._handler.pinchEvent&&void 0===this._handler.pinchEndEvent||(this._target.addEventListener("touchstart",function(t){return e._checkPinchState(t.touches)},{passive:!0}),
+this._target.addEventListener("touchmove",function(t){var i;2===t.touches.length&&null!==e._startPinchMiddlePoint&&void 0!==e._handler.pinchEvent&&(i=n(t.touches[0],t.touches[1])/e._startPinchDistance,e._handler.pinchEvent(e._startPinchMiddlePoint,i),Object(l.a)(t))},{passive:!1}),this._target.addEventListener("touchend",function(t){e._checkPinchState(t.touches)}))},e.prototype._checkPinchState=function(e){1===e.length&&(this._pinchPrevented=!1),2!==e.length||this._pinchPrevented||this._longTapActive?this._stopPinch():this._startPinch(e)},e.prototype._startPinch=function(e){var t=this._target.getBoundingClientRect()||{left:0,top:0};this._startPinchMiddlePoint={x:(e[0].clientX-t.left+(e[1].clientX-t.left))/2,y:(e[0].clientY-t.top+(e[1].clientY-t.top))/2},this._startPinchDistance=n(e[0],e[1]),void 0!==this._handler.pinchStartEvent&&this._handler.pinchStartEvent(),this._clearLongTapTimeout()},e.prototype._stopPinch=function(){null!==this._startPinchMiddlePoint&&(this._startPinchMiddlePoint=null,void 0!==this._handler.pinchEndEvent&&this._handler.pinchEndEvent())},e.prototype._mouseLeaveHandler=function(e){this._unsubscribeMousemove&&this._unsubscribeMousemove();var t=this._makeCompatEvent(e);this._processEvent(t,this._handler.mouseLeaveEvent)},e.prototype._longTapHandler=function(e){o(e)||Object(l.a)(e);var t=this._makeCompatEvent(e);this._processEvent(t,this._handler.longTapEvent),this._processEvent(t,this._handler.contextMenuEvent),this._cancelClick=!0,this._longTapActive=!0},e.prototype._processEvent=function(e,t){t&&t.call(this._handler,e)},e.prototype._makeCompatEvent=function(e){var t,i;return t="touches"in e&&e.touches.length?e.touches[0]:"changedTouches"in e&&e.changedTouches.length?e.changedTouches[0]:e,i=this._target.getBoundingClientRect()||{left:0,top:0},{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,screenX:t.screenX,screenY:t.screenY,localX:t.clientX-i.left,localY:t.clientY-i.top,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,type:e.type.startsWith("mouse")?"mouse":"touch",target:t.target,view:e.view,preventDefault:function(){Object(l.a)(e)}}},e}()},SXwY:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var i=function i(n){var o=i.cache,r=""+(t?t.apply(this,arguments):n);return o.hasOwnProperty(r)||(o[r]=e.apply(this,arguments)),o[r]};return i.cache={},i},e.exports=t.default},Si3H:function(e,t,i){"use strict";function n(e,t){var i=s.a.versionOf(e),n=e;void 0===n._serverMetaInfoVersion&&(n._serverMetaInfoVersion=i),h.forEach(function(n){i<0||i>=n.targetMetaInfoVersion()||(n.migrateMetaInfo(e),void 0!==t&&n.migratePropState(t),Object(o.assert)(e._metainfoVersion===n.targetMetaInfoVersion()))})}var o,r,s,a,l,c,u,h;i.r(t),o=i("Eyy1"),r=i("0YCj"),s=i.n(r),a=i("ogJP"),l=function(){function e(){}return e.prototype.targetMetaInfoVersion=function(){return 47},e.prototype.migrateMetaInfo=function(e){var t,i,n=e,o=e;o._metainfoVersion=47,n.defaults&&void 0!==n.defaults.precision?(t=n.defaults&&n.defaults.precision,
+0===(i=Object(a.isNumber)(t)?t:parseInt(t))?o.format={type:"volume"}:isFinite(i)?o.format={type:"price",precision:i}:o.format={type:"inherit"},delete n.defaults.precision):o.format={type:"inherit"}},e.prototype.migratePropState=function(e){},e}(),c=i("mrSG"),u=function(){function e(){}return e.prototype.targetMetaInfoVersion=function(){return 50},e.prototype.migrateMetaInfo=function(e){var t,i,n,r,s,a,l,u,h,d=e,p=e;if(p._metainfoVersion=50,void 0!==d.defaults&&void 0!==d.defaults.ohlcPlots&&void 0!==d.ohlcPlots)for(t=d.ohlcPlots,i=d.defaults.ohlcPlots,n=Object(o.ensureDefined)(Object(o.ensureDefined)(p.defaults).ohlcPlots),r=0,s=Object.keys(i);r=t.length)return null;var i=t[e.index];return i===s.a?null:{startPrice:e.startPrice,endPrice:e.endPrice,index:i,extendTop:e.extendTop,extendBottom:e.extendBottom}}function o(e,t,i){var n=Object(a.ensureTimePointIndexIndex)(i.indexOf(e.index));return Object(r.__assign)(Object(r.__assign)({id:t},e),{index:n})}var r,s,a;i.d(t,"b",function(){return n}),i.d(t,"a",function(){return o}),r=i("mrSG"),s=i("tqok"),a=i("hsV8")},Ss5c:function(e,t,i){"use strict";(function(e){function n(t,i){var o,r;if(c.call(this),this._model=t,this._properties=i,this._pointAdded=new y,this._pointChanged=new y,this._onTemplateApplying=new y,this._onTemplateApplied=new y,this._paneViews=[],this._points=[],this._fixedPoints=[],this._timePoint=[],this._currentPointsetId=null,this._properties.hasChild("symbol")||this._properties.addChild("symbol",new e(t.mainSeries().symbol())),this._properties.hasChild("interval")||this._properties.addChild("interval",new e(t.mainSeries().interval())),this.calcIsActualSymbol(),this._properties.intervalsVisibilities.listeners().subscribe(this,n.prototype.calcIsActualSymbol),this._properties.listeners().subscribe(this,this.propertiesChanged),this._createPointsProperties(),this.m_priceAxisViews=[],this.m_timeAxisViews=[],this.pointsCount()>0)for(o=0;o=i.multiplier()&&(t=e.key)}),t},n.prototype.calcIsActualSymbol=function(){var e,t=this._properties.symbol,i=this._model.mainSeries(),n=t.value();this._isActualSymbol=i.symbolSameAsCurrent(n),this._isActualSymbol&&(e=i.symbol(),v(n,e)||(f.logWarn('Possible drawing "migrating" detected from "'+n+'" to "'+e+'"'),f.logWarn("Series symbolInfo: "+JSON.stringify(i.symbolInfo())),f.logWarn((new Error).stack)),t.setValue(e)),this.calcIsActualInterval()},n.prototype.calcIsActualInterval=function(){var e,t,i,n,o,r,s=this._properties,a=this._model.mainSeries(),l=d.parse(a.interval()),c=s.intervalsVisibilities;this._isActualInterval=!1,l.isSeconds()&&l.multiplier()<60&&(e=c.seconds.value(),t=c.secondsFrom.value(),i=c.secondsTo.value(),this._isActualInterval=e&&l.multiplier()>=t&&l.multiplier()<=i),l.isSeconds()&&l.multiplier()>=60&&(n=Math.floor(l.multiplier()/60),e=c.minutes.value(),t=c.minutesFrom.value(),i=c.minutesTo.value(),this._isActualInterval=e&&n>=t&&n<=i),l.isMinutes()&&l.multiplier()<60&&(e=c.minutes.value(),t=c.minutesFrom.value(),i=c.minutesTo.value(),this._isActualInterval=e&&l.multiplier()>=t&&l.multiplier()<=i),l.isMinutes()&&l.multiplier()>=60&&(o=Math.floor(l.multiplier()/60),e=c.hours.value(),t=c.hoursFrom.value(),i=c.hoursTo.value(),this._isActualInterval=e&&o>=t&&o<=i),l.isHours()&&(e=c.hours.value(),t=c.hoursFrom.value(),i=c.hoursTo.value(),this._isActualInterval=e&&l.multiplier()>=t&&l.multiplier()<=i),l.isDays()&&(e=c.days.value(),t=c.daysFrom.value(),i=c.daysTo.value(),this._isActualInterval=e&&l.multiplier()>=t&&l.multiplier()<=i),l.isWeeks()&&(this._isActualInterval=c.weeks.value()),l.isMonths()&&(this._isActualInterval=c.months.value()),l.isRange()&&(this._isActualInterval=c.ranges.value()),!this._isActualInterval&&this._model.selection().isSelected(this)&&(r=this,
+this._model.selectionMacro(function(e){e.removeSourceFromSelection(r)}))},n.PointIndexProperty=function(t,i){e.call(this),this._lineSource=t,this._pointIndex=i},inherit(n.PointIndexProperty,e),n.PointIndexProperty.prototype.value=function(){return this._lineSource.points()[this._pointIndex].index},n.PointIndexProperty.prototype.setValue=function(e){var t=this._lineSource.points()[this._pointIndex];t.index=e,this._lineSource.setPoint(this._pointIndex,t),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(!0),this._lineSource._syncMultichartState(),this._lineSource._properties.lastUpdateTime.setValue((new Date).valueOf())},n.prototype._syncMultichartState=function(){var e={points:this._timePoint,interval:this._model.mainSeries().interval()};this.linkKey&&!this.properties().singleChartOnly&&u.finishChangingLineTool({model:this._model,linkKey:this.linkKey,symbol:this._model.mainSeries().symbol(),finalState:e})},n.prototype._createPointProperty=function(e){var t,i=this._properties.points;i.addProperty(e),(t=i[e]).addChild("price",new n.PointPriceProperty(this,e)),t.addChild("bar",new n.PointIndexProperty(this,e))},n.prototype._createPointsProperties=function(){this._properties.addProperty("points");for(var e=0;e0&&(this._points=i)},n.prototype.restorePoints=function(e,t,i){this._timePoint=e,this._points=t,i||this.denormalizeTimePoints()},n.prototype.restoreExternalPoints=function(e){this.properties().interval.setValue(e.interval),this._timePoint=e.points,this.denormalizeTimePoints(),this.isActualSymbol()?this.createServerPoints():this.clearServerPoints()},n.prototype.restorePositionPercents=function(e){this._positionPercents=e},n.prototype.getLinkKey=function(){return this.linkKey||null},n.prototype.updateAllViewsAndRedraw=function(){this.updateAllViews(),this._model.updateSource(this)},n.prototype.propertiesChanged=function(){if(this.calcIsActualInterval(),this.updateAllViewsAndRedraw(),this.linkKey){var e=this.properties().state(this._syncStateExclusions);delete e.interval,u.changeLineStyle({linkKey:this.linkKey,state:e,model:this._model})}},n.prototype.points=function(){var e,t,i=[];for(e=0;e=2&&this._properties.snapTo45Degrees&&this._snapPoint45Degree(i,this.points()[this.points().length-2]),i},n.prototype.addPoint=function(e,t,i){var n=this._preparePoint(e,t);return this._addPointIntenal(n,t,i)},n.prototype._addPointIntenal=function(e,t,i){this._points.push(e);var n=this._points.length===this.pointsCount();return n?(this._lastPoint=null,i||(this.normalizePoints(),this.createServerPoints())):this._lastPoint=e,
+this._pointAdded.fire(this._points.length-1),n},n.prototype.addFixedPoint=function(e){this._fixedPoints.push(e);var t=this._fixedPoints.length===this.pointsCount();return t&&this.calcPositionPercents(),t},n.prototype.calcPositionPercents=function(){var e,t,i,n;if(!this.priceScale()||this.priceScale().isEmpty())return[];for(this._positionPercents=[],e=0;e=0;--t)e.push(this._paneViews[t]);return e},n.prototype._setPaneViews=function(e){this._paneViews=e,this._model.lightUpdate()},n.prototype.dataWindowView=function(){return null},n.prototype.statusView=function(){return null},n.prototype.isSourceHidden=function(){return!this._properties.visible.value()||u.hideAllDrawings().value()&&this.canBeHidden()||!this._isActualInterval||!this._isActualSymbol},n.prototype.priceAxisViews=function(e,t){var i,n,o;return t!==this.priceScale()||this.isSourceHidden()?null:this._model.lineBeingEdited()===this&&(i=this._model.linePointBeingEdited())0&&(o=-o),o))},t.prototype._reversePoints=function(){var e=this._points,t=e[0],i=e[1];this._points[0]=i,this._points[1]=t,this.normalizePoints(),this.restart()},t}(r.LineDataSource)).prototype.superclass=r.LineDataSource},TMWk:function(e,t,i){"use strict";function n(e,t,i,n){s.call(this,e,t,i,n),this._underlyingData=new a(l(n))}var o=i("Eyy1").assert,r=i("ogJP").clone,s=i("GVHu").Study,a=i("k9/m").PlotList,l=i("w4Ji").studyPlotFunctionMap;inherit(n,s),n.prototype.clearData=function(){s.prototype.clearData.call(this),this._underlyingData.clear()},n.prototype._mergeData=function(e){var t,i;this._invalidateLastNonEmptyPlotRowCache(),t=this._underlyingData.firstIndex(),this._underlyingData.merge(e),t!==this._underlyingData.firstIndex()&&(this.m_data=new a(l(this._metaInfo),function(e,t){return null==e[t]})),i=this.m_data.lastIndex(),this._underlyingData.range(i,this._underlyingData.lastIndex()).each(function(e,t){return this.m_data.add(e,r(t)),!1}.bind(this)),this._plotsForStrategyProcessing().forEach(function(e){this._createStrategy(e.strategy,e.strategyIndex,e.targetIndex,i).rebuildData(this.m_data)},this)},n.prototype._plotsForStrategyProcessing=function(){var e=["dataoffset"],t=[];return this._metaInfo.plots.forEach(function(i,n){var r,s,a=e.indexOf(i.type)>-1;a&&(r=null,this._metaInfo.plots.forEach(function(e,t){e.id===i.target&&(r=t)}),o(r>=0,"target plot not found for strategy plot "+i.id),s={strategy:i.type,strategyIndex:n,targetIndex:r},t.push(s))},this),t},n.prototype._createStrategy=function(e,t,i,o){return new n["Strategy_"+e](t,i,o)},n.Strategy_dataoffset=function(e,t,i){this._strategyPlotIndex=e,this._targetPlotIndex=t,this._startIndex=i},n.Strategy_dataoffset.prototype.rebuildData=function(e){var t=this._targetPlotIndex+1,i=this._strategyPlotIndex+1,n=null,o=null;e.range(this._startIndex||e.firstIndex(),e.lastIndex()).each(function(r,s){var a,l,c,u=s[t],h=s[i]?Math.round(s[i]):null;return s[t]=null,s[i]=null,!(!h||h>0)&&(l={pointIndex:a=r+h,value:u},o?o.pointIndex!==l.pointIndex&&(a>=0&&(e.valueAt(a)[t]=u),c=!1,n&&(c=n.value<=o.value&&o.value<=u||n.value>=o.value&&o.value>=u),c?o.pointIndex>=0&&(e.valueAt(o.pointIndex)[t]=null):n=o,o=l):o=l,!1)})},t.study_ScriptWithDataOffset=n},TQMj:function(e,t,i){"use strict";function n(e){return("0"+e).slice(-2)}var o,r,s,a,l,c,u,h,d,p,_;i.r(t),i.d(t,"SeriesPriceAxisView",function(){return _}),o=i("mrSG"),r=i("Eyy1"),s=i("LxhU"),a=i("KcY8"),l=i("Kxc7"),c=i("oXaB"),u=l.enabled("countdown"),
+h=l.enabled("price_scale_always_last_bar_value"),d=[0,1,2,3,9,8],p=l.enabled("force_exchange_as_title"),_=function(e){function t(t,i){var n=e.call(this)||this;return n._source=t,n._data=i,n}return Object(o.__extends)(t,e),t.prototype._getSource=function(){return this._source},t.prototype._getData=function(){return this._data},t.prototype._isCountdownEnabled=function(){return u},t.prototype._countdownText=function(){var e,t,i,o,a,l,c,u,h,d=s.Interval.parse(this._source.interval());return d.isDWM()||d.isSeconds()&&1===d.multiplier()?"":(e=1e3*Object(r.ensure)(Object(r.ensureNotNull)(this._source.data().bars().last()).value[0]),t=1e3*this._source.serverTimeOffset(),i=s.Interval.parse(this._source.interval()).inMilliseconds(),o=e.valueOf()+i,a=(new Date).valueOf()+t,(l=Math.round((o-a)/1e3))<=0?"":(c=null,(l=Math.min(l,i/1e3))>=3600&&(c=n(Math.floor(l/3600))),l%=3600,u=n(Math.floor(l/60)),l%=60,h=n(Math.floor(l)),null!==c?c+":"+u+":"+h:u+":"+h))},t.prototype._updateRendererData=function(e,t,i){var n,o,r,s,a,l,p,_,f,m,y,g;e.visible=!1,t.visible=!1,12!==(n=this._source.properties()).style.value()&&(r=(o=this._data.model.properties().scalesProperties).showSeriesLastValue.value(),s=u&&-1!==d.indexOf(n.style.value())&&n.showCountdown.value(),a=o.showSymbolLabels.value(),l=o.seriesLastValueMode.value()===c.PriceAxisLastValueMode.LastPriceAndPercentageValue,(p=this._source.lastValueData(void 0,h)).noData||(_=8===n.style.value(),(r||s||a)&&_&&n.haStyle.showRealLastPrice.value()&&(f=this._source.lastValueData(void 0,!1),m=this._source.lastValueData(void 0,!0),f.noData||m.noData||f.index!==m.index||(r=!1,s=!1,a=!1)),(r||s)&&(y=this._axisFirstLineText(p,r,l),g=s?this._countdownText():"",0===y.length?(e.text=g,e.secondLine=""):(e.text=y,e.secondLine=g),0===y.length&&0===g.length||(e.visible=!0)),(a||l)&&(t.text=this._paneText(p,r,a,l),t.visible=t.text.length>0),i.background=this._source.priceLineColor(p.color),i.color=this.generateTextColor(i.background),i.coordinate=p.coordinate,i.floatCoordinate=p.floatCoordinate))},t.prototype._paneText=function(e,t,i,n){var o,r="";return p?r+=(o=this._source.symbolInfo())?o.exchange+" ":"":i&&(r+=this._source.firstShortName()+" "),t&&n&&(r+=this._source.priceScale().isPercentage()?e.formattedPriceAbsolute:e.formattedPricePercentage),r.trim()},t.prototype._axisFirstLineText=function(e,t,i){return t?i?this._source.priceScale().isPercentage()?e.formattedPricePercentage:e.formattedPriceAbsolute:e.text:""},t}(a.a)},TTFo:function(e,t,i){"use strict";function n(e,t){return t<0&&(e=-e),e/100*t+t}function o(e,t){var i=100*(e-t)/t;return t<0?-i:i}function r(e,t){var i=o(e.minValue(),t),n=o(e.maxValue(),t);return new h.PriceRange(i,n)}function s(e,t){return e-=100,t<0&&(e=-e),e/100*t+t}function a(e,t){var i=100*(e-t)/t+100;return t<0?-i:i}function l(e,t){var i=a(e.minValue(),t),n=a(e.maxValue(),t);return new h.PriceRange(i,n)}function c(e){var t,i=Math.abs(e);return i<1e-8?0:(t=Object(d.log10)(i+1e-4)+4,e<0?-t:t)}function u(e){var t,i=Math.abs(e);return i<1e-8?0:(t=Math.pow(10,i-4)-1e-4,e<0?-t:t)}var h,d
+;i.r(t),i.d(t,"fromPercent",function(){return n}),i.d(t,"toPercent",function(){return o}),i.d(t,"toPercentRange",function(){return r}),i.d(t,"fromIndexedTo100",function(){return s}),i.d(t,"toIndexedTo100",function(){return a}),i.d(t,"toIndexedTo100Range",function(){return l}),i.d(t,"toLog",function(){return c}),i.d(t,"fromLog",function(){return u}),h=i("Qb4w"),d=i("Hr11")},TcSq:function(e,t,i){"use strict";function n(e){var t=e.indexOf("$"),i=e.indexOf("@");return t<0&&i>=0?null:e.substring(Math.max(t+1,0),i>=0?i:e.length)}function o(e){return e.startsWith("PUB;")}i.r(t),i.d(t,"extractPineId",function(){return n}),i.d(t,"isPublisedPineId",function(){return o})},TlGQ:function(e,t,i){"use strict";function n(e,t,i){return Object(r.isArray)(e)?function(e,t,i){return e.map(function(e){var o=n(e,t,i),r=t(o);return void 0!==r?r:o})}(e,t,i):Object(r.isObject)(e)&&(Object(r.isHashObject)(e)||i&&i.visitInstances)?function(e,t,i){var o={};return Object.keys(e).forEach(function(r){var s=n(e[r],t,i),a=t(s);o[r]=void 0!==a?a:s}),o}(e,t,i):e}function o(e,t,i){var o=n(e,t,i),r=t(o);return void 0!==r?r:o}var r;i.r(t),i.d(t,"visitObject",function(){return o}),r=i("ogJP")},TmNs:function(e,t,i){"use strict";var n,o,r,s,a,l,c,u,h;i.r(t),n=i("mrSG"),o=i("KcY8"),r=i("Eyy1"),s=i("jFln"),a=i("8Uy/"),l=function(){function e(e,t){this.setData(e,t)}return e.prototype.setData=function(e,t){this._data=e,this._commonData=t},e.prototype.draw=function(e,t,i,n,o){if(this._data.visible){var l=this._commonData.coordinate;void 0!==this._commonData.fixedCoordinate&&(l=this._commonData.fixedCoordinate),e.lineWidth=Object(r.ensureDefined)(this._data.linewidth),e.lineCap="square",Object(s.setLineStyle)(e,void 0===this._data.linestyle?a.LINESTYLE_DOTTED:this._data.linestyle),e.strokeStyle=this._commonData.color,e.beginPath(),e.moveTo(0,l),e.lineTo(n,l),e.stroke()}},e.prototype.height=function(e,t){return 0},e}(),i.d(t,"PriceLineAxisView",function(){return c}),i.d(t,"SeriesPriceLineAxisView",function(){return u}),i.d(t,"StudyPriceLineAxisView",function(){return h}),c=function(e){function t(){return e.call(this,l)||this}return Object(n.__extends)(t,e),t.prototype._updateRendererData=function(e,t,i){if(t.visible=!1,e.visible=!1,this._isVisible()){var n=this._value();n.noData||(i.background="",i.color=this._priceLineColor(n.color),i.coordinate=n.coordinate,i.floatCoordinate=n.floatCoordinate,e.linewidth=this._lineWidth(),e.visible=!0)}},t}(o.a),u=function(e){function t(t){var i=e.call(this)||this;return i._series=t,i}return Object(n.__extends)(t,e),t.prototype._value=function(){return this._series.lastValueData(void 0,!0)},t.prototype._priceLineColor=function(e){return this._series.priceLineColor(e)},t.prototype._lineWidth=function(){return this._series.properties().priceLineWidth.value()},t.prototype._isVisible=function(){var e=this._series.model().properties().scalesProperties,t=e.showSeriesLastValue.value();return this._series.properties().showPriceLine.value()&&t},t}(c),h=function(e){function t(t,i){var n=e.call(this)||this;return n._study=t,n._plotname=i,n}
+return Object(n.__extends)(t,e),t.prototype._value=function(){return this._study.lastValueData(this._plotname,!0)},t.prototype._lineWidth=function(){return this._study.properties().styles[this._plotname].linewidth.value()},t.prototype._priceLineColor=function(e){return e},t.prototype._isVisible=function(){var e=this._study.model().properties().scalesProperties,t=e.showStudyLastValue.value();return this._study.properties().styles[this._plotname].trackPrice.value()&&t},t}(c)},Tmoa:function(e,t,i){"use strict";function n(e,t,i){var n,o,s,a,u;return t=t||0,l(e)?(o=(n=Object(c.parseRgb)(e))[0],s=n[1],a=n[2],u=Object(c.normalizeAlphaComponent)(r(t)),Object(c.rgbaToString)([o,s,a,u])):i?Object(c.rgbaToString)(Object(c.rgba)(Object(c.parseRgb)(e),Object(c.normalizeAlphaComponent)(r(t)))):e}function o(e){return 100*(1-e)}function r(e){if(e<0||e>100)throw new Error("invalid transparency");return 1-e/100}function s(e){return l(e)?e:Object(c.rgbaToString)(Object(c.rgba)(Object(c.parseRgb)(e),Object(c.normalizeAlphaComponent)(1)))}function a(e){var t=Object(c.parseRgb)(e).map(function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)});return Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function l(e){return 0===e.indexOf("#")}var c;i.r(t),i.d(t,"generateColor",function(){return n}),i.d(t,"alphaToTransparency",function(){return o}),i.d(t,"transparencyToAlpha",function(){return r}),i.d(t,"resetTransparency",function(){return s}),i.d(t,"getLuminance",function(){return a}),i.d(t,"isHexColor",function(){return l}),c=i("eJTA")},TohL:function(e,t,i){"use strict";function n(e,t){var o=t||n.createProperties();l.call(this,e,o),i.e("lt-pane-views").then(function(t){var n=i("mr3a").TextPaneView,o=i("5Dp4").MarkPaneView,r=[new o(this,e,this.image,this.width,this.height,this.offsetX,this.offsetY)],s=this._createTextPaneView(n);null!==s&&r.push(s),this._setPaneViews(r)}.bind(this).bind(null,i)).catch(i.oe)}function o(e,t){this._constructor="LineToolArrowMarkLeft",n.call(this,e,t)}function r(e,t){this._constructor="LineToolArrowMarkUp",n.call(this,e,t)}function s(e,t){this._constructor="LineToolArrowMarkRight",n.call(this,e,t)}function a(e,t){this._constructor="LineToolArrowMarkDown",n.call(this,e,t)}var l=i("Ss5c").LineDataSource,c=i("tc+8"),u=i("Ocx9").DefaultProperty,h=i("hayr").propertyPages,d=window.t("Arrow Mark"),p=window.t("Arrow Mark Left"),_=window.t("Arrow Mark Up"),f=window.t("Arrow Mark Right"),m=window.t("Arrow Mark Down");inherit(n,l),n.prototype.width=21,n.prototype.height=21,n.prototype.offsetX=0,n.prototype.offsetY=0,n.prototype.paneViews=function(){var e=l.prototype.paneViews.call(this);return null!==e&&this._textPaneView&&e.push(this._textPaneView),e},n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return d},n.prototype.name=function(){return"Arrow Mark"},n.prototype.getStylesPropertyPage=function(){return h.LineToolArrowMarkStylesPropertyPage},n.prototype._getPropertyDefinitionsViewModelClass=function(){
+return Promise.all([i.e(13),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("5sLb").ArrowMarkDefinitionsViewModel}.bind(null,i)).catch(i.oe)},n.prototype.template=function(){var e=l.prototype.template.call(this);return e.text=this.properties().childs().text.value(),e},n.prototype._applyTemplateImpl=function(e){l.prototype._applyTemplateImpl.call(this,e),this.properties().childs().text.setValue(e.text)},n.prototype._createTextPaneView=function(e){return null},n.createProperties=function(e){var t=new u("linetoolarrowmark",e);return n._configureProperties(t),t},n._configureProperties=function(e){l._configureProperties(e),e.hasChild("text")||e.addChild("text",new c("")),e.addExclusion("text")},inherit(o,n),o.prototype.image=new Image,o.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB50lEQVR4AWMgETAKKAgIAGkQ5mCgAmCWdtTWV4yxvgFkWwKxOKUGssr5Gccrx9t+Vk6w+w/kxwKxIrmGMTKIivIohFvONKsI+e/cl/ofamgGECuTYyCTqJ2mqlK01Vnr+uj/HjNy/1v1J8AMzSTHUBYZP6MgpTjb97bNsf9dpmf9N++J/W/UEQEztAiIbUEGo2EpIObE8C4oVuVDzLuBmv869aT8t5+c+t+0K/q/YXs4GGsWeIAMRscwy/yhBiO8K2ijJKcYZXXYuj7qv/u0nP/W/Yn/jTsjQYYRwliDhUXKy8BVKdbmuW1T7H+3Gdn/LXrjQN4FaSDLUBa5MItyoOAvp67k/45T0pC9S56hSrHWhY4tif9D5pUDXZjz36w7Blkx+S5VDLNoBUWMY3fKfwdExMAw+WEq7Wvkoxhn+waUhFwRSYhcQxGxL26jpqQYbX3CBpjY3aeDYj+BothHpFNxcW75cIvJpmXB/516Uv/bT0r5b9IVRUY6xQSssr6GkcAc9dGuNe6/y7RMMnMUJmCWcNTSBgbHZeuG6P+eM/P+W/VRlPcRwSGoJMgvH265yKIq/L9LfzqKoZSXp0Em6cDy9BvU0Dhyy1PM4PAwMFWKs7kFZFsBsQQDlQAjr4a0MJAWxFdHAQAcI3sGHsO1dgAAAABJRU5ErkJggg==",o.prototype.offsetX=1,o.prototype.offsetY=-10,o.prototype.title=function(){return p},o.prototype.name=function(){return"Arrow Mark Left"},o.prototype._createTextPaneView=function(e){var t=new e(this,this._model,22,-3,"middle","left");return t.disableSelection(),t},o.createProperties=function(e){return n.createProperties(e)},inherit(r,n),r.prototype.image=new Image,r.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAACBklEQVR4AWMgErAoxVoXgmgGKgEWxTCLVseWxP9yYRbl1DCYSdrXyEc5we5vyLzy/0D6l5SXgStInFwDGcVt1JQU42zfOHan/HebkfPfqSv5v1KszXNBGyU5kDzpRoqLcytGW5+wbY797zA59b9Zd8x/xylp/22bYv8rRlkdBqrgINVIVvlwi8k29dH/Xadn/Tftiv5v2B4Opt1mZP+3ro/6Lx9i3k1K+DLL+hpGmpYF/3efnvPfvCcWZCAcW/TG/XeflvMfFM4yfkZBxIQvo4SjlrZSnO1Hp57U/9b9Cf+NOiKQDQXxgeKJ/516Uv4D1b0XtdNUxRu+gkqC/MBwvGzXGvffflLKf+POSISBCAwWtweGMyi8laKtzjKIivLgCUfLRdYN0f9dpmX+N+mKghiCieHh6wIMb2tguCuEW84E6ccIR7kgk3SLqvD/njPzYOFICIPVeczI/W9WEfJfzs84HmQOIhw9DEyV422/ufSn/7fqg4cjIQxWZwUMd+e+1P9A/Z+lHbX1weHLqyEtrBRncwsYm/+RsWaBBz4DwfLoehRjrG8IKAgIgOMHiK2AOA6IM6G4CKgIr6EgeZA6qPoMII4FYksgFmCA5gwJIFYEYmUotiXSUFuYHqh+cXw5TZlIQ5WxaR4mhuLBZBkqBcT+oJjFg/3B6kgAnFANyniwFEQdJgAAOuN7Bp7MBuYAAAAASUVORK5CYII=",r.prototype.offsetX=-9,r.prototype.offsetY=0,r.prototype.title=function(){return _},r.prototype.name=function(){return"Arrow Mark Up"},r.prototype._createTextPaneView=function(e){var t=new e(this,this._model,0,18,"top","center");return t.disableSelection(),t},r.createProperties=function(e){return n.createProperties(e)},inherit(s,n),
+s.prototype.image=new Image,s.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB60lEQVR4AWPAAziAWJBXQ1oYSDMyUAlIALGVUpzNLQkPA1Mgm5kahioCcZxygt1/5Xjbb3JBJulAPiulhioDcSbIUJf+9P8WVeH/5cMtFwkqCfKDgoNiQ636Ev57zsz7b90Q/V8x2vqyhKOWNqHg4ARiKZAhaNgWiItAhhp1RPw374n97zIt879da9x/pTjbj7K+hpE4gwNqoD9IMzasWeDx37A9HIxNuqL+209K+e/Uk/rftCwYGBwWkxnExbkRwYHpTZBGgti4M/K/dX/Cf/fpOf9t6sHBcULcRk0JaAYT6YYiMDw4XKdn/bdtjv2vGGf7RtrXyAdoDguZhiKwaVf0f4fJqf8du1NAQfVXMcyiFWQwmYYisFl3zH+3GTn/Q+aV/3dsSfyvFGtdSLFLHaek/XfqSga59JdcmEU5yKVkh6lFbxzQhdn/bZtiga6zeS7lZeAKMpCC2E/87z4t5791fdR/xSirw4I2SnKg2CcxnSK8aw+MGKceSMTIh5h3Q0szRvJzFCQJgXLUexk/oyCQd8nP+8DE7jEjF+jd6P9K0VZnRe00VWHeJcfQDJChzn2p/80qQv4rhFvOZBAV5QF5l5LyNBZann6W8zOOp0Z5Kg7Eloox1jekHbX1qVLyQ2NVQEBBQIBU7wIAOFZ7BmG7RzYAAAAASUVORK5CYII=",s.prototype.offsetX=-19,s.prototype.offsetY=-10,s.prototype.title=function(){return f},s.prototype.name=function(){return"Arrow Mark Right"},s.prototype._createTextPaneView=function(e){var t=new e(this,this._model,-22,-3,"middle","right",!0);return t.disableSelection(),t},s.createProperties=function(e){return n.createProperties(e)},inherit(a,n),a.prototype.image=new Image,a.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB/UlEQVR4AWPAATj3Wij8J4RB6hhIAFIgTS9a8nBhmKFSpBiqDNJ0P80PF4YZqkyyobfD7HDh4WJolaKY+G5zhXvoMXva2xifoWB5dD07zeTvFKvxioDMFY6RFUgEGvzzQVk8OGafVib9v5fkhc9QkDxIHVj9vaKY/7vM5b+HS/JFA80TAhnKA8TGZSoiS057GYFiFqzhTpQTPkNB8iB1YPUnPQz+5ykKzQGaYwjE3CBDmUCuBWKHabqSZ0656oI0EY1B6idoSx4F6reDupIJFrTMQCwtxsYcvNZY5uU5T0OiDDwLdOFKI9knvMzM/kD9kmBz0AAbEKs6iHAX7zSX/3nF3xyvgZd8Tf9vM5P/ZiXAmQdNBazYEgIjEHOBwiVHXmjWcSctnAbeDLH5f8xR83+SjNBEoHo9sD4owGWwIBDb9mtJHMIVviDxDg3x3UB11kDMD9ZHADCDwkeAmdlvhZHMI2C4oRh4xl3//1IDmbvszAxeQHXiUPWEATR8lE0EubJB4QYMP7CBF31M/m82k/usy8uRCpRXAKsjEXCCwiteVqD/qIPG/+tBVv/3WCj8C5Pi7wCKawMxBwMZgBEaXlbtGuI7T7ro/G9QFdsI5JsDMR/+cCQcvuLsLAzubRoSa4FsJyAWBSdwsgEifKVBXoYmcBYGagCoQZzEGggAoyq6zKXuV5gAAAAASUVORK5CYII=",a.prototype.offsetX=-9,a.prototype.offsetY=-18,a.prototype.title=function(){return m},a.prototype.name=function(){return"Arrow Mark Down"},a.prototype._createTextPaneView=function(e){var t=new e(this,this._model,0,-23,"bottom","center");return t.disableSelection(),t},a.createProperties=function(e){return n.createProperties(e)},s.prototype.version=o.prototype.version=a.prototype.version=r.prototype.version=2,t.LineToolArrowMark=n,t.LineToolArrowMarkLeft=o,t.LineToolArrowMarkRight=s,t.LineToolArrowMarkUp=r,t.LineToolArrowMarkDown=a},TrvT:function(e,t,i){"use strict";var n,o,r,s,a,l,c,u;i.r(t),i.d(t,"CompareDataWindowView",function(){return u}),n=i("mrSG"),o=i("it7y"),r=i("e92V"),s=i("mMWL"),a=i("qFKp"),l=i("ogJP"),c=a.CheckMobile.any(),u=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._studyCompare=t,n}return Object(n.__extends)(t,e),t.prototype._updateImpl=function(){e.prototype._updateImpl.call(this),this._items[0].setTitle(this._studyCompare.guiPlotName(""))},t.prototype._hideValues=function(){return!1},t.prototype._currentIndex=function(){
+var e,t=this._model.crossHairSource().lockedIndex,i=c&&(null===this._model.crossHairSource().pane&&void 0===t||Object(r.a)(s.tool.value())||null!==this._model.lineBeingEdited());return i?e=this._study.data().lastIndex():(e=this._model.crossHairSource().appliedIndex(),Object(l.isNumber)(e)||(e=this._study.data().lastIndex())),e},t}(o.StudyDataWindowView)},TzTt:function(e,t,i){"use strict";function n(e,t){var i,n;return i=null==t?document.documentElement:9===t.nodeType?t.documentElement:t,r&&(n=r.get(i)),n||((n=i.ownerDocument.createRange()).selectNodeContents(i),r&&r.set(i,n)),n.createContextualFragment(e)}function o(e,t){var i,o,r,s=n(e,t);if("firstElementChild"in s)i=s.firstElementChild;else for(i=null,o=0;o0?"+"+(r-r%1)+n:0===r?"":String(r-r%1+n))}}var o;i.d(t,"a",function(){return n}),o=i("jCNj")},"U0+/":function(e,t,i){"use strict";function n(e){e.description_localized=window.t(e.description,{context:"study"})}function o(e,t){var i,n,o,r,s,u=new a.a(t);return Object(l.migrateMetaInfoAndPropState)(u),i=!0,-1===(n=e.findIndex(function(e){return e.id===u.id}))?e.push(u):(r=void 0!==(o=e[n]).pine?c.Version.parse(o.pine.version):null,null===(s=void 0!==u.pine?c.Version.parse(u.pine.version):null)||null===r||s.isGreaterOrEqual(r)?(o.removeDefaults(),e[n]=u):i=!1),i&&u.createDefaults(),u}var r,s,a,l,c,u,h,d;i.r(t),i.d(t,"StudyMetaInfoRepository",function(){return d}),i("YFKU"),r=i("Eyy1"),s=i("0YCj"),a=i.n(s),l=i("Si3H"),c=i("lCO3"),u=i("uOxu"),h=Object(u.getLogger)("Chart.Studies.StudyMetaInfoRepository",{color:"#606"}),d=function(){function e(e){this._nextRequestNumber=1,this._rawStudiesMetaInfo=[],this._isReady=!1,this._metaInfoQueryQueue=[],this._javaMetaInfoQueryQueue=[],this._javaStudiesMetaInfo=[],this._pineMetaInfoCache=[],this._studiesMigrations=[],this._gateway=e}return e.prototype.requestMetaInfo=function(){var e,t=this;return this._requestStarted(),e=this._makeNextRequestId(),h.logNormal("Requesting metainfo #"+e),new Promise(function(i){h.logNormal("Requesting studies metadata #"+e),t._gateway.requestMetadata(e,function(n){var o;h.logNormal("Requesting studies metadata #"+e+" finished"),o=n.params[1].metainfo.slice(),t._processLibraryMetaInfo(o),t._requestFinished(),i()})})},e.prototype.findById=function(e){if(!this._isReady)return this._enqueueMetaInfoQuery(e);var t=this._findStudyMetaInfo(e);if(null!==t)return Promise.resolve(t);if("pine"===e.type)return this._compilePine(e);throw new ReferenceError("unexpected study id="+e.studyId+" with type="+e.type)},e.prototype.findByIdSync=function(e){return this._findStudyMetaInfo(e)},e.prototype.isReady=function(){
+return this._isReady},e.prototype.findAllJavaStudies=function(){return this._isReady?Promise.resolve(this._javaStudiesMetaInfo):this._enqueueJavaMetaInfoQuery()},e.prototype.getInternalMetaInfoArray=function(){return this._javaStudiesMetaInfo},e.prototype.getMigrations=function(){return this._studiesMigrations},e.prototype.addPineMetaInfo=function(e){return o(this._pineMetaInfoCache,e)},e.prototype._processMigrations=function(e){throw new Error("not implemented")},e.prototype._processSiteMetaInfo=function(e,t){throw new Error("not implemented")},e.prototype._processLibraryMetaInfo=function(e){var t,i,r;for(t=0,i=e;tn?1:i50)){for(i=0,a=[r=o(this._position1,this._position2,this._maxSpeed)],l=[s=n(this._position1,this._position2)],i+=s,null!==this._position3&&(c=o(this._position2,this._position3,this._maxSpeed),Math.sign(c)===Math.sign(r)&&(u=n(this._position2,this._position3),a.push(c),l.push(u),i+=u,null!==this._position4&&(h=o(this._position3,this._position4,this._maxSpeed),Math.sign(h)===Math.sign(r)&&(d=n(this._position3,this._position4),a.push(h),l.push(d),i+=d)))),p=0,_=0;_=0&&e.h>=0,"Try to set invalid size to PaneWidget "+JSON.stringify(e)),this._size.equals(e)||(this._size=e,Object(g.resizeCanvas)(this._canvas,e),Object(g.resizeCanvas)(this._topCanvas,e),this._ctx=Object(s.ensureNotNull)(this._canvas.getContext("2d")),this._paneCell.style.width=e.w+"px",this._paneCell.style.height=e.h+"px",this._rowElement.classList.toggle("js-hidden",0===e.h),null!==this._legendWidget&&this._legendWidget.updateWidgetModeBySize(e),null!==this._paneControls&&this._paneControls.updateWidgetModeByWidth(e.w))},e.prototype.width=function(){return this._size.w},e.prototype.height=function(){return this._size.h},e.prototype.state=function(){return Object(s.ensureNotNull)(this._state)},e.prototype.hasState=function(){return null!==this._state},e.prototype.setState=function(e){this.hasState()&&(this.state().onDestroyed().unsubscribeAll(this),this.state().dataSourcesCollectionChanged().unsubscribeAll(this)),this._state=e,this.hasState()&&(this.state().onDestroyed().subscribe(this,this._onStateDestroyed,!0),this.state().dataSourcesCollectionChanged().subscribe(this,this._onDataSourcesCollectionChanged),this.updatePriceAxisWidgets())},e.prototype.getScreenshotData=function(){return{leftAxis:this._lhsPriceAxisesContainer.getScreenshotData(),rightAxis:this._rhsPriceAxisesContainer.getScreenshotData(),content:this._canvas.toDataURL(),contentWidth:this._size.w,contentHeight:this._size.h}},e.prototype.hardResetCanvas=function(){this._size.equals(new g.Size(0,0))||(Object(g.hardResizeCanvas)(this._canvas,this._size),Object(g.hardResizeCanvas)(this._topCanvas,this._size),this._lhsPriceAxisesContainer.hardResetCanvas(),this._rhsPriceAxisesContainer.hardResetCanvas())},e.prototype.updatePriceAxisWidgets=function(){var e,t,i,n,o,r;this.hasState()&&(t=(e=this._chartModel()).paneForSource(e.mainSeries()))&&(i=e.priceScaleSlotsCount(),o=(n=this.state()).visibleLeftPriceScales(),r=n.visibleRightPriceScales(),this._lhsPriceAxisesContainer.setScales(o,i.left,t.leftPriceScales().length,i.left+i.right),this._rhsPriceAxisesContainer.setScales(r,i.right,t.rightPriceScales().length,i.left+i.right))},e.prototype.update=function(){this.hasState()&&(this._lhsPriceAxisesContainer.update(),this._rhsPriceAxisesContainer.update(),
+null!==this._legendWidget&&this._legendWidget.update(),this.updateControls())},e.prototype.updateControls=function(){this.hasState()&&null!==this._paneControls&&this._paneControls.update()},e.prototype.updateThemedColors=function(e){this._themedColor=e,this._updateByThemedColors()},e.prototype.statusWidget=function(){return this._legendWidget},e.prototype.getElement=function(){return this._rowElement},e.prototype.canvasElement=function(){return this._canvas},e.prototype.hasCanvas=function(e){return this._canvas===e||this._topCanvas===e},e.prototype.pinchStartEvent=function(){this._options.handleScale.pinch&&(this._terminateActiveAnimations(),this._prevPinchScale=1,this._pinching=!0)},e.prototype.pinchEvent=function(e,t){if(this._options.handleScale.pinch){var i=5*(t-this._prevPinchScale);this._prevPinchScale=t,this._chartModel().zoomTime(e.x,i,!0),this._prevPinchScale=t}},e.prototype.pinchEndEvent=function(){this._pinching=!1},e.prototype.mouseClickEvent=function(e){var t,i,n,o,r,a;this.hasState()&&(t=this._dataSourceAtPoint(e.localX,e.localY),i=this._chartUndoModel(),n=t&&t.source,o=t&&!t.isCustom&&null!==t.source?t.source.id():null,this._lastClickedSourceId!==o&&(null!==this._lastClickedSourceId&&(r=i.model().dataSourceForId(this._lastClickedSourceId))&&r.onClickOutside&&(r.onClickOutside(e),i.model().updateSource(r)),this._lastClickedSourceId=o),!this._isSelectBarModeEnabled()||this.trackingModeEnabled()&&!this._exitTrackingModeOnNextTry||i.crossHairSource().trySelectCurrentBar(),t&&t.hittest&&t.hittest.result()===d.HitTestResult.CUSTOM&&(a=t.hittest.data().mouseClickHandler)&&(a(e),i.model().updateSource(Object(s.ensureNotNull)(n))),this._isSelectBarModeEnabled()||t&&t.source===i.crossHairSource()||this._tryExitTrackingMode(),n instanceof y.BarsMarksContainer&&t&&Object(s.ensureNotNull)(t.hittest).data()&&n.onClicked(Object(s.ensureNotNull)(t.hittest).data()),n&&Object(_.isLineTool)(n)&&Object(c.emit)("drawing_event",n.id(),"click"))},e.prototype.exitTrackingMode=function(){null!==this._state&&null!==this._startTrackPoint&&(this._exitTrackingModeOnNextTry=!0,this._tryExitTrackingMode())},e.prototype.trackingModeEnabled=function(){return null!==this._state&&null!==this._startTrackPoint},e.prototype._tryExitTrackingMode=function(){this._exitTrackingModeOnNextTry&&(this._startTrackPoint=null,this._clearCursorPosition())},e.prototype._clearCursorPosition=function(){this._chartModel().clearCurrentPosition()},e.prototype._dataSourceAtPoint=function(e,t){var i,n,o,r,s,l,c,u,h,d,_,f,m,y,g,v,S,b,w,P,C,T,x,I,L=null,M=null,A=null;if(!this.hasState())return null;for(n=(i=this.state()).height(),o=i.width(),r=!1,s=function(e,t,i,n){var o=A?A.result():0;e.result()>o&&(A=e,L=t,M=i,r=n)},l=new a.Point(e,t),this._hitTestCustomSources(i.customSources(p.CustomSourceLayer.Foreground),l,s),c=i.hitTestSources(),u=this._chartUndoModel(),h=c.length;0=0;--m)(y=S[m].renderer(n,o))&&y.hitTest&&(g=y.hitTest(l))&&s(g,v,y,!1);if(this.containsMainSeries()){for(b=u.barsMarksSources(),h=0;h=0;--n)if(0!==(r=(o=e[n]).paneViews(h)).length)for(a=r.length-1;a>=0;--a)l=o===_,null!==(c=r[a].renderer(d,p,l))&&null!==(u=c.hitTest(t))&&i(u,o,c,!0)},e.prototype._tryStartMovingLineTool=function(e,t,i,n){var o,l,c,u,h,d;return!(null===t.source||!t.source.movable()||null!==this._startTrackPoint)&&(this._preventSourceChange?(this._startMoveLineToolParams=null,!1):(o=this._chartUndoModel(),l=Object(s.ensureNotNull)(Object(s.ensureNotNull)(this._state).mainDataSource()).firstValue(),c=Object(s.ensureNotNull)(t.source.priceScale()).coordinateToPrice(e.localY,Object(s.ensureNotNull)(l)),u=r(t.source)?o.selection().sources():[t.source],h=new a.Point(e.localX,e.localY),d={index:n,price:c},this._startMoveLineToolParams={source:u,startPoint:{logical:d,screen:h},data:t.hittest&&t.hittest.data(),envState:i},!0))},e.prototype._chartModel=function(){return this._chart.model().model()},e.prototype._chartUndoModel=function(){return this._chart.model()},e.prototype._externalPaneXCoord=function(e,t){var i,n,o=this._div.getBoundingClientRect(),r=o.left+document.body.scrollLeft;return t+=r,n=(i=Object(s.ensureNotNull)(this._chart.paneByState(e)))._div.getBoundingClientRect().left+document.body.scrollLeft,i._correctXCoord(t-n)},e.prototype._externalPaneYCoord=function(e,t){var i,n,o=this._div.getBoundingClientRect(),r=o.left+document.body.scrollTop;return t+=r,n=(i=Object(s.ensureNotNull)(this._chart.paneByState(e)))._div.getBoundingClientRect().left+document.body.scrollTop,i._correctYCoord(t-n)},e.prototype._correctXCoord=function(e){return Math.max(0,Math.min(e,this._size.w-1))},e.prototype._correctYCoord=function(e){return Math.max(0,Math.min(e,this._size.h-1))},e.prototype._processScroll=function(e){var t,i,n;if(this._chart.model().model().scrollEnabled()){if(t=Date.now(),this._startScrollingPos||this._preventScroll()||(this._startScrollingPos={x:e.clientX,y:e.clientY,timestamp:t,localX:e.localX,localY:e.localY}),null!==this._scrollXAnimation&&this._scrollXAnimation.addPosition(e.localX,t),null!==this._scrollYAnimation&&this._scrollYAnimation.addPosition(e.localY,t),i=this._chartUndoModel(),n=this.state().defaultPriceScale(),
+this._startScrollingPos&&!this._isScrolling&&(this._startScrollingPos.x!==e.clientX||this._startScrollingPos.y!==e.clientY))return i.beginUndoMacro("scroll").setCustomFlag("doesnt_affect_save",!0),null===this._scrollXAnimation&&M&&(this._scrollXAnimation=new b(.2,3.2,-.0026,15),this._scrollXAnimation.addPosition(this._startScrollingPos.localX,this._startScrollingPos.timestamp),this._scrollXAnimation.addPosition(e.localX,t)),null===this._scrollYAnimation&&A&&M&&(this._scrollYAnimation=new b(.2,3.2,-.0026,15),this._scrollYAnimation.addPosition(this._startScrollingPos.localY,this._startScrollingPos.timestamp),this._scrollYAnimation.addPosition(e.localY,t)),i.selection().isEmpty()||(n=i.selection().sources()[0].priceScale()),null===n||n.isEmpty()||(this._scrollPriceScale=n,i.startScrollPrice(this.state(),n,e.localY)),i.startScrollTime(e.localX),this._isScrolling=!0,void this.setCursorForTool();this._isScrolling&&(null!==this._scrollPriceScale&&i.scrollPriceTo(this.state(),this._scrollPriceScale,e.localY),i.scrollTimeTo(e.localX))}},e.prototype._finishScroll=function(){var e=this._chartUndoModel();e.endScrollTime(),null!==this._scrollPriceScale&&e.endScrollPrice(this.state(),this._scrollPriceScale),e.endUndoMacro(),this._isScrolling=!1,this._startScrollingPos=null,this._scrollPriceScale=null,this.setCursorForTool()},e.prototype._endScroll=function(e){var t,i,n,o,r,s,a=this;if(!this._isScrolling)return!1;if(t=this._isScrolling&&this._scrollUndoCommandInStack(),this._isScrolling){if(i=Date.now(),null!==this._scrollXAnimation&&this._scrollXAnimation.start(e.localX,i),null!==this._scrollYAnimation&&this._scrollYAnimation.start(e.localY,i),n=this._chartUndoModel(),(null===this._scrollXAnimation||this._scrollXAnimation.finished(i))&&(null===this._scrollYAnimation||this._scrollYAnimation.finished(i)))return this._finishScroll(),t;o=this._scrollXAnimation,r=this._scrollYAnimation,s=function(){var e,t,i;(null!==o&&!o.terminated()||null!==r&&!r.terminated())&&(e=Date.now(),t=null===o||o.finished(e),i=null===r||r.finished(e),null===o||o.terminated()||n.scrollTimeTo(o.getPosition(e)),null===r||r.terminated()||null===a._scrollPriceScale||n.scrollPriceTo(a.state(),a._scrollPriceScale,r.getPosition(e)),t&&i?a._finishScroll():requestAnimationFrame(s))},requestAnimationFrame(s)}return t},e.prototype._terminateActiveAnimations=function(){var e=Date.now(),t=null===this._scrollXAnimation||this._scrollXAnimation.finished(e),i=null===this._scrollYAnimation||this._scrollYAnimation.finished(e);null===this._scrollXAnimation&&null===this._scrollYAnimation||t&&i||this._finishScroll(),null!==this._scrollXAnimation&&(this._scrollXAnimation.terminate(),this._scrollXAnimation=null),null!==this._scrollYAnimation&&(this._scrollYAnimation.terminate(),this._scrollYAnimation=null)},e.prototype._preventScroll=function(){return L&&this._longTap||this._contextMenuOpenedOnLastMouseDown||Object(_.isLineToolName)(f.tool.value())||Boolean(this._chartUndoModel().lineBeingCreated())||null!==this._startTrackPoint},e.prototype._isSelectBarModeEnabled=function(){
+return this._chartUndoModel().crossHairSource().selectBarMode().value()},e.prototype._updateByThemedColors=function(){null!==this._legendWidget&&this._legendWidget.updateThemedColors(this._themedColor),null!==this._paneControls&&this._paneControls.updateThemedColors(this._themedColor)},e.prototype._scrollUndoCommandInStack=function(){var e,t,i=this._chartUndoModel().undoHistory().undoStack();return!i.isEmpty()&&((e=i.head())instanceof m.a&&(!e.isEmpty()&&((t=e.commands()[0])instanceof x.PriceScaleChangeUndoCommand||t instanceof T.a)))},e.prototype._onStateDestroyed=function(){this.setState(null)},e.prototype._getHideNotMainSourcesValue=function(){return!this._chart.isActive()&&!this._chart.crossHairSyncEnabled()},e.prototype._onDataSourcesCollectionChanged=function(){null!==this._legendWidget&&this._legendWidget.updateLayout()},e.prototype._loadAndCreateLegendWidget=function(){var e=this;Promise.all([i.e(61),i.e("chart-widget-gui")]).then(i.bind(null,"sAH5")).then(function(t){var i,n,o;e._isDestroyed||(i=t.LegendWidget,(n=Object(h.deepExtend)({},e._options.legendWidget)).canShowSourceCode=!e._chart.onWidget(),n.readOnlyMode=n.readOnlyMode||e._chart.readOnly(),o=new P.a(e._getHideNotMainSourcesValue()),e._hideNotMainSourcesInLegendSpawn=Object(C.a)(function(){return{}},e._chart.chartWidgetCollection().activeChartWidget,e._chart.chartWidgetCollection().lock.crosshair),e._hideNotMainSourcesInLegendSpawn.subscribe(function(){o.setValue(e._getHideNotMainSourcesValue())}),e._legendWidget=new i(e._chartUndoModel(),e,e._chart.backgroundBasedTheme(),o,n,{showContextMenuForSelection:e.showContextMenuForSelection.bind(e),showContextMenuForSources:e.showContextMenuForSources.bind(e),updateActions:e._chart.updateActions.bind(e._chart),showChartPropertiesForSource:e._chart.showChartPropertiesForSource.bind(e._chart),showGeneralChartProperties:e._chart.showGeneralChartProperties.bind(e._chart),showObjectsTreeDialog:e._chart.showObjectsTreeDialog.bind(e._chart)}),e._div.appendChild(e._legendWidget.getElement()),e._legendWidget.updateLayout(),e._legendWidget.updateWidgetModeBySize(e._size),e._legendWidget.updateThemedColors(e._themedColor))})},e.prototype._loadAndCreatePaneControlsWidget=function(){var e=this;Promise.all([i.e(61),i.e("chart-widget-gui")]).then(i.bind(null,"lvAK")).then(function(t){if(!e._isDestroyed){var i=t.PaneControlsWidget;e._paneControls=new i(e._chartUndoModel(),e,{backgroundThemeName:e._chart.backgroundBasedTheme()},{toggleMaximizePane:e._chart.toggleMaximizePane.bind(e._chart)},e._div),e._paneControls.updateWidgetModeByWidth(e._size.w),e._paneControls.updateThemedColors(e._themedColor)}})},e}()},UJLt:function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),t.SaveRenameDialog=void 0,n=function(){function e(e,t){var i,n;for(i=0;i0&&void 0!==arguments[0]?arguments[0]:{},i=t.fields,n=t.confirm,o=t.manager,r=t.title,s=void 0===r?"":r,a=t.destroyOnClose,l=void 0===a||a,c=t.modal,u=void 0!==c&&c;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._form=document.createElement("div"),this._fields=i,this._appendFieldsToForm(),this._title=s,this._destroyOnClose=l,this._modal=u,this._manager=o,this._isConfirmDialogOpened=!1,n&&(this._needCheckConfirm=!0,this._shouldShowConfirm=n.shouldShowDialog,this._getConfirmMessage=n.getMessage)}return n(e,[{key:"setField",value:function(e,t){this._fields.find(function(t){return t.name===e}).value=t}},{key:"show",value:function(){var e=this,t=this._createDialog(),i=new Promise(function(i){t.then(function(t){t.on("action:submit",function(t){return e._onSubmit(t,i)}),t.open(),t.on("beforeClose",e._unmountFields.bind(e)),e._fields[a].select()})});return i}},{key:"_appendFieldsToForm",value:function(){var e=this;this._fields.forEach(function(t){t.appendTo(e._form)})}},{key:"_createDialog",value:function(){var e=this,t=470,n=13;return new Promise(function(o){Promise.all([i.e("dialogs-core"),i.e(19),i.e("create-dialog")]).then(function(r){var s=i("YDhE").createDialog;o(s({type:e._modal?"modal":"popup",title:e._title,content:$(e._form),actionsWrapTemplate:'',width:t,destroyOnClose:e._destroyOnClose,manager:e._manager,isClickOutFn:function(){if(e._isConfirmDialogOpened)return!1},actions:[{name:"submit",type:"primary",text:window.t("Save"),key:n,addClass:"js-submit-button"},{name:"cancel",type:"default",text:window.t("Cancel"),method:"close",addClass:"js-cancel-button"}]}))}.bind(null,i)).catch(i.oe)})}},{key:"_onSubmit",value:function(e,t){var i=this,n=this._validate();if(n)e.error(n.error),n.focus();else{if(!this._needCheckConfirm)return t(this._collectValues(),e),void e.close();Promise.resolve(this._shouldShowConfirm(this._collectValues())).then(function(n){if(!n)return t(i._collectValues(),e),void e.close();i._showConfirmDialog().then(function(n){n===s&&(e.focus(),i._fields[a].focus()),n===r&&(t(i._collectValues(),e),e.close())})})}}},{key:"_showConfirmDialog",value:function(){var e=this;return new Promise(function(t){Promise.resolve(e._getConfirmMessage(e._collectValues())).then(function(i){e._isConfirmDialogOpened=!0,(0,o.createConfirmDialog)({type:"modal",content:document.createTextNode(i),manager:e._manager}).then(function(i){i.on("action:yes",function(e){t(r),e.close()}),i.on("afterClose",function(){t(s),e._isConfirmDialogOpened=!1}),i.open()})})})}},{key:"_validate",value:function(){return this._fields.find(function(e){return!e.valid})}},{key:"_collectValues",value:function(){return this._fields.reduce(function(e,t){return e[t.name]=t.value,e},{})}},{key:"_unmountFields",value:function(){this._fields.forEach(function(e){e.unmount&&e.unmount()})}}]),e}()},ULlu:function(e,t,i){"use strict"
+;function n(e){return e[0]}function o(e,t,i){return"string"!=typeof t?e:void 0===i||null===i?(e.removeAttribute(t),e):(e.setAttribute(t,String(i)),e)}function r(e,t){return"string"==typeof t&&e.classList.add(t),e}function s(e,t){return void 0===t?e:(null===t&&(e.innerHTML=""),"string"!=typeof t&&"number"!=typeof t||(e.innerHTML=String(t)),e)}function a(e){var t=window.getComputedStyle(e);return[t.paddingLeft,t.paddingRight].reduce(function(e,t){return e-Number((t||"").replace("px",""))},e.clientWidth)}function l(e){var t=window.getComputedStyle(e);return[t.paddingTop,t.paddingBottom].reduce(function(e,t){return e-Number((t||"").replace("px",""))},e.clientHeight)}function c(e,t){var i;i=function(i){return i(e).trigger(t)},window.jQuery&&i(window.jQuery)}i.r(t),i.d(t,"unwrap",function(){return n}),i.d(t,"attr",function(){return o}),i.d(t,"addClass",function(){return r}),i.d(t,"html",function(){return s}),i.d(t,"contentWidth",function(){return a}),i.d(t,"contentHeight",function(){return l}),i.d(t,"trigger",function(){return c})},UlDV:function(e,t,i){"use strict";var n,o,r;i.r(t),i.d(t,"RestrictedToolsetBootloader",function(){return r}),n=i("mrSG"),o=i("cZRT"),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype._startLoading=function(){return Promise.all([i.e("react"),i.e(3),i.e(6),i.e(15),i.e(20),i.e(35),i.e(37),i.e(39),i.e(52),i.e(53),i.e(54),i.e(0),i.e(1),i.e(8),i.e(44),i.e("restricted-toolset")]).then(i.bind(null,"miV2")).then(function(e){return e.getRestrictedToolSet()})},t}(o.a)},UqOQ:function(e,t,i){"use strict";var n,o,r,s,a,l;i.d(t,"a",function(){return l}),n=i("mrSG"),o=i("Eyy1"),r=i("aIyQ"),s=i.n(r),a=i("0waE"),l=function(){function e(e,t,i){this._onChanged=new s.a,this._lineToolsSet=new Set,this._lineTools=Object(n.__spreadArrays)(e),this._lineToolsSet=new Set(this._lineTools),this._name=t,this.id=i||Object(a.randomHashN)(6)}return e.prototype.lineTools=function(){return this._lineTools},e.prototype.name=function(){return this._name},e.prototype.setName=function(e){var t=this;this._doAndFireOnChange(function(){t._name=e})},e.prototype.isActualSymbol=function(){return this._lineTools.length>0&&this._lineTools[0].isActualSymbol()},e.prototype.containsLineTool=function(e){return this._lineToolsSet.has(e)},e.prototype.addLineTools=function(e){var t=this;this._doAndFireOnChange(function(){var i;e.forEach(function(e){return t._lineToolsSet.add(e)}),(i=t._lineTools).push.apply(i,e)})},e.prototype.excludeLineTool=function(e){var t=this;this._doAndFireOnChange(function(){t._lineToolsSet.delete(e);var i=t._lineTools.indexOf(e);t._lineTools.splice(i,1)})},e.prototype.excludeLineTools=function(e){var t=this;this._doAndFireOnChange(function(){var i=new Set(e);e.forEach(function(e){return t._lineToolsSet.delete(e)}),t._lineTools=t._lineTools.filter(function(e){return!i.has(e)})})},e.prototype.state=function(){return{id:this.id,name:this._name,tools:this._lineTools.map(function(e){return e.id()})}},e.prototype.visibility=function(){
+var e=this._lineTools.some(function(e){return e.properties().visible.value()}),t=this._lineTools.some(function(e){return!e.properties().visible.value()});return e&&!t?"Visible":t&&!e?"Invisible":"Partial"},e.prototype.locked=function(){var e=this._lineTools.some(function(e){return e.properties().frozen.value()}),t=this._lineTools.some(function(e){return!e.properties().frozen.value()});return e&&!t?"Locked":t&&!e?"Unlocked":"Partial"},e.prototype.onChanged=function(){return this._onChanged},e.fromState=function(t,i){return new e(i.tools.map(function(e){return Object(o.ensureNotNull)(t.dataSourceForId(e))}),i.name,i.id)},e.prototype._doAndFireOnChange=function(e){var t,i=this.visibility(),n=this.locked();e(),t={visibilityChanged:this.visibility()!==i,lockedChanged:n!==this.locked()},this._onChanged.fire(t)},e}()},UxRM:function(e,t,i){"use strict";function n(e){this.items=e.items,this.barSpacing=e.barSpacing,this.lineColor=e.lineColor,this.lineWidth=e.lineWidth,this.lineStyle=e.lineStyle}var o=i("aO4+").Point,r=i("GEp6").distanceToSegment,s=i("Zp/P").selectionTolerance,a=i("VdBB").HitTestResult;n.prototype.draw=function(e){var t,i,n,o,r,s,a,l,c=!1;for(n=0;n
e.price?1:-1,e.price=this.screenPointToPoint({x:n.x,y:o.y+l}).price},n.prototype.addPoint=function(e,t,i){var n=s.prototype.addPoint.call(this,e,t,i);return n&&(this._fakePointAdded=!1),n},n.prototype.setPoint=function(e,t,i){var n,s,a,l,c=Object.assign({},t),u=this.pointToScreenPoint(this._points[0])[0],h=this.pointToScreenPoint(this._points[1])[0],d=this.pointToScreenPoint(this._points[2])[0];switch(e){case 0:if(i&&i.shift()){this._snapPoint45Degree(c,this._points[1]),this._points[0]=c,this._points[2]=this._preparePointInternal(this._points[2],i,!0),this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[0],this._points[1],this._points[2]);break}u=this.pointToScreenPoint(c)[0],n=h.subtract(u),s=u.add(h).scaled(.5),a=(a=new o(-n.y,n.x)).normalized(),d=s.add(a.scaled(this._dist)),d=this.screenPointToPoint(d),this._points[0]=c,this._points[2]=d;break;case 1:if(i&&i.shift()){this._snapPoint45Degree(c,this._points[0]),this._points[1]=c,this._points[2]=this._preparePointInternal(this._points[2],i,!0),this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[1],this._points[0],this._points[2]);break}n=(h=this.pointToScreenPoint(c)[0]).subtract(u),s=u.add(h).scaled(.5),a=(a=new o(-n.y,n.x)).normalized(),d=s.add(a.scaled(this._dist)),d=this.screenPointToPoint(d),this._points[1]=c,this._points[2]=d;break;case 2:case 3:c=this.pointToScreenPoint(c)[0],l=r(u,h,c).distance,n=h.subtract(u),s=u.add(h).scaled(.5),a=(a=new o(-n.y,n.x)).normalized(),d=s.add(a.scaled(l)),d=this.screenPointToPoint(d),this._points[2]=d}this.normalizePoints()},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return c},n.prototype.name=function(){return"Ellipse"},n.prototype.hasEditableCoordinates=function(){return!1},n.version=2,n.prototype.migrateVersion=function(e,t,i){var n,o,r;1===e&&2===this._points.length&&(n=this._points[0].price,o=.5*(this._points[0].price+this._points[1].price),this._points[0]={price:o,index:this._points[0].index},this._points[1]={price:o,index:this._points[1].index},this._points.push({price:n,index:this._points[0].index})),1===e&&2===this._timePoint.length&&(n=this._timePoint[0].price,o=.5*(this._timePoint[0].price+this._timePoint[1].price),this._timePoint[0].price=o,this._timePoint[1].price=o,r={price:n,
+offset:this._timePoint[0].offset,time_t:this._timePoint[0].time_t},this._timePoint.push(r))},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return l.LineToolEllipseStylesPropertyPage},n.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(13),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("Zd1D").GeneralFiguresDefinitionsViewModel}.bind(null,i)).catch(i.oe)},n.createProperties=function(e){var t=new a("linetoolellipse",e);return n._configureProperties(t),t},n._configureProperties=function(e){s._configureProperties(e)},t.LineToolEllipse=n},V0al:function(e,t,i){"use strict";var n,o,r;i.r(t),i.d(t,"PaneRendererXCross",function(){return r}),n=i("mrSG"),o=i("2WC2"),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype._drawItemShape=function(e,t){var i=t.width,n=t.height,o=t.x-i/2,r=t.vertOffset,s=t.y-n/2+r;e.moveTo(o,s),e.lineTo(o+i,s+n),e.moveTo(o,s+n),e.lineTo(o+i,s)},t}(o.c)},V0dR:function(e,t,i){"use strict";var n,o,r,s,a,l,c,u;i.r(t),i.d(t,"PaneRendererLabelBase",function(){return l}),i.d(t,"PaneRendererLabelUp",function(){return c}),i.d(t,"PaneRendererLabelDown",function(){return u}),n=i("mrSG"),o=i("aO4+"),r=i("VdBB"),s=i("2WC2"),a=2,l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype.setData=function(e,t){var i,n,o,r,s,a,l,c,u,h;for(this._setBaseData(e,t),i=this._isUp(),n=0,o=this._items;n0?r.stepY+a:-r.stepY-a):(r.shapeWidth=2*r.stepX,r.shapeHeight=2.5*r.stepY)},t.prototype.hitTest=function(e){var t,i,n,s,a,l,c,u,h,d,p,_,f,m,y,g,v,S,b=this._isUp(),w=b?1:-1;for(t=0,i=this._items;tg&&mv&&y=3*a)&&f>=1.5*a,s=o&&f-v>=1.5*a,l=f,c=S*_,u=f,h=m*_,d=_*a,e.translate(i,n),e.moveTo(0,0),e.lineTo(v,c),s?(e.lineTo(l-a,c),e.arcTo(l,c,u,h,a)):e.lineTo(l,c),r?(e.lineTo(u,h-d),e.arcTo(u,h,-u,h,a),e.lineTo(-u+a,h),e.arcTo(-u,h,-l,c,a)):(e.lineTo(u,h),e.lineTo(-u,h)),s?(e.lineTo(-l,c+d),e.arcTo(-l,c,l,c,a)):e.lineTo(-l,c),
+e.lineTo(-v,c),e.lineTo(0,0),e.translate(-i,-n)},t}(s.a),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype._isUp=function(){return!0},t}(l),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype._isUp=function(){return!1},t}(l)},V3Oj:function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolText";var o=t||n.createProperties();r.call(this,e,o),this._timeScale=e.timeScale(),this._barSpacing=e.timeScale().barSpacing(),i.e("lt-pane-views").then(function(e){var t=i("mr3a").TextPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function o(e,t){var i=t||o.createProperties();n.call(this,e,i)}var r=i("Ss5c").LineDataSource,s=i("fgLi").DataSource,a=i("tc+8"),l=i("Ocx9").DefaultProperty,c=i("hayr").propertyPages,u=window.t("Text",{context:"tool"});inherit(n,r),n.MIN_WIDTH=100,n.prototype.setPoint=function(e,t){var i,o,r=this.properties();if(0===e&&r.wordWrapWidth&&r.wordWrapWidth.value()){if(i=this.isFixed()?this.fixedPoints()[0].x:this._timeScale.indexToCoordinate(this.points()[0].index),o=this._timeScale.indexToCoordinate(t.index)-i-~~(r.fontsize.value()/6),!isFinite(o))return;r.wordWrapWidth.setValue(Math.max(n.MIN_WIDTH,o))}},n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return u},n.prototype.name=function(){return"Text"},n.prototype.setPriceScale=function(e){s.prototype.setPriceScale.call(this,e),e&&e.priceRange()&&(this._priceDencity=e.height()/e.priceRange().length(),this._isPriceDencityLog=e.isLog())},n.prototype.restoreSize=function(){this._barSpacing=this._model.timeScale().barSpacing(),this._priceDencity=this.priceScale().height()/this.priceScale().priceRange().length(),this.updateAllViews(),this._model.updateSource(this)},n.prototype.template=function(){var e=r.prototype.template.call(this);return e.text=this.properties().childs().text.value(),e},n.prototype._applyTemplateImpl=function(e){r.prototype._applyTemplateImpl.call(this,e),this.properties().childs().text.setValue(e.text)},n.createProperties=function(e){var t=new l("linetooltext",e);return n._configureProperties(t),t},n._configureProperties=function(e){r._configureProperties(e),e.hasChild("text")||e.addChild("text",new a(window.t("Text"))),e.addExclusion("text")},inherit(o,n),o.prototype.title=function(){return window.t("Anchored Text")},o.prototype.name=function(){return"Anchored Text"},n.prototype.hasEditableCoordinates=function(){return!1},o.prototype.isFixed=function(){return!0},o.createProperties=function(e){var t=new l("linetooltextabsolute",e);return o._configureProperties(t),t},o._configureProperties=function(e){n._configureProperties(e)},n.prototype.state=function(e){var t=r.prototype.state.call(this,e);return e&&(t.state.fixedSize=!1),t},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return c.LineToolTextStylesPropertyPage},
+n.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(13),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("QWxu").TextDefinitionsViewModel}.bind(null,i)).catch(i.oe)},t.LineToolText=n,t.LineToolTextAbsolute=o},VNzU:function(e,t,i){"use strict";function n(e){return"s"===e}function o(e){return!n(e)}var r,s,a,l;i.r(t),r=i("mrSG"),i("Dq3s"),i.d(t,"layouts",function(){return l}),i.d(t,"isSingleLayout",function(){return n}),i.d(t,"isMultipleLayout",function(){return o}),s={s:{title:"1 chart",count:1,sizer:function(e,t){if(0!==t)throw new RangeError("invalid index");return e}}},a={},l=Object(r.__assign)(Object(r.__assign)({},s),a)},VVxS:function(e,t,i){"use strict";var n,o=function(){try{this.isAvailable=!0,this.localStorage=window.localStorage,this.localStorage.setItem("tvlocalstorage.available","true")}catch(e){delete this.isAvailable,delete this.localStorage}this._updateLength()};o.prototype.length=0,o.prototype.isAvailable=!1,o.prototype.localStorage={"tvlocalstorage.available":"false"},o.prototype._updateLength=function(){var e,t;if(this.isAvailable)this.length=this.localStorage.length;else{for(t in e=0,this.localStorage)this.localStorage.hasOwnProperty(t)&&e++;this.length=e}},o.prototype.key=function(e){return this.isAvailable?this.localStorage.key(e):Object.keys(this.localStorage)[e]},o.prototype.getItem=function(e){return this.isAvailable?this.localStorage.getItem(e):void 0===this.localStorage[e]?null:this.localStorage[e]},o.prototype.setItem=function(e,t){this.isAvailable?this.localStorage.setItem(e,t):this.localStorage[e]=t,this._updateLength()},o.prototype.removeItem=function(e){this.isAvailable?this.localStorage.removeItem(e):delete this.localStorage[e],this._updateLength()},o.prototype.clear=function(){this.isAvailable?this.localStorage.clear():this.localStorage={},this._updateLength()},(n=function(e){this.storage=e}).prototype.getItem=function(e){return Promise.resolve(this.storage.getItem(e))},n.prototype.setItem=function(e,t){return Promise.resolve(this.storage.setItem(e,t))},window.TVLocalStorage=new o,window.TVLocalStorageAsync=new n(window.TVLocalStorage),e.exports={TVLocalStorage:window.TVLocalStorage,TVLocalStorageAsync:window.TVLocalStorageAsync}},VdBB:function(e,t,i){"use strict";i.r(t),i.d(t,"HitTestResult",function(){return n});var n=function(){function e(e,t,i){this._result=e,this._data=t,this._eraseMarker=i}return e.prototype.result=function(){return this._result},e.prototype.data=function(){return this._data},e.prototype.eraseMarker=function(){return this._eraseMarker},e.MOVEPOINT_BACKGROUND=1,e.REGULAR=2,e.MOVEPOINT=3,e.CHANGEPOINT=4,e.CUSTOM=5,e.CUSTOM_MOVE=6,e}()},Vdly:function(e,t,i){"use strict";(function(e,t){var n,o,r,s,a,l;i("qFKp"),n=i("dTSQ").regExpEscape,o=i("FBuY").TVXWindowEvents,r=i("VVxS").TVLocalStorage,s=i("aIyQ"),i("brCa").showNoticeDialog,a=["s.tradingview.com","betacdn.tradingview.com"],l=window.TVSettings=function(){function t(e){return w+"."+e}function i(e,t){var i;return i=P[e],
+window.is_authenticated&&!A||null!=i||(i=P[e]),null==i?t:i}function c(e,t,i){i=i||{};var n=""+t;return P[e]!==n&&(P[e]=n,d(e)),i.forceFlush&&!x&&(x=setTimeout(function(){x=void 0,p()},b)),l}function u(e,t){return t=t||{},null!=P[e]&&(delete P[e],d(e)),t.forceFlush&&p(),l}function h(){T=void 0,C.length&&p()}function d(e){if(k)null==P[e]?k.removeValue(e):k.setValue(e,P[e]);else if(!window.is_authenticated||A)try{null==P[e]?r.removeItem(t(e)):r.setItem(t(e),P[e])}catch(e){}else C.push(e),T||(T=setTimeout(h,S));o.emit("settings",JSON.stringify({key:e,value:P[e]}))}function p(t){e.enabled("widget")||window.is_authenticated&&!A&&C.length}function _(){return Object.keys(P)}function f(e){for(var t=0;t=0;i--)e.test(o[i])&&r.push(o[i]),e.lastIndex=0;return r},sync:function(t){k?m(k.initialSettings||{}):window.is_authenticated&&!A?m(t||{}):(function(){var e,t,i,n;if(TradingView.onWidget()&&a.includes(window.location.host))for(e="tradingview.",t=r.length;t--;)0===(i=r.key(t)).indexOf(e)&&(n=i.replace(e,w+"."),r.setItem(n,r.getItem(i)),r.removeItem(i))}(),function(){var t,i,n,o,s;for(P={},t=w+".",i=!e.enabled("save_chart_properties_to_local_storage"),n=r.length;n--;)(o=r.key(n))&&o.substring(0,t.length)===t&&(s=o.substring(t.length),i&&!f(s)||(P[s]=r.getItem(o)))}()),L.fire()},onSync:L,setSettingsAdapter:function(e){k=e}})}(),t&&t.exports&&(t.exports=l)}).call(this,i("Kxc7"),i("YuTi")(e))},VfPj:function(e,t,i){"use strict";function n(e){this._items=e.items,this._y=e.y,this._h=e.h,this._w=e.w}n.prototype.draw=function(e){},n.prototype.drawBackground=function(e){var t,i,n;for(e.save(),e.translate(-.5,-.5),t=0;t0?this._logMessage("Bars to return for request {0}: total {1} bars in [{2} ... {3}] ".format(e.key,s.count(),o(s.bars[0].time),o(s.bars[s.count()-1].time))):this._logMessage("Request {0}. Nothing to return.".format(e.key)),t.barset=s,(i=this._inGapNextTime(r.from))?(this._logMessage("Request {0} is in gap, nextTime = {1}".format(e.key,o(1e3*i))),s.nextTime=i):0===s.count()&&(n=this._cache.bars.length&&this._cache.bars[this._cache.bars.length-1].time/1e3)&&r.from>n&&(this._logMessage("Request {0} is in gap, nextTime = {1}".format(e.key,o(1e3*n))),s.nextTime=n||void 0),this._endOfData&&null!==this._leftDate&&e.range.from<=this._leftDate&&(s.endOfData=!0),e.onHistoryCallback(s)},e.prototype._createBarset=function(e){var t=Object(l.lowerbound)(this._cache.bars,1e3*e,function(e,t){return e.time0?(this._emptyResponsesCount=0,this._processFullBarset(e,t)):(this._emptyResponsesCount+=1,this._processEmptyBarset(t)),this._processPendingSubscribers()},
+e.prototype._processEmptyBarset=function(t){this._logMessage("Receiving bars: barset is empty"),t&&t.nextTime?(this._logMessage("Next time received: `{0}`".format(o(1e3*t.nextTime))),this._addGap(t.nextTime),this._leftDate=Math.min(this._leftDate||e._now()/1e3,t.nextTime+1)):t&&t.noData?(this._logMessage("EOD received"),this._setEndOfData()):this._logMessage("nextTime or noData should present in metainfo when empty barset is returned"),50===this._emptyResponsesCount&&(this._logMessage("EOD detected due 50 empty responses in a row"),this._setEndOfData())},e.prototype._setEndOfData=function(){this._endOfData=!0,this._cache.bars.length&&(this._leftDate=this._cache.bars[0].time/1e3)},e.prototype._processFullBarset=function(e,t){var i=e[0].time,n=e[e.length-1].time;this._logMessage("Receiving bars: total {0} bars in [{1} ... {2}] ".format(e.length,o(i),o(n))),null!==this._leftDate&&i<1e3*this._leftDate&&this._logMessage("Returned more data than needed"),this._putToCache(e)?null!==this._leftDate&&this._cache.bars.length&&this._leftDate>this._cache.bars[0].time/1e3&&(this._leftDate=this._cache.bars[0].time/1e3):this._logMessage("Incremental update failed. Starting full update. Returned data should be in the requested range.",!0),t&&t.nextTime?console.warn("nextTime should be set when there is no data in the requested period only"):t&&t.noData&&console.warn("noData should be set when there is no data in the requested period and earlier only")},e.prototype._addGap=function(t){var i,n=this._gaps.find(function(e){return e.from===t});n||(i=(this._cache.bars.length?this._cache.bars[0].time:e._now())/1e3,this._gaps.push({from:t,to:i}))},e.prototype._inGapNextTime=function(e){var t=this._gaps.find(function(t){return t.frome});return t?t.from:null},e.prototype._getNextSubscriptionId=function(){return this._nextSubscriptionId++},e.prototype._checkBars=function(e,t){var i,n;if(void 0===t&&(t=!1),u.enabled("charting_library_debug_mode"))for(i=1;i=this._cache.bars[0].time){var t=this._cache.bars[this._cache.bars.length-1].time===e[e.length-1].time;if(this._cache.bars=[],!t)return this._leftDate=null,!1;this._logMessage("Received history up to now instead of incremental update. Return exactly what is requested.")}return this._cache.bars=Object(r.__spreadArrays)(e,this._cache.bars),
+this._checkBars(this._cache.bars,!0),!0},e.prototype._putToCacheNewBar=function(e){var t=this._cache.bars.length,i=e.time,n=0===t?NaN:this._cache.bars[t-1].time,r=0===t||n=0&&!function(){try{
+return/^(192|172|10)\.[0-9][0-9][0-9]\.[0-9][0-9][0-9]\.[0-9][0-9][0-9]/.test(location.hostname)||/^.*((?:\.local)|localhost)$/.test(location.hostname)}catch(e){return!1}}()&&setTimeout(function(){try{var e=function(){var e=0,t=JSON.parse(urlParams.logo);return t.image&&(e="C",n.enabled("link_to_tradingview")||(e="D")),e}();window.ga&&(0!==e&&window.ga("send","event","s",e),urlParams.utm||window.ga("send","event","l"))}catch(e){}},3e4)}},Wh6B:function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPrediction";var o=t||n.createProperties();r.call(this,e,o),i.e("lt-pane-views").then(function(e){var t=i("Ay2m").PredictionPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i("Eyy1").ensureNotNull,r=i("Ss5c").LineDataSource,s=i("Ocx9").DefaultProperty,a=i("hayr").propertyPages,l=i("08i5"),c=window.t("Forecast");inherit(n,r),n.prototype.status=function(){return this._properties.status.value()},n.prototype.setStatus=function(e){return this._properties.status.setValue(e)},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return c},n.prototype.name=function(){return"Forecast"},n.prototype.restorePoints=function(e,t,i){r.prototype.restorePoints.call(this,e,t,i),this.checkAlert()},n.prototype.checkAlert=function(){var e,t,i,n;this._points.length<2||this._model.mainSeries().bars().isEmpty()||(e=this._points[1],this.status()?e.index>this._model.timeScale().baseIndex()&&this.setStatus(l.AlertStatus.Waiting):null!==(t=this._model.mainSeries().bars().valueAt(e.index))&&((i=this.direction())===l.Direction.Up&&t[TradingView.HIGH_PLOT]>=e.price?this.setStatus(l.AlertStatus.Success):i===l.Direction.Down&&t[TradingView.LOW_PLOT]<=e.price?this.setStatus(l.AlertStatus.Success):(n=o(this._model.mainSeries().bars().lastIndex()),e.index!==n&&this.setStatus(l.AlertStatus.Failure))))},n.prototype.addPoint=function(e){var t=r.prototype.addPoint.call(this,e);return t&&this.checkAlert(),t},n.prototype.endChanging=function(){r.prototype.endChanging.call(this),this.setStatus(l.AlertStatus.Waiting),this.checkAlert()},n.prototype.onData=function(e){r.prototype.onData.call(this,e),this.checkAlert()},n.prototype.endMoving=function(){r.prototype.endMoving.call(this),this.setStatus(l.AlertStatus.Waiting),this.checkAlert()},n.prototype.direction=function(){var e;return this.points().length<2?l.Direction.Up:(e=this.points()[0],this.points()[1].price>e.price?l.Direction.Up:l.Direction.Down)},n.prototype.getStylesPropertyPage=function(){return a.LineToolPredictionStylesPropertyPage},n.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(13),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("Pwwq").PredictionDefinitionsViewModel}.bind(null,i)).catch(i.oe)},n.prototype.cloneable=function(){return!1},n.createProperties=function(e){var t=new s("linetoolprediction",e);return n._configureProperties(t),t},n._configureProperties=function(e){r._configureProperties(e),e.merge({status:l.AlertStatus.Waiting})},t.LineToolPrediction=n},
+WkOR:function(e,t,i){"use strict";function n(e,t){return void 0===e?void 0===t:void 0!==t&&(s?e.toUpperCase()===t.toUpperCase():e===t)}function o(e,t){return e.some(function(e){return n(t,e)})}var r,s;i.r(t),i.d(t,"areEqualSymbols",function(){return n}),i.d(t,"includesEqualSymbol",function(){return o}),r=i("Kxc7"),s=r.enabled("uppercase_instrument_names")},WkYF:function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolDateRange";var r=t||n.createProperties();o.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("3xLB").DateRangePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,s=i("hayr").propertyPages,a=window.t("Date Range");inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return a},n.prototype.name=function(){return"Date Range"},n.prototype.getStylesPropertyPage=function(){return s.LineToolDateRangeStylesPropertyPage},n.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(13),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("Ax76").GeneralDatePriceRangeDefinitionsViewModel}.bind(null,i)).catch(i.oe)},n.createProperties=function(e){var t=new r("linetooldaterange",e);return n._configureProperties(t),t},n._configureProperties=function(e){o._configureProperties(e)},t.LineToolDateRange=n},WmDe:function(e,t,i){"use strict";TradingView.PublishedChartsTimeline=function(){},TradingView.LinearRegressionPaneView=function(){},TradingView.study_PivotPointsStandard=function(){},TradingView.study_PivotPointsHighLow=function(){},TradingView.study_ZigZag=function(){},TradingView.study_LinearRegression=function(){},TradingView.study_ElliottWave=function(){},TradingView.ESDStudyBase=function(){},TradingView.Pro=function(){this.hasPackage=function(){return!1}},window.user={is_pro:!1,settings:{}},TradingView.Pro.prototype.isPaidPro=function(){return!1},TradingView.Pro.prototype.hasActivePackages=function(){return!1},TradingView.Pro.prototype.isSupportAvailable=function(){return!1},TradingView.Pro.prototype.getStudies=function(){return[]},TradingView.Pro.prototype.getProduct=function(){return{}},TradingView.Pro.prototype.getStudiesOrder=function(){return[]},TradingView.AlertLabel=function(){},TradingView.getDataVendorString=function(){},TradingView.study_VbPVisible=function(){},TradingView.study_VbPSessions=function(){},TradingView.study_ESD$TV_DIVIDENDS=function(){},TradingView.study_ESD$TV_SPLITS=function(){},TradingView.study_ESD$TV_EARNINGS=function(){},TradingView.MockupRequestedCache=function(e){e&&e([])},TradingView.MockupRequestedCache.invalidate=function(){},TradingView.LinetoolTemplatesList=function(){}},Wo0S:function(e,t,i){e.exports={"common-tooltip":"common-tooltip-s2GEoMlT","common-tooltip--hidden":"common-tooltip--hidden-Z0EAvXgv","common-tooltip--horizontal":"common-tooltip--horizontal-13imOC5w","common-tooltip--farther":"common-tooltip--farther-2yXMAkHF",
+"common-tooltip--vertical":"common-tooltip--vertical-mcRoucek","common-tooltip-farther":"common-tooltip-farther-XoKytD99","common-tooltip--no-pointer-events":"common-tooltip--no-pointer-events-3nL0Vygu","common-tooltip--direction_normal":"common-tooltip--direction_normal-3u9ejKM2","common-tooltip__body":"common-tooltip__body-356XFpBj","common-tooltip__button-container":"common-tooltip__button-container-3EjyKV3s","common-tooltip__body--no-buttons":"common-tooltip__body--no-buttons-3quqi1Sv","common-tooltip__button":"common-tooltip__button-1rnQgujz","common-tooltip--direction_reversed":"common-tooltip--direction_reversed-XN-JUTdr","common-tooltip__ear-holder":"common-tooltip__ear-holder-yIJjpvgu","common-tooltip__ear-holder--below":"common-tooltip__ear-holder--below-1rmzWejA","common-tooltip__ear-holder--above":"common-tooltip__ear-holder--above-1D8FkNkw","common-tooltip__ear-holder--before":"common-tooltip__ear-holder--before-oXq5sFXr","common-tooltip__ear-holder--after":"common-tooltip__ear-holder--after-BnAcuW1N","common-tooltip__body--with-hotkey":"common-tooltip__body--with-hotkey-2wXRtgYZ","common-tooltip__body--width_wide":"common-tooltip__body--width_wide-3oG604Li","common-tooltip__body--width_narrow":"common-tooltip__body--width_narrow-34hrFTFo","common-tooltip__body--no-padding":"common-tooltip__body--no-padding-2vVe6Xco","common-tooltip__hotkey-block":"common-tooltip__hotkey-block-2gS_uAOl","common-tooltip__hotkey-block--divider":"common-tooltip__hotkey-block--divider-rQ38KmpQ","common-tooltip__hotkey-text":"common-tooltip__hotkey-text-1eb7dyCg","common-tooltip__hotkey-button":"common-tooltip__hotkey-button-1XJ40e4D","common-tooltip__plus-sign":"common-tooltip__plus-sign-3CKSupKp"}},Wt0y:function(e,t,i){"use strict";function n(e){var t;return void 0===e&&(e=location.host),t=["d33t3vvu2t2yu5.cloudfront.net","dwq4do82y8xi7.cloudfront.net","s.tradingview.com","s3.tradingview.com"],-1!==["i18n.tradingview.com","partial.tradingview.com","www.tradingview.com","wwwcn.tradingview.com"].indexOf(e)||-1!==t.indexOf(e)||e.match(/^[a-z]{2}\.tradingview\.com/)||e.match(/prod-[^.]+.tradingview.com/)?"battle":-1!==e.indexOf("tradingview.com")?"staging":e.match(/webcharts/)?"staging_local":(e.match(/^localhost(:\d+)?$/),"local")}function o(){return"local"===n()}function r(){return"battle"===n()}function s(){return!r()}i.r(t),i.d(t,"environment",function(){return n}),i.d(t,"isLocal",function(){return o}),i.d(t,"isProd",function(){return r}),i.d(t,"isDebug",function(){return s})},XAms:function(e,t,i){"use strict";function n(e){e.preventDefault()}function o(e){var t=e.target;t&&!t.closest(r.join(", "))&&e.preventDefault()}i.d(t,"a",function(){return n}),i.d(t,"b",function(){return o});var r=["input:not([type])",'input[type="text"]','input[type="email"]','input[type="password"]','input[type="search"]','input[type="number"]','input[type="url"]',"textarea","a[href]",'*[contenteditable="true"]']},XFad:function(e,t,i){"use strict";function n(e,t){var i=t||n.createProperties();r.call(this,e,i),
+this._constructor="LineToolSchiffPitchfork2"}var o=i("5rJj"),r=i("aDyP").LineToolPitchfork,s=window.t("Schiff Pitchfork");inherit(n,r),n.prototype.title=function(){return s},n.prototype.name=function(){return"Schiff Pitchfork"},n.createProperties=function(e){var t=new o("linetoolschiffpitchfork2",e,!1,{range:[0,8]});return n._configureProperties(t),t},n._configureProperties=function(e){r._configureProperties(e)},t.LineToolSchiffPitchfork2=n},XPit:function(e,t,i){"use strict";function n(){var e=new Map;return c.forEach(function(t,i){e.set(t,o(t))}),e}function o(e){return l[e]}var r,s,a,l,c,u;i.r(t),i.d(t,"TimePointIndexSearchMode",function(){return a}),i.d(t,"seriesPlotFunctionMap",function(){return n}),i.d(t,"barFunction",function(){return o}),i.d(t,"SeriesData",function(){return u}),r=i("Eyy1"),s=i("k9/m"),function(e){e[e.FromLeft=-1]="FromLeft",e[e.FromRight=1]="FromRight"}(a||(a={})),l={open:function(e){return e[1]},high:function(e){return e[2]},low:function(e){return e[3]},close:function(e){return e[4]},hl2:function(e){return(e[2]+e[3])/2},hlc3:function(e){return(e[2]+e[3]+e[4])/3},ohlc4:function(e){return(e[1]+e[2]+e[3]+e[4])/4}},c=["open","high","low","close","hl2","hlc3","ohlc4"],u=function(){function e(){this.m_bars=new s.PlotList(n()),this.m_nsBars=new s.PlotList(n())}return e.prototype.bars=function(){return this.m_bars},e.prototype.nsBars=function(){return this.m_nsBars},e.prototype.size=function(){return this.m_bars.size()+this.m_nsBars.size()},e.prototype.each=function(e){this.m_bars.each(e),this.m_nsBars.each(e)},e.prototype.clear=function(){this.m_bars.clear(),this.m_nsBars.clear(),this.lastProjectionPrice=void 0},e.prototype.isEmpty=function(){return this.m_bars.isEmpty()&&this.m_nsBars.isEmpty()},e.prototype.first=function(){return this.m_bars.isEmpty()?this.m_nsBars.first():this.m_bars.first()},e.prototype.last=function(){return this.m_nsBars.isEmpty()?this.m_bars.last():this.m_nsBars.last()},e.prototype.search=function(e,t){return this.nsBars().isEmpty()?this.bars().search(e,t):this.bars().isEmpty()?this.nsBars().search(e,t):Object(r.ensureNotNull)(this.nsBars().firstIndex())<=e?this.nsBars().search(e,t):this.bars().search(e,t)},e.prototype.valueAt=function(e){var t=this.search(e);return null!==t?t.value:null},e.prototype.plotValueToTimePointIndex=function(e,t,i){var n,o,r,s;if(i===a.FromRight)return n=function(i,n){var o=n[t];return void 0!==o&&null!==o&&e>=o},null!==(o=this.m_bars.findLast(n))?o.index:null!==(r=this.m_nsBars.findLast(n))?r.index:this.m_bars.firstIndex();if(i===a.FromLeft)return s=function(i,n){var o=n[t];return void 0!==o&&null!==o&&e<=o},null!==(o=this.m_bars.findFirst(s))?o.index:null!==(r=this.m_nsBars.findFirst(s))?r.index:this.m_bars.lastIndex();throw new Error("plotValueToTimePointIndex: unsupported search mode")},e}()},XUCF:function(e,t,i){"use strict";function n(e,t,i){this._source=e,this._index=t,this._bars=i||[]}function o(e,t,n){var r,a;this._constructor="LineToolGhostFeed",(r=t||o.createProperties())._source=this,n||(a=Math.round(this.calculateATR(e)),
+r.averageHL.setValue(a)),s.call(this,e,r),this._segments=[],r.averageHL.listeners().subscribe(this,o.prototype.regenerate),r.variance.listeners().subscribe(this,o.prototype.regenerate),r.points||r.addProperty("points"),this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value(),this._currentInterval=e.mainSeries().interval(),this.properties().onRestoreFactoryDefaults().subscribe(this,this._handleRestoringFactoryDefaults),i.e("lt-pane-views").then(function(e){var t=i("dMkl").GhostFeedPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i("Hr11").sign,s=i("Ss5c").LineDataSource,a=i("Ocx9").DefaultProperty,l=i("hayr").propertyPages,c=window.t("Ghost Feed");n.prototype.setBars=function(e){this._bars=e||[]},n.prototype.clone=function(e){return new n(e,this._index,TradingView.clone(this._bars))},n.prototype.createBar=function(){var e,t,i,n=this._source.properties().averageHL.value(),o=this._source.properties().variance.value()/100,r=this._source._model.mainSeries().base(),s=Math.random(),a=n*(1-2*s)*o;return i=(t=a-(e=n*(1+(.5-(s=Math.random()))*o))/2)+e,{o:(t+Math.random()*e)/r,h:i/r,l:t/r,c:(t+Math.random()*e)/r}},n.prototype.generate=function(){var e,t,i,n,o,s;if(this._bars=[],t=(e=this._source.points())[this._index],i=e[this._index+1],t&&i&&t.index!==i.index)for(this._avgHL=this._source.properties().averageHL.value(),this._variance=this._source.properties().variance.value()/100,n=this._index?t.index+1:t.index,o=r(i.index-t.index),s=n;s!==i.index;s+=o)this._bars.push(this.createBar())},n.prototype.bars=function(){return this._bars},n.prototype.setSize=function(e){if(e0&&this._points[this._points.length-1].index===e.index){for(this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),t=0;t1&&this.generateBars(this._points.length-2),i||this._finished},o.prototype.finish=function(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()},o.prototype.setPoint=function(e,t,i){var n,o;s.prototype.setPoint.call(this,e,t,i),e>0&&(n=this.points()[e-1],o=t.index-n.index,this._segments[e-1].setSize(Math.abs(o))),e>1)],t)?(n=a+1,r-=s+1):r=s;return n}function r(e,t,i,r){return void 0===i&&(i=0),void 0===r&&(r=e.length),o(e,t,n,i,r)}function s(e,t,i,n,o){var r,s,a;for(void 0===n&&(n=0),void 0===o&&(o=e.length),r=o-n;0>1)])?r=s:(n=a+1,r-=s+1);return n}function a(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=e.length),s(e,t,n,i,o)}function l(e,t){return e.filter(function(e){return!t.includes(e)})}function c(e,t){var i=e.indexOf(t);return i<0?e.slice():[t].concat(e.slice(0,i)).concat(e.slice(i+1))}function u(e,t,i){var n=new Set(t),o=[],s=[];return e.forEach(function(e,t){n.has(e)||(o.push(e),s.push(t))}),it?1:0}),e}(),n.prototype._alignPriceOnPattern=function(e,t){var i,n,r,s,a,l,c=Math.round(1e6*(e.price-t.price))/1e6;if(0===c)return t.price;for(i=o[0],n=o[o.length-1],r=1,s=Math.abs(c);s=0&&!(o[l]*r=0?a:-a),e},n.prototype._alignTimeOnPattern=function(e,t){var i,n=e.index-t.index;if(0===n)return 0;for(i=r.length-2;i>=0&&!(r[i]0?1:0,e.index=t.index+r[i],e},n.prototype._alignPointsFixedIncrement=function(e,t){return this._alignTimeOnPattern(e,t),this._alignPriceOnPattern(e,t),e},n.prototype._preparePoint=function(e,t){return t&&t.shift()&&0!==this._points.length&&this._alignPointsFixedIncrement(e,this._points[0]),s.prototype._preparePoint.call(this,e,t)},n.prototype.setPoint=function(e,t,i){if(i&&i.shift()){var n=0===e?this._points[1]:this._points[0];this._alignPointsFixedIncrement(t,n)}s.prototype.setPoint.call(this,e,t,i)},n.prototype.getStylesPropertyPage=function(){return l.LineToolGannSquareStylesPropertyPage},n.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(13),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("2liL").GannSquareDefinitionsViewModel}.bind(null,i)).catch(i.oe)},n.createProperties=function(e){var t=new a("linetoolgannsquare",e,!1,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]});return n._configureProperties(t),t},n._configureProperties=function(e){s._configureProperties(e)},t.LineToolGannSquare=n},Z8aO:function(e,t,i){"use strict";var n,o,r,s,a;i.r(t),i.d(t,"SeriesPriceLinePaneView",function(){return a}),n=i("mrSG"),o=i("aO4+"),r=i("k4w6"),s=i("8Uy/"),a=function(e){function t(t){var i=e.call(this,t)||this;return i._lineRendererData.linestyle=s.LINESTYLE_DOTTED,i}return Object(n.__extends)(t,e),t.prototype._updateImpl=function(){if(this._lineRendererData.visible=!1,this._series.properties().showPriceLine.value()&&12!==this._series.properties().style.value()){var e=this._series.lastValueData(void 0,!0);e.noData||(this._lineRendererData.visible=!0,this._lineRendererData.points=[new o.Point(0,e.coordinate)],this._lineRendererData.color=this._series.priceLineColor(e.color),this._lineRendererData.width=this._model.timeScale().width(),this._lineRendererData.height=this._series.priceScale().height(),this._lineRendererData.linewidth=this._series.properties().priceLineWidth.value())}},t}(r.a)},ZAbA:function(e,t,i){"use strict";var n,o,r;i.r(t),i.d(t,"SeriesDataEvents",function(){return r}),n=i("aIyQ"),o=i.n(n),r=function(){function e(){this._completed=new o.a,this._error=new o.a,this._symbolError=new o.a,this._symbolResolved=new o.a,this._seriesError=new o.a,this._symbolNotPermitted=new o.a,this._symbolGroupNotPermitted=new o.a,this._extendedHoursNotPermitted=new o.a,this._chartTypeNotPermitted=new o.a,this._intradaySpreadNotPermitted=new o.a,this._intradayExchangeNotPermitted=new o.a,this._customIntervalNotPermitted=new o.a,
+this._secondsIntervalNotPermitted=new o.a,this._tickMarksRangeChanged=new o.a,this._barReceived=new o.a,this._messageReceived=new o.a}return e.prototype.completed=function(){return this._completed},e.prototype.error=function(){return this._error},e.prototype.symbolError=function(){return this._symbolError},e.prototype.symbolResolved=function(){return this._symbolResolved},e.prototype.seriesError=function(){return this._seriesError},e.prototype.symbolNotPermitted=function(){return this._symbolNotPermitted},e.prototype.symbolGroupNotPermitted=function(){return this._symbolGroupNotPermitted},e.prototype.extendedHoursNotPermitted=function(){return this._extendedHoursNotPermitted},e.prototype.chartTypeNotPermitted=function(){return this._chartTypeNotPermitted},e.prototype.intradaySpreadNotPermitted=function(){return this._intradaySpreadNotPermitted},e.prototype.intradayExchangeNotPermitted=function(){return this._intradayExchangeNotPermitted},e.prototype.customIntervalNotPermitted=function(){return this._customIntervalNotPermitted},e.prototype.secondsIntervalNotPermitted=function(){return this._secondsIntervalNotPermitted},e.prototype.tickMarksRangeChanged=function(){return this._tickMarksRangeChanged},e.prototype.barReceived=function(){return this._barReceived},e.prototype.messageReceived=function(){return this._messageReceived},e.prototype.fireCompleted=function(){this._completed.fire()},e.prototype.fireError=function(){this._error.fire()},e.prototype.fireSymbolError=function(e){this._symbolError.fire(e),this.fireError()},e.prototype.fireSymbolResolved=function(e){this._symbolResolved.fire(e)},e.prototype.fireSeriesError=function(e){this._seriesError.fire(e),this.fireError()},e.prototype.fireSymbolNotPermitted=function(e){this._symbolNotPermitted.fire(e),this.fireError()},e.prototype.fireSymbolGroupNotPermitted=function(e){this._symbolGroupNotPermitted.fire(e),this.fireError()},e.prototype.fireExtendedHoursNotPermitted=function(){this._extendedHoursNotPermitted.fire(),this.fireError()},e.prototype.fireChartTypeNotPermitted=function(e){this._chartTypeNotPermitted.fire(e),this.fireError()},e.prototype.fireIntradaySpreadNotPermitted=function(){this._intradaySpreadNotPermitted.fire(),this.fireError()},e.prototype.fireIntradayExchangeNotPermitted=function(){this._intradayExchangeNotPermitted.fire(),this.fireError()},e.prototype.fireCustomIntervalNotPermitted=function(){this._customIntervalNotPermitted.fire(),this.fireError()},e.prototype.fireSecondsIntervalNotPermitted=function(){this._secondsIntervalNotPermitted.fire(),this.fireError()},e.prototype.fireTickMarksRangeChanged=function(e){this._tickMarksRangeChanged.fire(e)},e.prototype.fireBarReceived=function(e){this._barReceived.fire(e)},e.prototype.fireMessageReceived=function(e){this._messageReceived.fire(e)},e}()},ZJ1Q:function(e,t,i){"use strict";var n,o,r,s,a,l,c,u,h;i.r(t),n=i("qFKp"),o=i("Tmoa"),r=i("8Uy/"),s=i("jFln"),a=i("VdBB"),l=function(){function e(e){this._data=e}return e.prototype.draw=function(e){
+var t,i,n,o,a,l,c=this._data.vertLinesVisible,u=this._data.horzLinesVisible;(c||u)&&(e.lineStyle=this._data.lineStyle,e.lineWidth=this._data.lineWidth,e.strokeStyle=this._data.color,e.fillStyle=this._data.color,t=this._data.lineStyle===r.LINESTYLE_DASHED||this._data.lineStyle===r.LINESTYLE_DOTTED||this._data.lineStyle===r.LINESTYLE_SPARSE_DOTTED,i=this._data.lineWidth%2==0?.5:0,n=this._data.x+1+i,o=this._data.y+i,a=this._data.w,l=this._data.h,c&&n>=0&&(t?Object(s.drawDashedLineVertical)(e,n,0,l):Object(s.drawSolidLine)(e,n,0,n,l)),u&&o>=0&&(t?Object(s.drawDashedLineHorizontal)(e,0,o,a):Object(s.drawSolidLine)(e,0,o,a,o)),this._data.drawCenter&&(e.beginPath(),e.arc(n,o,3,0,2*Math.PI,!0),e.fillStyle=this._data.color,e.fill()))},e.prototype.hitTest=function(e){return void 0===this._data.mouseClickHandler?null:new a.HitTestResult(a.HitTestResult.CUSTOM,{mouseClickHandler:this._data.mouseClickHandler})},e}(),c=i("mMWL"),u=i("CW80"),i.d(t,"CrosshairPaneView",function(){return h}),h=function(){function e(e,t,i){this._rendererData={},this._renderer=new l(this._rendererData),this._source=e,this._pane=t,this._horzVisible=i}return e.prototype.update=function(){},e.prototype.renderer=function(e,t,i){var s,a,l,h,d,p,_=this._source.visible&&this._source.areLinesVisible,f=Object(c.lockTimeAxis)().value(),m=this._rendererData;return _&&null!==this._pane?(m.horzLinesVisible=_&&this._horzVisible,m.vertLinesVisible=_||f,s=this._source.model(),a=this._source.properties(),l=this._source.selectBarMode().value()&&this._source.isOnHoveredChartWidget(),d=(h=n.CheckMobile.any()&&Object(u.isLineToolName)(s.currentTool())&&!l)?s.isDark()?"#1E88E5":"#2196F3":a.childs().color.value(),p=a.childs().transparency.value(),!h&&p>0&&(d=Object(o.generateColor)(d,p)),m.color=d,m.lineWidth=a.childs().width.value(),m.lineStyle=a.childs().style.value(),m.drawCenter=h&&this._pane===this._source.pane,m.w=this._pane.width(),m.h=this._pane.height(),m.x=void 0!==this._source.lockedX&&isFinite(this._source.lockedX)&&this._source.lockedX||this._source.x,m.y=this._source.y,l&&(m.x=Math.max(0,this._source.x-1),m.vertLinesVisible=!0,m.lineStyle=r.LINESTYLE_SOLID,m.lineWidth=2,m.color="#ff0000"),this._renderer):null},e}()},ZJKN:function(e,t,i){"use strict";var n,o;i.r(t),i.d(t,"BarsRange",function(){return o}),n=i("Eyy1"),o=function(){function e(e,t){Object(n.assert)(e<=t,"The last bar in the bars range should be greater than or equal to the first bar"),this._firstBar=e,this._lastBar=t}return e.prototype.firstBar=function(){return this._firstBar},e.prototype.lastBar=function(){return this._lastBar},e.prototype.count=function(){return this._lastBar-this._firstBar+1},e.prototype.contains=function(e){return this._firstBar<=e&&e<=this._lastBar},e.prototype.equals=function(e){return this._firstBar===e.firstBar()&&this._lastBar===e.lastBar()},e.compare=function(e,t){return null===e||null===t?e===t:e.equals(t)},e}()},ZUZx:function(e,t,i){"use strict";function n(){!0}var o,r;i.r(t),i.d(t,"enableReloadPagePopup",function(){return n}),i("YFKU"),o=i("qFKp"),
+Object(o.isMac)()&&o.isSafari&&!o.CheckMobile.iOS()&&!Object(o.haveEverReceivedTouchEvent)()&&(r=function(){Object(o.markAsReceivedTouch)(),document.removeEventListener("touchstart",r)},document.addEventListener("touchstart",r,!1))},ZZnO:function(e,t,i){"use strict";function n(){return r.getValue(l,Object(a.defaultDateFormat)())}function o(){c.setValue(Object(a.defaultDateFormat)()),r.remove(l)}var r,s,a,l,c;i.r(t),i.d(t,"dateFormatProperty",function(){return c}),i.d(t,"removeSettingsValue",function(){return o}),r=i("Vdly"),s=i("m/cY"),a=i("e1ZQ"),l="date_format",c=Object(s.a)(n()),r.onSync.subscribe(null,function(){return c.setValue(n())}),c.listeners().subscribe(null,function(){return r.setValue(l,c.value())})},ZjKI:function(e,t,i){"use strict";i.r(t),i.d(t,"CLOSE_POPUPS_AND_DIALOGS_COMMAND",function(){return n});var n="CLOSE_POPUPS_AND_DIALOGS_COMMAND"},"Zo2/":function(e,t,i){"use strict";(function(t,n){function o(e){var i,o,r,s,a,l,c,u,h,d,p,_,f,m,y,g,v,S,b;ge.call(this,e),this._options.timeScaleWidget&&(this._options.timeScaleWidget.pressedMouseMoveScale=this._options.handleScale.axisPressedMouseMove),i=this,this._guid=re(),this._startSpinner(this._options.container.value()),o=this._options.content,r=this._options.readOnly,this._backgroundBasedTheme=new t("light"),this._removeMaximizeHotkey=null,i._hotkeys=P.createGroup({desc:"Chart actions",isDisabled:function(){return!i._isActive}}),s=this._options.containsData,a=this._options.onWidget,(l=this._options.onCmeWidget)&&he.logWarn("[ChartWidget] 'onCmeWidget' option is depricated"),c=this._options.widgetCustomer,u=this._options.timezone,h=this._options.hideSymbolSearch,d=this._options.defSymbol,p=V.isValid(this._options.defInterval)?this._options.defInterval:void 0,_=parseInt(this._options.defStyle),f=F.isValidStyle(_)?_:void 0,m=this._options.defExtendedHours,y=this._options.defTimeframe,this._chartWidgetCollection=this._options.chartWidgetCollection||null,this._content=o,this._initialLoading=this._options.initialLoading,this._readOnly=r,this._containsData=s,this._showChartEvents=!s&&this._options.chartEventsEnabled,this._defSymbol=d,this._defInterval=p,this._defTimeframe=y,this._defStyle=f,this._onWidget=!!a,this._onWidget&&(l?this._widgetCustomer="cme":c&&(this._widgetCustomer=c)),this._hideSymbolSearch=h,this._paneWidgets=[],this._maximizedPaneWidget=null,this._timeAxisSeparator=null,this._paneSeparators=[],this._timeAxisWidget=null,this._frameTime=30,this._model=null,this._metaInfo={},this._drawRafId=0,this._lhsAxesWidth=0,this._rhsAxesWidth=0,(g=this._contentSeriesProperties())&&(d=g.symbol,p=g.interval),void 0===this._options.useUserChartPreferences&&(this._options.useUserChartPreferences=!0),this._properties=new J("chartproperties",void 0,void 0,this._options.useUserChartPreferences),v="chartproperties.mainSeriesProperties",S=this._options.useUserChartPreferences?ue.defaults(v):ue.factoryDefaults(v),this._properties.mainSeriesProperties.merge(S),p=p||S.interval||"D",F.isValidStyle(f)||(f=F.isValidStyle(S.style)?S.style:j(V.isRange(p))),
+this._properties.mainSeriesProperties.merge({visible:!0,symbol:d||DEFAULT_SYMBOL,shortName:"",timeframe:"",onWidget:this._onWidget,interval:p,style:f,extendedHours:m,lineStyle:{styleType:ue.factoryDefaults("chartproperties.mainSeriesProperties.lineStyle.styleType")}}),this._containsData&&this._properties.mainSeriesProperties.merge({showCountdown:!1}),u&&ee(u)&&this._properties.timezone.setValue(u),this._tagsChanged=new n,this._modelCreated=new n,this._disconnected=new n,this._reconnectBailout=new n,this._connected=new n,this._redrawPanes=new n,this._onScroll=new n,this.chartWidgetInitialized=new n,this._chartSession=new te(ChartApiInstance),this._metaInfoRepository=new de(this._chartSession),this.lhsPriceAxisWidthChanged=new n,this.rhsPriceAxisWidthChanged=new n,this._timingsMeter=null,this._isActive=this._options.isActive,this._options.container.subscribe(function(e){i._setElement($(e))},{callWithLast:!0}),b=function(){i.resize()},this._options.width.subscribe(b),this._options.height.subscribe(b),this._options.visible.subscribe(this._updateTimingsMeterState.bind(this)),this._properties.paneProperties.background.listeners().subscribe(this,this._updateThemedColor),this._aboutToBeDestroyed=new n,this._actions=null,this._definitionsViewModel=null}var r,s,a,l,c,u,h,d,p,_,f,m,y,g,v,S,b,w,P,C,T,x,I,L,M,A,k,E,O,D,V,B,R,N,F,W,j,U,z,H,Y,G,q,K,Z,J,X,Q,ee,te,ie,ne,oe,re,se,ae,le,ce,ue,he,de,pe,_e,fe,me,ye,ge,ve,Se,be,we,Pe,Ce,Te;i("YCFM"),i("YFKU"),r=i("Eyy1").assert,s=i("Y7w9").moveToHead,a=i("mkn5").PaneWidget,l=i("sw9I"),c=i("mNEU"),u=i("1IXQ").PriceAxisWidget,h=i("uPb3").TimeAxisWidget,d=i("fTGZ").BarsMarksContainer,p=i("qJq3").Series,_=i("Kxc7"),f=i("+GxX").isFeatureEnabled,m=i("YmeR").ActionBinder,y=i("mKT+").resolveAndShowEditObjectDialog,g=i("Vdly").setValue,v=i("QloM").TabNames,S=i("cdbK").showGoToDateDialog,b=i("efOF").CustomEvent,w=i("/3z9"),P=i("lxNp"),C=i("7nsU").showConfirmInputsDialog,T=i("GVHu").Study,x=i("8sOK").StudyStub,I=i("3ClC").isStudy,L=i("Ss5c").LineDataSource,M=i("CW80").isLineToolName,A=i("CW80").isLineTool,k=i("7KDR"),E=k.Action,O=k.Separator,i("L/Ed").ToolboxType,D=i("mMWL"),V=i("LxhU").Interval,B=i("pPtI"),R=B.setLastUsedResolution,N=B.getDefaultResolution,F=i("n5al"),W=F.isRangeStyle,j=F.getDefaultStyle,U=i("pvsv").showSymbolInfoDialog,z=i("i1o5").InvalidateMask,H=i("i1o5").InvalidationLevel,Y=i("nqXy").MouseWheelHelper,G=i("PT1i").linking,q=i("mYjs").showChangeIntervalDialog,K=i("u5Q5").showDialog,Z=i("u5Q5").activateKeyPressHandler,J=i("Ocx9").DefaultProperty,X=i("+6ja"),Q=X.availableTimezones,ee=X.timezoneIsAvailable,te=i("0F0w").ChartSession,ie=i("0YCj"),ne=i("c2JX").Spinner,oe=i("PC8g").trackEvent,re=i("0waE").guid,se=i("Tmoa"),ae=i("ikwP").Size,le=i("oNU6").MarketStatusIndicator,ce=i("Wc1E").DataModeIndicator,ue=i("wZIs"),he=i("uOxu").getLogger("ChartWidget",{color:"#606"}),de=i("U0+/").StudyMetaInfoRepository,pe=i("VNzU").isMultipleLayout,_e=i("b1GK").addPerfMark,fe=i("KnF9").EnvironmentState,me=i("FQhm"),ye=i("zDbI").CHART_FONT_FAMILY,ge=i("wjVR").ChartWidgetBase,
+ve=i("qFKp").CheckMobile.any(),Se=window.t("On The Left"),be=window.t("On The Right"),we=window.t("Move Scale To Left"),Pe=window.t("Move Scale To Right"),Ce=.5,Te=_.enabled("chart_content_overrides_by_defaults"),inherit(o,ge),o.prototype.isInitialized=function(){return Boolean(this._inited)},o.prototype._getChartPropertyDefinitionsViewModel=function(){if(null===this._definitionsViewModel){var e=this;return new Promise(function(t,n){Promise.all([i.e(13),i.e(47),i.e("general-property-page")]).then(function(o){if(e._isDestroyed)n("Chart widget already destroyed");else{var r=i("5lPo").ChartPropertyDefinitionsViewModel;e.withModel(e,function(){null===e._definitionsViewModel&&(e._definitionsViewModel=new r(e.model(),e.properties(),e._options)),t(e._definitionsViewModel)})}}.bind(null,i)).catch(i.oe)})}return Promise.resolve(this._definitionsViewModel)},o.prototype._initMaximizeHotkey=function(e){function t(e){e.defaultPrevented||w.modifiersFromEvent(e)===w.Modifiers.Alt&&e.stopPropagation()}function i(e){e.defaultPrevented||w.modifiersFromEvent(e)===w.Modifiers.Alt&&(e.preventDefault(),e.stopPropagation(),n.toggleFullscreen())}var n=this;return e.addEventListener("mousedown",t,!0),e.addEventListener("click",i,!0),function(){e.removeEventListener("mousedown",t,!0),e.removeEventListener("click",i,!0)}},o.prototype.toggleFullscreen=function(){var e=this.getResizerDetacher();e.fullscreenable.value()&&(e.fullscreen.value()?e.exitFullscreen():e.requestFullscreen())},o.prototype.backgroundBasedTheme=function(){return this._backgroundBasedTheme.readonly()},o.prototype._updateThemedColor=function(){var e,t=this._properties.paneProperties.background.value(),i=se.getLuminance(t),n=i',t),this._elTooltipDiv=t.createElement("div"),this._elTooltipDiv.className="tooltip-wrapper",this._jqMainDiv.append(this._elTooltipDiv),this._elMainTable=t.createElement("table"),this._elMainTable.className="chart-markup-table",this._elMainTable.setAttribute("cellpading","0"),this._elMainTable.setAttribute("cellspacing","0"),this._jqMainDiv.append(this._elMainTable),(this._options.controlBarEnabled||_.enabled("control_bar"))&&Promise.all([i.e(61),i.e("chart-widget-gui")]).then(function(e){if(!this._isDestroyed){this._controlBarNavigation&&this._controlBarNavigation.destroy();var t=i("TGRH").ControlBarNavigation;this._controlBarNavigation=new t(this,this._jqMainDiv[0],this._options.controlBar),this._model&&this._adjustSize()}}.bind(this).bind(null,i)).catch(i.oe),this._containsData||this.createIndicatorImage(),(this._options.handleScale.mouseWheel||this._options.handleScroll.mouseWheel)&&(this._mouseWheelHelper=new Y,this._onWheelBound=this._onMousewheel.bind(this),this._jqMainDiv[0].addEventListener("wheel",this._onWheelBound,{passive:!1})),this.resize(),this._justActivated=!1,this.withModel(this,function(){this._jqParent.append(this._jqMainDiv),this._jqMainDiv.on("mousedown",this._beginRequestActive.bind(this)),this._jqMainDiv.on("mouseup",this._endRequestActive.bind(this)),this._jqMainDiv.on("touchstart",this._beginRequestActive.bind(this)),this._jqMainDiv.on("touchmove",this._endRequestActive.bind(this)),this._jqMainDiv.on("touchend",this._endRequestActive.bind(this)),this._jqParent.on("click",this._requestActive.bind(this))}),this._inited&&(null!==this._timeAxisWidget&&(this._timeAxisWidget.destroy(),this._timeAxisWidget=null),this._paneWidgets.length=0,this._paneSeparators.length=0,this._update(z.full()))},o.prototype._beginRequestActive=function(){var e=!1;this._chartWidgetCollection&&(e=this._chartWidgetCollection.activeChartWidget.value()!==this,this._chartWidgetCollection.activeChartWidget.setValue(this)),e&&(TradingView.isMobile.any()&&this._isLineToolModeExceptBrush()&&this.updateCrossHairPositionIfNeeded(),this._justActivated=!0)},o.prototype._endRequestActive=function(){var e=this;this._justActivated&&setTimeout(function(){e._justActivated=!1},0)},o.prototype._requestActive=function(){this._beginRequestActive(),this._endRequestActive()},o.prototype.justActivated=function(){return this._justActivated},
+o.prototype._onMousewheel=function(e){var t,i,n,o,r,s,a;if(this.model().model().zoomEnabled()&&(TradingView.onWidget()||!parent||parent===window||!parent.IS_DEMO_PAGE)&&this.model()&&!this.noScroll&&!this.model().timeScale().isEmpty()&&(i=(t=this._mouseWheelHelper.processWheel(e)).deltaX/100,n=-t.deltaY/100,0!==i&&this._options.handleScroll.mouseWheel||0!==n&&this._options.handleScale.mouseWheel)){switch(e.cancelable&&e.preventDefault(),e.deltaMode){case e.DOM_DELTA_PAGE:i*=120,n*=120;break;case e.DOM_DELTA_LINE:i*=32,n*=32}if(0!==n&&this._options.handleScale.mouseWheel){if(o=Math.sign(n)*Math.min(1,Math.abs(n)),r=this._jqMainDiv[0].getBoundingClientRect(),s=e.clientX-this._lhsAxesWidth-r.left,!Number.isFinite(s)||!Number.isFinite(o))return void he.logWarn("Incorrect mouse wheel processing: scrollPosition: "+s+", zoomScale: "+o);a=new fe(e).control(),this.model().model().zoomTime(s,o,!!a||void 0)}0!==i&&this._options.handleScroll.mouseWheel&&this.model().scrollChart(-80*i)}},o.prototype.setTimezone=function(e){e&&ee(e)?this._properties.timezone.setValue(e):console.warn("Incorrect timezone: "+JSON.stringify(e))},o.prototype.getTimezone=function(){return this._properties.timezone.value()},o.prototype.refreshMarks=function(){this.model().barsMarksSources().forEach(function(e){e.refreshData()})},o.prototype.clearMarks=function(){this.model().barsMarksSources().forEach(function(e){e.clearMarks()})},o.prototype.metaInfoRepository=function(){return this._metaInfoRepository},o.prototype._init=function(){var e,t,i=this;this.model()&&this.model().mainSeries().clearData(),this.initColors(),this._makeDefaultGui(),e=function(){i._checkObsoleteTimezone(),i._chartSession&&i._chartSession.connected()&&this._model.restart(),this._content&&(this.initColors(),this._updateGui(),this.update());var e=i._model.mainSeries();e.marketStatus.subscribe(function(t){i.indicatorImage&&i._updateDataAndMarketStatus(t,e.status())},{callWithLast:!0}),this._resizeHandler=function(){this._adjustSize(),this._model&&this._model.mainSeries().requestMoreData(),this.paint(),this.checkCompactMode(),this.resizeIndicator()}.bind(this),this._resizeHandler(),this._jqParent.append(this._jqMainDiv),this._spinner&&(this._spinner.stop(),delete this._spinner),f("chrome_canvas_fix")&&navigator.userAgent.match(/windows.+chrome/i)&&$(window).on("visibilitychange:chart_"+this._guid,function(e,t){if(t){for(var n=0;n'),this.$shield=$('').appendTo(this.$element),this.$element.appendTo(t),this._showed=!1,this._cw.withModel(this,this._connectToModel)},o.LoadingScreen.prototype._connectToModel=function(){this._cw.model().mainSeries().dataEvents().messageReceived().subscribe(this,function(e){switch(e.method){case"symbol_error":e.params[1]!==p.PERMISSION_DENIED&&this.hide();break;case"series_error":_.enabled("hide_loading_screen_on_series_error")&&this.hide();break;case"series_completed":this.hide()}})},o.LoadingScreen.prototype.show=function(){this._cw._inLoadingState=!0,this._showed||(this._showed=!0,this._show())},o.LoadingScreen.prototype._show=function(){var e=this._cw.properties().paneProperties.background.value();this.$shield.css("background",e),this.$element.addClass("fade")},o.LoadingScreen.prototype.hide=function(){delete this._cw._inLoadingState,this._showed&&this._hide()},o.LoadingScreen.prototype._hide=function(){this._showed=!1,this.$element.removeClass("fade")},o.LoadingScreen.prototype.$canvas=null,o.LoadingScreen.prototype.context=null,o.LoadingScreen.prototype.isShown=function(){return this._showed},o.prototype.unsetActivePaneWidget=function(){this.activePaneWidget=!1},o.prototype.setActivePaneWidget=function(e){this.activePaneWidget=e},o.prototype.maximizedPaneWidget=function(){return this._maximizedPaneWidget},o.prototype.isMaximizedPane=function(){return null!==this._maximizedPaneWidget},o.prototype.toggleMaximizePane=function(e){if(!(this._paneWidgets.length<2)){this._maximizedPaneWidget?(this._maximizedPaneWidget.state().setMaximized(!1),this._maximizedPaneWidget=null,
+this._paneSeparators.forEach(function(e){e.show()})):(this._maximizedPaneWidget=e,this._maximizedPaneWidget.state().setMaximized(!0),this._paneSeparators.forEach(function(e){e.hide()}));for(var t=this._paneWidgets.length;t--;)this._paneWidgets[t].updateControls(),this._paneWidgets[t].updatePriceAxisWidgets();this._timeAxisWidget.updatePriceAxisStubs(),this._adjustSize(),this.updateIndicatorImagePosition(),this.updateCrossHairPositionIfNeeded()}},o.prototype._makePaneWidgetsAndSeparators=function(){var e,t,i,n,o=this._model.panes(),r=o.length,s=this._paneWidgets.length;for(e=r;e
0&&(i=new l(this,e-1,e),this._paneSeparators.push(i),this._timeAxisWidget?$(i.row).insertBefore(this._timeAxisWidget.getElement()):$(i.row).appendTo(this._elMainTable)),this._timeAxisWidget?this._elMainTable.insertBefore(t.getElement(),this._timeAxisWidget.getElement()):this._elMainTable.appendChild(t.getElement());for(null!==this._timeAxisSeparator&&this._timeAxisSeparator.destroy(),this._timeAxisSeparator=new l(this,this._paneWidgets.length-1,0,!0),$(this._timeAxisSeparator.row).insertBefore(this._timeAxisWidget.getElement()),e=0;e0;)for(i=(t=this._content.panes[e].sources).length;i-- >0;)if("MainSeries"===t[i].type)return t[i].state},o.prototype.updateUndoRedo=function(){this._model&&(this.actions().undo.update({disabled:this._model.undoHistory().undoStack().isEmpty()}),this.actions().redo.update({disabled:this._model.undoHistory().redoStack().isEmpty()}))},o.prototype.createSessionBreaksActions=function(e){var t=new E({label:window.t("Session Breaks"),checkable:!0,statName:"ToggleSessionBreaks"});t.binder=new m(t,this._model.chartModel().sessions().properties().graphics.vertlines.sessBreaks.visible,this.model(),"Session Breaks"),this._actions.sessionBreaks=t},o.prototype.updateActionForIntradayOnly=function(e){!e||!e instanceof E||e.update({disabled:this.model().mainSeries().isDWM()})},o.prototype.withModel=function(e,t){this.model()?t.call(e):this.modelCreated().subscribe(e,t,!0)},o.prototype.containsVolume=function(){return this.model().dataSources().some(function(e){return e instanceof T&&"Volume"===e.metaInfo().shortId})},o.prototype.containsStudyByPredicate=function(e){return!!this._model&&this._model.dataSources().some(function(t){if(!(t instanceof T))return!1;var i=t.metaInfo();return e(i)})},o.prototype.containsStudy=function(e){return this.containsStudyByPredicate(function(t){return t.id===e||t.fullId===e})},o.prototype.isSmall=function(){return this._width()<550||this._height()<300},o.prototype.onWidget=function(){return this._onWidget},o.prototype.onCmeWidget=function(){return"cme"===this.widgetCustomer()},o.prototype.widgetCustomer=function(){return this._widgetCustomer},o.prototype._width=function(){return this._options.width.value()},o.prototype._height=function(){return this._options.height.value()},o.prototype.resize=function(){var e={height:this._height()+"px",width:this._width()+"px"};this._jqMainDiv.css(e),this._elMainTable.style.height=e.height,
+this._elMainTable.style.width=e.width,this._resizeHandler&&this._jqMainDiv&&this._resizeHandler()},o.prototype.chartSession=function(){return this._chartSession},o.prototype.maxLhsPriceAxisWidth=0,o.prototype.maxRhsPriceAxisWidth=0,o.prototype.GUIResetScales=function(){oe("GUI","Reset Scales");var e=this.model();e&&e.resetScales()},o.prototype.onLineCancelled=function(){D.resetToCursor()},o.prototype.createIndicatorImage=function(){var e=this;this._indicatorBindingPriceAxisName="right",this._indicatorImageMargin="marginRight",this.indicatorImage=this._jqParent[0].getElementsByClassName("chart-status-picture")[0],this.indicatorImage?this.indicatorImage.innerHTML="":(this.indicatorImage=this._jqParent.prop("ownerDocument").createElement("span"),this.indicatorImage.className="chart-status-picture",this._jqParent.append(this.indicatorImage)),this._options.marketStatusWidgetEnabled&&(this.indicatorText=$(''),this.indicatorText.appendTo(this.indicatorImage),this.indicatorDot&&this.indicatorDot.stop(),this.indicatorDot=new le({el:this.indicatorText.find(".js-market-status")[0],classSuffix:"--for-chart"}),this.indicatorDot.start(),_.enabled("display_data_mode")&&($('').appendTo(this.indicatorText),this.dataModeIndicator&&this.dataModeIndicator.stop(),this.dataModeIndicator=new ce({el:this.indicatorText.find(".js-data-mode")[0],classSuffix:"--for-chart"}),this.dataModeIndicator.start())),e.withModel(null,function(){var t=e._model.mainSeries();t.onStatusChanged().subscribe(null,e.updateIndicatorImage.bind(e)),t.marketStatus.subscribe(e.updateIndicatorImage.bind(e)),e.updateIndicatorImage(),e.checkCompactMode(),e._model.model().onRearrangePanes().subscribe(null,function(){e.resetIndicatorSize(),e.resizeIndicator()})}),this._indicatorPriceAxisWidthChanged=this.getPriceAxisWidthChangedByName(this._indicatorBindingPriceAxisName),this._indicatorPriceAxisWidthChanged.subscribe(this,this.updateIndicatorImagePosition),this.updateIndicatorImagePosition()},o.prototype._updateDataWarningIndicator=function(){},o.prototype.updateIndicatorImage=function(){var e,t,i,n=this,o=this._model;o&&(t=(e=o.mainSeries()).status(),i=e.quotes()?e.quotes().update_mode_seconds:null,n._updateDataAndMarketStatus(e.marketStatus.value(),t,i))},o.prototype.checkCompactMode=function(){this._jqMainDiv.toggleClass("i-compact",this._width()<=400),this.indicatorImage&&(this._indicatorWidth=this.indicatorImage.clientWidth)},o.prototype.getDataTextStatus=function(e){var t;switch(e){case p.STATUS_LOADING:case p.STATUS_RESOLVING:t="loading";break;case p.STATUS_INVALID_SYMBOL:t="invalid";break;case p.STATUS_NO_BARS:t="forbidden";break;case p.STATUS_DELAYED:t="delayed";break;case p.STATUS_DELAYED_STREAMING:t="delayed_streaming";break;case p.STATUS_EOD:case p.STATUS_PULSE:t="endofday";break;case p.STATUS_OFFLINE:t="connecting";break;case p.STATUS_SNAPSHOT:
+t="snapshot";break;case p.STATUS_READY:t="realtime";break;case p.STATUS_REPLAY:t="replay";break;default:t=e}return t},o.prototype._updateDataAndMarketStatus=function(e,t){var i;void 0!==this.indicatorText&&(i=this.getDataTextStatus(t),t===p.STATUS_LOADING||t===p.STATUS_RESOLVING?this.indicatorDot.setStatus("loading"):t===p.STATUS_INVALID_SYMBOL?this.indicatorDot.reset():i===t&&he.logWarn("unhandled data mode "+i),_.enabled("display_data_mode")&&this.dataModeIndicator.setMode(i),!["loading","invalid","replay"].includes(i)&&e?this.indicatorDot.setStatus(e,!0):"invalid"===i?this.indicatorDot.setStatus("invalid",!0):"replay"===i&&this.indicatorDot.setStatus("replay"),this.resizeIndicator())},o.prototype.resetIndicatorSize=function(){var e,t;null!==this._paneWidgets[0]&&null!==(e=this._paneWidgets[0].statusWidget())&&null!==(t=e.firstTitle())&&(t.style.paddingRight="")},o.prototype.resizeIndicator=function(){var e,t,i,n,o;null!==this._paneWidgets[0]&&null!==(e=this._paneWidgets[0].statusWidget())&&null!==(t=e.firstTitle())&&(i=this._width()<150?0:this._indicatorWidth+10,t.style.paddingRight=i+"px"),this._options.marketStatusWidgetEnabled&&_.enabled("display_data_mode")&&this.indicatorDot&&this.dataModeIndicator&&(this.indicatorDot.isShortModeEnabled()&&this.dataModeIndicator.isShortModeEnabled()?(n=[this.indicatorDot.getTooltipText(),this.dataModeIndicator.getTooltipText()].filter(function(e){return e}).join(", "),this.indicatorText.attr("title",n)):this.indicatorText.attr("title",""),this.indicatorText.get(0).dispatchEvent(new b("common-tooltip-update"))),this.indicatorImage&&(this._indicatorWidth=this.indicatorImage.clientWidth),o=this._width(),this._options.marketStatusWidgetEnabled&&this.indicatorDot&&(o>650?(this.indicatorDot.setTooltipEnabled(!1),this.indicatorDot.disableShortMode()):o>550?(this.indicatorDot.setTooltipEnabled(!1),this.indicatorDot.disableShortMode()):(this.indicatorDot.setTooltipEnabled(!1),this.indicatorDot.enableShortMode())),_.enabled("display_data_mode")&&this.dataModeIndicator&&(o>650?(this.dataModeIndicator.setTooltipEnabled(!1),this.dataModeIndicator.disableShortMode()):o>550?(this.dataModeIndicator.setTooltipEnabled(!0),this.dataModeIndicator.enableShortMode()):(this.dataModeIndicator.setTooltipEnabled(!1),this.dataModeIndicator.enableShortMode()))},o.prototype.updateIndicatorImagePosition=function(){this.indicatorImage&&(this.indicatorImage.style[this._indicatorImageMargin]=this.getPriceAxisMaxWidthByName(this._indicatorBindingPriceAxisName)+"px")},o.prototype._getMainSeriesPaneWidget=function(){for(var e=0;e=3},inherit(o,r),o.version=2,o.LevelsCount=24,o.prototype.levelsCount=function(){return o.LevelsCount},o.prototype.stop=function(){r.prototype.stop.call(this),this._model._trendBasedFibExtensionLabelsCache.removeSource(this.id())},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return c},o.prototype.name=function(){return"Trend-Based Fib Extension"},o.prototype.migrateVersion=function(e,t,i){1===e&&this.properties().extendLines.setValue(!0)},o.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},o.prototype.getStylesPropertyPage=function(){return l.LineToolTrendBasedFibExtensionStylesPropertyPage},o.createProperties=function(e){var t=new s("linetooltrendbasedfibextension",e,!1,{range:[0,8]});return o._configureProperties(t),t},o.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(13),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("17v9").FibDrawingsWith24LevelsDefinitionsViewModel}.bind(null,i)).catch(i.oe)},o._configureProperties=function(e){r._configureProperties(e)},o.prototype.fibLevelsBasedOnLogScale=function(){return this.properties().fibLevelsBasedOnLogScale.value()&&this.priceScale().isLog()},t.LineToolTrendBasedFibExtension=o},"Zy3/":function(e,t,i){"use strict";i.r(t),i.d(t,"CompositeRenderer",function(){return n});var n=function(){function e(){
+this._renderers=[],this._globalAlpha=1}return e.prototype.setGlobalAlpha=function(e){this._globalAlpha=e},e.prototype.append=function(e){this._renderers.push(e)},e.prototype.insert=function(e,t){this._renderers.splice(t,0,e)},e.prototype.clear=function(){this._renderers.length=0},e.prototype.draw=function(e){for(var t=0;t=0;t--)null!==(i=this._renderers[t].hitTest(e))&&(null===n||i.result()>n.result())&&(n=i);return n},e.prototype.doesIntersectWithBox=function(e){return this._renderers.some(function(t){return!!t.doesIntersectWithBox&&t.doesIntersectWithBox(e)})},e}()},a7Ha:function(e,t,i){"use strict";var n;i.r(t),i.d(t,"LineEnd",function(){return n}),function(e){e[e.Normal=0]="Normal",e[e.Arrow=1]="Arrow",e[e.Circle=2]="Circle"}(n||(n={}))},a9Kt:function(e,t){e.exports=''},aDyP:function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolPitchfork";var i=t||n.createProperties();o.call(this,e,i),this._properties.style.listeners().subscribe(this,n.prototype._recreatePaneView),this._recreatePaneView()}var o=i("Ss5c").LineDataSource,r=i("5rJj"),s=i("7KDR").Action,a=i("hayr").propertyPages,l=i("rCHB").LineToolPitchforkStyle,c=null,u=window.t("Pitchfork");inherit(n,o),n.LevelsCount=8,n.prototype.levelsCount=function(){return n.LevelsCount},n.prototype.additionalActions=function(){var e,t,i=[],n=["Original","Modified Schiff","Inside","Schiff"];for(e=0;e<4;e++)t=new s({checked:this.properties().style.value()===e,checkable:!0,label:window.t(n[e]),payload:{target:this,value:e},onExecute:function(e){var t=e.getPayload(),i=t.target,n=t.value;i.properties().style.setValue(n),i.updateAllViews(),i._model.updateSource(i)}}),i.push(t);return[i[0],i[3],i[1],i[2]]},n.prototype._recreatePaneView=function(){if(null!==c){var e=[];this._properties.style.value()===l.Original?e=[new c.PitchforkLinePaneView(this,this._model)]:this._properties.style.value()===l.Schiff?e=[new c.SchiffPitchforkLinePaneView(this,this._model)]:this._properties.style.value()===l.Schiff2?e=[new c.SchiffPitchfork2LinePaneView(this,this._model)]:this._properties.style.value()===l.Inside&&(e=[new c.InsidePitchforkLinePaneView(this,this._model)]),this._setPaneViews(e)}else i.e("lt-pane-views").then(function(e){null===c&&(c=i("cT+B")),this._recreatePaneView()}.bind(this).bind(null,i)).catch(i.oe)},n.prototype.pointsCount=function(){
+return 3},n.prototype.title=function(){return u},n.prototype.name=function(){return"Pitchfork"},n.prototype.processErase=function(e,t){var i="level"+t,n=this.properties()[i].visible;e.setProperty(n,!1,"Erase level line")},n.prototype.getStylesPropertyPage=function(){return a.LineToolPitchforkStylesPropertyPage},n.createProperties=function(e){var t=new r("linetoolpitchfork",e,!1,{range:[0,8]});return n._configureProperties(t),t},n.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(13),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("HCdA").PitchForkDefinitionsViewModel}.bind(null,i)).catch(i.oe)},n._configureProperties=function(e){o._configureProperties(e)},t.LineToolPitchfork=n},aILO:function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolHeadAndShoulders";var r=t||n.createProperties();o.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("Fx2Q").LineToolHeadAndShouldersPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,s=i("hayr").propertyPages,a=window.t("Head and Shoulders");inherit(n,o),n.prototype.pointsCount=function(){return 7},n.prototype.title=function(){return a},n.prototype.name=function(){return"Head and Shoulders"},n.prototype.getStylesPropertyPage=function(){return s.LineToolLineTool5PointsPatternStylesPropertyPage},n.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(13),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("EFc4").Points5PatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},n.createProperties=function(e){var t=new r("linetoolheadandshoulders",e);return n._configureProperties(t),t},n._configureProperties=function(e){o._configureProperties(e)},t.LineToolHeadAndShoulders=n},aIha:function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolFlagMark";var s=t||n.createProperties();r.call(this,e,s),i.e("lt-pane-views").then(function(t){var n=i("5Dp4").MarkPaneView,r=new n(this,e,this.image,25,25,-8,-21);r.setAnchors(new o(0,0)),this._setPaneViews([r])}.bind(this).bind(null,i)).catch(i.oe)}var o=i("aO4+").Point,r=i("Ss5c").LineDataSource,s=i("Ocx9").DefaultProperty,a=window.t("Flag Mark");inherit(n,r),n.prototype.image=new Image,n.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAsElEQVR4AWMYWcDExOS/YUd4hWF7+H90bNAePpO2liDwJTxyi2htyVXLvlBOWlry2bAtVIumwWXQERFF4zgJ20iPiP8JDCpLeqSuJ6ZdoRJ0SMIRx7QbQtmItgSXnGFbRCzMEnIzK8ISWgL6WzJqibGxsYaFhYUC7SxBWMQPNMjazMxMjebBZWhoKAq00NHc3FyL5nFiaWkpDTTYz8jISI/mEW9qaqoExGFgS+gFRgEAaE0hWxrw50oAAAAASUVORK5CYII=",n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return a},n.prototype.name=function(){return"Flag Mark"},n.prototype.version=2,n.createProperties=function(e){var t=new s("linetoolflagmark",e);return n._configureProperties(t),t},n._configureProperties=function(e){r._configureProperties(e)},t.LineToolFlagMark=n},aIyQ:function(e,t,i){"use strict"
+;(function(e){function t(){this._listeners=[]}function n(e){return!e.singleshot}i("uOxu").getLogger("Common.Delegate");t.prototype.subscribe=function(e,t,i){var n={object:e,member:t,singleshot:!!i};this._listeners.push(n)},t.prototype.unsubscribe=function(e,t){var i,n;for(i=0;i=0;--t)this._listeners[t].object===e&&this._listeners.splice(t,1)},t.prototype.destroy=function(){delete this._listeners},t.prototype.fire=function(){var e,t,i,o=this._listeners;for(this._listeners=this._listeners.filter(n),e=o.length,t=0;t0)},t.box=function(e,t){return{min:n(Math.min(e.x,t.x),Math.min(e.y,t.y)),max:n(Math.max(e.x,t.x),Math.max(e.y,t.y))}},t.equalBoxes=function(e,t){return o(e.min,t.min)&&o(e.max,t.max)}},akof:function(e,t,i){"use strict";var n,o,r,s;i.r(t),i.d(t,"PaneRendererCircleShape",function(){return s}),n=i("mrSG"),o=i("2WC2"),r=2*Math.PI,s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype._drawItemShape=function(e,t){var i=Math.max(t.width,t.height)/2,n=t.x,o=t.vertOffset,s=t.y+o;e.moveTo(n+i,s),e.arc(n,s,i,0,r,!1)},t}(o.a)},b1GK:function(e,t,i){"use strict";function n(){}function o(e){r(e),s(e)}var r,s;i.r(t),i.d(t,"addPerfMark",function(){return o}),r=console.timeStamp?console.timeStamp.bind(console):n,
+s=window.performance&&performance.mark?performance.mark.bind(performance):n},bJYc:function(e,t,i){"use strict";var n,o,r,s;i.r(t),i.d(t,"SetPropertyUndoCommand",function(){return s}),n=i("mrSG"),o=i("RDU5"),r=i("Ocx9"),s=function(e){function t(t,i,n,o,r){var s=e.call(this,n)||this;return s._targetObj=t,s._newValue=i,s._oldValue=s._targetObj.value(),s._model=o,r&&s.setCustomFlag("doesnt_affect_save",!0),s}return Object(n.__extends)(t,e),t.prototype.redo=function(){Object(r.saveDefaultProperties)(!0),this._targetObj.setValue(this._newValue),Object(r.saveDefaultProperties)(!1),this._model.recalculateAllPanes(),this._model.lightUpdate()},t.prototype.undo=function(){Object(r.saveDefaultProperties)(!0),this._targetObj.setValue(this._oldValue),Object(r.saveDefaultProperties)(!1),this._model.recalculateAllPanes(),this._model.lightUpdate()},t}(o.UndoCommand)},bKFv:function(e,t,i){"use strict";var n;i.r(t),i.d(t,"StatsPosition",function(){return n}),function(e){e[e.Left=0]="Left",e[e.Center=1]="Center",e[e.Right=2]="Right"}(n||(n={}))},bOGh:function(e,t,i){"use strict";var n,o,r;i.d(t,"a",function(){return r}),n=i("mrSG"),o=i("RDU5"),r=function(e){function t(t){var i=e.call(this,t,!1)||this;return i._subcommands=[],i}return Object(n.__extends)(t,e),t.prototype.addCommand=function(e){this._subcommands.push(e)},t.prototype.isEmpty=function(){return 0===this._subcommands.length},t.prototype.redo=function(){for(var e=0;e=0;e--)this._subcommands[e].undo()},t.prototype.commands=function(){return this._subcommands},t}(o.UndoCommand)},bSeV:function(e,t){},bTqm:function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolCypherPattern";var r=t||n.createProperties();o.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("mjK7").CypherPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,s=i("NJRZ").LineTool5PointsPattern,a=window.t("Cypher Pattern");inherit(n,s),n.prototype.title=function(){return a},n.prototype.name=function(){return"Cypher Pattern"},n.createProperties=function(e){var t=new r("linetoolcypherpattern",e);return n._configureProperties(t),t},n._configureProperties=function(e){s._configureProperties(e)},t.LineToolCypherPattern=n},bc0y:function(e,t,i){},beCu:function(e,t,i){"use strict";function n(e){return new a(e)}var o,r,s,a;i.r(t),i.d(t,"doAnimate",function(){return n}),o=i("mrSG"),r=i("j1f4"),s={from:0,duration:250,easing:r.easingFunc.easeOutCubic},a=function(){function e(e){var t,i=this;this._doing=!0,this._options=Object(o.__assign)(Object(o.__assign)({},s),e),t=performance.now(),window.requestAnimationFrame(function(e){i._animation(t,i._options.from,e)})}return e.prototype.stop=function(){this._doing=!1},e.prototype._animation=function(e,t,i){var n,o,r,s,a,l,c,u,h=this;this._doing?(o=(n=(i=!i||i<1e12?performance.now():i)-e)>=this._options.duration||t===this._options.to,
+l=this._options.from,c=this._options.to,u=this._options.easing(n/this._options.duration),r=l*(1-u)+c*u,a=(s=o?this._options.to:r)-t,this._options.onStep(a,s),o?this._finishAnimation():window.requestAnimationFrame(function(t){h._animation(e,s,t)})):this._finishAnimation()},e.prototype._finishAnimation=function(){this._options.onComplete&&this._options.onComplete()},e}()},biIa:function(e,t,i){"use strict";var n,o,r,s,a,l,c;i.r(t),i.d(t,"SeriesWaterlinePaneView",function(){return c}),n=i("mrSG"),o=i("aO4+"),r=i("k4w6"),s=i("//lt"),a=i("VdBB"),l=i("8Uy/"),c=function(e){function t(t){var i=e.call(this,t)||this,n={cursorType:s.PaneCursorType.VerticalResize,pressedMouseMoveHandler:function(e){var i=t.priceScale(),n=t.properties().baselineStyle,o=i.height(),r=100-e.y/o*100,s=r<0?0:Math.round(10*r)/10;n.baseLevelPercentage.setValue(Math.max(Math.min(s,100),0))}};return i._lineRenderer.setHitTest(new a.HitTestResult(a.HitTestResult.CUSTOM_MOVE,n)),i._lineRendererData.visible=!0,i._lineRendererData.linestyle=l.LINESTYLE_SPARSE_DOTTED,i}return Object(n.__extends)(t,e),t.prototype._updateImpl=function(){var e=this._series.properties().baselineStyle,t=Math.abs(100-e.baseLevelPercentage.value());this._lineRendererData.width=this._model.timeScale().width(),this._lineRendererData.height=this._series.priceScale().height(),this._lineRendererData.points=[new o.Point(0,Math.round(this._lineRendererData.height*(t/100)))],this._lineRendererData.color=e.baselineColor.value()},t}(r.a)},brCa:function(e,t,i){"use strict";function n(e){return new Promise(function(t){Promise.all([i.e("dialogs-core"),i.e(19),i.e("create-dialog")]).then(function(n){var o=i("YDhE").createDialog;t(o(Object(r.__assign)(Object(r.__assign)({},s),e)))}.bind(null,i)).catch(void 0)})}function o(e){n(e).then(function(e){return e.open()})}var r,s;i.r(t),i.d(t,"createNoticeDialog",function(){return n}),i.d(t,"showNoticeDialog",function(){return o}),r=i("mrSG"),i("YFKU"),s={width:400,destroyOnClose:!0,title:window.t("Notification"),content:window.t("You are notified"),contentWrapTemplate:'',actionsWrapTemplate:'',actions:[{name:"ok",type:"primary",text:window.t("Ok"),method:"close",key:[13,32]}]}},"bv/X":function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolSineLine";var r=t||n.createProperties();o.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)}var o=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,s=i("hayr").propertyPages,a=window.t("Sine Line");inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return a},n.prototype.name=function(){return"Sine Line"},n.prototype.getStylesPropertyPage=function(){return s.LineToolTimeCyclesPropertyPage},n.prototype._getPropertyDefinitionsViewModelClass=function(){
+return Promise.all([i.e(13),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("LX4V").CyclicAndSineLinesPatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},n.createProperties=function(e){var t=new r("linetoolsineline",e);return n._configureProperties(t),t},n._configureProperties=function(e){o._configureProperties(e)},t.LineToolSineLine=n},c2JX:function(e,t,i){"use strict";function n(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 o,r,s,a,l;i.r(t),i.d(t,"renderSpinnerTemplate",function(){return n}),i.d(t,"Spinner",function(){return l}),o=i("SzKR"),r=i("TzTt"),s=i("Owlf"),a=Object(r.parseHtmlElement)(n()),l=function(){function e(e){this._shown=!1,this._el=a.cloneNode(!0),this.setSize(e||s.a)}return e.prototype.spin=function(e){return this._el.classList.add("tv-spinner--shown"),void 0===this._container&&(this._container=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}()},cBZt:function(e,t,i){"use strict";function n(e,t){return e+"@"+t}function o(e){return e.replace(/(@[^-]+-[^-]+).*$/,"$1")}i.r(t),i.d(t,"studyIdString",function(){return n}),i.d(t,"extractStudyId",function(){return o})},cKqi:function(e,t,i){"use strict";function n(e,t){this._source=e,this._model=t,this._points=[new s(0,0)],this._lineRenderer=new C}function o(e,t){return null==e[t]}function r(e,t,i,n){this._waterlineView=null,l.call(this,e,t,i,n),this.m_data=new k(A(),o),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(),this._quotesProvider=new V,
+B&&this._quotesProvider.quotesUpdate().subscribe(this,this._onQuotesUpdate)}var s=i("aO4+").Point,a=i("qJq3").Series,l=i("GVHu").Study,c=i("k9/m").PlotRowSearchMode,u=i("FBsw").OverlayPriceAxisView,h=i("KtbP").PanePriceAxisView,d=i("x0JF"),p=d.SeriesAreaPaneView,_=d.SeriesLinePaneView,f=d.SeriesHollowCandlesPaneView,m=d.SeriesCandlesPaneView,y=d.SeriesBarsPaneView,g=d.SeriesBaselinePaneView,v=i("biIa").SeriesWaterlinePaneView,S=i("i3nr").OverlayStatusView,b=i("JjUe").OverlayDataWindowView,w=i("z8/4").OverlayLegendView,P=i("38az").SeriesBarColorer,C=i("l4sv").HorizontalLineRenderer,T=i("hayr").propertyPages,x=i("Kxc7"),I=i("6sst").OverlayStudyPriceLineAxisView,L=i("Qb4w").PriceRange,M=i("XPit").barFunction,A=i("XPit").seriesPlotFunctionMap,k=i("k9/m").PlotList,E=i("n5al").createSeriesFormatter,O=i("n5al").seriesCurrency,D=i("n5al").extractSymbolNameFromSymbolInfo,V=i("wOSo").QuotesProvider,B=i("qFKp").CheckMobile.any()&&!1,R=!x.enabled("hide_study_overlay_legend_item"),N=x.enabled("uppercase_instrument_names"),F=i("uOxu").getLogger("Chart.StudyOverlay"),W=x.enabled("study_overlay_compare_legend_option");n.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 s(0,e.coordinate)],this._color=e.color)}},n.prototype.renderer=function(){var e={};return e.width=this._model.timeScale().width(),e.height=this._source.priceScale().height(),e.points=this._points,e.color=this._color,e.linewidth=1,e.linestyle=CanvasEx.LINESTYLE_DOTTED,e.visible=this._visible,this._lineRenderer.setData(e),this._lineRenderer},inherit(r,l),r.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},r.prototype.symbol=function(){var e,t=this.properties().inputs.symbol.value(),i=this._resolvedSymbols?this._resolvedSymbols[t]:null;return e=i?i.name:t,N?e.toUpperCase():e},r.prototype.currency=function(){return O(this.symbolInfo())},r.prototype.lastValueData=function(e,t,i){var n,o,r,s,l,u,h,d,p,_,f,m,y,g={noData:!0};if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return g;if(null===(n=this._model.timeScale().visibleBarsStrictRange()))return g;if(!this.properties().visible.value())return g;if(null==(o=this.nearestIndex(n.lastBar(),c.NearestLeft,TradingView.OPEN_PLOT)))return g;if(s=null!==(r=this._lastNonEmptyPlotRow(TradingView.CLOSE_PLOT))&&n.contains(r.index),l=null!==r?r.value:null,null===(u=t||s?l:this.data().valueAt(o)))return g;if(h=this._barFunction(u),!isNumber(h))return g;if(d={noData:!1},i&&(d.price=h),!(p=this.firstValue()))return g;switch(d.text=this.priceScale().formatPrice(h,p),d.text=this.priceScale().formatPrice(h,p),d.formattedPriceAbsolute=this.priceScale().formatPriceAbsolute(h),d.formattedPricePercentage=this.priceScale().formatPricePercentage(h,p),d.floatCoordinate=this.priceScale().priceToCoordinate(h,p,!0),d.coordinate=Math.round(d.floatCoordinate),d.item=u,
+(_=this.properties()).style.value()){case a.STYLE_BARS:d.color=u[TradingView.OPEN_PLOT]<=u[TradingView.CLOSE_PLOT]?_.barStyle.upColor.value():_.barStyle.downColor.value();break;case a.STYLE_CANDLES:case a.STYLE_HOLLOW_CANDLES:d.color=u[TradingView.OPEN_PLOT]<=u[TradingView.CLOSE_PLOT]?_.candleStyle.upColor.value():_.candleStyle.downColor.value();break;case a.STYLE_LINE:d.color=_.lineStyle.color.value();break;case a.STYLE_AREA:d.color=_.areaStyle.color1.value();break;case a.STYLE_BASELINE:f=_.baselineStyle,m=this.priceScale(),y=Math.round(m.height()*(Math.abs(100-f.baseLevelPercentage.value())/100)),d.color=d.coordinate
0),n?{left:0,right:1,totallySlots:e}:{left:1,right:0,totallySlots:e}):{left:o,right:r,totallySlots:o+r}},r.prototype.startScalePrice=function(e,t,i){e.startScalePrice(t,i)},r.prototype.scalePriceTo=function(e,t,i){e.scalePriceTo(t,i),this.mainSeries().priceScale().isLockScale()?this.lightUpdate():this.invalidate(this._paneInvalidationMask(e,E.Light)),this._setScalesResetAvailable(!0)},r.prototype.endScalePrice=function(e,t){e.endScalePrice(t),this.invalidate(this._paneInvalidationMask(e,E.Light))},r.prototype.startScrollPrice=function(e,t,i){e.startScrollPrice(t,i)},r.prototype.scrollPriceTo=function(e,t,i){e.scrollPriceTo(t,i),this.invalidate(this._paneInvalidationMask(e,E.Light))},r.prototype.endScrollPrice=function(e,t){e.endScrollPrice(t),this.invalidate(this._paneInvalidationMask(e,E.Light))},r.prototype.setPriceAutoScale=function(e,t,i){e.setPriceAutoScale(t,i),this.invalidate(this._paneInvalidationMask(e,E.Light))},r.prototype.restorePriceScaleState=function(e,t,i){e.restorePriceScaleState(t,i),this.invalidate(this._paneInvalidationMask(e,E.Light))},r.prototype.resetPriceScale=function(e,t){this._setScalesResetAvailable(!1),e.resetPriceScale(t),this.invalidate(this._paneInvalidationMask(e,E.Light))},r.prototype.updateScales=function(e,t){this._undoModel._chartWidget._updateScalesActions()},r.prototype.startScaleTime=function(e){this._timeScale.startScale(e)},r.prototype.mainSeriesScaleRatioProperty=function(){return this._mainSeriesScaleRatioProperty},r.prototype.mainSeriesScaleRatioPropertyOnChanged=function(){
+this._mainSeriesScaleRatioProperty.listeners().fire(this._mainSeriesScaleRatioProperty)},r.prototype.mainSeriesScaleRatio=function(){return ee(this._timeScale,this.m_mainSeries.priceScale())},r.prototype.setMainSeriesScaleRatio=function(e){this.paneForSource(this.m_mainSeries).applyPriceScaleRatio(this.m_mainSeries.priceScale(),e)},r.prototype.scaleTimeTo=function(e){this._timeScale.scaleTo(e),this.recalculateAllPanes(),this.lightUpdate(),this._setScalesResetAvailable(!0)},r.prototype.endScaleTime=function(){this._timeScale.endScale(),this.lightUpdate(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources())},r.prototype.startScrollTime=function(e){this._timeScale.startScroll(e),this._isTimeScrolling=!0},r.prototype.scrollTimeTo=function(e){this._timeScale.scrollTo(e),this.recalculateAllPanes(),this.updateCrossHair(),this.lightUpdate(),this._setScalesResetAvailable(!0)},r.prototype.endScrollTime=function(){this._timeScale.endScroll(),this.lightUpdate(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this._isTimeScrolling=!1},r.prototype.recalcStudyBasedLineTools=function(){this.dataSources().forEach(function(e){P(e)&&e.recalcStudyIfNeeded&&e.recalcStudyIfNeeded()})},r.prototype.recalcVisibleRangeStudy=function(e,t){void 0!==this._recalcVRTimerId&&clearTimeout(this._recalcVRTimerId);var i=this;this._recalcVRTimerId=setTimeout(function(){i._recalcVisibleRangeStudy(e,t)},500)},r.prototype._recalcVisibleRangeStudy=function(e,t){var i,n,o,r,s,a,l,c,u,h,d,p,_,f,m,y;if(!this.timeScale().isEmpty()&&(i=this.timeScale().visibleBarsStrictRange(),n=this.mainSeries().nearestData(i.firstBar(),z.NearestRight),o=this.mainSeries().nearestData(i.lastBar(),z.NearestLeft),r=this.mainSeries().bars().lastIndex(),s=n?n.index:void 0,a=o?o.index:void 0,l=s===this._oldStartVisibleIndex,c=a===this._oldEndVisibleIndex,!l||!c||t))for(this._oldStartVisibleIndex=s,this._oldEndVisibleIndex=a,u={first_visible_bar_time:1e3*Math.floor(n&&n.value?n.value[TradingView.TIME_PLOT]:0),last_visible_bar_time:1e3*Math.floor(o&&o.value?o.value[TradingView.TIME_PLOT]:0),subscribeRealtime:o&&o.index===r},h=0;h0&&m.listeners().fire(m)}},r.prototype.onResetScales=function(){return this._resetScales},r.prototype.resetTimeScale=function(){this._timeScale.restoreDefault(),this.recalculateAllPanes(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this.updateCrossHair(),this.lightUpdate(),this._resetScales.fire(),this._setScalesResetAvailable(!1)},r.prototype.restoreTimeScaleState=function(e){this._timeScale.restoreState(e),this.recalculateAllPanes(),this.updateCrossHair(),this.lightUpdate(),this._setScalesResetAvailable(!0)},r.prototype.restoreFactoryDefaults=function(e){e.restoreFactoryDefaults(),this.recalcVisibleRangeStudy(this.dataSources(),!0)},
+r.prototype.selectionMacro=function(e){var t,i,n=this.selection().sources();e({removeSourceFromSelection:function(e){this._selection.remove(e)}.bind(this),addSourceToSelection:function(e,t){var i=this._selection.isSelected(e);i&&this._lastHittestData===t||e&&e.customization&&e.customization.disableSelection||(this._lastHittestData=t,i||this._selection.add(e))}.bind(this),clearSelection:function(){this._selection.clear()}.bind(this),selection:this.selection.bind(this)}),t=ie(n,this.selection().sources()),(i=ie(this.selection().sources(),n)).concat(n).forEach(function(e){e.updateAllViews()}),TradingView.alertsDispatcher&&(t.filter(function(e){return e.hasAlert&&e.hasAlert.value()}).forEach(function(e){e.getAlert({fromCache:!0}).done(function(e){e&&e.set("selected",!1)})}),i.forEach(function(e){e.hasAlert&&e.hasAlert.value()&&e.getAlert({fromCache:!0}).done(function(e){e&&e.set("selected",!0)})})),this.lightUpdate(),this.setHoveredSource(null),(t.length>0||i.length>0)&&this._selectedSourceChanged.fire()},r.prototype.checkLineToolSelection=function(){this._selection.checkLineToolSelection()},r.prototype.onSelectedSourceChanged=function(){return this._selectedSourceChanged},r.prototype.selection=function(){return this._selection},r.prototype.invalidate=function(e){this._invalidateHandler&&this._invalidateHandler(e)},r.prototype.dataSources=function(){var e,t,i,n=[];for(n.push(this.m_crossHairSource),e=0;e0)for(s=this.dataSources(),a=0;a0&&(a=n-i,l=s?null:t.rightOffset()-a,!this._options.shiftVisibleRangeOnNewBar&&s&&((c=t.width()/(r.length()+a))>=t.minBarSpacing()?(t.setBarSpacing(c),l=t.rightOffset()+a):o.lastBar()!==i&&(l=t.rightOffset()-a)),null!==l&&t.setRightOffset(l))),t.setBaseIndex(n))},r.prototype.recalculatePane=function(e){e&&e.recalculate()},r.prototype.paneForSource=function(e){for(var t=this._panes.length-1;t>=0;t--)if(-1!==this._panes[t].dataSources().indexOf(e))return this._panes[t];return e instanceof M?this.paneForSource(this.m_mainSeries):null},r.prototype.recalculateAllPanes=function(){for(var e=0;e1},r.prototype.createLineTool=function(e,t,i,n,o,r){var s,a,l,c,u,h,d,_;return b(i)?("LineToolExecution"!==i&&le("drawings","Study_Drawing_"+i),n&&(s=n.state(),n=S(i,s)),a=v(i,this,n,null),n||(n=a.properties()),l=!a.linkKey&&!o,Y.drawOnAllCharts().value()?a.linkKey=o||Z.randomHash():a.linkKey=o,a.toolname=i,a.setOwnerSource(r||e.mainDataSource()),c=e.defaultPriceScale(),e.addDataSource(a,c),a.isFixed()?(h=e.mainDataSource().firstValue(),d=this._timeScale.indexToCoordinate(t.index),_=c.priceToCoordinate(t.price,h),u=a.addFixedPoint(new p(d,_))):u=a.addPoint(t),u||(this._lineBeingCreated=a,this._paneBeingCreatedLineOn=e),l&&a.enableCurrentIntervalVisibility(),this.fullUpdate(),a):null},r.prototype.lineBeingCreated=function(){return this._lineBeingCreated},r.prototype.paneBeingCreatedLineOn=function(){return this._paneBeingCreatedLineOn},r.prototype.coninueCreatingLine=function(e,t,i,n){var o,r=this._lineBeingCreated.addPoint(e,t,i);return this._lineBeingCreated.updateAllViews(),o=new k(E.Light),r&&(this._paneBeingCreatedLineOn=null,this._lineBeingCreated=null),this.invalidate(o),r},r.prototype.cancelCreatingLine=function(){if(this._lineBeingCreated){var e=this._lineBeingCreated;this.removeSource(this._lineBeingCreated),this._lineBeingCreated=null,this._lineCancelled.fire(),Y.drawOnAllCharts().value()&&!e.properties().singleChartOnly&&Y.cancelLineTool({model:this})}},r.prototype.startChangingLinetool=function(e,t,i,n){var o,r,s;this._lineBeingEdited=e,Y.isToolEditingNow.setValue(!0),this._linePointBeingEdited=i,this._lineBeingEdited.startChanging(i,t),o=this.paneForSource(e),this._lineBeingEdited.startDragPoint&&this._lineBeingEdited.startDragPoint(i,t),this._lineBeingEdited.setPoint(i,t,n),this._lineBeingEdited.updateAllViews(),(r=this._paneInvalidationMask(o,E.Light)).force=!0,this.invalidate(r),e.linkKey&&!e.properties().singleChartOnly&&(s=this.externalTimeStamp(t.index),Y.startChangingLineTool({linkKey:e.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:t.price,timeStamp:s},pointIndex:i,envState:n}))},r.prototype.lineBeingEdited=function(){return this._lineBeingEdited},r.prototype.linePointBeingEdited=function(){return this._linePointBeingEdited},r.prototype.changeLinePoint=function(e,t){var i,n,o,r,s,a=this.paneForSource(this._lineBeingEdited);void 0!==e.x&&void 0!==e.y?(o=this._lineBeingEdited.priceScale(),r=a.mainDataSource().firstValue(),i=o.coordinateToPrice(e.y,r),n=Math.round(this.timeScale().coordinateToIndex(e.x)),i=this._magnet.align(i,n,a),this._lineBeingEdited.setPoint(this._linePointBeingEdited,{price:i,index:n
+},t)):this._lineBeingEdited.setPoint(this._linePointBeingEdited,e,t),this._lineBeingEdited.updateAllViews(),this.lightUpdate(),this._lineBeingEdited.linkKey&&!this._lineBeingEdited.properties().singleChartOnly&&(s=this.externalTimeStamp(n),Y.changeLineTool({linkKey:this._lineBeingEdited.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:i,timeStamp:s},envState:t}))},r.prototype.endChangingLinetool=function(e){var t,i=this._lineBeingEdited;this._lineBeingEdited.endChanging(!1,e),this._lineBeingEdited=null,Y.isToolEditingNow.setValue(!1),this._linePointBeingEdited=null,this.lightUpdate(),t={points:i._timePoint,interval:this.mainSeries().interval()},i.linkKey&&!i.properties().singleChartOnly&&Y.finishChangingLineTool({model:this,linkKey:i.linkKey,symbol:this.mainSeries().symbol(),finalState:t})},r.prototype.startMovingSources=function(e,t,i,n){var o,r,s;this._sourcesBeingMoved=e,this._linePointBeingMoved=i,o=this,this._sourcesBeingMoved.forEach(function(e){var r,s;e.startMoving(t,i,n),r=o.paneForSource(e),(s=o._paneInvalidationMask(r,E.Light)).force=!0,o.invalidate(s)}),(r=e.filter(function(e){return e.linkKey&&!e.properties().singleChartOnly}).map(function(e){return e.linkKey})).length&&(s=o.externalTimeStamp(t.logical.index),Y.startMovingLineTool({linkKeys:r,model:o,symbol:o.mainSeries().symbol(),point:{price:t.logical.price,timeStamp:s},envState:n}))},r.prototype.sourcesBeingMoved=function(){return this._sourcesBeingMoved},r.prototype.moveSources=function(e,t){var i,n,o=this;this._sourcesBeingMoved.filter(function(e){return!e.isLocked||!e.isLocked()}).forEach(function(i){i.move(e,o._linePointBeingMoved,t)}),this.lightUpdate(),i=this._sourcesBeingMoved.filter(function(e){return!e.properties().singleChartOnly&&!!e.linkKey}).map(function(e){return e.linkKey}),n=o.externalTimeStamp(e.logical.index),Y.moveLineTool({linkKeys:i,model:o,point:{price:e.logical.price,timeStamp:n},envState:t})},r.prototype.endMovingSources=function(e){var t,i,n=this;this._sourcesBeingMoved.forEach(function(t){var i,o=n.paneForSource(t);t.endMoving(e),(i=n._paneInvalidationMask(o,E.Light)).invalidateAll(E.Light),i.force=!0,n.invalidate(i)}),t=this._sourcesBeingMoved.filter(function(e){return!e.properties().singleChartOnly&&!!e.linkKey}).map(function(e){return e.linkKey}),i=this._sourcesBeingMoved.filter(function(e){return!e.properties().singleChartOnly&&!!e.linkKey}).map(function(e){return{points:e._timePoint,interval:n.mainSeries().interval()}}),t.length&&Y.finishMovingLineTool({linkKeys:t,model:n,finalStates:i}),this._sourcesBeingMoved=[],this._linePointBeingMoved=null},r.prototype.finishLineTool=function(e){var t=this.lineBeingCreated();t&&(t.finish&&t.finish(),!e&&Y.drawOnAllCharts().value()&&t.linkKey&&!t.properties().singleChartOnly&&Y.finishLineTool({linkKey:t.linkKey,model:this}))},r.prototype.calculateDefaultTags=function(){var e,t,i=[],n=this.dataSources();for(e=0;e-1&&this._modelIntervals.splice(t,1)},r.prototype.clearIntervals=function(){for(var e=0;e=0?_.SeriesBarColorer.upColor(this._series.properties()):_.SeriesBarColorer.downColor(this._series.properties()):n(p,null!=(I=this._series.barColorer().barStyle(u,!1)).barBorderColor?I.barBorderColor:I.barColor)),L=0,M=this._items;L>>4==7)return!1;switch(e^i){case r.Modifiers.Alt:return(38===i||40===i)&&"SELECT"===t.tagName||n(t);case r.Modifiers.Alt+r.Modifiers.Shift:return n(t);case r.Modifiers.Mod:return!(67!==i&&(r.isMacKeyboard||45!==i)||!(o=t.ownerDocument&&t.ownerDocument.getSelection())||o.isCollapsed)||n(t);case r.Modifiers.Mod+r.Modifiers.Shift:return i>=33&&i<=40&&n(t);case r.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}i.d(t,"b",function(){return n}),i.d(t,"a",function(){return o});var r=i("/3z9")},dDSx:function(e,t,i){"use strict";(function(e){function n(t,i,n,o,r,s,a,l,c){I.call(this,a),this._chartWidget=s,this.m_model=new T(t,i,n,o,r,this,l,c),this.m_zoomStack=new N,this._onSimpleZoomIn=new e,this._onSimpleZoomOut=new e,this._currentCustomMoveSource=null,this._currentLineMoveCommand=null,this.beginUndoMacro=a.beginUndoMacro.bind(a),this.endUndoMacro=a.endUndoMacro.bind(a),this.createUndoCheckpoint=a.createUndoCheckpoint.bind(a),this.undoToCheckpoint=a.undoToCheckpoint.bind(a)}function o(e,t,i,n){F.call(this,i),this._priceScale=t,this._newMode=e,this._model=n}function r(e,t,i,n){F.call(this,i),this._property=e,this._newValue=t,this._model=n,this._priceScale=this._model.mainSeries().priceScale()}function s(e,t,i,n){F.call(this,"scale price",!1),this.m_model=e,this.m_pane=t,this.m_priceScale=i,this.m_state=n,this.m_newPriceScaleState=null}function a(e,t,i,n){this._model=e,this._series=t,this._oldSymbol=t.symbol(),this._oldInterval=t.interval(),this._symbol=i,this._interval=n}function l(e,t){F.call(this,"Remove Drawing(s)"),this._model=e,this._linetoolsIds=t.map(function(e){return e.id()}),this._statesByPaneIndexes={}}function c(e,t,i,n,o){F.call(this,"Move Drawing(s)",!1),this._model=e,this._sourceIds=t.map(function(e){return e.id()}),this._points=null,this._origPoints={screen:i.screen.clone(),logical:{index:i.logical.index,price:i.logical.price}},
+this._pointIndex=n,this._envState=o}function u(e,t,i){F.call(this,"Move "+t[0].title()+" "+(i>0?"Forward":"Backward")),this._model=e,this._sourcesIds=t.map(function(e){return e.id()}),this._shift=i}function h(e,t,i,n,o,r){F.call(this,"Zoom"),this._model=e,this._startBar=t,this._endBar=i,this._startPrice=n,this._endPrice=o,this._pane=r}function d(e,t,i){F.call(this,"Zoom"),this._baseCmd=e,this._zoomStack=t,this._inOut=i}function p(e,t,i,n,o){F.call(this,"",!1),this._model=e,this._paneA=t,this._paneB=i,this._prevStretchA=n,this._currStretchA=o}function _(e,t,i){F.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=C({},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.showStudyPlotLabels,delete this._newChartProps.scalesProperties.showFundamentalNameLabel,delete this._newChartProps.scalesProperties.showFundamentalLastValue,e.timeScale().preserveBarSpacing()&&delete this._newChartProps.scalesProperties.barSpacing,this._newSeriesProps=C({},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().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)}function f(e,t,i,n,o){F.call(this,e),this._property=t,this._value=i,this._forceSetProperty=o,this._prevValue=t.value(),this._cw=n}function m(e,t){
+F.call(this,"Stop Sincing Drawing"),this._model=e,this._sourceId=t.id(),this._linkKey=t.linkKey}function y(e,t,i){F.call(this,"Paste Drawing"),this._model=e,this._clipboardData=t,this._paneIndex=this._model.panes().indexOf(i||this._model.paneForSource(this._model.mainSeries())),this._source=null}function g(e,t){F.call(this,"Paste Indicator"),this._model=e,this._clipboardData=t}function v(e,t){F.call(this,"Move",!1),this._origPoint=e.clone(),this._point=null,this._handler=t}var S=i("aO4+").Point,b=i("CW80"),w=b.isLineTool,P=i("Ss5c").LineDataSource,C=i("FIi8").deepExtend,T=i("OK+B"),x=i("beCu").doAnimate,I=i("onDC").ChartUndoModelBase,L=i("Ocx9"),M=L.saveDefaultProperties,A=i("GVQo"),k=i("qJq3").Series,E=i("GVHu"),O=E.Study,D=i("8sOK").StudyStub,V=i("0YCj"),B=i("0waE"),R=i("7MZv").showTooManyStudiesNotice,N=i("MY2c").UndoStack,F=i("RDU5").UndoCommand,W=i("Ltzl").SaveLineToolStateUndoCommand,j=i("YlKu").ApplyLineToolTemplateUndoCommand,U=i("s9sR").SetResolutionUndoCommand,z=i("8C8C").RestoreFactoryDefaultsUndoCommand,H=i("/ToI"),Y=H.MoveToNewPriceScaleUndoCommand,G=H.MoveToExistingPriceScaleUndoCommand,q=i("2OVc").InsertStudyCommand,K=i("FKaq").SetPriceScaleSelectionStrategyCommand,Z=i("/YGI").StudyInserter,J=i("PC8g").trackEvent,X=i("Fixu").trackDrawingPasted,Q=i("uOxu").getLogger("Chart.ChartUndoModel"),$=i("QTwd").RestoreDefaultsPreferencesUndoCommand,ee=i("bJYc").SetPropertyUndoCommand;inherit(n,I),n.prototype.version=function(){return this.m_model._version},n.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)}},n.prototype.paneForSource=function(e){return this.m_model.paneForSource(e)},n.prototype.createPane=function(e){return this.m_model.createPane(e)},n.prototype.readOnly=function(){return this.m_model.readOnly()},n.prototype.restart=function(){this.m_model.restart()},n.prototype.disconnect=function(){this.m_model.disconnect()},n.prototype.studiesMetaData=function(){return this.m_model.studiesMetaData()},n.prototype.studyVersioning=function(){return this.m_model.studyVersioning()},n.prototype.chartModel=function(){return this._model()},n.prototype._model=function(){return this.m_model},n.prototype.pushUndoCommand=function(e){this._pushUndoCommand(e)},n.prototype._pushUndoCommand=function(e){this._undoHistory.pushUndoCommand(e)},n.prototype.startScalePrice=function(e,t,i){this.pushUndoCommand(new s(this.m_model,e,t,t.state())),this.chartModel().startScalePrice(e,t,i)},n.prototype.scalePriceTo=function(e,t,i){this.chartModel().scalePriceTo(e,t,i)},n.prototype.endScalePrice=function(e,t){this.chartModel().endScalePrice(e,t)},n.prototype.startScrollPrice=function(e,t,i){t.isAutoScale()||(this._initialPriceScrollState=t.state(),this._initialPriceScrollPos=i,this.chartModel().startScrollPrice(e,t,i))},n.prototype.scrollPriceTo=function(e,t,i){
+t.isAutoScale()||(this._initialPriceScrollPos&&Math.abs(this._initialPriceScrollPos-i)>20&&(this.pushUndoCommand(new s(this.m_model,e,t,this._initialPriceScrollState)),delete this._initialPriceScrollState,delete this._initialPriceScrollPos),this.chartModel().scrollPriceTo(e,t,i))},n.prototype.endScrollPrice=function(e,t){t.isAutoScale()||(delete this._initialPriceScrollState,delete this._initialPriceScrollPos,this.chartModel().endScrollPrice(e,t))},n.prototype.setPriceAutoScale=function(e,t,i){this.pushUndoCommand(new s(this.m_model,e,t,t.state())),this.chartModel().setPriceAutoScale(e,t,i)},n.prototype.resetPriceScale=function(e,t){this.pushUndoCommand(new s(this.m_model,e,t,t.state())),this.chartModel().resetPriceScale(e,t)},n.prototype.setWidth=function(e){this.m_model.setWidth(e)},n.prototype.setPaneHeight=function(e,t){this.m_model.setPaneHeight(e,t)},n.prototype.gridSource=function(){return this.m_model.gridSource()},n.prototype.watermarkSource=function(){return this.m_model.watermarkSource()},n.prototype.addAlertsSource=function(e){return this.m_model.addAlertsSource(e)},n.prototype.alertsSources=function(){return this.m_model.alertsSources()},n.prototype.publishedChartsTimelineSource=function(){return this.m_model.publishedChartsTimelineSource()},n.prototype.barsMarksSources=function(){return this.m_model.barsMarksSources()},n.prototype.crossHairSource=function(){return this.m_model.crossHairSource()},n.prototype.model=function(){return this.m_model},n.prototype.chartWidget=function(){return this._chartWidget},n.prototype.mainSeries=function(){return this.m_model.m_mainSeries},n.prototype.mainSeriesScaleRatioProperty=function(){return this.m_model.mainSeriesScaleRatioProperty()},n.prototype.panes=function(){return this.m_model.panes()},n.prototype.timeScale=function(){return this.m_model.timeScale()},n.prototype.selectionMacro=function(e){return this.m_model.selectionMacro(e)},n.prototype.setHoveredSource=function(e,t){this.m_model.setHoveredSource(e,t)},n.prototype.selection=function(){return this.m_model.selection()},n.prototype.onSelectedSourceChanged=function(){return this.m_model.onSelectedSourceChanged()},n.prototype.hoveredSource=function(){return this.m_model.hoveredSource()},n.prototype.activeStrategySource=function(){return this.m_model.activeStrategySource()},n.prototype.invalidate=function(e){this.m_model.invalidate(e)},n.prototype.setCurrentPosition=function(e,t,i,n){this.m_model.setCurrentPosition(e,t,i,n)},n.prototype.setAndSaveCurrentPosition=function(e,t,i,n){this.m_model.setAndSaveCurrentPosition(e,t,i,n)},n.prototype.modifySeries=function(e,t,i){var n=new a(this.m_model,e,t,i);this.pushUndoCommand(n)},n.prototype.canCreateStudy=function(e){return this.model().chartApi().chartApi().isCanCreateStudy(e)},n.prototype.checkIfFeatureAvailable=function(e,t){var i=this.canCreateStudy(),n=t&&t instanceof O;return!this.readOnly()&&n&&(i=this.canCreateStudy(!0)),!!i||(n||R(),!1)},n.prototype._insertStudy=function(e,t,i,n,o,r,s,a){var l=new q(this.m_model,e,t,i,n,o,r,s,a||null,"Insert "+e.description)
+;return this.pushUndoCommand(l),l.insertedStudy()},n.prototype.insertStudyWithoutCheck=function(e){return this._insertStudy(e)},n.prototype.createStudyInserter=function(e,t,i){var n,o=this,r=null,s={createStudy:function(e,t,i,n,s,a,l,c){return o.checkIfFeatureAvailable(e,a)?(J("studies","Study_"+e.id),"Compare@tv-basicstudies"===e.id&&J("compare","symbol:"+t.symbol),o._insertStudy(e,t,n,s,a,l,c,r)):(Q.logNormal("Cannot insert study "+e.id),null)}};return void 0!==i&&(s.createStub=function(){var e=o.m_model.insertStudyStub(i);return r={targetPaneId:o.m_model.paneForSource(e).id(),targetZOrder:e.zorder()},e.id()},s.removeStub=function(e){return o.m_model.removeStudyStub(e)}),(n=new Z(e,this.m_model._studiesMetaInfoRepository,s)).setParentSource(t),n},n.prototype.setProperty=function(e,t,i,n){if(e&&e.value()!==t){var o=new ee(e,t,i,this.m_model,n);this.pushUndoCommand(o),this.emitEvent("setProperty")}},n.prototype.setProperties=function(e,t,i){var n=this;this.beginUndoMacro(i),this.m_model.selectionMacro(function(){for(var o=0;o0&&t.reverse(),t.forEach(function(t){e._model.changeZOrder(t,e._shift)})},n.prototype.removePane=function(e){var t=this.m_model.panes()[e].dataSources().slice();this._removeSources(t,!1,"Remove pane")},inherit(h,F),h.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)},h.prototype.undo=function(){this._model.timeScale().restoreState(this._timeScaleState),this._pane.defaultPriceScale().restoreState(this._priceScaleState),this._model.recalculateAllPanes(),this._model.lightUpdate()},inherit(d,F),d.prototype.undo=function(){if(this._inOut){if(this._baseCmd!==this._zoomStack.head())return void Q.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}else this._baseCmd.redo(),this._zoomStack.push(this._baseCmd)},d.prototype.redo=function(){if(this._inOut)this._baseCmd.redo(),this._zoomStack.push(this._baseCmd);else{if(this._baseCmd!==this._zoomStack.head())return void Q.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}},inherit(p,F),p.prototype.redo=function(){var e=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._currStretchA,this._paneB._stretchFactor=e-this._currStretchA,this._model.fullUpdate()},p.prototype.undo=function(){var e=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._prevStretchA,this._paneB._stretchFactor=e-this._prevStretchA,this._model.fullUpdate()},inherit(_,F),_.prototype._merge=function(e,t,i){var n=this._model;M(!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}),M(!1)},_.prototype.undo=function(){this._merge(this._oldChartProps,this._oldSeriesProps,this._oldSessionsProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},_.prototype.redo=function(){this._merge(this._newChartProps,this._newSeriesProps,this._newSessionProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},inherit(f,F),f.prototype.redo=function(){this._cw.screen.show(),this._property.setValue(this._value,this._forceSetProperty)},f.prototype.undo=function(){this._cw.screen.show(),this._property.setValue(this._prevValue,this._forceSetProperty)},inherit(m,F),m.prototype.redo=function(){delete this._model.dataSourceForId(this._sourceId).linkKey},m.prototype.undo=function(){this._model.dataSourceForId(this._sourceId).linkKey=this._linkKey},inherit(y,F),y.prototype.redo=function(){var e,t,i,n,o,r,s,a=this._model.panes()[this._paneIndex],l=a.dataSourceForId(this._clipboardData.source.ownerSource)||a.mainDataSource();this._sourceState||(e=!0,this._clipboardData.source.state.symbol===((t=a.mainDataSource()).symbol?t.symbol():"")&&(l instanceof k&&(e=!1),l instanceof O&&(e=!l.metaInfo().is_price_study)),delete(i=TradingView.clone(this._clipboardData.source)).state.symbol,e?(n=this._model,o=function(e){var t=e.x*n.timeScale().width(),i=e.y*l.priceScale().height();return new S(t,i)},r=l.firstValue(),i.points=this._clipboardData.geometry.map(function(e){var t=o(e),i=n.timeScale().coordinateToIndex(t.x),s=n.timeScale().normalizeBarIndex(i);return s.price=l.priceScale().coordinateToPrice(t.y,r),s})):this._model._id===this._clipboardData.modelId&&l.id()===this._clipboardData.source.ownerSource&&(i.points=function(e,t){var i,n,o,r,s=t.priceScale(),a=[],l=t.firstValue();for(i=0;i1e-8&&(b=u/c,S+=" ("+(new s.PercentageFormatter).format(100*b)+")"),w=Object(r.forceLTRStr)(S),this._label=w+"\n"+m.format(g),P=Object(o.ensureNotNull)(v.firstValue()),C=this._source.model().timeScale().indexToCoordinate(i.index),T=this._source.model().timeScale().indexToCoordinate(t),x=l.defaultPriceScale().priceToCoordinate(c,P),I=l.defaultPriceScale().priceToCoordinate(e,P),this._p1=new n.Point(C,x),this._p2=new n.Point(T,I),L=this._source.model().timeScale().indexToUserTime(i.index),M=this._source.model().timeScale().indexToUserTime(t),
+A=null,null!==L&&null!==M&&(null!==(k=this._pane.model().mainSeries().symbolInfo())&&k!==this._lastSymbolInfo&&(this._pipFormatter=new a.PipFormatter(k.pricescale,k.minmov,k.type,k.minmove2),this._lastSymbolInfo=k),A=(M.valueOf()-L.valueOf())/1e3),O=null!==(E=this._pipFormatter?this._pipFormatter.format(u):null)?" , "+E:"",V=null!==(D=null!==A?y.format(A):null)?", "+Object(r.startWithLTR)(D):"",this._label=Object(r.forceLTRStr)(w+O)+"\n"+m.format(g)+V,B={points:[this._p1,this._p2],linewidth:0,fillBackground:!0,color:"rgba(30,136,229,0.2)",backcolor:"rgba(30,136,229,0.2)"},this._bgRenderer.setData(B),R=this._p1.add(this._p2).scaled(.5),N=l.defaultPriceScale().height(),F=Math.round(R.y),W={points:[new n.Point(this._p1.x,F),new n.Point(this._p2.x,F)],width:this._source.model().timeScale().width(),height:N,color:"#1E88E5",linewidth:2,linestyle:p.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:_.LineEnd.Normal,rightend:_.LineEnd.Arrow},this._horzTrenRenderer.setData(W),j=Math.round(R.x),W={points:[new n.Point(j,this._p1.y),new n.Point(j,this._p2.y)],width:this._source.model().timeScale().width(),height:N,color:"#1E88E5",linewidth:2,linestyle:p.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:_.LineEnd.Normal,rightend:_.LineEnd.Arrow},this._vertTrenRenderer.setData(W),U={x:0,y:10},z=function(e,t){return{points:[t],text:e,color:"#FFFFFF",horzAlign:"center",vertAlign:"middle",font:f.CHART_FONT_FAMILY,offsetX:U.x,offsetY:U.y,bold:!1,italic:!1,fontsize:12,padding:8,highlightBorder:!1,backgroundColor:"rgba(30,136,229,0.9)",backgroundTransparency:10,backgroundVertInflate:5,backgroundHorzInflate:5,backgroundRoundRect:4}},H=.5*(this._p1.x+this._p2.x),Y=this._p2.y,G=new n.Point(H,Y),q=z(Object(o.ensureNotNull)(this._label),G),this._labelRenderer.setData(q),K=this._labelRenderer.measure(),Z=Object(h.calculateLabelPosition)(K,this._p1,this._p2,U,this._pane.height()),this._labelRenderer.setPoints([Z])},e.prototype.renderer=function(){if(null===this._p1||null===this._p2)return null;var e=new d.CompositeRenderer;return e.append(this._bgRenderer),e.append(this._horzTrenRenderer),e.append(this._vertTrenRenderer),e.append(this._labelRenderer),e},e}()},dTSQ:function(e,t,i){"use strict";function n(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}i.r(t),i.d(t,"regExpEscape",function(){return n})},dUDn:function(e,t,i){"use strict";var n,o,r,s;i.r(t),i.d(t,"StandardPivotPointsPriceAxisView",function(){return s}),n=i("mrSG"),o=i("KcY8"),r=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"],s=function(e){function t(t,i){var n,o=e.call(this)||this;return o._source=t,o._data=i,n=i.name,o._completeName="P"===n.toUpperCase()?"P":"S"+n[1]+"/R"+n[1],o}return Object(n.__extends)(t,e),t.prototype._updateRendererData=function(e,t,i){var n,o,s,a,l,c,u,h;e.visible=!1,t.visible=!1,(n=this._source.properties()).visible.value()&&(o=this._completeName,(s=n.levelsStyle.visibility)[o]&&s[o].value()&&(a=this._source.model().timeScale(),l=this._source.priceScale(),
+a.isEmpty()||null===a.visibleBarsStrictRange()||null!==l&&l.isEmpty()||(c=this._source.customData())&&c.pivots&&(u=this._source.pricesView().prices()[r.indexOf(this._data.name.toUpperCase())])&&(i.background=u.color,i.color=this.generateTextColor(u.color),i.coordinate=u.coordinate,i.floatCoordinate=u.floatCoordinate,(h=this._source.model().properties().scalesProperties).showStudyLastValue.value()&&(e.text=u.formatted,e.visible=!0),h.showStudyPlotLabels.value()&&(t.text=this._source.priceLabelText(this._data.name),t.visible=!0))))},t}(o.a)},dfhE:function(e,t,i){"use strict";var n,o,r,s,a,l,c,u,h,d,p,_,f,m,y,g,v,S,b,w,P,C,T,x,I,L,M,A,k,E,O,D;i.r(t),i.d(t,"STATUS_OFFLINE",function(){return r}),i.d(t,"STATUS_RESOLVING",function(){return s}),i.d(t,"STATUS_LOADING",function(){return a}),i.d(t,"STATUS_READY",function(){return l}),i.d(t,"STATUS_INVALID_SYMBOL",function(){return c}),i.d(t,"STATUS_SNAPSHOT",function(){return u}),i.d(t,"STATUS_EOD",function(){return h}),i.d(t,"STATUS_PULSE",function(){return d}),i.d(t,"STATUS_DELAYED",function(){return p}),i.d(t,"STATUS_DELAYED_STREAMING",function(){return _}),i.d(t,"STATUS_NO_BARS",function(){return f}),i.d(t,"STATUS_REPLAY",function(){return m}),i.d(t,"STYLE_LINE_TYPE_MARKERS",function(){return y}),i.d(t,"STYLE_LINE_TYPE_STEP",function(){return g}),i.d(t,"STYLE_LINE_TYPE_SIMPLE",function(){return v}),i.d(t,"STYLE_BARS",function(){return S}),i.d(t,"STYLE_CANDLES",function(){return b}),i.d(t,"STYLE_LINE",function(){return w}),i.d(t,"STYLE_AREA",function(){return P}),i.d(t,"STYLE_RENKO",function(){return C}),i.d(t,"STYLE_KAGI",function(){return T}),i.d(t,"STYLE_PNF",function(){return x}),i.d(t,"STYLE_PB",function(){return I}),i.d(t,"STYLE_HEIKEN_ASHI",function(){return L}),i.d(t,"STYLE_HOLLOW_CANDLES",function(){return M}),i.d(t,"STYLE_BASELINE",function(){return A}),i.d(t,"STYLE_RANGE",function(){return k}),i.d(t,"STYLE_HILO",function(){return E}),i.d(t,"STYLE_SHORT_NAMES",function(){return O}),i.d(t,"SYMBOL_STRING_DATA",function(){return D}),r=0,s=1,a=2,l=3,c=4,u=5,h=6,d=7,p=8,_=9,f=10,m=11,y=0,g=1,v=2,S=0,b=1,w=2,P=3,C=4,T=5,x=6,I=7,L=8,M=9,A=10,k=11,E=12,(n={})[0]="bar",n[1]="candle",n[9]="hollowCandle",n[2]="line",n[3]="area",n[4]="renko",n[7]="pb",n[5]="kagi",n[6]="pnf",n[8]="ha",n[10]="baseline",n[11]="range",n[12]="hilo",O=n,(o={})[4]={type:"BarSetRenko@tv-prostudies",basicStudyVersion:34},o[7]={type:"BarSetPriceBreak@tv-prostudies",basicStudyVersion:34},o[5]={type:"BarSetKagi@tv-prostudies",basicStudyVersion:34},o[6]={type:"BarSetPnF@tv-prostudies",basicStudyVersion:34},o[8]={type:"BarSetHeikenAshi@tv-basicstudies",basicStudyVersion:60},o[11]={type:"BarSetRange@tv-basicstudies",basicStudyVersion:72},D=o},di4O:function(e,t,i){"use strict";function n(){var e,t,i=a.getJSON(u),n=Object.assign({},h,i);return void 0===i&&(void 0!==a.getJSON("chartproperties")&&void 0!==(e=a.getJSON("chartproperties").symbolWatermarkProperties)&&(t=Object(s.tryParseRgba)(e.color),n=Object.assign(n,e),null!==t&&(0!==t[3]?n.visibility=!0:(t[3]=.25,n.color=Object(s.rgbaToString)(t)))),
+delete n.transparency),n}function o(){return null===d&&(d=new c.a(n()),a.onSync.subscribe(null,function(){null!==d&&d.mergeAndFire(n())}),d.listeners().subscribe(null,function(){null!==d&&a.setJSON(u,d.state())})),d}function r(){null!==d&&d.mergeAndFire(h)}var s,a,l,c,u,h,d;i.r(t),i.d(t,"watermarkProperty",function(){return o}),i.d(t,"restoreWatermarkPropertyDefaults",function(){return r}),s=i("eJTA"),a=i("Vdly"),l=i("tc+8"),c=i.n(l),u="symbolWatermark",h={visibility:!1,color:"rgba(80, 83, 94, 0.25)"},d=null},e1ZQ:function(e,t,i){"use strict";var n,o,r,s,a,l,c,u,h,d,p,_,f,m;i.r(t),i.d(t,"dateFormatFunctions",function(){return _}),i.d(t,"availableDateFormats",function(){return f}),i.d(t,"defaultDateFormat",function(){return m}),n=i("YFKU"),o=i("kcTO"),r={1:n.t("Jan"),2:n.t("Feb"),3:n.t("Mar"),4:n.t("Apr"),5:n.t("May"),6:n.t("Jun"),7:n.t("Jul"),8:n.t("Aug"),9:n.t("Sep"),10:n.t("Oct"),11:n.t("Nov"),12:n.t("Dec")},s=function(e,t){return(t?e.getMonth():e.getUTCMonth())+1},a=function(e,t){return t?e.getDate():e.getUTCDate()},l=function(e,t){return t?e.getFullYear():e.getUTCFullYear()},c=function(e,t){return Object(o.numberToStringWithLeadingZero)(a(e,t),2)},u=function(e,t){return r[s(e,t)]},h=function(e,t){return Object(o.numberToStringWithLeadingZero)(s(e,t),2)},d=function(e,t){return Object(o.numberToStringWithLeadingZero)(l(e,t)%100,2)},p=function(e,t){return Object(o.numberToStringWithLeadingZero)(l(e,t),4)},_={"dd MMM 'yy":function(e,t){return c(e,t)+" "+u(e,t)+" '"+d(e,t)},"MMM dd":function(e,t){return u(e,t)+" "+c(e,t)},"yyyy-MM-dd":function(e,t){return p(e,t)+"-"+h(e,t)+"-"+c(e,t)},"yy-MM-dd":function(e,t){return d(e,t)+"-"+h(e,t)+"-"+c(e,t)},"yy/MM/dd":function(e,t){return d(e,t)+"/"+h(e,t)+"/"+c(e,t)},"yyyy/MM/dd":function(e,t){return p(e,t)+"/"+h(e,t)+"/"+c(e,t)},"dd-MM-yyyy":function(e,t){return c(e,t)+"-"+h(e,t)+"-"+p(e,t)},"dd-MM-yy":function(e,t){return c(e,t)+"-"+h(e,t)+"-"+d(e,t)},"dd/MM/yy":function(e,t){return c(e,t)+"/"+h(e,t)+"/"+d(e,t)},"dd/MM/yyyy":function(e,t){return c(e,t)+"/"+h(e,t)+"/"+p(e,t)},"MM/dd/yy":function(e,t){return h(e,t)+"/"+c(e,t)+"/"+d(e,t)},"MM/dd/yyyy":function(e,t){return h(e,t)+"/"+c(e,t)+"/"+p(e,t)}},f=Object.keys(_),m=function(){return-1!==["ja","ko","zh","zh_TW"].indexOf(window.language||"")?"yyyy-MM-dd":"dd MMM 'yy"}},e92V:function(e,t,i){"use strict";function n(e){return!1}function o(e){return e in r||!1}var r;i.d(t,"b",function(){return n}),i.d(t,"a",function(){return o}),r=i("OH2X")},eJTA:function(e,t,i){"use strict";function n(e,t,i){return M.isNaN(t)?e:ti?i:Math.round(t)}function o(e,t,i){return M.isNaN(t)?e:ti?i:Math.round(1e4*t)/1e4}function r(e){return n(0,e,255)}function s(e){return n(0,e,255)}function a(e){return n(0,e,255)}function l(e){return o(0,e,1)}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 _(e){var t,i=e[0],n=e[1],o=e[2],r=i/255,s=n/255,a=o/255,l=Math.min(r,s,a),c=Math.max(r,s,a),u=0,h=0,d=(l+c)/2;if(l===c)u=0,
+h=0;else switch(t=c-l,h=d>.5?t/(2-c-l):t/(c+l),c){case r:u=((s-a)/t+(s1&&(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 m(e){var t,i,n,o,l,c=e[0],u=e[1],h=e[2];return 0===u?t=i=n=h:(t=f(l=2*h-(o=h<.5?h*(1+u):h+u-h*u),o,c+1/3),i=f(l,o,c),n=f(l,o,c-1/3)),[r(255*t),s(255*i),a(255*n)]}function y(e){return A[0]*e[0]+A[1]*e[1]+A[2]*e[2]}function g(e,t,i){var n,o;return void 0===i&&(i=.05),o=(n=_(e))[0]+t*i,n[0]=c(o-Math.floor(o)),m(n)}function v(e,t,i){var n,o,r,s,a;return void 0===i&&(i=.05),n=e[0],o=e[1],r=e[2],s=e[3],[(a=g([n,o,r],t,i))[0],a[1],a[2],s]}function S(e,t){return t in e}function b(e){var t=E.re.exec(e);return null!==t?E.parse(t):null}function w(e){var t=O.re.exec(e);return null!==t?O.parse(t):null}function P(e){var t=D.re.exec(e);return null!==t?D.parse(t):null}function C(e){var t=V.re.exec(e);return null!==t?V.parse(t):null}function T(e){return"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function x(e){var t,i,n,o,r;if(e=e.toLowerCase(),S(k,e)){if(null!==(t=w(k[e])))return t;throw new Error("Invalid named color definition")}return null!==(i=b(e))?i:null!==(n=w(e))?n:null!==(o=P(e))?o:null!==(r=C(e))?[r[0],r[1],r[2]]:null}function I(e){var t,i,n,o,r;if(e=e.toLowerCase(),S(k,e)){if(null!==(t=w(k[e])))return[t[0],t[1],t[2],1];throw new Error("Invalid named color definition")}return null!==(i=b(e))?[i[0],i[1],i[2],1]:null!==(n=w(e))?[n[0],n[1],n[2],1]:null!==(o=P(e))?[o[0],o[1],o[2],1]:null!==(r=C(e))?r:null}function L(e){var t=I(e);if(null!==t)return t;throw new Error("Passed color string does not match any of the known color representations")}var M,A,k,E,O,D,V;Object.defineProperty(t,"__esModule",{value:!0}),M=i("ivNn"),t.normalizeRedComponent=r,t.normalizeGreenComponent=s,t.normalizeBlueComponent=a,t.normalizeAlphaComponent=l,t.rgb=function(e,t,i){return[r(e),s(t),a(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){var o,c;return Array.isArray(e)?(n=t,[(o=e)[0],o[1],o[2],l(n)]):(c=t,i=i||0,n=n||0,[r(e),s(c),a(i),l(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=c,t.normalizeHslSaturation=u,t.normalizeHsvSaturation=h,t.normalizeLightness=d,t.normalizeValue=p,t.hsl=function(e,t,i){return[c(e),u(t),d(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[c(e),h(t),p(i)]},t.areEqualHsv=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},t.rgbToHsl=_,t.hslToRgb=m,t.rgbToHsv=function(e){var t=e[0],i=e[1],n=e[2],o=t/255,r=i/255,s=n/255,a=Math.min(o,r,s),l=Math.max(o,r,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=((r-s)/c+(r255)throw new Error("invalid threshold value, valid values are [0, 255]");return y(e)>=t?"white":"black"},t.tryParseRgb=x,t.parseRgb=function(e){var t=x(e);if(null!==t)return t;throw new Error("Passed color string does not match any of the known color representations")},t.tryParseRgba=I,t.parseRgba=L},ePL1:function(e,t,i){"use strict";i.r(t),i.d(t,"types",function(){return n});var n={ECONOMIC:"economic",QUANDL:"quandl"}},ei7k:function(e,t,i){"use strict";function n(e){return Object(r.clean)(JSON.stringify(e))}function o(e){return JSON.parse(Object(r.clean)(e,!0))}var r;i.d(t,"b",function(){return n}),i.d(t,"a",function(){return o}),r=i("CLNU")},f3xO:function(e,t,i){"use strict";var n,o,r,s,a,l,c,u,h,d,p;i.r(t),i.d(t,"PaneRendererUnicodeChar",function(){return p}),n=i("mrSG"),o=i("/SnT"),r=i.n(o),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,o=e.call(this,t,i)||this;return o._heightEnsured=Object(s.ensureDefined)(o._height),n=t.char.slice(0,40),o._ch=r()(n)[0]||" ",o._fontFamily=t.fontFamily||h.CHART_FONT_FAMILY,o._charCache=new d.b(o._ch,!1,!1,o._fontFamily,o._heightEnsured),o}return Object(n.__extends)(t,e),t.prototype.hitTest=function(e){var t,i,n,o=Object(u.selectionTolerance)(this._heightEnsured);for(t=0,i=this._items;t0?1:-1,r=t.y+t.vertOffset-o*Math.round(this._heightEnsured/2);i=t.style&&void 0!==t.style.color?t.style.color:this._color,this._charCache.paintTo(e,i,n,r,d.a.Center,t.vertOffset>0?d.c.Middle:d.c.Bottom)},t.prototype._startPath=function(e,t,i){},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,n=i.A*e.x+i.B*e.y+i.C>0;return n===t.isPositive},t.pointInTriangle=function(e,t,i,o){var r=t.add(i).scaled(.5),s=r.add(o).scaled(.5),a=n.intersectLineSegments(t,i,s,e);return null===a&&null===(a=n.intersectLineSegments(i,o,s,e))&&null===(a=n.intersectLineSegments(o,t,s,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){var i,n,o,r=t.length-1,s=!1,a=e.x,l=e.y;for(i=0;i=l||o.y=l)&&n.x+(l-n.y)/(o.y-n.y)*(o.x-n.x)this.timeScale().points().firstIndex()&&e.firstBar()=t.start&&r<=t.end+i&&e.push(o)},this),e},
+r.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},r.prototype._maxPlatesPerBar=10,r.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),[])},r.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"}},r.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"}},r.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())},r.prototype._getIndex=function(e){return this.timeScale().timePointToIndex(e)},r.prototype.getViewData=function(){return{barWidth:this.barWidth(),plates:this.getPlatesViewData(),tooltip:this._tooltip}},r.prototype.barWidth=function(){return this.timeScale().barSpacing()},r.prototype.getPlatesViewData=function(){var e,t,i,n,o,r,s,a=this._model.mainSeries();if(a.data().isEmpty())return[];for(e=d(a.style())?a.barFunction():null,t=this.filterDisplayedPlates(this.getVisibleRangePlates()),i=this,n={},o=this._model.lastHittestData(),r=(t=(t=t.map(function(t){var r,s,a,l,c,u,h,d=this._getIndex(t.tickmark),p=this._getBar(d);return null!==p&&(r=this._layout(t.direction),s=this._theme(t.direction),a=o&&o.id===t.id,l=this.timeScale().indexToCoordinate(d),c=this._offset(r,p,e),u=this.priceScale().isInverted(),h=0,d in n||(n[d]={up:0,down:0}),h=n[d][r]++,TradingView.merge({id:t.id,x:l,y:c,yInverted:u,order:h,direction:r,theme:s,hovered:a,pinned:!0===i.pinnedTooltips[t.id],user__id:t.user__id,label:t.label,labelFontColor:t.labelFontColor||"#444",minSize:t.minSize||5},this._plateViewData(t)))}.bind(this))).filter(function(e){return!!e})).filter(function(e){return!0===e.hovered}),s=0;sthis._loadedRange.end&&(e.start=this._loadedRange.end)),e},r.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},r.prototype._pushGetDataStack=function(e){a(e.start)&&a(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)):p.logError("Wrong tickmark range")},r.prototype.roundRange=function(e){return{start:Math.round(e.start),end:Math.round(e.end)}},r.prototype.refreshData=function(){this.getData(this._lastRange)},r.prototype.getData=function(e){a(e.start)&&a(e.end)?(this._lastRange=e,(e=Object.assign({},e)).end=this._maxDate,this._pushGetDataStack(e)):p.logError("Wrong range")},r.prototype._abortAllRequests=function(){this._requests.forEach(function(e){e.abort()}),this._requests=[],this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._getDataTimeout=this._collectedRange=null},r.prototype.clearMarks=function(){this._abortAllRequests(),this._marks={},this._loadedRange=null},t.BarsMarksContainer=r}).call(this,i("Kxc7"),i("tc+8"),i("aIyQ"))},fgLi:function(e,t,i){"use strict";var n,o,r,s,a,l;i.r(t),i.d(t,"DataSource",function(){return l}),n=i("hY0g"),o=i.n(n),r=i("0waE"),s=i("aIyQ"),a=i.n(s),l=function(){function e(){this.hasAlert=new o.a(!1),this._zorder=0,this.m_priceScale=null,this._id=Object(r.randomHashN)(6),this._ownerSource=null,this._userEditEnabled=!0,this._onPriceScaleChanged=new a.a,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.priceAxisViews=function(e,t){return null},e.prototype.updateAllViews=function(){},e.prototype.paneViews=function(){return null},e.prototype.isFailed=function(){return!1},e.prototype.isLoading=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.getStrategyPropertyPage=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.copiable=function(){return!1},e.prototype.cloneable=function(){return!1},e.prototype.movable=function(){return!1},e}()},fs3R:function(e,t){e.exports=''},fxzW:function(e,t,i){"use strict";var n,o,r;i.r(t),i.d(t,"PaneRendererDiamond",function(){return r}),n=i("mrSG"),o=i("2WC2"),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype._drawItemShape=function(e,t){var i=Math.round(t.height/2),n=t.x,o=t.vertOffset,r=t.y+o;e.moveTo(n,r-i),e.lineTo(n+i,r),e.lineTo(n,r+i),e.lineTo(n-i,r),e.lineTo(n,r-i)},t}(o.a)},g5Qf:function(e,t,i){"use strict";function n(){return a}function o(){null===a&&(a=new Promise(function(e){Promise.all([i.e(22),i.e(29),i.e(32),i.e(65),i.e(18),i.e(25),i.e("line-tools-icons"),i.e(42),i.e("floating-toolbars")]).then(function(t){if(null===s){var n=i("gmn6").FavoriteDrawingToolbar;s=new n({left:window.innerWidth/2,top:r.HEADER_TOOLBAR_HEIGHT_EXPANDED+61}),e(s)}}.bind(null,i)).catch(void 0)}))}var r,s,a;i.r(t),i.d(t,"getFavoriteDrawingToolbarPromise",function(){return n}),i.d(t,"createFavoriteDrawingToolbar",function(){return o}),i("YFKU"),r=i("yMne"),s=null,a=null},gBDZ:function(e,t,i){"use strict";var n,o,r,s,a;i.d(t,"a",function(){return r}),i.d(t,"c",function(){return s}),i.d(t,"b",function(){return a}),n=i("XlJ7"),o=i("Eyy1"),function(e){e.Left="left",
+e.Right="right",e.Center="center"}(r||(r={})),function(e){e.Top="top",e.Bottom="bottom",e.Middle="middle"}(s||(s={})),a=function(){function e(e,t,i,r,s){var a,l,c,u,h,d,p;for(this._canvasesMap={},this._lines=e.split(/[^\S\r\n]*(?:\r\n|\r|\n)/),this._font=function(e,t,i,o){return Object(n.makeFont)(o,i,(e?"bold ":"")+(t?"italic ":""))}(t,i,r,s),this._fontSize=s,this._verticalPadding=~~(s/6),a=document.createElement("canvas"),(l=Object(o.ensureNotNull)(a.getContext("2d"))).font=this._font,c=0,u=0,h=this._lines;u0&&(t=this._strategySources[this._strategySources.length-1],this.setActiveStrategySource(t)),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.updateCrosshair=function(){var e,t,i=this.crossHairSource(),n=i.pane;null!==n&&(e=i.originCoordX(),t=i.originCoordY(),this.setAndSaveCurrentPosition(e,t,n))},e.prototype.zoomTime=function(e,t,i){var n,o;this._zoomEnabled&&((n=this.timeScale()).isEmpty()||0===t||(o=n.width(),e=Math.max(1,Math.min(e,o-2)),n.zoom(e,t,i),this.updateCrosshair(),this.recalculateAllPanes(),this.lightUpdate(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this._setScalesResetAvailable(!0)))},e.prototype.lineToolsGroupModel=function(){return this._lineToolsGroupModel},e.prototype.restoreLineToolsGroups=function(e){this._lineToolsGroupModel=b.LineToolsGroupModel.fromState(this,e)},e.prototype.updateSource=function(e){var t=this._invalidationMaskForSource(e);null!==t&&this.invalidate(t)},e.prototype.replaceStudyStub=function(e,t){var i,n,o,r=this.paneForSource(e);return null!==r&&(i=e.priceScale(),n=e.zorder(),o=e.ownerSource(),this.paneForSource(e)===r?r.replaceSource(e,t,i):(r.insertDataSource(t,i,n),this.removeSource(e)),t.setOwnerSource(o),this.dataSources().forEach(function(i){i.ownerSource()===e&&i.setOwnerSource(t)}),t.start(),this.recalculatePane(r),this.fullUpdate(),!0)},e.prototype.insertStudyStub=function(e){var t=this.mainSeries(),i=Object(o.ensureNotNull)(this.paneForSource(t)),n=new s.StudyStub(this,null,e),r=i.createPriceScaleAtPosition("overlay");return i.addDataSource(n,r,!1),this.recalculatePane(i),this.fullUpdate(),n},e.prototype.removeStudyStub=function(e){var t=this.dataSourceForId(e);return null===t?(x.logNormal("StudyStub id="+e+" is not found in chart model"),!1):(this.removeSource(t),!0)},e.prototype.setHoveredSource=function(e,t){var i,n,o=this._hoveredSource!==e;(o||this._lastHittestData!==t)&&(this._lastHittestData=t,i=null,this._hoveredSource&&(this._hoveredSource.updateAllViews(),i=new p.InvalidateMask,null!==(n=this._invalidationMaskForSource(this._hoveredSource,p.InvalidationLevel.Light))&&i.merge(n)),this._hoveredSource=e,e&&(e.updateAllViews(),i||(i=new p.InvalidateMask),null!==(n=this._invalidationMaskForSource(e,p.InvalidationLevel.Light))&&i.merge(n)),i&&this.invalidate(i),o&&this._hoveredSourceChanged.fire(e))},e.prototype.hoveredSource=function(){return this._hoveredSource},e.prototype.hoveredSourceChanged=function(){
+return this._hoveredSourceChanged},e.prototype.lastHittestData=function(){return this._lastHittestData},e.prototype.findNonOverlayStudyWithGroupingKey=function(e,t){var i,n,o,r=void 0!==t?[t]:this._panes,s=function(t){var i=t.dataSources().find(function(i){return Object(l.isStudy)(i)&&i.metaInfo().groupingKey===e&&!t.isOverlay(i)});if(void 0!==i)return{value:{pane:t,study:i}}};for(i=0,n=r;i=0&&e'+e+""}),o.innerHTML=(t=r.text).format.apply(t,s).replace(/\s\+\s/g,'+'),l.classList.add(L["common-tooltip__body--with-hotkey"]),n&&o.classList.add(L["common-tooltip__hotkey-block--divider"]),l.appendChild(o)),a.addEventListener("contextmenu",I.a),a}function l(e,t){var i,n,o,r,s,a,l,c,d,p,_,f,m,y,g=t.rect;g&&(!function(e,t){var i,n=w.includes(t)?b[t]:"";(i=e.classList).remove.apply(i,w.map(function(e){return b[e]}).filter(function(e){return!!e})),n&&!e.classList.contains(n)&&e.classList.add(n)}(e,t.colorTheme||"default"),t.addClass&&e.classList.add(t.addClass),(i=h(e)).classList.toggle(L["common-tooltip__body--width_wide"],Boolean(t.wide)),i.classList.toggle(L["common-tooltip__body--no-padding"],Boolean(t.noPadding)),i.classList.toggle(L["common-tooltip__body--width_narrow"],Boolean(t.narrow)),i.classList.toggle(L["common-tooltip__body--no-buttons"],!0),e.classList.toggle(L["common-tooltip--no-pointer-events"],!Modernizr.pointerevents),i.style.left=u(0),i.style.width=u(i.clientWidth+(Boolean(t.noPadding)?0:2)),n=document.body.clientWidth,o=window.innerHeight,s=(r=t.vertical)&&g.w<20||!r&&g.h<20,e.classList.toggle(L["common-tooltip--farther"],s),e.classList.toggle(L["common-tooltip--vertical"],r),e.classList.toggle(L["common-tooltip--horizontal"],!r),a=e.querySelector("."+L["common-tooltip__ear-holder"]),l="",r?(e.style.left=u(g.x+g.w),e.style.top=u(g.y-(e.offsetHeight-g.h)/2),c=(e.querySelector(":last-child")||i).getBoundingClientRect().right+M>n,e.classList.toggle(L["common-tooltip--direction_reversed"],c),e.classList.toggle(L["common-tooltip--direction_normal"],!c),l=c?"after":"before",Object(x.isRtl)()?(l=t.otr?"after":l,l=t.otl?"before":l):(l=t.otr?"before":l,l=t.otl?"after":l),a.classList.toggle(L["common-tooltip__ear-holder--before"],"before"===l),a.classList.toggle(L["common-tooltip__ear-holder--after"],"after"===l),"after"===l&&(e.style.left="auto",e.style.right=u(n-g.x))):(d=g.x-(i.offsetWidth-g.w)/2,p=n-M-e.offsetWidth,_=Math.max(M,Math.min(d,p)),e.style.bottom=u(o-g.y),e.style.left=u(_),c=p\n\t\t\n\t\t\n\t \n',k='\n\t\n',E='\n\t\n',O=Object(T.parseHtmlElement)(A),D=Object(T.parseHtmlElement)(k),V=Object(T.parseHtmlElement)(E),B=i("lxNp"),i.d(t,"showOnElement",function(){return U}),i.d(t,"show",function(){return z}),i.d(t,"updateTooltipText",function(){return H}),i.d(t,"hide",function(){return Y}),R=500,N=!1,F=null,W=null,Modernizr.mobiletouch||document.addEventListener("mouseover",function(e){var t,i,n=e.target,o=e.currentTarget,r=function(e,t,i){for(var n,o=[];e&&e!==t;)e.classList&&e.classList.contains(i)&&o.push(e),e=e.parentElement||(n=e.parentNode)&&(n.nodeType===Node.ELEMENT_NODE?n:null);return o}(n,o,"apply-common-tooltip"),s=function(t){var i,n;if("buttons"in e){if(1&e.buttons)return"continue"}else if(1===e.which)return"continue";if((i=function(){return U(t)})())return n=function(){t.removeEventListener("common-tooltip-update",i),t.removeEventListener("mouseleave",n),t.removeEventListener("mousedown",n),document.removeEventListener("scroll",n),W&&(W.destroy(),W=null),Y()},t.addEventListener("common-tooltip-update",i),t.addEventListener("mouseleave",n),t.addEventListener("mousedown",n),document.addEventListener("scroll",n),null===W&&(W=Object(B.createGroup)({desc:"Tooltip"})).add({desc:"Hide",hotkey:27,handler:n}),"break"};for(t=0,i=r;t2;)c=Math.round((p+d)/2),this.items[c].x<=e.x?d=c:p=c;for(d=Math.max(1,d-1),p=Math.min(this.items.length-1,p+1),u=d;u<=p;++u)if(t=this.items[u-1],i=this.items[u],n=t.x,l=i.x,r(new o(n,t.y),new o(l,i.y),new o(e.x,e.y)).distance<=h)return this.hittest?this.hittest:new a(a.REGULAR);return null},t.PaneRendererLine=TradingView.PaneRendererLine=n},h24c:function(e,t,i){"use strict";function n(e){var t,i,n,o;return i=~~(t=/^[,\s]*(\d*)\s*([hdwms]?)\s*$/i.exec(e)||[])[1],n=t[2]&&t[2].toUpperCase()||null,(o={qty:!i&&n?1:i,unit:n}).error=!i&&!n,o.intraday=!(o.error||o.unit&&"H"!==o.unit),o}function o(e){var t,i,o;return u.enabled("allow_supported_resolutions_set_only")?null!==(t=p.Interval.normalize(e))&&Object(h.isAvailable)(t):!(i=n(e)).error&&(i.intraday?d.linking.intraday.value():!(o=d.linking.supportedResolutions.value())||null!==i.unit&&!!~o.indexOf(i.unit))}function r(){return!1}function s(e){return!e.ctrlKey&&(!e.metaKey&&(!!e.charCode&&(!(!e.which||e.which<=32)&&(null===e.target||!/^(input|textarea)$/i.test(e.target.tagName)))))}function a(e,t){return!t&&(e===d.linking.symbol.value()||e===d.linking.seriesShortSymbol.value())}function l(e,t){var i=d.linking.symbol.value()||"";i=function(e,t){if(!t)return e;if(f.test(e)){var i=e.split(/\//);i.length&&(e=i[i.length-1])}else e=d.linking.seriesShortSymbol.value()||e;return e}(i,t),e.val(i)}function c(e){Object(h.setLastUsedResolution)(e),d.linking.interval.setValue(e)}var u,h,d,p,_,f;i.r(t),i.d(t,"parseIntervalValue",function(){return n}),i.d(t,"intervalIsSupported",function(){return o}),i.d(t,"canShowSpreadActions",function(){return r}),i.d(t,"globalKeypressMatches",function(){return s}),i.d(t,"skipAccept",function(){return a}),i.d(t,"syncSymbolSearch",function(){return l}),i.d(t,"setLinkingResolution",function(){return c}),u=i("Kxc7"),h=i("pPtI"),d=i("PT1i"),p=i("LxhU"),_=i("ePL1"),f=new RegExp("^"+_.types.QUANDL,"i")},hBTJ:function(e,t,i){"use strict";function n(e,t){var i,n,o=e.A,r=t.A,s=e.B,a=t.B,l=e.C,u=t.C,h=o*a-r*s;return Math.abs(h)<1e-6?null:(i=(s*u-a*l)/h,n=(r*l-o*u)/h,new c.Point(i,n))}function o(e,t,i,n){var o,r,s=function(e,t,i,n){var o,r=t.subtract(e),s=n.subtract(i),a=r.x*s.y-r.y*s.x
+;return Math.abs(a)<1e-6?null:((o=e.subtract(i)).y*s.x-o.x*s.y)/a}(e,t,i,n);return null===s?null:(o=t.subtract(e).scaled(s).add(e),r=u.distanceToSegment(i,n,o),Math.abs(r.distance)<1e-6?s:null)}function r(e,t){var i,n,o;for(i=0,n=e;i0&&c.equalPoints(e[e.length-1],t))&&(e.push(t),!0)}function a(e,t){var i,o,r,a,l,u=[];for(i=0;i=3?u:null}var l,c,u,h;Object.defineProperty(t,"__esModule",{value:!0}),l=i("Eyy1"),c=i("aO4+"),u=i("GEp6"),h=i("f6yo"),t.intersectLineSegmentAndBox=function(e,t){function i(e,t,i,n,o,r){var s=0;return eo&&(s|=2),tr&&(s|=8),s}for(var n,o,r,s=e[0].x,a=e[0].y,l=e[1].x,u=e[1].y,h=t.min.x,d=t.min.y,p=t.max.x,_=t.max.y,f=i(s,a,h,d,p,_),m=i(l,u,h,d,p,_),y=!1,g=0;;){if(g>1e3)throw new Error("Cohen - Sutherland algorithm: infinity loop");if(g++,!(f|m)){y=!0;break}if(f&m)break;o=void 0,r=void 0,8&(n=f||m)?(o=s+(l-s)*(_-a)/(u-a),r=_):4&n?(o=s+(l-s)*(d-a)/(u-a),r=d):2&n?(r=a+(u-a)*(p-s)/(l-s),o=p):(r=a+(u-a)*(h-s)/(l-s),o=h),n===f?f=i(s=o,a=r,h,d,p,_):m=i(l=o,u=r,h,d,p,_)}return y?c.equalPoints(c.point(s,a),c.point(l,u))?c.point(s,a):c.lineSegment(c.point(s,a),c.point(l,u)):null},t.intersectLines=n,t.intersectLineSegments=o,t.intersectLineAndBox=function(e,t){var i,n,o,s,a,u=t.min.x,h=t.min.y,d=t.max.x,p=t.max.y;if(0===e.A)return i=-e.C/e.B,h<=i&&i<=p?c.lineSegment(c.point(u,i),c.point(d,i)):null;if(0===e.B)return n=-e.C/e.A,u<=n&&n<=d?c.lineSegment(c.point(n,h),c.point(n,p)):null;switch(o=[],a=function(t){var i=function(e,t){return-(e.C+e.B*t)/e.A}(e,t);u<=i&&i<=d&&r(o,new c.Point(i,t))},(s=function(t){var i=function(e,t){return-(e.C+e.A*t)/e.B}(e,t);h<=i&&i<=p&&r(o,new c.Point(t,i))})(u),a(h),s(d),a(p),o.length){case 0:return null;case 1:return o[0];case 2:return c.equalPoints(o[0],o[1])?o[0]:c.lineSegment(o[0],o[1])}return l.assert(!1,"We should have at most two intersection points"),null},t.intersectRayAndBox=function(e,t,i){var n,r=o(e,t,i.min,new c.Point(i.max.x,i.min.y)),s=o(e,t,new c.Point(i.max.x,i.min.y),i.max),a=o(e,t,i.max,new c.Point(i.min.x,i.max.y)),l=o(e,t,new c.Point(i.min.x,i.max.y),i.min),u=[];return null!==r&&r>=0&&u.push(r),null!==s&&s>=0&&u.push(s),null!==a&&a>=0&&u.push(a),null!==l&&l>=0&&u.push(l),0===u.length?null:(u.sort(function(e,t){return e-t}),n=h.pointInBox(e,i)?u[0]:u[u.length-1],e.addScaled(t.subtract(e),n))},t.intersectPolygonAndHalfplane=a,t.intersectPolygons=function(e,t){var i,n,o,r,s,l=e;for(i=0;i0){if(t=this._points[this._points.length-1],i=this._model.timeScale().indexToCoordinate(t.index),n=t.price,s=this.priceScale().priceToCoordinate(n,p),new o(h,_).subtract(new o(i,s)).length()0&&(this._value=e),this._listeners=[]}t.prototype.value=function(){return this._owner?this._owner._value:this._value},t.prototype.setValue=function(e,t){var i,n,o,r=this._owner?this._owner:this;if("function"==typeof r.hook&&(e=r.hook(e)),r.writeLock)return r._value;if(!t&&r._value===e&&r.hasOwnProperty("_value"))return e;for(r._value=e,i=r._listeners.slice(),n=0,o=0;o=1&&t<=15?"1D":"1W"}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 s,a,l,c,u,h;i.r(t),i.d(t,"pivotPointsStandardStudyItem",function(){return h}),s=i("ocLq"),a=i("LxhU"),l=function(){return function(){this.p=NaN,this.r1=NaN,this.s1=NaN,this.r2=NaN,this.s2=NaN,this.r3=NaN,this.s3=NaN,this.r4=NaN,this.s4=NaN,this.r5=NaN,this.s5=NaN,this.startIndex__t=NaN,this.endIndex__t=NaN}}(),c=function(){return function(){this.pivots=[]}}(),u=function(){function e(){this._secondaryRes="1D",this._firstMainSeriesBarTime=NaN}return e.prototype.init=function(e,t){var i,n=t(0),o=t(1),a=t(2),l=t(3);this._data=new c,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)}}(n),this._showHistoricalPivots=o,this._historicalPivotsToKeep=l,this._pivTimeFrame=a,this._isValidResolution=function(e,t){return!(s.Std.isdaily(e)&&"Daily"===t||s.Std.isweekly(e)&&("Daily"===t||"Weekly"===t)||s.Std.ismonthly(e)&&("Daily"===t||"Weekly"===t||"Monthly"===t))}(e,this._pivTimeFrame),this._isValidResolution||s.Std.error("You cannot see this pivot timeframe on this resolution"),this._isValidResolution&&(this._secondaryRes=r(e,this._pivTimeFrame)),i=""===e.symbol.resolution?String(Math.max(30,2*e.symbol.interval)):e.symbol.period,e.new_sym(e.symbol.tickerid,this._secondaryRes,this._secondaryRes,i)},e.prototype.main=function(e){var t,i,n,r,a,c,u,h,d,p,_,f,m,y,g;return this._isValidResolution?e.symbol.time?(isNaN(this._firstMainSeriesBarTime)&&(this._firstMainSeriesBarTime=e.symbol.time,this._removeUnusedPivots()),e.symbol.isLastBar&&e.symbol.isNewBar?this._createResponse():null):(e.select_sym(1),t=e.new_var(s.Std.open(e)),i=e.new_var(s.Std.high(e)),n=e.new_var(s.Std.low(e)),r=e.new_var(s.Std.close(e)),a=e.new_var(s.Std.time(e)),c=this._data,u=t.get(0),h=a.get(0),d=t.get(1),p=i.get(1),_=n.get(1),f=r.get(1),m=e.symbol.isLastBar,0!==c.pivots.length&&e.symbol.isNewBar&&(y=c.pivots[c.pivots.length-1]).endIndex__t!==h&&(y.endIndex__t=h),0!==e.symbol.index&&e.symbol.isNewBar?(g=function(e,t,i,n,o,r,a,c){var u,h=new l,d=NaN,p=i-n;switch(c){case 0:d=(i+n+o)/3,h.p=d,h.r1=2*d-n,h.s1=2*d-i,h.r2=d+(i-n),h.s2=d-(i-n),h.r3=2*d+(i-2*n),h.s3=2*d-(2*i-n),h.r4=3*d+(i-3*n),h.s4=3*d-(3*i-n),h.r5=4*d+(i-4*n),h.s5=4*d-(4*i-n);break;case 1:d=(i+n+o)/3,h.p=d,h.r1=d+.382*p,h.s1=d-.382*p,h.r2=d+.618*p,h.s2=d-.618*p,h.r3=d+p,h.s3=d-p;break;case 2:d=(i+n+2*e)/4,h.p=d,h.r1=2*d-n,h.s1=2*d-i,h.r2=d+p,h.s2=d-p,h.r3=i+2*(d-n),h.s3=n-2*(i-d),h.r4=h.r3+p,h.s4=h.s3-p;break;case 3:d=(i+n+o)/3,h.p=d,h.r1=2*d-n,h.s1=2*d-i,h.r2=d+p,h.s2=d-p,h.r3=d+2*p,h.s3=d-2*p,h.r4=d+3*p,h.s4=d-3*p;break;case 4:u=NaN,d=(u=s.Std.equal(t,o)?i+n+2*o:s.Std.greater(o,t)?2*i+n+o:2*n+i+o)/4,h.p=d,h.r1=u/2-n,h.s1=u/2-i;break;case 5:d=(i+n+o)/3,h.p=d,h.r1=o+1.1*p/12,h.s1=o-1.1*p/12,h.r2=o+1.1*p/6,h.s2=o-1.1*p/6,h.r3=o+1.1*p/4,h.s3=o-1.1*p/4,h.r4=o+1.1*p/2,h.s4=o-1.1*p/2;break;default:throw new Error("Unknown kind")}return h.startIndex__t=r,h.endIndex__t=a,h}(u,d,p,_,f,h,o(e,h),this._kindPP),e.select_sym(0),this._showHistoricalPivots||(c.pivots=[]),c.pivots.push(g),c.pivots.length>this._historicalPivotsToKeep&&c.pivots.shift(),m?this._createResponse():null):(e.select_sym(0),null)):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}(),h={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:u}},"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";var n,o,r,s,a,l,c,u;i.r(t),i.d(t,"StudyColorRotatorFactory",function(){return u}),n=i("eJTA"),o=i("Tmoa"),r=i("6Kf3"),s=i("3ClC"),a=["color-tan-orange-a700","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"],l=function(){function e(e){this._offset=0,this._offset=e}return e.prototype.getColor=function(e){var t,i,s;return 0===this._offset?e:(t=a[(this._offset-1)%a.length],i=r.a[t],s=Object(o.isHexColor)(e)?1:Object(n.parseRgba)(e)[3],Object(o.generateColor)(i,Object(o.alphaToTransparency)(s)))},e}(),c=function(){function e(e,t){this._offset=e,this._modelStartOffset=t}return e.prototype.getColor=function(e){var t,i;return Object(o.isHexColor)(e)?(t=Object(n.parseRgb)(e),Object(n.rgbToHexString)(Object(n.shiftRgb)(t,this._offset,this._modelStartOffset))):(i=Object(n.parseRgba)(e),Object(n.rgbaToString)(Object(n.shiftRgba)(i,this._offset,this._modelStartOffset)))},e}(),u=function(){function e(e){this._chartModel=e}return e.prototype.getColorRotator=function(e){var t,i=Object(s.studyColorRotationMode)(e),n=this._calcDefaultColorsOffset(e);switch(i){case"loop":return new l(n);case"shift":return t=this._chartModel.getStudyShiftColorStartOffset(),new c(n,t)}},e.prototype._calcDefaultColorsOffset=function(e){var t=0;return this._chartModel.dataSources().filter(s.isStudy).forEach(function(i){var n,o,r,s,a=i.metaInfo().id===e.id,l=(n=i.metaInfo(),o=e,r=n.pine?n.pine.version:void 0,s=o.pine?o.pine.version:void 0,
+r===s),c=a&&l;c&&t++}),t},e}()},i1o5:function(e,t,i){"use strict";var n,o;i.r(t),i.d(t,"InvalidationLevel",function(){return n}),i.d(t,"InvalidateMask",function(){return o}),function(e){e[e.Cursor=1]="Cursor",e[e.Light=2]="Light",e[e.Full=3]="Full"}(n||(n={})),o=function(){function e(e){this._panesOrderChanged=!1,this._invalidatedPanes=new Map,this._invalidationLevel=e||n.Cursor}return e.prototype.invalidatePane=function(e,t){var i=this._invalidatedPanes.get(e)||n.Cursor;this._invalidatedPanes.set(e,Math.max(i,t))},e.prototype.invalidatePanesOrder=function(){this._panesOrderChanged=!0},e.prototype.invalidateAll=function(e){this._invalidationLevel=Math.max(this._invalidationLevel,e)},e.prototype.fullInvalidation=function(){return this._invalidationLevel},e.prototype.invalidateForPane=function(e){var t=this._invalidatedPanes.get(e)||n.Cursor;return Math.max(t,this._invalidationLevel)},e.prototype.merge=function(e){var t=this;this._invalidationLevel=Math.max(this._invalidationLevel,e._invalidationLevel),this._panesOrderChanged=this._panesOrderChanged||e._panesOrderChanged,e._invalidatedPanes.forEach(function(e,i){var o=t._invalidatedPanes.get(i)||n.Cursor;t._invalidatedPanes.set(i,Math.max(o,e))})},e.prototype.panesOrderInvalidated=function(){return this._panesOrderChanged},e.prototype.exclude=function(e){var t,i,n,o;for(this._invalidationLevel<=e&&(this._invalidationLevel=0),t=[],this._invalidatedPanes.forEach(function(i,n){i<=e&&t.push(i)}),i=0,n=t;it.left?((e=s(this._leftPriceScales,this.mainDataSource().priceScale())).splice(t.left),e):this._leftPriceScales},n.prototype.visibleRightPriceScales=function(){var e,t=this._model.priceScaleSlotsCount();return this._rightPriceScales.length>t.right?((e=s(this._rightPriceScales,this.mainDataSource().priceScale())).splice(t.right),e):this._rightPriceScales},n.prototype.timeScale=function(){return this.m_timeScale},n.prototype.dataSources=function(){return this.m_dataSources},n.prototype.isOverlay=function(e){var t=e.priceScale();return"overlay"===this.priceScalePosition(t)},n.prototype._processMainSourceChange=function(){var e,t,i,n,o;if(null===this.m_mainDataSource)for(t=0;tn)&&(n=i));return null===n&&(n=this.getZOrderMinMax().minZOrder-1),this.m_dataSources.forEach(function(e){e.zorder()>n&&e.setZorder(e.zorder()+1)}),n+1},n.prototype.beginInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!0,this._lastLineDataSourceZOrder=null},n.prototype.endInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null},n.prototype.addDataSource=function(e,t,i){var n;d(e)&&!i?(n=null!==this._lastLineDataSourceZOrder?this._lastLineDataSourceZOrder:this._newZOrderForLineTool(),this._isInInsertManyDataSourcesState&&(this._lastLineDataSourceZOrder=n)):n=this.getZOrderMinMax().minZOrder-1,this.insertDataSource(e,t,n)},n.prototype.insertDataSource=function(e,t,i){t||(t=this.findSuitableScale(e)),this._addSourceToCollections(e);var o=!1;e===this._model.mainSeries()?(this.m_mainDataSource=e,o=!0):null===this.m_mainDataSource&&(this.m_mainDataSource=e,o=!0),t.addDataSource(e,this._isInInsertManyDataSourcesState),e.setPriceScale(t),e.onTagsChanged&&e.onTagsChanged().subscribe(this,n.prototype.onSourceTagsChanged),e.setZorder(i),o&&this._processMainSourceChange(),this._tagsChanged.fire(),TradingView.isInherited(e.constructor,u)&&this.recalculatePriceScale(t),this._invalidateSourcesCache()},n.prototype.priceScalePosition=function(e){return this._leftPriceScales.includes(e)?"left":this._rightPriceScales.includes(e)?"right":"overlay"},n.prototype.createPriceScaleAtPosition=function(e,t){var i,n=this._properties.axisProperties.state();return n.autoScale=!0,(i=new p(this._model.properties().scalesProperties,n)).setHeight(this.height()),i.setTopMargin(this._defaultTopMargin()),i.setBottomMargin(this._defaultBottomMargin()),this._placePriceScale(i,e,t),i},n.prototype._placePriceScale=function(e,t,i){var n,o;"overlay"!==t&&(n="left"===t?this._leftPriceScales:this._rightPriceScales,o=void 0===i?n.length:i,n.splice(o,0,e),e.modeChanged().subscribe(this,this._onPriceScaleModeChanged.bind(this,e)),e.internalHeightChanged().subscribe(this,this._recalculatePriceScaleByScaleRatio.bind(this,e)),e.priceRangeChanged().subscribe(this,this._recalculateTimeScaleByScaleRatio.bind(this,e)),e.priceRangeChanged().subscribe(this,this._onPriceScaleSetMinMaxPriceRange.bind(this,e)),e.isLockScale()&&(r(null===this._lockedPriceScale),this._lockedPriceScale=e,this._currentPriceScaleRatio=null),this._onPriceScalesChanged.fire())},n.prototype.removePriceScale=function(e){var t,i;e.modeChanged().unsubscribeAll(this),e.priceRangeChanged().unsubscribeAll(this),e.internalHeightChanged().unsubscribeAll(this),e===this._lockedPriceScale&&(this._lockedPriceScale=null,this._currentPriceScaleRatio=null),-1!==(t=this._leftPriceScales.indexOf(e))&&this._leftPriceScales.splice(t,1),-1!==(i=this._rightPriceScales.indexOf(e))&&this._rightPriceScales.splice(i,1),
+this._onPriceScalesChanged.fire()},n.prototype.removeDataSource=function(e,t){var i,o,r=this.m_dataSources.indexOf(e);-1!==r?(this._removeSourceFromCollections(r),e!==this.m_mainDataSource||t||(this.m_mainDataSource=null),(i=e.priceScale())&&i.dataSources().indexOf(e)>=0&&i.removeDataSource(e),i&&null===i.mainSource()&&(0!==(o=i.dataSources().length)&&h.logError("Invalid priceScale state: empty mainSource but non-empty data sources="+o),this.removePriceScale(i)),e.onTagsChanged&&e.onTagsChanged().unsubscribe(this,n.prototype.onSourceTagsChanged),e instanceof u&&!t&&this._processMainSourceChange(),this._tagsChanged.fire(),i&&e instanceof u&&this.recalculatePriceScale(i),this._invalidateSourcesCache()):h.logDebug("removeDataSource: invalid data source")},n.prototype.startScalePrice=function(e,t){e.startScale(t)},n.prototype.scalePriceTo=function(e,t){e.scaleTo(t),this.updateAllViews()},n.prototype.endScalePrice=function(e){e.endScale()},n.prototype.startScrollPrice=function(e,t){e.startScroll(t)},n.prototype.scrollPriceTo=function(e,t){e.scrollTo(t),this.updateAllViews()},n.prototype.endScrollPrice=function(e){e.endScroll()},n.prototype.setPriceAutoScale=function(e,t){e.setMode({autoScale:t}),this.timeScale().isEmpty()?e.setPriceRange(null):this.recalculatePriceScale(e)},n.prototype.restorePriceScaleState=function(e,t){e.restoreState(t),this.updateAllViews()},n.prototype._updateCustomSourceAllViews=function(e){e.paneViews(this).length>0&&e.updateAllViews()},n.prototype.updateAllViews=function(){for(var e=0;e0&&!this.timeScale().isEmpty()&&(i=this.timeScale().visibleBarsStrictRange(),e.recalculatePriceRange(i)),e.updatePaneViews())},n.prototype.resetPriceScale=function(e){var t=this.timeScale().visibleBarsStrictRange();e.isLockScale()||e.setMode({autoScale:!0}),e.recalculatePriceRange(t),this.updateAllViews()},n.prototype.recalculate=function(){var e,t;for(this.recalculatePriceScale(this.m_rightPriceScale),
+this.recalculatePriceScale(this.m_leftPriceScale),e=0;et&&(t=n.zorder());return{minZOrder:e,maxZOrder:t}},n.prototype.isZOrderAvailable=function(e){var t;for(t=0;t0&&t<0?(o=a[l-1].zorder(),r=e.zorder(),a[l-1].setZorder(r),e.setZorder(o)):l0&&(s=a[l+1].zorder(),r=e.zorder(),a[l+1].setZorder(r),e.setZorder(s)),this._invalidateSourcesCache(),this._dataSourcesCollectionChanged.fire()},n.prototype.onSourceTagsChanged=function(){this._tagsChanged.fire()},n.prototype.onDestroyed=function(){return this._destroyed},n.prototype.clearSeries=function(){
+for(var e=this.m_dataSources.length-1;e>=0;e--)TradingView.isInherited(this.m_dataSources[e].constructor,TradingView.Series)&&this._removeSourceFromCollections(e)},n.prototype.nonOverlayPricesSourcesCount=function(){return this.m_dataSources.filter(function(e){return(!e.properties().linkedToSeries||!e.properties().linkedToSeries.value())&&(TradingView.isInherited(e.constructor,u)&&e.showInObjectTree()&&!this.isOverlay(e))},this).length},n.prototype.canHaveMoreNoScaleSources=function(){return this.nonOverlayPricesSourcesCount()>1},n.prototype.actionNoScaleIsEnabled=function(e){return!(!this.isOverlay(e)&&TradingView.isInherited(e.constructor,u))||this.canHaveMoreNoScaleSources()},n.prototype.executionsPositionController=function(){return this._executionsPositionController||(this._executionsPositionController=new a(this,this._model.timeScale())),this._executionsPositionController},n.prototype.isLast=function(){var e=this._model.panes(),t=e[e.length-1];return t===this},n.prototype.setMaximized=function(e){this._maximized=e},n.prototype.isMaximized=function(){return this._maximized},n.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},n.prototype.properties=function(){return this._properties},n.prototype._mainSourceVisiblePriceRange=function(e){var t=this.m_timeScale.visibleBarsStrictRange();return null!==t?e.mainSource().priceRange(t.firstBar(),t.lastBar()):new c(-.5,.5)},n.prototype.priceScaleRatio=function(){return this._currentPriceScaleRatio},n.prototype.applyPriceScaleRatio=function(e,t){null!==this._lockedPriceScale&&this._lockedPriceScale!==e||this._currentPriceScaleRatio===t||!this.isMainPane()||null===this._lockedPriceScale&&e!==this.mainDataSource().priceScale()||(this._setNewPriceRangeByScaleRatio(e,t,this._mainSourceVisiblePriceRange(e),!0,!0),null!==this._lockedPriceScale?this._tryToApplyNewPriceScaleRatio():e.isLog()||this._model.mainSeriesScaleRatioPropertyOnChanged())},n.prototype._mainSeriesPaneScaleRatioOnChange=function(){this.isMainPane()&&this._model.mainSeriesScaleRatioPropertyOnChanged()},n.prototype._applyOldScaleRatioToPriceScale=function(){if(this._isRecalculatingScales||null===this._currentPriceScaleRatio)return!1;this._isRecalculatingScales=!0,this._setNewPriceRangeByScaleRatio(this._lockedPriceScale,this._currentPriceScaleRatio,this._mainSourceVisiblePriceRange(this._lockedPriceScale)),this._isRecalculatingScales=!1},n.prototype._applyOldScaleRatioToTimeScale=function(){if(this._isRecalculatingScales||null===this._currentPriceScaleRatio)return!1;this._isRecalculatingScales=!0,this._setNewBarSpacingByScaleRatio(),this._isRecalculatingScales=!1},n.prototype._tryToApplyNewPriceScaleRatio=function(){var e=_(this.m_timeScale,this._lockedPriceScale);this._currentPriceScaleRatio===e||this._lockedPriceScale.isLog()||(this._priceScaleRatioChanged.fire(this._currentPriceScaleRatio,e),this._currentPriceScaleRatio=e)},n.prototype._recalculatePriceScaleByScaleRatio=function(e){
+this.isMainPane()&&e===this._lockedPriceScale&&(null!==this._currentPriceScaleRatio?this._applyOldScaleRatioToPriceScale():this._tryToApplyNewPriceScaleRatio())},n.prototype._recalculateTimeScaleByScaleRatio=function(e){e===this._lockedPriceScale&&(null!==this._currentPriceScaleRatio?this._applyOldScaleRatioToTimeScale():this._tryToApplyNewPriceScaleRatio())},n.prototype._setNewPriceRangeByScaleRatio=function(e,t,i,n,o){var r=f(e,this.m_timeScale.barSpacing(),t);e.setPriceRange(null!==r?r:i,n,o)},n.prototype._setMinMaxPriceRange=function(){var e=f(this._lockedPriceScale,this.m_timeScale.maxBarSpacing(),this._currentPriceScaleRatio),t=f(this._lockedPriceScale,this.m_timeScale.minBarSpacing(),this._currentPriceScaleRatio);null!==e&&this._lockedPriceScale.setMaxPriceRange(e),null!==t&&this._lockedPriceScale.setMinPriceRange(t)},n.prototype._onPriceScaleSetMinMaxPriceRange=function(e){e===this._lockedPriceScale&&this._setMinMaxPriceRange()},n.prototype._setNewBarSpacingByScaleRatio=function(){var e=this.m_timeScale.getValidBarSpacing(m(this._lockedPriceScale,this._currentPriceScaleRatio));this.m_timeScale.isValidBarSpacing(e)&&this.m_timeScale.setBarSpacing(e)},n.prototype._onPriceScaleModeChanged=function(e,t,i){if(i.lockScale&&(this._lockedPriceScale!==e&&null!==this._lockedPriceScale&&this._lockedPriceScale.setMode({lockScale:!1}),this._lockedPriceScale=e,this._currentPriceScaleRatio=_(this.m_timeScale,e)),t.lockScale&&!i.lockScale&&(this._lockedPriceScale=null,this._currentPriceScaleRatio=null),t.percentage!==i.percentage||t.indexedTo100!==i.indexedTo100){var n=this.timeScale().visibleBarsStrictRange();null!==n&&(e.recalculatePriceRange(n),e.updatePaneViews())}},n.prototype.lineToolsForArea=function(e){var t=this.m_height,i=this.m_width,n=this.logicalRectToPixels(e),o=function(e){return(e.paneViews()||[]).some(function(e){var o=e.renderer(t,i,!0);return o&&o.doesIntersectWithBox&&o.doesIntersectWithBox(n)})};return this.m_dataSources.filter(function(e){return d(e)}).filter(o)},n.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()},n.prototype.setPriceScaleSelectionStrategy=function(e){this._priceScaleSelectionStrategy=e,e.apply(this)},n.prototype.movePriceScale=function(e,t,i){var n,o,r=this.priceScalePosition(e);r!==t?(this.removePriceScale(e),this._placePriceScale(e,t,i),this._invalidateSourcesCache()):void 0!==i&&"overlay"!==r&&(o=(n="left"===r?this._leftPriceScales:this._rightPriceScales).indexOf(e),n.splice(o,1),n.splice(i,0,e))},n.prototype.onPriceScalesChanged=function(){return this._onPriceScalesChanged},n.prototype.priceScaleIndex=function(e,t){switch(t){case"left":return this.leftPriceScales().indexOf(e);case"right":return this.rightPriceScales().indexOf(e)}},n.prototype.findTargetPriceAxisViews=function(e,t,i,n){var o,r
+;return this._model.paneForSource(e)!==this?null:t===e.priceScale()?i:"overlay"===this.priceScalePosition(e.priceScale())?t===this.defaultPriceScale()?i:null:(o=this.priceScalePosition(t))!==this.priceScalePosition(e.priceScale())?null:(r="left"===o?this.leftPriceScales():this.rightPriceScales()).indexOf(t)0&&(c=2*Math.PI-c),0===e&&(c+=Math.PI),this._properties.angle.setValue(c)):(u=this._startChangeWidth,h=r.subtract(o).length(),this._origScale*uP||(T=this._study.data().last(),null!==(x=this._study.data().valueAt(P)||(null!==T?T.value:null))&&(I=x[b+1],Object(o.isNumber)(I)&&(r.setValue(m.format(I)),L=this._study.properties().styles[S].color.value(),d=s[b],Object(l.isOhlcPlot)(d)&&(S=d.target||S,L=this._study.properties().ohlcPlots[S].color.value()),M=L,c[S]&&x.length>c[S].index+1&&(A=x[c[S].index+1],k=c[S].palette,void 0!==A&&null!==A&&void 0!==k&&(E=c[S].paletterProps,
+O=k.valToIndex?k.valToIndex[A]:A,M=E.colors[void 0!==O?O:A].color.value())),r.setColor(M)))))}},t.prototype._currentIndex=function(){var e=this._model.crossHairSource().lockedIndex;return void 0!==e?e:null!==this._model.crossHairSource().pane?this._model.crossHairSource().appliedIndex():this._study.data().lastIndex()},t}(r.b)},ivNn:function(e,t,i){"use strict";function n(e){return Math.round(1e10*e)/1e10}Object.defineProperty(t,"__esModule",{value:!0}),t.isNumber=function(e){return"number"==typeof e&&isFinite(e)},t.isInteger=function(e){return"number"==typeof e&&e%1==0},t.isNaN=function(e){return!(e<=0||e>0)},t.fixComputationError=n,t.alignTo=function(e,t){var i=e/t,o=Math.floor(i),r=i-o;return r>2e-10?n(r>.5?(o+1)*t:o*t):e}},j1f4:function(e,t,i){"use strict";var n,o,r,s;i.r(t),i.d(t,"dur",function(){return n}),i.d(t,"easingFunc",function(){return o}),i.d(t,"CubicBezier",function(){return r}),i.d(t,"color",function(){return s}),n=350,o={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}},r=function(){function e(e,t,i,n){this._mX1=e,this._mY1=t,this._mX2=i,this._mY2=n}return e.prototype.easingFunc=function(e){return this._mX1===this._mY1&&this._mX2===this._mY2?e:this._calcBezier(this._getTForX(e))},e.prototype._a=function(e,t){return 1-3*t+3*e},e.prototype._b=function(e,t){return 3*t-6*e},e.prototype._c=function(e){return 3*e},e.prototype._calcBezier=function(e){return((this._a(this._mY1,this._mY2)*e+this._b(this._mY1,this._mY2))*e+this._c(this._mY1))*e},e.prototype._getSlope=function(e){return 3*this._a(this._mX1,this._mX2)*e*e+2*this._b(this._mX1,this._mX2)*e+this._c(this._mX1)},e.prototype._getTForX=function(e){var t,i,n=e;for(t=0;t<4;++t){if(0===(i=this._getSlope(n)))return n;n-=(this._calcBezier(n)-e)/i}return n},e}(),s={black0:"#000",black20:"#2b2d36",black25:"#2b2e37",black27:"#2f3241",black30:"#212121",black70:"#4A4A4A",black80:"#535353",black100:"#646464",black110:"#757575",black140:"#8A8A8A",black170:"#ADAEB0",black180:"#b4b4b4",black200:"#C8C8C8",black220:"#DADDE0",black230:"#ECECEC",black240:"#F2F2F2",black248:"#F8F8F8",black255:"#FFF",brand:"#3BB3E4",brandHover:"#3BABD8",brandActive:"#3898C2",brandDown:"#049DDC",brand220:"#3BB3E0",brand255:"#3BB3FF",brandNew:"#37A6EF",brandNew2:"#2196F3",spinner:"#00A2E2",brandMedium80:"#3C4650",brandMedium90:"#465a6e",brandMedium100:"#627384",brandMedium120:"#758696",brandMedium150:"#94959C",brandMedium190:"#9DB2BD",brandMedium220:"#E9EFF2",brandMedium230:"#EAECEF",brandMedium240:"#F1F3F6",brandDark:"#2A2C39",
+brandDark50:"#252733",brandDark45:"#20222D",brandDarkText:"#6A6B74",danger:"#FF4A68",dangerHover:"#F24965",dangerDown:"#FF173E",success:"#3CBC98",success55:"#37BC9B",success250:"#00FFC0",successHover:"#38B395",successDown:"#00A97F",attention:"#FFC84A",attention50:"#F89E30",growing:"#37bc9b",falling:"#ff4a68"}},jA0t:function(e,t,i){"use strict";var n=function(){function e(e){return e.is_price_study}function t(e,t){var i,n=t.slice(0).toLowerCase();if(e){for(i=0;it){if((n=o-1)0&&e-i[r-1]<=t?t:0},n.prototype.is_valid=function(){return!this._invalid},n._offset=function(e,t,i){var n=o(e,i);return-1===n?0:t[n]},s=function(e){return 0|e},l=function(e){return 1e3*e},c=function(e,t){return s((s(e/1e3)-s(t/1e3))/60)},u=function(e,t){return s(s(e/1e3)-s(t/1e3))},h={0:0,1:31,2:59,3:90,4:120,5:151,6:181,7:212,8:243,9:273,10:304,11:334},d={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=function(e){return 60*e*1e3})(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=h[t];return t>d.JANUARY+1&&r(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=d.get_day_of_year(e),o=n-i;return Math.ceil(o/7)+1},get_minutes_from_midnight:function(e){return 60*d.get_hours(e)+d.get_minutes(e)},set_hms:function(e,t,i,n,o,r){e.setUTCHours(t),e.setUTCMinutes(i),e.setUTCSeconds(n),e.setUTCMilliseconds(o),d.correct_time(e,r)},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,o=e.offset_utc(t),r=this.clone(t);return this.add_date(r,i),n=e.offset_utc(r),r.setTime(r.getTime()+o-n),r},add_date:function(e,t){e.setTime(e.getTime()+t*d.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 r(e)?366:365},get_part:function(e,t){switch(t){case d.YEAR:return d.get_year(e);case d.MONTH:return d.get_month(e);case d.DAY_OF_MONTH:return d.get_day_of_month(e);case d.WEEK_OF_YEAR:return d.get_week_of_year(e);case d.DAY_OF_WEEK:return d.get_day_of_week(e);case d.HOUR_OF_DAY:return d.get_hours(e);case d.MINUTE:return d.get_minutes(e);case d.DAY_OF_YEAR:return d.get_day_of_year(e);case d.SECOND:return d.get_seconds(e);default:return e.getTime()}},time_minutes:a,time_seconds:l,time_minutes_diff:c,time_seconds_diff:u,utc_to_cal:function(e,t){var i=e.offset_utc(t);return new Date(t+i)},get_cal:function(e,t,i,n,o,r,s){var a=new Date(Date.UTC(t,i,n,o||0,r||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(),n=e.offset_loc(i);return i-n},get_timezone:function(e){return new n(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=d},jFln:function(e,t,i){"use strict";var n,o,r,s;i("xL1m"),n=i("Hr11"),o=n.greaterThan,r=n.lessThan,s=window.CanvasEx=i("8Uy/"),TradingView.resizeCanvas=function(e,t,i){var n,o,r,s,a,l=e.height,c=e.width;l&&c&&(l/=window.hidpiCanvasRatio||1,c/=window.hidpiCanvasRatio||1,l<1&&(l=1),
+c<1&&(c=1),(n=document.createElement("canvas")).setAttribute("width",c),n.setAttribute("height",l),o=n.getContext("2d"),r=Math.min(c,t),s=Math.min(l,i),r&&s&&o.drawImage(e,0,0,r,s,0,0,r,s),e.height=i,e.width=t,a=e.getContext("2d"),r&&s&&a.drawImage(n,0,0,r,s,0,0,r,s))},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]][e.lineStyle-1]},s.drawLine=function(e,t,i,n,o){isFinite(t)&&isFinite(n)&&isFinite(i)&&isFinite(o)&&(e.lineStyle===s.LINESTYLE_DASHED||e.lineStyle===s.LINESTYLE_DOTTED||e.lineStyle===s.LINESTYLE_SPARSE_DOTTED?e.drawDashedLine(e,t,i,n,o):s.drawSolidLine(e,t,i,n,o))},s.drawArrow=function(e,t,i,n,o){isFinite(t)&&isFinite(n)&&isFinite(i)&&isFinite(o)&&(e.beginPath(),e.moveTo(n,o),e.lineTo(t,i),e.moveTo(t+2,i+2),e.lineTo(t-2,i+2),e.moveTo(t-1,i+1),e.lineTo(t+1,i+1),e.stroke())},s.drawSolidLine=function(e,t,i,n,o){e.beginPath(),e.moveTo(t,i),e.lineTo(n,o),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){var n,o;for(e.beginPath(),e.moveTo(t[0].x,t[0].y),n=0;n0&&(this.lineStyle=s.lineStyles.pop(),s.originalRestore.call(this))},CanvasRenderingContext2D.prototype.drawDashedLine=function(e,t,i,n,o){e.save();var r=s.computeDashPattern(e);if(e.beginPath(),
+"function"==typeof e.setLineDash)e.setLineDash(r);else if(void 0!==e.mozDash)e.mozDash=r;else{if(void 0===e.webkitLineDash)return e.dashedLineTo(t,i,n,o,r),e.stroke(),void e.restore();e.webkitLineDash=r}e.moveTo(t,i),e.lineTo(n,o),e.stroke(),e.restore()},CanvasRenderingContext2D.prototype.dashedLineTo=function(e,t,i,n,s){var a,l,c,u,h,d,p={thereYet:o,cap:Math.min},_={thereYet:o,cap:Math.min};for(t-n>0&&(_.thereYet=r,_.cap=Math.max),e-i>0&&(p.thereYet=r,p.cap=Math.max),this.moveTo(e,t),a=e,l=t,c=0,u=!0;!p.thereYet(a,i)||!_.thereYet(l,n);)h=Math.atan2(n-t,i-e),d=s[c],a=p.cap(i,a+Math.cos(h)*d),l=_.cap(n,l+Math.sin(h)*d),u?this.lineTo(a,l):this.moveTo(a,l),c=(c+1)%s.length,u=!u}),e.exports=s},jJ9X:function(e,t,i){},jRfx:function(e,t,i){"use strict";var n,o,r,s,a,l;i.d(t,"c",function(){return s}),i.d(t,"a",function(){return a}),i.d(t,"b",function(){return l}),n=i("mrSG"),o=i("Eyy1"),r=function(e){function t(t,i,n){var o=e.call(this,t,i,n)||this;return o._restorePane=!1,o}return Object(n.__extends)(t,e),t.prototype.redo=function(){var e,t,i=this,n=this._chartModel.panes()[this._targetPaneIndex()],r=Object(o.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),s=this._chartModel.children(r,!0);s.forEach(function(e){return i._chartModel.detachSource(e)}),this._restorePane=this._chartModel.detachSource(r),e=n.findSuitableScale(r),n.addDataSource(r,e,!1),s.forEach(function(t){return n.addDataSource(t,e,!1)}),r===this._chartModel.mainSeries()&&(t=n.priceScalePosition(e),n.movePriceScale(e,t,0)),this._chartModel.fullUpdate()},t.prototype.undo=function(){var e,t,i,n,r=this;e=this._restorePane?this._chartModel.createPane(this._initialPaneIndex):this._chartModel.panes()[this._initialPaneIndex],t=Object(o.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),(i=this._chartModel.children(t,!0)).forEach(function(e){return r._chartModel.detachSource(e)}),this._chartModel.detachSource(t),null===(n=e.getPriceScaleById(this._initialPriceScaleId))&&(n=e.createPriceScaleAtPosition(this._initialPriceScalePosition,this._initialPriceScaleIndex)),e.addDataSource(t,n,!0),i.forEach(function(t){return e.addDataSource(t,n,!1)}),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.__extends)(t,e),t.prototype._targetPaneIndex=function(){return this._initialPaneIndex-1},t}(r),a=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}return Object(n.__extends)(t,e),t.prototype._targetPaneIndex=function(){return this._initialPaneIndex+1},t}(r),l=function(e){function t(t,i,n,o){var r=e.call(this,t,i,o)||this;return r._targetPane=n,r}return Object(n.__extends)(t,e),t.prototype._targetPaneIndex=function(){return this._targetPane},t}(r)},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={}))},jenN:function(e,t,i){"use strict";function n(e,t,n){return new Promise(function(r){
+i.e("study-pane-views").then(function(s){var a=Object.keys(e.graphicsInfo());a.sort(function(e,t){return o(e)-o(t)}),r(a.map(function(o){var r,s=i("psYU").VertLinePaneView;return null===(r={backgrounds:null,hhists:null,horizlines:null,hlines:null,lines:null,polygons:null,shapemarks:null,textmarks:null,trendchannels:null,vertlines:s,dwglabels:null,dwglines:null}[o])?(u.logWarn(o+" is not supported by this build of graphics subsystem, skipping"),null):new r(e,t,n)}).filter(function(e){return null!==e}))}.bind(null,i)).catch(void 0)})}function o(e){switch(e){case"polygons":return-100;case"trendchannels":return-90;default:return 0}}function r(e){var t,i,n=Object.keys(e.graphicsInfo()),o=[],r=function(e){return u.logWarn(e+" is not supported by this build of graphics subsystem, skipping"),"continue"};for(t=0,i=n;t0&&t.setValue(a.family),i.setValue(a.size),n.setValue(a.bold),r.setValue(a.italic)):s.logError("Invalid font: "+e)},fontHeight:function(e){var t,i;return this._fontHeightCache[e]||((t=document.createElement("span")).appendChild(document.createTextNode("height")),document.body.appendChild(t),t.style.cssText="font: "+e+"; white-space: nowrap; display: inline;",i=t.offsetHeight,document.body.removeChild(t),this._fontHeightCache[e]=Math.ceil(i)),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=e.mainSource().base(),n=1/i;return n*Math.round(t/n)}};e.exports=a},jofe:function(e,t,i){"use strict";function n(){var e,t,i=new Promise(function(i,n){e=i,t=n});return{promise:i,reject:t,resolve:e}}i.r(t),i.d(t,"createDeferredPromise",function(){return n})},jy4L:function(e,t,i){"use strict";function n(){return"ss_"+ ++r}function o(){return"st"+ ++s}var r,s;i.r(t),i.d(t,"makeNextSymbolId",function(){return n}),i.d(t,"makeNextStudyId",function(){return o}),r=0,s=0},k4w6:function(e,t,i){"use strict";var n,o,r,s;i.d(t,"a",function(){return s}),n=i("aO4+"),o=i("l4sv"),r=i("8Uy/"),s=function(){function e(e){this._lineRendererData={width:0,height:0,points:[new n.Point(0,0)],color:"rgba(0, 0, 0, 0)",linewidth:1,linestyle:r.LINESTYLE_SOLID,visible:!1},this._lineRenderer=new o.HorizontalLineRenderer,this._invalidated=!0,this._series=e,this._model=e.model(),this._lineRenderer.setData(this._lineRendererData)}return e.prototype.update=function(){this._invalidated=!0},e.prototype.renderer=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._lineRenderer},e}()},"k9/m":function(e,t,i){"use strict";function n(e,t){return null===e?t:null===t?e:{min:Math.min(e.min,t.min),max:Math.max(e.max,t.max)}}function o(e,t){for(var i=function(e,t){var i=e.length,n=t.length,o=i+n,r=0,s=0;for(;rt[s].index?s++:(r++,s++,o--);return o}(e,t),n=new Array(i),o=0,r=0,s=e.length,a=t.length,l=0;ot[r].index?(n[l]=t[r],r++):(n[l]=t[r],o++,r++),l++;for(;o0?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,u.Exact)},e.prototype.valueAt=function(e){var t=this.search(e);return null!==t?t.value:null},e.prototype.add=function(e,t){var i,n;return this._shareRead?(c.logDebug("add: readonly collection modification attempt"),!1):(i={index:e,value:t},n=this._search(e,u.Exact),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear(),null===n?(this._items.splice(this._lowerbound(e),0,i),this._start=0,this._end=this._items.length,!0):(this._items[n]=i,!1))},e.prototype.search=function(e,t,i){var n,o,r,s,a,l;return void 0===t&&(t=u.Exact),n=void 0!==i?this._rowSearchCacheWithoutEmptyValues:this._rowSearchCache,o=void 0!==i?1e4*(t+1)+i:t,void 0!==(r=n.get(e))&&void 0!==(s=r.get(o))?s:null===(a=this._search(e,t,i))?null:(l={index:this._indexAt(a),value:this._valueAt(a)},void 0===r&&(r=new Map,n.set(e,r)),r.set(o,l),l)},e.prototype.fold=function(e,t){var i,n=t;for(i=this._start;i=r;--i)if(e(n=this._indexAt(i),o=this._valueAt(i)))return{index:n,value:o};return null},e.prototype.each=function(e){var t;for(t=this._start;tthis._items[this._items.length-1].index?this._append(e):1===e.length&&e[0].index===this._items[this._items.length-1].index?(this._updateLast(e[0]),e[0]):this._merge(e)},e.prototype.addTail=function(e,t){var i,n,o,r;for(void 0===t&&(t=!1),i=0,t&&this._end-this._start>0&&(i=1,this._items[this._end-this._start-1].value=e[0].value),n=i;n0?i[0]:null)},e.prototype.state=function(){return{start:this._start,end:this._end,data:this._items,shareread:this._shareRead}},e.prototype.restoreState=function(e){e?(this._start=e.start,this._end=e.end,this._shareRead=e.shareread,this._items=e.data,this._minMaxCache.clear(),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear()):this.clear()},e.prototype._indexAt=function(e){return this._items[e].index},e.prototype._valueAt=function(e){return this._items[e].value},e.prototype._length=function(){return this._items.length},e.prototype._search=function(e,t,i){var n=this._bsearch(e);if(null===n&&t!==u.Exact)switch(t){case u.NearestLeft:return this._searchNearestLeft(e,i);case u.NearestRight:return this._searchNearestRight(e,i);default:throw new TypeError("Unknown search mode")}if(void 0===i||null===n||t===u.Exact)return n;switch(t){case u.NearestLeft:return this._nonEmptyNearestLeft(n,i);case u.NearestRight:return this._nonEmptyNearestRight(n,i);default:throw new TypeError("Unknown search mode")}},e.prototype._nonEmptyNearestRight=function(e,t){for(var i=Object(r.ensure)(this._emptyValuePredicate),n=Object(r.ensure)(t);e=this._start&&i(this._valueAt(e),n);)e-=1;return ethis._start&&(n-=1),i=n!==this._end&&this._indexAt(n)e},this._start,this._end)},e.prototype._plotMinMax=function(e,t,i){var n,o,r=null,s=this._plotFunctions.get(i.name);if(void 0===s)throw new Error('Plot "'+i.name+'" is not registered');for(n=e;nr.max&&(r.max=o)));return r},e.prototype._invalidateCacheForRow=function(e){var t=Math.floor(e.index/h);this._minMaxCache.forEach(function(e){return e.delete(t)})},e.prototype._prepend=function(e){return Object(r.assert)(!this._shareRead,"collection should not be readonly"),Object(r.assert)(0!==e.length,"plotRows should not be empty"),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear(),this._minMaxCache.clear(),this._items=e.concat(this._items),this._start=0,this._end=this._items.length,e[0]},e.prototype._append=function(e){return Object(r.assert)(!this._shareRead,"collection should not be readonly"),Object(r.assert)(0!==e.length,"plotRows should not be empty"),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear(),this._minMaxCache.clear(),this._items=this._items.concat(e),this._start=0,this._end=this._items.length,e[0]},e.prototype._updateLast=function(e){Object(r.assert)(!this.isEmpty(),"plot list should not be empty");var t=this._items[this._end-1];Object(r.assert)(t.index===e.index,"last row index should match new row index"),this._invalidateCacheForRow(e),this._rowSearchCache.delete(e.index),this._rowSearchCacheWithoutEmptyValues.delete(e.index),this._items[this._end-1]=e},e.prototype._merge=function(e){return Object(r.assert)(0!==e.length,"plot rows should not be empty"),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear(),this._minMaxCache.clear(),this._items=o(this._items,e),this._start=0,this._end=this._items.length,e[0]},e.prototype._minMaxOnRangeCachedImpl=function(e,t,i){var o,s,a,l,c,u,d,p,_,f,m,y,g,v,S;if(this.isEmpty())return null;for(o=null,s=Object(r.ensureNotNull)(this.firstIndex()),a=Object(r.ensureNotNull)(this.lastIndex()),l=e-i.offset,c=t-i.offset,l=Math.max(l,s),c=Math.min(c,a),u=Math.ceil(l/h)*h,d=Math.max(u,Math.floor(c/h)*h),p=this._lowerbound(l),_=this._upperbound(Math.min(c,u,t)),o=n(o,this._plotMinMax(p,_,i)),void 0===(f=this._minMaxCache.get(i.name))&&(f=new Map,this._minMaxCache.set(i.name,f)),m=Math.max(u+1,l);mt-i.offset&&(o=n),this._plotMinMax(n,o,i)},e}()},kIXa:function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolTimeCycles";var r=t||n.createProperties();o.call(this,e,r),i.e("lt-pane-views").then(function(e){
+var t=i("am+t").TimeCyclesPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,s=i("hayr").propertyPages,a=window.t("Time Cycles");inherit(n,o),n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return a},n.prototype.name=function(){return"Time Cycles"},n.prototype.setPoint=function(e,t,i){var n=Object.assign({},t),o=this._points[0],r=this._points[1];o.price=n.price,r.price=n.price,this._points[e]=n,this.normalizePoints()},n.prototype.addPoint=function(e,t,i){var n,r=o.prototype.addPoint.call(this,e,t,!0);return r&&(n=this._points[0],this._points[1].price=n.price,i||(this.normalizePoints(),this.createServerPoints())),r},n.prototype.getStylesPropertyPage=function(){return s.LineToolTimeCyclesPropertyPage},n.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(13),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("BABJ").TimeCyclesPatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},n.createProperties=function(e){var t=new r("linetooltimecycles",e);return n._configureProperties(t),t},n._configureProperties=function(e){o._configureProperties(e)},t.LineToolTimeCycles=n},kSsA:function(e,t,i){"use strict";t.createInputsPropertyPage=function(e,t){var i=e.getInputsPropertyPage();return null==i?null:new i(e.properties(),t,e)},t.createStudyStrategyPropertyPage=function(e,t){var i=e.getStrategyPropertyPage();return null==i?null:new i(e.properties(),t,e)},t.createStylesPropertyPage=function(e,t){var i=e.getStylesPropertyPage();return null==i?null:new i(e.properties(),t,e)},t.createDisplayPropertyPage=function(e,t){var i=e.getDisplayPropertyPage();return null==i?null:new i(e.properties(),t,e)},t.createVisibilitiesPropertyPage=function(e,t){var i=e.getVisibilitiesPropertyPage();return null==i?null:new i(e.properties(),t,e)},t.hasInputsPropertyPage=function(e){return null!==e.getInputsPropertyPage()},t.hasStylesPropertyPage=function(e){return null!==e.getStylesPropertyPage()}},kcTO:function(e,t,i){"use strict";function n(e,t){if(!Object(r.isNumber)(e))return"n/a";if(!Object(r.isInteger)(t))throw new TypeError("invalid length");if(t<0||t>16)throw new TypeError("invalid length");if(0===t)return e.toString();return("0000000000000000"+e.toString()).slice(-t)}var o,r,s,a,l,c,u,h,d;i.r(t),i.d(t,"customFormatters",function(){return c}),i.d(t,"formatterOptions",function(){return u}),i.d(t,"numberToStringWithLeadingZero",function(){return n}),i.d(t,"PriceFormatter",function(){return d}),o=i("YFKU"),r=i("ogJP"),s=i("Ialn"),a=i("uOxu"),l=Object(a.getLogger)("Chart.PriceFormatter"),c={dateFormatter:null,timeFormatter:null},u={decimalSign:".",decimalSignFractional:"'"},h={custom:o.t("Price format is invalid."),fraction:o.t("Fraction part is invalid."),secondFraction:o.t("Second fraction part is invalid.")},d=function(){function e(e,t,i,n){if(this.type="price",t||(t=1),Object(r.isNumber)(e)&&Object(r.isInteger)(e)||(e=100),e<0)throw new TypeError("invalid base")
+;this._priceScale=e,this._minMove=t,this._minMove2=n,i&&void 0!==n&&n>0&&2!==n&&4!==n&&8!==n?l.logDebug("invalid minmove2"):(this._fractional=i,this.calculateDecimal())}return e.prototype.isFractional=function(){return!!this._fractional},e.prototype.state=function(){return{fractional:this._fractional,fractionalLength:this._fractionalLength,minMove:this._minMove,minMove2:this._minMove2,priceScale:this._priceScale}},e.prototype.calculateDecimal=function(){if(this._fractionalLength=0,this._priceScale>0&&this._minMove>0){var e=this._priceScale;for(this._fractional&&this._minMove2&&(e/=this._minMove2);e>1;)e/=10,this._fractionalLength++}},e.prototype.format=function(e,t,i,n,o){var r,a;return void 0===n&&(n=!0),void 0===o&&(o=!0),r="",e<0?(r=!1===n?"":"−",e=-e):e&&!0===t&&(r="+"),a=this._fractional?r+this._formatAsFractional(e,i):r+this._formatAsDecimal(e,i),o?Object(s.forceLTRStr)(a):a},e.prototype.parse=function(e){return e=(e=Object(s.stripLTRMarks)(e)).replace("−","-"),this._fractional?this._minMove2?this._parseAsDoubleFractional(e):this._parseAsSingleFractional(e):this._parseAsDecimal(e)},e.prototype.hasForexAdditionalPrecision=function(){return!this._fractional&&10===this._minMove2},e.serialize=function(e){return e.state()},e.deserialize=function(t){return new e(t.priceScale,t.minMove,t.fractional,t.minMove2)},e.prototype._formatAsDecimal=function(e,t){var i,o,r,s,a;return t=t||0,i=this._fractional?Math.pow(10,this._fractionalLength||0):Math.pow(10,t)*this._priceScale/this._minMove,o=Math.floor(e),(r=+(Math.round(e*i)-o*i).toFixed(this._fractionalLength))>=i&&(r-=i,o+=1),s="",1!==i&&(a=void 0!==this._fractionalLength?this._fractionalLength:NaN,s=u.decimalSign+n(+r.toFixed(this._fractionalLength)*this._minMove,a+t),s=this._removeEndingZeros(s,t)),o.toString()+s},e.prototype._getFractPart=function(e,t){var i=[0,5],n=[0,2,5,7];return 2===t?void 0===i[e]?-1:i[e]:4===t?void 0===n[e]?-1:n[e]:e},e.prototype._formatAsFractional=function(e,t){var i,o,r,s,a,l,c=this._priceScale/this._minMove,h=Math.floor(e),d=t?Math.floor(e*c)-h*c:Math.round(e*c)-h*c;if(d===c&&(d=0,h+=1),i="",t&&(o=(e-h-d/c)*c,i=n(o=Math.round(o*Math.pow(10,t)),t),i=this._removeEndingZeros(i,t)),!this._fractionalLength)throw new Error("_fractionalLength is not calculated");return r="",this._minMove2?(a=n(d=(d-(s=d%this._minMove2))/this._minMove2,this._fractionalLength),l=this._getFractPart(s,this._minMove2),r=a+u.decimalSignFractional+l):r=n((d=this._getFractPart(d,this._priceScale))*this._minMove,this._fractionalLength),h.toString()+u.decimalSignFractional+r+i},e.prototype._removeEndingZeros=function(e,t){for(var i=0;i=o||r<0?{error:h.fraction,res:!1}:(t=n+r/o,i&&(t=-t),{price:t,res:!0,suggest:this.format(t)})):{error:h.custom,res:!1}},e.prototype._parseAsDoubleFractional=function(e){var t,i,n,o,r,s,a,l,c=new RegExp(/^(\-?)[0-9]+$/),d=c.exec(e);return d?{price:t=parseFloat(e),res:!0,suggest:this.format(t)}:(d=new RegExp("^(-?)([0-9]+)\\"+u.decimalSignFractional+"([0-9]+)\\"+u.decimalSignFractional+"([0-9]+)$").exec(e))?(i=!!d[1],n=parseInt(d[2]),o=void 0!==this._minMove2?this._minMove2:NaN,r=this._priceScale/o,s=this._minMove2,a=this._patchFractPart(parseInt(d[3]),r),l=this._patchFractPart(parseInt(d[4]),s),a>=r||a<0?{error:h.fraction,res:!1}:void 0!==s&&l>=s||l<0?{error:h.secondFraction,res:!1}:(t=void 0!==s?n+a/r+l/(r*s):NaN,i&&(t=-t),{price:t,res:!0,suggest:this.format(t)})):{error:h.custom,res:!1}},e}()},kw0O:function(e,t,i){"use strict";function n(e){return"black"===Object(o.rgbToBlackWhiteString)(Object(o.parseRgb)(e),150)?"white":"black"}var o;i.d(t,"a",function(){return n}),o=i("eJTA")},l4sv:function(e,t,i){"use strict";var n,o,r;i.r(t),i.d(t,"HorizontalLineRenderer",function(){return r}),n=i("VdBB"),o=i("jFln"),r=function(){function e(){this._data=null,this._hitTest=new n.HitTestResult(n.HitTestResult.REGULAR)}return e.prototype.setData=function(e){this._data=e},e.prototype.setHitTest=function(e){this._hitTest=e},e.prototype.draw=function(e){var t,i;null!==this._data&&0!==this._data.points.length&&!1!==this._data.visible&&((t=this._data.points[0].y)<0||t>this._data.height||(i=this._data.width,e.lineCap="square",e.strokeStyle=this._data.color,e.lineWidth=this._data.linewidth,void 0!==this._data.linestyle&&Object(o.setLineStyle)(e,this._data.linestyle),Object(o.drawLine)(e,0,t,i,t)))},e.prototype.hitTest=function(e){return null===this._data||!1===this._data.visible?null:0===this._data.points.length?null:Math.abs(e.y-this._data.points[0].y)<=5?this._hitTest:null},e}()},l7mP:function(e,t,i){"use strict";function n(e,t,n){void 0===t&&(t={}),Promise.all([i.e("react"),i.e(2),i.e(20),i.e(28),i.e(31),i.e(50),i.e(67),i.e(0),i.e(45),i.e("take-chart-image-dialog-impl")]).then(function(o){i("fMMV").getImageOfChart(e,t,n)}.bind(null,i)).catch(void 0)}function o(e,t,n){void 0===t&&(t={}),Promise.all([i.e("react"),i.e(2),i.e(20),i.e(28),i.e(31),i.e(50),i.e(67),i.e(0),i.e(45),i.e("take-chart-image-dialog-impl")]).then(function(o){i("fMMV").getImageOfChartSilently(e,t,n)}.bind(null,i)).catch(void 0)}i.r(t),i.d(t,"getImageOfChart",function(){return n}),i.d(t,"getImageOfChartSilently",function(){return o})},lA7n:function(e,t,i){"use strict";var n,o,r,s,a,l,c,u,h;i.r(t),n=i("Kxc7"),o=i("mrSG"),r=i("ulZB"),s=function(e){function t(t,i){
+return e.call(this,t,i,"FAVORITE_CHARTS_CHANGED","loadChartDialog.favorites",{})||this}return Object(o.__extends)(t,e),t}(r.b),a=i("zUrt"),l=i("FBuY"),c=i("Vdly"),u=i("/z0S"),i.d(t,"LoadChartService",function(){return h}),h=function(){function e(e){var t=this;void 0===e&&(e=null),this._favoriteChartsService=new s(l.TVXWindowEvents,c),this._chartWidgetCollection=null,this._promise=null,this._getChartEntry=function(e){return{id:e.id,url:e.url,title:e.name,symbol:e.short_symbol,interval:e.interval,toolsCount:0,modified:e.modified_iso,active:function(){return t._isActiveChart(e.id)},openAction:function(){return a.backend.loadChart(e)},deleteAction:function(){return new Promise(function(i){a.backend.removeChart(e.image_url,function(){t._deleteChart(e.id),i()})})},favoriteAction:t._updateFavorites}},this._updateFavorites=function(e){return t._favoriteChartsService.set(e)},this._isActiveChart=function(e){return null!==t._chartWidgetCollection&&e===t._chartWidgetCollection.metaInfo.id.value()},this._deleteChart=function(e){t._isActiveChart(e)&&(n.enabled("saveload_storage_customization")?null!==t._chartWidgetCollection&&t._chartWidgetCollection.clearChartMetaInfo():location.href="/chart/"+location.search)},this._chartWidgetCollection=e}return e.prototype.showLoadDialog=function(){Object(u.a)(this._showLoadDialog.bind(this),{source:"Load chart",sourceMeta:"Chart"})},e.prototype._showLoadDialog=function(){var e=this;(n.enabled("saveload_requires_authentication")&&!window.is_authenticated?Promise.resolve([]):new Promise(function(e){a.backend.getCharts(function(t){e(t)})})).then(function(t){return t.map(e._getChartEntry)}).then(function(t){var n=e._promise=Promise.all([i.e("react"),i.e(2),i.e(3),i.e(5),i.e(6),i.e(7),i.e(62),i.e(0),i.e(1),i.e(4),i.e(10),i.e(24),i.e("load-chart-dialog")]).then(i.bind(null,"AMW5")).then(function(i){e._promise===n&&i.showLoadChartDialog(t,e._favoriteChartsService,e._chartWidgetCollection)})})},e}()},lCO3:function(e,t,i){"use strict";var n,o;i.r(t),i.d(t,"Version",function(){return o}),n=i("Eyy1"),o=function(){function e(e,t){this._major=e,this._minor=t}return e.prototype.major=function(){return this._major},e.prototype.minor=function(){return this._minor},e.prototype.isZero=function(){return 0===this._major&&0===this._minor},e.prototype.toString=function(){return this._major+"."+this._minor},e.prototype.compareTo=function(e){return this._majore._major?1:this._minore._minor?1:0},e.prototype.isLess=function(e){return this.compareTo(e)<0},e.prototype.isLessOrEqual=function(e){return this.compareTo(e)<=0},e.prototype.isEqual=function(e){return 0===this.compareTo(e)},e.prototype.isGreater=function(e){return this.compareTo(e)>0},e.prototype.isGreaterOrEqual=function(e){return this.compareTo(e)>=0},e.parse=function(t){var i,o,r;if(t instanceof e)return new e(t.major(),t.minor());if("number"==typeof t)return Object(n.assert)(Math.floor(t)===t,"Version should not be a float number"),new e(t,0);if("string"==typeof t){
+if(1===(i=t.split(".")).length)return o=parseInt(i[0],10),Object(n.assert)(!isNaN(o),"Bad version string: "+t),new e(o,0);if(2===i.length)return o=parseInt(i[0],10),Object(n.assert)(!isNaN(o),"Bad version string: "+t),r=parseInt(i[1],10),Object(n.assert)(!isNaN(r),"Bad version string: "+t),new e(o,r);throw new Error("Bad version string (one dot expected): "+t)}throw new Error("Bad version: "+t)},e.ZERO=new e(0,0),e}()},lJvs:function(e,t,i){"use strict";function n(e){a.call(this,e);var t=this;l.hideMarksOnBars().subscribe(this,function(){t._properties.visible.setValue(!l.hideMarksOnBars().value())}),this._paneView=new o(this)}function o(e,t){this.source=e,this._rendererFactory=t,this.stylesCache={},this.templatesCache={},this._lollipops={},this._createLollipops()}var r=i("aO4+").Point,s=i("vAx0").ESDPaneView,a=i("fTGZ").BarsMarksContainer,l=i("mMWL"),c=i("FQhm"),u=i("6xeX").Tooltip,h=i("zDbI").CHART_FONT_FAMILY;inherit(n,a),n.prototype._initialize=function(e){this._properties.visible.setValue(!0)},n.prototype.userEditEnabled=function(){return!1},n.prototype._constructor="UserDefinedTimescaleMarks",n.prototype._plateViewData=function(e){return{text:e.text}},n.prototype.onClicked=function(e){c.emit("onTimescaleMarkClick",e.id)},n.prototype.clearMarks=function(){a.prototype.clearMarks.call(this),this._paneView.clearCaches(),this.onNeedRepaint.fire()},n.prototype._getData=function(e){var t,i,n,o=this._model.mainSeries().symbolInfo();o&&(t=this.roundRange(this._rangeDifference(e)),i=this,n=this._model.mainSeries().properties().interval.value(),ChartApiInstance.getTimescaleMarks(o,t.start,t.end,function(t){t.forEach(function(e){i._marks[e.id]=e},i),i._loadedRange=i._rangeUnion(e,i._loadedRange),i.onNeedRepaint.fire()},n))},n.prototype.updatePlateData=function(e,t){return t.barWidth=this.barWidth(),t.text=e.text,t.tooltipMargin=-1*Math.max(e.minSize/2,.4*this.barWidth()),t},n.prototype.hasContextMenu=function(){return!1},n.prototype.paneViews=function(){return this._properties.visible.value()?[this._paneView]:[]},n.prototype.onClickOutside=function(e){this._paneView.onClickOutside(e)},inherit(o,s),o.prototype._createLollipops=function(){var e=this.source._model.timeScale(),t=s.prototype._getY.call(this.source),i=this.source._model.lastHittestData(),n=this;Object.keys(this.source._marks).forEach(function(o){var s=this.source._marks[o],a=s.id;n._lollipops[a]={id:a,basePoint:new r(e.indexToCoordinate(e.timePointToIndex(s.tickmark))+1,t),hovered:i&&i.id===a||a===n.getLastClickedLollipopId(),barY:null,label:s.label,color:s.color,items:s.tooltip,tooltip:n._lollipops.hasOwnProperty(a)?n._lollipops[a].tooltip:new u,visible:!0}},this)},o.prototype.clearCaches=function(){this.closeTooltips(),this.clearLastClicked(),this._lollipops={}},o.prototype.update=function(){this._createLollipops()},o.prototype.renderer=function(){return this.update(),s.prototype.renderer.call(this)},o.prototype._generateTemplateStyle=function(e,t,i){var n,o,r=e+t+i;return r in this.stylesCache||(n="default"!==e,o={strokeStyle:t,lineWidth:1,fillStyle:"white",
+barLine:{lineStyle:CanvasEx.LINESTYLE_DASHED},lollipop:{width:32,height:96,circleHeight:16,radius:12,lineWidth:1.5,fillStyle:n?t:"white",fillCircle:n,strokeStyle:"#E2745B",text:{label:i,strokeStyle:n?"white":t,font:"normal 12px "+h}}},this.stylesCache[r]=o),this.stylesCache[r]},o.prototype.getTemplate=function(e,t){var i=e+t.color+t.label;return i in this.templatesCache||(this.templatesCache[i]=this.createTemplate(this._generateTemplateStyle(e,t.color,t.label))),this.templatesCache[i]},o.prototype.getStyle=function(e,t){return this._generateTemplateStyle(e,t.color,t.label)},o.prototype.createText=function(e,t){"string"==typeof e.items?t.addTextLine(e.items):Array.isArray(e.items)&&e.items.forEach(function(e){t.addTextLine(e)})},o.prototype.hasTooltip=function(e){return!!e.tooltip&&e.tooltip.length},e.exports=n},"lNN+":function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolTrianglePattern";var r=t||n.createProperties();o.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("Jej9").LineToolTrianglePatternPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,s=i("hayr").propertyPages,a=window.t("Triangle Pattern");inherit(n,o),n.prototype.pointsCount=function(){return 4},n.prototype.title=function(){return a},n.prototype.name=function(){return"Triangle Pattern"},n.prototype.getStylesPropertyPage=function(){return s.LineToolTrianglePatternStylesPropertyPage},n.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(13),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("EFc4").Points5PatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},n.createProperties=function(e){var t=new r("linetooltrianglepattern",e);return n._configureProperties(t),t},n._configureProperties=function(e){o._configureProperties(e)},t.LineToolTrianglePattern=n},lReN:function(e,t,i){"use strict";var n,o,r,s;i.r(t),i.d(t,"LineToolsGroupControllerApi",function(){return s}),n=i("s1Gx"),o=i("Eyy1"),r=i("CW80"),s=function(){function e(e,t){this._controller=e,this._model=t}return e.prototype.createGroupFromSelection=function(){return this._controller.createGroupFromSelection().id},e.prototype.removeGroup=function(e){var t=Object(o.ensureDefined)(this._groupById(e));this._controller.removeGroup(t)},e.prototype.groups=function(){return this._controller.groups().map(function(e){return e.id})},e.prototype.shapesInGroup=function(e){var t=Object(o.ensureDefined)(this._groupById(e));return Object(n.sortSources)(t.lineTools()).map(function(e){return e.id()})},e.prototype.excludeShapeFromGroup=function(e,t){var i=Object(o.ensureDefined)(this._groupById(e)),n=Object(o.ensureNotNull)(this._model.dataSourceForId(t));Object(o.assert)(Object(r.isLineTool)(n),"Passed shapeId is not a line tool"),this._controller.excludeLineToolFromGroup(i,n)},e.prototype.availableZOrderOperations=function(e){var t=Object(o.ensureDefined)(this._groupById(e));return this._controller.availableZOrderOperations(t)},
+e.prototype.bringToFront=function(e){var t=Object(o.ensureDefined)(this._groupById(e));this._controller.bringToFront(t)},e.prototype.bringForward=function(e){var t=Object(o.ensureDefined)(this._groupById(e));this._controller.bringForward(t)},e.prototype.sendBackward=function(e){var t=Object(o.ensureDefined)(this._groupById(e));this._controller.sendBackward(t)},e.prototype.sendToBack=function(e){var t=Object(o.ensureDefined)(this._groupById(e));this._controller.sendToBack(t)},e.prototype.insertAfter=function(e,t){var i=Object(o.ensureDefined)(this._groupById(e)),n=Object(o.ensureNotNull)(this._groupById(t)||this._model.dataSourceForId(t));this._controller.insertAfter(i,n)},e.prototype.insertBefore=function(e,t){var i=Object(o.ensureDefined)(this._groupById(e)),n=Object(o.ensureNotNull)(this._groupById(t)||this._model.dataSourceForId(t));this._controller.insertBefore(i,n)},e.prototype.groupVisibility=function(e){return Object(o.ensureDefined)(this._groupById(e)).visibility()},e.prototype.setGroupVisibility=function(e,t){var i=Object(o.ensureDefined)(this._groupById(e));this._controller.setGroupVisibility(i,t)},e.prototype.groupLock=function(e){return Object(o.ensureDefined)(this._groupById(e)).locked()},e.prototype.setGroupLock=function(e,t){var i=Object(o.ensureDefined)(this._groupById(e));this._controller.setGroupLock(i,t)},e.prototype.getGroupName=function(e){return Object(o.ensureDefined)(this._groupById(e)).name()},e.prototype.setGroupName=function(e,t){var i=Object(o.ensureDefined)(this._groupById(e));this._controller.setGroupName(i,t)},e.prototype.canBeGroupped=function(e){var t=this,i=e.map(function(e){return Object(o.ensureNotNull)(t._model.dataSourceForId(e))});return!i.some(function(e){return!Object(r.isLineTool)(e)})&&this._controller.canBeGroupped(i)},e.prototype._groupById=function(e){return this._controller.groups().find(function(t){return t.id===e})},e}()},lTLF:function(e,t,i){"use strict";var n,o,r,s,a;i.r(t),n=i("Hr11"),o=1e-9,r=function(){function e(e,t){if(this._base=e,this._integralDividers=t,Object(n.isBaseDecimal)(this._base))this._fractionalDividers=[2,2.5,2];else{this._fractionalDividers=[];for(var i=this._base;1!==i;){if(i%2==0)this._fractionalDividers.push(2),i/=2;else{if(i%5!=0)throw new Error("unexpected base");this._fractionalDividers.push(2),this._fractionalDividers.push(2.5),i/=5}if(this._fractionalDividers.length>100)throw new Error("something wrong with base")}}}return e.prototype.tickSpan=function(e,t,i){for(var r,s,a,l=0===this._base?0:1/this._base,c=o,u=Math.pow(10,Math.max(0,Math.ceil(Object(n.log10)(e-t)))),h=0,d=this._integralDividers[0];r=Object(n.greaterOrEqual)(u,l,c)&&u>l+c,s=Object(n.greaterOrEqual)(u,i*d,c),a=Object(n.greaterOrEqual)(u,1,c),r&&s&&a;)u/=d,d=this._integralDividers[++h%this._integralDividers.length];if(u<=l+c&&(u=l),u=Math.max(1,u),this._fractionalDividers.length>0&&Object(n.equal)(u,1,c))for(h=0,d=this._fractionalDividers[0];Object(n.greaterOrEqual)(u,i*d,c)&&u>l+c;)u/=d,d=this._fractionalDividers[++h%this._fractionalDividers.length];return u},e}(),
+i.d(t,"PriceTickMarkBuilder",function(){return a}),s=2.5,a=function(){function e(e,t,i,n){this._marks=[],this._priceScale=e,this._base=t,this._coordinateToLogicalFunc=i,this._logicalToCoordinateFunc=n}return e.prototype.base=function(){return this._base},e.prototype.setBase=function(e){if(e<0)throw new Error("base < 0");this._base=e},e.prototype.tickSpan=function(e,t,i){var n,o,s,a,l,c,u,h,d;if(void 0===i&&(i=0),ei&&(c=u),(h=a.tickSpan(e,t,o))>i&&(c=Math.min(c,h)),(d=l.tickSpan(e,t,o))>i&&(c=Math.min(c,d)),c>0?c:e-t},e.prototype.rebuildTickMarks=function(){var e,t,i,n,o,r,s,a,l,c,u,h,d,p,_,f=this._priceScale;if(this._marks=[],!f.isEmpty()&&null!==(e=f.mainSource())&&(null===(t=e.firstValue())&&(t=0),i=f.height(),n=this._coordinateToLogicalFunc(i-1,t),o=this._coordinateToLogicalFunc(0,t),(r=Math.max(n,o))!==(s=Math.min(n,o))))for(l=r%(a=this.tickSpan(r,s)),l+=l<0?a:0,c=r>=s?1:-1,u=null,h=f.formatter(),d=NaN,p=r-l;p>s;p-=a)p===d&&(a=this.tickSpan(r,s,a)),d=p,_=this._logicalToCoordinateFunc(p,t,!0),null!==u&&Math.abs(_-u)0;)if(!(o=e._groups[n]).isDisabled()){if(o.handleHotkey(i,t))return;if(o.modal)return}},this._keyUpListener=function(t){var i=Object(s.hashFromEvent)(t);e._pressedKeys.setValue(i)},this._blurEvent=function(){e._pressedKeys.setValue(0)},this._mouseEvent=function(t){var i=Object(s.modifiersFromEvent)(t),n=255&e._pressedKeys.value();e._pressedKeys.setValue(i|n)}}return e.prototype.listen=function(e){e.addEventListener("keydown",this._keyDownListener),e.addEventListener("keyup",this._keyUpListener),e.addEventListener("blur",this._blurEvent),e.addEventListener("mousemove",this._mouseEvent)},e.prototype.unlisten=function(e){e.removeEventListener("keydown",this._keyDownListener),e.removeEventListener("keyup",this._keyUpListener),e.removeEventListener("blur",this._blurEvent),e.removeEventListener("mousemove",this._mouseEvent)},e.prototype.registerGroup=function(e){this._groups.push(e)},e.prototype.unregisterGroup=function(e){for(var t=this._groups.length;t--;)this._groups[t]===e&&this._groups.splice(t,1)},e.prototype.promoteGroup=function(e){var t,i=this._groups.length-1;for(t=this._groups.length;t--;){if(this._groups[t]===e)return void(t!==i&&(this._groups.splice(t,1),this._groups.splice(i,0,e)));this._groups[t].modal&&(i=t-1)}},e.prototype.pressedKeys=function(){return this._pressedKeys},e}(),h=i("PC8g"),d=function(){function e(e,t){this._group=e,this.hotkey=t.hotkey,this.handler=t.handler,this.desc=t.desc,this.element=t.element||null,t.isDisabled?"function"==typeof t.isDisabled?this.isDisabled=t.isDisabled:this.isDisabled=function(){return!0}:this.isDisabled=function(){return!1}}return e.prototype.destroy=function(){this._group&&(this._group.remove(this),this._group=null)},e}(),p=function(){function e(e,t){this._actions=[],this._manager=e,this.modal=!(!t||!t.modal),t&&(this.desc=t.desc),t&&t.isDisabled?"function"==typeof t.isDisabled?this.isDisabled=t.isDisabled:this.isDisabled=function(){return!0}:this.isDisabled=function(){return!1},this._manager.registerGroup(this)}return e.prototype.add=function(e){var t=new d(this,e);return this._actions.push(t),t},e.prototype.remove=function(e){for(var t=this._actions.length;t-- >0;)this._actions[t]===e&&this._actions.splice(t,1)},e.prototype.handleHotkey=function(e,t){var i,n;for(i=this._actions.length;i-- >0;)if((n=this._actions[i]).hotkey===e&&(!n.element||t.target&&n.element.contains(t.target))&&!n.isDisabled())return n.handler(t),t.preventDefault(),Object(h.trackEvent)("Keyboard Shortcuts",Object(s.humanReadableHash)(e)),!0;return!1},e.prototype.promote=function(){this._manager.promoteGroup(this)},e.prototype.destroy=function(){this._actions.length=0,this._manager.unregisterGroup(this)},e}(),i.d(t,"pressedKeys",function(){return f}),i.d(t,"createGroup",function(){return n}),i.d(t,"registerWindow",function(){return o}),i.d(t,"unregisterWindow",function(){return r}),
+i.d(t,"Modifiers",function(){return s.Modifiers}),_=new u,f=_.pressedKeys(),o(window)},"m/cY":function(e,t,i){"use strict";function n(e){return new r.a(e)}var o,r;i.d(t,"a",function(){return n}),o=i("tc+8"),r=i.n(o)},mE5r:function(e,t,i){"use strict";function n(e){return e/11}var o,r,s,a,l,c,u,h,d,p,_,f,m,y,g,v,S,b,w,P,C,T;i.r(t),o=i("mrSG"),r=i("Eyy1"),s=i("ikwP"),a=i("i1o5"),l=i("aO4+"),c=i("XlJ7"),u=i("EsvI"),h=i("OsWk"),d=i("rL76"),p=i("zDbI"),_=parseInt(d.labelheight),f=parseInt(d.bottommargin),m=function(){function e(){this._wrapper=document.createElement("div"),this._element=document.createElement("div"),this._labelElement=document.createElement("div"),this._gearElement=document.createElement("div"),this._currentScale=1,this._info=null,this._mode="auto",this._wrapper.appendChild(this._element),this._wrapper.classList.add(d.wrapper),this._element.classList.add(d.label),this._labelElement.className=d.symbol,this._element.appendChild(this._labelElement),this._gearElement.className=d.gear,this._gearElement.innerHTML=h,this._element.appendChild(this._gearElement)}return e.prototype.getElement=function(){return this._wrapper},e.prototype.setMode=function(e){this._mode!==e&&(this._mode=e)},e.prototype.align=function(e,t){var i=n(t);Math.abs(i-this._currentScale)>.1&&(this._currentScale=i,Math.abs(this._currentScale-1)>.1?this._element.style.transform="scale("+this._currentScale+")":(this._currentScale=1,this._element.style.transform=""))},e.prototype.drawLabelForScreenshot=function(e,t){var i,o,r;null!==this._info&&"gear"!==this._mode&&(i=Object(c.makeFont)(t.fontSize,p.CHART_FONT_FAMILY),e.fillStyle=u.themes[t.theme].getThemedColor("color-price-axis-label-back"),e.globalAlpha=.5,e.beginPath(),o=n(t.fontSize)*_/2,r=Object(l.point)(t.offset+t.width/2,t.height/2),e.arc(r.x,r.y,o,0,2*Math.PI,!0),e.fill(),e.globalAlpha=1,e.fillStyle=u.themes[t.theme].getThemedColor("color-price-axis-label-text"),e.textAlign="center",e.font=i,e.textBaseline="middle",e.fillText(this._info.label,r.x,r.y))},e.prototype.setAxisNameInfo=function(e){this._info=e,null!==e&&(this._labelElement.textContent=e.label)},e.height=function(e){return(_+f)*e},e}(),y=i("aIyQ"),g=i.n(y),v=i("S8xo"),S=i("5VQP"),b=i("ljE9"),w={enableTooltip:!0,showLabels:!0,enableMenu:!0,enableHighlight:!0},P=function(){function e(e,t,i,n,r){var a=this;this._invalidated=!0,this._size=new s.Size(0,0),this._offset=0,this._axisInfo=null,this._onLabelHovered=new g.a,this._highlighted=!1,this._labelMode="auto",this._fixedLabelMode=null,this._isLeft="left"===e,this._rendererOptionsProvider=n.rendererOptionsProvider,this._sourcesTitlesProvider=n.sourcesTitlesProvider,this._contextMenuItemsProvider=n.contextMenuItemsProvider,this._backgroundBasedTheme=n.backgroundBasedTheme,this._properties=t,this._axisInfo=i,this._labelOptions=Object(o.__assign)(Object(o.__assign)({},w),r),this._properties.backgroundColor.subscribe(this,this._onPropertyChanged),this._properties.lineColor.subscribe(this,this._onPropertyChanged),this._cell=document.createElement("div"),
+this._cell.classList.add(d["price-axis-stub"]),this._labelOptions.enableTooltip&&this._cell.classList.add("apply-common-tooltip","common-tooltip-html"),this._cell.style.width="25px",this._cell.style.height="100%",this._cell.style.position="absolute",this._cell.style.left="0",this._cell.style.overflow="hidden",this._labelOptions.showLabels?(this._label=new m,this._label.setAxisNameInfo(this._axisInfo),this._cell.appendChild(this._label.getElement()),this._labelOptions.enableTooltip&&Object(b.b)(this._cell,"text",function(e){return a._tooltipContent()})):this._label=null,this._mouseEventHandler=new v.MouseEventHandler(this._cell,this,{treatHorzTouchDragAsPageScroll:!0,treatVertTouchDragAsPageScroll:!0}),this._canvas=Object(s.addCanvasTo)(this._cell,new s.Size(16,16)),this._canvas.style.position="absolute",this._canvas.style.left="0",this._canvas.style.top="0",this._ctx=this._canvas.getContext("2d")}return e.prototype.destroy=function(){this._properties.backgroundColor.unsubscribe(this,this._onPropertyChanged),this._properties.lineColor.unsubscribe(this,this._onPropertyChanged),this._mouseEventHandler.destroy(),$(this._cell).remove()},e.prototype.mouseEnterEvent=function(e){null!==this._label&&"symbol"!==this._labelMode&&this._labelOptions.enableHighlight&&this._setHighlighted(!0)},e.prototype.mouseLeaveEvent=function(e){"symbol"!==this._labelMode&&this._setHighlighted(!1)},e.prototype.mouseDownEvent=function(e){var t=this;null===this._fixedLabelMode&&"symbol"!==this._labelMode&&this._labelOptions.enableMenu&&this._labelOptions.showLabels?(this._fixedLabelMode=this._labelMode,this.setLabelMode("gear"),S.ContextMenuManager.createMenu(this._contextMenuItemsProvider(),{statName:"PriceScaleLabelContextMenu"},function(){t.setLabelMode(Object(r.ensureNotNull)(t._fixedLabelMode)),t._fixedLabelMode=null}).then(function(e){return e.show(function(e,i){var n=t._cell.getBoundingClientRect();return{clientX:t._isLeft?n.left:n.right-e,clientY:n.top-Math.min(i,n.top),overrideHeight:n.top")},e}(),C=i("Daqx"),i.d(t,"PriceAxisesContainer",function(){return T}),T=function(){function e(e,t,i,n,r,a){this._axises=[],this._stubs=[],this._size=new s.Size(0,0),this._onLabelHovered=new g.a,this._scalesProperties=t,this._priceAxisWidgetFactory=n,this._rendererOptionsProvider=r.rendererOptionsProvider,this._titlesProvider=r.titlesProvider,this._contentMenuProvider=r.contentMenuProvider,this._backgroundBasedTheme=r.backgroundBasedTheme,this._labelsOptions=Object(o.__assign)(Object(o.__assign)({},w),a),this._stubProperties={lineColor:this._scalesProperties.lineColor,backgroundColor:e,fontSize:t.fontSize},this._side=i,this._cell=document.createElement("td"),this._cell.classList.add("chart-markup-table","price-axis-container"),this._cell.style.width="25px",this._cell.style.position="relative"}return e.prototype.destroy=function(){this.setScales([],0,0,0)},e.prototype.onLabelHovered=function(){return this._onLabelHovered},e.prototype.setScales=function(e,t,i,n){for(var o,s,a,l,c,u,h,d,p=this;e.length>this._axises.length&&this._axises.lengthc;)(u=Object(r.ensureDefined)(this._stubs.pop())).onLabelHovered().unsubscribeAll(this),this._cell.removeChild(u.getElement()),u.destroy();for(h=function(){var e=d._labelsOptions.showLabels?Object(C.getPriceAxisNameInfo)(d._side,d._stubs.length):null,t=d._stubs.length,i=new P(d._side,d._stubProperties,e,d._stubParams(t),d._labelsOptions);i.onLabelHovered().subscribe(d,function(t){p._labelsOptions.showLabels&&p._labelsOptions.enableHighlight&&p._onLabelHovered.fire(Object(r.ensureNotNull)(e),t)}),d._stubs.push(i),d._cell.appendChild(i.getElement())},d=this;this._stubs.length1,"Unable to change pane's height if there is only one pane"),t=r.indexOf(this._pane),Object(n.assert)(-1!==t,"Invalid pane index"),i=new c(o,t,e),this._chartWidget.model().undoHistory().pushUndoCommand(i)},e.prototype.moveTo=function(e){var t=this.paneIndex();t!==e&&(Object(n.assert)(e>=0&&e